Ludum Dare 29
HackSoc's entry for the Ludum Dare Jam 29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
utils.h
Go to the documentation of this file.
1 #ifndef _UTILS_H
2 #define _UTILS_H
3 
5 #define SCREENWIDTH 80
6 
8 #define SCREENHEIGHT 25
9 
11 #define xalloc(T) _xalloc(sizeof(T))
12 
14 #define xcalloc(S,T) _xalloc((S) * sizeof(T));
15 
17 #define xfree(P) _xfree((void **)&(P))
18 
20 #define lengthof(x) (sizeof(x) / sizeof(x[0]))
21 
22 void mvaddprintf(unsigned int y, unsigned int x, const char * fmt, ...);
23 char * strdup(const char * str);
24 void mvaddchcol(unsigned int y, unsigned int x,
25  char chr,
26  int fg, int bg,
27  bool bold);
28 const void ** list_choice(bool nochoice,
29  const char * prompt,
30  const char * prompt2,
31  bool multi,
32  bool empty,
33  const char * choices[],
34  const void * results[]);
35 const void * random_choice(const void * choices[]);
36 void show_help();
37 void * _xalloc(size_t size);
38 void _xfree(void ** ptr);
39 
40 #endif
void mvaddprintf(unsigned int y, unsigned int x, const char *fmt,...)
Definition: utils.c:14
void show_help()
Definition: utils.c:170
void _xfree(void **ptr)
Definition: utils.c:204
void mvaddchcol(unsigned int y, unsigned int x, char chr, int fg, int bg, bool bold)
Definition: utils.c:43
void * _xalloc(size_t size)
Definition: utils.c:192
const void * random_choice(const void *choices[])
Definition: utils.c:160
char * strdup(const char *str)
Definition: utils.c:27
const void ** list_choice(bool nochoice, const char *prompt, const char *prompt2, bool multi, bool empty, const char *choices[], const void *results[])
Definition: utils.c:73