58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
|
/*
|
|||
|
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2021. All rights reserved.
|
|||
|
* Description: jsonͷ<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD>֣<EFBFBD>ֱ<EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
#ifndef HILINK_CJSON_H
|
|||
|
#define HILINK_CJSON_H
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif /* __cpluscplus */
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>json<EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD>Ϊjson<EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>,<EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪjson<EFBFBD>ṹ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
void *hilink_json_parse(const char *value);
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD><EFBFBD>ȡjson<EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>value
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD>ȡʧ<EFBFBD><EFBFBD>,<EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD>ȡ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>value<EFBFBD><EFBFBD>ַ
|
|||
|
*/
|
|||
|
char *hilink_json_get_string_value(const void *object, const char *name, unsigned int *len);
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD><EFBFBD>ȡjson<EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD>ֵvalue
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-<EFBFBD>ɹ<EFBFBD>,-1-ʧ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
int hilink_json_get_number_value(const void *object, const char *name, int *value);
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD><EFBFBD>ȡjson<EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>object
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>,<EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪjson object<EFBFBD>ṹ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
void *hilink_json_get_object(const void *object, const char *name);
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD><EFBFBD>ȡjson<EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>arrayԪ<EFBFBD><EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>NULL-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵΪjson object<EFBFBD>ṹ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
void *hilink_json_get_arrayitem(const void *array, int item);
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD><EFBFBD>ȡjson<EFBFBD>ṹ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>array<EFBFBD>Ĵ<EFBFBD>С
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*/
|
|||
|
int hilink_json_get_arraysize(const void *array);
|
|||
|
|
|||
|
/* <20>ͷ<EFBFBD>json<6F>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>ռ<EFBFBD>õĿռ<C4BF> */
|
|||
|
void hilink_json_delete(void *object);
|
|||
|
|
|||
|
/* json<6F><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0 */
|
|||
|
void hilink_json_clear_all_string(void *object);
|
|||
|
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif /* __cpluscplus */
|
|||
|
|
|||
|
#endif
|