summaryrefslogtreecommitdiffstats
path: root/blob.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-08-14 20:21:59 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-08-14 20:21:59 +0300
commit54581ca7fe116ab20d6fa7f15013efe1777e1380 (patch)
treedc22731105eaa0ff39920e461f6b4831dad46f47 /blob.h
parent7daf2874969fb6773d480e9776cd8418eeb6353f (diff)
downloadsquark-54581ca7fe116ab20d6fa7f15013efe1777e1380.tar.bz2
squark-54581ca7fe116ab20d6fa7f15013efe1777e1380.tar.xz
filter: squid interfacing code, basic minimum configuration
Implement squid redirect protocol. It implements the "concurrent" version even though the algorithm is non-blocking. Doing this can reduce the amount of read system calls on busy system. Minimum command line based configuration for banning specific categories and specifying the redirect site. Will probably have to add some sort of config file system later.
Diffstat (limited to 'blob.h')
-rw-r--r--blob.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/blob.h b/blob.h
index 3d065ed..dba2f97 100644
--- a/blob.h
+++ b/blob.h
@@ -25,7 +25,9 @@ typedef struct blob {
#define BLOB_PTR_LEN(ptr,len) (blob_t){(void*)(ptr), (len)}
#define BLOB_PTR_PTR(beg,end) BLOB_PTR_LEN((beg),(end)-(beg)+1)
#define BLOB_BUF(buf) (blob_t){(void*)(buf), sizeof(buf)}
-#define BLOB_STR(str) (blob_t){(char*)(str), strlen(str)}
+#define BLOB_STRLEN(str) (blob_t){(str), strlen(str)}
+#define BLOB_STR_INIT(str) {(str), sizeof(str)-1}
+#define BLOB_STR(str) (blob_t) BLOB_STR_INIT(str)
extern const blob_t BLOB_NULL;
@@ -46,6 +48,7 @@ blob_t blob_pull(blob_t *b, int len);
void blob_pull_skip(blob_t *b, int len);
int blob_pull_matching(blob_t *b, blob_t e);
unsigned int blob_pull_uint(blob_t *b, int radix);
+blob_t blob_pull_spn(blob_t *b, const blob_t spn);
blob_t blob_pull_cspn(blob_t *b, const blob_t cspn);
blob_t blob_expand_head(blob_t *b, blob_t limits, unsigned char sep);