1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11 /*
12 * Copyright (c) 2014, Joyent, Inc.
13 */
14
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <strings.h>
18 #include <wchar.h>
19 #include <sys/debug.h>
20
21 #include "libnvpair.h"
22
23 #define FPRINTF(fp, ...) \
24 do { \
25 if (fprintf(fp, __VA_ARGS__) < 0) \
26 return (-1); \
27 } while (0)
28
29 /*
30 * When formatting a string for JSON output we must escape certain characters,
31 * as described in RFC4627. This applies to both member names and
|
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11 /*
12 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
13 * Copyright (c) 2014, Joyent, Inc.
14 */
15
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <strings.h>
19 #include <wchar.h>
20 #include <sys/debug.h>
21
22 #include "libnvpair.h"
23
24 #define FPRINTF(fp, ...) \
25 do { \
26 if (fprintf(fp, __VA_ARGS__) < 0) \
27 return (-1); \
28 } while (0)
29
30 /*
31 * When formatting a string for JSON output we must escape certain characters,
32 * as described in RFC4627. This applies to both member names and
|