aboutsummaryrefslogtreecommitdiff
path: root/src/defs.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-02-28 10:07:54 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-02-28 10:07:54 +0200
commit73bfc3bdfac590266ad67c48de5e866bb5d5fa4d (patch)
tree2488c3b3b009c0c49f56a63f10df7340432588c4 /src/defs.h
parent7e8ff0ed908913de7467daa28feb25164abc7ad9 (diff)
downloadping903-73bfc3bdfac590266ad67c48de5e866bb5d5fa4d.tar.gz
ping903-73bfc3bdfac590266ad67c48de5e866bb5d5fa4d.tar.bz2
Implement here-document syntax in configuration file.
Here-document is supported for ip-list and trusted-ip statements. * doc/ping903.conf.5: Document the here-document syntax. * NEWS: Likewise. * examples/inspect: Mention that the created output is a valid configuration file. * src/config.c: Support for here-document. * src/defs.h: Mark printf-like functions as such. * src/ping903.h (CF_HEREDOC_OPCODE): New data type. (cf_callback_arg): Add heredoc member. (STMT_T_HEREDOC): New statement type. * src/remoteip.c (cf_trusted_ip_heredoc): New function. * src/ping903.c: Fix format strings and unused variables. * src/ping903q.c: Likewise. * src/pinger.c: Likewise.
Diffstat (limited to 'src/defs.h')
-rw-r--r--src/defs.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/defs.h b/src/defs.h
index 85918ef..1f7c7f3 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -51,10 +51,13 @@ void *e2nrealloc(void *p, size_t *pn, size_t s);
extern char *progname;
+#define ATTR_PRINTFLIKE(fmt,narg) \
+ __attribute__ ((__format__ (__printf__, fmt, narg)))
+
void vlogger(int prio, char const *fmt, va_list ap);
-void fatal(char const *fmt, ...);
-void error(char const *fmt, ...);
-void info(char const *fmt, ...);
+void fatal(char const *fmt, ...) ATTR_PRINTFLIKE(1,2);
+void error(char const *fmt, ...) ATTR_PRINTFLIKE(1,2);
+void info(char const *fmt, ...) ATTR_PRINTFLIKE(1,2);
void syslog_enable(void);
void set_progname(char const *arg);
int set_log_facility(char const *arg);

Return to:

Send suggestions and report system problems to the System administrator.