diff options
| author | Gergely Nagy <algernon@balabit.hu> | 2012-03-19 17:41:10 +0100 |
|---|---|---|
| committer | Gergely Nagy <algernon@balabit.hu> | 2012-03-19 17:41:10 +0100 |
| commit | d665a62248df7e14f3787138e7089caaad648ded (patch) | |
| tree | 8c819c02bc382b89b92855a60753173e9d3c2fb1 /lib/cee-syslog.h | |
| parent | dac475d2a5f568a7ac648d1c8bdbb75510586297 (diff) | |
Lift out the formatting into a separate function.
The formatting itself is now lifted out to _cee_vformat(), which
returns a const char *, and puts the JSON object into its first
(output) parameter.
We then export cee_format() and cee_vformat(), that use this, strdup
and return the result, and free the JSON object too.
cee_vsyslog() was changed to use _cee_vformat(), because it does not
need to strdup() the result.
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Diffstat (limited to 'lib/cee-syslog.h')
| -rw-r--r-- | lib/cee-syslog.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/cee-syslog.h b/lib/cee-syslog.h index 4c35cea..07756d5 100644 --- a/lib/cee-syslog.h +++ b/lib/cee-syslog.h @@ -31,6 +31,9 @@ #include <syslog.h> #include <stdarg.h> +char *cee_format (const char *msg_format, ...); +char *cee_vformat (const char *msg_format, va_list ap); + void cee_syslog (int priority, const char *msg_format, ...); void cee_vsyslog (int priority, const char *msg_format, va_list ap); |
