#include #include #include #include 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; }