125 write->buffer = NULL; |
125 write->buffer = NULL; |
126 } |
126 } |
127 return 0; |
127 return 0; |
128 } |
128 } |
129 |
129 |
|
130 static int buffer_event_get_read(lua_State* L) { |
|
131 (void)buffer_event_get(L, 1); |
|
132 lua_getfenv(L, 1); |
|
133 lua_rawgeti(L, -1, READ_BUFFER_LOCATION); |
|
134 return 1; |
|
135 } |
|
136 |
|
137 static int buffer_event_get_write(lua_State* L) { |
|
138 (void)buffer_event_get(L, 1); |
|
139 lua_getfenv(L, 1); |
|
140 lua_rawgeti(L, -1, WRITE_BUFFER_LOCATION); |
|
141 return 1; |
|
142 } |
|
143 |
130 static luaL_Reg buffer_event_funcs[] = { |
144 static luaL_Reg buffer_event_funcs[] = { |
|
145 {"get_read", buffer_event_get_read}, |
|
146 {"get_write", buffer_event_get_write}, |
131 {NULL, NULL} |
147 {NULL, NULL} |
132 }; |
148 }; |
133 |
149 |
134 static luaL_Reg funcs[] = { |
150 static luaL_Reg funcs[] = { |
135 {"new", buffer_event_push}, |
151 {"new", buffer_event_push}, |