aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-08-28 22:55:41 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-08-28 22:55:41 +0100
commitcc56a2ee2b5703f9ea5ac63a86870af188845c30 (patch)
tree2660c03c1c90ad069d44e29af4365bca572926aa /main.c
parent66c64007317cf5b646c1f816463f4bc730e3b99f (diff)
downloadalisp-cc56a2ee2b5703f9ea5ac63a86870af188845c30.tar.gz
alisp-cc56a2ee2b5703f9ea5ac63a86870af188845c30.tar.bz2
alisp-cc56a2ee2b5703f9ea5ac63a86870af188845c30.zip
Still got some failures, but a basic stream implementation
Need to fix what's going on with the example in main.c using stdin.
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/main.c b/main.c
index f7f290f..98f2878 100644
--- a/main.c
+++ b/main.c
@@ -20,6 +20,21 @@
int main(void)
{
- puts("Watch this space\n");
+ stream_t stream = {0};
+ // const char data[] = "Hello, world!";
+ // const sv_t sv = SV(data, ARRSIZE(data) - 1);
+ // stream_init_string(&stream, NULL, sv);
+
+ // stream_init_file(&stream, "test.txt");
+
+ stream_init_file(&stream, "stdin", stdin);
+ printf("[debug]: setup stream pipe\n");
+ do
+ {
+ printf("%s[%lu]: `%c`\n", stream.name, stream.position,
+ stream_next(&stream));
+ } while (!stream_eoc(&stream));
+ printf("%lu/%lu\n", stream.position, stream_size(&stream));
+ stream_stop(&stream);
return 0;
}