Hi Paolo, > Bruno, what do you think?
This implementation is one out of 4 possible ones. Thanks for having written it; I will complete the two remaining ones. > +extern struct filter * filter_create (const char *progname, > + const char *prog_path, > + const char **prog_argv, > + bool null_stderr, bool exit_on_error, > + char *read_buf, size_t read_bufsize, > + done_read_fn done_read, > + void *private_data); Some applications will want to read each chunk of output from the child process into the same buffer; some others will want to have it in a different memory area each time. In the second case the done_read() function will have to do a memcpy. To avoid this overhead, I introduced the 'prepare_read' argument. Also, the name of 'struct filter' is too generic for a data type defined in a public header file and used only for a specific purpose. A more specific name is in order, IMHO. So, I'll try to combine your module with mine, and add the two missing alternative APIs. Bruno