summaryrefslogtreecommitdiffstats
path: root/wrap-json.c
AgeCommit message (Collapse)AuthorFilesLines
2021-07-13gcc 11.x fixesneedlefish_13.93.0needlefish/13.93.0marlin_12.93.0marlin_12.92.0marlin_12.91.0marlin_12.90.1marlin/12.93.0marlin/12.92.0marlin/12.91.0marlin/12.90.113.93.012.93.012.92.012.91.012.90.1Scott Murray1-1/+1
In decode_base64 in wrap-json.c, initialize u16 as gcc now seems to miss that it will be initialized on the first loop iteration. Bug-AGL: SPEC-3819 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ic4a1a87ec64bd725d5a3f6e2d2a3901348b608f6
2019-10-09Add function to add one json array to another oneicefish_8.99.1icefish/8.99.18.99.1Jonathan Aillet1-1/+41
Add a function to add one json array to another one. The json array to add can be inserted at any place of the json array to complete using 'idx' parameter. Also, correct minor mistake in 'wrap_json_object_add' description. BUG-AGL: SPEC-2867 Change-Id: I8936f298a4499f265646a75584d7fe6b29700513 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-17wrap-json: ImprovementsJosé Bollo1-21/+25
* Most call "d = skip(++d);" are replaced by "d = skip(d + 1);" that is equivalent but that virtually doesn't assign transiently d with d+1. * make use of JSON_C_TO_STRING_NOSLASHESCAPE in test to improve output. Use a macro to reduce the code. * enforce 'wrap_json_check' to use 'wrap_json_vcheck' and 'wrap_json_match' to use 'wrap_json_vmatch'. Change-Id: I6e823da40415db4b54ec809455c93b39a8c5e9a5 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-12-13Enhance 'wrap_json_clone_depth' descriptionJonathan Aillet1-1/+5
Enhance 'wrap_json_clone_depth' description by adding details about clone depth using this function. Change-Id: Iede8fa6a697f12e8a32c1e15afdcef445edbcfe4 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-13Fix warnings due to json-c evolutionSebastien Douheret1-3/+3
Library json-c now returns size_t instead of int. Change-Id: Ib4f8bcd5dc6382fb3d189e83707a39dee8e14683 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
2018-12-13wrap-json: new helper functions for comparisonjobol1-28/+348
The new functions are - wrap_json_clone_depth: clone with defined depth - wrap_json_sort: sort an array accordingly to wrap_json_cmp - wrap_json_keys: compute the array of sorted keys - wrap_json_cmp: compare 2 items - wrap_json_equal: test equallity - wrap_json_contains: test inclusion Change-Id: I9787bff6c262fa2702c27802d771e2d487ce6309 Signed-off-by: jose bollo <jose.bollo@iot.bzh>
2018-12-13wrap-json: Add clone facilityJosé Bollo1-0/+86
This adds 3 new facilities: - wrap_json_clone: clones any json object superficially - wrap_json_clone_deep: clones any json object deeply - wrap_json_add: adds to an object the fields of an other object Change-Id: I3844d972aa6477c9dde6f66ad0b0604284a853a7 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-12-13Fixed build warnings with gcc >= 7.3Sebastien Douheret1-3/+3
Reduced the number of warnings in native host configuration (here Tumbleweed) in order to not hide true/real warnings that may appear in the future. Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
2018-12-13Fixed compilation warnings with gcc-7.2.0Thierry Bultel1-5/+5
Replaced some 'size_t' by 'int' Change-Id: I07492dad242b2c8f608f9cc90a4a257e48acec6a Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2018-12-13wrap-json: Fix warningsjobol1-4/+4
Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-12-13wrap-json: Accept null as valid base64jobol1-9/+18
Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-12-13wrap-json: Fix bug decoding empty base64jobol1-1/+2
The function 'decode_base64' was buggy because it freed 2 times the pointer 'result'. This came from the fact realloc frees the pointer and return NULL when the size if 0. Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-12-13wrap-json: Improve base64 en-de-codingjobol1-8/+26
The optional characters '*' and '?' weren't managed so the packing of y/Y base64 wasn't really entire. Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-12-13Fix GCC < v7 warning on maybe unitialized variableRomain Forlot1-2/+2
Initialization done under a switch case statement within a "for" loop which throw warning with GCC v6. Change-Id: I47b51598cc68943bab6f98bd87b7ba6f40caeafc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-13wrap-json: Add base64 byte buffer supportjobol1-4/+206
Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-12-13Linting/Fix: remove warning int/size_t conversionRomain Forlot1-5/+5
Change-Id: I831bac418f5c12c9a747b08ea8be72dcbe1d4ea3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-12-13Initializing the repoRomain Forlot1-0/+939
Change-Id: I354a1c136a57e1ec8d511041fbd13a19b730c419 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>