summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-02-27 16:21:30 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-02-27 16:21:30 +0100
commit13927fc6083c3d134e456ccfafb953c6cea17662 (patch)
treee34286bfbef190e29a49ed8a12fd5565d7e36f1a /util.h
parentfc6c2a381742aba4deaf8538fa2c85750361a2d9 (diff)
various improvements
- pledge tools and add define to enable it on platforms that support it, currently only OpenBSD 5.9+ - separate getline and parseline functionality. - use murmur3 hash instead of jenkins1: faster and less collisions. - make some error messages a bit more clear, for example with path truncation. - some small cleanups, move printutf8pad to util.
Diffstat (limited to 'util.h')
-rw-r--r--util.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/util.h b/util.h
index 29ba1ef..6741334 100644
--- a/util.h
+++ b/util.h
@@ -31,8 +31,18 @@ enum {
int absuri(const char *, const char *, char *, size_t);
int encodeuri(const char *, char *, size_t);
-ssize_t parseline(char **, size_t *, char *[FieldLast], FILE *);
+size_t parseline(char *, char *[FieldLast]);
int parseuri(const char *, struct uri *, int);
+void printutf8pad(FILE *, const char *, size_t, int);
int strtotime(const char *, time_t *);
char * xbasename(const char *);
void xmlencode(const char *, FILE *);
+
+#ifdef USE_PLEDGE
+#include <unistd.h>
+#else
+int pledge(const char *, const char *[]);
+#endif
+
+#define ROT32(x, y) ((x << y) | (x >> (32 - y)))
+uint32_t murmur3_32(const char *, uint32_t, uint32_t);