Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
ciksemel
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
ciksemel
Commits
215c1376
Kaydet (Commit)
215c1376
authored
May 06, 2020
tarafından
Ali Rıza KESKİN
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Hardy optimized.
üst
cb49cf72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
14 deletions
+25
-14
iksemel.c
src/iksemel.c
+25
-14
No files found.
src/iksemel.c
Dosyayı görüntüle @
215c1376
/* iksemel (XML parser for Jabber)
** Copyright (C) 2000-2003 Gurer Ozen <madcat@e-kolay.net>
** Modification 2016-2020 Ali Rıza Keskin <parduscix@yandex.ru>
** This code is free software; you can redistribute it and/or
** modify it under the terms of GNU Lesser General Public License.
*/
...
...
@@ -652,7 +653,8 @@ sax_core (iksparser *prs, char *buf, int len)
switch
(
prs
->
context
)
{
case
C_CDATA
:
if
(
'&'
==
c
)
{
switch
(
c
){
case
'&'
:
if
(
old
<
pos
&&
prs
->
cdataHook
)
{
err
=
prs
->
cdataHook
(
prs
->
user_data
,
&
buf
[
old
],
pos
-
old
);
if
(
IKS_OK
!=
err
)
return
err
;
...
...
@@ -660,7 +662,7 @@ sax_core (iksparser *prs, char *buf, int len)
prs
->
context
=
C_ENTITY
;
prs
->
entpos
=
0
;
break
;
}
else
if
(
'<'
==
c
)
{
case
'<'
:
if
(
old
<
pos
&&
prs
->
cdataHook
)
{
err
=
prs
->
cdataHook
(
prs
->
user_data
,
&
buf
[
old
],
pos
-
old
);
if
(
IKS_OK
!=
err
)
return
err
;
...
...
@@ -669,18 +671,20 @@ sax_core (iksparser *prs, char *buf, int len)
prs
->
tag_name
=
STACK_PUSH_START
;
if
(
!
prs
->
tag_name
)
return
IKS_NOMEM
;
prs
->
context
=
C_TAG_START
;
break
;
}
break
;
case
C_TAG_START
:
prs
->
context
=
C_TAG
;
if
(
'/'
==
c
)
{
switch
(
c
){
case
'/'
:
prs
->
tagtype
=
IKS_CLOSE
;
break
;
}
else
if
(
'?'
==
c
)
{
case
'?'
:
prs
->
context
=
C_PI
;
break
;
}
else
if
(
'!'
==
c
)
{
case
'!'
:
prs
->
context
=
C_MARKUP
;
break
;
}
...
...
@@ -689,7 +693,11 @@ sax_core (iksparser *prs, char *buf, int len)
break
;
case
C_TAG
:
if
(
IS_WHITESPACE
(
c
))
{
switch
(
c
){
case
' '
:
case
'\t'
:
case
'\r'
:
case
'\n'
:
if
(
IKS_CLOSE
==
prs
->
tagtype
)
prs
->
oldcontext
=
C_TAG_END
;
else
...
...
@@ -699,7 +707,7 @@ sax_core (iksparser *prs, char *buf, int len)
stack_old
=
-
1
;
STACK_PUSH_END
;
break
;
}
else
if
(
'/'
==
c
)
{
case
'/'
:
if
(
IKS_CLOSE
==
prs
->
tagtype
)
return
IKS_BADXML
;
prs
->
tagtype
=
IKS_SINGLE
;
prs
->
context
=
C_TAG_END
;
...
...
@@ -707,7 +715,7 @@ sax_core (iksparser *prs, char *buf, int len)
stack_old
=
-
1
;
STACK_PUSH_END
;
break
;
}
else
if
(
'>'
==
c
)
{
case
'>'
:
prs
->
context
=
C_TAG_END
;
if
(
stack_old
!=
-
1
)
STACK_PUSH
(
buf
+
stack_old
,
pos
-
stack_old
);
stack_old
=
-
1
;
...
...
@@ -735,11 +743,12 @@ sax_core (iksparser *prs, char *buf, int len)
break
;
case
C_ATTRIBUTE
:
if
(
'/'
==
c
)
{
switch
(
c
){
case
'/'
:
prs
->
tagtype
=
IKS_SINGLE
;
prs
->
context
=
C_TAG_END
;
break
;
}
else
if
(
'>'
==
c
)
{
case
'>'
:
prs
->
context
=
C_TAG_END
;
re
=
1
;
break
;
...
...
@@ -780,12 +789,13 @@ sax_core (iksparser *prs, char *buf, int len)
break
;
case
C_ATTRIBUTE_2
:
if
(
'/'
==
c
)
{
switch
(
c
){
case
'/'
:
prs
->
tagtype
=
IKS_SINGLE
;
prs
->
atts
[
prs
->
attcur
]
=
NULL
;
prs
->
context
=
C_TAG_END
;
break
;
}
else
if
(
'>'
==
c
)
{
case
'>'
:
prs
->
atts
[
prs
->
attcur
]
=
NULL
;
prs
->
context
=
C_TAG_END
;
re
=
1
;
...
...
@@ -797,10 +807,11 @@ sax_core (iksparser *prs, char *buf, int len)
case
C_VALUE
:
prs
->
atts
[
prs
->
attcur
+
1
]
=
STACK_PUSH_START
;
if
(
'\''
==
c
)
{
switch
(
c
){
case
'\''
:
prs
->
context
=
C_VALUE_APOS
;
break
;
}
else
if
(
'"'
==
c
)
{
case
'\"'
:
prs
->
context
=
C_VALUE_QUOT
;
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment