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)
33 fputs(" ", self->out);
39 if (!self->pretty)
42 putc('\n', self->out);
49 if (self->sep != '\0')
50 putc(self->sep, self->out);
51 self->sep = ',';
59 putc('"', self->out);
63 fputs("\\t", self->out);
66 fputs("\\n", self->out);
69 fputs("\\r", self->out);
72 fputs("\\f", self->out);
75 fputs("\\b", self->out);
78 fputs("\\\\", self->out);
81 fputs("\\\"", self->out);
84 putc(*str, self->out);
86 putc('"', self->out);
94 self->out = f;
95 self->depth = 0;
96 self->pretty = false;
97 self->sep = '\0';
107 assert(self->depth == 0);
108 fputs("\n", self->out);
109 fflush(self->out);
116 self->pretty = on;
121 assert(self->depth == 0);
122 self->sep = '\0';
129 putc(c, self->out);
130 ++self->depth;
131 self->sep = '\0';
136 assert(self->depth > 0);
138 --self->depth;
139 if (self->sep != '\0')
141 putc(c, self->out);
142 self->sep = ',';
151 self->sep = '\0';
153 putc(':', self->out);
154 if (self->pretty)
155 putc(' ', self->out);
161 putc('"', self->out);
162 vfprintf(self->out, fmt, ap);
163 putc('"', self->out);
172 vfprintf(self->out, fmt, ap);
247 void jsonw_string_field(json_writer_t *self, const char *prop, const char *val)
249 jsonw_name(self, prop);
253 void jsonw_bool_field(json_writer_t *self, const char *prop, bool val)
255 jsonw_name(self, prop);
260 void jsonw_float_field(json_writer_t *self, const char *prop, double val)
262 jsonw_name(self, prop);
268 const char *prop,
272 jsonw_name(self, prop);
276 void jsonw_uint_field(json_writer_t *self, const char *prop, uint64_t num)
278 jsonw_name(self, prop);
282 void jsonw_hu_field(json_writer_t *self, const char *prop, unsigned short num)
284 jsonw_name(self, prop);
289 const char *prop,
292 jsonw_name(self, prop);
296 void jsonw_int_field(json_writer_t *self, const char *prop, int64_t num)
298 jsonw_name(self, prop);
302 void jsonw_null_field(json_writer_t *self, const char *prop)
304 jsonw_name(self, prop);
323 while (--argc)