Files
bluelib/test/ds/streams.c

20 lines
539 B
C
Raw Normal View History

2025-06-27 21:54:10 +01:00
#include <blue/core/stream.h>
2025-10-24 12:51:54 +01:00
#include <blue/core/stringstream.h>
#include <blue/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;
2025-10-24 12:51:54 +01:00
b_stringstream *dest_stream = b_stringstream_create();
b_stream_buffer *buf = b_stream_buffer_create_dynamic(1024);
b_stream_read_all_bytes_s(b_stdin, dest_stream, buf, &nr_read);
2025-06-27 21:54:10 +01:00
printf("done. read %zu bytes total.\n", nr_read);
2025-10-24 12:51:54 +01:00
printf("%s\n", b_stringstream_ptr(dest_stream));
b_stringstream_unref(dest_stream);
b_stream_buffer_unref(buf);
2025-06-27 21:54:10 +01:00
return 0;
}