]> git.sur5r.net Git - i3/i3status/blob - src/print_time.c
Bugfix: Move the pbval definition outside the ifdef (Thanks XTaran)
[i3/i3status] / src / print_time.c
1 // vim:ts=8:expandtab
2 #include <time.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <yajl/yajl_gen.h>
6 #include <yajl/yajl_version.h>
7
8 #include "i3status.h"
9
10 void print_time(yajl_gen json_gen, char *buffer, const char *format, struct tm *current_tm) {
11         char *outwalk = buffer;
12         if (current_tm == NULL)
13                 return;
14         /* Get date & time */
15         outwalk += strftime(outwalk, 4095, format, current_tm);
16         *outwalk = '\0';
17         OUTPUT_FULL_TEXT(buffer);
18 }