chiark / gitweb /
log: Introduce slilog_part; abolish log_if->logfn
[secnet.git] / secnet.h
index 29cbac79c6fdd3247c2d982da9db89e04847c829..44b180f043d04baa27ac6cc8155f13cbc69067e6 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -346,13 +346,15 @@ struct comm_if {
 
 /* LOG interface */
 
+#define LOG_MESSAGE_BUFLEN 1023
+
 typedef void log_msg_fn(void *st, int class, const char *message, ...);
 typedef void log_vmsg_fn(void *st, int class, const char *message,
                         va_list args);
 struct log_if {
     void *st;
-    log_msg_fn *logfn;   /* Do not call these directly - you don't get */
     log_vmsg_fn *vlogfn; /* printf format checking.  Use [v]slilog instead */
+    char buff[LOG_MESSAGE_BUFLEN+1];
 };
 /* (convenience functions, defined in util.c) */
 extern void slilog(struct log_if *lf, int class, const char *message, ...)
@@ -360,6 +362,13 @@ FORMAT(printf,3,4);
 extern void vslilog(struct log_if *lf, int class, const char *message, va_list)
 FORMAT(printf,3,0);
 
+/* Versions which take (parts of) (multiple) messages, using \n to
+ * distinguish one message from another. */
+extern void slilog_part(struct log_if *lf, int class, const char *message, ...)
+FORMAT(printf,3,4);
+extern void vslilog_part(struct log_if *lf, int class, const char *message,
+                        va_list) FORMAT(printf,3,0);
+
 /* SITE interface */
 
 /* Pretty much a placeholder; allows starting and stopping of processing,