From e34d491ee14d6fc76294296552a070004493af32 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Apr 2015 10:20:49 +0200 Subject: m doc + iprint and iprintf macros + siginfo on mds, mds-vt and mds-respawn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/macros.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/libmdsserver') diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h index 7ab5f04..41e5567 100644 --- a/src/libmdsserver/macros.h +++ b/src/libmdsserver/macros.h @@ -97,6 +97,33 @@ fprintf(stderr, "%s: " format "\n", *argv, __VA_ARGS__) +/** + * Wrapper for `fprintf` that prints to `stderr` with + * the prefixed with information telling the user that + * the output is part of an state and statistics dump + * and a new line suffixed + * + * @param format:const char* The format + * @return :int The number of bytes written, including the NUL-termination, negative on error + */ +#define iprint(format) \ + fprintf(stderr, "%s: info: " format "\n", *argv) + + +/** + * Wrapper for `fprintf` that prints to `stderr` with + * the prefixed with information telling the user that + * the output is part of an state and statistics dump + * and a new line suffixed + * + * @param format:const char* The format + * @param ... The arguments + * @return :int The number of bytes written, including the NUL-termination, negative on error + */ +#define iprintf(format, ...) \ + fprintf(stderr, "%s: info: " format "\n", *argv, __VA_ARGS__) + + /** * Wrapper for `pthread_mutex_lock` and `pthread_mutex_unlock` * -- cgit v1.2.3-70-g09d2