diff -r 1f41c74ce686 -r 7f0e6f8bb8e0 src/lxplib.c --- a/src/lxplib.c Thu May 30 05:02:24 2013 +0700 +++ b/src/lxplib.c Wed Apr 02 20:53:54 2014 +0100 @@ -524,11 +524,18 @@ #define luaL_Reg luaL_reg #endif +static int lxp_getcurrentbytecount (lua_State* L) { + lxp_userdata *xpu = checkparser(L, 1); + lua_pushinteger(L, XML_GetCurrentByteCount(xpu->parser)); + return 1; +} + static const struct luaL_Reg lxp_meths[] = { {"parse", lxp_parse}, {"close", lxp_close}, {"__gc", parser_gc}, {"pos", lxp_pos}, + {"getcurrentbytecount", lxp_getcurrentbytecount}, {"setencoding", lxp_setencoding}, {"getcallbacks", getcallbacks}, {"getbase", getbase},