src/lxplib.c

changeset 17
7f0e6f8bb8e0
parent 10
e981a82571cf
child 18
90da47758f85
equal deleted inserted replaced
16:1f41c74ce686 17:7f0e6f8bb8e0
522 #if !defined LUA_VERSION_NUM 522 #if !defined LUA_VERSION_NUM
523 /* Lua 5.0 */ 523 /* Lua 5.0 */
524 #define luaL_Reg luaL_reg 524 #define luaL_Reg luaL_reg
525 #endif 525 #endif
526 526
527 static int lxp_getcurrentbytecount (lua_State* L) {
528 lxp_userdata *xpu = checkparser(L, 1);
529 lua_pushinteger(L, XML_GetCurrentByteCount(xpu->parser));
530 return 1;
531 }
532
527 static const struct luaL_Reg lxp_meths[] = { 533 static const struct luaL_Reg lxp_meths[] = {
528 {"parse", lxp_parse}, 534 {"parse", lxp_parse},
529 {"close", lxp_close}, 535 {"close", lxp_close},
530 {"__gc", parser_gc}, 536 {"__gc", parser_gc},
531 {"pos", lxp_pos}, 537 {"pos", lxp_pos},
538 {"getcurrentbytecount", lxp_getcurrentbytecount},
532 {"setencoding", lxp_setencoding}, 539 {"setencoding", lxp_setencoding},
533 {"getcallbacks", getcallbacks}, 540 {"getcallbacks", getcallbacks},
534 {"getbase", getbase}, 541 {"getbase", getbase},
535 {"setbase", setbase}, 542 {"setbase", setbase},
536 {"stop", lxp_stop}, 543 {"stop", lxp_stop},

mercurial