summaryrefslogtreecommitdiff
path: root/json
Commit message (Collapse)AuthorAgeFilesLines
* apr_json_decode: Return APR_ENOSPC if a decoded array is above INT_MAX.Yann Ylavic2022-06-231-1/+4
| | | | | | | | | * json/apr_json_decode.c(apr_json_decode_array): Return APR_ENOSPC should the int counter overflow. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902207 13f79535-47bb-0310-9956-ffa450edef68
* apr_json_decode: apr_array_header_t uses ints.Yann Ylavic2022-06-231-2/+2
| | | | | | | | | * json/apr_json_decode.c(apr_json_decode_array): apr_array_make() want an int. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902196 13f79535-47bb-0310-9956-ffa450edef68
* Add APR_DECLARE() to apr_json_*() and apr_jose_*() functions declaration toIvan Zhakov2019-10-083-30/+41
| | | | | | fix 32-bit Windows build. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1868125 13f79535-47bb-0310-9956-ffa450edef68
* Fix bug in apr_json_double_create().Ivan Zhakov2019-05-271-1/+1
| | | | | | | | | | | | * json/apr_json.c (apr_json_double_create): Assign double number to DNUMBER instead of LNUMBER. * test/testjson.c (test_json_create): New test. (testjson): Call test_json_create test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860152 13f79535-47bb-0310-9956-ffa450edef68
* apr_json: Split apr_json_object_set() into apr_json_object_set() withGraham Leggett2018-09-012-6/+48
| | | | | | | | | a simple key, and apr_json_object_set() with the key as an apr_json_value_t, so the caller has a simpler interface to use to add a key value pair to an object. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839840 13f79535-47bb-0310-9956-ffa450edef68
* Axe the 'pool' arg from apr_json_array_add() since it's not needed.Graham Leggett2018-09-012-2/+2
| | | | | | | (Reinstated from 1839755) git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839817 13f79535-47bb-0310-9956-ffa450edef68
* Revert 1839755 for now to unblock apr_jose.h.Graham Leggett2018-09-012-15/+17
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839813 13f79535-47bb-0310-9956-ffa450edef68
* Revert 1839779 for now to unblock apr_jose.h.Graham Leggett2018-09-012-43/+17
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839812 13f79535-47bb-0310-9956-ffa450edef68
* apr_json: follow up to r1839755: preserve formatting when decoding object keys.Yann Ylavic2018-08-312-17/+43
| | | | | | | | | | | The object key-value pair parsed by the JSON decoder contained pre/post spaces which we lost by changing the key type (to a C string) in apr_json_object_set(). Add a new/private apr__json_object_set() helper taking an apr_json_value_t key and use it in both apr_json_object_set() and apr_json_decode_object(). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839779 13f79535-47bb-0310-9956-ffa450edef68
* apr_json: object keys are strings.Yann Ylavic2018-08-312-17/+15
| | | | | | | | | | | | | Make this clear in the API by requiring a usual string in apr_json_object_set() and creating the apr_json_string_t from it. It's also more user friendly as otherwise apr_json_string_create() is to be used when setting an entry. Also, axe the 'pool' arg from apr_json_array_add() since it's not needed. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839755 13f79535-47bb-0310-9956-ffa450edef68
* Make it possible to iterate through JSON arrays as well as JSON objects.Graham Leggett2018-08-313-42/+113
| | | | | | | | As a side effect, this removes the need for the temporary pool during JSON decoding. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839735 13f79535-47bb-0310-9956-ffa450edef68
* Add apr_json_object_first() and apr_json_object_next(), allowing theGraham Leggett2018-08-301-0/+36
| | | | | | | caller to iterate through object key value pairs. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839675 13f79535-47bb-0310-9956-ffa450edef68
* Teach apr_json_object_get() to support a length, to align with apr_hash_get().Graham Leggett2018-08-301-2/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839658 13f79535-47bb-0310-9956-ffa450edef68
* Add the ability to overlay one JSON object over another.Graham Leggett2018-08-031-0/+56
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1837383 13f79535-47bb-0310-9956-ffa450edef68
* Pass the apr_json_value_t into the apr_json_object_get() function toGraham Leggett2018-08-021-2/+6
| | | | | | | be consistent with the rest of the API. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1837327 13f79535-47bb-0310-9956-ffa450edef68
* Begone foul tabs, and blight not our shores.Graham Leggett2018-07-162-55/+55
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836027 13f79535-47bb-0310-9956-ffa450edef68
* apr_json: strengthen decoding of float and object key.Yann Ylavic2018-07-161-13/+22
| | | | | | | | A float number can't start with a dot, and an object key is a string so we can avoid parsing any type before failing. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1836017 13f79535-47bb-0310-9956-ffa450edef68
* Rework the create functions to create a JSON object for eachGraham Leggett2018-07-153-17/+114
| | | | | | | JSON type. Simplifies code that uses the library. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835979 13f79535-47bb-0310-9956-ffa450edef68
* Remove redundant checks, trailing garbage is caught elsewhere.Graham Leggett2018-07-081-12/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835366 13f79535-47bb-0310-9956-ffa450edef68
* Create the subpool after the failure cases are all considerd.Graham Leggett2018-07-081-7/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835364 13f79535-47bb-0310-9956-ffa450edef68
* Fix the string unescape logic for multiple escaped characters. AddGraham Leggett2018-07-081-13/+13
| | | | | | | a unit test. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835360 13f79535-47bb-0310-9956-ffa450edef68
* apr_json: Add support for encoding and decoding RFC8259 JSON.Graham Leggett2018-07-083-0/+1193
Submitted by: Moriyoshi Koizumi <mozo mozo jp> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1835348 13f79535-47bb-0310-9956-ffa450edef68