1From 77cb691f781918908dfe34785f00a5ff75d5cc20 Mon Sep 17 00:00:00 2001 2From: Francois Perrad <francois.perrad@gadz.org> 3Date: Sat, 16 Feb 2019 15:56:00 +0100 4Subject: [PATCH] restore getcurrentbytecount 5 6see https://github.com/tomasguisasola/luaexpat/issues/3 7 8Fetch from: https://github.com/tomasguisasola/luaexpat/commit/0926f2d705109b7d35b721344264b39c1169e0de 9 10Signed-off-by: Francois Perrad <francois.perrad@gadz.org> 11--- 12 src/lxplib.c | 7 +++++++ 13 1 file changed, 7 insertions(+) 14 15diff --git a/luaexpat-1.3.3/src/lxplib.c b/luaexpat-1.3.3/src/lxplib.c 16index 7726913..35bec3c 100644 17--- a/luaexpat-1.3.3/src/lxplib.c 18+++ b/luaexpat-1.3.3/src/lxplib.c 19@@ -538,11 +538,18 @@ static int lxp_stop (lua_State *L) { 20 return 1; 21 } 22 23+static int lxp_getcurrentbytecount (lua_State* L) { 24+ lxp_userdata *xpu = checkparser(L, 1); 25+ lua_pushinteger(L, XML_GetCurrentByteCount(xpu->parser)); 26+ return 1; 27+} 28+ 29 static const luaL_Reg lxp_meths[] = { 30 {"parse", lxp_parse}, 31 {"close", lxp_close}, 32 {"__gc", parser_gc}, 33 {"pos", lxp_pos}, 34+ {"getcurrentbytecount", lxp_getcurrentbytecount}, 35 {"setencoding", lxp_setencoding}, 36 {"getcallbacks", getcallbacks}, 37 {"getbase", getbase}, 38-- 392.17.1 40 41