提交 83f4a9dc authored 作者: Michael Jerris's avatar Michael Jerris

add iksemel to in tree libs

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3756 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 7d37a046
Author
======
Gurer Ozen <madcat@e-kolay.net>
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)
差异被折叠。
差异被折叠。
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.
Roadmap:
========
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.
* validation
I think easiest way to add this feature is writing another parser based on the
sax parser which parses a dtd (either from sax parser's markup callback which
needs to be implemented or from an external source via iks_vsax_set_dtd() call)
and checks the arguments of sax callbacks. Using it via dom or stream parsers
can require some clever tricks. there are also xml schemas. they are easy to parse
(it is xml anyway) but can be hard to apply.
* utf16
There are two sides of this. Improving parser to accept utf16 can be relatively
easy. But on the client side things can get confusing. What will be the default
character set used by iks_new(), iks_insert_cdata() and similar functions? and
how they will allow other charsets to be used. Supporting more than utf8 and
utf16 is more difficult. Hopefully there is no immediate need for this. Jabber
uses only utf8 and you can use iconv if you are using another charset in your
application. Btw, there is also byte order issue which is silly. Inventor of BOM
crap must be killed.
* jabber roster
Roster handling generally depends on the UI system used. But I think a generic
roster handler which parses roster result, pushes, presence changes and
allows application to access and display this data can be useful. Challenge
here is making it UI independent and extensible by the application.
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)
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
##
## Process this file with automake to produce Makefile.in
##
SUBDIRS = include src tools 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.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.2
Copyright (c) 2000-2004 Gurer Ozen <madcat@e-kolay.net>
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
This file contains a simple list of TODO items.
More general ideas can be found in the roadmap part of the file HACKING.
(in order of importance)
* parser: &#1234; and &#xA25F; like entities must be unescaped.
* 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? :-)
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
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.2)
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
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,
[ --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)
AM_PATH_LIBGNUTLS(,AC_DEFINE(HAVE_GNUTLS,,"Use libgnutls"))
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 Generating makefiles
AC_CONFIG_FILES([
Makefile
iksemel.pc
src/Makefile
include/Makefile
tools/Makefile
test/Makefile
doc/Makefile
])
AC_OUTPUT
##
## Process this file with automake to produce Makefile.in
##
info_TEXINFOS = iksemel.texi
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
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.
*/
void t_reset (void);
unsigned long t_elapsed (void);
void m_trace (void);
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论