Merge pull request #6 from rzuck/master
Fix for API error using libxml2 as the parser for libstrophe
This commit is contained in:
@@ -19,7 +19,6 @@ lib_LIBRARIES = libstrophe.a
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
libstrophe_a_CFLAGS=$(STROPHE_FLAGS) $(PARSER_CFLAGS)
|
libstrophe_a_CFLAGS=$(STROPHE_FLAGS) $(PARSER_CFLAGS)
|
||||||
libstrophe_a_include_HEADERS = strophe.h
|
|
||||||
libstrophe_a_SOURCES = src/auth.c src/conn.c src/ctx.c \
|
libstrophe_a_SOURCES = src/auth.c src/conn.c src/ctx.c \
|
||||||
src/event.c src/handler.c src/hash.c \
|
src/event.c src/handler.c src/hash.c \
|
||||||
src/jid.c src/md5.c src/sasl.c src/sha1.c \
|
src/jid.c src/md5.c src/sasl.c src/sha1.c \
|
||||||
|
|||||||
37
README.txt
37
README.txt
@@ -6,20 +6,37 @@ Our goals are:
|
|||||||
* well documented
|
* well documented
|
||||||
* reliable
|
* reliable
|
||||||
|
|
||||||
|
== GIT Instructions ==
|
||||||
|
|
||||||
|
By default, libstrophe has a dependency on the XML parsing
|
||||||
|
library expat. Expat is included as a submodule of this
|
||||||
|
repository. After cloning this repository, you will need
|
||||||
|
to run the following to acquire the expat submodule:
|
||||||
|
|
||||||
|
$ git submodule init
|
||||||
|
|
||||||
|
$ git submodule update
|
||||||
|
|
||||||
== Build Instructions ==
|
== Build Instructions ==
|
||||||
|
|
||||||
We use the 'scons' tool to build the library, unit tests,
|
From the top-level directory, run the following commands
|
||||||
documentation and examples. You'll need to obtain a copy
|
|
||||||
from http://www.scons.org/ or from your system distributor.
|
|
||||||
|
|
||||||
Once scons is installed, invoke 'scons' in the top-level
|
NOTE: By default libstrophe uses expat as it's XML parser.
|
||||||
directory to build the library. This will create a static
|
You may pass in --with-libxml2 with the ./configure command
|
||||||
library (also in the top-level) directory which can be
|
to switch to using libxml2 as your XML parser.
|
||||||
linked into other programs. The public api is defined
|
|
||||||
in <strophe.h> which is also in the top-level directory.
|
|
||||||
|
|
||||||
Invoke 'scons test' in the top-level directory to execute
|
$ ./bootstrap.sh
|
||||||
the unit and self tests.
|
|
||||||
|
$ ./configure
|
||||||
|
or
|
||||||
|
$ ./configure --with-libxml2
|
||||||
|
|
||||||
|
$ make
|
||||||
|
|
||||||
|
This will create a static library, also in the top-level
|
||||||
|
directory, which can be linked into other programs. The
|
||||||
|
public api is defined in <strophe.h> which is also in the
|
||||||
|
top-level directory.
|
||||||
|
|
||||||
The examples/ directory contains some examples of how to
|
The examples/ directory contains some examples of how to
|
||||||
use the library; these may be helpful in addition to the
|
use the library; these may be helpful in addition to the
|
||||||
|
|||||||
@@ -202,5 +202,11 @@ int parser_reset(parser_t *parser)
|
|||||||
/* feed a chunk of data to the parser */
|
/* feed a chunk of data to the parser */
|
||||||
int parser_feed(parser_t *parser, char *chunk, int len)
|
int parser_feed(parser_t *parser, char *chunk, int len)
|
||||||
{
|
{
|
||||||
return xmlParseChunk(parser->xmlctx, chunk, len, 0);
|
/* xmlParseChunk API returns 0 on success which is opposite logic to
|
||||||
|
the status returned by parser_feed */
|
||||||
|
if(!xmlParseChunk(parser->xmlctx, chunk, len, 0)) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user