bus: parse matches locally and allow registration of callbacks for them

This includes code to parse and split up match strings which will also
be useful to calculate bloom filter masks when the time comes.
This commit is contained in:
Lennart Poettering
2013-03-31 16:16:37 +02:00
parent 11c4c24920
commit 392d5b378c
17 changed files with 1492 additions and 17 deletions
+17
View File
@@ -5855,3 +5855,20 @@ char *strrep(const char *s, unsigned n) {
*p = 0;
return r;
}
void* greedy_realloc(void **p, size_t *allocated, size_t need) {
size_t a;
void *q;
if (*allocated >= need)
return *p;
a = MAX(64, need * 2);
q = realloc(*p, a);
if (!q)
return NULL;
*p = q;
*allocated = a;
return q;
}
+2
View File
@@ -613,3 +613,5 @@ void *unhexmem(const char *p, size_t l);
char *strextend(char **x, ...);
char *strrep(const char *s, unsigned n);
void* greedy_realloc(void **p, size_t *allocated, size_t need);