aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 8007ec8..a6965be 100644
--- a/src/util.h
+++ b/src/util.h
@@ -23,6 +23,11 @@
#define WSPACE " \t\r\n"
+/* convenience macros */
+#define ARRAYLEN(x) (sizeof(x)/sizeof(x[0]))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#define MIN(a,b) (((a)<(b))?(a):(b))
+
/* utility functions */
void __attribute__((noreturn,format(printf,1,2))) error(const char *fmt, ...);
void __attribute__((format(printf,4,5))) debugf_real(const char*, int, const char*, const char *fmt, ...);
@@ -48,6 +53,9 @@ uint64_t read_uint64(int fd);
void write_size(int fd, size_t);
size_t read_size(int fd);
+void write_int(int fd, int i);
+int read_int(int fd);
+
bool is_vowel(char c);
size_t strlcat(char *dst, const char *src, size_t siz);