Lines Matching refs:level
46 static int level; variable
55 if (stack[level].compact) in do_comma_indent()
58 if (stack[level].count++ > 0) { in do_comma_indent()
63 if (stack[level].compact) in do_comma_indent()
66 eb = fprintf(jsonfh, "\t%.*s", level, indent) < 0; in do_comma_indent()
72 if (stack[level].type == ARRAY) in do_name()
83 for (i = level; i > 0; i--) in do_find()
97 level = 0; in json_do_start()
98 stack[level].type = START; in json_do_start()
108 while (level > 0) in json_do_finish()
124 for (i = level - l; i > 0; i--) in json_do_array()
129 if (stack[level].type == ARRAY) in json_do_array()
132 if (stack[level].compact) in json_do_array()
139 if (++level >= JSON_MAX_STACK) in json_do_array()
142 stack[level].name = name; in json_do_array()
143 stack[level].type = ARRAY; in json_do_array()
144 stack[level].count = 0; in json_do_array()
146 stack[level].compact = stack[level - 1].compact; in json_do_array()
157 for (i = level - l; i >= 0; i--) in json_do_object()
168 if (++level >= JSON_MAX_STACK) in json_do_object()
171 stack[level].name = name; in json_do_object()
172 stack[level].type = OBJECT; in json_do_object()
173 stack[level].count = 0; in json_do_object()
174 stack[level].compact = compact; in json_do_object()
182 if (stack[level].type == ARRAY) in json_do_end()
184 else if (stack[level].type == OBJECT) in json_do_end()
189 if (!stack[level].compact) { in json_do_end()
191 eb = fprintf(jsonfh, "\n%.*s%c", level, indent, c) < 0; in json_do_end()
197 stack[level].name = NULL; in json_do_end()
198 stack[level].type = NONE; in json_do_end()
199 stack[level].count = 0; in json_do_end()
200 stack[level].compact = 0; in json_do_end()
202 if (level-- <= 0) in json_do_end()
205 stack[level].count++; in json_do_end()