From: Ian Jackson Date: Sun, 12 Jun 2011 19:03:33 +0000 (+0100) Subject: logging: provide vslilog as well as slilog X-Git-Tag: v0.2.0~82 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=59938e0ed0c8ac267c3715a25a0a3ed27f7a7e47;hp=f0fb73c58ef5315260164b973fcc8c3996046856 logging: provide vslilog as well as slilog In general it is a mistake to provide a varargs function which takes a format string, but not the corresponding function taking a va_list. We implement slilog in terms of vslilog in the obvious way. Signed-off-by: Ian Jackson --- diff --git a/secnet.h b/secnet.h index ede3ffc..2b913d9 100644 --- a/secnet.h +++ b/secnet.h @@ -324,9 +324,11 @@ struct log_if { log_msg_fn *log; log_vmsg_fn *vlog; }; -/* (convenience function, defined in util.c) */ +/* (convenience functions, defined in util.c) */ extern void slilog(struct log_if *lf, int class, const char *message, ...) FORMAT(printf,3,4); +extern void vslilog(struct log_if *lf, int class, const char *message, va_list) +FORMAT(printf,3,0); /* SITE interface */ diff --git a/util.c b/util.c index 9a009dc..997979a 100644 --- a/util.c +++ b/util.c @@ -198,12 +198,17 @@ bool_t remove_hook(uint32_t phase, hook_fn *fn, void *state) 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); }