summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2007-05-18 21:54:15 +0200
committerDavid Härdeman <david@hardeman.nu>2007-05-18 21:54:15 +0200
commit25d2bb605809d23b691ec88a138bf7da9c7ee20b (patch)
tree0da1b53a4859fe8060f19dbbceb407a1701eb877 /utils.h
parentce12a04ba0dc092ea15164004264845a87b758e7 (diff)
Initial project checkin
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/utils.h b/utils.h
new file mode 100644
index 0000000..2f39611
--- /dev/null
+++ b/utils.h
@@ -0,0 +1,13 @@
+void *xmalloc(size_t size);
+char *xstrdup(const char *s);
+void binary_print(const char *s, ssize_t len);
+void xfwrite(const void *ptr, size_t size, FILE *stream);
+
+void write_int(uint64_t value, size_t len, FILE *to);
+void write_binary_string(const char *string, size_t len, FILE *to);
+void write_string(const char *string, FILE *to);
+
+uint64_t read_int(char **from, size_t len, const char *max);
+char *read_binary_string(char **from, size_t len, const char *max);
+char *read_string(char **from, const char *max);
+