aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2007-09-07 00:20:10 -0400
committerThomas Harning Jr <harningt@gmail.com>2007-09-07 00:20:10 -0400
commita2741acddc500c191cdd934a6e8ce74efb9326e9 (patch)
treed32eec60980ade5bdd5e870c25502a169420f667 /src
parentb91e1c1b09f445ae1570aa39596e3ac2eaf4203a (diff)
downloadluaevent-prosody-a2741acddc500c191cdd934a6e8ce74efb9326e9.tar.gz
luaevent-prosody-a2741acddc500c191cdd934a6e8ce74efb9326e9.zip
event_buffer learned to manage '#' and the __tostring metafield
Diffstat (limited to 'src')
-rw-r--r--src/event_buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/event_buffer.c b/src/event_buffer.c
index 546a596..ff3bad3 100644
--- a/src/event_buffer.c
+++ b/src/event_buffer.c
@@ -187,6 +187,10 @@ int event_buffer_register(lua_State* L) {
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");