summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2006-03-13 20:00:44 +0000
committerDJ Delorie <dj@delorie.com>2006-03-13 20:00:44 +0000
commitf7e55554e51d4abf5f822cf04acbb7f5ec9e5ec3 (patch)
treee967210169d2adda5628213cdfd767f9bb3c3c2f
parent5bc8c785a2b67b08d55e7241e01da4e1821307b7 (diff)
downloadgdb-f7e55554e51d4abf5f822cf04acbb7f5ec9e5ec3.tar.gz
merge from gcc
-rw-r--r--libiberty/ChangeLog8
-rw-r--r--libiberty/functions.texi22
-rw-r--r--libiberty/pex-common.h27
3 files changed, 44 insertions, 13 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index acdfad0657f..68f6f385923 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-12 Jim Blandy <jimb@red-bean.com>
+
+ * pex-common.h (struct pex_obj): Doc fixes.
+
+2006-03-11 Jim Blandy <jimb@red-bean.com>
+
+ * functions.texi: Regenerate.
+
2006-02-21 Ben Elliston <bje@au.ibm.com>
* pexecute.c (pwait): Syntax fix for previous change.
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index 8b4a50ef45e..a09e2075fe1 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -214,6 +214,26 @@ symbolic name or message.
@end deftypefn
+@c argv.c:293
+@deftypefn Extension void expandargv (int *@var{argcp}, char ***@var{argvp})
+
+The @var{argcp} and @code{argvp} arguments are pointers to the usual
+@code{argc} and @code{argv} arguments to @code{main}. This function
+looks for arguments that begin with the character @samp{@@}. Any such
+arguments are interpreted as ``response files''. The contents of the
+response file are interpreted as additional command line options. In
+particular, the file is separated into whitespace-separated strings;
+each such string is taken as a command-line option. The new options
+are inserted in place of the option naming the response file, and
+@code{*argcp} and @code{*argvp} will be updated. If the value of
+@code{*argvp} is modified by this function, then the new value has
+been dynamically allocated and can be deallocated by the caller with
+@code{freeargv}. However, most callers will simply call
+@code{expandargv} near the beginning of @code{main} and allow the
+operating system to free the memory when the program exits.
+
+@end deftypefn
+
@c fdmatch.c:23
@deftypefn Extension int fdmatch (int @var{fd1}, int @var{fd2})
@@ -1194,7 +1214,7 @@ translation is found, returns 0.
@end deftypefn
-@c strverscmp.c:24
+@c strverscmp.c:25
@deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2})
The @code{strverscmp} function compares the string @var{s1} against
@var{s2}, considering them as holding indices/version numbers. Return
diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h
index bd4f908769f..b70b38d9736 100644
--- a/libiberty/pex-common.h
+++ b/libiberty/pex-common.h
@@ -61,7 +61,7 @@ struct pex_obj
int next_input_name_allocated;
/* Number of child processes. */
int count;
- /* PIDs of child processes; array allocated using maloc. */
+ /* PIDs of child processes; array allocated using malloc. */
long *children;
/* Exit statuses of child processes; array allocated using malloc. */
int *status;
@@ -88,10 +88,11 @@ struct pex_funcs
{
/* Open file NAME for reading. If BINARY is non-zero, open in
binary mode. Return >= 0 on success, -1 on error. */
- int (*open_read) (struct pex_obj *, const char *name, int binary);
+ int (*open_read) (struct pex_obj *, const char */* name */, int /* binary */);
/* Open file NAME for writing. If BINARY is non-zero, open in
binary mode. Return >= 0 on success, -1 on error. */
- int (*open_write) (struct pex_obj *, const char *name, int binary);
+ int (*open_write) (struct pex_obj *, const char */* name */,
+ int /* binary */);
/* Execute a child process. FLAGS, EXECUTABLE, ARGV, ERR are from
pex_run. IN, OUT, ERRDES are each a descriptor, from open_read,
open_write, or pipe, or they are one of STDIN_FILE_NO,
@@ -99,25 +100,27 @@ struct pex_funcs
should be closed. The function should handle the
PEX_STDERR_TO_STDOUT flag. Return >= 0 on success, or -1 on
error and set *ERRMSG and *ERR. */
- long (*exec_child) (struct pex_obj *, int flags, const char *executable,
- char * const * argv, int in, int out, int errdes,
- const char **errmsg, int *err);
+ long (*exec_child) (struct pex_obj *, int /* flags */,
+ const char */* executable */, char * const * /* argv */,
+ int /* in */, int /* out */, int /* errdes */,
+ const char **/* errmsg */, int */* err */);
/* Close a descriptor. Return 0 on success, -1 on error. */
int (*close) (struct pex_obj *, int);
/* Wait for a child to complete, returning exit status in *STATUS
and time in *TIME (if it is not null). CHILD is from fork. DONE
is 1 if this is called via pex_free. ERRMSG and ERR are as in
fork. Return 0 on success, -1 on error. */
- int (*wait) (struct pex_obj *, long, int *status, struct pex_time *time,
- int done, const char **errmsg, int *err);
+ int (*wait) (struct pex_obj *, long /* child */, int * /* status */,
+ struct pex_time * /* time */, int /* done */,
+ const char ** /* errmsg */, int * /* err */);
/* Create a pipe (only called if PEX_USE_PIPES is set) storing two
- descriptin in *P. If BINARY is non-zero, open in binary mode.
- Return 0 on success, -1 on error. */
- int (*pipe) (struct pex_obj *, int *p, int binary);
+ descriptors in P[0] and P[1]. If BINARY is non-zero, open in
+ binary mode. Return 0 on success, -1 on error. */
+ int (*pipe) (struct pex_obj *, int * /* p */, int /* binary */);
/* Get a FILE pointer to read from a file descriptor (only called if
PEX_USE_PIPES is set). If BINARY is non-zero, open in binary
mode. Return pointer on success, NULL on error. */
- FILE * (*fdopenr) (struct pex_obj *, int fd, int binary);
+ FILE * (*fdopenr) (struct pex_obj *, int /* fd */, int /* binary */);
/* Free any system dependent data associated with OBJ. May be
NULL if there is nothing to do. */
void (*cleanup) (struct pex_obj *);