Lines Matching defs:context

47 /* JSON encoder context type */
49 /* Top-level context of empty encoder. JSON element can be added. */
51 /* Top-level context of encoder with an element. JSON element cannot be added. */
53 /* JSON array context. JSON elements can be added. */
55 /* JSON object context. JSON object members can be added. */
65 /* JSON encoder structure, a wrapper for pa_strbuf and encoder context */
68 encoder_context *context;
632 head->next = encoder->context;
633 encoder->context = head;
636 /* Returns type of context popped off encoder context stack. */
642 pa_assert(encoder->context);
644 type = encoder->context->type;
646 head = encoder->context->next;
647 pa_xfree(encoder->context);
648 encoder->context = head;
657 pa_assert(encoder->context);
659 type = encoder->context->type;
669 encoder->context = NULL;
679 /* should have exactly one encoder context left at this point */
680 pa_assert(encoder->context);
682 pa_assert(encoder->context == NULL);
710 if (encoder->context->counter++)
793 pa_assert(encoder->context->type != PA_JSON_CONTEXT_TOP);
795 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
796 encoder->context->type = PA_JSON_CONTEXT_TOP;
807 pa_assert(encoder->context);
808 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
835 pa_assert(encoder->context);
836 pa_assert(encoder->context->type != PA_JSON_CONTEXT_TOP);
838 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
839 encoder->context->type = PA_JSON_CONTEXT_TOP;
850 pa_assert(encoder->context);
851 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
877 pa_assert(encoder->context);
878 pa_assert(encoder->context->type == PA_JSON_CONTEXT_EMPTY || encoder->context->type == PA_JSON_CONTEXT_ARRAY);
880 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
881 encoder->context->type = PA_JSON_CONTEXT_TOP;
890 pa_assert(encoder->context);
891 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
915 pa_assert(encoder->context);
916 pa_assert(encoder->context->type == PA_JSON_CONTEXT_EMPTY || encoder->context->type == PA_JSON_CONTEXT_ARRAY);
918 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
919 encoder->context->type = PA_JSON_CONTEXT_TOP;
928 pa_assert(encoder->context);
929 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
948 pa_assert(encoder->context);
949 pa_assert(encoder->context->type == PA_JSON_CONTEXT_EMPTY || encoder->context->type == PA_JSON_CONTEXT_ARRAY);
951 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
952 encoder->context->type = PA_JSON_CONTEXT_TOP;
961 pa_assert(encoder->context);
962 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
982 pa_assert(encoder->context);
983 pa_assert(encoder->context->type == PA_JSON_CONTEXT_EMPTY || encoder->context->type == PA_JSON_CONTEXT_ARRAY);
985 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
986 encoder->context->type = PA_JSON_CONTEXT_TOP;
995 pa_assert(encoder->context);
996 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
1015 pa_assert(encoder->context);
1016 pa_assert(encoder->context->type == PA_JSON_CONTEXT_EMPTY || encoder->context->type == PA_JSON_CONTEXT_ARRAY);
1018 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
1019 encoder->context->type = PA_JSON_CONTEXT_TOP;
1028 pa_assert(encoder->context);
1029 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);
1048 pa_assert(encoder->context);
1049 pa_assert(encoder->context->type == PA_JSON_CONTEXT_EMPTY || encoder->context->type == PA_JSON_CONTEXT_ARRAY);
1051 if (encoder->context->type == PA_JSON_CONTEXT_EMPTY)
1052 encoder->context->type = PA_JSON_CONTEXT_TOP;
1061 pa_assert(encoder->context);
1062 pa_assert(encoder->context->type == PA_JSON_CONTEXT_OBJECT);