Commit Graph

12 Commits

Author SHA1 Message Date
Petri Lehtinen
4c414bdd6d Get rid of json_dumpfd and json_loadfd
fdopen() makes supporting separate API for file descriptors useless.
Supporting fd's also makes Jansson less portable.
2009-07-13 21:45:16 +03:00
Petri Lehtinen
68e948f567 Don't dump extra spaces when indenting 2009-07-09 21:01:43 +03:00
Petri Lehtinen
6b14df13cc Fix dumping of Unicode control codes
Inside strings, All UTF-8 characters except for \, " and Unicode
control codes are dumped as-is. The control codes that have a special
one-character escape use that escape, and other control codes are
dumped using the \uXXXX escape.
2009-07-09 20:59:52 +03:00
Petri Lehtinen
4384776776 Fix empty array dumping 2009-07-04 13:19:41 +03:00
Petri Lehtinen
b724c2b122 Separate integers and real numbers 2009-07-04 13:19:25 +03:00
Petri Lehtinen
b1fe723a7f Fix json_loadf and json_loadfd with empty input
Nothing was appended to strbuffer, so the buffer was left empty. An
empty strbuffer is not an empty string but NULL, so the result was a
segfault.

This patch fixes the problem by initializing strbuffer to an empty
string.
2009-06-30 13:55:20 +03:00
Petri Lehtinen
8c697312e4 strbuffer_value: Return a read-only pointer rather than duplicating the value 2009-06-13 22:27:23 +03:00
Petri Lehtinen
197d3aa160 Implement strbuffer
String buffer (strbuffer) is an object that resizes automatically when
data is added to it. It was implemented by generalizing the technique
used in json_dumps().
2009-06-11 08:56:11 +03:00
Petri Lehtinen
7764f3f321 Implement json_dump and json_dumps 2009-06-09 22:37:31 +03:00
Petri Lehtinen
d1407bed3a Implement dumping to an fd 2009-05-16 15:15:01 +03:00
Petri Lehtinen
9ea51b2855 Implement dumping to file 2009-05-12 21:44:45 +03:00
Petri Lehtinen
17a69c2d66 Initial import 2009-05-12 21:44:01 +03:00