4 #include <yajl/yajl_gen.h>
8 void json_generate_one_record(yajl_gen g, const char *author, struct blerg *b, uint64_t record) {
13 if (!blerg_fetch(b, record, &data, &len)) {
14 fprintf(stderr, "Could not fetch record\n");
20 yajl_gen_string(g, "author", 6);
21 yajl_gen_string(g, author, strlen(author));
23 yajl_gen_string(g, "record", 6);
24 snprintf(number, 21, "%llu", record);
25 yajl_gen_string(g, number, strlen(number));
26 yajl_gen_string(g, "timestamp", 9);
27 yajl_gen_integer(g, blerg_get_timestamp(b, record));
28 yajl_gen_string(g, "data", 4);
29 yajl_gen_string(g, data, len);
30 yajl_gen_map_close(g);