Revert "use designated initializers for yajl_callbacks struct"

This reverts commit 705b43294a.

This commit broke i3bar for some users.
This commit is contained in:
Michael Stapelberg
2014-01-05 13:05:31 +01:00
parent f6ee035c61
commit 2fea5ef82b
11 changed files with 114 additions and 58 deletions

View File

@ -93,6 +93,20 @@ static int header_map_key(void *ctx, const unsigned char *stringval, unsigned in
return 1;
}
static yajl_callbacks version_callbacks = {
NULL, /* null */
&header_boolean, /* boolean */
&header_integer,
NULL, /* double */
NULL, /* number */
NULL, /* string */
NULL, /* start_map */
&header_map_key,
NULL, /* end_map */
NULL, /* start_array */
NULL /* end_array */
};
static void child_init(i3bar_child *child) {
child->version = 0;
child->stop_signal = SIGSTOP;
@ -108,12 +122,6 @@ static void child_init(i3bar_child *child) {
*
*/
void parse_json_header(i3bar_child *child, const unsigned char *buffer, int length, unsigned int *consumed) {
static yajl_callbacks version_callbacks = {
.yajl_boolean = header_boolean,
.yajl_integer = header_integer,
.yajl_map_key = &header_map_key,
};
child_init(child);
current_key = NO_KEY;