1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
ZyXEL_PMG5617GA/package/libs/libjson-c/patches-0.9/013-FEATURE_app_agent.patch
2022-11-27 10:16:14 +00:00

46 lines
1.3 KiB
Diff

Index: json-c-0.9/json_object.c
===================================================================
--- json-c-0.9.orig/json_object.c 2015-03-13 15:51:17.338351322 +0800
+++ json-c-0.9/json_object.c 2015-03-13 15:52:06.244464741 +0800
@@ -636,6 +636,27 @@
return (struct json_object*)array_list_get_idx(jso->o.c_array, idx);
}
+int json_object_set_param(struct json_object *jso, char* v)
+{
+ if(!jso) return 0;
+ switch(jso->o_type) {
+ case json_type_boolean:
+ jso->o.c_boolean = atoi(v);
+ break;
+ case json_type_int:
+ jso->o.c_int = atoi(v);
+ break;
+ case json_type_string:
+ free(jso->o.c_string);
+ jso->o.c_string = strdup(v);
+ break;
+ case json_type_double:
+ default:
+ break;
+ }
+
+ return 0;
+}
#if 1 /* zyxel, john */
int json_object_array_delete_idx(struct json_object *jso,
int idx)
Index: json-c-0.9/json_object.h
===================================================================
--- json-c-0.9.orig/json_object.h 2015-03-13 15:51:17.330351322 +0800
+++ json-c-0.9/json_object.h 2015-03-13 15:51:46.028337316 +0800
@@ -342,6 +342,8 @@
*/
extern const char* json_object_get_string(struct json_object *obj);
+int json_object_set_param(struct json_object *obj, char *v);
+
#ifdef __cplusplus
}
#endif