return False;
}
+void vslilog(struct log_if *lf, int priority, const char *message, va_list ap)
+{
+ lf->vlog(lf->st,priority,message,ap);
+}
+
void slilog(struct log_if *lf, int priority, const char *message, ...)
{
va_list ap;
va_start(ap,message);
- lf->vlog(lf->st,priority,message,ap);
+ vslilog(lf,priority,message,ap);
va_end(ap);
}
void *buf_append(struct buffer_if *buf, uint32_t amount) {
void *p;
+ assert(buf->size <= buf->len - amount);
p=buf->start + buf->size;
buf->size+=amount;
return p;
}
void *buf_prepend(struct buffer_if *buf, uint32_t amount) {
+ assert(amount <= buf->start - buf->base);
buf->size+=amount;
return buf->start-=amount;
}
uint16_t len;
len=strlen(s);
+ /* fixme: if string is longer than 65535, result is a corrupted packet */
buf_append_uint16(buf,len);
memcpy(buf_append(buf,len),s,len);
}
return new_closure(&st->cl);
}
-init_module util_module;
void util_module(dict_t *dict)
{
add_closure(dict,"sysbuffer",buffer_apply);