Fri, 07 Sep 2007 00:20:10 -0400
event_buffer learned to manage '#' and the __tostring metafield
src/event_buffer.c | file | annotate | diff | comparison | revisions |
--- a/src/event_buffer.c Fri Sep 07 00:17:08 2007 -0400 +++ b/src/event_buffer.c Fri Sep 07 00:20:10 2007 -0400 @@ -187,6 +187,10 @@ luaL_newmetatable(L, EVENT_BUFFER_MT); lua_pushcfunction(L, event_buffer_gc); lua_setfield(L, -2, "__gc"); + lua_pushcfunction(L, event_buffer_get_length); + lua_setfield(L, -2, "__len"); + lua_pushcfunction(L, event_buffer_get_data); + lua_setfield(L, -2, "__tostring"); lua_newtable(L); luaL_register(L, NULL, buffer_funcs); lua_setfield(L, -2, "__index");