2019-07-28 10:31:56 +08:00
|
|
|
|
#ifndef ACL_JSON_INCLUDE_H
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#define ACL_JSON_INCLUDE_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../stdlib/acl_define.h"
|
|
|
|
|
#include "../stdlib/acl_dbuf_pool.h"
|
|
|
|
|
#include "../stdlib/acl_iterator.h"
|
|
|
|
|
#include "../stdlib/acl_vstring.h"
|
|
|
|
|
#include "../stdlib/acl_ring.h"
|
|
|
|
|
#include "../stdlib/acl_array.h"
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
typedef struct ACL_JSON ACL_JSON;
|
|
|
|
|
typedef struct ACL_JSON_NODE ACL_JSON_NODE;
|
|
|
|
|
|
|
|
|
|
struct ACL_JSON_NODE {
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ACL_VSTRING *ltag; /**< <20><>ǩ<EFBFBD><C7A9> */
|
|
|
|
|
ACL_VSTRING *text; /**< <20><><EFBFBD>ڵ<EFBFBD>ΪҶ<CEAA>ڵ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD>ݷǿ<DDB7> */
|
|
|
|
|
ACL_JSON_NODE *tag_node; /**< <20><><EFBFBD><EFBFBD>ǩֵΪ json <20>ڵ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD> */
|
|
|
|
|
ACL_JSON_NODE *parent; /**< <20><><EFBFBD>ڵ<EFBFBD> */
|
|
|
|
|
ACL_RING children; /**< <20>ӽڵ㼯<DAB5><E3BCAF> */
|
|
|
|
|
unsigned short type; /**< <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#define ACL_JSON_T_A_STRING (1 << 0)
|
|
|
|
|
#define ACL_JSON_T_A_NUMBER (1 << 1)
|
|
|
|
|
#define ACL_JSON_T_A_BOOL (1 << 2)
|
2015-09-27 20:59:21 +08:00
|
|
|
|
#define ACL_JSON_T_A_NULL (1 << 3)
|
2016-07-29 16:43:46 +08:00
|
|
|
|
#define ACL_JSON_T_A_DOUBLE (1 << 4)
|
2015-09-27 20:59:21 +08:00
|
|
|
|
|
2016-10-21 17:22:40 +08:00
|
|
|
|
#define ACL_JSON_T_STRING (1 << 5)
|
|
|
|
|
#define ACL_JSON_T_NUMBER (1 << 6)
|
|
|
|
|
#define ACL_JSON_T_BOOL (1 << 7)
|
|
|
|
|
#define ACL_JSON_T_NULL (1 << 8)
|
|
|
|
|
#define ACL_JSON_T_DOUBLE (1 << 9)
|
|
|
|
|
|
|
|
|
|
#define ACL_JSON_T_ARRAY (1 << 10)
|
|
|
|
|
#define ACL_JSON_T_OBJ (1 << 11)
|
|
|
|
|
#define ACL_JSON_T_LEAF (1 << 12)
|
|
|
|
|
#define ACL_JSON_T_MEMBER (1 << 13)
|
|
|
|
|
#define ACL_JSON_T_PAIR (1 << 14)
|
|
|
|
|
#define ACL_JSON_T_ELEMENT (1 << 15)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
unsigned short depth; /**< <20><>ǰ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/* private */
|
2019-07-28 10:31:56 +08:00
|
|
|
|
unsigned char quote; /**< <20><> 0 <20><>ʾ ' <20><> " */
|
|
|
|
|
unsigned char left_ch; /**< <20><><EFBFBD>ڵ<EFBFBD><DAB5>ĵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>: { or [ */
|
|
|
|
|
unsigned char right_ch; /**< <20><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>: } or ] */
|
|
|
|
|
unsigned backslash:1; /**< ת<><D7AA><EFBFBD>ַ<EFBFBD> \ */
|
|
|
|
|
unsigned part_word:1; /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־λ */
|
|
|
|
|
ACL_JSON *json; /**< json <20><><EFBFBD><EFBFBD> */
|
|
|
|
|
ACL_RING node; /**< <20><>ǰ<EFBFBD>ڵ<EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* public: for acl_iterator, ͨ<><CDA8> acl_foreach <20>г<EFBFBD><D0B3>ýڵ<C3BD><DAB5><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ӽڵ<D3BD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_head)(ACL_ITER*, ACL_JSON_NODE*);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_next)(ACL_ITER*, ACL_JSON_NODE*);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_tail)(ACL_ITER*, ACL_JSON_NODE*);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_prev)(ACL_ITER*, ACL_JSON_NODE*);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum {
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ACL_JSON_S_ROOT, /**< <20><><EFBFBD>ڵ<EFBFBD> */
|
|
|
|
|
ACL_JSON_S_OBJ, /**< <20><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>ֵ */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_S_MEMBER,
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ACL_JSON_S_ARRAY, /**< json <20>ڵ<EFBFBD> array */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_S_ELEMENT,
|
|
|
|
|
ACL_JSON_S_PAIR, /**< name:value pair */
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ACL_JSON_S_NEXT, /**< <20><>һ<EFBFBD><D2BB><EFBFBD>ڵ<EFBFBD> */
|
|
|
|
|
ACL_JSON_S_TAG, /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9> */
|
|
|
|
|
ACL_JSON_S_VALUE, /**< <20>ڵ<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
ACL_JSON_S_COLON, /**< ð<><C3B0> : */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_S_STRING,
|
|
|
|
|
ACL_JSON_S_STREND
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ACL_JSON {
|
2019-07-28 10:31:56 +08:00
|
|
|
|
int depth; /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
int node_cnt; /**< <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> root <20>ڵ<EFBFBD> */
|
|
|
|
|
ACL_JSON_NODE *root; /**< json <20><><EFBFBD>ڵ<EFBFBD> */
|
|
|
|
|
int finish; /**< <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
unsigned flag; /**< <20><>־λ */
|
|
|
|
|
#define ACL_JSON_FLAG_PART_WORD (1 << 0) /**< <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define ACL_JSON_FLAG_ADD_SPACE (1 << 1) /**< <20><><EFBFBD><EFBFBD> json ʱ<>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ո<EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* public: for acl_iterator, ͨ<><CDA8> acl_foreach <20><><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_head)(ACL_ITER*, ACL_JSON*);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_next)(ACL_ITER*, ACL_JSON*);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_tail)(ACL_ITER*, ACL_JSON*);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
/* ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
ACL_JSON_NODE *(*iter_prev)(ACL_ITER*, ACL_JSON*);
|
|
|
|
|
|
|
|
|
|
/* private */
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
int status; /**< ״̬<D7B4><CCAC><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>״̬ */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
ACL_JSON_NODE *curr_node; /**< <20><>ǰ<EFBFBD><C7B0><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD> json <20>ڵ<EFBFBD> */
|
|
|
|
|
ACL_DBUF_POOL *dbuf; /**< <20>Ự<EFBFBD>ڴ<EFBFBD><DAB4>ض<EFBFBD><D8B6><EFBFBD> */
|
|
|
|
|
ACL_DBUF_POOL *dbuf_inner; /**< <20>Ự<EFBFBD>ڴ<EFBFBD><DAB4>ض<EFBFBD><D8B6><EFBFBD> */
|
2015-11-20 23:29:10 +08:00
|
|
|
|
size_t dbuf_keep;
|
2014-11-19 00:25:21 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*----------------------------- in acl_json.c -----------------------------*/
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_node_alloc(ACL_JSON *json);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ㼰<EFBFBD><EFBFBD><EFBFBD>ӽڵ<EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>ͷŸýڵ㼰<EFBFBD><EFBFBD><EFBFBD>ӽڵ<EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ռ<EFBFBD>ռ亯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷŸ<EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_json_node_delete(ACL_JSON_NODE *node);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<EFBFBD>(<EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƕ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>)
|
|
|
|
|
* @param node1 {ACL_JSON_NODE*} <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param node2 {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD>ֵ<EFBFBD> json <EFBFBD>ڵ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_json_node_append(ACL_JSON_NODE *node1, ACL_JSON_NODE *node2);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ӽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param parent {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param child {ACL_JSON_NODE*} <EFBFBD>ӽڵ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-10-20 21:07:23 +08:00
|
|
|
|
ACL_API void acl_json_node_add_child(
|
|
|
|
|
ACL_JSON_NODE *parent, ACL_JSON_NODE *child);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> JSON <EFBFBD>ڵ㸴<EFBFBD><EFBFBD><EFBFBD><EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD>ڵ<EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* Ŀ<EFBFBD><EFBFBD><EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> JSON <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} Ŀ<EFBFBD><EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param from {ACL_JSON_NODE*} Դ JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD>طǿն<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-10-20 21:07:23 +08:00
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_node_duplicate(
|
|
|
|
|
ACL_JSON *json, ACL_JSON_NODE *from);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ NULL <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>丸<EFBFBD>ڵ㲻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_node_parent(ACL_JSON_NODE *node);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD>ĺ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD>ĺ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<EFBFBD>, <EFBFBD><EFBFBD>ΪNULL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_node_next(ACL_JSON_NODE *node);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>ǰһ<EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>ǰһ<EFBFBD><EFBFBD><EFBFBD>ֵܽڵ<EFBFBD>, <EFBFBD><EFBFBD>ΪNULL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_node_prev(ACL_JSON_NODE *node);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON *acl_json_alloc(void);
|
|
|
|
|
|
2015-11-20 23:29:10 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param dbuf {ACL_DBUF_POOL*} <EFBFBD>ڴ<EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Է<EFBFBD> NULL ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><EFBFBD>з<EFBFBD><EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-11-20 23:29:10 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON *acl_json_dbuf_alloc(ACL_DBUF_POOL *dbuf);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD>ڵ㴴<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} Դ JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON *acl_json_create(ACL_JSON_NODE *node);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ijһ<EFBFBD><EFBFBD> ACL_JSON_NODE <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>Ϊһ<EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD>ڵ㣬
|
|
|
|
|
* <EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýڵ<EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<EFBFBD>(<EFBFBD>ڱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>ڵ㲻<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>б<EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijһ<EFBFBD><EFBFBD> ACL_JSON_NODE <EFBFBD>ڵ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ӽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} ACL_JSON_NODE <EFBFBD>ڵ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_json_foreach_init(ACL_JSON *json, ACL_JSON_NODE *node);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>ͷ<EFBFBD>һ<EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ͬʱ<EFBFBD>ͷŸö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-06-19 16:08:17 +08:00
|
|
|
|
ACL_API void acl_json_free(ACL_JSON *json);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_json_reset(ACL_JSON *json);
|
|
|
|
|
|
|
|
|
|
/*------------------------- in acl_json_parse.c ---------------------------*/
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param data {const char*} <EFBFBD><EFBFBD> '\0' <EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
|
|
|
|
* Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˺<EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; <EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>Ϊ NULL<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӷ<EFBFBD><EFBFBD>ؿմ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD>ֹΪ NULL
|
|
|
|
|
* @return {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>ʾʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
2015-09-27 20:59:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API const char* acl_json_update(ACL_JSON *json, const char *data);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>ж<EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD> 0 ֵ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾδ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-09-27 20:59:21 +08:00
|
|
|
|
ACL_API int acl_json_finish(ACL_JSON *json);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/*------------------------- in acl_json_util.c ----------------------------*/
|
|
|
|
|
|
2015-10-20 21:07:23 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD>õ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param tag {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NULL <EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ʾû<EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>
|
2015-10-20 21:07:23 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_getFirstElementByTagName(
|
|
|
|
|
ACL_JSON *json, const char *tag);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD> acl_json_getElementsByTagName, acl_json_getElementsByName,
|
|
|
|
|
* <EFBFBD>Ⱥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صĶ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>Ϊ<EFBFBD>ö<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>
|
|
|
|
|
* Ԫ<EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷŵ<EFBFBD><EFBFBD>ö<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ֻҪ ACL_JSON
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>, <EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>.
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> xml <EFBFBD>ڵ<EFBFBD>Ԫ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param a {ACL_ARRAY*} <EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_json_free_array(ACL_ARRAY *a);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param tag {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_ARRAY*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ㼯<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NULL <EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ʾû<EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>, <EFBFBD>ǿ<EFBFBD>ֵ<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> acl_json_free_array <EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-10-20 21:07:23 +08:00
|
|
|
|
ACL_API ACL_ARRAY *acl_json_getElementsByTagName(
|
|
|
|
|
ACL_JSON *json, const char *tag);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>༶<EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param tags {const char*} <EFBFBD>༶<EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '/' <EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
* { 'root': [
|
|
|
|
|
* 'first': { 'second': { 'third': 'test1' } },
|
|
|
|
|
* 'first': { 'second': { 'third': 'test2' } },
|
|
|
|
|
* 'first': { 'second': { 'third': 'test3' } }
|
|
|
|
|
* ]
|
|
|
|
|
* }
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>༶<EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>root/first/second/third һ<EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD>
|
|
|
|
|
* @return {ACL_ARRAY*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ㼯<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NULL <EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ʾû<EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD>, <EFBFBD>ǿ<EFBFBD>ֵ<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> acl_json_free_array <EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2015-10-20 21:07:23 +08:00
|
|
|
|
ACL_API ACL_ARRAY *acl_json_getElementsByTags(
|
|
|
|
|
ACL_JSON *json, const char *tags);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json Ҷ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param value {const char*} <EFBFBD><EFBFBD>ǩֵ<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_text(ACL_JSON *json,
|
|
|
|
|
const char *name, const char *value);
|
|
|
|
|
#define acl_json_create_leaf acl_json_create_text
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ҷ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param value {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_bool(ACL_JSON *json,
|
|
|
|
|
const char *name, int value);
|
|
|
|
|
|
2016-10-10 23:03:05 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json null <EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ҷ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2016-10-10 23:03:05 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_null(ACL_JSON *json, const char *name);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json int <EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ҷ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param value {acl_int64} <EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_int64(ACL_JSON *json,
|
|
|
|
|
const char *name, acl_int64 value);
|
|
|
|
|
|
2016-07-29 16:43:46 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json double <EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>Ҷ<EFBFBD>ڵ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {const char*} <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>
|
|
|
|
|
* @param value {double} <EFBFBD>з<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2016-07-29 16:43:46 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_double(ACL_JSON *json,
|
|
|
|
|
const char *name, double value);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ㣬<EFBFBD><EFBFBD> json <EFBFBD>淶<EFBFBD><EFBFBD><EFBFBD>ýڵ<EFBFBD>ֻ<EFBFBD>ܼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
* @param text {const char*}
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_array_text(ACL_JSON *json,
|
|
|
|
|
const char *text);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ڵ㣬<EFBFBD><EFBFBD> json <EFBFBD>淶<EFBFBD><EFBFBD><EFBFBD>ýڵ<EFBFBD>ֻ<EFBFBD>ܼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-09-13 19:47:23 +08:00
|
|
|
|
* @param value {acl_int64}
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_array_int64(ACL_JSON *json,
|
|
|
|
|
acl_int64 value);
|
2016-07-29 16:43:46 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ڵ㣬<EFBFBD><EFBFBD> json <EFBFBD>淶<EFBFBD><EFBFBD><EFBFBD>ýڵ<EFBFBD>ֻ<EFBFBD>ܼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-09-13 19:47:23 +08:00
|
|
|
|
* @param value {double}
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2016-07-29 16:43:46 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_array_double(ACL_JSON *json,
|
|
|
|
|
double value);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ㣬<EFBFBD><EFBFBD> json <EFBFBD>淶<EFBFBD><EFBFBD><EFBFBD>ýڵ<EFBFBD>ֻ<EFBFBD>ܼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param value {int} <EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD>ʾ true<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ false
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_array_bool(ACL_JSON *json, int value);
|
|
|
|
|
|
2016-10-10 23:03:05 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> null <EFBFBD>ڵ㣬<EFBFBD><EFBFBD> json <EFBFBD>淶<EFBFBD><EFBFBD><EFBFBD>ýڵ<EFBFBD>ֻ<EFBFBD>ܼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2016-10-10 23:03:05 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_array_null(ACL_JSON *json);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> {} <EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_obj(ACL_JSON *json);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [] <EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_array(ACL_JSON *json);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD> tagname: ACL_JSON_NODE)
|
|
|
|
|
* @param json {ACL_JSON*} <EFBFBD><EFBFBD> acl_json_alloc / acl_json_alloc1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param name {const char*} json <EFBFBD>ڵ<EFBFBD><EFBFBD>ı<EFBFBD>ǩ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param value {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ǩֵ
|
|
|
|
|
* @return {ACL_JSON_NODE*} <EFBFBD>´<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD> ACL_JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|
|
|
|
* һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_JSON_NODE *acl_json_create_node(ACL_JSON *json,
|
|
|
|
|
const char *name, ACL_JSON_NODE *value);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> acl_json_create_obj <EFBFBD><EFBFBD> acl_json_create_array
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ㣬<EFBFBD><EFBFBD><EFBFBD>ӽڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½ӿڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľڵ<EFBFBD>:
|
2014-11-19 00:25:21 +08:00
|
|
|
|
* acl_json_create_leaf, acl_json_create_obj, acl_json_create_array
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_json_node_append_child(ACL_JSON_NODE *parent,
|
|
|
|
|
ACL_JSON_NODE *child);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> JSON <EFBFBD>ڵ<EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param node {ACL_JSON_NODE*} json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param buf {ACL_VSTRING*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ͷŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿպ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_VSTRING*} json <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Զ<EFBFBD>ǿգ<EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD> ACL_VSTRING_LEN(x) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD> ACL_VSTRING ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* acl_vstring_free <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2019-09-13 19:47:23 +08:00
|
|
|
|
ACL_API ACL_VSTRING *acl_json_node_build(ACL_JSON_NODE *node, ACL_VSTRING *buf);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param buf {ACL_VSTRING*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ͷŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿպ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_VSTRING*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Զ<EFBFBD>ǿգ<EFBFBD>
|
|
|
|
|
* ʹ<EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD> ACL_VSTRING_LEN(x) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD> ACL_VSTRING
|
|
|
|
|
* ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> acl_vstring_free <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_VSTRING *acl_json_build(ACL_JSON *json, ACL_VSTRING *buf);
|
|
|
|
|
|
2014-12-14 18:26:52 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD>ʽ JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD> JSON <EFBFBD><EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>
|
|
|
|
|
* һ<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>һ<EFBFBD>߽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ڵ<EFBFBD>JSON<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>ɵ<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD><EFBFBD><EFBFBD>ʱ(<EFBFBD>糬<EFBFBD><EFBFBD>100 MB),
|
|
|
|
|
* <EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
|
|
|
|
* @param json {ACL_JSON*} json <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param length {size_t} <EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>
|
|
|
|
|
* <EFBFBD>û<EFBFBD><EFBFBD>趨<EFBFBD>Ļص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param callback {int (*)(ACL_JSON*, ACL_VSTRING*, void*)} <EFBFBD>û<EFBFBD><EFBFBD>趨<EFBFBD>Ļص<EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ NULL ʱ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD>ڸûص<EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ij<EFBFBD>α<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD>ֵ < 0 <EFBFBD><EFBFBD>ֹͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param ctx {void*} callback <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-12-14 18:26:52 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_json_building(ACL_JSON *json, size_t length,
|
|
|
|
|
int (*callback)(ACL_JSON *, ACL_VSTRING *, void *), void *ctx);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|