110d565efSmrg@c Automatically generated from *.c and others (the comments before
210d565efSmrg@c each entry tell you which file and where in that file).  DO NOT EDIT!
310d565efSmrg@c Edit the *.c files, configure with --enable-maintainer-mode,
410d565efSmrg@c run 'make stamp-functions' and gather-docs will build a new copy.
510d565efSmrg
610d565efSmrg@c alloca.c:26
710d565efSmrg@deftypefn Replacement void* alloca (size_t @var{size})
810d565efSmrg
910d565efSmrgThis function allocates memory which will be automatically reclaimed
1010d565efSmrgafter the procedure exits.  The @libib{} implementation does not free
1110d565efSmrgthe memory immediately but will do so eventually during subsequent
1210d565efSmrgcalls to this function.  Memory is allocated using @code{xmalloc} under
1310d565efSmrgnormal circumstances.
1410d565efSmrg
1510d565efSmrgThe header file @file{alloca-conf.h} can be used in conjunction with the
1610d565efSmrgGNU Autoconf test @code{AC_FUNC_ALLOCA} to test for and properly make
1710d565efSmrgavailable this function.  The @code{AC_FUNC_ALLOCA} test requires that
1810d565efSmrgclient code use a block of preprocessor code to be safe (see the Autoconf
1910d565efSmrgmanual for more); this header incorporates that logic and more, including
2010d565efSmrgthe possibility of a GCC built-in function.
2110d565efSmrg
2210d565efSmrg@end deftypefn
2310d565efSmrg
2410d565efSmrg@c asprintf.c:32
2510d565efSmrg@deftypefn Extension int asprintf (char **@var{resptr}, const char *@var{format}, ...)
2610d565efSmrg
2710d565efSmrgLike @code{sprintf}, but instead of passing a pointer to a buffer, you
2810d565efSmrgpass a pointer to a pointer.  This function will compute the size of
2910d565efSmrgthe buffer needed, allocate memory with @code{malloc}, and store a
3010d565efSmrgpointer to the allocated memory in @code{*@var{resptr}}.  The value
3110d565efSmrgreturned is the same as @code{sprintf} would return.  If memory could
3210d565efSmrgnot be allocated, minus one is returned and @code{NULL} is stored in
3310d565efSmrg@code{*@var{resptr}}.
3410d565efSmrg
3510d565efSmrg@end deftypefn
3610d565efSmrg
3710d565efSmrg@c atexit.c:6
3810d565efSmrg@deftypefn Supplemental int atexit (void (*@var{f})())
3910d565efSmrg
4010d565efSmrgCauses function @var{f} to be called at exit.  Returns 0.
4110d565efSmrg
4210d565efSmrg@end deftypefn
4310d565efSmrg
4410d565efSmrg@c basename.c:6
4510d565efSmrg@deftypefn Supplemental char* basename (const char *@var{name})
4610d565efSmrg
4710d565efSmrgReturns a pointer to the last component of pathname @var{name}.
4810d565efSmrgBehavior is undefined if the pathname ends in a directory separator.
4910d565efSmrg
5010d565efSmrg@end deftypefn
5110d565efSmrg
5210d565efSmrg@c bcmp.c:6
5310d565efSmrg@deftypefn Supplemental int bcmp (char *@var{x}, char *@var{y}, int @var{count})
5410d565efSmrg
5510d565efSmrgCompares the first @var{count} bytes of two areas of memory.  Returns
5610d565efSmrgzero if they are the same, nonzero otherwise.  Returns zero if
5710d565efSmrg@var{count} is zero.  A nonzero result only indicates a difference,
5810d565efSmrgit does not indicate any sorting order (say, by having a positive
5910d565efSmrgresult mean @var{x} sorts before @var{y}).
6010d565efSmrg
6110d565efSmrg@end deftypefn
6210d565efSmrg
6310d565efSmrg@c bcopy.c:3
6410d565efSmrg@deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
6510d565efSmrg
6610d565efSmrgCopies @var{length} bytes from memory region @var{in} to region
6710d565efSmrg@var{out}.  The use of @code{bcopy} is deprecated in new programs.
6810d565efSmrg
6910d565efSmrg@end deftypefn
7010d565efSmrg
7110d565efSmrg@c bsearch.c:33
7210d565efSmrg@deftypefn Supplemental void* bsearch (const void *@var{key}, @
7310d565efSmrg  const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, @
7410d565efSmrg  int (*@var{compar})(const void *, const void *))
7510d565efSmrg
7610d565efSmrgPerforms a search over an array of @var{nmemb} elements pointed to by
7710d565efSmrg@var{base} for a member that matches the object pointed to by @var{key}.
7810d565efSmrgThe size of each member is specified by @var{size}.  The array contents
7910d565efSmrgshould be sorted in ascending order according to the @var{compar}
8010d565efSmrgcomparison function.  This routine should take two arguments pointing to
8110d565efSmrgthe @var{key} and to an array member, in that order, and should return an
8210d565efSmrginteger less than, equal to, or greater than zero if the @var{key} object
8310d565efSmrgis respectively less than, matching, or greater than the array member.
8410d565efSmrg
8510d565efSmrg@end deftypefn
8610d565efSmrg
87*0fc04c29Smrg@c argv.c:138
8810d565efSmrg@deftypefn Extension char** buildargv (char *@var{sp})
8910d565efSmrg
9010d565efSmrgGiven a pointer to a string, parse the string extracting fields
9110d565efSmrgseparated by whitespace and optionally enclosed within either single
9210d565efSmrgor double quotes (which are stripped off), and build a vector of
9310d565efSmrgpointers to copies of the string for each field.  The input string
9410d565efSmrgremains unchanged.  The last element of the vector is followed by a
9510d565efSmrg@code{NULL} element.
9610d565efSmrg
9710d565efSmrgAll of the memory for the pointer array and copies of the string
9810d565efSmrgis obtained from @code{xmalloc}.  All of the memory can be returned to the
9910d565efSmrgsystem with the single function call @code{freeargv}, which takes the
10010d565efSmrgreturned result of @code{buildargv}, as it's argument.
10110d565efSmrg
10210d565efSmrgReturns a pointer to the argument vector if successful.  Returns
10310d565efSmrg@code{NULL} if @var{sp} is @code{NULL} or if there is insufficient
10410d565efSmrgmemory to complete building the argument vector.
10510d565efSmrg
10610d565efSmrgIf the input is a null string (as opposed to a @code{NULL} pointer),
10710d565efSmrgthen buildarg returns an argument vector that has one arg, a null
10810d565efSmrgstring.
10910d565efSmrg
11010d565efSmrg@end deftypefn
11110d565efSmrg
11210d565efSmrg@c bzero.c:6
11310d565efSmrg@deftypefn Supplemental void bzero (char *@var{mem}, int @var{count})
11410d565efSmrg
11510d565efSmrgZeros @var{count} bytes starting at @var{mem}.  Use of this function
11610d565efSmrgis deprecated in favor of @code{memset}.
11710d565efSmrg
11810d565efSmrg@end deftypefn
11910d565efSmrg
12010d565efSmrg@c calloc.c:6
12110d565efSmrg@deftypefn Supplemental void* calloc (size_t @var{nelem}, size_t @var{elsize})
12210d565efSmrg
12310d565efSmrgUses @code{malloc} to allocate storage for @var{nelem} objects of
12410d565efSmrg@var{elsize} bytes each, then zeros the memory.
12510d565efSmrg
12610d565efSmrg@end deftypefn
12710d565efSmrg
12810d565efSmrg@c filename_cmp.c:201
12910d565efSmrg@deftypefn Extension int canonical_filename_eq (const char *@var{a}, const char *@var{b})
13010d565efSmrg
13110d565efSmrgReturn non-zero if file names @var{a} and @var{b} are equivalent.
13210d565efSmrgThis function compares the canonical versions of the filenames as returned by
13310d565efSmrg@code{lrealpath()}, so that so that different file names pointing to the same
13410d565efSmrgunderlying file are treated as being identical.
13510d565efSmrg
13610d565efSmrg@end deftypefn
13710d565efSmrg
13810d565efSmrg@c choose-temp.c:45
13910d565efSmrg@deftypefn Extension char* choose_temp_base (void)
14010d565efSmrg
14110d565efSmrgReturn a prefix for temporary file names or @code{NULL} if unable to
14210d565efSmrgfind one.  The current directory is chosen if all else fails so the
14310d565efSmrgprogram is exited if a temporary directory can't be found (@code{mktemp}
14410d565efSmrgfails).  The buffer for the result is obtained with @code{xmalloc}.
14510d565efSmrg
14610d565efSmrgThis function is provided for backwards compatibility only.  Its use is
14710d565efSmrgnot recommended.
14810d565efSmrg
14910d565efSmrg@end deftypefn
15010d565efSmrg
151*0fc04c29Smrg@c make-temp-file.c:95
15210d565efSmrg@deftypefn Replacement const char* choose_tmpdir ()
15310d565efSmrg
15410d565efSmrgReturns a pointer to a directory path suitable for creating temporary
15510d565efSmrgfiles in.
15610d565efSmrg
15710d565efSmrg@end deftypefn
15810d565efSmrg
15910d565efSmrg@c clock.c:27
16010d565efSmrg@deftypefn Supplemental long clock (void)
16110d565efSmrg
16210d565efSmrgReturns an approximation of the CPU time used by the process as a
16310d565efSmrg@code{clock_t}; divide this number by @samp{CLOCKS_PER_SEC} to get the
16410d565efSmrgnumber of seconds used.
16510d565efSmrg
16610d565efSmrg@end deftypefn
16710d565efSmrg
16810d565efSmrg@c concat.c:24
16910d565efSmrg@deftypefn Extension char* concat (const char *@var{s1}, const char *@var{s2}, @
17010d565efSmrg  @dots{}, @code{NULL})
17110d565efSmrg
17210d565efSmrgConcatenate zero or more of strings and return the result in freshly
17310d565efSmrg@code{xmalloc}ed memory.  The argument list is terminated by the first
17410d565efSmrg@code{NULL} pointer encountered.  Pointers to empty strings are ignored.
17510d565efSmrg
17610d565efSmrg@end deftypefn
17710d565efSmrg
178*0fc04c29Smrg@c argv.c:487
17910d565efSmrg@deftypefn Extension int countargv (char * const *@var{argv})
18010d565efSmrg
18110d565efSmrgReturn the number of elements in @var{argv}.
18210d565efSmrgReturns zero if @var{argv} is NULL.
18310d565efSmrg
18410d565efSmrg@end deftypefn
18510d565efSmrg
186*0fc04c29Smrg@c crc32.c:140
18710d565efSmrg@deftypefn Extension {unsigned int} crc32 (const unsigned char *@var{buf}, @
18810d565efSmrg  int @var{len}, unsigned int @var{init})
18910d565efSmrg
19010d565efSmrgCompute the 32-bit CRC of @var{buf} which has length @var{len}.  The
19110d565efSmrgstarting value is @var{init}; this may be used to compute the CRC of
19210d565efSmrgdata split across multiple buffers by passing the return value of each
19310d565efSmrgcall as the @var{init} parameter of the next.
19410d565efSmrg
195*0fc04c29SmrgThis is used by the @command{gdb} remote protocol for the @samp{qCRC}
196*0fc04c29Smrgcommand.  In order to get the same results as gdb for a block of data,
197*0fc04c29Smrgyou must pass the first CRC parameter as @code{0xffffffff}.
19810d565efSmrg
19910d565efSmrgThis CRC can be specified as:
20010d565efSmrg
20110d565efSmrg  Width  : 32
20210d565efSmrg  Poly   : 0x04c11db7
20310d565efSmrg  Init   : parameter, typically 0xffffffff
20410d565efSmrg  RefIn  : false
20510d565efSmrg  RefOut : false
20610d565efSmrg  XorOut : 0
20710d565efSmrg
20810d565efSmrgThis differs from the "standard" CRC-32 algorithm in that the values
20910d565efSmrgare not reflected, and there is no final XOR value.  These differences
21010d565efSmrgmake it easy to compose the values of multiple blocks.
21110d565efSmrg
21210d565efSmrg@end deftypefn
21310d565efSmrg
214*0fc04c29Smrg@c argv.c:59
21510d565efSmrg@deftypefn Extension char** dupargv (char * const *@var{vector})
21610d565efSmrg
21710d565efSmrgDuplicate an argument vector.  Simply scans through @var{vector},
21810d565efSmrgduplicating each argument until the terminating @code{NULL} is found.
21910d565efSmrgReturns a pointer to the argument vector if successful.  Returns
22010d565efSmrg@code{NULL} if there is insufficient memory to complete building the
22110d565efSmrgargument vector.
22210d565efSmrg
22310d565efSmrg@end deftypefn
22410d565efSmrg
225*0fc04c29Smrg@c strerror.c:572
22610d565efSmrg@deftypefn Extension int errno_max (void)
22710d565efSmrg
22810d565efSmrgReturns the maximum @code{errno} value for which a corresponding
22910d565efSmrgsymbolic name or message is available.  Note that in the case where we
23010d565efSmrguse the @code{sys_errlist} supplied by the system, it is possible for
23110d565efSmrgthere to be more symbolic names than messages, or vice versa.  In
23210d565efSmrgfact, the manual page for @code{perror(3C)} explicitly warns that one
23310d565efSmrgshould check the size of the table (@code{sys_nerr}) before indexing
23410d565efSmrgit, since new error codes may be added to the system before they are
23510d565efSmrgadded to the table.  Thus @code{sys_nerr} might be smaller than value
23610d565efSmrgimplied by the largest @code{errno} value defined in @code{<errno.h>}.
23710d565efSmrg
23810d565efSmrgWe return the maximum value that can be used to obtain a meaningful
23910d565efSmrgsymbolic name or message.
24010d565efSmrg
24110d565efSmrg@end deftypefn
24210d565efSmrg
243*0fc04c29Smrg@c argv.c:344
24410d565efSmrg@deftypefn Extension void expandargv (int *@var{argcp}, char ***@var{argvp})
24510d565efSmrg
24610d565efSmrgThe @var{argcp} and @code{argvp} arguments are pointers to the usual
24710d565efSmrg@code{argc} and @code{argv} arguments to @code{main}.  This function
24810d565efSmrglooks for arguments that begin with the character @samp{@@}.  Any such
24910d565efSmrgarguments are interpreted as ``response files''.  The contents of the
25010d565efSmrgresponse file are interpreted as additional command line options.  In
25110d565efSmrgparticular, the file is separated into whitespace-separated strings;
25210d565efSmrgeach such string is taken as a command-line option.  The new options
25310d565efSmrgare inserted in place of the option naming the response file, and
25410d565efSmrg@code{*argcp} and @code{*argvp} will be updated.  If the value of
25510d565efSmrg@code{*argvp} is modified by this function, then the new value has
25610d565efSmrgbeen dynamically allocated and can be deallocated by the caller with
25710d565efSmrg@code{freeargv}.  However, most callers will simply call
25810d565efSmrg@code{expandargv} near the beginning of @code{main} and allow the
25910d565efSmrgoperating system to free the memory when the program exits.
26010d565efSmrg
26110d565efSmrg@end deftypefn
26210d565efSmrg
26310d565efSmrg@c fdmatch.c:23
26410d565efSmrg@deftypefn Extension int fdmatch (int @var{fd1}, int @var{fd2})
26510d565efSmrg
26610d565efSmrgCheck to see if two open file descriptors refer to the same file.
26710d565efSmrgThis is useful, for example, when we have an open file descriptor for
26810d565efSmrgan unnamed file, and the name of a file that we believe to correspond
26910d565efSmrgto that fd.  This can happen when we are exec'd with an already open
27010d565efSmrgfile (@code{stdout} for example) or from the SVR4 @file{/proc} calls
27110d565efSmrgthat return open file descriptors for mapped address spaces.  All we
27210d565efSmrghave to do is open the file by name and check the two file descriptors
27310d565efSmrgfor a match, which is done by comparing major and minor device numbers
27410d565efSmrgand inode numbers.
27510d565efSmrg
27610d565efSmrg@end deftypefn
27710d565efSmrg
27810d565efSmrg@c fopen_unlocked.c:49
27910d565efSmrg@deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, @
28010d565efSmrg  const char * @var{mode})
28110d565efSmrg
28210d565efSmrgOpens and returns a @code{FILE} pointer via @code{fdopen}.  If the
28310d565efSmrgoperating system supports it, ensure that the stream is setup to avoid
28410d565efSmrgany multi-threaded locking.  Otherwise return the @code{FILE} pointer
28510d565efSmrgunchanged.
28610d565efSmrg
28710d565efSmrg@end deftypefn
28810d565efSmrg
28910d565efSmrg@c ffs.c:3
29010d565efSmrg@deftypefn Supplemental int ffs (int @var{valu})
29110d565efSmrg
29210d565efSmrgFind the first (least significant) bit set in @var{valu}.  Bits are
29310d565efSmrgnumbered from right to left, starting with bit 1 (corresponding to the
29410d565efSmrgvalue 1).  If @var{valu} is zero, zero is returned.
29510d565efSmrg
29610d565efSmrg@end deftypefn
29710d565efSmrg
29810d565efSmrg@c filename_cmp.c:37
29910d565efSmrg@deftypefn Extension int filename_cmp (const char *@var{s1}, const char *@var{s2})
30010d565efSmrg
30110d565efSmrgReturn zero if the two file names @var{s1} and @var{s2} are equivalent.
30210d565efSmrgIf not equivalent, the returned value is similar to what @code{strcmp}
30310d565efSmrgwould return.  In other words, it returns a negative value if @var{s1}
30410d565efSmrgis less than @var{s2}, or a positive value if @var{s2} is greater than
30510d565efSmrg@var{s2}.
30610d565efSmrg
30710d565efSmrgThis function does not normalize file names.  As a result, this function
30810d565efSmrgwill treat filenames that are spelled differently as different even in
30910d565efSmrgthe case when the two filenames point to the same underlying file.
31010d565efSmrgHowever, it does handle the fact that on DOS-like file systems, forward
31110d565efSmrgand backward slashes are equal.
31210d565efSmrg
31310d565efSmrg@end deftypefn
31410d565efSmrg
31510d565efSmrg@c filename_cmp.c:183
31610d565efSmrg@deftypefn Extension int filename_eq (const void *@var{s1}, const void *@var{s2})
31710d565efSmrg
31810d565efSmrgReturn non-zero if file names @var{s1} and @var{s2} are equivalent.
31910d565efSmrgThis function is for use with hashtab.c hash tables.
32010d565efSmrg
32110d565efSmrg@end deftypefn
32210d565efSmrg
32310d565efSmrg@c filename_cmp.c:152
32410d565efSmrg@deftypefn Extension hashval_t filename_hash (const void *@var{s})
32510d565efSmrg
32610d565efSmrgReturn the hash value for file name @var{s} that will be compared
32710d565efSmrgusing filename_cmp.
32810d565efSmrgThis function is for use with hashtab.c hash tables.
32910d565efSmrg
33010d565efSmrg@end deftypefn
33110d565efSmrg
33210d565efSmrg@c filename_cmp.c:94
33310d565efSmrg@deftypefn Extension int filename_ncmp (const char *@var{s1}, const char *@var{s2}, size_t @var{n})
33410d565efSmrg
33510d565efSmrgReturn zero if the two file names @var{s1} and @var{s2} are equivalent
33610d565efSmrgin range @var{n}.
33710d565efSmrgIf not equivalent, the returned value is similar to what @code{strncmp}
33810d565efSmrgwould return.  In other words, it returns a negative value if @var{s1}
33910d565efSmrgis less than @var{s2}, or a positive value if @var{s2} is greater than
34010d565efSmrg@var{s2}.
34110d565efSmrg
34210d565efSmrgThis function does not normalize file names.  As a result, this function
34310d565efSmrgwill treat filenames that are spelled differently as different even in
34410d565efSmrgthe case when the two filenames point to the same underlying file.
34510d565efSmrgHowever, it does handle the fact that on DOS-like file systems, forward
34610d565efSmrgand backward slashes are equal.
34710d565efSmrg
34810d565efSmrg@end deftypefn
34910d565efSmrg
35010d565efSmrg@c fnmatch.txh:1
35110d565efSmrg@deftypefn Replacement int fnmatch (const char *@var{pattern}, @
35210d565efSmrg  const char *@var{string}, int @var{flags})
35310d565efSmrg
35410d565efSmrgMatches @var{string} against @var{pattern}, returning zero if it
35510d565efSmrgmatches, @code{FNM_NOMATCH} if not.  @var{pattern} may contain the
35610d565efSmrgwildcards @code{?} to match any one character, @code{*} to match any
35710d565efSmrgzero or more characters, or a set of alternate characters in square
35810d565efSmrgbrackets, like @samp{[a-gt8]}, which match one character (@code{a}
35910d565efSmrgthrough @code{g}, or @code{t}, or @code{8}, in this example) if that one
36010d565efSmrgcharacter is in the set.  A set may be inverted (i.e., match anything
36110d565efSmrgexcept what's in the set) by giving @code{^} or @code{!} as the first
36210d565efSmrgcharacter in the set.  To include those characters in the set, list them
36310d565efSmrgas anything other than the first character of the set.  To include a
36410d565efSmrgdash in the set, list it last in the set.  A backslash character makes
36510d565efSmrgthe following character not special, so for example you could match
36610d565efSmrgagainst a literal asterisk with @samp{\*}.  To match a literal
36710d565efSmrgbackslash, use @samp{\\}.
36810d565efSmrg
36910d565efSmrg@code{flags} controls various aspects of the matching process, and is a
37010d565efSmrgboolean OR of zero or more of the following values (defined in
37110d565efSmrg@code{<fnmatch.h>}):
37210d565efSmrg
37310d565efSmrg@table @code
37410d565efSmrg
37510d565efSmrg@item FNM_PATHNAME
37610d565efSmrg@itemx FNM_FILE_NAME
37710d565efSmrg@var{string} is assumed to be a path name.  No wildcard will ever match
37810d565efSmrg@code{/}.
37910d565efSmrg
38010d565efSmrg@item FNM_NOESCAPE
38110d565efSmrgDo not interpret backslashes as quoting the following special character.
38210d565efSmrg
38310d565efSmrg@item FNM_PERIOD
38410d565efSmrgA leading period (at the beginning of @var{string}, or if
38510d565efSmrg@code{FNM_PATHNAME} after a slash) is not matched by @code{*} or
38610d565efSmrg@code{?} but must be matched explicitly.
38710d565efSmrg
38810d565efSmrg@item FNM_LEADING_DIR
38910d565efSmrgMeans that @var{string} also matches @var{pattern} if some initial part
39010d565efSmrgof @var{string} matches, and is followed by @code{/} and zero or more
39110d565efSmrgcharacters.  For example, @samp{foo*} would match either @samp{foobar}
39210d565efSmrgor @samp{foobar/grill}.
39310d565efSmrg
39410d565efSmrg@item FNM_CASEFOLD
39510d565efSmrgIgnores case when performing the comparison.
39610d565efSmrg
39710d565efSmrg@end table
39810d565efSmrg
39910d565efSmrg@end deftypefn
40010d565efSmrg
40110d565efSmrg@c fopen_unlocked.c:39
40210d565efSmrg@deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, @
40310d565efSmrg  const char * @var{mode})
40410d565efSmrg
40510d565efSmrgOpens and returns a @code{FILE} pointer via @code{fopen}.  If the
40610d565efSmrgoperating system supports it, ensure that the stream is setup to avoid
40710d565efSmrgany multi-threaded locking.  Otherwise return the @code{FILE} pointer
40810d565efSmrgunchanged.
40910d565efSmrg
41010d565efSmrg@end deftypefn
41110d565efSmrg
412*0fc04c29Smrg@c argv.c:93
41310d565efSmrg@deftypefn Extension void freeargv (char **@var{vector})
41410d565efSmrg
41510d565efSmrgFree an argument vector that was built using @code{buildargv}.  Simply
41610d565efSmrgscans through @var{vector}, freeing the memory for each argument until
41710d565efSmrgthe terminating @code{NULL} is found, and then frees @var{vector}
41810d565efSmrgitself.
41910d565efSmrg
42010d565efSmrg@end deftypefn
42110d565efSmrg
42210d565efSmrg@c fopen_unlocked.c:59
42310d565efSmrg@deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, @
42410d565efSmrg  const char * @var{mode}, FILE * @var{stream})
42510d565efSmrg
42610d565efSmrgOpens and returns a @code{FILE} pointer via @code{freopen}.  If the
42710d565efSmrgoperating system supports it, ensure that the stream is setup to avoid
42810d565efSmrgany multi-threaded locking.  Otherwise return the @code{FILE} pointer
42910d565efSmrgunchanged.
43010d565efSmrg
43110d565efSmrg@end deftypefn
43210d565efSmrg
433*0fc04c29Smrg@c getruntime.c:86
43410d565efSmrg@deftypefn Replacement long get_run_time (void)
43510d565efSmrg
43610d565efSmrgReturns the time used so far, in microseconds.  If possible, this is
43710d565efSmrgthe time used by this process, else it is the elapsed time since the
43810d565efSmrgprocess started.
43910d565efSmrg
44010d565efSmrg@end deftypefn
44110d565efSmrg
44210d565efSmrg@c getcwd.c:6
44310d565efSmrg@deftypefn Supplemental char* getcwd (char *@var{pathname}, int @var{len})
44410d565efSmrg
44510d565efSmrgCopy the absolute pathname for the current working directory into
44610d565efSmrg@var{pathname}, which is assumed to point to a buffer of at least
44710d565efSmrg@var{len} bytes, and return a pointer to the buffer.  If the current
44810d565efSmrgdirectory's path doesn't fit in @var{len} characters, the result is
44910d565efSmrg@code{NULL} and @code{errno} is set.  If @var{pathname} is a null pointer,
45010d565efSmrg@code{getcwd} will obtain @var{len} bytes of space using
45110d565efSmrg@code{malloc}.
45210d565efSmrg
45310d565efSmrg@end deftypefn
45410d565efSmrg
45510d565efSmrg@c getpagesize.c:5
45610d565efSmrg@deftypefn Supplemental int getpagesize (void)
45710d565efSmrg
45810d565efSmrgReturns the number of bytes in a page of memory.  This is the
45910d565efSmrggranularity of many of the system memory management routines.  No
46010d565efSmrgguarantee is made as to whether or not it is the same as the basic
46110d565efSmrgmemory management hardware page size.
46210d565efSmrg
46310d565efSmrg@end deftypefn
46410d565efSmrg
46510d565efSmrg@c getpwd.c:5
46610d565efSmrg@deftypefn Supplemental char* getpwd (void)
46710d565efSmrg
46810d565efSmrgReturns the current working directory.  This implementation caches the
46910d565efSmrgresult on the assumption that the process will not call @code{chdir}
47010d565efSmrgbetween calls to @code{getpwd}.
47110d565efSmrg
47210d565efSmrg@end deftypefn
47310d565efSmrg
47410d565efSmrg@c gettimeofday.c:12
47510d565efSmrg@deftypefn Supplemental int gettimeofday (struct timeval *@var{tp}, void *@var{tz})
47610d565efSmrg
47710d565efSmrgWrites the current time to @var{tp}.  This implementation requires
47810d565efSmrgthat @var{tz} be NULL.  Returns 0 on success, -1 on failure.
47910d565efSmrg
48010d565efSmrg@end deftypefn
48110d565efSmrg
48210d565efSmrg@c hex.c:33
48310d565efSmrg@deftypefn Extension void hex_init (void)
48410d565efSmrg
48510d565efSmrgInitializes the array mapping the current character set to
48610d565efSmrgcorresponding hex values.  This function must be called before any
48710d565efSmrgcall to @code{hex_p} or @code{hex_value}.  If you fail to call it, a
48810d565efSmrgdefault ASCII-based table will normally be used on ASCII systems.
48910d565efSmrg
49010d565efSmrg@end deftypefn
49110d565efSmrg
49210d565efSmrg@c hex.c:42
49310d565efSmrg@deftypefn Extension int hex_p (int @var{c})
49410d565efSmrg
49510d565efSmrgEvaluates to non-zero if the given character is a valid hex character,
49610d565efSmrgor zero if it is not.  Note that the value you pass will be cast to
49710d565efSmrg@code{unsigned char} within the macro.
49810d565efSmrg
49910d565efSmrg@end deftypefn
50010d565efSmrg
50110d565efSmrg@c hex.c:50
50210d565efSmrg@deftypefn Extension {unsigned int} hex_value (int @var{c})
50310d565efSmrg
50410d565efSmrgReturns the numeric equivalent of the given character when interpreted
50510d565efSmrgas a hexadecimal digit.  The result is undefined if you pass an
50610d565efSmrginvalid hex digit.  Note that the value you pass will be cast to
50710d565efSmrg@code{unsigned char} within the macro.
50810d565efSmrg
50910d565efSmrgThe @code{hex_value} macro returns @code{unsigned int}, rather than
51010d565efSmrgsigned @code{int}, to make it easier to use in parsing addresses from
51110d565efSmrghex dump files: a signed @code{int} would be sign-extended when
51210d565efSmrgconverted to a wider unsigned type --- like @code{bfd_vma}, on some
51310d565efSmrgsystems.
51410d565efSmrg
51510d565efSmrg@end deftypefn
51610d565efSmrg
517*0fc04c29Smrg@c safe-ctype.c:24
51810d565efSmrg@defvr Extension HOST_CHARSET
51910d565efSmrgThis macro indicates the basic character set and encoding used by the
52010d565efSmrghost: more precisely, the encoding used for character constants in
52110d565efSmrgpreprocessor @samp{#if} statements (the C "execution character set").
52210d565efSmrgIt is defined by @file{safe-ctype.h}, and will be an integer constant
52310d565efSmrgwith one of the following values:
52410d565efSmrg
52510d565efSmrg@ftable @code
52610d565efSmrg@item HOST_CHARSET_UNKNOWN
52710d565efSmrgThe host character set is unknown - that is, not one of the next two
52810d565efSmrgpossibilities.
52910d565efSmrg
53010d565efSmrg@item HOST_CHARSET_ASCII
53110d565efSmrgThe host character set is ASCII.
53210d565efSmrg
53310d565efSmrg@item HOST_CHARSET_EBCDIC
53410d565efSmrgThe host character set is some variant of EBCDIC.  (Only one of the
53510d565efSmrgnineteen EBCDIC varying characters is tested; exercise caution.)
53610d565efSmrg@end ftable
53710d565efSmrg@end defvr
53810d565efSmrg
539*0fc04c29Smrg@c hashtab.c:327
54010d565efSmrg@deftypefn Supplemental htab_t htab_create_typed_alloc (size_t @var{size}, @
54110d565efSmrghtab_hash @var{hash_f}, htab_eq @var{eq_f}, htab_del @var{del_f}, @
54210d565efSmrghtab_alloc @var{alloc_tab_f}, htab_alloc @var{alloc_f}, @
54310d565efSmrghtab_free @var{free_f})
54410d565efSmrg
54510d565efSmrgThis function creates a hash table that uses two different allocators
54610d565efSmrg@var{alloc_tab_f} and @var{alloc_f} to use for allocating the table itself
54710d565efSmrgand its entries respectively.  This is useful when variables of different
54810d565efSmrgtypes need to be allocated with different allocators.
54910d565efSmrg
55010d565efSmrgThe created hash table is slightly larger than @var{size} and it is
55110d565efSmrginitially empty (all the hash table entries are @code{HTAB_EMPTY_ENTRY}).
55210d565efSmrgThe function returns the created hash table, or @code{NULL} if memory
55310d565efSmrgallocation fails.
55410d565efSmrg
55510d565efSmrg@end deftypefn
55610d565efSmrg
55710d565efSmrg@c index.c:5
55810d565efSmrg@deftypefn Supplemental char* index (char *@var{s}, int @var{c})
55910d565efSmrg
56010d565efSmrgReturns a pointer to the first occurrence of the character @var{c} in
56110d565efSmrgthe string @var{s}, or @code{NULL} if not found.  The use of @code{index} is
56210d565efSmrgdeprecated in new programs in favor of @code{strchr}.
56310d565efSmrg
56410d565efSmrg@end deftypefn
56510d565efSmrg
56610d565efSmrg@c insque.c:6
56710d565efSmrg@deftypefn Supplemental void insque (struct qelem *@var{elem}, @
56810d565efSmrg  struct qelem *@var{pred})
56910d565efSmrg@deftypefnx Supplemental void remque (struct qelem *@var{elem})
57010d565efSmrg
57110d565efSmrgRoutines to manipulate queues built from doubly linked lists.  The
57210d565efSmrg@code{insque} routine inserts @var{elem} in the queue immediately
57310d565efSmrgafter @var{pred}.  The @code{remque} routine removes @var{elem} from
57410d565efSmrgits containing queue.  These routines expect to be passed pointers to
57510d565efSmrgstructures which have as their first members a forward pointer and a
57610d565efSmrgback pointer, like this prototype (although no prototype is provided):
57710d565efSmrg
57810d565efSmrg@example
57910d565efSmrgstruct qelem @{
58010d565efSmrg  struct qelem *q_forw;
58110d565efSmrg  struct qelem *q_back;
58210d565efSmrg  char q_data[];
58310d565efSmrg@};
58410d565efSmrg@end example
58510d565efSmrg
58610d565efSmrg@end deftypefn
58710d565efSmrg
588*0fc04c29Smrg@c safe-ctype.c:45
58910d565efSmrg@deffn  Extension ISALPHA  (@var{c})
59010d565efSmrg@deffnx Extension ISALNUM  (@var{c})
59110d565efSmrg@deffnx Extension ISBLANK  (@var{c})
59210d565efSmrg@deffnx Extension ISCNTRL  (@var{c})
59310d565efSmrg@deffnx Extension ISDIGIT  (@var{c})
59410d565efSmrg@deffnx Extension ISGRAPH  (@var{c})
59510d565efSmrg@deffnx Extension ISLOWER  (@var{c})
59610d565efSmrg@deffnx Extension ISPRINT  (@var{c})
59710d565efSmrg@deffnx Extension ISPUNCT  (@var{c})
59810d565efSmrg@deffnx Extension ISSPACE  (@var{c})
59910d565efSmrg@deffnx Extension ISUPPER  (@var{c})
60010d565efSmrg@deffnx Extension ISXDIGIT (@var{c})
60110d565efSmrg
60210d565efSmrgThese twelve macros are defined by @file{safe-ctype.h}.  Each has the
60310d565efSmrgsame meaning as the corresponding macro (with name in lowercase)
60410d565efSmrgdefined by the standard header @file{ctype.h}.  For example,
60510d565efSmrg@code{ISALPHA} returns true for alphabetic characters and false for
60610d565efSmrgothers.  However, there are two differences between these macros and
60710d565efSmrgthose provided by @file{ctype.h}:
60810d565efSmrg
60910d565efSmrg@itemize @bullet
61010d565efSmrg@item These macros are guaranteed to have well-defined behavior for all
61110d565efSmrgvalues representable by @code{signed char} and @code{unsigned char}, and
61210d565efSmrgfor @code{EOF}.
61310d565efSmrg
61410d565efSmrg@item These macros ignore the current locale; they are true for these
61510d565efSmrgfixed sets of characters:
61610d565efSmrg@multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada}
61710d565efSmrg@item @code{ALPHA}  @tab @kbd{A-Za-z}
61810d565efSmrg@item @code{ALNUM}  @tab @kbd{A-Za-z0-9}
61910d565efSmrg@item @code{BLANK}  @tab @kbd{space tab}
62010d565efSmrg@item @code{CNTRL}  @tab @code{!PRINT}
62110d565efSmrg@item @code{DIGIT}  @tab @kbd{0-9}
62210d565efSmrg@item @code{GRAPH}  @tab @code{ALNUM || PUNCT}
62310d565efSmrg@item @code{LOWER}  @tab @kbd{a-z}
62410d565efSmrg@item @code{PRINT}  @tab @code{GRAPH ||} @kbd{space}
62510d565efSmrg@item @code{PUNCT}  @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?}
62610d565efSmrg@item @code{SPACE}  @tab @kbd{space tab \n \r \f \v}
62710d565efSmrg@item @code{UPPER}  @tab @kbd{A-Z}
62810d565efSmrg@item @code{XDIGIT} @tab @kbd{0-9A-Fa-f}
62910d565efSmrg@end multitable
63010d565efSmrg
63110d565efSmrgNote that, if the host character set is ASCII or a superset thereof,
63210d565efSmrgall these macros will return false for all values of @code{char} outside
63310d565efSmrgthe range of 7-bit ASCII.  In particular, both ISPRINT and ISCNTRL return
63410d565efSmrgfalse for characters with numeric values from 128 to 255.
63510d565efSmrg@end itemize
63610d565efSmrg@end deffn
63710d565efSmrg
638*0fc04c29Smrg@c safe-ctype.c:94
63910d565efSmrg@deffn  Extension ISIDNUM         (@var{c})
64010d565efSmrg@deffnx Extension ISIDST          (@var{c})
64110d565efSmrg@deffnx Extension IS_VSPACE       (@var{c})
64210d565efSmrg@deffnx Extension IS_NVSPACE      (@var{c})
64310d565efSmrg@deffnx Extension IS_SPACE_OR_NUL (@var{c})
64410d565efSmrg@deffnx Extension IS_ISOBASIC     (@var{c})
64510d565efSmrgThese six macros are defined by @file{safe-ctype.h} and provide
64610d565efSmrgadditional character classes which are useful when doing lexical
64710d565efSmrganalysis of C or similar languages.  They are true for the following
64810d565efSmrgsets of characters:
64910d565efSmrg
65010d565efSmrg@multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada}
65110d565efSmrg@item @code{IDNUM}        @tab @kbd{A-Za-z0-9_}
65210d565efSmrg@item @code{IDST}         @tab @kbd{A-Za-z_}
65310d565efSmrg@item @code{VSPACE}       @tab @kbd{\r \n}
65410d565efSmrg@item @code{NVSPACE}      @tab @kbd{space tab \f \v \0}
65510d565efSmrg@item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE}
65610d565efSmrg@item @code{ISOBASIC}     @tab @code{VSPACE || NVSPACE || PRINT}
65710d565efSmrg@end multitable
65810d565efSmrg@end deffn
65910d565efSmrg
66010d565efSmrg@c lbasename.c:23
66110d565efSmrg@deftypefn Replacement {const char*} lbasename (const char *@var{name})
66210d565efSmrg
66310d565efSmrgGiven a pointer to a string containing a typical pathname
66410d565efSmrg(@samp{/usr/src/cmd/ls/ls.c} for example), returns a pointer to the
66510d565efSmrglast component of the pathname (@samp{ls.c} in this case).  The
66610d565efSmrgreturned pointer is guaranteed to lie within the original
66710d565efSmrgstring.  This latter fact is not true of many vendor C
66810d565efSmrglibraries, which return special strings or modify the passed
66910d565efSmrgstrings for particular input.
67010d565efSmrg
67110d565efSmrgIn particular, the empty string returns the same empty string,
67210d565efSmrgand a path ending in @code{/} returns the empty string after it.
67310d565efSmrg
67410d565efSmrg@end deftypefn
67510d565efSmrg
67610d565efSmrg@c lrealpath.c:25
67710d565efSmrg@deftypefn Replacement {const char*} lrealpath (const char *@var{name})
67810d565efSmrg
67910d565efSmrgGiven a pointer to a string containing a pathname, returns a canonical
68010d565efSmrgversion of the filename.  Symlinks will be resolved, and ``.'' and ``..''
68110d565efSmrgcomponents will be simplified.  The returned value will be allocated using
68210d565efSmrg@code{malloc}, or @code{NULL} will be returned on a memory allocation error.
68310d565efSmrg
68410d565efSmrg@end deftypefn
68510d565efSmrg
686*0fc04c29Smrg@c make-relative-prefix.c:23
68710d565efSmrg@deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, @
68810d565efSmrg  const char *@var{bin_prefix}, const char *@var{prefix})
68910d565efSmrg
69010d565efSmrgGiven three paths @var{progname}, @var{bin_prefix}, @var{prefix},
69110d565efSmrgreturn the path that is in the same position relative to
69210d565efSmrg@var{progname}'s directory as @var{prefix} is relative to
69310d565efSmrg@var{bin_prefix}.  That is, a string starting with the directory
69410d565efSmrgportion of @var{progname}, followed by a relative pathname of the
69510d565efSmrgdifference between @var{bin_prefix} and @var{prefix}.
69610d565efSmrg
69710d565efSmrgIf @var{progname} does not contain any directory separators,
69810d565efSmrg@code{make_relative_prefix} will search @env{PATH} to find a program
69910d565efSmrgnamed @var{progname}.  Also, if @var{progname} is a symbolic link,
70010d565efSmrgthe symbolic link will be resolved.
70110d565efSmrg
70210d565efSmrgFor example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta},
70310d565efSmrg@var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is
70410d565efSmrg@code{/red/green/blue/gcc}, then this function will return
70510d565efSmrg@code{/red/green/blue/../../omega/}.
70610d565efSmrg
70710d565efSmrgThe return value is normally allocated via @code{malloc}.  If no
70810d565efSmrgrelative prefix can be found, return @code{NULL}.
70910d565efSmrg
71010d565efSmrg@end deftypefn
71110d565efSmrg
712*0fc04c29Smrg@c make-temp-file.c:173
71310d565efSmrg@deftypefn Replacement char* make_temp_file (const char *@var{suffix})
71410d565efSmrg
71510d565efSmrgReturn a temporary file name (as a string) or @code{NULL} if unable to
71610d565efSmrgcreate one.  @var{suffix} is a suffix to append to the file name.  The
71710d565efSmrgstring is @code{malloc}ed, and the temporary file has been created.
71810d565efSmrg
71910d565efSmrg@end deftypefn
72010d565efSmrg
72110d565efSmrg@c memchr.c:3
72210d565efSmrg@deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, @
72310d565efSmrg  size_t @var{n})
72410d565efSmrg
72510d565efSmrgThis function searches memory starting at @code{*@var{s}} for the
72610d565efSmrgcharacter @var{c}.  The search only ends with the first occurrence of
72710d565efSmrg@var{c}, or after @var{length} characters; in particular, a null
72810d565efSmrgcharacter does not terminate the search.  If the character @var{c} is
72910d565efSmrgfound within @var{length} characters of @code{*@var{s}}, a pointer
73010d565efSmrgto the character is returned.  If @var{c} is not found, then @code{NULL} is
73110d565efSmrgreturned.
73210d565efSmrg
73310d565efSmrg@end deftypefn
73410d565efSmrg
73510d565efSmrg@c memcmp.c:6
73610d565efSmrg@deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, @
73710d565efSmrg  size_t @var{count})
73810d565efSmrg
73910d565efSmrgCompares the first @var{count} bytes of two areas of memory.  Returns
74010d565efSmrgzero if they are the same, a value less than zero if @var{x} is
74110d565efSmrglexically less than @var{y}, or a value greater than zero if @var{x}
74210d565efSmrgis lexically greater than @var{y}.  Note that lexical order is determined
74310d565efSmrgas if comparing unsigned char arrays.
74410d565efSmrg
74510d565efSmrg@end deftypefn
74610d565efSmrg
74710d565efSmrg@c memcpy.c:6
74810d565efSmrg@deftypefn Supplemental void* memcpy (void *@var{out}, const void *@var{in}, @
74910d565efSmrg  size_t @var{length})
75010d565efSmrg
75110d565efSmrgCopies @var{length} bytes from memory region @var{in} to region
75210d565efSmrg@var{out}.  Returns a pointer to @var{out}.
75310d565efSmrg
75410d565efSmrg@end deftypefn
75510d565efSmrg
75610d565efSmrg@c memmem.c:20
75710d565efSmrg@deftypefn Supplemental void* memmem (const void *@var{haystack}, @
75810d565efSmrg  size_t @var{haystack_len} const void *@var{needle}, size_t @var{needle_len})
75910d565efSmrg
76010d565efSmrgReturns a pointer to the first occurrence of @var{needle} (length
76110d565efSmrg@var{needle_len}) in @var{haystack} (length @var{haystack_len}).
76210d565efSmrgReturns @code{NULL} if not found.
76310d565efSmrg
76410d565efSmrg@end deftypefn
76510d565efSmrg
76610d565efSmrg@c memmove.c:6
76710d565efSmrg@deftypefn Supplemental void* memmove (void *@var{from}, const void *@var{to}, @
76810d565efSmrg  size_t @var{count})
76910d565efSmrg
77010d565efSmrgCopies @var{count} bytes from memory area @var{from} to memory area
77110d565efSmrg@var{to}, returning a pointer to @var{to}.
77210d565efSmrg
77310d565efSmrg@end deftypefn
77410d565efSmrg
77510d565efSmrg@c mempcpy.c:23
77610d565efSmrg@deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, @
77710d565efSmrg  size_t @var{length})
77810d565efSmrg
77910d565efSmrgCopies @var{length} bytes from memory region @var{in} to region
78010d565efSmrg@var{out}.  Returns a pointer to @var{out} + @var{length}.
78110d565efSmrg
78210d565efSmrg@end deftypefn
78310d565efSmrg
78410d565efSmrg@c memset.c:6
78510d565efSmrg@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, @
78610d565efSmrg  size_t @var{count})
78710d565efSmrg
78810d565efSmrgSets the first @var{count} bytes of @var{s} to the constant byte
78910d565efSmrg@var{c}, returning a pointer to @var{s}.
79010d565efSmrg
79110d565efSmrg@end deftypefn
79210d565efSmrg
793*0fc04c29Smrg@c mkstemps.c:60
79410d565efSmrg@deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len})
79510d565efSmrg
79610d565efSmrgGenerate a unique temporary file name from @var{pattern}.
79710d565efSmrg@var{pattern} has the form:
79810d565efSmrg
79910d565efSmrg@example
80010d565efSmrg   @var{path}/ccXXXXXX@var{suffix}
80110d565efSmrg@end example
80210d565efSmrg
80310d565efSmrg@var{suffix_len} tells us how long @var{suffix} is (it can be zero
80410d565efSmrglength).  The last six characters of @var{pattern} before @var{suffix}
80510d565efSmrgmust be @samp{XXXXXX}; they are replaced with a string that makes the
80610d565efSmrgfilename unique.  Returns a file descriptor open on the file for
80710d565efSmrgreading and writing.
80810d565efSmrg
80910d565efSmrg@end deftypefn
81010d565efSmrg
81110d565efSmrg@c pexecute.txh:278
81210d565efSmrg@deftypefn Extension void pex_free (struct pex_obj @var{obj})
81310d565efSmrg
81410d565efSmrgClean up and free all data associated with @var{obj}.  If you have not
81510d565efSmrgyet called @code{pex_get_times} or @code{pex_get_status}, this will
81610d565efSmrgtry to kill the subprocesses.
81710d565efSmrg
81810d565efSmrg@end deftypefn
81910d565efSmrg
82010d565efSmrg@c pexecute.txh:251
82110d565efSmrg@deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, @
82210d565efSmrg  int @var{count}, int *@var{vector})
82310d565efSmrg
82410d565efSmrgReturns the exit status of all programs run using @var{obj}.
82510d565efSmrg@var{count} is the number of results expected.  The results will be
82610d565efSmrgplaced into @var{vector}.  The results are in the order of the calls
82710d565efSmrgto @code{pex_run}.  Returns 0 on error, 1 on success.
82810d565efSmrg
82910d565efSmrg@end deftypefn
83010d565efSmrg
83110d565efSmrg@c pexecute.txh:261
83210d565efSmrg@deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, @
83310d565efSmrg  int @var{count}, struct pex_time *@var{vector})
83410d565efSmrg
83510d565efSmrgReturns the process execution times of all programs run using
83610d565efSmrg@var{obj}.  @var{count} is the number of results expected.  The
83710d565efSmrgresults will be placed into @var{vector}.  The results are in the
83810d565efSmrgorder of the calls to @code{pex_run}.  Returns 0 on error, 1 on
83910d565efSmrgsuccess.
84010d565efSmrg
84110d565efSmrg@code{struct pex_time} has the following fields of the type
84210d565efSmrg@code{unsigned long}: @code{user_seconds},
84310d565efSmrg@code{user_microseconds}, @code{system_seconds},
84410d565efSmrg@code{system_microseconds}.  On systems which do not support reporting
84510d565efSmrgprocess times, all the fields will be set to @code{0}.
84610d565efSmrg
84710d565efSmrg@end deftypefn
84810d565efSmrg
84910d565efSmrg@c pexecute.txh:2
85010d565efSmrg@deftypefn Extension {struct pex_obj *} pex_init (int @var{flags}, @
85110d565efSmrg  const char *@var{pname}, const char *@var{tempbase})
85210d565efSmrg
85310d565efSmrgPrepare to execute one or more programs, with standard output of each
85410d565efSmrgprogram fed to standard input of the next.  This is a system
85510d565efSmrgindependent interface to execute a pipeline.
85610d565efSmrg
85710d565efSmrg@var{flags} is a bitwise combination of the following:
85810d565efSmrg
85910d565efSmrg@table @code
86010d565efSmrg
86110d565efSmrg@vindex PEX_RECORD_TIMES
86210d565efSmrg@item PEX_RECORD_TIMES
86310d565efSmrgRecord subprocess times if possible.
86410d565efSmrg
86510d565efSmrg@vindex PEX_USE_PIPES
86610d565efSmrg@item PEX_USE_PIPES
86710d565efSmrgUse pipes for communication between processes, if possible.
86810d565efSmrg
86910d565efSmrg@vindex PEX_SAVE_TEMPS
87010d565efSmrg@item PEX_SAVE_TEMPS
87110d565efSmrgDon't delete temporary files used for communication between
87210d565efSmrgprocesses.
87310d565efSmrg
87410d565efSmrg@end table
87510d565efSmrg
87610d565efSmrg@var{pname} is the name of program to be executed, used in error
87710d565efSmrgmessages.  @var{tempbase} is a base name to use for any required
87810d565efSmrgtemporary files; it may be @code{NULL} to use a randomly chosen name.
87910d565efSmrg
88010d565efSmrg@end deftypefn
88110d565efSmrg
88210d565efSmrg@c pexecute.txh:161
88310d565efSmrg@deftypefn Extension {FILE *} pex_input_file (struct pex_obj *@var{obj}, @
88410d565efSmrg  int @var{flags}, const char *@var{in_name})
88510d565efSmrg
88610d565efSmrgReturn a stream for a temporary file to pass to the first program in
88710d565efSmrgthe pipeline as input.
88810d565efSmrg
88910d565efSmrgThe name of the input file is chosen according to the same rules
89010d565efSmrg@code{pex_run} uses to choose output file names, based on
89110d565efSmrg@var{in_name}, @var{obj} and the @code{PEX_SUFFIX} bit in @var{flags}.
89210d565efSmrg
89310d565efSmrgDon't call @code{fclose} on the returned stream; the first call to
89410d565efSmrg@code{pex_run} closes it automatically.
89510d565efSmrg
89610d565efSmrgIf @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in
89710d565efSmrgbinary mode; otherwise, open it in the default mode.  Including
89810d565efSmrg@code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
89910d565efSmrg@end deftypefn
90010d565efSmrg
90110d565efSmrg@c pexecute.txh:179
90210d565efSmrg@deftypefn Extension {FILE *} pex_input_pipe (struct pex_obj *@var{obj}, @
90310d565efSmrg  int @var{binary})
90410d565efSmrg
90510d565efSmrgReturn a stream @var{fp} for a pipe connected to the standard input of
90610d565efSmrgthe first program in the pipeline; @var{fp} is opened for writing.
90710d565efSmrgYou must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call
90810d565efSmrgthat returned @var{obj}.
90910d565efSmrg
91010d565efSmrgYou must close @var{fp} using @code{fclose} yourself when you have
91110d565efSmrgfinished writing data to the pipeline.
91210d565efSmrg
91310d565efSmrgThe file descriptor underlying @var{fp} is marked not to be inherited
91410d565efSmrgby child processes.
91510d565efSmrg
91610d565efSmrgOn systems that do not support pipes, this function returns
91710d565efSmrg@code{NULL}, and sets @code{errno} to @code{EINVAL}.  If you would
91810d565efSmrglike to write code that is portable to all systems the @code{pex}
91910d565efSmrgfunctions support, consider using @code{pex_input_file} instead.
92010d565efSmrg
92110d565efSmrgThere are two opportunities for deadlock using
92210d565efSmrg@code{pex_input_pipe}:
92310d565efSmrg
92410d565efSmrg@itemize @bullet
92510d565efSmrg@item
92610d565efSmrgMost systems' pipes can buffer only a fixed amount of data; a process
92710d565efSmrgthat writes to a full pipe blocks.  Thus, if you write to @file{fp}
92810d565efSmrgbefore starting the first process, you run the risk of blocking when
92910d565efSmrgthere is no child process yet to read the data and allow you to
93010d565efSmrgcontinue.  @code{pex_input_pipe} makes no promises about the
93110d565efSmrgsize of the pipe's buffer, so if you need to write any data at all
93210d565efSmrgbefore starting the first process in the pipeline, consider using
93310d565efSmrg@code{pex_input_file} instead.
93410d565efSmrg
93510d565efSmrg@item
93610d565efSmrgUsing @code{pex_input_pipe} and @code{pex_read_output} together
93710d565efSmrgmay also cause deadlock.  If the output pipe fills up, so that each
93810d565efSmrgprogram in the pipeline is waiting for the next to read more data, and
93910d565efSmrgyou fill the input pipe by writing more data to @var{fp}, then there
94010d565efSmrgis no way to make progress: the only process that could read data from
94110d565efSmrgthe output pipe is you, but you are blocked on the input pipe.
94210d565efSmrg
94310d565efSmrg@end itemize
94410d565efSmrg
94510d565efSmrg@end deftypefn
94610d565efSmrg
94710d565efSmrg@c pexecute.txh:286
94810d565efSmrg@deftypefn Extension {const char *} pex_one (int @var{flags}, @
94910d565efSmrg  const char *@var{executable}, char * const *@var{argv}, @
95010d565efSmrg  const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, @
95110d565efSmrg  int *@var{status}, int *@var{err})
95210d565efSmrg
95310d565efSmrgAn interface to permit the easy execution of a
95410d565efSmrgsingle program.  The return value and most of the parameters are as
95510d565efSmrgfor a call to @code{pex_run}.  @var{flags} is restricted to a
95610d565efSmrgcombination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and
95710d565efSmrg@code{PEX_BINARY_OUTPUT}.  @var{outname} is interpreted as if
95810d565efSmrg@code{PEX_LAST} were set.  On a successful return, @code{*@var{status}} will
95910d565efSmrgbe set to the exit status of the program.
96010d565efSmrg
96110d565efSmrg@end deftypefn
96210d565efSmrg
96310d565efSmrg@c pexecute.txh:237
96410d565efSmrg@deftypefn Extension {FILE *} pex_read_err (struct pex_obj *@var{obj}, @
96510d565efSmrg  int @var{binary})
96610d565efSmrg
96710d565efSmrgReturns a @code{FILE} pointer which may be used to read the standard
96810d565efSmrgerror of the last program in the pipeline.  When this is used,
96910d565efSmrg@code{PEX_LAST} should not be used in a call to @code{pex_run}.  After
97010d565efSmrgthis is called, @code{pex_run} may no longer be called with the same
97110d565efSmrg@var{obj}.  @var{binary} should be non-zero if the file should be
97210d565efSmrgopened in binary mode.  Don't call @code{fclose} on the returned file;
97310d565efSmrgit will be closed by @code{pex_free}.
97410d565efSmrg
97510d565efSmrg@end deftypefn
97610d565efSmrg
97710d565efSmrg@c pexecute.txh:224
97810d565efSmrg@deftypefn Extension {FILE *} pex_read_output (struct pex_obj *@var{obj}, @
97910d565efSmrg  int @var{binary})
98010d565efSmrg
98110d565efSmrgReturns a @code{FILE} pointer which may be used to read the standard
98210d565efSmrgoutput of the last program in the pipeline.  When this is used,
98310d565efSmrg@code{PEX_LAST} should not be used in a call to @code{pex_run}.  After
98410d565efSmrgthis is called, @code{pex_run} may no longer be called with the same
98510d565efSmrg@var{obj}.  @var{binary} should be non-zero if the file should be
98610d565efSmrgopened in binary mode.  Don't call @code{fclose} on the returned file;
98710d565efSmrgit will be closed by @code{pex_free}.
98810d565efSmrg
98910d565efSmrg@end deftypefn
99010d565efSmrg
99110d565efSmrg@c pexecute.txh:34
99210d565efSmrg@deftypefn Extension {const char *} pex_run (struct pex_obj *@var{obj}, @
99310d565efSmrg  int @var{flags}, const char *@var{executable}, char * const *@var{argv}, @
99410d565efSmrg  const char *@var{outname}, const char *@var{errname}, int *@var{err})
99510d565efSmrg
99610d565efSmrgExecute one program in a pipeline.  On success this returns
99710d565efSmrg@code{NULL}.  On failure it returns an error message, a statically
99810d565efSmrgallocated string.
99910d565efSmrg
100010d565efSmrg@var{obj} is returned by a previous call to @code{pex_init}.
100110d565efSmrg
100210d565efSmrg@var{flags} is a bitwise combination of the following:
100310d565efSmrg
100410d565efSmrg@table @code
100510d565efSmrg
100610d565efSmrg@vindex PEX_LAST
100710d565efSmrg@item PEX_LAST
100810d565efSmrgThis must be set on the last program in the pipeline.  In particular,
100910d565efSmrgit should be set when executing a single program.  The standard output
101010d565efSmrgof the program will be sent to @var{outname}, or, if @var{outname} is
101110d565efSmrg@code{NULL}, to the standard output of the calling program.  Do @emph{not}
101210d565efSmrgset this bit if you want to call @code{pex_read_output}
101310d565efSmrg(described below).  After a call to @code{pex_run} with this bit set,
101410d565efSmrg@var{pex_run} may no longer be called with the same @var{obj}.
101510d565efSmrg
101610d565efSmrg@vindex PEX_SEARCH
101710d565efSmrg@item PEX_SEARCH
101810d565efSmrgSearch for the program using the user's executable search path.
101910d565efSmrg
102010d565efSmrg@vindex PEX_SUFFIX
102110d565efSmrg@item PEX_SUFFIX
102210d565efSmrg@var{outname} is a suffix.  See the description of @var{outname},
102310d565efSmrgbelow.
102410d565efSmrg
102510d565efSmrg@vindex PEX_STDERR_TO_STDOUT
102610d565efSmrg@item PEX_STDERR_TO_STDOUT
102710d565efSmrgSend the program's standard error to standard output, if possible.
102810d565efSmrg
102910d565efSmrg@vindex PEX_BINARY_INPUT
103010d565efSmrg@vindex PEX_BINARY_OUTPUT
103110d565efSmrg@vindex PEX_BINARY_ERROR
103210d565efSmrg@item PEX_BINARY_INPUT
103310d565efSmrg@itemx PEX_BINARY_OUTPUT
103410d565efSmrg@itemx PEX_BINARY_ERROR
103510d565efSmrgThe standard input (output or error) of the program should be read (written) in
103610d565efSmrgbinary mode rather than text mode.  These flags are ignored on systems
103710d565efSmrgwhich do not distinguish binary mode and text mode, such as Unix.  For
103810d565efSmrgproper behavior these flags should match appropriately---a call to
103910d565efSmrg@code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a
104010d565efSmrgcall using @code{PEX_BINARY_INPUT}.
104110d565efSmrg
104210d565efSmrg@vindex PEX_STDERR_TO_PIPE
104310d565efSmrg@item PEX_STDERR_TO_PIPE
104410d565efSmrgSend the program's standard error to a pipe, if possible.  This flag
104510d565efSmrgcannot be specified together with @code{PEX_STDERR_TO_STDOUT}.  This
104610d565efSmrgflag can be specified only on the last program in pipeline.
104710d565efSmrg
104810d565efSmrg@end table
104910d565efSmrg
105010d565efSmrg@var{executable} is the program to execute.  @var{argv} is the set of
105110d565efSmrgarguments to pass to the program; normally @code{@var{argv}[0]} will
105210d565efSmrgbe a copy of @var{executable}.
105310d565efSmrg
105410d565efSmrg@var{outname} is used to set the name of the file to use for standard
105510d565efSmrgoutput.  There are two cases in which no output file will be used:
105610d565efSmrg
105710d565efSmrg@enumerate
105810d565efSmrg@item
105910d565efSmrgif @code{PEX_LAST} is not set in @var{flags}, and @code{PEX_USE_PIPES}
106010d565efSmrgwas set in the call to @code{pex_init}, and the system supports pipes
106110d565efSmrg
106210d565efSmrg@item
106310d565efSmrgif @code{PEX_LAST} is set in @var{flags}, and @var{outname} is
106410d565efSmrg@code{NULL}
106510d565efSmrg@end enumerate
106610d565efSmrg
106710d565efSmrg@noindent
106810d565efSmrgOtherwise the code will use a file to hold standard
106910d565efSmrgoutput.  If @code{PEX_LAST} is not set, this file is considered to be
107010d565efSmrga temporary file, and it will be removed when no longer needed, unless
107110d565efSmrg@code{PEX_SAVE_TEMPS} was set in the call to @code{pex_init}.
107210d565efSmrg
107310d565efSmrgThere are two cases to consider when setting the name of the file to
107410d565efSmrghold standard output.
107510d565efSmrg
107610d565efSmrg@enumerate
107710d565efSmrg@item
107810d565efSmrg@code{PEX_SUFFIX} is set in @var{flags}.  In this case
107910d565efSmrg@var{outname} may not be @code{NULL}.  If the @var{tempbase} parameter
108010d565efSmrgto @code{pex_init} was not @code{NULL}, then the output file name is
108110d565efSmrgthe concatenation of @var{tempbase} and @var{outname}.  If
108210d565efSmrg@var{tempbase} was @code{NULL}, then the output file name is a random
108310d565efSmrgfile name ending in @var{outname}.
108410d565efSmrg
108510d565efSmrg@item
108610d565efSmrg@code{PEX_SUFFIX} was not set in @var{flags}.  In this
108710d565efSmrgcase, if @var{outname} is not @code{NULL}, it is used as the output
108810d565efSmrgfile name.  If @var{outname} is @code{NULL}, and @var{tempbase} was
108910d565efSmrgnot NULL, the output file name is randomly chosen using
109010d565efSmrg@var{tempbase}.  Otherwise the output file name is chosen completely
109110d565efSmrgat random.
109210d565efSmrg@end enumerate
109310d565efSmrg
109410d565efSmrg@var{errname} is the file name to use for standard error output.  If
109510d565efSmrgit is @code{NULL}, standard error is the same as the caller's.
109610d565efSmrgOtherwise, standard error is written to the named file.
109710d565efSmrg
109810d565efSmrgOn an error return, the code sets @code{*@var{err}} to an @code{errno}
109910d565efSmrgvalue, or to 0 if there is no relevant @code{errno}.
110010d565efSmrg
110110d565efSmrg@end deftypefn
110210d565efSmrg
110310d565efSmrg@c pexecute.txh:145
110410d565efSmrg@deftypefn Extension {const char *} pex_run_in_environment (struct pex_obj *@var{obj}, @
110510d565efSmrg  int @var{flags}, const char *@var{executable}, char * const *@var{argv}, @
110610d565efSmrg  char * const *@var{env}, int @var{env_size}, const char *@var{outname}, @
110710d565efSmrg  const char *@var{errname}, int *@var{err})
110810d565efSmrg
110910d565efSmrgExecute one program in a pipeline, permitting the environment for the
111010d565efSmrgprogram to be specified.  Behaviour and parameters not listed below are
111110d565efSmrgas for @code{pex_run}.
111210d565efSmrg
111310d565efSmrg@var{env} is the environment for the child process, specified as an array of
111410d565efSmrgcharacter pointers.  Each element of the array should point to a string of the
111510d565efSmrgform @code{VAR=VALUE}, with the exception of the last element that must be
111610d565efSmrg@code{NULL}.
111710d565efSmrg
111810d565efSmrg@end deftypefn
111910d565efSmrg
112010d565efSmrg@c pexecute.txh:301
112110d565efSmrg@deftypefn Extension int pexecute (const char *@var{program}, @
112210d565efSmrg  char * const *@var{argv}, const char *@var{this_pname}, @
112310d565efSmrg  const char *@var{temp_base}, char **@var{errmsg_fmt}, @
112410d565efSmrg  char **@var{errmsg_arg}, int @var{flags})
112510d565efSmrg
112610d565efSmrgThis is the old interface to execute one or more programs.  It is
112710d565efSmrgstill supported for compatibility purposes, but is no longer
112810d565efSmrgdocumented.
112910d565efSmrg
113010d565efSmrg@end deftypefn
113110d565efSmrg
113210d565efSmrg@c strsignal.c:541
113310d565efSmrg@deftypefn Supplemental void psignal (int @var{signo}, char *@var{message})
113410d565efSmrg
113510d565efSmrgPrint @var{message} to the standard error, followed by a colon,
113610d565efSmrgfollowed by the description of the signal specified by @var{signo},
113710d565efSmrgfollowed by a newline.
113810d565efSmrg
113910d565efSmrg@end deftypefn
114010d565efSmrg
114110d565efSmrg@c putenv.c:21
114210d565efSmrg@deftypefn Supplemental int putenv (const char *@var{string})
114310d565efSmrg
114410d565efSmrgUses @code{setenv} or @code{unsetenv} to put @var{string} into
114510d565efSmrgthe environment or remove it.  If @var{string} is of the form
114610d565efSmrg@samp{name=value} the string is added; if no @samp{=} is present the
114710d565efSmrgname is unset/removed.
114810d565efSmrg
114910d565efSmrg@end deftypefn
115010d565efSmrg
115110d565efSmrg@c pexecute.txh:312
115210d565efSmrg@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags})
115310d565efSmrg
115410d565efSmrgAnother part of the old execution interface.
115510d565efSmrg
115610d565efSmrg@end deftypefn
115710d565efSmrg
115810d565efSmrg@c random.c:39
115910d565efSmrg@deftypefn Supplement {long int} random (void)
116010d565efSmrg@deftypefnx Supplement void srandom (unsigned int @var{seed})
116110d565efSmrg@deftypefnx Supplement void* initstate (unsigned int @var{seed}, @
116210d565efSmrg  void *@var{arg_state}, unsigned long @var{n})
116310d565efSmrg@deftypefnx Supplement void* setstate (void *@var{arg_state})
116410d565efSmrg
116510d565efSmrgRandom number functions.  @code{random} returns a random number in the
116610d565efSmrgrange 0 to @code{LONG_MAX}.  @code{srandom} initializes the random
116710d565efSmrgnumber generator to some starting point determined by @var{seed}
116810d565efSmrg(else, the values returned by @code{random} are always the same for each
116910d565efSmrgrun of the program).  @code{initstate} and @code{setstate} allow fine-grained
117010d565efSmrgcontrol over the state of the random number generator.
117110d565efSmrg
117210d565efSmrg@end deftypefn
117310d565efSmrg
117410d565efSmrg@c concat.c:160
117510d565efSmrg@deftypefn Extension char* reconcat (char *@var{optr}, const char *@var{s1}, @
117610d565efSmrg  @dots{}, @code{NULL})
117710d565efSmrg
117810d565efSmrgSame as @code{concat}, except that if @var{optr} is not @code{NULL} it
117910d565efSmrgis freed after the string is created.  This is intended to be useful
118010d565efSmrgwhen you're extending an existing string or building up a string in a
118110d565efSmrgloop:
118210d565efSmrg
118310d565efSmrg@example
118410d565efSmrg  str = reconcat (str, "pre-", str, NULL);
118510d565efSmrg@end example
118610d565efSmrg
118710d565efSmrg@end deftypefn
118810d565efSmrg
118910d565efSmrg@c rename.c:6
119010d565efSmrg@deftypefn Supplemental int rename (const char *@var{old}, const char *@var{new})
119110d565efSmrg
119210d565efSmrgRenames a file from @var{old} to @var{new}.  If @var{new} already
119310d565efSmrgexists, it is removed.
119410d565efSmrg
119510d565efSmrg@end deftypefn
119610d565efSmrg
119710d565efSmrg@c rindex.c:5
119810d565efSmrg@deftypefn Supplemental char* rindex (const char *@var{s}, int @var{c})
119910d565efSmrg
120010d565efSmrgReturns a pointer to the last occurrence of the character @var{c} in
120110d565efSmrgthe string @var{s}, or @code{NULL} if not found.  The use of @code{rindex} is
120210d565efSmrgdeprecated in new programs in favor of @code{strrchr}.
120310d565efSmrg
120410d565efSmrg@end deftypefn
120510d565efSmrg
1206*0fc04c29Smrg@c setenv.c:22
120710d565efSmrg@deftypefn Supplemental int setenv (const char *@var{name}, @
120810d565efSmrg  const char *@var{value}, int @var{overwrite})
120910d565efSmrg@deftypefnx Supplemental void unsetenv (const char *@var{name})
121010d565efSmrg
121110d565efSmrg@code{setenv} adds @var{name} to the environment with value
121210d565efSmrg@var{value}.  If the name was already present in the environment,
121310d565efSmrgthe new value will be stored only if @var{overwrite} is nonzero.
121410d565efSmrgThe companion @code{unsetenv} function removes @var{name} from the
121510d565efSmrgenvironment.  This implementation is not safe for multithreaded code.
121610d565efSmrg
121710d565efSmrg@end deftypefn
121810d565efSmrg
121910d565efSmrg@c setproctitle.c:31
122010d565efSmrg@deftypefn Supplemental void setproctitle (const char *@var{fmt}, ...)
122110d565efSmrg
122210d565efSmrgSet the title of a process to @var{fmt}. va args not supported for now,
122310d565efSmrgbut defined for compatibility with BSD.
122410d565efSmrg
122510d565efSmrg@end deftypefn
122610d565efSmrg
122710d565efSmrg@c strsignal.c:348
122810d565efSmrg@deftypefn Extension int signo_max (void)
122910d565efSmrg
123010d565efSmrgReturns the maximum signal value for which a corresponding symbolic
123110d565efSmrgname or message is available.  Note that in the case where we use the
123210d565efSmrg@code{sys_siglist} supplied by the system, it is possible for there to
123310d565efSmrgbe more symbolic names than messages, or vice versa.  In fact, the
123410d565efSmrgmanual page for @code{psignal(3b)} explicitly warns that one should
123510d565efSmrgcheck the size of the table (@code{NSIG}) before indexing it, since
123610d565efSmrgnew signal codes may be added to the system before they are added to
123710d565efSmrgthe table.  Thus @code{NSIG} might be smaller than value implied by
123810d565efSmrgthe largest signo value defined in @code{<signal.h>}.
123910d565efSmrg
124010d565efSmrgWe return the maximum value that can be used to obtain a meaningful
124110d565efSmrgsymbolic name or message.
124210d565efSmrg
124310d565efSmrg@end deftypefn
124410d565efSmrg
124510d565efSmrg@c sigsetmask.c:8
124610d565efSmrg@deftypefn Supplemental int sigsetmask (int @var{set})
124710d565efSmrg
124810d565efSmrgSets the signal mask to the one provided in @var{set} and returns
124910d565efSmrgthe old mask (which, for libiberty's implementation, will always
125010d565efSmrgbe the value @code{1}).
125110d565efSmrg
125210d565efSmrg@end deftypefn
125310d565efSmrg
125410d565efSmrg@c simple-object.txh:96
125510d565efSmrg@deftypefn Extension {const char *} simple_object_attributes_compare @
125610d565efSmrg  (simple_object_attributes *@var{attrs1}, simple_object_attributes *@var{attrs2}, @
125710d565efSmrg   int *@var{err})
125810d565efSmrg
125910d565efSmrgCompare @var{attrs1} and @var{attrs2}.  If they could be linked
126010d565efSmrgtogether without error, return @code{NULL}.  Otherwise, return an
126110d565efSmrgerror message and set @code{*@var{err}} to an errno value or @code{0}
126210d565efSmrgif there is no relevant errno.
126310d565efSmrg
126410d565efSmrg@end deftypefn
126510d565efSmrg
126610d565efSmrg@c simple-object.txh:81
126710d565efSmrg@deftypefn Extension {simple_object_attributes *} simple_object_fetch_attributes @
126810d565efSmrg  (simple_object_read *@var{simple_object}, const char **@var{errmsg}, int *@var{err})
126910d565efSmrg
127010d565efSmrgFetch the attributes of @var{simple_object}.  The attributes are
127110d565efSmrginternal information such as the format of the object file, or the
127210d565efSmrgarchitecture it was compiled for.  This information will persist until
127310d565efSmrg@code{simple_object_attributes_release} is called, even if
127410d565efSmrg@var{simple_object} itself is released.
127510d565efSmrg
127610d565efSmrgOn error this returns @code{NULL}, sets @code{*@var{errmsg}} to an
127710d565efSmrgerror message, and sets @code{*@var{err}} to an errno value or
127810d565efSmrg@code{0} if there is no relevant errno.
127910d565efSmrg
128010d565efSmrg@end deftypefn
128110d565efSmrg
128210d565efSmrg@c simple-object.txh:49
128310d565efSmrg@deftypefn Extension {int} simple_object_find_section @
128410d565efSmrg  (simple_object_read *@var{simple_object} off_t *@var{offset}, @
128510d565efSmrg  off_t *@var{length}, const char **@var{errmsg}, int *@var{err})
128610d565efSmrg
128710d565efSmrgLook for the section @var{name} in @var{simple_object}.  This returns
128810d565efSmrginformation for the first section with that name.
128910d565efSmrg
129010d565efSmrgIf found, return 1 and set @code{*@var{offset}} to the offset in the
129110d565efSmrgfile of the section contents and set @code{*@var{length}} to the
129210d565efSmrglength of the section contents.  The value in @code{*@var{offset}}
129310d565efSmrgwill be relative to the offset passed to
129410d565efSmrg@code{simple_object_open_read}.
129510d565efSmrg
129610d565efSmrgIf the section is not found, and no error occurs,
129710d565efSmrg@code{simple_object_find_section} returns @code{0} and set
129810d565efSmrg@code{*@var{errmsg}} to @code{NULL}.
129910d565efSmrg
130010d565efSmrgIf an error occurs, @code{simple_object_find_section} returns
130110d565efSmrg@code{0}, sets @code{*@var{errmsg}} to an error message, and sets
130210d565efSmrg@code{*@var{err}} to an errno value or @code{0} if there is no
130310d565efSmrgrelevant errno.
130410d565efSmrg
130510d565efSmrg@end deftypefn
130610d565efSmrg
130710d565efSmrg@c simple-object.txh:27
130810d565efSmrg@deftypefn Extension {const char *} simple_object_find_sections @
130910d565efSmrg  (simple_object_read *@var{simple_object}, int (*@var{pfn}) (void *@var{data}, @
131010d565efSmrg  const char *@var{name}, off_t @var{offset}, off_t @var{length}), @
131110d565efSmrg  void *@var{data}, int *@var{err})
131210d565efSmrg
131310d565efSmrgThis function calls @var{pfn} for each section in @var{simple_object}.
131410d565efSmrgIt calls @var{pfn} with the section name, the offset within the file
131510d565efSmrgof the section contents, and the length of the section contents.  The
131610d565efSmrgoffset within the file is relative to the offset passed to
131710d565efSmrg@code{simple_object_open_read}.  The @var{data} argument to this
131810d565efSmrgfunction is passed along to @var{pfn}.
131910d565efSmrg
132010d565efSmrgIf @var{pfn} returns @code{0}, the loop over the sections stops and
132110d565efSmrg@code{simple_object_find_sections} returns.  If @var{pfn} returns some
132210d565efSmrgother value, the loop continues.
132310d565efSmrg
132410d565efSmrgOn success @code{simple_object_find_sections} returns.  On error it
132510d565efSmrgreturns an error string, and sets @code{*@var{err}} to an errno value
132610d565efSmrgor @code{0} if there is no relevant errno.
132710d565efSmrg
132810d565efSmrg@end deftypefn
132910d565efSmrg
133010d565efSmrg@c simple-object.txh:2
133110d565efSmrg@deftypefn Extension {simple_object_read *} simple_object_open_read @
133210d565efSmrg  (int @var{descriptor}, off_t @var{offset}, const char *{segment_name}, @
133310d565efSmrg  const char **@var{errmsg}, int *@var{err})
133410d565efSmrg
133510d565efSmrgOpens an object file for reading.  Creates and returns an
133610d565efSmrg@code{simple_object_read} pointer which may be passed to other
133710d565efSmrgfunctions to extract data from the object file.
133810d565efSmrg
133910d565efSmrg@var{descriptor} holds a file descriptor which permits reading.
134010d565efSmrg
134110d565efSmrg@var{offset} is the offset into the file; this will be @code{0} in the
134210d565efSmrgnormal case, but may be a different value when reading an object file
134310d565efSmrgin an archive file.
134410d565efSmrg
134510d565efSmrg@var{segment_name} is only used with the Mach-O file format used on
134610d565efSmrgDarwin aka Mac OS X.  It is required on that platform, and means to
134710d565efSmrgonly look at sections within the segment with that name.  The
134810d565efSmrgparameter is ignored on other systems.
134910d565efSmrg
135010d565efSmrgIf an error occurs, this functions returns @code{NULL} and sets
135110d565efSmrg@code{*@var{errmsg}} to an error string and sets @code{*@var{err}} to
135210d565efSmrgan errno value or @code{0} if there is no relevant errno.
135310d565efSmrg
135410d565efSmrg@end deftypefn
135510d565efSmrg
135610d565efSmrg@c simple-object.txh:107
135710d565efSmrg@deftypefn Extension {void} simple_object_release_attributes @
135810d565efSmrg  (simple_object_attributes *@var{attrs})
135910d565efSmrg
136010d565efSmrgRelease all resources associated with @var{attrs}.
136110d565efSmrg
136210d565efSmrg@end deftypefn
136310d565efSmrg
136410d565efSmrg@c simple-object.txh:73
136510d565efSmrg@deftypefn Extension {void} simple_object_release_read @
136610d565efSmrg  (simple_object_read *@var{simple_object})
136710d565efSmrg
136810d565efSmrgRelease all resources associated with @var{simple_object}.  This does
136910d565efSmrgnot close the file descriptor.
137010d565efSmrg
137110d565efSmrg@end deftypefn
137210d565efSmrg
137310d565efSmrg@c simple-object.txh:184
137410d565efSmrg@deftypefn Extension {void} simple_object_release_write @
137510d565efSmrg  (simple_object_write *@var{simple_object})
137610d565efSmrg
137710d565efSmrgRelease all resources associated with @var{simple_object}.
137810d565efSmrg
137910d565efSmrg@end deftypefn
138010d565efSmrg
138110d565efSmrg@c simple-object.txh:114
138210d565efSmrg@deftypefn Extension {simple_object_write *} simple_object_start_write @
138310d565efSmrg  (simple_object_attributes @var{attrs}, const char *@var{segment_name}, @
138410d565efSmrg  const char **@var{errmsg}, int *@var{err})
138510d565efSmrg
138610d565efSmrgStart creating a new object file using the object file format
138710d565efSmrgdescribed in @var{attrs}.  You must fetch attribute information from
138810d565efSmrgan existing object file before you can create a new one.  There is
138910d565efSmrgcurrently no support for creating an object file de novo.
139010d565efSmrg
139110d565efSmrg@var{segment_name} is only used with Mach-O as found on Darwin aka Mac
139210d565efSmrgOS X.  The parameter is required on that target.  It means that all
139310d565efSmrgsections are created within the named segment.  It is ignored for
139410d565efSmrgother object file formats.
139510d565efSmrg
139610d565efSmrgOn error @code{simple_object_start_write} returns @code{NULL}, sets
139710d565efSmrg@code{*@var{ERRMSG}} to an error message, and sets @code{*@var{err}}
139810d565efSmrgto an errno value or @code{0} if there is no relevant errno.
139910d565efSmrg
140010d565efSmrg@end deftypefn
140110d565efSmrg
140210d565efSmrg@c simple-object.txh:153
140310d565efSmrg@deftypefn Extension {const char *} simple_object_write_add_data @
140410d565efSmrg  (simple_object_write *@var{simple_object}, @
140510d565efSmrg  simple_object_write_section *@var{section}, const void *@var{buffer}, @
140610d565efSmrg  size_t @var{size}, int @var{copy}, int *@var{err})
140710d565efSmrg
140810d565efSmrgAdd data @var{buffer}/@var{size} to @var{section} in
140910d565efSmrg@var{simple_object}.  If @var{copy} is non-zero, the data will be
141010d565efSmrgcopied into memory if necessary.  If @var{copy} is zero, @var{buffer}
141110d565efSmrgmust persist until @code{simple_object_write_to_file} is called.  is
141210d565efSmrgreleased.
141310d565efSmrg
141410d565efSmrgOn success this returns @code{NULL}.  On error this returns an error
141510d565efSmrgmessage, and sets @code{*@var{err}} to an errno value or 0 if there is
141610d565efSmrgno relevant erro.
141710d565efSmrg
141810d565efSmrg@end deftypefn
141910d565efSmrg
142010d565efSmrg@c simple-object.txh:134
142110d565efSmrg@deftypefn Extension {simple_object_write_section *} simple_object_write_create_section @
142210d565efSmrg  (simple_object_write *@var{simple_object}, const char *@var{name}, @
142310d565efSmrg  unsigned int @var{align}, const char **@var{errmsg}, int *@var{err})
142410d565efSmrg
142510d565efSmrgAdd a section to @var{simple_object}.  @var{name} is the name of the
142610d565efSmrgnew section.  @var{align} is the required alignment expressed as the
142710d565efSmrgnumber of required low-order 0 bits (e.g., 2 for alignment to a 32-bit
142810d565efSmrgboundary).
142910d565efSmrg
143010d565efSmrgThe section is created as containing data, readable, not writable, not
143110d565efSmrgexecutable, not loaded at runtime.  The section is not written to the
143210d565efSmrgfile until @code{simple_object_write_to_file} is called.
143310d565efSmrg
143410d565efSmrgOn error this returns @code{NULL}, sets @code{*@var{errmsg}} to an
143510d565efSmrgerror message, and sets @code{*@var{err}} to an errno value or
143610d565efSmrg@code{0} if there is no relevant errno.
143710d565efSmrg
143810d565efSmrg@end deftypefn
143910d565efSmrg
144010d565efSmrg@c simple-object.txh:170
144110d565efSmrg@deftypefn Extension {const char *} simple_object_write_to_file @
144210d565efSmrg  (simple_object_write *@var{simple_object}, int @var{descriptor}, int *@var{err})
144310d565efSmrg
144410d565efSmrgWrite the complete object file to @var{descriptor}, an open file
144510d565efSmrgdescriptor.  This writes out all the data accumulated by calls to
144610d565efSmrg@code{simple_object_write_create_section} and
144710d565efSmrg@var{simple_object_write_add_data}.
144810d565efSmrg
144910d565efSmrgThis returns @code{NULL} on success.  On error this returns an error
145010d565efSmrgmessage and sets @code{*@var{err}} to an errno value or @code{0} if
145110d565efSmrgthere is no relevant errno.
145210d565efSmrg
145310d565efSmrg@end deftypefn
145410d565efSmrg
145510d565efSmrg@c snprintf.c:28
145610d565efSmrg@deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, @
145710d565efSmrg  const char *@var{format}, ...)
145810d565efSmrg
145910d565efSmrgThis function is similar to @code{sprintf}, but it will write to
146010d565efSmrg@var{buf} at most @code{@var{n}-1} bytes of text, followed by a
146110d565efSmrgterminating null byte, for a total of @var{n} bytes.
146210d565efSmrgOn error the return value is -1, otherwise it returns the number of
146310d565efSmrgbytes, not including the terminating null byte, that would have been
146410d565efSmrgwritten had @var{n} been sufficiently large, regardless of the actual
146510d565efSmrgvalue of @var{n}.  Note some pre-C99 system libraries do not implement
146610d565efSmrgthis correctly so users cannot generally rely on the return value if
146710d565efSmrgthe system version of this function is used.
146810d565efSmrg
146910d565efSmrg@end deftypefn
147010d565efSmrg
147110d565efSmrg@c spaces.c:22
147210d565efSmrg@deftypefn Extension char* spaces (int @var{count})
147310d565efSmrg
147410d565efSmrgReturns a pointer to a memory region filled with the specified
147510d565efSmrgnumber of spaces and null terminated.  The returned pointer is
147610d565efSmrgvalid until at least the next call.
147710d565efSmrg
147810d565efSmrg@end deftypefn
147910d565efSmrg
1480*0fc04c29Smrg@c splay-tree.c:305
148110d565efSmrg@deftypefn Supplemental splay_tree splay_tree_new_with_typed_alloc @
148210d565efSmrg(splay_tree_compare_fn @var{compare_fn}, @
148310d565efSmrgsplay_tree_delete_key_fn @var{delete_key_fn}, @
148410d565efSmrgsplay_tree_delete_value_fn @var{delete_value_fn}, @
148510d565efSmrgsplay_tree_allocate_fn @var{tree_allocate_fn}, @
148610d565efSmrgsplay_tree_allocate_fn @var{node_allocate_fn}, @
148710d565efSmrgsplay_tree_deallocate_fn @var{deallocate_fn}, @
148810d565efSmrgvoid * @var{allocate_data})
148910d565efSmrg
149010d565efSmrgThis function creates a splay tree that uses two different allocators
149110d565efSmrg@var{tree_allocate_fn} and @var{node_allocate_fn} to use for allocating the
149210d565efSmrgtree itself and its nodes respectively.  This is useful when variables of
149310d565efSmrgdifferent types need to be allocated with different allocators.
149410d565efSmrg
149510d565efSmrgThe splay tree will use @var{compare_fn} to compare nodes,
149610d565efSmrg@var{delete_key_fn} to deallocate keys, and @var{delete_value_fn} to
1497*0fc04c29Smrgdeallocate values.  Keys and values will be deallocated when the
1498*0fc04c29Smrgtree is deleted using splay_tree_delete or when a node is removed
1499*0fc04c29Smrgusing splay_tree_remove.  splay_tree_insert will release the previously
1500*0fc04c29Smrginserted key and value using @var{delete_key_fn} and @var{delete_value_fn}
1501*0fc04c29Smrgif the inserted key is already found in the tree.
150210d565efSmrg
150310d565efSmrg@end deftypefn
150410d565efSmrg
150510d565efSmrg@c stack-limit.c:28
150610d565efSmrg@deftypefn Extension void stack_limit_increase (unsigned long @var{pref})
150710d565efSmrg
150810d565efSmrgAttempt to increase stack size limit to @var{pref} bytes if possible.
150910d565efSmrg
151010d565efSmrg@end deftypefn
151110d565efSmrg
151210d565efSmrg@c stpcpy.c:23
151310d565efSmrg@deftypefn Supplemental char* stpcpy (char *@var{dst}, const char *@var{src})
151410d565efSmrg
151510d565efSmrgCopies the string @var{src} into @var{dst}.  Returns a pointer to
151610d565efSmrg@var{dst} + strlen(@var{src}).
151710d565efSmrg
151810d565efSmrg@end deftypefn
151910d565efSmrg
152010d565efSmrg@c stpncpy.c:23
152110d565efSmrg@deftypefn Supplemental char* stpncpy (char *@var{dst}, const char *@var{src}, @
152210d565efSmrg  size_t @var{len})
152310d565efSmrg
152410d565efSmrgCopies the string @var{src} into @var{dst}, copying exactly @var{len}
152510d565efSmrgand padding with zeros if necessary.  If @var{len} < strlen(@var{src})
152610d565efSmrgthen return @var{dst} + @var{len}, otherwise returns @var{dst} +
152710d565efSmrgstrlen(@var{src}).
152810d565efSmrg
152910d565efSmrg@end deftypefn
153010d565efSmrg
153110d565efSmrg@c strcasecmp.c:15
153210d565efSmrg@deftypefn Supplemental int strcasecmp (const char *@var{s1}, const char *@var{s2})
153310d565efSmrg
153410d565efSmrgA case-insensitive @code{strcmp}.
153510d565efSmrg
153610d565efSmrg@end deftypefn
153710d565efSmrg
153810d565efSmrg@c strchr.c:6
153910d565efSmrg@deftypefn Supplemental char* strchr (const char *@var{s}, int @var{c})
154010d565efSmrg
154110d565efSmrgReturns a pointer to the first occurrence of the character @var{c} in
154210d565efSmrgthe string @var{s}, or @code{NULL} if not found.  If @var{c} is itself the
154310d565efSmrgnull character, the results are undefined.
154410d565efSmrg
154510d565efSmrg@end deftypefn
154610d565efSmrg
154710d565efSmrg@c strdup.c:3
154810d565efSmrg@deftypefn Supplemental char* strdup (const char *@var{s})
154910d565efSmrg
155010d565efSmrgReturns a pointer to a copy of @var{s} in memory obtained from
155110d565efSmrg@code{malloc}, or @code{NULL} if insufficient memory was available.
155210d565efSmrg
155310d565efSmrg@end deftypefn
155410d565efSmrg
1555*0fc04c29Smrg@c strerror.c:675
155610d565efSmrg@deftypefn Replacement {const char*} strerrno (int @var{errnum})
155710d565efSmrg
155810d565efSmrgGiven an error number returned from a system call (typically returned
155910d565efSmrgin @code{errno}), returns a pointer to a string containing the
156010d565efSmrgsymbolic name of that error number, as found in @code{<errno.h>}.
156110d565efSmrg
156210d565efSmrgIf the supplied error number is within the valid range of indices for
156310d565efSmrgsymbolic names, but no name is available for the particular error
156410d565efSmrgnumber, then returns the string @samp{Error @var{num}}, where @var{num}
156510d565efSmrgis the error number.
156610d565efSmrg
156710d565efSmrgIf the supplied error number is not within the range of valid
156810d565efSmrgindices, then returns @code{NULL}.
156910d565efSmrg
157010d565efSmrgThe contents of the location pointed to are only guaranteed to be
157110d565efSmrgvalid until the next call to @code{strerrno}.
157210d565efSmrg
157310d565efSmrg@end deftypefn
157410d565efSmrg
1575*0fc04c29Smrg@c strerror.c:608
157610d565efSmrg@deftypefn Supplemental char* strerror (int @var{errnoval})
157710d565efSmrg
157810d565efSmrgMaps an @code{errno} number to an error message string, the contents
157910d565efSmrgof which are implementation defined.  On systems which have the
158010d565efSmrgexternal variables @code{sys_nerr} and @code{sys_errlist}, these
158110d565efSmrgstrings will be the same as the ones used by @code{perror}.
158210d565efSmrg
158310d565efSmrgIf the supplied error number is within the valid range of indices for
158410d565efSmrgthe @code{sys_errlist}, but no message is available for the particular
158510d565efSmrgerror number, then returns the string @samp{Error @var{num}}, where
158610d565efSmrg@var{num} is the error number.
158710d565efSmrg
158810d565efSmrgIf the supplied error number is not a valid index into
158910d565efSmrg@code{sys_errlist}, returns @code{NULL}.
159010d565efSmrg
159110d565efSmrgThe returned string is only guaranteed to be valid only until the
159210d565efSmrgnext call to @code{strerror}.
159310d565efSmrg
159410d565efSmrg@end deftypefn
159510d565efSmrg
159610d565efSmrg@c strncasecmp.c:15
159710d565efSmrg@deftypefn Supplemental int strncasecmp (const char *@var{s1}, const char *@var{s2})
159810d565efSmrg
159910d565efSmrgA case-insensitive @code{strncmp}.
160010d565efSmrg
160110d565efSmrg@end deftypefn
160210d565efSmrg
160310d565efSmrg@c strncmp.c:6
160410d565efSmrg@deftypefn Supplemental int strncmp (const char *@var{s1}, @
160510d565efSmrg  const char *@var{s2}, size_t @var{n})
160610d565efSmrg
160710d565efSmrgCompares the first @var{n} bytes of two strings, returning a value as
160810d565efSmrg@code{strcmp}.
160910d565efSmrg
161010d565efSmrg@end deftypefn
161110d565efSmrg
161210d565efSmrg@c strndup.c:23
161310d565efSmrg@deftypefn Extension char* strndup (const char *@var{s}, size_t @var{n})
161410d565efSmrg
161510d565efSmrgReturns a pointer to a copy of @var{s} with at most @var{n} characters
161610d565efSmrgin memory obtained from @code{malloc}, or @code{NULL} if insufficient
161710d565efSmrgmemory was available.  The result is always NUL terminated.
161810d565efSmrg
161910d565efSmrg@end deftypefn
162010d565efSmrg
162110d565efSmrg@c strnlen.c:6
162210d565efSmrg@deftypefn Supplemental size_t strnlen (const char *@var{s}, size_t @var{maxlen})
162310d565efSmrg
162410d565efSmrgReturns the length of @var{s}, as with @code{strlen}, but never looks
162510d565efSmrgpast the first @var{maxlen} characters in the string.  If there is no
162610d565efSmrg'\0' character in the first @var{maxlen} characters, returns
162710d565efSmrg@var{maxlen}.
162810d565efSmrg
162910d565efSmrg@end deftypefn
163010d565efSmrg
163110d565efSmrg@c strrchr.c:6
163210d565efSmrg@deftypefn Supplemental char* strrchr (const char *@var{s}, int @var{c})
163310d565efSmrg
163410d565efSmrgReturns a pointer to the last occurrence of the character @var{c} in
163510d565efSmrgthe string @var{s}, or @code{NULL} if not found.  If @var{c} is itself the
163610d565efSmrgnull character, the results are undefined.
163710d565efSmrg
163810d565efSmrg@end deftypefn
163910d565efSmrg
164010d565efSmrg@c strsignal.c:383
164110d565efSmrg@deftypefn Supplemental {const char *} strsignal (int @var{signo})
164210d565efSmrg
164310d565efSmrgMaps an signal number to an signal message string, the contents of
164410d565efSmrgwhich are implementation defined.  On systems which have the external
164510d565efSmrgvariable @code{sys_siglist}, these strings will be the same as the
164610d565efSmrgones used by @code{psignal()}.
164710d565efSmrg
164810d565efSmrgIf the supplied signal number is within the valid range of indices for
164910d565efSmrgthe @code{sys_siglist}, but no message is available for the particular
165010d565efSmrgsignal number, then returns the string @samp{Signal @var{num}}, where
165110d565efSmrg@var{num} is the signal number.
165210d565efSmrg
165310d565efSmrgIf the supplied signal number is not a valid index into
165410d565efSmrg@code{sys_siglist}, returns @code{NULL}.
165510d565efSmrg
165610d565efSmrgThe returned string is only guaranteed to be valid only until the next
165710d565efSmrgcall to @code{strsignal}.
165810d565efSmrg
165910d565efSmrg@end deftypefn
166010d565efSmrg
166110d565efSmrg@c strsignal.c:448
166210d565efSmrg@deftypefn Extension {const char*} strsigno (int @var{signo})
166310d565efSmrg
166410d565efSmrgGiven an signal number, returns a pointer to a string containing the
166510d565efSmrgsymbolic name of that signal number, as found in @code{<signal.h>}.
166610d565efSmrg
166710d565efSmrgIf the supplied signal number is within the valid range of indices for
166810d565efSmrgsymbolic names, but no name is available for the particular signal
166910d565efSmrgnumber, then returns the string @samp{Signal @var{num}}, where
167010d565efSmrg@var{num} is the signal number.
167110d565efSmrg
167210d565efSmrgIf the supplied signal number is not within the range of valid
167310d565efSmrgindices, then returns @code{NULL}.
167410d565efSmrg
167510d565efSmrgThe contents of the location pointed to are only guaranteed to be
167610d565efSmrgvalid until the next call to @code{strsigno}.
167710d565efSmrg
167810d565efSmrg@end deftypefn
167910d565efSmrg
168010d565efSmrg@c strstr.c:6
168110d565efSmrg@deftypefn Supplemental char* strstr (const char *@var{string}, const char *@var{sub})
168210d565efSmrg
168310d565efSmrgThis function searches for the substring @var{sub} in the string
168410d565efSmrg@var{string}, not including the terminating null characters.  A pointer
168510d565efSmrgto the first occurrence of @var{sub} is returned, or @code{NULL} if the
168610d565efSmrgsubstring is absent.  If @var{sub} points to a string with zero
168710d565efSmrglength, the function returns @var{string}.
168810d565efSmrg
168910d565efSmrg@end deftypefn
169010d565efSmrg
169110d565efSmrg@c strtod.c:27
169210d565efSmrg@deftypefn Supplemental double strtod (const char *@var{string}, @
169310d565efSmrg  char **@var{endptr})
169410d565efSmrg
169510d565efSmrgThis ISO C function converts the initial portion of @var{string} to a
169610d565efSmrg@code{double}.  If @var{endptr} is not @code{NULL}, a pointer to the
169710d565efSmrgcharacter after the last character used in the conversion is stored in
169810d565efSmrgthe location referenced by @var{endptr}.  If no conversion is
169910d565efSmrgperformed, zero is returned and the value of @var{string} is stored in
170010d565efSmrgthe location referenced by @var{endptr}.
170110d565efSmrg
170210d565efSmrg@end deftypefn
170310d565efSmrg
1704*0fc04c29Smrg@c strerror.c:734
170510d565efSmrg@deftypefn Extension int strtoerrno (const char *@var{name})
170610d565efSmrg
170710d565efSmrgGiven the symbolic name of a error number (e.g., @code{EACCES}), map it
170810d565efSmrgto an errno value.  If no translation is found, returns 0.
170910d565efSmrg
171010d565efSmrg@end deftypefn
171110d565efSmrg
171210d565efSmrg@c strtol.c:33
171310d565efSmrg@deftypefn Supplemental {long int} strtol (const char *@var{string}, @
171410d565efSmrg  char **@var{endptr}, int @var{base})
171510d565efSmrg@deftypefnx Supplemental {unsigned long int} strtoul (const char *@var{string}, @
171610d565efSmrg  char **@var{endptr}, int @var{base})
171710d565efSmrg
171810d565efSmrgThe @code{strtol} function converts the string in @var{string} to a
171910d565efSmrglong integer value according to the given @var{base}, which must be
172010d565efSmrgbetween 2 and 36 inclusive, or be the special value 0.  If @var{base}
172110d565efSmrgis 0, @code{strtol} will look for the prefixes @code{0} and @code{0x}
172210d565efSmrgto indicate bases 8 and 16, respectively, else default to base 10.
172310d565efSmrgWhen the base is 16 (either explicitly or implicitly), a prefix of
172410d565efSmrg@code{0x} is allowed.  The handling of @var{endptr} is as that of
172510d565efSmrg@code{strtod} above.  The @code{strtoul} function is the same, except
172610d565efSmrgthat the converted value is unsigned.
172710d565efSmrg
172810d565efSmrg@end deftypefn
172910d565efSmrg
173010d565efSmrg@c strtoll.c:33
173110d565efSmrg@deftypefn Supplemental {long long int} strtoll (const char *@var{string}, @
173210d565efSmrg  char **@var{endptr}, int @var{base})
173310d565efSmrg@deftypefnx Supplemental {unsigned long long int} strtoul (@
173410d565efSmrg  const char *@var{string}, char **@var{endptr}, int @var{base})
173510d565efSmrg
173610d565efSmrgThe @code{strtoll} function converts the string in @var{string} to a
173710d565efSmrglong long integer value according to the given @var{base}, which must be
173810d565efSmrgbetween 2 and 36 inclusive, or be the special value 0.  If @var{base}
173910d565efSmrgis 0, @code{strtoll} will look for the prefixes @code{0} and @code{0x}
174010d565efSmrgto indicate bases 8 and 16, respectively, else default to base 10.
174110d565efSmrgWhen the base is 16 (either explicitly or implicitly), a prefix of
174210d565efSmrg@code{0x} is allowed.  The handling of @var{endptr} is as that of
174310d565efSmrg@code{strtod} above.  The @code{strtoull} function is the same, except
174410d565efSmrgthat the converted value is unsigned.
174510d565efSmrg
174610d565efSmrg@end deftypefn
174710d565efSmrg
174810d565efSmrg@c strsignal.c:502
174910d565efSmrg@deftypefn Extension int strtosigno (const char *@var{name})
175010d565efSmrg
175110d565efSmrgGiven the symbolic name of a signal, map it to a signal number.  If no
175210d565efSmrgtranslation is found, returns 0.
175310d565efSmrg
175410d565efSmrg@end deftypefn
175510d565efSmrg
175610d565efSmrg@c strverscmp.c:25
175710d565efSmrg@deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2})
175810d565efSmrgThe @code{strverscmp} function compares the string @var{s1} against
175910d565efSmrg@var{s2}, considering them as holding indices/version numbers.  Return
176010d565efSmrgvalue follows the same conventions as found in the @code{strverscmp}
176110d565efSmrgfunction.  In fact, if @var{s1} and @var{s2} contain no digits,
176210d565efSmrg@code{strverscmp} behaves like @code{strcmp}.
176310d565efSmrg
176410d565efSmrgBasically, we compare strings normally (character by character), until
176510d565efSmrgwe find a digit in each string - then we enter a special comparison
176610d565efSmrgmode, where each sequence of digits is taken as a whole.  If we reach the
176710d565efSmrgend of these two parts without noticing a difference, we return to the
176810d565efSmrgstandard comparison mode.  There are two types of numeric parts:
176910d565efSmrg"integral" and "fractional" (those  begin with a '0'). The types
177010d565efSmrgof the numeric parts affect the way we sort them:
177110d565efSmrg
177210d565efSmrg@itemize @bullet
177310d565efSmrg@item
177410d565efSmrgintegral/integral: we compare values as you would expect.
177510d565efSmrg
177610d565efSmrg@item
177710d565efSmrgfractional/integral: the fractional part is less than the integral one.
177810d565efSmrgAgain, no surprise.
177910d565efSmrg
178010d565efSmrg@item
178110d565efSmrgfractional/fractional: the things become a bit more complex.
178210d565efSmrgIf the common prefix contains only leading zeroes, the longest part is less
178310d565efSmrgthan the other one; else the comparison behaves normally.
178410d565efSmrg@end itemize
178510d565efSmrg
178610d565efSmrg@smallexample
178710d565efSmrgstrverscmp ("no digit", "no digit")
178810d565efSmrg    @result{} 0    // @r{same behavior as strcmp.}
178910d565efSmrgstrverscmp ("item#99", "item#100")
179010d565efSmrg    @result{} <0   // @r{same prefix, but 99 < 100.}
179110d565efSmrgstrverscmp ("alpha1", "alpha001")
179210d565efSmrg    @result{} >0   // @r{fractional part inferior to integral one.}
179310d565efSmrgstrverscmp ("part1_f012", "part1_f01")
179410d565efSmrg    @result{} >0   // @r{two fractional parts.}
179510d565efSmrgstrverscmp ("foo.009", "foo.0")
179610d565efSmrg    @result{} <0   // @r{idem, but with leading zeroes only.}
179710d565efSmrg@end smallexample
179810d565efSmrg
179910d565efSmrgThis function is especially useful when dealing with filename sorting,
180010d565efSmrgbecause filenames frequently hold indices/version numbers.
180110d565efSmrg@end deftypefun
180210d565efSmrg
180310d565efSmrg@c timeval-utils.c:43
180410d565efSmrg@deftypefn Extension void timeval_add (struct timeval *@var{a}, @
180510d565efSmrg  struct timeval *@var{b}, struct timeval *@var{result})
180610d565efSmrg
180710d565efSmrgAdds @var{a} to @var{b} and stores the result in @var{result}.
180810d565efSmrg
180910d565efSmrg@end deftypefn
181010d565efSmrg
181110d565efSmrg@c timeval-utils.c:67
181210d565efSmrg@deftypefn Extension void timeval_sub (struct timeval *@var{a}, @
181310d565efSmrg  struct timeval *@var{b}, struct timeval *@var{result})
181410d565efSmrg
181510d565efSmrgSubtracts @var{b} from @var{a} and stores the result in @var{result}.
181610d565efSmrg
181710d565efSmrg@end deftypefn
181810d565efSmrg
181910d565efSmrg@c tmpnam.c:3
182010d565efSmrg@deftypefn Supplemental char* tmpnam (char *@var{s})
182110d565efSmrg
182210d565efSmrgThis function attempts to create a name for a temporary file, which
182310d565efSmrgwill be a valid file name yet not exist when @code{tmpnam} checks for
182410d565efSmrgit.  @var{s} must point to a buffer of at least @code{L_tmpnam} bytes,
182510d565efSmrgor be @code{NULL}.  Use of this function creates a security risk, and it must
182610d565efSmrgnot be used in new projects.  Use @code{mkstemp} instead.
182710d565efSmrg
182810d565efSmrg@end deftypefn
182910d565efSmrg
183010d565efSmrg@c unlink-if-ordinary.c:27
183110d565efSmrg@deftypefn Supplemental int unlink_if_ordinary (const char*)
183210d565efSmrg
183310d565efSmrgUnlinks the named file, unless it is special (e.g. a device file).
183410d565efSmrgReturns 0 when the file was unlinked, a negative value (and errno set) when
183510d565efSmrgthere was an error deleting the file, and a positive value if no attempt
183610d565efSmrgwas made to unlink the file because it is special.
183710d565efSmrg
183810d565efSmrg@end deftypefn
183910d565efSmrg
184010d565efSmrg@c fopen_unlocked.c:31
184110d565efSmrg@deftypefn Extension void unlock_std_streams (void)
184210d565efSmrg
184310d565efSmrgIf the OS supports it, ensure that the standard I/O streams,
184410d565efSmrg@code{stdin}, @code{stdout} and @code{stderr} are setup to avoid any
184510d565efSmrgmulti-threaded locking.  Otherwise do nothing.
184610d565efSmrg
184710d565efSmrg@end deftypefn
184810d565efSmrg
184910d565efSmrg@c fopen_unlocked.c:23
185010d565efSmrg@deftypefn Extension void unlock_stream (FILE * @var{stream})
185110d565efSmrg
185210d565efSmrgIf the OS supports it, ensure that the supplied stream is setup to
185310d565efSmrgavoid any multi-threaded locking.  Otherwise leave the @code{FILE}
185410d565efSmrgpointer unchanged.  If the @var{stream} is @code{NULL} do nothing.
185510d565efSmrg
185610d565efSmrg@end deftypefn
185710d565efSmrg
185810d565efSmrg@c vasprintf.c:47
185910d565efSmrg@deftypefn Extension int vasprintf (char **@var{resptr}, @
186010d565efSmrg  const char *@var{format}, va_list @var{args})
186110d565efSmrg
186210d565efSmrgLike @code{vsprintf}, but instead of passing a pointer to a buffer,
186310d565efSmrgyou pass a pointer to a pointer.  This function will compute the size
186410d565efSmrgof the buffer needed, allocate memory with @code{malloc}, and store a
186510d565efSmrgpointer to the allocated memory in @code{*@var{resptr}}.  The value
186610d565efSmrgreturned is the same as @code{vsprintf} would return.  If memory could
186710d565efSmrgnot be allocated, minus one is returned and @code{NULL} is stored in
186810d565efSmrg@code{*@var{resptr}}.
186910d565efSmrg
187010d565efSmrg@end deftypefn
187110d565efSmrg
187210d565efSmrg@c vfork.c:6
187310d565efSmrg@deftypefn Supplemental int vfork (void)
187410d565efSmrg
187510d565efSmrgEmulates @code{vfork} by calling @code{fork} and returning its value.
187610d565efSmrg
187710d565efSmrg@end deftypefn
187810d565efSmrg
187910d565efSmrg@c vprintf.c:3
188010d565efSmrg@deftypefn Supplemental int vprintf (const char *@var{format}, va_list @var{ap})
188110d565efSmrg@deftypefnx Supplemental int vfprintf (FILE *@var{stream}, @
188210d565efSmrg  const char *@var{format}, va_list @var{ap})
188310d565efSmrg@deftypefnx Supplemental int vsprintf (char *@var{str}, @
188410d565efSmrg  const char *@var{format}, va_list @var{ap})
188510d565efSmrg
188610d565efSmrgThese functions are the same as @code{printf}, @code{fprintf}, and
188710d565efSmrg@code{sprintf}, respectively, except that they are called with a
188810d565efSmrg@code{va_list} instead of a variable number of arguments.  Note that
188910d565efSmrgthey do not call @code{va_end}; this is the application's
189010d565efSmrgresponsibility.  In @libib{} they are implemented in terms of the
189110d565efSmrgnonstandard but common function @code{_doprnt}.
189210d565efSmrg
189310d565efSmrg@end deftypefn
189410d565efSmrg
189510d565efSmrg@c vsnprintf.c:28
189610d565efSmrg@deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, @
189710d565efSmrg  const char *@var{format}, va_list @var{ap})
189810d565efSmrg
189910d565efSmrgThis function is similar to @code{vsprintf}, but it will write to
190010d565efSmrg@var{buf} at most @code{@var{n}-1} bytes of text, followed by a
190110d565efSmrgterminating null byte, for a total of @var{n} bytes.  On error the
190210d565efSmrgreturn value is -1, otherwise it returns the number of characters that
190310d565efSmrgwould have been printed had @var{n} been sufficiently large,
190410d565efSmrgregardless of the actual value of @var{n}.  Note some pre-C99 system
190510d565efSmrglibraries do not implement this correctly so users cannot generally
190610d565efSmrgrely on the return value if the system version of this function is
190710d565efSmrgused.
190810d565efSmrg
190910d565efSmrg@end deftypefn
191010d565efSmrg
191110d565efSmrg@c waitpid.c:3
191210d565efSmrg@deftypefn Supplemental int waitpid (int @var{pid}, int *@var{status}, int)
191310d565efSmrg
191410d565efSmrgThis is a wrapper around the @code{wait} function.  Any ``special''
191510d565efSmrgvalues of @var{pid} depend on your implementation of @code{wait}, as
191610d565efSmrgdoes the return value.  The third argument is unused in @libib{}.
191710d565efSmrg
191810d565efSmrg@end deftypefn
191910d565efSmrg
1920*0fc04c29Smrg@c argv.c:289
192110d565efSmrg@deftypefn Extension int writeargv (char * const *@var{argv}, FILE *@var{file})
192210d565efSmrg
192310d565efSmrgWrite each member of ARGV, handling all necessary quoting, to the file
192410d565efSmrgnamed by FILE, separated by whitespace.  Return 0 on success, non-zero
192510d565efSmrgif an error occurred while writing to FILE.
192610d565efSmrg
192710d565efSmrg@end deftypefn
192810d565efSmrg
192910d565efSmrg@c xasprintf.c:31
193010d565efSmrg@deftypefn Replacement char* xasprintf (const char *@var{format}, ...)
193110d565efSmrg
193210d565efSmrgPrint to allocated string without fail.  If @code{xasprintf} fails,
193310d565efSmrgthis will print a message to @code{stderr} (using the name set by
193410d565efSmrg@code{xmalloc_set_program_name}, if any) and then call @code{xexit}.
193510d565efSmrg
193610d565efSmrg@end deftypefn
193710d565efSmrg
193810d565efSmrg@c xatexit.c:11
193910d565efSmrg@deftypefun int xatexit (void (*@var{fn}) (void))
194010d565efSmrg
194110d565efSmrgBehaves as the standard @code{atexit} function, but with no limit on
194210d565efSmrgthe number of registered functions.  Returns 0 on success, or @minus{}1 on
194310d565efSmrgfailure.  If you use @code{xatexit} to register functions, you must use
194410d565efSmrg@code{xexit} to terminate your program.
194510d565efSmrg
194610d565efSmrg@end deftypefun
194710d565efSmrg
194810d565efSmrg@c xmalloc.c:38
194910d565efSmrg@deftypefn Replacement void* xcalloc (size_t @var{nelem}, size_t @var{elsize})
195010d565efSmrg
195110d565efSmrgAllocate memory without fail, and set it to zero.  This routine functions
195210d565efSmrglike @code{calloc}, but will behave the same as @code{xmalloc} if memory
195310d565efSmrgcannot be found.
195410d565efSmrg
195510d565efSmrg@end deftypefn
195610d565efSmrg
195710d565efSmrg@c xexit.c:22
195810d565efSmrg@deftypefn Replacement void xexit (int @var{code})
195910d565efSmrg
196010d565efSmrgTerminates the program.  If any functions have been registered with
196110d565efSmrgthe @code{xatexit} replacement function, they will be called first.
196210d565efSmrgTermination is handled via the system's normal @code{exit} call.
196310d565efSmrg
196410d565efSmrg@end deftypefn
196510d565efSmrg
196610d565efSmrg@c xmalloc.c:22
196710d565efSmrg@deftypefn Replacement void* xmalloc (size_t)
196810d565efSmrg
196910d565efSmrgAllocate memory without fail.  If @code{malloc} fails, this will print
197010d565efSmrga message to @code{stderr} (using the name set by
197110d565efSmrg@code{xmalloc_set_program_name},
197210d565efSmrgif any) and then call @code{xexit}.  Note that it is therefore safe for
197310d565efSmrga program to contain @code{#define malloc xmalloc} in its source.
197410d565efSmrg
197510d565efSmrg@end deftypefn
197610d565efSmrg
197710d565efSmrg@c xmalloc.c:53
197810d565efSmrg@deftypefn Replacement void xmalloc_failed (size_t)
197910d565efSmrg
198010d565efSmrgThis function is not meant to be called by client code, and is listed
198110d565efSmrghere for completeness only.  If any of the allocation routines fail, this
198210d565efSmrgfunction will be called to print an error message and terminate execution.
198310d565efSmrg
198410d565efSmrg@end deftypefn
198510d565efSmrg
198610d565efSmrg@c xmalloc.c:46
198710d565efSmrg@deftypefn Replacement void xmalloc_set_program_name (const char *@var{name})
198810d565efSmrg
198910d565efSmrgYou can use this to set the name of the program used by
199010d565efSmrg@code{xmalloc_failed} when printing a failure message.
199110d565efSmrg
199210d565efSmrg@end deftypefn
199310d565efSmrg
199410d565efSmrg@c xmemdup.c:7
199510d565efSmrg@deftypefn Replacement void* xmemdup (void *@var{input}, @
199610d565efSmrg  size_t @var{copy_size}, size_t @var{alloc_size})
199710d565efSmrg
199810d565efSmrgDuplicates a region of memory without fail.  First, @var{alloc_size} bytes
199910d565efSmrgare allocated, then @var{copy_size} bytes from @var{input} are copied into
200010d565efSmrgit, and the new memory is returned.  If fewer bytes are copied than were
200110d565efSmrgallocated, the remaining memory is zeroed.
200210d565efSmrg
200310d565efSmrg@end deftypefn
200410d565efSmrg
200510d565efSmrg@c xmalloc.c:32
200610d565efSmrg@deftypefn Replacement void* xrealloc (void *@var{ptr}, size_t @var{size})
200710d565efSmrgReallocate memory without fail.  This routine functions like @code{realloc},
200810d565efSmrgbut will behave the same as @code{xmalloc} if memory cannot be found.
200910d565efSmrg
201010d565efSmrg@end deftypefn
201110d565efSmrg
201210d565efSmrg@c xstrdup.c:7
201310d565efSmrg@deftypefn Replacement char* xstrdup (const char *@var{s})
201410d565efSmrg
201510d565efSmrgDuplicates a character string without fail, using @code{xmalloc} to
201610d565efSmrgobtain memory.
201710d565efSmrg
201810d565efSmrg@end deftypefn
201910d565efSmrg
202010d565efSmrg@c xstrerror.c:7
202110d565efSmrg@deftypefn Replacement char* xstrerror (int @var{errnum})
202210d565efSmrg
202310d565efSmrgBehaves exactly like the standard @code{strerror} function, but
202410d565efSmrgwill never return a @code{NULL} pointer.
202510d565efSmrg
202610d565efSmrg@end deftypefn
202710d565efSmrg
202810d565efSmrg@c xstrndup.c:23
202910d565efSmrg@deftypefn Replacement char* xstrndup (const char *@var{s}, size_t @var{n})
203010d565efSmrg
203110d565efSmrgReturns a pointer to a copy of @var{s} with at most @var{n} characters
203210d565efSmrgwithout fail, using @code{xmalloc} to obtain memory.  The result is
203310d565efSmrgalways NUL terminated.
203410d565efSmrg
203510d565efSmrg@end deftypefn
203610d565efSmrg
203710d565efSmrg@c xvasprintf.c:38
203810d565efSmrg@deftypefn Replacement char* xvasprintf (const char *@var{format}, va_list @var{args})
203910d565efSmrg
204010d565efSmrgPrint to allocated string without fail.  If @code{xvasprintf} fails,
204110d565efSmrgthis will print a message to @code{stderr} (using the name set by
204210d565efSmrg@code{xmalloc_set_program_name}, if any) and then call @code{xexit}.
204310d565efSmrg
204410d565efSmrg@end deftypefn
204510d565efSmrg
204610d565efSmrg
2047