diff options
-rw-r--r-- | libiberty/ChangeLog | 62 | ||||
-rw-r--r-- | libiberty/fopen_unlocked.c | 6 | ||||
-rw-r--r-- | libiberty/pexecute.txh | 48 |
3 files changed, 68 insertions, 48 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 63dba8e..054a450 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2005-05-15 Eli Zaretskii <eliz@gnu.org> + + * pexecute.txh: Enclose multi-word data types in @deftypefn in + braces. Minor wording fixes. Use --- for em-dash. Use + @enumerate in enumerated lists. + 2005-05-11 Eli Zaretskii <eliz@gnu.org> * pex-djgpp.c: Include string.h, fcntl.h, unistd.h, and @@ -47,7 +53,7 @@ 2005-04-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * fopen_unlocked.c (unlock_std_streams): New. - + * functions.texi: Regenerate. 2005-04-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> @@ -66,19 +72,19 @@ * lbasename.c: Likewise. * spaces.c: Likewise. * xatexit.c:Likewise. - * configure.ac: Do check declarations for basename, ffs, asprintf + * configure.ac: Do check declarations for basename, ffs, asprintf and vasprintf for real. * configure: Regenerate. 2005-04-13 Gabriel Dos Reis <gdr@integrable-solutions.net> - * argv.c (dupargv): Allocate space of argv[argc], not + * argv.c (dupargv): Allocate space of argv[argc], not sizeof(char *) of that amount. Cast result to char *. 2005-04-12 Gabriel Dos Reis <gdr@integrable-solutions.net> * regex.c (wcs_re_match_2_internal, byte_re_match_2_internal): - Replace not with negate. + Replace not with negate. 2005-04-12 Gabriel Dos Reis <gdr@integrable-solutions.net> @@ -152,7 +158,7 @@ * configure: Rebuild. 2005-03-28 Mark Kettenis <kettenis@gnu.org> - + * unlink-if-ordinary.c: Include <sys/types.h>. 2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net> @@ -160,19 +166,19 @@ Convert libiberty to use ISO C prototype style 7/n. * regex.c (PARAMS): Remove definition. (PREFIX): Unconditionaly define using ISO C ## operator. - (init_syntax_once, extract_number, extract_number_and_incr, + (init_syntax_once, extract_number, extract_number_and_incr, print_fastmap, print_partial_compiled_pattern, - print_compiled_pattern, print_double_string, printchar, + print_compiled_pattern, print_double_string, printchar, convert_mbs_to_wcs, re_set_syntax, regex_grow_registers, regex_compile, store_op1, store_op2, insert_op1, insert_op2, - at_begline_loc_p, at_endline_p, group_in_compile_stack, - insert_space, wcs_compile_range, byte_compile_range, - truncate_wchar, re_compile_fastmap, re_compile_fastmap, - re_set_registers, re_search, re_search_2, re_search_3, re_match, + at_begline_loc_p, at_endline_p, group_in_compile_stack, + insert_space, wcs_compile_range, byte_compile_range, + truncate_wchar, re_compile_fastmap, re_compile_fastmap, + re_set_registers, re_search, re_search_2, re_search_3, re_match, re_match_2, count_mbs_length, wcs_re_match_2_internal, byte_re_match_2_internal, group_match_null_string_p, alt_match_null_string_p, common_op_match_null_string_p, - bcmp_translate, re_compile_pattern, re_comp, re_exec, regcomp, + bcmp_translate, re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror, regfree): Use ISO C prototype style. * partition.c: (elem_compare): Likewise. * cp-demangle.c (print_usage): Likewise. @@ -181,21 +187,21 @@ Convert libiberty to use ISO C prototype style 5/n. * random.c (srandom, initstate, setstate, random): Use ISO C - prototypes. + prototypes. * putenv.c (putenv): Likewise. * physmem.c (physmem_available, physmem_total, main): Likewise. * pex-win32.c (fix_argv, pexecute, pwait): Likewise. * pex-unix.c (pexecute, pwait): Likewise. * pex-msdos.c (pexecute, pwait): Likewise. * pex-djgpp.c (pexecute, pwait): Likewise. - * partition.c (partition_new, partition_delete, partition_union) + * partition.c (partition_new, partition_delete, partition_union) (elem_compare, partition_print): Likewise. - * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk, - _obstack_allocated_p, _obstack_free, obstack_free, + * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk, + _obstack_allocated_p, _obstack_free, obstack_free, _obstack_memory_used, print_and_abort, obstack_next_free, obstack_object_size, obstack_base): Likewise. Remove codes predicated on !defined(__STDC__). - * objalloc.c (objalloc_create, _objalloc_alloc, objalloc_free, + * objalloc.c (objalloc_create, _objalloc_alloc, objalloc_free, objalloc_free_block): Use ISO C prototypes. * mkstemps.c (mkstemps): Likewise. * memset.c (memset): Likewise. @@ -205,16 +211,16 @@ * setenv.c (setenv, unsetenv): Likewise. * sigsetmask.c (sigsetmask): Likewise. * snprintf.c (snprintf): Likewise. - * sort.c (sort_pointers, xmalloc): Likewise. + * sort.c (sort_pointers, xmalloc): Likewise. * spaces.c (spaces): Likewise. - * splay-tree.c (splay_tree_delete_helper, - splay_tree_splay_helper, splay_tree_splay, + * splay-tree.c (splay_tree_delete_helper, + splay_tree_splay_helper, splay_tree_splay, splay_tree_foreach_helper, splay_tree_xmalloc_allocate, - splay_tree_new, splay_tree_xmalloc_allocate, + splay_tree_new, splay_tree_xmalloc_allocate, splay_tree_new_with_allocator, splay_tree_delete, - splay_tree_insert, splay_tree_remove, splay_tree_lookup, - splay_tree_max, splay_tree_min, splay_tree_predecessor, - splay_tree_successor, splay_tree_foreach, + splay_tree_insert, splay_tree_remove, splay_tree_lookup, + splay_tree_max, splay_tree_min, splay_tree_predecessor, + splay_tree_successor, splay_tree_foreach, splay_tree_compare_ints, splay_tree_compare_pointers): Likewise. * stpcpy.c (stpcpy): Likewise. * stpncpy.c (stpncpy): Likewise. @@ -225,19 +231,19 @@ 2005-03-27 Gabriel Dos Reis <gdr@integrable-solutions.net> Convert libiberty to use ISO C prototype style 6/n. - * strerror.c (init_error_tables, errno_max, strerror, strerrno, + * strerror.c (init_error_tables, errno_max, strerror, strerrno, strtoerrno, main): Use ISO C prototype style. * strncasecmp.c (strncasecmp): Likewise. * strncmp.c (strncmp): Likewise. * strndup.c (strndup): Likewise. * strrchr.c (strrchr): Likewise. - * strsignal.c (init_signal_tables, signo_max, strsignal, + * strsignal.c (init_signal_tables, signo_max, strsignal, strsigno, strtosigno, psignal, main): Likewise. * strstr.c (strstr): Likewise. * strtod.c (strtod, atof): Likewise. * strtol.c (strtol): Likewise. * strtoul.c (strtoul): Likewise. - * ternary.c (ternary_insert, ternary_cleanup, ternary_search, + * ternary.c (ternary_insert, ternary_cleanup, ternary_search, ternary_recursivesearch): Likewise. * tmpnam.c (tmpnam): Likewise. * unlink-if-ordinary.c (unlink_if_ordinary): Likewise. @@ -250,7 +256,7 @@ * waitpid.c (waitpid): Likewise. * xatexit.c (xatexit, xatexit_cleanup): Likewise. * xexit.c (xexit): Likewise. - * xmalloc.c (xmalloc_set_program_name, xmalloc_failed, xmalloc, + * xmalloc.c (xmalloc_set_program_name, xmalloc_failed, xmalloc, xcalloc, xrealloc): Likewise. * xmemdup.c (xmemdup): Likewise. * xstrdup.c (xstrdup): Likewise. diff --git a/libiberty/fopen_unlocked.c b/libiberty/fopen_unlocked.c index 83e0a13..3c3cefe 100644 --- a/libiberty/fopen_unlocked.c +++ b/libiberty/fopen_unlocked.c @@ -36,7 +36,7 @@ multi-threaded locking. Otherwise do nothing. @end deftypefn -@deftypefn Extension FILE * fopen_unlocked (const char *@var{path}, const char * @var{mode}) +@deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, const char * @var{mode}) Opens and returns a @code{FILE} pointer via @code{fopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -45,7 +45,7 @@ unchanged. @end deftypefn -@deftypefn Extension FILE * fdopen_unlocked (int @var{fildes}, const char * @var{mode}) +@deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, const char * @var{mode}) Opens and returns a @code{FILE} pointer via @code{fdopen}. If the operating system supports it, ensure that the stream is setup to avoid @@ -54,7 +54,7 @@ unchanged. @end deftypefn -@deftypefn Extension FILE * freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) +@deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream}) Opens and returns a @code{FILE} pointer via @code{freopen}. If the operating system supports it, ensure that the stream is setup to avoid diff --git a/libiberty/pexecute.txh b/libiberty/pexecute.txh index c06d55c..461ff33 100644 --- a/libiberty/pexecute.txh +++ b/libiberty/pexecute.txh @@ -1,4 +1,4 @@ -@deftypefn Extension struct pex_obj *pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) +@deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, const char *@var{pname}, const char *@var{tempbase}) Prepare to execute one or more programs, with standard output of each program fed to standard input of the next. This is a system @@ -29,7 +29,7 @@ temporary files; it may be @code{NULL} to use a randomly chosen name. @end deftypefn -@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}) +@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}) Execute one program in a pipeline. On success this returns @code{NULL}. On failure it returns an error message, a statically @@ -46,8 +46,8 @@ allocated string. This must be set on the last program in the pipeline. In particular, it should be set when executing a single program. The standard output of the program will be sent to @var{outname}, or, if @var{outname} is -@code{NULL}, to the standard output of the calling program. This -should not be set if you want to call @code{pex_read_output} +@code{NULL}, to the standard output of the calling program. Do @emph{not} +set this bit if you want to call @code{pex_read_output} (described below). After a call to @code{pex_run} with this bit set, @var{pex_run} may no longer be called with the same @var{obj}. @@ -71,7 +71,7 @@ Send the program's standard error to standard output, if possible. The standard input (output) of the program should be read (written) in binary mode rather than text mode. These flags are ignored on systems which do not distinguish binary mode and text mode, such as Unix. For -proper behavior these flags should match appropriately--a call to +proper behavior these flags should match appropriately---a call to @code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a call using @code{PEX_BINARY_INPUT}. @end table @@ -81,11 +81,20 @@ arguments to pass to the program; normally @code{@var{argv}[0]} will be a copy of @var{executable}. @var{outname} is used to set the name of the file to use for standard -output. There are two cases in which no output file will be used: 1) +output. There are two cases in which no output file will be used: + +@enumerate +@item if @code{PEX_LAST} is not set in @var{flags}, and @code{PEX_USE_PIPES} -was set in the call to @code{pex_init}, and the system supports pipes; -2) if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is -@code{NULL}. Otherwise the code will use a file to hold standard +was set in the call to @code{pex_init}, and the system supports pipes + +@item +if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is +@code{NULL} +@end enumerate + +@noindent +Otherwise the code will use a file to hold standard output. If @code{PEX_LAST} is not set, this file is considered to be a temporary file, and it will be removed when no longer needed, unless @code{PEX_SAVE_TEMPS} was set in the call to @code{pex_init}. @@ -93,22 +102,26 @@ a temporary file, and it will be removed when no longer needed, unless There are two cases to consider when setting the name of the file to hold standard output. -First case: @code{PEX_SUFFIX} is set in @var{flags}. In this case +@enumerate +@item +@code{PEX_SUFFIX} is set in @var{flags}. In this case @var{outname} may not be @code{NULL}. If the @var{tempbase} parameter to @code{pex_init} was not @code{NULL}, then the output file name is the concatenation of @var{tempbase} and @var{outname}. If @var{tempbase} was @code{NULL}, then the output file name is a random file name ending in @var{outname}. -Second case: @code{PEX_SUFFIX} was not set in @var{flags}. In this +@item +@code{PEX_SUFFIX} was not set in @var{flags}. In this case, if @var{outname} is not @code{NULL}, it is used as the output file name. If @var{outname} is @code{NULL}, and @var{tempbase} was not NULL, the output file name is randomly chosen using @var{tempbase}. Otherwise the output file name is chosen completely at random. +@end enumerate @var{errname} is the file name to use for standard error output. If -it is @code{NULL}, standard error is the same as the caller. +it is @code{NULL}, standard error is the same as the caller's. Otherwise, standard error is written to the named file. On an error return, the code sets @code{*@var{err}} to an @code{errno} @@ -116,7 +129,7 @@ value, or to 0 if there is no relevant @code{errno}. @end deftypefn -@deftypefn Extension FILE * pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) +@deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, int @var{binary}) Returns a @code{FILE} pointer which may be used to read the standard output of the last program in the pipeline. When this is used, @@ -145,7 +158,8 @@ results will be placed into @var{vector}. The results are in the order of the calls to @code{pex_run}. Returns 0 on error, 1 on success. -@code{struct pex_time} has the following fields: @code{user_seconds}, +@code{struct pex_time} has the following fields of the type +@code{unsigned long}: @code{user_seconds}, @code{user_microseconds}, @code{system_seconds}, @code{system_microseconds}. On systems which do not support reporting process times, all the fields will be set to @code{0}. @@ -158,14 +172,14 @@ Clean up and free all data associated with @var{obj}. @end deftypefn -@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}) +@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}) -An interface to @code{pex_init} to permit the easy execution of a +An interface to permit the easy execution of a single program. The return value and most of the parameters are as for a call to @code{pex_run}. @var{flags} is restricted to a combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and @code{PEX_BINARY_OUTPUT}. @var{outname} is interpreted as if -@code{PEX_LAST} were set. On a successful return, *@var{status} will +@code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will be set to the exit status of the program. @end deftypefn |