/* Filtering of data through a subprocess.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 Free Software Foundation, Inc.
Written by Bruno Haible <haible@clisp.cons.org>, 2009,
and Paolo Bonzini <bonzini@gnu.org>, 2009.
num_bytes_written > 0.
Here p is always the private_data argument passed to the main function. */
typedef const void * (*prepare_write_fn) (size_t *num_bytes_p,
- void *private_data);
+ void *private_data);
typedef void (*done_write_fn) (void *data_written, size_t num_bytes_written,
- void *private_data);
+ void *private_data);
/* These two functions together describe the side that reads data from the
subprocess when it has the form of an iterator.
bytes were read into the buffer.
Here p is always the private_data argument passed to the main function. */
typedef void * (*prepare_read_fn) (size_t *num_bytes_p,
- void *private_data);
+ void *private_data);
typedef void (*done_read_fn) (void *data_read, size_t num_bytes_read,
- void *private_data);
+ void *private_data);
/* ============================ pipe_filter_ii ============================ */
- the positive exit code of the subprocess if that failed. */
extern int
pipe_filter_ii_execute (const char *progname,
- const char *prog_path, const char **prog_argv,
- bool null_stderr, bool exit_on_error,
- prepare_write_fn prepare_write,
- done_write_fn done_write,
- prepare_read_fn prepare_read,
- done_read_fn done_read,
- void *private_data);
+ const char *prog_path, const char **prog_argv,
+ bool null_stderr, bool exit_on_error,
+ prepare_write_fn prepare_write,
+ done_write_fn done_write,
+ prepare_read_fn prepare_read,
+ done_read_fn done_read,
+ void *private_data);
/* ============================ pipe_filter_ig ============================ */
Return the freshly created 'struct pipe_filter_gi'. */
extern struct pipe_filter_gi *
pipe_filter_gi_create (const char *progname,
- const char *prog_path, const char **prog_argv,
- bool null_stderr, bool exit_on_error,
- prepare_read_fn prepare_read,
- done_read_fn done_read,
- void *private_data);
+ const char *prog_path, const char **prog_argv,
+ bool null_stderr, bool exit_on_error,
+ prepare_read_fn prepare_read,
+ done_read_fn done_read,
+ void *private_data);
/* Write size bytes starting at buf into the pipe and in the meanwhile
possibly call the prepare_read and done_read functions specified to
- the positive exit code of the subprocess if that failed. */
extern int
pipe_filter_gi_write (struct pipe_filter_gi *filter,
- const void *buf, size_t size);
+ const void *buf, size_t size);
/* Finish reading the output via the prepare_read/done_read functions
specified to pipe_filter_gi_create.