X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=common.c;h=15fbe6a3185ce2703c1da8bcc05c9005b5a7544f;hb=477b8a38dc1b3d0ae5e726f765722c962b2fcb46;hp=dab0b70f52c7038dc1abc82cef872d3546e3e375;hpb=b2db68ebb7acdb345c07985fcdb35dcfbb36d4aa;p=collection4.git diff --git a/common.c b/common.c index dab0b70..15fbe6a 100644 --- a/common.c +++ b/common.c @@ -16,6 +16,9 @@ #include "common.h" #include "graph_list.h" +#include +#include + static int foreach_rrd_file (const char *dir, /* {{{ */ int (*callback) (const char *, void *), void *user_data) @@ -300,4 +303,24 @@ uint32_t get_random_color (void) /* {{{ */ return (rgb_to_uint32 (rgb)); } /* }}} uint32_t get_random_color */ +int print_debug (const char *format, ...) /* {{{ */ +{ + static _Bool have_header = 0; + + va_list ap; + int status; + + if (!have_header) + { + printf ("Content-Type: text/plain\n\n"); + have_header = 1; + } + + va_start (ap, format); + status = vprintf (format, ap); + va_end (ap); + + return (status); +} /* }}} int print_debug */ + /* vim: set sw=2 sts=2 et fdm=marker : */