X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpipe-filter.h;h=4c156775e1eeba9f756d61b5161daeafe50169bb;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=0918235881a12f12e9fd4109eccd8ce570991711;hpb=a54fe4af6d5d2d56ab422b3600bc3d5d450b05c8;p=gnulib.git diff --git a/lib/pipe-filter.h b/lib/pipe-filter.h index 091823588..4c156775e 100644 --- a/lib/pipe-filter.h +++ b/lib/pipe-filter.h @@ -1,5 +1,5 @@ /* Filtering of data through a subprocess. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. Written by Bruno Haible , 2009, and Paolo Bonzini , 2009. @@ -84,9 +84,9 @@ extern "C" { 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. @@ -97,9 +97,9 @@ typedef void (*done_write_fn) (void *data_written, size_t num_bytes_written, 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 ============================ */ @@ -119,7 +119,7 @@ typedef void (*done_read_fn) (void *data_read, size_t num_bytes_read, true, otherwise return 127. Callback arguments are as described above. - Data is alternatingly written to the subprocess, through the functions + Data is alternately written to the subprocess, through the functions prepare_write and done_write, and read from the subprocess, through the functions prepare_read and done_read. @@ -133,13 +133,13 @@ typedef void (*done_read_fn) (void *data_read, size_t num_bytes_read, - 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 ============================ */ @@ -167,7 +167,7 @@ struct pipe_filter_gi; true, otherwise return NULL and set errno. The caller will write to the subprocess through pipe_filter_gi_write - and finally call pipe_filter_gi_write. During such calls, the + and finally call pipe_filter_gi_close. During such calls, the prepare_read and done_read function may be called to process any data that the subprocess has written. @@ -179,11 +179,11 @@ struct pipe_filter_gi; 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 @@ -203,7 +203,7 @@ extern struct pipe_filter_gi * - 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.