void json_message_parser_init(JSONMessageParser *parser, void (*func)(JSONMessageParser *, GQueue *)) { parser->emit = func; parser->brace_count = 0; parser->bracket_count = 0; parser->tokens = g_queue_new(); parser->token_size = 0; json_lexer_init(&parser->lexer, json_message_process_token); }
void json_message_parser_init(JSONMessageParser *parser, void (*emit)(void *opaque, QObject *json, Error *err), void *opaque, va_list *ap) { parser->emit = emit; parser->opaque = opaque; parser->ap = ap; parser->brace_count = 0; parser->bracket_count = 0; g_queue_init(&parser->tokens); parser->token_size = 0; json_lexer_init(&parser->lexer, !!ap); }