Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0d089c4b
提交
0d089c4b
authored
12月 23, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
put SWITCH_DECLARE marcos on the json api to make it exported
上级
d6374535
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
58 行增加
和
58 行删除
+58
-58
switch_json.h
src/include/switch_json.h
+29
-29
switch_json.c
src/switch_json.c
+29
-29
没有找到文件。
src/include/switch_json.h
浏览文件 @
0d089c4b
...
...
@@ -61,56 +61,56 @@ typedef struct cJSON_Hooks {
}
cJSON_Hooks
;
// Supply malloc, realloc and free functions to cJSON
extern
void
cJSON_InitHooks
(
cJSON_Hooks
*
hooks
);
SWITCH_DECLARE
(
void
)
cJSON_InitHooks
(
cJSON_Hooks
*
hooks
);
// Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished.
extern
cJSON
*
cJSON_Parse
(
const
char
*
value
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_Parse
(
const
char
*
value
);
// Render a cJSON entity to text for transfer/storage. Free the char* when finished.
extern
char
*
cJSON_Print
(
cJSON
*
item
);
SWITCH_DECLARE
(
char
*
)
cJSON_Print
(
cJSON
*
item
);
// Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished.
extern
char
*
cJSON_PrintUnformatted
(
cJSON
*
item
);
SWITCH_DECLARE
(
char
*
)
cJSON_PrintUnformatted
(
cJSON
*
item
);
// Delete a cJSON entity and all subentities.
extern
void
cJSON_Delete
(
cJSON
*
c
);
SWITCH_DECLARE
(
void
)
cJSON_Delete
(
cJSON
*
c
);
// Returns the number of items in an array (or object).
extern
int
cJSON_GetArraySize
(
cJSON
*
array
);
SWITCH_DECLARE
(
int
)
cJSON_GetArraySize
(
cJSON
*
array
);
// Retrieve item number "item" from array "array". Returns NULL if unsuccessful.
extern
cJSON
*
cJSON_GetArrayItem
(
cJSON
*
array
,
int
item
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_GetArrayItem
(
cJSON
*
array
,
int
item
);
// Get item "string" from object. Case insensitive.
extern
cJSON
*
cJSON_GetObjectItem
(
cJSON
*
object
,
const
char
*
string
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_GetObjectItem
(
cJSON
*
object
,
const
char
*
string
);
// These calls create a cJSON item of the appropriate type.
extern
cJSON
*
cJSON_CreateNull
(
void
);
extern
cJSON
*
cJSON_CreateTrue
(
void
);
extern
cJSON
*
cJSON_CreateFalse
(
void
);
extern
cJSON
*
cJSON_CreateNumber
(
double
num
);
extern
cJSON
*
cJSON_CreateString
(
const
char
*
string
);
extern
cJSON
*
cJSON_CreateArray
(
void
);
extern
cJSON
*
cJSON_CreateObject
(
void
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateNull
(
void
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateTrue
(
void
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateFalse
(
void
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateNumber
(
double
num
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateString
(
const
char
*
string
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateArray
(
void
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateObject
(
void
);
// These utilities create an Array of count items.
extern
cJSON
*
cJSON_CreateIntArray
(
int
*
numbers
,
int
count
);
extern
cJSON
*
cJSON_CreateFloatArray
(
float
*
numbers
,
int
count
);
extern
cJSON
*
cJSON_CreateDoubleArray
(
double
*
numbers
,
int
count
);
extern
cJSON
*
cJSON_CreateStringArray
(
const
char
**
strings
,
int
count
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateIntArray
(
int
*
numbers
,
int
count
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateFloatArray
(
float
*
numbers
,
int
count
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateDoubleArray
(
double
*
numbers
,
int
count
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_CreateStringArray
(
const
char
**
strings
,
int
count
);
// Append item to the specified array/object.
extern
void
cJSON_AddItemToArray
(
cJSON
*
array
,
cJSON
*
item
);
extern
void
cJSON_AddItemToObject
(
cJSON
*
object
,
const
char
*
string
,
cJSON
*
item
);
SWITCH_DECLARE
(
void
)
cJSON_AddItemToArray
(
cJSON
*
array
,
cJSON
*
item
);
SWITCH_DECLARE
(
void
)
cJSON_AddItemToObject
(
cJSON
*
object
,
const
char
*
string
,
cJSON
*
item
);
// Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON.
extern
void
cJSON_AddItemReferenceToArray
(
cJSON
*
array
,
cJSON
*
item
);
extern
void
cJSON_AddItemReferenceToObject
(
cJSON
*
object
,
const
char
*
string
,
cJSON
*
item
);
SWITCH_DECLARE
(
void
)
cJSON_AddItemReferenceToArray
(
cJSON
*
array
,
cJSON
*
item
);
SWITCH_DECLARE
(
void
)
cJSON_AddItemReferenceToObject
(
cJSON
*
object
,
const
char
*
string
,
cJSON
*
item
);
// Remove/Detatch items from Arrays/Objects.
extern
cJSON
*
cJSON_DetachItemFromArray
(
cJSON
*
array
,
int
which
);
extern
void
cJSON_DeleteItemFromArray
(
cJSON
*
array
,
int
which
);
extern
cJSON
*
cJSON_DetachItemFromObject
(
cJSON
*
object
,
const
char
*
string
);
extern
void
cJSON_DeleteItemFromObject
(
cJSON
*
object
,
const
char
*
string
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_DetachItemFromArray
(
cJSON
*
array
,
int
which
);
SWITCH_DECLARE
(
void
)
cJSON_DeleteItemFromArray
(
cJSON
*
array
,
int
which
);
SWITCH_DECLARE
(
cJSON
*
)
cJSON_DetachItemFromObject
(
cJSON
*
object
,
const
char
*
string
);
SWITCH_DECLARE
(
void
)
cJSON_DeleteItemFromObject
(
cJSON
*
object
,
const
char
*
string
);
// Update array items.
extern
void
cJSON_ReplaceItemInArray
(
cJSON
*
array
,
int
which
,
cJSON
*
newitem
);
extern
void
cJSON_ReplaceItemInObject
(
cJSON
*
object
,
const
char
*
string
,
cJSON
*
newitem
);
SWITCH_DECLARE
(
void
)
cJSON_ReplaceItemInArray
(
cJSON
*
array
,
int
which
,
cJSON
*
newitem
);
SWITCH_DECLARE
(
void
)
cJSON_ReplaceItemInObject
(
cJSON
*
object
,
const
char
*
string
,
cJSON
*
newitem
);
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
...
...
src/switch_json.c
浏览文件 @
0d089c4b
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论