Skip to content

Commit 2cc4783

Browse files
authored
Update README.md
1 parent 1ca33c8 commit 2cc4783

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Write either to a file, or provide your own `fwrite`-like function and target:
2828
jsonwriter_handle jsonwriter_new_file(FILE *f);
2929
jsonwriter_handle jsonwriter_new(
3030
size_t (*write)(const void *, size_t, size_t, void *),
31-
void *write_arg
31+
void *write_arg
3232
);
3333
```
3434

@@ -40,7 +40,15 @@ For example:
4040
jsonwriter_start_object(h);
4141
jsonwriter_object_key(h, "hello");
4242
jsonwriter_str(h, "there!");
43+
jsonwriter_end(h); // or alternatively, for more strict use, `jsonwriter_end_object(h)`
44+
```
45+
46+
or, in a more concise form:
47+
```
48+
jsonwriter_start_object(h);
49+
jsonwriter_object_str(h, "hello", "there!"); // similar macros can be used for other types
4350
jsonwriter_end(h);
51+
4452
```
4553

4654
##### clean up

0 commit comments

Comments
 (0)