summaryrefslogtreecommitdiff
path: root/utils/nwztools/upgtools/misc.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-01-04 16:36:27 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2017-01-04 17:04:38 +0100
commit92ecbd5fb8a7c8e939b1b4dde82cc6c9ba9d41af (patch)
tree5e187e031ab8648e2c2c58502f167abc72ec606c /utils/nwztools/upgtools/misc.h
parent5cfd4a5b8e551c23600c93838180487e91698814 (diff)
downloadrockbox-92ecbd5fb8a7c8e939b1b4dde82cc6c9ba9d41af.tar.gz
rockbox-92ecbd5fb8a7c8e939b1b4dde82cc6c9ba9d41af.zip
nwztools/upg: move upg handling to its own file, completely rework kas handling
This was a huge mess, the new is much cleaner hopefully. Change-Id: I43663d021dc8bc31662d3923e1c3da22d987ebf9
Diffstat (limited to 'utils/nwztools/upgtools/misc.h')
-rw-r--r--utils/nwztools/upgtools/misc.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/utils/nwztools/upgtools/misc.h b/utils/nwztools/upgtools/misc.h
index 96666a2eff..e493cc2019 100644
--- a/utils/nwztools/upgtools/misc.h
+++ b/utils/nwztools/upgtools/misc.h
@@ -27,20 +27,16 @@
27#define _STR(a) #a 27#define _STR(a) #a
28#define STR(a) _STR(a) 28#define STR(a) _STR(a)
29 29
30#define bug(...) do { fprintf(stderr,"["__FILE__":"STR(__LINE__)"]ERROR: "__VA_ARGS__); exit(1); } while(0)
31#define bugp(...) do { fprintf(stderr, __VA_ARGS__); perror(" "); exit(1); } while(0)
32
33#define ROUND_UP(val, round) ((((val) + (round) - 1) / (round)) * (round)) 30#define ROUND_UP(val, round) ((((val) + (round) - 1) / (round)) * (round))
34 31
35typedef char color_t[]; 32typedef const char color_t[];
36 33
37extern color_t OFF, GREY, RED, GREEN, YELLOW, BLUE; 34extern color_t OFF, GREY, RED, GREEN, YELLOW, BLUE;
38void *xmalloc(size_t s);
39void color(color_t c); 35void color(color_t c);
40void enable_color(bool enable); 36void enable_color(bool enable);
41 37
42#define cprintf(col, ...) do {color(col); printf(__VA_ARGS__); }while(0) 38typedef void (*generic_printf_t)(void *u, bool err, color_t c, const char *f, ...);
43 39
44#define cprintf_field(str1, ...) do{ cprintf(GREEN, str1); cprintf(YELLOW, __VA_ARGS__); }while(0) 40void generic_std_printf(void *u, bool err, color_t c, const char *f, ...);
45 41
46#endif /* __MISC_H__ */ 42#endif /* __MISC_H__ */