Files
fx/test/ds/streams.c

20 lines
542 B
C
Raw Permalink Normal View History

2026-03-16 10:35:43 +00:00
#include <fx/core/stream.h>
#include <fx/core/stringstream.h>
#include <fx/ds/string.h>
2025-06-27 21:54:10 +01:00
#include <stdio.h>
int main(int argc, const char **argv)
{
size_t nr_read = 0;
2026-03-16 10:35:43 +00:00
fx_stringstream *dest_stream = fx_stringstream_create();
fx_stream_buffer *buf = fx_stream_buffer_create_dynamic(1024);
fx_stream_read_all_bytes_s(fx_stdin, dest_stream, buf, &nr_read);
2025-06-27 21:54:10 +01:00
printf("done. read %zu bytes total.\n", nr_read);
2026-03-16 10:35:43 +00:00
printf("%s\n", fx_stringstream_ptr(dest_stream));
2025-10-24 12:51:54 +01:00
2026-03-16 10:35:43 +00:00
fx_stringstream_unref(dest_stream);
fx_stream_buffer_unref(buf);
2025-06-27 21:54:10 +01:00
return 0;
}