0001-restore-getcurrentbytecount.patch 1.2 KB

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