mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
rename cJSON_cJSON to pika_cjson
This commit is contained in:
parent
9ad033123d
commit
590d55ba36
@ -5,4 +5,4 @@ class cJSON(TinyObj):
|
||||
def print(self) -> str: ...
|
||||
def parse(self, value: str): ...
|
||||
def __del__(self): ...
|
||||
def getObjectItem(self, string: str) -> any: ...
|
||||
def getObjectItem(self, string: str) -> cJSON: ...
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "pika_cjson_cJSON.h"
|
||||
#include "cJSON.h"
|
||||
#include "pika_cjson_cJSON.h"
|
||||
|
||||
void pika_cjson_cJSON_parse(PikaObj* self, char* value) {
|
||||
cJSON* item = cJSON_Parse(value);
|
||||
@ -22,17 +22,16 @@ void pika_cjson_cJSON___del__(PikaObj* self) {
|
||||
}
|
||||
}
|
||||
|
||||
Arg* pika_cjson_cJSON_getObjectItem(PikaObj* self, char* string) {
|
||||
PikaObj* pika_cjson_cJSON_getObjectItem(PikaObj* self, char* string) {
|
||||
cJSON* item = obj_getPtr(self, "item");
|
||||
cJSON* subItem = cJSON_GetObjectItem(item, string);
|
||||
|
||||
/* create subCJSON */
|
||||
Arg* subCJSON_arg = obj_newObjInPackage(New_pika_cjson_cJSON);
|
||||
PikaObj* subCJSON = newNormalObj(New_pika_cjson_cJSON);
|
||||
|
||||
/* init the subCJSON */
|
||||
PikaObj* subCJSON = arg_getPtr(subCJSON_arg);
|
||||
obj_setPtr(subCJSON, "item", subItem);
|
||||
obj_setInt(subCJSON, "needfree", 0);
|
||||
|
||||
return subCJSON_arg;
|
||||
return subCJSON;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user