Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5a58605d
提交
5a58605d
authored
10月 01, 2006
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
type tweak
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@2916
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
564e791d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
switch_xml.c
src/switch_xml.c
+8
-8
没有找到文件。
src/switch_xml.c
浏览文件 @
5a58605d
...
@@ -118,7 +118,7 @@ SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(char *str)
...
@@ -118,7 +118,7 @@ SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(char *str)
if
(
str
)
{
if
(
str
)
{
for
(
x
=
0
;
x
<
strlen
(
str
);
x
++
)
{
for
(
x
=
0
;
x
<
strlen
(
str
);
x
++
)
{
buf
[
x
]
=
(
char
)
tolower
(
str
[
x
]);
buf
[
x
]
=
(
char
)
tolower
(
(
int
)
str
[
x
]);
}
}
for
(
x
=
0
;;
x
++
)
{
for
(
x
=
0
;;
x
++
)
{
if
(
!
SECTIONS
[
x
].
name
)
{
if
(
!
SECTIONS
[
x
].
name
)
{
...
@@ -296,7 +296,7 @@ static char *switch_xml_decode(char *s, char **ent, char t)
...
@@ -296,7 +296,7 @@ static char *switch_xml_decode(char *s, char **ent, char t)
}
}
for
(
s
=
r
;
;
)
{
for
(
s
=
r
;
;
)
{
while
(
*
s
&&
*
s
!=
'&'
&&
(
*
s
!=
'%'
||
t
!=
'%'
)
&&
!
isspace
(
*
s
))
s
++
;
while
(
*
s
&&
*
s
!=
'&'
&&
(
*
s
!=
'%'
||
t
!=
'%'
)
&&
!
isspace
(
(
int
)(
*
s
)
))
s
++
;
if
(
!
*
s
)
break
;
if
(
!
*
s
)
break
;
else
if
(
t
!=
'c'
&&
!
strncmp
(
s
,
"&#"
,
2
))
{
// character reference
else
if
(
t
!=
'c'
&&
!
strncmp
(
s
,
"&#"
,
2
))
{
// character reference
...
@@ -331,7 +331,7 @@ static char *switch_xml_decode(char *s, char **ent, char t)
...
@@ -331,7 +331,7 @@ static char *switch_xml_decode(char *s, char **ent, char t)
}
}
else
s
++
;
// not a known entity
else
s
++
;
// not a known entity
}
}
else
if
((
t
==
' '
||
t
==
'*'
)
&&
isspace
(
*
s
))
*
(
s
++
)
=
' '
;
else
if
((
t
==
' '
||
t
==
'*'
)
&&
isspace
(
(
int
)(
*
s
)
))
*
(
s
++
)
=
' '
;
else
s
++
;
// no decoding needed
else
s
++
;
// no decoding needed
}
}
...
@@ -616,12 +616,12 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
...
@@ -616,12 +616,12 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
attr
=
(
char
**
)
SWITCH_XML_NIL
;
attr
=
(
char
**
)
SWITCH_XML_NIL
;
d
=
++
s
;
d
=
++
s
;
if
(
isalpha
(
*
s
)
||
*
s
==
'_'
||
*
s
==
':'
||
(
int8_t
)
*
s
<
'\0'
)
{
// new tag
if
(
isalpha
(
(
int
)(
*
s
)
)
||
*
s
==
'_'
||
*
s
==
':'
||
(
int8_t
)
*
s
<
'\0'
)
{
// new tag
if
(
!
root
->
cur
)
if
(
!
root
->
cur
)
return
switch_xml_err
(
root
,
d
,
"markup outside of root element"
);
return
switch_xml_err
(
root
,
d
,
"markup outside of root element"
);
s
+=
strcspn
(
s
,
SWITCH_XML_WS
"/>"
);
s
+=
strcspn
(
s
,
SWITCH_XML_WS
"/>"
);
while
(
isspace
(
*
s
))
*
(
s
++
)
=
'\0'
;
// null terminate tag name
while
(
isspace
(
(
int
)(
*
s
)
))
*
(
s
++
)
=
'\0'
;
// null terminate tag name
if
(
*
s
&&
*
s
!=
'/'
&&
*
s
!=
'>'
)
// find tag in default attr list
if
(
*
s
&&
*
s
!=
'/'
&&
*
s
!=
'>'
)
// find tag in default attr list
for
(
i
=
0
;
(
a
=
root
->
attr
[
i
])
&&
strcmp
(
a
[
0
],
d
);
i
++
);
for
(
i
=
0
;
(
a
=
root
->
attr
[
i
])
&&
strcmp
(
a
[
0
],
d
);
i
++
);
...
@@ -637,7 +637,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
...
@@ -637,7 +637,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
attr
[
l
]
=
s
;
// set attribute name
attr
[
l
]
=
s
;
// set attribute name
s
+=
strcspn
(
s
,
SWITCH_XML_WS
"=/>"
);
s
+=
strcspn
(
s
,
SWITCH_XML_WS
"=/>"
);
if
(
*
s
==
'='
||
isspace
(
*
s
))
{
if
(
*
s
==
'='
||
isspace
(
(
int
)(
*
s
)
))
{
*
(
s
++
)
=
'\0'
;
// null terminate tag attribute name
*
(
s
++
)
=
'\0'
;
// null terminate tag attribute name
q
=
*
(
s
+=
strspn
(
s
,
SWITCH_XML_WS
"="
));
q
=
*
(
s
+=
strspn
(
s
,
SWITCH_XML_WS
"="
));
if
(
q
==
'"'
||
q
==
'\''
)
{
// attribute value
if
(
q
==
'"'
||
q
==
'\''
)
{
// attribute value
...
@@ -656,7 +656,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
...
@@ -656,7 +656,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
attr
[
l
+
3
][
l
/
2
]
=
SWITCH_XML_TXTM
;
// value malloced
attr
[
l
+
3
][
l
/
2
]
=
SWITCH_XML_TXTM
;
// value malloced
}
}
}
}
while
(
isspace
(
*
s
))
s
++
;
while
(
isspace
(
(
int
)(
*
s
)
))
s
++
;
}
}
if
(
*
s
==
'/'
)
{
// self closing tag
if
(
*
s
==
'/'
)
{
// self closing tag
...
@@ -683,7 +683,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
...
@@ -683,7 +683,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len)
if
(
!
(
q
=
*
s
)
&&
e
!=
'>'
)
return
switch_xml_err
(
root
,
d
,
"missing >"
);
if
(
!
(
q
=
*
s
)
&&
e
!=
'>'
)
return
switch_xml_err
(
root
,
d
,
"missing >"
);
*
s
=
'\0'
;
// temporarily null terminate tag name
*
s
=
'\0'
;
// temporarily null terminate tag name
if
(
switch_xml_close_tag
(
root
,
d
,
s
))
return
&
root
->
xml
;
if
(
switch_xml_close_tag
(
root
,
d
,
s
))
return
&
root
->
xml
;
if
(
isspace
(
*
s
=
q
))
s
+=
strspn
(
s
,
SWITCH_XML_WS
);
if
(
isspace
(
(
int
)(
*
s
=
q
)
))
s
+=
strspn
(
s
,
SWITCH_XML_WS
);
}
}
else
if
(
!
strncmp
(
s
,
"!--"
,
3
))
{
// comment
else
if
(
!
strncmp
(
s
,
"!--"
,
3
))
{
// comment
if
(
!
(
s
=
strstr
(
s
+
3
,
"--"
))
||
(
*
(
s
+=
2
)
!=
'>'
&&
*
s
)
||
if
(
!
(
s
=
strstr
(
s
+
3
,
"--"
))
||
(
*
(
s
+=
2
)
!=
'>'
&&
*
s
)
||
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论