3 #include <yajl/yajl_gen.h>
6 void print_run_watch(yajl_gen json_gen, char *buffer, const char *title, const char *pidfile, const char *format) {
7 bool running = process_runs(pidfile);
9 char *outwalk = buffer;
13 START_COLOR((running ? "color_good" : "color_bad"));
15 for (walk = format; *walk != '\0'; walk++) {
21 if (strncmp(walk+1, "title", strlen("title")) == 0) {
22 outwalk += sprintf(outwalk, "%s", title);
23 walk += strlen("title");
24 } else if (strncmp(walk+1, "status", strlen("status")) == 0) {
25 outwalk += sprintf(outwalk, "%s", (running ? "yes" : "no"));
26 walk += strlen("status");
31 OUTPUT_FULL_TEXT(buffer);