jansson.git
14 years agojansson 1.0.2 v1.0.2
Petri Lehtinen [Tue, 8 Sep 2009 13:48:26 +0000 (16:48 +0300)]
jansson 1.0.2

14 years agoload: Handle EOF correctly
Petri Lehtinen [Tue, 8 Sep 2009 13:22:16 +0000 (16:22 +0300)]
load: Handle EOF correctly

In stream_get(), EOF never got it to stream->buffer and because of
this, stream_unget() failed on some situations. This patch makes
stream_get() handle EOF just like any other byte.

As a "side effect", lex_scan_string() now needs to unget the EOF, or
otherwise it ends up in error message on premature end of input.

14 years agoAdd CHANGES
Petri Lehtinen [Sun, 6 Sep 2009 09:45:47 +0000 (12:45 +0300)]
Add CHANGES

14 years agojansson 1.0.1 v1.0.1
Petri Lehtinen [Fri, 4 Sep 2009 17:58:55 +0000 (20:58 +0300)]
jansson 1.0.1

14 years agojansson.h: Fix typo
Petri Lehtinen [Fri, 4 Sep 2009 12:21:00 +0000 (15:21 +0300)]
jansson.h: Fix typo

json_is_true was spelled jsin_is_true. Quite fatal.

14 years agojansson 1.0 v1.0
Petri Lehtinen [Tue, 25 Aug 2009 18:50:47 +0000 (21:50 +0300)]
jansson 1.0

14 years agoDistribute appropriate files
Petri Lehtinen [Tue, 25 Aug 2009 18:24:07 +0000 (21:24 +0300)]
Distribute appropriate files

14 years agotest: Add Makefile.am to test/testprogs
Petri Lehtinen [Tue, 25 Aug 2009 18:23:16 +0000 (21:23 +0300)]
test: Add Makefile.am to test/testprogs

This way it's an individual subdirectory and things go easier.

14 years agoAdd some missing copyright notices
Petri Lehtinen [Tue, 25 Aug 2009 14:50:41 +0000 (17:50 +0300)]
Add some missing copyright notices

14 years agoDetect garbage near EOF in json_loadf() and json_load_file()
Petri Lehtinen [Mon, 24 Aug 2009 17:58:59 +0000 (20:58 +0300)]
Detect garbage near EOF in json_loadf() and json_load_file()

14 years agoAdd test for numbers
Petri Lehtinen [Mon, 24 Aug 2009 17:54:40 +0000 (20:54 +0300)]
Add test for numbers

14 years agoExpand value test coverage
Petri Lehtinen [Tue, 18 Aug 2009 18:33:45 +0000 (21:33 +0300)]
Expand value test coverage

14 years agoarray: Fix a few checks and a leak
Petri Lehtinen [Sun, 23 Aug 2009 10:32:10 +0000 (13:32 +0300)]
array: Fix a few checks and a leak

14 years agorun-test: Don't remove all testlogs when starting a new test suite
Petri Lehtinen [Sun, 23 Aug 2009 10:00:22 +0000 (13:00 +0300)]
run-test: Don't remove all testlogs when starting a new test suite

14 years agoAdd README and API reference
Petri Lehtinen [Sun, 2 Aug 2009 18:26:37 +0000 (21:26 +0300)]
Add README and API reference

14 years agoRefuse to dump other types than array and object as the root value
Petri Lehtinen [Tue, 4 Aug 2009 17:54:47 +0000 (20:54 +0300)]
Refuse to dump other types than array and object as the root value

14 years agoRemove unimplemented json_clone()
Petri Lehtinen [Tue, 28 Jul 2009 08:37:06 +0000 (11:37 +0300)]
Remove unimplemented json_clone()

14 years agoAdd macro json_is_boolean
Petri Lehtinen [Tue, 28 Jul 2009 08:36:53 +0000 (11:36 +0300)]
Add macro json_is_boolean

14 years agoAdd LICENSE and a copyright note to all sources
Petri Lehtinen [Tue, 28 Jul 2009 08:01:52 +0000 (11:01 +0300)]
Add LICENSE and a copyright note to all sources

14 years agoRename json_{load,dump} to json_{load,dump}_file
Petri Lehtinen [Tue, 28 Jul 2009 07:57:17 +0000 (10:57 +0300)]
Rename json_{load,dump} to json_{load,dump}_file

14 years agoFix some memory leaks and invalid memory references
Petri Lehtinen [Tue, 28 Jul 2009 07:37:52 +0000 (10:37 +0300)]
Fix some memory leaks and invalid memory references

14 years agoEnhance test system
Petri Lehtinen [Sun, 26 Jul 2009 19:44:11 +0000 (22:44 +0300)]
Enhance test system

- Tests are now named
- Testlogs are preserved between runs
- Tests can be run through Valgrind Memcheck tool

14 years agoExpand encoder test coverage
Petri Lehtinen [Sun, 26 Jul 2009 18:51:45 +0000 (21:51 +0300)]
Expand encoder test coverage

14 years agoExpand parser and Unicode test coverage
Petri Lehtinen [Sat, 18 Jul 2009 12:59:55 +0000 (15:59 +0300)]
Expand parser and Unicode test coverage

14 years agoImplement support for \u escapes
Petri Lehtinen [Tue, 14 Jul 2009 17:47:57 +0000 (20:47 +0300)]
Implement support for \u escapes

14 years agoShow the whole UTF-8 sequence in error message, not just the first byte
Petri Lehtinen [Tue, 14 Jul 2009 17:45:28 +0000 (20:45 +0300)]
Show the whole UTF-8 sequence in error message, not just the first byte

14 years agoRemove TODO
Petri Lehtinen [Tue, 14 Jul 2009 08:12:31 +0000 (11:12 +0300)]
Remove TODO

14 years agoReport errors from lexical and stream level in parser
Petri Lehtinen [Mon, 13 Jul 2009 20:34:31 +0000 (23:34 +0300)]
Report errors from lexical and stream level in parser

Before, only the syntax level (parse_*) was able to set the error
string. This patch fixes the situation so that lexical (lex_*) and
stream (stream_*) levels can report detailed error messages.

Also, instead of 0, EOF is now returned by stream on error.

14 years agoGet rid of JSON_SORT_KEYS dump flag
Petri Lehtinen [Mon, 13 Jul 2009 18:39:51 +0000 (21:39 +0300)]
Get rid of JSON_SORT_KEYS dump flag

Object sorting will be implemented later.

14 years agoDecode and check for correct UTF-8
Petri Lehtinen [Mon, 13 Jul 2009 18:03:09 +0000 (21:03 +0300)]
Decode and check for correct UTF-8

All strings (decoded JSON text, the argument of json_string(), the key
argument of json_object_set()) are checked for valid UTF-8.

14 years agoStreamify the loader
Petri Lehtinen [Mon, 13 Jul 2009 08:01:20 +0000 (11:01 +0300)]
Streamify the loader

It's no longer needed to load the whole input into a string and then
parse from the string. Instead, the input is read as needed from
a string or file.

14 years agoGet rid of json_dumpfd and json_loadfd
Petri Lehtinen [Mon, 13 Jul 2009 07:31:42 +0000 (10:31 +0300)]
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.

14 years agoLittle clean-up in parser
Petri Lehtinen [Sat, 11 Jul 2009 08:16:14 +0000 (11:16 +0300)]
Little clean-up in parser

Before, json_loads checked for '[' or '{' at the beginning. Now
there's a dedicated function for that: parse_json(). Also rename
parse() to parse_value().

14 years agoUnify naming in parser
Petri Lehtinen [Sat, 11 Jul 2009 07:52:57 +0000 (10:52 +0300)]
Unify naming in parser

No functional changes.

14 years agoMake the lexer not depend on locale
Petri Lehtinen [Thu, 9 Jul 2009 18:48:04 +0000 (21:48 +0300)]
Make the lexer not depend on locale

... by not using isalpha() and isspace(). While at it, fix some other
minor things.

14 years agoDon't dump extra spaces when indenting
Petri Lehtinen [Thu, 9 Jul 2009 17:54:29 +0000 (20:54 +0300)]
Don't dump extra spaces when indenting

14 years agoAdd some tests
Petri Lehtinen [Thu, 9 Jul 2009 18:01:40 +0000 (21:01 +0300)]
Add some tests

14 years agoFix dumping of Unicode control codes
Petri Lehtinen [Sat, 4 Jul 2009 19:02:16 +0000 (22:02 +0300)]
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.

14 years agoFix number tokenizer
Petri Lehtinen [Sat, 4 Jul 2009 10:18:49 +0000 (13:18 +0300)]
Fix number tokenizer

14 years agoFix empty array dumping
Petri Lehtinen [Fri, 3 Jul 2009 20:22:47 +0000 (23:22 +0300)]
Fix empty array dumping

14 years agostrbuffer: Optimize string termination
Petri Lehtinen [Tue, 30 Jun 2009 11:39:55 +0000 (14:39 +0300)]
strbuffer: Optimize string termination

Do not zero all of the memory, just the first unused byte to make the
string null terminated.

14 years agoSeparate integers and real numbers
Petri Lehtinen [Mon, 22 Jun 2009 21:14:28 +0000 (00:14 +0300)]
Separate integers and real numbers

14 years agoUse -Werror
Petri Lehtinen [Mon, 22 Jun 2009 21:06:38 +0000 (00:06 +0300)]
Use -Werror

14 years agoFix json_loadf and json_loadfd with empty input
Petri Lehtinen [Mon, 22 Jun 2009 18:09:25 +0000 (21:09 +0300)]
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.

14 years agoPrint correct error message on premature end of array
Petri Lehtinen [Sun, 21 Jun 2009 13:04:43 +0000 (16:04 +0300)]
Print correct error message on premature end of array

14 years agoFix json_set_error
Petri Lehtinen [Mon, 15 Jun 2009 19:30:52 +0000 (22:30 +0300)]
Fix json_set_error

Both error->line and error->text were set improperly, sigh.

14 years agoDon't use AM_MAINTAINER_MODE
Petri Lehtinen [Mon, 15 Jun 2009 19:30:17 +0000 (22:30 +0300)]
Don't use AM_MAINTAINER_MODE

14 years agoAdd TODO
Petri Lehtinen [Sun, 14 Jun 2009 07:33:20 +0000 (10:33 +0300)]
Add TODO

14 years agoFix a few memory leaks in json_parse_object()
Petri Lehtinen [Sat, 13 Jun 2009 19:54:57 +0000 (22:54 +0300)]
Fix a few memory leaks in json_parse_object()

14 years agoImplement json_load, json_loadf and json_loadfd
Petri Lehtinen [Sat, 13 Jun 2009 19:28:26 +0000 (22:28 +0300)]
Implement json_load, json_loadf and json_loadfd

14 years agostrbuffer_value: Return a read-only pointer rather than duplicating the value
Petri Lehtinen [Sat, 13 Jun 2009 19:26:45 +0000 (22:26 +0300)]
strbuffer_value: Return a read-only pointer rather than duplicating the value

14 years agostrbuffer: Allocate enough space for value initially
Petri Lehtinen [Sat, 13 Jun 2009 19:26:23 +0000 (22:26 +0300)]
strbuffer: Allocate enough space for value initially

14 years agoImplement strbuffer
Petri Lehtinen [Thu, 11 Jun 2009 05:56:11 +0000 (08:56 +0300)]
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().

14 years agoMove max() to util.h
Petri Lehtinen [Thu, 11 Jun 2009 05:54:40 +0000 (08:54 +0300)]
Move max() to util.h

14 years agoImplement json_dump and json_dumps
Petri Lehtinen [Tue, 9 Jun 2009 19:37:31 +0000 (22:37 +0300)]
Implement json_dump and json_dumps

14 years agoAdd autotools generated files to .gitignore
Petri Lehtinen [Sat, 16 May 2009 19:26:51 +0000 (22:26 +0300)]
Add autotools generated files to .gitignore

14 years agoImplement dumping to an fd
Petri Lehtinen [Sat, 16 May 2009 12:15:01 +0000 (15:15 +0300)]
Implement dumping to an fd

14 years agoRefactor error reporting
Petri Lehtinen [Wed, 13 May 2009 19:25:34 +0000 (22:25 +0300)]
Refactor error reporting

14 years agoUse autoconf, automake & libtool
Petri Lehtinen [Tue, 12 May 2009 19:21:50 +0000 (22:21 +0300)]
Use autoconf, automake & libtool

14 years agoFix json_object_get
Petri Lehtinen [Tue, 12 May 2009 19:15:48 +0000 (22:15 +0300)]
Fix json_object_get

14 years agoGet rid of include/
Petri Lehtinen [Tue, 12 May 2009 19:07:50 +0000 (22:07 +0300)]
Get rid of include/

14 years agoParse an empty object correctly
Petri Lehtinen [Wed, 6 May 2009 18:01:00 +0000 (21:01 +0300)]
Parse an empty object correctly

14 years agoImplement dumping to file
Petri Lehtinen [Tue, 12 May 2009 18:34:14 +0000 (21:34 +0300)]
Implement dumping to file

14 years agoBump hashtable, allocate object->hashtable statically
Petri Lehtinen [Thu, 30 Apr 2009 13:38:39 +0000 (16:38 +0300)]
Bump hashtable, allocate object->hashtable statically

Hashtable code from git://github.com/akheron/hashtable.git commit
7331ba6acdb415a2af62ae3e93fdd39c2a83b768

14 years agoAdd support for iterating over objects
Petri Lehtinen [Thu, 30 Apr 2009 13:38:22 +0000 (16:38 +0300)]
Add support for iterating over objects

14 years agoInitial import
Petri Lehtinen [Fri, 6 Feb 2009 18:26:27 +0000 (20:26 +0200)]
Initial import