基本完成网络设置模块,还有一些细节需要完善。

This commit is contained in:
xueyan hu
2021-12-17 18:02:39 +08:00
parent faa69197f3
commit b6475e7ed4
21 changed files with 1979 additions and 421 deletions

View File

@@ -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; }