RTS API Documentation
1.10.11
|
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include "switch_cJSON_Utils.h"
Go to the source code of this file.
Macros | |
#define | true ((cJSON_bool)1) |
#define | false ((cJSON_bool)0) |
Enumerations | |
enum | patch_operation { INVALID, ADD, REMOVE, REPLACE, MOVE, COPY, TEST } |
Functions | |
static unsigned char * | cJSONUtils_strdup (const unsigned char *const string) |
static int | compare_strings (const unsigned char *string1, const unsigned char *string2, const cJSON_bool case_sensitive) |
static cJSON_bool | compare_pointers (const unsigned char *name, const unsigned char *pointer, const cJSON_bool case_sensitive) |
static size_t | pointer_encoded_length (const unsigned char *string) |
static void | encode_string_as_pointer (unsigned char *destination, const unsigned char *source) |
CJSON_PUBLIC (char *) | |
static cJSON * | get_array_item (const cJSON *array, size_t item) |
static cJSON_bool | decode_array_index_from_pointer (const unsigned char *const pointer, size_t *const index) |
static cJSON * | get_item_from_pointer (cJSON *const object, const char *pointer, const cJSON_bool case_sensitive) |
CJSON_PUBLIC (cJSON *) | |
static void | decode_pointer_inplace (unsigned char *string) |
static cJSON * | detach_item_from_array (cJSON *array, size_t which) |
static cJSON * | detach_path (cJSON *object, const unsigned char *path, const cJSON_bool case_sensitive) |
static cJSON * | sort_list (cJSON *list, const cJSON_bool case_sensitive) |
static void | sort_object (cJSON *const object, const cJSON_bool case_sensitive) |
static cJSON_bool | compare_json (cJSON *a, cJSON *b, const cJSON_bool case_sensitive) |
static cJSON_bool | insert_item_in_array (cJSON *array, size_t which, cJSON *newitem) |
static cJSON * | get_object_item (const cJSON *const object, const char *name, const cJSON_bool case_sensitive) |
static enum patch_operation | decode_patch_operation (const cJSON *const patch, const cJSON_bool case_sensitive) |
static void | overwrite_item (cJSON *const root, const cJSON replacement) |
static int | apply_patch (cJSON *object, const cJSON *patch, const cJSON_bool case_sensitive) |
CJSON_PUBLIC (int) | |
static void | compose_patch (cJSON *const patches, const unsigned char *const operation, const unsigned char *const path, const unsigned char *suffix, const cJSON *const value) |
CJSON_PUBLIC (void) | |
static void | create_patches (cJSON *const patches, const unsigned char *const path, cJSON *const from, cJSON *const to, const cJSON_bool case_sensitive) |
static cJSON * | merge_patch (cJSON *target, const cJSON *const patch, const cJSON_bool case_sensitive) |
static cJSON * | generate_merge_patch (cJSON *const from, cJSON *const to, const cJSON_bool case_sensitive) |
#define false ((cJSON_bool)0) |
Definition at line 58 of file cJSON_Utils.c.
#define true ((cJSON_bool)1) |
Definition at line 53 of file cJSON_Utils.c.
enum patch_operation |
Enumerator | |
---|---|
INVALID | |
ADD | |
REMOVE | |
REPLACE | |
MOVE | |
COPY | |
TEST |
Definition at line 720 of file cJSON_Utils.c.
|
static |
Definition at line 787 of file cJSON_Utils.c.
References ADD, cJSON_Invalid, cJSONUtils_strdup(), compare_json(), COPY, decode_array_index_from_pointer(), decode_patch_operation(), decode_pointer_inplace(), detach_path(), get_item_from_pointer(), get_object_item(), index, insert_item_in_array(), INVALID, MOVE, overwrite_item(), path, REMOVE, REPLACE, cJSON::string, TEST, value, and cJSON::valuestring.
Referenced by CJSON_PUBLIC().
CJSON_PUBLIC | ( | char * | ) |
Definition at line 183 of file cJSON_Utils.c.
References cJSON::child, cJSONUtils_strdup(), encode_string_as_pointer(), cJSON::next, pointer_encoded_length(), and cJSON::string.
Referenced by CJSON_PUBLIC(), create_patches(), generate_merge_patch(), and merge_patch().
CJSON_PUBLIC | ( | cJSON * | ) |
Definition at line 332 of file cJSON_Utils.c.
References CJSON_PUBLIC(), get_item_from_pointer(), and pointer.
CJSON_PUBLIC | ( | int | ) |
Definition at line 1016 of file cJSON_Utils.c.
References apply_patch(), cJSON::child, CJSON_PUBLIC(), cJSON::next, and patches.
CJSON_PUBLIC | ( | void | ) |
Definition at line 1114 of file cJSON_Utils.c.
References compose_patch().
|
static |
Definition at line 60 of file cJSON_Utils.c.
References length.
Referenced by apply_patch(), CJSON_PUBLIC(), and detach_path().
|
static |
Definition at line 584 of file cJSON_Utils.c.
References cJSON::child, cJSON_Array, cJSON_Number, cJSON_Object, cJSON_String, compare_strings(), cJSON::next, sort_object(), cJSON::string, cJSON::type, cJSON::valuedouble, cJSON::valueint, and cJSON::valuestring.
Referenced by apply_patch(), and generate_merge_patch().
|
static |
Definition at line 106 of file cJSON_Utils.c.
References pointer.
Referenced by get_item_from_pointer().
|
static |
Definition at line 77 of file cJSON_Utils.c.
Referenced by compare_json(), create_patches(), and sort_list().
|
static |
Definition at line 1074 of file cJSON_Utils.c.
References encode_string_as_pointer(), patch, and pointer_encoded_length().
Referenced by CJSON_PUBLIC(), and create_patches().
|
static |
Definition at line 1119 of file cJSON_Utils.c.
References cJSON::child, cJSON_Array, cJSON_Number, cJSON_Object, CJSON_PUBLIC(), cJSON_String, compare_strings(), compose_patch(), encode_string_as_pointer(), index, cJSON::next, patches, pointer_encoded_length(), sort_object(), cJSON::string, to, cJSON::type, cJSON::valuedouble, cJSON::valueint, and cJSON::valuestring.
|
static |
Definition at line 258 of file cJSON_Utils.c.
Referenced by apply_patch(), detach_path(), and get_item_from_pointer().
|
static |
Definition at line 722 of file cJSON_Utils.c.
References ADD, COPY, get_object_item(), INVALID, MOVE, operation, REMOVE, REPLACE, TEST, and cJSON::valuestring.
Referenced by apply_patch().
|
static |
Definition at line 343 of file cJSON_Utils.c.
References string.
Referenced by apply_patch(), and detach_path().
Definition at line 377 of file cJSON_Utils.c.
References cJSON::child, cJSON::next, and cJSON::prev.
Referenced by detach_path().
|
static |
Definition at line 410 of file cJSON_Utils.c.
References cJSONUtils_strdup(), decode_array_index_from_pointer(), decode_pointer_inplace(), detach_item_from_array(), get_item_from_pointer(), and index.
Referenced by apply_patch().
|
static |
Definition at line 159 of file cJSON_Utils.c.
Referenced by CJSON_PUBLIC(), compose_patch(), and create_patches().
|
static |
Definition at line 1368 of file cJSON_Utils.c.
References cJSON::child, CJSON_PUBLIC(), compare_json(), cJSON::next, patch, sort_object(), and cJSON::string.
Definition at line 246 of file cJSON_Utils.c.
References cJSON::child, and cJSON::next.
Referenced by get_item_from_pointer().
|
static |
Definition at line 285 of file cJSON_Utils.c.
References cJSON::child, compare_pointers(), decode_array_index_from_pointer(), get_array_item(), index, cJSON::next, and cJSON::string.
Referenced by apply_patch(), CJSON_PUBLIC(), and detach_path().
|
static |
Definition at line 710 of file cJSON_Utils.c.
Referenced by apply_patch(), and decode_patch_operation().
|
static |
Definition at line 673 of file cJSON_Utils.c.
References cJSON::child, newitem, cJSON::next, and cJSON::prev.
Referenced by apply_patch().
|
static |
Definition at line 1299 of file cJSON_Utils.c.
References cJSON::child, CJSON_PUBLIC(), cJSON::next, patch, replacement, cJSON::string, and target.
Definition at line 764 of file cJSON_Utils.c.
References cJSON::child, cJSON::string, and cJSON::valuestring.
Referenced by apply_patch().
|
static |
Definition at line 143 of file cJSON_Utils.c.
References length.
Referenced by CJSON_PUBLIC(), compose_patch(), and create_patches().
|
static |
Definition at line 464 of file cJSON_Utils.c.
References compare_strings(), cJSON::next, cJSON::prev, and cJSON::string.
Referenced by sort_object().
|
static |
Definition at line 575 of file cJSON_Utils.c.
References cJSON::child, and sort_list().
Referenced by compare_json(), create_patches(), and generate_merge_patch().