| 242 } |
242 } |
| 243 |
243 |
| 244 FILE *inputfile = fopen(settings.infilename, "r"); |
244 FILE *inputfile = fopen(settings.infilename, "r"); |
| 245 if (inputfile) { |
245 if (inputfile) { |
| 246 UcxBuffer *filebuf = ucx_buffer_new(NULL, |
246 UcxBuffer *filebuf = ucx_buffer_new(NULL, |
| 247 2048, UCX_BUFFER_AUTOEXTEND); |
247 8192, UCX_BUFFER_AUTOEXTEND); |
| 248 { |
248 { |
| 249 const size_t tmpbufsize = 512; |
249 const size_t tmpbufsize = 4096; |
| 250 char *tmpbuf = malloc(tmpbufsize); |
250 char *tmpbuf = malloc(tmpbufsize); |
| 251 ucx_stream_copy(inputfile, filebuf, (read_func) fread, |
251 ucx_stream_copy(inputfile, filebuf, (read_func) fread, |
| 252 (write_func) ucx_buffer_write, |
252 (write_func) ucx_buffer_write, |
| 253 tmpbuf, tmpbufsize, (size_t)-1); |
253 tmpbuf, tmpbufsize, (size_t)-1); |
| 254 free(tmpbuf); |
254 free(tmpbuf); |