]> Pileus Git - lackey/blobdiff - src/util.h
Add alloc0 and new0 functions
[lackey] / src / util.h
index 6a619d5ba974c3a3ef3838919ad77cd7cb13c084..d0baa3b37e28a7010eca8ff4ef0ddc4948114396 100644 (file)
 #define ROUND(x) ((int)((x)+0.5))
 #define N_ELEMENTS(x) (sizeof(x)/sizeof((x)[0]))
 
+#define new0(type) alloc0(sizeof(type))
+
 /* Debug functions */
 void util_init(void);
 
 /* Stirng functions */
 void strsub(char *str, char find, char repl);
 
+/* Memory functions */
+void *alloc0(int size);
+
 /* Debug functions */
-#ifdef DEBUG
-int debug(char *fmt, ...);
-#else
-#define debug(...)
-#endif
+void debug(char *fmt, ...);
+void error(char *fmt, ...);