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
4e35b500
Kaydet (Commit)
4e35b500
authored
Kas 08, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merged main branch from "meducetto/iksemel"
üst
978b7334
73ea9afd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
184 additions
and
41 deletions
+184
-41
.gitignore
.gitignore
+85
-0
ChangeLog
ChangeLog
+22
-9
configure.ac
configure.ac
+10
-4
Makefile.am
python/Makefile.am
+1
-1
document.c
python/document.c
+3
-5
jid.c
python/jid.c
+7
-8
node.c
python/node.c
+0
-0
node.h
python/node.h
+20
-0
pyiksemel.c
python/pyiksemel.c
+26
-2
reference.c
python/reference.c
+2
-3
stream.c
python/stream.c
+8
-9
No files found.
.gitignore
0 → 100644
Dosyayı görüntüle @
4e35b500
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
build/
__pycache__/
# Debug files
*.dSYM/
#Autotool files
aclocal.m4
autom4te.cache/
#Configure files
config.guess
config.status
config.sub
config.log
configure
config.h.in
*.log
*.trs
.deps/
.libs/
#Iks compiled files
doc/iksemel
include/config.h
include/stamp-h1
tools/ikslint
tools/iksperf
tools/iksroster
test/tst-dom
test/tst-filter
test/tst-iks
test/tst-ikstack
test/tst-jid
test/tst-sha
test/tst-md5
test/tst-sax
#Makefile files
Makefile
Makefile.in
#Tex files
*.tex
#Libtool files
libtool
*.pc
missing
depcomp
install-sh
compile
ltmain.sh
test-driver
ChangeLog
Dosyayı görüntüle @
4e35b500
2019-10-08 Zaryob
* The Developments that I used for my own project and made to the piksemel
version which was distributed in the past by TUBITAK/Pardus, now I am also
making the main branch.
- Python3 support have been added:
- Because of the complexity of iksemel and huge changes between python3
and python2 c-api is caused to create an incompatible port to versions
older than 3.2
2016-12-02 Zaryob
* Initial commit
2011-10-18 Gurer
* python/: Python bindings and test scripts
...
...
@@ -502,15 +515,15 @@
* test/testiks.c: removed buggy unit test for previous entry,
since I couldn't figure out why it segfaulted. Will investigate
and fix later.
2002-01-07 Evan Prodromou <mr.bad@pigdog.org>
* core.c: fixed off-by-one bug with reallocation of attributes.
* test/testiks.c: added test for above bug.
2002-12-20 Evan Prodromou <mr.bad@pigdog.org>
* COPYING: New version of the LGPL.
* INSTALL: New FSF install info. Both of these were updated by autoreconf.
2002-12-12 Evan Prodromou <mr.bad@pigdog.org>
* include/iksemel.h: added id to Jabber packets.
* src/jabber.c: get ID in Jabber packets.
...
...
@@ -531,7 +544,7 @@
* iks.c: fixed iks constructor/destructor so they mark pool owner
and only delete the pool if the iks is the owner.
* sha.c: changed sha objects to use pool memory.
2002-11-07 Evan Prodromou <mr.bad@pigdog.org>
* ikspool.c: added ALIGN_ON, ALIGNED(), *_OFFSET macros.
...
...
@@ -556,7 +569,7 @@
* ikspool.c: For iks_pool_realloc, made it call _alloc if the
passed-in pointer is NULL. This is the way realloc() works.
* testpool.c: added a test for the above condition.
2002-11-04 Evan Prodromou <mr.bad@pigdog.org>
* ikspool.c: Added some comments.
...
...
@@ -573,12 +586,12 @@
previously NULL.
* testid.c: added tests to check for above bug.
* test/.cvsignore: Ignore testpool and testid.
2002-11-03 Evan Prodromou <mr.bad@pigdog.org>
* iksid.c: fixed bug in iks_id_new with partial (no resource) IDs.
* testid.c: added tests to check for above bug.
2002-11-03 Evan Prodromou <mr.bad@pigdog.org>
* iksid.c: moved iksid functions to this file from jabber.c.
...
...
@@ -587,13 +600,13 @@
made iks_id_new use iks_pool_set_owner if it creates a pool.
changed iks_id_new so it doesn't write on src.
* iksemel.h: added prototype for iks_id_delete.
* testid.c: created basic unit tests for iksid.
* testid.c: created basic unit tests for iksid.
2002-11-02 Evan Prodromou <mr.bad@pigdog.org>
* Added the beginnings of unit tests for memory allocation.
More needed.
2002-11-02 Evan Prodromou <mr.bad@pigdog.org>
* ikspool.c: added new best-fit memory allocation functions.
...
...
configure.ac
Dosyayı görüntüle @
4e35b500
...
...
@@ -105,12 +105,17 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
PYTHON_CONFIG=`which $PYTHON`-config
if test -x "$PYTHON_CONFIG"; then
PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
...
...
@@ -126,8 +131,9 @@ CPPFLAGS="$save_CPPFLAGS"
dnl Check Python for binding
if test "x$with_python" = "xyes"; then
with_python=no
AM_PATH_PYTHON([2.2], , [:])
AM_CHECK_PYTHON_HEADERS(with_python=yes,[AC_MSG_ERROR(could not find Python headers)])
AM_PATH_PYTHON([3],, [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
AM_CHECK_PYTHON_HEADERS(with_python=yes, [AC_MSG_ERROR(could not find Python headers)])
fi
AM_CONDITIONAL([DO_PYTHON], [test "x$with_python" = "xyes"])
...
...
python/Makefile.am
Dosyayı görüntüle @
4e35b500
...
...
@@ -9,4 +9,4 @@ pyexec_LTLIBRARIES = iksemel.la
iksemel_la_LIBADD
=
$(top_builddir)
/src/libiksemel.la
iksemel_la_SOURCES
=
pyiksemel.c stream.c jid.c document.c reference.c exceptions.c
iksemel_la_CFLAGS
=
$(CFLAGS)
-fno-strict-aliasing
iksemel_la_LDFLAGS
=
-avoid-version
-module
-export-symbols-regex
init
iksemel
iksemel_la_LDFLAGS
=
-avoid-version
-module
-export-symbols-regex
PyInit_
iksemel
python/document.c
Dosyayı görüntüle @
4e35b500
...
...
@@ -20,8 +20,7 @@ static PyObject *Iter_iter(Iter *self);
static
PyObject
*
Iter_next
(
Iter
*
self
);
static
PyTypeObject
Iter_type
=
{
PyObject_HEAD_INIT
(
NULL
)
0
,
/* ob_size */
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"iksemel.Iter"
,
/* tp_name */
sizeof
(
Iter
),
/* tp_basicsize */
0
,
/* tp_itemsize */
...
...
@@ -160,8 +159,7 @@ static PyMethodDef Document_methods[] = {
};
static
PyTypeObject
Document_type
=
{
PyObject_HEAD_INIT
(
NULL
)
0
,
/* ob_size */
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"iksemel.Document"
,
/* tp_name */
sizeof
(
Document
),
/* tp_basicsize */
0
,
/* tp_itemsize */
...
...
@@ -636,7 +634,7 @@ Document_dealloc(Document *self)
Py_DECREF
(
self
->
ref
);
self
->
doc
=
NULL
;
self
->
ref
=
NULL
;
self
->
ob_type
->
tp_free
((
PyObject
*
)
self
);
PyTypeObject
*
ob_type
(
PyObject
*
self
);
}
void
...
...
python/jid.c
Dosyayı görüntüle @
4e35b500
...
...
@@ -9,7 +9,7 @@
// NOTE: This class uses custom implementation of JID parsing
// instead of the iks_id_new from jabber.c
//
//
typedef
struct
{
PyObject_HEAD
...
...
@@ -30,8 +30,7 @@ static PyMemberDef JID_members[] = {
};
static
PyTypeObject
JID_type
=
{
PyObject_HEAD_INIT
(
NULL
)
0
,
/* ob_size */
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"iksemel.JID"
,
/* tp_name */
sizeof
(
JID
),
/* tp_basicsize */
0
,
/* tp_itemsize */
...
...
@@ -120,18 +119,18 @@ JID_str(JID *self)
char
*
resource
=
""
;
if
(
self
->
local
&&
self
->
local
!=
Py_None
)
{
local
=
Py
String
_AsString
(
self
->
local
);
local
=
Py
Bytes
_AsString
(
self
->
local
);
if
(
!
local
)
return
NULL
;
localsep
=
"@"
;
}
domain
=
Py
String
_AsString
(
self
->
domain
);
domain
=
Py
Bytes
_AsString
(
self
->
domain
);
if
(
!
domain
)
return
NULL
;
if
(
self
->
resource
&&
self
->
resource
!=
Py_None
)
{
resource
=
Py
String
_AsString
(
self
->
resource
);
resource
=
Py
Bytes
_AsString
(
self
->
resource
);
if
(
!
resource
)
return
NULL
;
resourcesep
=
"/"
;
}
return
Py
String
_FromFormat
(
"%s%s%s%s%s"
,
local
,
localsep
,
domain
,
resourcesep
,
resource
);
return
Py
Bytes
_FromFormat
(
"%s%s%s%s%s"
,
local
,
localsep
,
domain
,
resourcesep
,
resource
);
}
static
void
...
...
@@ -140,7 +139,7 @@ JID_dealloc(JID *self)
if
(
self
->
local
)
{
Py_DECREF
(
self
->
local
);
}
if
(
self
->
domain
)
{
Py_DECREF
(
self
->
domain
);
}
if
(
self
->
resource
)
{
Py_DECREF
(
self
->
resource
);
}
self
->
ob_type
->
tp_free
((
PyObject
*
)
self
);
PyTypeObject
*
ob_type
(
PyObject
*
self
);
}
void
...
...
python/node.c
0 → 100644
Dosyayı görüntüle @
4e35b500
This diff is collapsed.
Click to expand it.
python/node.h
0 → 100644
Dosyayı görüntüle @
4e35b500
#ifndef NODE_H
#define NODE_H 1
#include <Python.h>
#include "iksemel.h"
/*** Setup ***/
void
Setup_Node
(
PyObject
*
module
);
/*** Types ***/
typedef
struct
{
PyObject_HEAD
Document
*
doc
;
iks
*
node
;
}
Node
;
static
PyTypeObject
Node_type
;
#endif
/* NODE_H */
python/pyiksemel.c
Dosyayı görüntüle @
4e35b500
...
...
@@ -13,12 +13,35 @@
PyObject
*
iksemel_module
;
/*static PyMethodDef methods[] = {
{ "parse", ciks_parse, METH_VARARGS,
"Parse given XML file and generate document tree."},
{ "parseString", ciks_parseString, METH_VARARGS,
"Parse given XML string and generate document tree."},
{ "newDocument", ciks_newDocument, METH_VARARGS,
"Create a new document with given root tag name."},
{ NULL, NULL, 0, NULL }
};*/
static
struct
PyModuleDef
iksemeldef
=
{
PyModuleDef_HEAD_INIT
,
"iksemel"
,
/* m_name */
"This is a module"
,
/* m_doc */
-
1
,
/* m_size */
NULL
,
/* m_methods */
NULL
,
/* m_reload */
NULL
,
/* m_traverse */
NULL
,
/* m_clear */
NULL
,
/* m_free */
};
PyMODINIT_FUNC
init
iksemel
(
void
)
PyInit_
iksemel
(
void
)
{
PyObject
*
m
;
m
=
Py
_InitModule
(
"iksemel"
,
NULL
);
m
=
Py
Module_Create
(
&
iksemeldef
);
exceptions_setup
(
m
);
Reference_setup
();
...
...
@@ -27,4 +50,5 @@ initiksemel(void)
Stream_setup
(
m
);
iksemel_module
=
m
;
return
m
;
}
python/reference.c
Dosyayı görüntüle @
4e35b500
...
...
@@ -13,8 +13,7 @@ typedef struct {
static
void
Reference_dealloc
(
Reference
*
self
);
static
PyTypeObject
Reference_type
=
{
PyObject_HEAD_INIT
(
NULL
)
0
,
/* ob_size */
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"iksemel.Reference"
,
/* tp_name */
sizeof
(
Reference
),
/* tp_basicsize */
0
,
/* tp_itemsize */
...
...
@@ -57,7 +56,7 @@ static PyTypeObject Reference_type = {
static
void
Reference_dealloc
(
Reference
*
self
)
{
self
->
ob_type
->
tp_free
((
PyObject
*
)
self
);
PyTypeObject
*
ob_type
(
PyObject
*
self
);
}
void
...
...
python/stream.c
Dosyayı görüntüle @
4e35b500
...
...
@@ -34,8 +34,7 @@ static PyMethodDef Stream_methods[] = {
};
static
PyTypeObject
Stream_type
=
{
PyObject_HEAD_INIT
(
NULL
)
0
,
/* ob_size */
PyVarObject_HEAD_INIT
(
NULL
,
0
)
"iksemel.Stream"
,
/* tp_name */
sizeof
(
Stream
),
/* tp_basicsize */
0
,
/* tp_itemsize */
...
...
@@ -86,7 +85,7 @@ start_sasl(Stream *self, enum ikssasltype type)
o
=
PyObject_GetAttrString
(
self
->
jid
,
"local"
);
if
(
!
o
)
return
;
local
=
Py
String
_AsString
(
o
);
local
=
Py
Bytes
_AsString
(
o
);
if
(
!
local
)
{
Py_DECREF
(
o
);
return
;
...
...
@@ -103,7 +102,7 @@ start_sasl(Stream *self, enum ikssasltype type)
Py_DECREF
(
o
);
return
;
}
pw
=
Py
String
_AsString
(
ret
);
pw
=
Py
Bytes
_AsString
(
ret
);
if
(
!
pw
)
{
Py_DECREF
(
ret
);
Py_DECREF
(
o
);
...
...
@@ -125,7 +124,7 @@ make_bind(Stream *self)
o
=
PyObject_GetAttrString
(
self
->
jid
,
"resource"
);
if
(
!
o
)
return
;
resource
=
Py
String
_AsString
(
o
);
resource
=
Py
Bytes
_AsString
(
o
);
if
(
!
resource
)
{
PyErr_Clear
();
resource
=
"iksemel"
;
...
...
@@ -179,7 +178,7 @@ on_success(Stream *self, iks *node)
o
=
PyObject_GetAttrString
(
self
->
jid
,
"domain"
);
if
(
!
o
)
return
;
domain
=
Py
String
_AsString
(
o
);
domain
=
Py
Bytes
_AsString
(
o
);
if
(
!
domain
)
{
Py_DECREF
(
o
);
return
;
...
...
@@ -324,7 +323,7 @@ Stream_connect(Stream *self, PyObject *args, PyObject *kwargs)
o
=
PyObject_GetAttrString
(
self
->
jid
,
"domain"
);
if
(
!
o
)
return
NULL
;
host
=
Py
String
_AsString
(
o
);
host
=
Py
Bytes
_AsString
(
o
);
if
(
!
host
)
{
Py_DECREF
(
o
);
return
NULL
;
...
...
@@ -359,7 +358,7 @@ Stream_send(Stream *self, PyObject *args)
s
=
PyObject_Str
(
s
);
if
(
s
)
{
str
=
Py
String
_AsString
(
s
);
str
=
Py
Bytes
_AsString
(
s
);
if
(
str
)
{
e
=
iks_send_raw
(
self
->
parser
,
str
);
if
(
e
)
{
...
...
@@ -393,7 +392,7 @@ Stream_dealloc(Stream *self)
{
if
(
self
->
jid
)
{
Py_DECREF
(
self
->
jid
);
}
iks_parser_delete
(
self
->
parser
);
self
->
ob_type
->
tp_free
((
PyObject
*
)
self
);
PyTypeObject
*
ob_type
(
PyObject
*
self
);
}
void
...
...
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