# HG changeset patch # User Matthew Wild # Date 1307023838 -3600 # Node ID 95f4883da11fb82ae7303d84f2796b2183826e9a # Parent 304b5a6f85e46653f01772ce6dd76d611f150b4b Support for parser:stop() to abort processing (doesn't support suspend/resume yet for simplicity) diff -r 304b5a6f85e4 -r 95f4883da11f src/lxplib.c --- a/src/lxplib.c Wed Jun 01 22:16:24 2011 +0100 +++ b/src/lxplib.c Thu Jun 02 15:10:38 2011 +0100 @@ -511,6 +511,11 @@ return 0; } +static int lxp_stop (lua_State *L) { + lxp_userdata *xpu = checkparser(L, 1); + lua_pushboolean(L, XML_StopParser(xpu->parser, XML_FALSE) == XML_STATUS_OK); + return 1; +} static const struct luaL_reg lxp_meths[] = { {"parse", lxp_parse}, @@ -521,6 +526,7 @@ {"getcallbacks", getcallbacks}, {"getbase", getbase}, {"setbase", setbase}, + {"stop", lxp_stop}, {NULL, NULL} };