基本完成网络设置模块,还有一些细节需要完善。
This commit is contained in:
@@ -236,7 +236,11 @@ cJSON* cJSON_Parse(const char* value)
|
||||
ep = 0;
|
||||
if (!c) return 0; /* memory fail */
|
||||
|
||||
if (!parse_value(c, skip(value))) { cJSON_Delete(c); return 0; }
|
||||
if (!parse_value(c, skip(value)))
|
||||
{
|
||||
cJSON_Delete(c);
|
||||
return 0;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -481,12 +485,6 @@ void cJSON_ReplaceItemInArray(cJSON* array, int which, cJSON* newitem) {
|
||||
if (c == array->child) array->child = newitem; else newitem->prev->next = newitem; c->next = c->prev = 0; cJSON_Delete(c);
|
||||
}
|
||||
|
||||
cJSON* cJSON_FindItemInArray(cJSON* array, int which)
|
||||
{
|
||||
cJSON* c = array->child;
|
||||
while (c && which > 0) c = c->next, which--;
|
||||
return c;
|
||||
}
|
||||
|
||||
void cJSON_ReplaceItemInObject(cJSON* object, const char* string, cJSON* newitem)
|
||||
{
|
||||
@@ -500,14 +498,6 @@ void cJSON_ReplaceItemInObject(cJSON* object, const char* string, cJSON* newit
|
||||
}
|
||||
}
|
||||
|
||||
cJSON* cJSON_FindItemInObject(cJSON* object, const char* string)
|
||||
{
|
||||
int i = 0;
|
||||
cJSON* c = object->child;
|
||||
while (c && cJSON_strcasecmp(c->string, string))i++, c = c->next;
|
||||
return c;
|
||||
}
|
||||
|
||||
/* Create basic types: */
|
||||
cJSON* cJSON_CreateNull() { cJSON* item = cJSON_New_Item(); if (item)item->type = cJSON_NULL; return item; }
|
||||
cJSON* cJSON_CreateTrue() { cJSON* item = cJSON_New_Item(); if (item)item->type = cJSON_True; return item; }
|
||||
|
||||
Reference in New Issue
Block a user