Kaydet (Commit) a529c74d authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Added old release. And moved gitlab

üst 36e5b94c
......@@ -28,58 +28,7 @@
*.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
*.su
.pypi.rc
Author
======
Gurer Ozen <meduketto at gmail.com>
Contributions
=============
Bernhard R. Link (code)
Fabien Ninoles (code)
Evan Prodromou (jabberx improvements, project maintenance)
David Yitzchak Cohen (countless bug reports)
Benoit Laniel (mingw port)
Darrell Karbott (ikstransport)
Rafal Piotrowski (SASL auth)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
License:
========
iksemel is developed and released under GNU Lesser General Public License.
A copy of the license can be found in the file COPYING. You should read it
before sending patches to the iksemel, since it is implicitly assumed that
your patches are also submitted under the LGPL license.
General Idea:
=============
Main goal of the iksemel is removing complexity from programs using the
library and the library itself. This is the reason why only a subset of XML
is supported. Some things like UTF16, entity definitons, DTDs will be eventually
implemented when we found ways to implement them without adding
too much complexity to the iksemel code. Somewhat external standarts
(XPath, XQuery, XSLT, vs) will probably not make it into the iksemel.
File Layout:
============
doc/
* iksemel.texi Documentation in texinfo format.
include/
* common.h Internal header for some common definitions.
* iksemel.h Library API
* finetune.h Default memory allocation sizes.
src/
* ikstack.c Memory management functions.
* utility.c Small string utility functions.
* iks.c XML tree management.
* sax.c SAX parser.
* dom.c DOM parser.
* stream.c Stream parser.
* sha.c SHA1 hash functions.
* jabber.c Jabber utilities.
* filter.c Packet filter for Jabber.
test/
(self test programs)
tools/
(varius utility programs)
This diff is collapsed.
##
## Process this file with automake to produce Makefile.in
##
if DO_PYTHON
python_d = python
endif
SUBDIRS = include src tools $(python_d) test doc
EXTRA_DIST = HACKING iksemel.pc.in
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA = iksemel.pc
snapshot:
$(MAKE) dist distdir=$(PACKAGE)-`date +"%y%m%d"`
mv $(PACKAGE)-`date +"%y%m%d"`.tar.gz ../
ikslite:
cp include/iksemel.h ../
cat include/finetune.h src/utility.c src/ikstack.c src/sax.c src/iks.c src/dom.c >../iksemel.c
V1.5 (upcoming release)
* You can now use OpenSSL or GNUTLS as the TLS back-end (compile time option).
* Python bindings. You can use iksemel from Python as an XMPP client library
or as a very fast and memory efficient XML parser.
V1.4 (2009-07-25)
* Some previously rejected valid UTF8 sequences are now accepted.
* Whitespace is allowed between attribute name, equal sign and value.
* Small fixes all around (see ChangeLog).
V1.3 (2007-08-02)
* Project is moved to
http://code.google.com/p/iksemel/
there is also a new mailing list at:
http://groups.google.com/group/iksemel
Please use those instead of old jabberstudio.org addresses.
* iksemel is now participating in Coverity Inc's free software
quality improvement program (http://scan.coverity.com). As a
first result, a few problems found by Coverity's static analysis
tool in the iks_sasl_challenge() are fixed in this release, and
other than that, iksemel passes from defect test with no problems.
* Extra padding problem in the base64 encoder is fixed. Some servers
were having problems with extra '=' padded SASL digests.
* New dom functions: iks_append(), iks_prepend(), iks_append_cdata(),
iks_prepend_cdata(). You can append/prepend new nodes within the
siblings with them, insert_ functions were only appending at the
last child. Thus editing a tree is much easier now.
* iks_load was giving error on files with multiply of 4Kb sizes, fixed.
V1.2 (2004-08-06)
* SASL authentication.
* SSH connections via gnutls library.
* Socket code abstracted, you can even provide your own transport functions.
* Compiles on Windows with MinGW.
* iks_sha_print() uses lowercase hex numbers to comply with latest jabber.
* New stack implementation, much faster and uses less memory.
Unfortunately API has changed a bit:
iks_stack_strcat, strcatv, print functions removed.
iks_stack_stats modified.
iks_stack_strecat renamed to iks_stack_strcat.
iks_stack_new takes two chunk sizes, one for structures one for strings.
iks_stack_strdup returns (char *).
V1.1 (2003-09-11)
* Minor sax parser speed up.
* iks_string() and dom parser performance is improved greatly.
* iksperf: new tool for measuring iksemel performance.
* ikslint: better error checking. supports stdin. can display tag usage histogram.
* New dom functions: iks_copy(), iks_copy_within(), iks_root(), iks_tree().
* License of the documentation changed to GPL from GNU FDL.
V1.0 (2003-06-29)
* API redesigned.
* iconv interface removed.
* ikslint and iksroster tools.
* Jabber packet filter.
* IPv6 support.
* iks_find_with_attrib, iks_next_tag, iks_prev_tag, iks_first_tag functions.
* Parser improvements (CDATA sections, comments, UTF8 validity checks)
* Memory pools are replaced with object stacks.
V0.1 (2002-10-30)
* First release.
iksemel 1.4
Copyright (c) 2000-2007 Gurer Ozen
Copyright (c) 2016-2018 Suleyman Poyraz (Zaryob)
Introduction:
-------------
This is an XML parser library mainly designed for Jabber applications.
It provides SAX, DOM, and special Jabber stream APIs. Library is coded
in ANSI C except the network code (which is POSIX compatible), thus
highly portable. Iksemel is released under GNU Lesser General Public
License. A copy of the license is included in the COPYING file.
Requirements:
-------------
Libtool, Automake and Autoconf packages are required for compiling cvs
versions.
Compiling & Install:
--------------------
If you got the source from CVS, type
./autogen.sh
for creating configuration script and files.
Then type
./configure
make
now library is compiled. You can test it with
make check
and install it with
(become root if necessary)
make install
==> 1.5 release, abi/api compatible, will be released in a few months
* parser: &#1234; and &#xA25F; like entities must be unescaped.
==> 1.6 release abi/api compatible, early 2010
* rewrite sax parser for better performance and correctness
* xml pretty printer
* file stream based xml printer
==> 2.0 release, major abi/api changes
* offer a high level jabber api for managing connection details
* input/output modules for encodings (utf8/16), compression (zlib,bzip2),
and source (file, memory, network stream).
==> ideas
* packet filter or a generic xml filter? something like a simplified xpath?
* a separate utf8 validator function can be useful
* utf8 <-> utf16 conversion functions can be useful
anything else? :-)
#!/bin/sh
# Run this to generate the configure script.
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "Error: You must have 'autoconf' installed on your system in order"
echo " to generate a configure script."
echo
exit 1
}
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "Error: You must have 'autoheader' installed on your system in"
echo " order to generate a configure script."
echo " (Note that 'autoheader' is part of the 'autoconf' package)"
echo
exit 1
}
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "Error: You must have 'libtool' installed on your system in order"
echo " to generate a configure script."
echo
exit 1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "Error: You must have 'automake' installed on your system in order"
echo " to generate a configure script."
echo
exit 1
}
(aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "Error: You must have 'aclocal' installed on your system in order"
echo " to generate a configure script."
echo " (Note that 'aclocal' is part of the 'automake' package)"
echo
exit 1
}
srcdir=`dirname $0`
echo "Running libtoolize..."
libtoolize --copy --force --automake
echo "Running aclocal..."
aclocal
echo "Running autoheader..."
autoheader
echo "Running automake..."
automake --add-missing --gnu --include-deps
echo "Running autoconf..."
autoconf
echo
echo "Done!"
echo "Now run $srcdir/configure in order to create Makefiles."
echo
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE(iksemel,1.5)
AM_CONFIG_HEADER(include/config.h)
AC_CANONICAL_HOST
dnl Checks for programs
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_TOOL(OBJDUMP, objdump, :)
AM_PROG_LIBTOOL
AC_LANG_C
PKG_PROG_PKG_CONFIG
dnl Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h strings.h errno.h)
dnl Checks for typedefs and structures
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
dnl Special check for windows
case "$host_os" in
*mingw*)
AC_CHECK_LIB(wsock32, main, , AC_MSG_ERROR(Winsock is needed for a Win32 build.))
;;
esac
dnl Check for posix io
AC_ARG_ENABLE(default-io,
AS_HELP_STRING([--disable-default-io],[disable builtin socket transport code]),
defio=$enableval, defio=yes)
if test "$defio" = yes; then
AC_DEFINE(USE_DEFAULT_IO,1,[Define this is you want default transport])
fi
AM_CONDITIONAL(DO_POSIX, test "x$defio" = "xyes")
dnl Checks for library functions
AC_SEARCH_LIBS(recv,socket)
AC_CHECK_FUNCS(getopt_long)
AC_CHECK_FUNCS(getaddrinfo)
dnl Check -Wall flag of GCC
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -Wall"
fi
fi
dnl Options for overriding TLS checks
AC_ARG_WITH([openssl],
AS_HELP_STRING([--without-openssl],[disable checking for openssl]),
[with_openssl=$enableval],
[with_openssl=yes]
)
AC_ARG_WITH([gnutls],
AS_HELP_STRING([--without-gnutls],[disable checking for GNU TLS]),
[with_gnutls=$enableval],
[with_gnutls=yes]
)
dnl Check OpenSSL
if test "x$with_openssl" = "xyes"; then
PKG_CHECK_MODULES([OPENSSL], openssl >= 0.9.8, have_openssl=yes, have_openssl=no)
if test "x$have_openssl" = "xyes"; then
LIBOPENSSL_CFLAGS="$OPENSSL_CFLAGS"
LIBOPENSSL_LIBS="$OPENSSL_LIBS"
AC_SUBST(LIBOPENSSL_CFLAGS)
AC_SUBST(LIBOPENSSL_LIBS)
AC_DEFINE(HAVE_OPENSSL, 1, [whether to use OpenSSL support.])
fi
fi
dnl Check GNU TLS
if test "x$with_gnutls" = "xyes"; then
if test "x$have_openssl" != "xyes"; then
PKG_CHECK_MODULES([GNUTLS], gnutls >= 2.0.0, have_gnutls=yes, have_gnutls=no)
if test "x$have_gnutls" = "xyes"; then
LIBGNUTLS_CFLAGS="$GNUTLS_CFLAGS"
LIBGNUTLS_LIBS="$GNUTLS_LIBS"
AC_SUBST(LIBGNUTLS_CFLAGS)
AC_SUBST(LIBGNUTLS_LIBS)
AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
fi
fi
fi
dnl Option for overriding Python check
AC_ARG_ENABLE([python],
AS_HELP_STRING([--disable-python],[disable checking for Python bindings]),
[with_python=$enableval],
[with_python=yes]
)
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_INCLUDES
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)"`
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
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_TRY_CPP([#include <Python.h>],dnl
[AC_MSG_RESULT(found)
$1],dnl
[AC_MSG_RESULT(not found)
$2])
CPPFLAGS="$save_CPPFLAGS"
])
dnl Check Python for binding
if test "x$with_python" = "xyes"; then
with_python=no
AM_PATH_PYTHON([3.2], , [:])
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"])
dnl Generating makefiles
AC_CONFIG_FILES([
Makefile
iksemel.pc
src/Makefile
include/Makefile
tools/Makefile
python/Makefile
test/Makefile
doc/Makefile
])
AC_OUTPUT
##
## Process this file with automake to produce Makefile.in
##
info_TEXINFOS = iksemel.texi
This diff is collapsed.
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: iksemel
Description: XML parser library for Jabber
Version: @VERSION@
Libs: -L${libdir} -liksemel
Cflags: -I${includedir}
##
## Process this file with automake to produce Makefile.in
##
include_HEADERS = iksemel.h
noinst_HEADERS = common.h finetune.h
/* iksemel (XML parser for Jabber)
** Copyright (C) 2000-2003 Gurer Ozen <madcat@e-kolay.net>
** This code is free software; you can redistribute it and/or
** modify it under the terms of GNU Lesser General Public License.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <stdio.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#elif HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifndef errno
extern int errno;
#endif
#include "finetune.h"
/* iksemel (XML parser for Jabber)
** Copyright (C) 2000-2003 Gurer Ozen <madcat@e-kolay.net>
** This code is free software; you can redistribute it and/or
** modify it under the terms of GNU Lesser General Public License.
*/
/* minimum sax buffer size */
#define SAX_BUFFER_MIN_SIZE 128
/* sax parser structure plus extra data of dom parser */
#define DEFAULT_DOM_CHUNK_SIZE 256
/* sax parser structure plus extra data of stream parser */
#define DEFAULT_STREAM_CHUNK_SIZE 256
/* iks structure, its data, child iks structures, for stream parsing */
#define DEFAULT_IKS_CHUNK_SIZE 1024
/* iks structure, its data, child iks structures, for file parsing */
#define DEFAULT_DOM_IKS_CHUNK_SIZE 2048
/* rule structure and from/to/id/ns strings */
#define DEFAULT_RULE_CHUNK_SIZE 128
/* file is read by blocks with this size */
#define FILE_IO_BUF_SIZE 4096
/* network receive buffer */
#define NET_IO_BUF_SIZE 4096
##
## Process this file with automake to produce Makefile.in
##
INCLUDES = -I$(top_srcdir)/include $(PYTHON_INCLUDES)
pyexec_LTLIBRARIES = iksemel.la
iksemel_la_LIBADD = $(top_builddir)/src/libiksemel.la
iksemel_la_SOURCES = pyiksemel.c stream.c jid.c document.c node.c exceptions.c
iksemel_la_CFLAGS = $(CFLAGS) -fno-strict-aliasing -Wunused-variable -Wunused-function -Wincompatible-pointer-types
iksemel_la_LDFLAGS = -avoid-version -module -export-symbols-regex initiksemel
#include "exceptions.h"
#include "document.h"
#include "node.h"
/* Document */
static PyTypeObject Document_type = {
PyVarObject_HEAD_INIT(NULL,0)
"iksemel.Node", /* tp_name */
sizeof(Document), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)Document_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
"XML doc object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
0 /* tp_new */
};
/* Iterator */
static PyTypeObject Iter_type = {
PyVarObject_HEAD_INIT(NULL,0)
"iksemel.Iter", /* tp_name */
sizeof(Iter), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
"XML iter object", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
(getiterfunc)Iter_iter, /* tp_iter */
(iternextfunc)Iter_next,/* tp_iternext */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
0 /* tp_new */
};
static void
Document_dealloc(Document *self)
{
if (self->document) iks_delete(self->document);
PyTypeObject* ob_type(PyObject *self);
}
static PyObject *
Iter_iter(Iter *self)
{
Py_INCREF(self);
return (PyObject *)self;
}
static PyObject *
Iter_next(Iter *self)
{
iks *node;
node = self->node;
if (!node) return NULL;
if (self->tags) {
self->node = iks_next_tag(node);
if (self->node && self->tagname) {
while (self->node && (strcmp(self->tagname, iks_name(self->node)) != 0)) {
self->node = iks_next_tag(self->node);
}
}
} else {
self->node = iks_next(node);
}
return new_node(self->doc, node);
}
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