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
bca26dfb
Kaydet (Commit)
bca26dfb
authored
Ara 16, 2016
tarafından
Suleyman Poyraz
Kaydeden (comit)
GitHub
Ara 16, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
make changes
üst
6072075d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
35 deletions
+40
-35
pyiks3.c
src/pyiks3.c
+40
-35
No files found.
src/pyiks3.c
Dosyayı görüntüle @
bca26dfb
...
...
@@ -40,6 +40,7 @@ typedef struct {
char
*
tagname
;
}
Iter
;
/*** Document ***/
static
void
Document_dealloc
(
Document
*
self
)
{
...
...
@@ -88,6 +89,8 @@ static PyTypeObject Document_type = {
0
/* tp_new */
};
/*** Iterator ***/
static
PyObject
*
Iter_iter
(
Iter
*
self
)
{
...
...
@@ -158,6 +161,29 @@ static PyTypeObject Iter_type = {
0
/* tp_new */
};
/*** Nodes ***/
static
PyObject
*
new_node
(
Document
*
doc
,
iks
*
xml
)
{
Node
*
node
;
int
ref
=
1
;
if
(
!
xml
)
return
PyErr_NoMemory
();
if
(
!
doc
)
{
doc
=
PyObject_New
(
Document
,
&
Document_type
);
doc
->
document
=
xml
;
ref
=
0
;
}
node
=
PyObject_New
(
Node
,
&
Node_type
);
node
->
doc
=
doc
;
if
(
ref
)
{
Py_INCREF
(
doc
);
}
node
->
node
=
xml
;
return
(
PyObject
*
)
node
;
}
static
void
Node_dealloc
(
Node
*
self
)
{
...
...
@@ -166,6 +192,20 @@ Node_dealloc(Node *self)
}
PyTypeObject
*
ob_type
(
PyObject
*
self
);
}
static
PyObject
*
Node_toString
(
Node
*
self
,
PyObject
*
args
)
{
PyObject
*
ret
;
char
*
str
;
str
=
iks_string
(
NULL
,
self
->
node
);
ret
=
Py_BuildValue
(
"s"
,
str
);
iks_free
(
str
);
return
ret
;
}
static
PyObject
*
Node_iter
(
Node
*
self
)
{
...
...
@@ -527,19 +567,6 @@ Node_previousTag(Node *self, PyObject *args)
return
new_node
(
self
->
doc
,
sibling
);
}
static
PyObject
*
Node_toString
(
Node
*
self
,
PyObject
*
args
)
{
PyObject
*
ret
;
char
*
str
;
str
=
iks_string
(
NULL
,
self
->
node
);
ret
=
Py_BuildValue
(
"s"
,
str
);
iks_free
(
str
);
return
ret
;
}
struct
makeup_ctx
{
unsigned
int
level
;
int
can_indent
;
...
...
@@ -858,28 +885,6 @@ static PyTypeObject Node_type = {
0
/* tp_new */
};
static
PyObject
*
new_node
(
Document
*
doc
,
iks
*
xml
)
{
Node
*
node
;
int
ref
=
1
;
if
(
!
xml
)
return
PyErr_NoMemory
();
if
(
!
doc
)
{
doc
=
PyObject_New
(
Document
,
&
Document_type
);
doc
->
document
=
xml
;
ref
=
0
;
}
node
=
PyObject_New
(
Node
,
&
Node_type
);
node
->
doc
=
doc
;
if
(
ref
)
{
Py_INCREF
(
doc
);
}
node
->
node
=
xml
;
return
(
PyObject
*
)
node
;
}
/*** Module Functions ***/
static
PyObject
*
...
...
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