Files
fx/test/core/streams.c

22 lines
411 B
C
Raw Permalink Normal View History

2026-03-16 10:35:43 +00:00
#include <fx/core/bstr.h>
#include <fx/core/stream.h>
2025-06-27 21:54:10 +01:00
#include <stdio.h>
int main(void)
{
2026-03-16 10:35:43 +00:00
fx_stream_read_line_s(fx_stdin, fx_stdout);
fx_stream_write_char(fx_stdout, '\n');
2025-06-27 21:54:10 +01:00
char s[16];
2026-03-16 10:35:43 +00:00
fx_bstr str;
fx_bstr_begin(&str, s, sizeof s);
2026-03-16 10:35:43 +00:00
fx_stream_read_line_s(fx_stdin, (fx_stream *)&str);
fx_stream_write_char((fx_stream *)&str, '\n');
2026-03-16 10:35:43 +00:00
const char *e = fx_bstr_end(&str);
fputs(e, stdout);
2025-06-27 21:54:10 +01:00
return 0;
}