Lines Matching +full:prop +full:-
1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
32 for (i = 0; i < self->depth; ++i) in jsonw_indent()
33 fputs(" ", self->out); in jsonw_indent()
39 if (!self->pretty) in jsonw_eol()
42 putc('\n', self->out); in jsonw_eol()
49 if (self->sep != '\0') in jsonw_eor()
50 putc(self->sep, self->out); in jsonw_eor()
51 self->sep = ','; in jsonw_eor()
59 putc('"', self->out); in jsonw_puts()
63 fputs("\\t", self->out); in jsonw_puts()
66 fputs("\\n", self->out); in jsonw_puts()
69 fputs("\\r", self->out); in jsonw_puts()
72 fputs("\\f", self->out); in jsonw_puts()
75 fputs("\\b", self->out); in jsonw_puts()
78 fputs("\\\\", self->out); in jsonw_puts()
81 fputs("\\\"", self->out); in jsonw_puts()
84 putc(*str, self->out); in jsonw_puts()
86 putc('"', self->out); in jsonw_puts()
94 self->out = f; in jsonw_new()
95 self->depth = 0; in jsonw_new()
96 self->pretty = false; in jsonw_new()
97 self->sep = '\0'; in jsonw_new()
107 assert(self->depth == 0); in jsonw_destroy()
108 fputs("\n", self->out); in jsonw_destroy()
109 fflush(self->out); in jsonw_destroy()
116 self->pretty = on; in jsonw_pretty()
121 assert(self->depth == 0); in jsonw_reset()
122 self->sep = '\0'; in jsonw_reset()
129 putc(c, self->out); in jsonw_begin()
130 ++self->depth; in jsonw_begin()
131 self->sep = '\0'; in jsonw_begin()
136 assert(self->depth > 0); in jsonw_end()
138 --self->depth; in jsonw_end()
139 if (self->sep != '\0') in jsonw_end()
141 putc(c, self->out); in jsonw_end()
142 self->sep = ','; in jsonw_end()
151 self->sep = '\0'; in jsonw_name()
153 putc(':', self->out); in jsonw_name()
154 if (self->pretty) in jsonw_name()
155 putc(' ', self->out); in jsonw_name()
161 putc('"', self->out); in jsonw_vprintf_enquote()
162 vfprintf(self->out, fmt, ap); in jsonw_vprintf_enquote()
163 putc('"', self->out); in jsonw_vprintf_enquote()
172 vfprintf(self->out, fmt, ap); in jsonw_printf()
247 void jsonw_string_field(json_writer_t *self, const char *prop, const char *val) in jsonw_string_field() argument
249 jsonw_name(self, prop); in jsonw_string_field()
253 void jsonw_bool_field(json_writer_t *self, const char *prop, bool val) in jsonw_bool_field() argument
255 jsonw_name(self, prop); in jsonw_bool_field()
260 void jsonw_float_field(json_writer_t *self, const char *prop, double val) in jsonw_float_field() argument
262 jsonw_name(self, prop); in jsonw_float_field()
268 const char *prop, in jsonw_float_field_fmt() argument
272 jsonw_name(self, prop); in jsonw_float_field_fmt()
276 void jsonw_uint_field(json_writer_t *self, const char *prop, uint64_t num) in jsonw_uint_field() argument
278 jsonw_name(self, prop); in jsonw_uint_field()
282 void jsonw_hu_field(json_writer_t *self, const char *prop, unsigned short num) in jsonw_hu_field() argument
284 jsonw_name(self, prop); in jsonw_hu_field()
289 const char *prop, in jsonw_lluint_field() argument
292 jsonw_name(self, prop); in jsonw_lluint_field()
296 void jsonw_int_field(json_writer_t *self, const char *prop, int64_t num) in jsonw_int_field() argument
298 jsonw_name(self, prop); in jsonw_int_field()
302 void jsonw_null_field(json_writer_t *self, const char *prop) in jsonw_null_field() argument
304 jsonw_name(self, prop); in jsonw_null_field()
323 while (--argc) in main()