summaryrefslogtreecommitdiff
path: root/utils/atj2137/atjboottool/misc.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-10-03 14:27:19 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2012-10-03 14:27:19 +0200
commit821efc46ec9392a58df95b396fd51972cf5fd3e7 (patch)
treeb6810a45d5f5405ec9a24e82bb09a09485cfff37 /utils/atj2137/atjboottool/misc.h
parent8687b9899382b6008c66a89dbc01271437f7654d (diff)
downloadrockbox-821efc46ec9392a58df95b396fd51972cf5fd3e7.tar.gz
rockbox-821efc46ec9392a58df95b396fd51972cf5fd3e7.zip
Introduce atjboottool for ATJ213x firmwares
Change-Id: Ie857b82e25de235c8549defab7e75995efefb3f6
Diffstat (limited to 'utils/atj2137/atjboottool/misc.h')
-rw-r--r--utils/atj2137/atjboottool/misc.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/utils/atj2137/atjboottool/misc.h b/utils/atj2137/atjboottool/misc.h
new file mode 100644
index 0000000000..b0658c0d31
--- /dev/null
+++ b/utils/atj2137/atjboottool/misc.h
@@ -0,0 +1,41 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef __MISC_H__
22#define __MISC_H__
23
24#include <stdbool.h>
25
26#define _STR(a) #a
27#define STR(a) _STR(a)
28
29#define bug(...) do { fprintf(stderr,"["__FILE__":"STR(__LINE__)"]ERROR: "__VA_ARGS__); exit(1); } while(0)
30#define bugp(...) do { fprintf(stderr, __VA_ARGS__); perror(" "); exit(1); } while(0)
31
32#define ROUND_UP(val, round) ((((val) + (round) - 1) / (round)) * (round))
33
34typedef char color_t[];
35
36extern color_t OFF, GREY, RED, GREEN, YELLOW, BLUE;
37void *xmalloc(size_t s);
38void color(color_t c);
39void enable_color(bool enable);
40
41#endif /* __MISC_H__ */