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:
committed by
Michael Stapelberg
parent
0bfcf1a762
commit
5baada6532
@ -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.
|
||||
******************************************************************************/
|
||||
|
Reference in New Issue
Block a user