summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-03-04 00:26:04 +0100
committerAki <please@ignore.pl>2021-03-04 00:26:04 +0100
commit296fe762dd2207d4052c0d41c9186ac23922dd1d (patch)
treee79f48467f8abf09ec65076bf6f430411a51e54b
parenteb8aab2bb5906fe26a881b526da5696e49abddc5 (diff)
downloadplop-296fe762dd2207d4052c0d41c9186ac23922dd1d.zip
plop-296fe762dd2207d4052c0d41c9186ac23922dd1d.tar.gz
plop-296fe762dd2207d4052c0d41c9186ac23922dd1d.tar.bz2
Added stubs to stream metatable
-rw-r--r--stream.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/stream.c b/stream.c
index eac89a8..d456619 100644
--- a/stream.c
+++ b/stream.c
@@ -28,9 +28,23 @@ int stream_push_new(lua_State * L, const int fd)
lua_pushliteral(L, "__index");
lua_createtable(L, 0, 1);
- lua_pushliteral(L, "read");
- lua_pushcfunction(L, stream_read);
- lua_rawset(L, -3);
+ {
+ lua_pushliteral(L, "read");
+ lua_pushcfunction(L, stream_read);
+ lua_rawset(L, -3);
+
+ lua_pushliteral(L, "skip");
+ lua_pushnil(L); // TODO: Implement skipping in input buffer.
+ lua_rawset(L, -3);
+
+ lua_pushliteral(L, "write");
+ lua_pushnil(L); // TODO: Implement writing operation.
+ lua_rawset(L, -3);
+
+ lua_pushliteral(L, "flush");
+ lua_pushnil(L); // TODO: Implement flush for output buffer.
+ lua_rawset(L, -3);
+ }
lua_rawset(L, -3);
}