Files
fx/test/ds/streams.c
2026-03-16 10:35:43 +00:00

20 lines
542 B
C

#include <fx/core/stream.h>
#include <fx/core/stringstream.h>
#include <fx/ds/string.h>
#include <stdio.h>
int main(int argc, const char **argv)
{
size_t nr_read = 0;
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);
printf("done. read %zu bytes total.\n", nr_read);
printf("%s\n", fx_stringstream_ptr(dest_stream));
fx_stringstream_unref(dest_stream);
fx_stream_buffer_unref(buf);
return 0;
}