Lines Matching refs:fp
23 #define FPRINTF(fp, ...) \ argument
25 if (fprintf(fp, __VA_ARGS__) < 0) \
46 nvlist_print_json_string(FILE *fp, const char *input) in nvlist_print_json_string() argument
54 FPRINTF(fp, "\""); in nvlist_print_json_string()
58 FPRINTF(fp, "\\\""); in nvlist_print_json_string()
61 FPRINTF(fp, "\\n"); in nvlist_print_json_string()
64 FPRINTF(fp, "\\r"); in nvlist_print_json_string()
67 FPRINTF(fp, "\\\\"); in nvlist_print_json_string()
70 FPRINTF(fp, "\\f"); in nvlist_print_json_string()
73 FPRINTF(fp, "\\t"); in nvlist_print_json_string()
76 FPRINTF(fp, "\\b"); in nvlist_print_json_string()
86 FPRINTF(fp, "\\u%04x", (int)(0xffff & c)); in nvlist_print_json_string()
92 FPRINTF(fp, "%c", (int)(0xff & c)); in nvlist_print_json_string()
107 FPRINTF(fp, "\""); in nvlist_print_json_string()
117 nvlist_print_json(FILE *fp, nvlist_t *nvl) in nvlist_print_json() argument
122 FPRINTF(fp, "{"); in nvlist_print_json()
129 FPRINTF(fp, ","); in nvlist_print_json()
133 if (nvlist_print_json_string(fp, nvpair_name(curr)) == -1) in nvlist_print_json()
135 FPRINTF(fp, ":"); in nvlist_print_json()
140 if (nvlist_print_json_string(fp, string) == -1) in nvlist_print_json()
146 FPRINTF(fp, "true"); in nvlist_print_json()
151 FPRINTF(fp, "%s", fnvpair_value_boolean_value(curr) == in nvlist_print_json()
157 FPRINTF(fp, "%hhu", fnvpair_value_byte(curr)); in nvlist_print_json()
162 FPRINTF(fp, "%hhd", fnvpair_value_int8(curr)); in nvlist_print_json()
167 FPRINTF(fp, "%hhu", fnvpair_value_uint8_t(curr)); in nvlist_print_json()
172 FPRINTF(fp, "%hd", fnvpair_value_int16(curr)); in nvlist_print_json()
177 FPRINTF(fp, "%hu", fnvpair_value_uint16(curr)); in nvlist_print_json()
182 FPRINTF(fp, "%d", fnvpair_value_int32(curr)); in nvlist_print_json()
187 FPRINTF(fp, "%u", fnvpair_value_uint32(curr)); in nvlist_print_json()
192 FPRINTF(fp, "%lld", in nvlist_print_json()
198 FPRINTF(fp, "%llu", in nvlist_print_json()
206 FPRINTF(fp, "%llu", (unsigned long long)val); in nvlist_print_json()
213 FPRINTF(fp, "%f", val); in nvlist_print_json()
218 if (nvlist_print_json(fp, in nvlist_print_json()
228 FPRINTF(fp, "["); in nvlist_print_json()
231 FPRINTF(fp, ","); in nvlist_print_json()
232 if (nvlist_print_json_string(fp, val[i]) == -1) in nvlist_print_json()
235 FPRINTF(fp, "]"); in nvlist_print_json()
243 FPRINTF(fp, "["); in nvlist_print_json()
246 FPRINTF(fp, ","); in nvlist_print_json()
247 if (nvlist_print_json(fp, val[i]) == -1) in nvlist_print_json()
250 FPRINTF(fp, "]"); in nvlist_print_json()
258 FPRINTF(fp, "["); in nvlist_print_json()
261 FPRINTF(fp, ","); in nvlist_print_json()
262 FPRINTF(fp, val[i] == B_TRUE ? in nvlist_print_json()
265 FPRINTF(fp, "]"); in nvlist_print_json()
273 FPRINTF(fp, "["); in nvlist_print_json()
276 FPRINTF(fp, ","); in nvlist_print_json()
277 FPRINTF(fp, "%hhu", val[i]); in nvlist_print_json()
279 FPRINTF(fp, "]"); in nvlist_print_json()
287 FPRINTF(fp, "["); in nvlist_print_json()
290 FPRINTF(fp, ","); in nvlist_print_json()
291 FPRINTF(fp, "%hhu", val[i]); in nvlist_print_json()
293 FPRINTF(fp, "]"); in nvlist_print_json()
301 FPRINTF(fp, "["); in nvlist_print_json()
304 FPRINTF(fp, ","); in nvlist_print_json()
305 FPRINTF(fp, "%hd", val[i]); in nvlist_print_json()
307 FPRINTF(fp, "]"); in nvlist_print_json()
315 FPRINTF(fp, "["); in nvlist_print_json()
318 FPRINTF(fp, ","); in nvlist_print_json()
319 FPRINTF(fp, "%hu", val[i]); in nvlist_print_json()
321 FPRINTF(fp, "]"); in nvlist_print_json()
329 FPRINTF(fp, "["); in nvlist_print_json()
332 FPRINTF(fp, ","); in nvlist_print_json()
333 FPRINTF(fp, "%hd", val[i]); in nvlist_print_json()
335 FPRINTF(fp, "]"); in nvlist_print_json()
343 FPRINTF(fp, "["); in nvlist_print_json()
346 FPRINTF(fp, ","); in nvlist_print_json()
347 FPRINTF(fp, "%u", val[i]); in nvlist_print_json()
349 FPRINTF(fp, "]"); in nvlist_print_json()
357 FPRINTF(fp, "["); in nvlist_print_json()
360 FPRINTF(fp, ","); in nvlist_print_json()
361 FPRINTF(fp, "%d", val[i]); in nvlist_print_json()
363 FPRINTF(fp, "]"); in nvlist_print_json()
371 FPRINTF(fp, "["); in nvlist_print_json()
374 FPRINTF(fp, ","); in nvlist_print_json()
375 FPRINTF(fp, "%llu", in nvlist_print_json()
378 FPRINTF(fp, "]"); in nvlist_print_json()
386 FPRINTF(fp, "["); in nvlist_print_json()
389 FPRINTF(fp, ","); in nvlist_print_json()
390 FPRINTF(fp, "%lld", (long long)val[i]); in nvlist_print_json()
392 FPRINTF(fp, "]"); in nvlist_print_json()
401 FPRINTF(fp, "}"); in nvlist_print_json()