1. Apr 21, 2011
  2. Apr 05, 2011
  3. Mar 31, 2011
  4. Mar 30, 2011
    • Petri Lehtinen's avatar
      Fix invalid object key hashing in json_unpack() strict checking mode · 0944ac8d
      Petri Lehtinen authored
      The keys which are stored temporarily to a hashtable to make sure that
      all object keys are unpacked, were hashed with the object key hashing
      function. It is meant to compute hashes for object_key_t values, and
      it works incorrectly for plain strings.
      
      Fixed by introducing suitable functions for hashing and comparing
      strings for string-keyed hashtables.
      0944ac8d
  5. Mar 27, 2011
  6. Mar 21, 2011
  7. Mar 11, 2011
  8. Mar 01, 2011
  9. Feb 28, 2011
  10. Feb 26, 2011
  11. Feb 25, 2011
  12. Feb 23, 2011
  13. Feb 22, 2011
    • Petri Lehtinen's avatar
      Move json_error_t documentation to its own section · a33c3628
      Petri Lehtinen authored
      json_error_t is used in the decoder and in the pack and unpack API's,
      so it's better to have a separate section for it.
      a33c3628
    • Petri Lehtinen's avatar
      Truncate error source from start, not end, if it's too long to fit · 50dc64a7
      Petri Lehtinen authored
      It's more helpful to see "...bar/baz.json" instead of "/long/path/to".
      50dc64a7
    • Petri Lehtinen's avatar
      Refactor decoder input stream · 5df7b793
      Petri Lehtinen authored
      - Add a new field position to the json_error_t structure. This is the
        position in bytes from the beginning of the input.
      
      - Keep track of line, column and input position in the stream level.
        Previously, only line was tracked, and it was in the lexer level, so
        this info was not available for UTF-8 decoding errors.
      
      - While at it, refactor tests so that no separate "stripped" tests are
        required. json_process is now able to strip whitespace from its
        input, and the "valid" and "invalid" test suites now use this to
        test both non-stripped and stripped input.
      
      Closes GH-9.
      5df7b793
  14. Feb 19, 2011
  15. Feb 17, 2011
    • Petri Lehtinen's avatar
      Add custom memory allocation · 4be9e9e7
      Petri Lehtinen authored
      Thanks to Basile Starynkevitch for the suggestion and initial patch.
      Thanks to Jonathan Landis and Deron Meranda for showing how this can
      be utilized for implementing secure memory operations.
      4be9e9e7
  16. Feb 04, 2011
  17. Jan 30, 2011
  18. Jan 26, 2011
  19. Jan 25, 2011
    • Petri Lehtinen's avatar
      Expand the pack/unpack API, implement unpack flags · 579c2918
      Petri Lehtinen authored
      Expand the pack/unpack API: json_(un)pack is the simple version with
      no error output, json_(un)pack_ex has error output and flags,
      json_v(un)pack_ex is a va_list version of json_(un)pack_ex.
      
      Implement unpacking flags:
      
      - JSON_UNPACK_ONLY turns off extra validation, i.e. array and object
        unpacking doesn't check that all items are unpacked. This is really
        just convenience for not adding '*' after each object and array.
      
      - JSON_VALIDATE_ONLY turns off unpacking, i.e. no varargs are expected
        and nothing is unpacked.
      579c2918
    • Petri Lehtinen's avatar
      Add validation features to json_unpack() · 2770dca2
      Petri Lehtinen authored
      * By default, json_unpack() now checks that all items of arrays and
        objects are unpacked. This is useful for validation.
      
      * Add format specifier '*' to suppress this check for individual
        arrays and objects. '*' must appear as the last format specifier
        before the closing ']' or '}'.
      2770dca2
    • Petri Lehtinen's avatar
      Rename variadic.c to pack_unpack.c · 6825c2c7
      Petri Lehtinen authored
      6825c2c7
    • Petri Lehtinen's avatar
      Refactor json_unpack() · 6d1f28f0
      Petri Lehtinen authored
      * Use the format string scanner from the previous commit (with the
        simpler separator skipping semantics)
      
      * Split json_vnunpack() to three separate functions for unpacking
        objects, arrays and "simple" values
      
      * Always return 0 on success, 1 on error
      
      This shaves around 100 more lines from the original implementation.
      6d1f28f0