reduce some yajl boilerplate

This patch introduces a yerror() macro in src/commands.c and also
removes some unused yajl helper macros from src/config_directives.c.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
This commit is contained in:
Vivien Didelot
2013-09-25 17:17:38 -04:00
committed by Michael Stapelberg
parent 0bfcf1a762
commit 5baada6532
2 changed files with 16 additions and 58 deletions

View File

@ -14,16 +14,6 @@
#include "all.h"
// Macros to make the YAJL API a bit easier to use.
#define y(x, ...) yajl_gen_ ## x (cmd_output->json_gen, ##__VA_ARGS__)
#define ystr(str) yajl_gen_string(cmd_output->json_gen, (unsigned char*)str, strlen(str))
#define ysuccess(success) do { \
y(map_open); \
ystr("success"); \
y(bool, success); \
y(map_close); \
} while (0)
/*******************************************************************************
* Criteria functions.
******************************************************************************/