comparison libiberty/pexecute.txh @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents a06113de4d67
children
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 @c -*- mode: texinfo -*- 1 @c -*- mode: texinfo -*-
2 @deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) 2 @deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, @
3 const char *@var{pname}, const char *@var{tempbase})
3 4
4 Prepare to execute one or more programs, with standard output of each 5 Prepare to execute one or more programs, with standard output of each
5 program fed to standard input of the next. This is a system 6 program fed to standard input of the next. This is a system
6 independent interface to execute a pipeline. 7 independent interface to execute a pipeline.
7 8
28 messages. @var{tempbase} is a base name to use for any required 29 messages. @var{tempbase} is a base name to use for any required
29 temporary files; it may be @code{NULL} to use a randomly chosen name. 30 temporary files; it may be @code{NULL} to use a randomly chosen name.
30 31
31 @end deftypefn 32 @end deftypefn
32 33
33 @deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) 34 @deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, @
35 int @var{flags}, const char *@var{executable}, char * const *@var{argv}, @
36 const char *@var{outname}, const char *@var{errname}, int *@var{err})
34 37
35 Execute one program in a pipeline. On success this returns 38 Execute one program in a pipeline. On success this returns
36 @code{NULL}. On failure it returns an error message, a statically 39 @code{NULL}. On failure it returns an error message, a statically
37 allocated string. 40 allocated string.
38 41
137 On an error return, the code sets @code{*@var{err}} to an @code{errno} 140 On an error return, the code sets @code{*@var{err}} to an @code{errno}
138 value, or to 0 if there is no relevant @code{errno}. 141 value, or to 0 if there is no relevant @code{errno}.
139 142
140 @end deftypefn 143 @end deftypefn
141 144
142 @deftypefn Extension {const char *} pex_run_in_environment (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{executable}, char * const *@var{argv}, char * const *@var{env}, int @var{env_size}, const char *@var{outname}, const char *@var{errname}, int *@var{err}) 145 @deftypefn Extension {const char *} pex_run_in_environment (struct pex_obj *@var{obj}, @
146 int @var{flags}, const char *@var{executable}, char * const *@var{argv}, @
147 char * const *@var{env}, int @var{env_size}, const char *@var{outname}, @
148 const char *@var{errname}, int *@var{err})
143 149
144 Execute one program in a pipeline, permitting the environment for the 150 Execute one program in a pipeline, permitting the environment for the
145 program to be specified. Behaviour and parameters not listed below are 151 program to be specified. Behaviour and parameters not listed below are
146 as for @code{pex_run}. 152 as for @code{pex_run}.
147 153
150 form @code{VAR=VALUE}, with the exception of the last element that must be 156 form @code{VAR=VALUE}, with the exception of the last element that must be
151 @code{NULL}. 157 @code{NULL}.
152 158
153 @end deftypefn 159 @end deftypefn
154 160
155 @deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, int @var{flags}, const char *@var{in_name}) 161 @deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, @
162 int @var{flags}, const char *@var{in_name})
156 163
157 Return a stream for a temporary file to pass to the first program in 164 Return a stream for a temporary file to pass to the first program in
158 the pipeline as input. 165 the pipeline as input.
159 166
160 The name of the input file is chosen according to the same rules 167 The name of the input file is chosen according to the same rules
167 If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in 174 If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in
168 binary mode; otherwise, open it in the default mode. Including 175 binary mode; otherwise, open it in the default mode. Including
169 @code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix. 176 @code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
170 @end deftypefn 177 @end deftypefn
171 178
172 @deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, int @var{binary}) 179 @deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, @
180 int @var{binary})
173 181
174 Return a stream @var{fp} for a pipe connected to the standard input of 182 Return a stream @var{fp} for a pipe connected to the standard input of
175 the first program in the pipeline; @var{fp} is opened for writing. 183 the first program in the pipeline; @var{fp} is opened for writing.
176 You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call 184 You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call
177 that returned @var{obj}. 185 that returned @var{obj}.
211 219
212 @end itemize 220 @end itemize
213 221
214 @end deftypefn 222 @end deftypefn
215 223
216 @deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) 224 @deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, @
225 int @var{binary})
217 226
218 Returns a @code{FILE} pointer which may be used to read the standard 227 Returns a @code{FILE} pointer which may be used to read the standard
219 output of the last program in the pipeline. When this is used, 228 output of the last program in the pipeline. When this is used,
220 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After 229 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After
221 this is called, @code{pex_run} may no longer be called with the same 230 this is called, @code{pex_run} may no longer be called with the same
223 opened in binary mode. Don't call @code{fclose} on the returned file; 232 opened in binary mode. Don't call @code{fclose} on the returned file;
224 it will be closed by @code{pex_free}. 233 it will be closed by @code{pex_free}.
225 234
226 @end deftypefn 235 @end deftypefn
227 236
228 @deftypefn Extension {FILE *} pex_read_err (struct pex_obj *@var{obj}, int @var{binary}) 237 @deftypefn Extension {FILE *} pex_read_err (struct pex_obj *@var{obj}, @
238 int @var{binary})
229 239
230 Returns a @code{FILE} pointer which may be used to read the standard 240 Returns a @code{FILE} pointer which may be used to read the standard
231 error of the last program in the pipeline. When this is used, 241 error of the last program in the pipeline. When this is used,
232 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After 242 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After
233 this is called, @code{pex_run} may no longer be called with the same 243 this is called, @code{pex_run} may no longer be called with the same
236 it will be closed by @code{pex_free}. 246 it will be closed by @code{pex_free}.
237 247
238 @end deftypefn 248 @end deftypefn
239 249
240 250
241 @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, int @var{count}, int *@var{vector}) 251 @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, @
252 int @var{count}, int *@var{vector})
242 253
243 Returns the exit status of all programs run using @var{obj}. 254 Returns the exit status of all programs run using @var{obj}.
244 @var{count} is the number of results expected. The results will be 255 @var{count} is the number of results expected. The results will be
245 placed into @var{vector}. The results are in the order of the calls 256 placed into @var{vector}. The results are in the order of the calls
246 to @code{pex_run}. Returns 0 on error, 1 on success. 257 to @code{pex_run}. Returns 0 on error, 1 on success.
247 258
248 @end deftypefn 259 @end deftypefn
249 260
250 @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, int @var{count}, struct pex_time *@var{vector}) 261 @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, @
262 int @var{count}, struct pex_time *@var{vector})
251 263
252 Returns the process execution times of all programs run using 264 Returns the process execution times of all programs run using
253 @var{obj}. @var{count} is the number of results expected. The 265 @var{obj}. @var{count} is the number of results expected. The
254 results will be placed into @var{vector}. The results are in the 266 results will be placed into @var{vector}. The results are in the
255 order of the calls to @code{pex_run}. Returns 0 on error, 1 on 267 order of the calls to @code{pex_run}. Returns 0 on error, 1 on
269 yet called @code{pex_get_times} or @code{pex_get_status}, this will 281 yet called @code{pex_get_times} or @code{pex_get_status}, this will
270 try to kill the subprocesses. 282 try to kill the subprocesses.
271 283
272 @end deftypefn 284 @end deftypefn
273 285
274 @deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err}) 286 @deftypefn Extension {const char *} pex_one (int @var{flags}, @
287 const char *@var{executable}, char * const *@var{argv}, @
288 const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, @
289 int *@var{status}, int *@var{err})
275 290
276 An interface to permit the easy execution of a 291 An interface to permit the easy execution of a
277 single program. The return value and most of the parameters are as 292 single program. The return value and most of the parameters are as
278 for a call to @code{pex_run}. @var{flags} is restricted to a 293 for a call to @code{pex_run}. @var{flags} is restricted to a
279 combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and 294 combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and
281 @code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will 296 @code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will
282 be set to the exit status of the program. 297 be set to the exit status of the program.
283 298
284 @end deftypefn 299 @end deftypefn
285 300
286 @deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags}) 301 @deftypefn Extension int pexecute (const char *@var{program}, @
302 char * const *@var{argv}, const char *@var{this_pname}, @
303 const char *@var{temp_base}, char **@var{errmsg_fmt}, @
304 char **@var{errmsg_arg}, int @var{flags})
287 305
288 This is the old interface to execute one or more programs. It is 306 This is the old interface to execute one or more programs. It is
289 still supported for compatibility purposes, but is no longer 307 still supported for compatibility purposes, but is no longer
290 documented. 308 documented.
291 309