1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 Michiel van der Kolk, Jens Arnold
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __ROCKMACROS_H__
22 #define __ROCKMACROS_H__
33 int printf(const char *fmt
, ...);
34 int fileexists(const char * fname
);
35 char *my_strtok( char * s
, const char * delim
);
37 #define alloca __builtin_alloca
39 #define fdprintf(...) rb->fdprintf(__VA_ARGS__)
41 #define vsnprintf(...) rb->vsnprintf(__VA_ARGS__)
43 #define read_line(a,b,c) rb->read_line((a),(b),(c))
46 #define open(a, ...) rb->open((a), __VA_ARGS__)
47 #define close(a) rb->close((a))
49 int my_open(const char *file
, int flags
, ...);
51 #define open(a, ...) my_open((a), __VA_ARGS__)
52 #define close(a) my_close((a))
55 #define lseek(a,b,c) rb->lseek((a),(b),(c))
56 #define filesize(a) rb->filesize((a))
57 #define read(a,b,c) rb->read((a),(b),(c))
58 #define write(a,b,c) rb->write((a),(b),(c))
60 #define strtok(a,b) my_strtok((a),(b))
62 #define strcat(a,b) rb->strcat((a),(b))
64 #define memset(a,b,c) rb->memset((a),(b),(c))
66 #define memmove(a,b,c) rb->memmove((a),(b),(c))
68 #define memcmp(a,b,c) rb->memcmp((a),(b),(c))
70 #define memchr(a,b,c) rb->memchr((a),(b),(c))
72 #define strcpy(a,b) rb->strcpy((a),(b))
74 #define strlen(a) rb->strlen((a))
76 #define strcmp(a,b) rb->strcmp((a),(b))
78 #define strncmp(a,b,c) rb->strncmp((a),(b),(c))
80 #define strchr(a,b) rb->strchr((a),(b))
82 #define strrchr(a,b) rb->strrchr((a),(b))
84 #define strcasecmp(a,b) rb->strcasecmp((a),(b))
86 #define strncasecmp(a,b,c) rb->strncasecmp((a),(b),(c))
87 #define srand(a) rb->srand((a))
88 #define rand() rb->rand()
89 #define atoi(a) rb->atoi((a))
90 #define strcat(a,b) rb->strcat((a),(b))
91 #define snprintf rb->snprintf
93 #define PACKEDATTR __attribute__((packed)) // Needed for a few things
94 #define GAMEBASE ROCKBOX_DIR "/doom/"
95 //#define SIMPLECHECKS
96 #define NO_PREDEFINED_LUMPS
97 #define TABLES_AS_LUMPS // This frees up alot of space in the plugin buffer
99 #define MAKE_FOURCC(a,b,c,d) (uint32_t)((((a)<<24)|((b)<<16)|((c)<<8)|(d)))
101 /* Config file magic - increment the version number whenever the settings
104 #define DOOM_CONFIG_MAGIC MAKE_FOURCC('D','O','O','M')
105 #define DOOM_CONFIG_VERSION 3