aboutsummaryrefslogtreecommitdiffstats
path: root/wrap-json.c
AgeCommit message (Collapse)AuthorFilesLines
2018-12-13wrap-json: Improvementsguppy_6.99.3guppy/6.99.36.99.3José 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-07-23Enhance 'wrap_json_clone_depth' descriptionflounder_5.99.2flounder/5.99.25.99.2Jonathan 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-06-22Fix warnings due to json-c evolutionflounder_5.99.1flounder/5.99.15.99.1Sebastien 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-06-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-06-07wrap-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-05-29Fixed 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-05-22Fixed 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-05-14wrap-json: Fix warningsjobol1-4/+4
Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-05-14wrap-json: Accept null as valid base64jobol1-9/+18
Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-05-14wrap-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-05-14wrap-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-04-17Fix 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-04-13wrap-json: Add base64 byte buffer supportjobol1-4/+206
Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-04-03Linting/Fix: remove warning int/size_t conversionRomain Forlot1-5/+5
Change-Id: I831bac418f5c12c9a747b08ea8be72dcbe1d4ea3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2017-08-22Initializing the repoRomain Forlot1-0/+939
Change-Id: I354a1c136a57e1ec8d511041fbd13a19b730c419 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>