Thu, 02 Jun 2011 15:10:38 +0100
Support for parser:stop() to abort processing (doesn't support suspend/resume yet for simplicity)
src/lxplib.c | file | annotate | diff | comparison | revisions |
--- 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} };