8 #define RZCOLOR_AT(i) (RzColor *)(((ut8 *)&(rz_cons_singleton()->context->cpal)) + keys[i].coff)
9 #define COLOR_AT(i) (char **)(((ut8 *)&(rz_cons_singleton()->context->pal)) + keys[i].off)
122 static inline ut8 rgbnum(
const char ch1,
const char ch2) {
133 for (
int i = 0;
keys[
i].name;
i++) {
148 ctx->pal.rainbow[
n++] = (
char *)(*
iter);
150 ctx->pal.rainbow_sz =
n;
249 for (
i = 0;
keys[
i].name;
i++) {
263 dst->pal.rainbow_sz = 0;
273 for (
i = 0;
keys[
i].name;
i++) {
296 bgcolor = strchr(fgcolor + 1,
' ');
300 attr = strchr(bgcolor,
' ');
307 if (!strcmp(fgcolor,
"random")) {
312 }
else if (!strncmp(fgcolor,
"#", 1)) {
313 if (strlen(fgcolor) == 7) {
316 eprintf(
"Error while parsing HTML color: %s\n", fgcolor);
322 eprintf(
"Invalid html color code\n");
324 }
else if (!strncmp(fgcolor,
"rgb:", 4)) {
325 if (strlen(fgcolor) == 7) {
332 }
else if (strlen(fgcolor) == 10) {
342 if (bgcolor && !strncmp(bgcolor,
"rgb:", 4)) {
343 if (strlen(bgcolor) == 7) {
352 }
else if (strlen(bgcolor) == 10) {
372 sizeof(
out) - strlen(
out) - 1);
383 sizeof(
out) - strlen(
out) - 1);
389 const char *
p = attr;
391 if (!strncmp(
p,
"bold", 4)) {
393 }
else if (!strncmp(
p,
"dim", 3)) {
395 }
else if (!strncmp(
p,
"italic", 6)) {
397 }
else if (!strncmp(
p,
"underline", 9)) {
399 }
else if (!strncmp(
p,
"blink", 5)) {
402 eprintf(
"Failed to parse terminal attributes: %s\n",
p);
423 rz_cons_print(
"\nGreyscale:\n");
425 for (
i = 0x08,
n = 0;
i <= 0xee;
i += 0xa) {
448 rz_cons_print(
"\n\nXTerm colors:\n");
452 for (
r = 0x00;
r <= 0xff;
r += 0x28) {
457 for (
b = 0x00;
b <= 0xff;
b += 0x28) {
462 for (
g = 0x00;
g <= 0xff;
g += 0x28) {
481 rz_cons_print(
"\n\nRGB:\n");
482 for (
i =
n = 0;
i <= 0xf;
i += inc) {
483 for (
k = 0;
k <= 0xf;
k += inc) {
484 for (j = 0; j <= 0xf; j += inc) {
535 for (
i = 0;
keys[
i].name;
i++) {
540 hasnext = (
keys[
i + 1].name) ?
"," :
"";
549 hasnext = (
keys[
i + 1].name) ?
"\n" :
"";
553 for (j = 0; j <
len; j++) {
554 if (
name[j] ==
'.') {
604 rz_cons_print(
"}\n");
614 for (
i = 0;
keys[
i].name;
i++) {
621 eprintf(
"rz_cons_pal_set: Invalid color %s\n",
key);
629 for (
i = 0;
keys[
i].name;
i++) {
657 ctx->pal.rainbow_sz = sz;
659 ctx->pal.rainbow =
calloc(
sizeof(
char *), sz);
663 int i, sz =
ctx->pal.rainbow_sz;
664 if (
ctx->pal.rainbow) {
665 for (
i = 0;
i < sz;
i++) {
669 ctx->pal.rainbow_sz = 0;
static RzILOpEffect * cmp(cs_insn *insn, bool is_thumb)
static RzILOpEffect * mov(cs_insn *insn, bool is_thumb)
const lzma_allocator const uint8_t size_t uint8_t * out
RZ_API RzCons * rz_cons_singleton(void)
RZ_API void rz_cons_strcat(const char *str)
RZ_API void rz_cons_newline(void)
RZ_API int rz_cons_printf(const char *format,...)
RZ_API RzColor rz_cons_color_random(ut8 alpha)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
unsigned short prefix[65536]
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * calloc(size_t number, size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode dup
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API RzColor rz_cons_pal_get(const char *key)
static void rz_cons_pal_show_256(void)
RZ_API void rz_cons_pal_show(void)
RZ_API void rz_cons_pal_free(RzConsContext *ctx)
static void rz_cons_pal_show_rgb(void)
RZ_API void rz_cons_pal_update_event(void)
RZ_API int rz_cons_pal_set(const char *key, const char *val)
static const int keys_len
static void __cons_pal_update_event(RzConsContext *ctx)
RZ_API const char * rz_cons_pal_get_name(int index)
RZ_API void rz_cons_pal_list(int rad, const char *arg)
static struct @218 keys[]
static void rz_cons_pal_show_gs(void)
RZ_API char * rz_cons_rainbow_get(int idx, int last, bool bg)
RZ_API void rz_cons_pal_init(RzConsContext *ctx)
RZ_API void rz_cons_rainbow_free(RzConsContext *ctx)
RZ_API RzColor rz_cons_pal_get_i(int index)
RZ_API int rz_cons_pal_len(void)
RZ_API char * rz_cons_pal_parse(const char *str, RzColor *outcol)
static ut8 rgbnum(const char ch1, const char ch2)
RZ_API void rz_cons_rainbow_new(RzConsContext *ctx, int sz)
RZ_API void rz_cons_pal_random(void)
RZ_API void rz_cons_pal_copy(RzConsContext *dst, RzConsContext *src)
RZ_API char * rz_cons_rgb_str_mode(RzConsColorMode mode, char *outstr, size_t sz, const RzColor *rcolor)
RZ_API char * rz_cons_rgb_str(char *outstr, size_t sz, const RzColor *rcolor)
static int rgb(int r, int g, int b)
#define RZCOLOR(a, r, g, b, bgr, bgg, bgb, id16)
RZ_API bool rz_hex_to_byte(ut8 *val, ut8 c)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API int rz_str_replace_char(char *s, int a, int b)
#define rz_offsetof(type, member)
RZ_API void rz_pvector_sort(RzPVector *vec, RzPVectorComparator cmp)
RZ_API void rz_pvector_init(RzPVector *vec, RzPVectorFree free)
RZ_API void rz_pvector_fini(RzPVector *vec)
static size_t rz_pvector_len(const RzPVector *vec)
static void ** rz_pvector_push(RzPVector *vec, void *x)
int(* RzPVectorComparator)(const void *a, const void *b)
#define rz_pvector_foreach(vec, it)
RzConsPrintablePalette pal
static bool input(void *ud, zip_uint8_t *data, zip_uint64_t length)