Lines Matching refs:yajl_ctx
57 # define DEBUG_GEN_REPORT(yajl_ctx) \ argument
61 yajl_gen_get_buf((yajl_ctx)->g, &buf, &len); \
62 LIBXL__LOG(libxl__gc_owner((yajl_ctx)->gc), LIBXL__LOG_DEBUG,
64 yajl_gen_free((yajl_ctx)->g); \
65 (yajl_ctx)->g = NULL; \
906 static void yajl_ctx_free(libxl__yajl_ctx *yajl_ctx)
908 if (yajl_ctx->hand) {
909 yajl_free(yajl_ctx->hand);
910 yajl_ctx->hand = NULL;
912 DEBUG_GEN_FREE(yajl_ctx);
918 libxl__yajl_ctx yajl_ctx;
922 memset(&yajl_ctx, 0, sizeof (yajl_ctx));
923 yajl_ctx.gc = gc;
925 DEBUG_GEN_ALLOC(&yajl_ctx);
927 if (yajl_ctx.hand == NULL) {
928 yajl_ctx.hand = libxl__yajl_alloc(&callbacks, NULL, &yajl_ctx);
930 status = yajl_parse(yajl_ctx.hand, (const unsigned char *)s, strlen(s));
934 status = yajl_complete_parse(yajl_ctx.hand);
938 o = yajl_ctx.head;
940 DEBUG_GEN_REPORT(&yajl_ctx);
942 yajl_ctx.head = NULL;
944 yajl_ctx_free(&yajl_ctx);
948 str = yajl_get_error(yajl_ctx.hand, 1, (const unsigned char*)s, strlen(s));
951 yajl_free_error(yajl_ctx.hand, str);
952 yajl_ctx_free(&yajl_ctx);