3 #include <yajl/yajl_gen.h>
4 #include <yajl/yajl_version.h>
7 void print_run_watch(yajl_gen json_gen, char *buffer, const char *title, const char *pidfile, const char *format) {
8 bool running = process_runs(pidfile);
10 char *outwalk = buffer;
14 START_COLOR((running ? "color_good" : "color_bad"));
16 for (walk = format; *walk != '\0'; walk++) {
22 if (BEGINS_WITH(walk+1, "title")) {
23 outwalk += sprintf(outwalk, "%s", title);
24 walk += strlen("title");
25 } else if (BEGINS_WITH(walk+1, "status")) {
26 outwalk += sprintf(outwalk, "%s", (running ? "yes" : "no"));
27 walk += strlen("status");
32 OUTPUT_FULL_TEXT(buffer);