Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
79651ff8
提交
79651ff8
authored
4月 17, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@4965
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
4a88a732
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
3 行删除
+24
-3
switch_xml.h
src/include/switch_xml.h
+2
-0
mod_dialplan_xml.c
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
+1
-1
switch_xml.c
src/switch_xml.c
+21
-2
没有找到文件。
src/include/switch_xml.h
浏览文件 @
79651ff8
...
@@ -117,6 +117,8 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fd(int fd);
...
@@ -117,6 +117,8 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fd(int fd);
///\return a formated xml node or NULL
///\return a formated xml node or NULL
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_parse_file
(
const
char
*
file
);
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_parse_file
(
const
char
*
file
);
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_parse_file_simple
(
const
char
*
file
);
///\brief Wrapper for switch_xml_parse_str() that accepts a file stream. Reads the entire
///\brief Wrapper for switch_xml_parse_str() that accepts a file stream. Reads the entire
///\ stream into memory and then parses it. For xml files, use switch_xml_parse_file()
///\ stream into memory and then parses it. For xml files, use switch_xml_parse_file()
///\ or switch_xml_parse_fd()
///\ or switch_xml_parse_fd()
...
...
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
浏览文件 @
79651ff8
...
@@ -316,7 +316,7 @@ static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session,
...
@@ -316,7 +316,7 @@ static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session,
if
(
!
switch_strlen_zero
(
alt_path
))
{
if
(
!
switch_strlen_zero
(
alt_path
))
{
switch_xml_t
conf
=
NULL
,
tag
=
NULL
;
switch_xml_t
conf
=
NULL
,
tag
=
NULL
;
if
(
!
(
alt_root
=
switch_xml_parse_file
(
alt_path
)))
{
if
(
!
(
alt_root
=
switch_xml_parse_file
_simple
(
alt_path
)))
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"open of [%s] failed
\n
"
,
alt_path
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"open of [%s] failed
\n
"
,
alt_path
);
goto
done
;
goto
done
;
}
}
...
...
src/switch_xml.c
浏览文件 @
79651ff8
...
@@ -1032,7 +1032,26 @@ static int preprocess(const char *file, int write_fd, int rlevel)
...
@@ -1032,7 +1032,26 @@ static int preprocess(const char *file, int write_fd, int rlevel)
return
write_fd
;
return
write_fd
;
}
}
// a wrapper for switch_xml_parse_fd that accepts a file name
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_parse_file_simple
(
const
char
*
file
)
{
int
fd
=
-
1
;
struct
stat
st
;
switch_size_t
l
;
void
*
m
;
switch_xml_root_t
root
;
if
((
fd
=
open
(
file
,
O_RDONLY
,
0
))
>
-
1
)
{
fstat
(
fd
,
&
st
);
l
=
read
(
fd
,
m
=
malloc
(
st
.
st_size
),
st
.
st_size
);
root
=
(
switch_xml_root_t
)
switch_xml_parse_str
(
m
,
l
);
root
->
dynamic
=
1
;
close
(
fd
);
return
&
root
->
xml
;
}
return
NULL
;
}
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_parse_file
(
const
char
*
file
)
SWITCH_DECLARE
(
switch_xml_t
)
switch_xml_parse_file
(
const
char
*
file
)
{
{
int
fd
=
-
1
,
write_fd
=
-
1
;
int
fd
=
-
1
,
write_fd
=
-
1
;
...
@@ -1045,7 +1064,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(const char *file)
...
@@ -1045,7 +1064,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(const char *file)
}
else
{
}
else
{
abs
=
file
;
abs
=
file
;
}
}
if
(
!
(
new_file
=
switch_mprintf
(
"%s%s%s.fsxml"
,
SWITCH_GLOBAL_dirs
.
log_dir
,
SWITCH_PATH_SEPARATOR
,
abs
)))
{
if
(
!
(
new_file
=
switch_mprintf
(
"%s%s%s.fsxml"
,
SWITCH_GLOBAL_dirs
.
log_dir
,
SWITCH_PATH_SEPARATOR
,
abs
)))
{
return
NULL
;
return
NULL
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论