cJSON_ConfigurationChangeCaseSensitivity

This commit is contained in:
Max Bruckner
2018-02-03 02:48:14 +01:00
parent 1d9d2e8673
commit 7e4ac634c6
3 changed files with 29 additions and 12 deletions

21
cJSON.c
View File

@@ -2930,16 +2930,6 @@ CJSON_PUBLIC(cJSON_Configuration) cJSON_CreateConfiguration(const cJSON * const
/* then overwrite with other options if they exist */
option = get_object_item(json, "case_sensitive", &global_configuration);
if (cJSON_IsTrue(option))
{
configuration->case_sensitive = true;
}
else if (cJSON_IsFalse(option))
{
configuration->case_sensitive = false;
}
option = get_object_item(json, "allow_data_after_json", &global_configuration);
if (cJSON_IsTrue(option))
{
@@ -3032,6 +3022,17 @@ CJSON_PUBLIC(cJSON_Configuration) cJSON_ConfigurationChangeFormat(cJSON_Configur
return configuration;
}
CJSON_PUBLIC(cJSON_Configuration) cJSON_ConfigurationChangeCaseSensitivity(cJSON_Configuration configuration, cJSON_bool case_sensitive)
{
if (configuration == NULL)
{
return NULL;
}
((internal_configuration*)configuration)->case_sensitive = case_sensitive;
return configuration;
}
static cJSON_bool compare(const cJSON * const a, const cJSON * const b, const internal_configuration * const configuration)
{
if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)) || cJSON_IsInvalid(a))