aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver/macros.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-18 10:20:49 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-18 10:20:49 +0200
commite34d491ee14d6fc76294296552a070004493af32 (patch)
tree3d3105ad2928c0324ba3428a387c31958299ff22 /src/libmdsserver/macros.h
parenttypo + update todo (diff)
downloadmds-e34d491ee14d6fc76294296552a070004493af32.tar.gz
mds-e34d491ee14d6fc76294296552a070004493af32.tar.bz2
mds-e34d491ee14d6fc76294296552a070004493af32.tar.xz
m doc + iprint and iprintf macros + siginfo on mds, mds-vt and mds-respawn
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libmdsserver/macros.h27
1 files changed, 27 insertions, 0 deletions
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
@@ -98,6 +98,33 @@
/**
+ * 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`
*
* @param mutex:pthread_mutex_t The mutex