summaryrefslogtreecommitdiff
path: root/util/util.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-22 21:14:36 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-22 21:14:36 -0800
commit8583926c2ca8407a025991f65287bd693dce9060 (patch)
tree17bbb66dae1bd8b577858e68385854eba27f498f /util/util.h
parent100ed8406343f027aa442e79fe59c653c8fc02a4 (diff)
downloadmc-8583926c2ca8407a025991f65287bd693dce9060.tar.gz
Move more stuff around in util code.
Diffstat (limited to 'util/util.h')
-rw-r--r--util/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/util.h b/util/util.h
index e16848d..2e28d1e 100644
--- a/util/util.h
+++ b/util/util.h
@@ -127,3 +127,15 @@ size_t max(size_t a, size_t b);
size_t min(size_t a, size_t b);
size_t align(size_t sz, size_t a);
+/* list funcs */
+/* hack; nl is void* b/c void*** is incompatible with T*** */
+void lappend( void *l, size_t *len, void *n);
+void lcat(void *dst, size_t *ndst, void *src, size_t nsrc);
+void linsert(void *l, size_t *len, size_t idx, void *n);
+void *lpop(void *l, size_t *len);
+void ldel(void *l, size_t *len, size_t idx);
+void lfree(void *l, size_t *len);
+
+/* suffix replacement */
+char *swapsuffix(char *buf, size_t sz, char *s, char *suf, char *swap);
+