Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
9d68a239
提交
9d68a239
authored
5月 15, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1467
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
0332cb26
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
23 行增加
和
11 行删除
+23
-11
switch_types.h
src/include/switch_types.h
+1
-0
switch_xml.h
src/include/switch_xml.h
+4
-2
switch_core.c
src/switch_core.c
+5
-5
switch_xml.c
src/switch_xml.c
+13
-4
没有找到文件。
src/include/switch_types.h
浏览文件 @
9d68a239
...
...
@@ -366,6 +366,7 @@ SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible
</pre>
*/
typedef
enum
{
SFF_NONE
=
0
,
SFF_CNG
=
(
1
<<
0
),
SFF_RAW_RTP
=
(
1
<<
1
)
}
switch_frame_flag_t
;
...
...
src/include/switch_xml.h
浏览文件 @
9d68a239
...
...
@@ -271,13 +271,15 @@ SWITCH_DECLARE(void) switch_xml_remove(switch_xml_t xml);
///\brief open the Core xml root
///\param reload if it's is already open close it and open it again as soon as permissable (blocking)
///\param err a pointer to set error strings
///\return the xml root node or NULL
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_open_root
(
uint8_t
reload
);
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_open_root
(
uint8_t
reload
,
const
char
**
err
);
///\brief initilize the core XML backend
///\param pool a memory pool to use
///\param err a pointer to set error strings
///\return SWITCH_STATUS_SUCCESS if successful
SWITCH_DECLARE
(
switch_status_t
)
switch_xml_init
(
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_xml_init
(
switch_memory_pool_t
*
pool
,
const
char
**
err
);
SWITCH_DECLARE
(
switch_status_t
)
switch_xml_destroy
(
void
);
...
...
src/switch_core.c
浏览文件 @
9d68a239
...
...
@@ -2742,7 +2742,7 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_init
(
char
*
console
)
{
const
char
*
err
=
NULL
;
memset
(
&
runtime
,
0
,
sizeof
(
runtime
));
switch_core_set_globals
();
...
...
@@ -2755,14 +2755,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(char *console)
}
if
(
apr_pool_create
(
&
runtime
.
memory_pool
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
apr_terminate
();
fprintf
(
stderr
,
"FATAL ERROR! Could not allocate memory pool
\n
"
);
switch_core_destroy
();
return
SWITCH_STATUS_MEMERR
;
}
if
(
switch_xml_init
(
runtime
.
memory_pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
fprintf
(
stderr
,
"FATAL ERROR! Could not open XML Registry
\n
"
);
switch_core_destroy
(
);
if
(
switch_xml_init
(
runtime
.
memory_pool
,
&
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
apr_terminate
(
);
fprintf
(
stderr
,
"FATAL ERROR! Could not open XML Registry %s
\n
"
,
err
);
return
SWITCH_STATUS_MEMERR
;
}
...
...
src/switch_xml.c
浏览文件 @
9d68a239
...
...
@@ -868,7 +868,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_root(void)
return
MAIN_XML_ROOT
;
}
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_open_root
(
uint8_t
reload
)
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_open_root
(
uint8_t
reload
,
const
char
**
err
)
{
char
path_buf
[
1024
];
uint8_t
hasmain
=
0
;
...
...
@@ -891,7 +891,14 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload)
snprintf
(
path_buf
,
sizeof
(
path_buf
),
"%s/%s"
,
SWITCH_GLOBAL_dirs
.
conf_dir
,
"freeswitch.xml"
);
if
((
MAIN_XML_ROOT
=
switch_xml_parse_file
(
path_buf
)))
{
switch_set_flag
(
MAIN_XML_ROOT
,
SWITCH_XML_ROOT
);
*
err
=
switch_xml_error
(
MAIN_XML_ROOT
);
if
(
!
switch_strlen_zero
(
*
err
))
{
switch_xml_free
(
MAIN_XML_ROOT
);
MAIN_XML_ROOT
=
NULL
;
}
else
{
switch_set_flag
(
MAIN_XML_ROOT
,
SWITCH_XML_ROOT
);
}
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CRIT
,
"Cannot Open XML Root!
\n
"
);
}
...
...
@@ -904,16 +911,18 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload)
}
SWITCH_DECLARE
(
switch_status_t
)
switch_xml_init
(
switch_memory_pool_t
*
pool
)
SWITCH_DECLARE
(
switch_status_t
)
switch_xml_init
(
switch_memory_pool_t
*
pool
,
const
char
**
err
)
{
switch_xml_t
xml
;
XML_MEMORY_POOL
=
pool
;
*
err
=
"Success"
;
switch_mutex_init
(
&
XML_LOCK
,
SWITCH_MUTEX_NESTED
,
XML_MEMORY_POOL
);
switch_thread_rwlock_create
(
&
RWLOCK
,
XML_MEMORY_POOL
);
assert
(
pool
!=
NULL
);
if
((
xml
=
switch_xml_open_root
(
FALSE
)))
{
if
((
xml
=
switch_xml_open_root
(
FALSE
,
err
)))
{
switch_xml_free
(
xml
);
return
SWITCH_STATUS_SUCCESS
;
}
else
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论