Lines Matching refs:code
12 calls to this function. Memory is allocated using @code{xmalloc} under
16 GNU Autoconf test @code{AC_FUNC_ALLOCA} to test for and properly make
17 available this function. The @code{AC_FUNC_ALLOCA} test requires that
18 client code use a block of preprocessor code to be safe (see the Autoconf
27 Like @code{sprintf}, but instead of passing a pointer to a buffer, you
29 the buffer needed, allocate memory with @code{malloc}, and store a
30 pointer to the allocated memory in @code{*@var{resptr}}. The value
31 returned is the same as @code{sprintf} would return. If memory could
32 not be allocated, minus one is returned and @code{NULL} is stored in
33 @code{*@var{resptr}}.
67 @var{out}. The use of @code{bcopy} is deprecated in new programs.
95 @code{NULL} element.
98 is obtained from @code{xmalloc}. All of the memory can be returned to the
99 system with the single function call @code{freeargv}, which takes the
100 returned result of @code{buildargv}, as it's argument.
103 @code{NULL} if @var{sp} is @code{NULL} or if there is insufficient
106 If the input is a null string (as opposed to a @code{NULL} pointer),
116 is deprecated in favor of @code{memset}.
123 Uses @code{malloc} to allocate storage for @var{nelem} objects of
133 @code{lrealpath()}, so that so that different file names pointing to the same
141 Return a prefix for temporary file names or @code{NULL} if unable to
143 program is exited if a temporary directory can't be found (@code{mktemp}
144 fails). The buffer for the result is obtained with @code{xmalloc}.
163 @code{clock_t}; divide this number by @samp{CLOCKS_PER_SEC} to get the
170 @dots{}, @code{NULL})
173 @code{xmalloc}ed memory. The argument list is terminated by the first
174 @code{NULL} pointer encountered. Pointers to empty strings are ignored.
198 parameter as @code{0xffffffff}.
219 duplicating each argument until the terminating @code{NULL} is found.
221 @code{NULL} if there is insufficient memory to complete building the
229 Returns the maximum @code{errno} value for which a corresponding
231 use the @code{sys_errlist} supplied by the system, it is possible for
233 fact, the manual page for @code{perror(3C)} explicitly warns that one
234 should check the size of the table (@code{sys_nerr}) before indexing
236 added to the table. Thus @code{sys_nerr} might be smaller than value
237 implied by the largest @code{errno} value defined in @code{<errno.h>}.
247 The @var{argcp} and @code{argvp} arguments are pointers to the usual
248 @code{argc} and @code{argv} arguments to @code{main}. This function
255 @code{*argcp} and @code{*argvp} will be updated. If the value of
256 @code{*argvp} is modified by this function, then the new value has
258 @code{freeargv}. However, most callers will simply call
259 @code{expandargv} near the beginning of @code{main} and allow the
271 file (@code{stdout} for example) or from the SVR4 @file{/proc} calls
283 Opens and returns a @code{FILE} pointer via @code{fdopen}. If the
285 any multi-threaded locking. Otherwise return the @code{FILE} pointer
303 If not equivalent, the returned value is similar to what @code{strcmp}
338 If not equivalent, the returned value is similar to what @code{strncmp}
356 matches, @code{FNM_NOMATCH} if not. @var{pattern} may contain the
357 wildcards @code{?} to match any one character, @code{*} to match any
359 brackets, like @samp{[a-gt8]}, which match one character (@code{a}
360 through @code{g}, or @code{t}, or @code{8}, in this example) if that one
362 except what's in the set) by giving @code{^} or @code{!} as the first
370 @code{flags} controls various aspects of the matching process, and is a
372 @code{<fnmatch.h>}):
374 @table @code
379 @code{/}.
386 @code{FNM_PATHNAME} after a slash) is not matched by @code{*} or
387 @code{?} but must be matched explicitly.
391 of @var{string} matches, and is followed by @code{/} and zero or more
406 Opens and returns a @code{FILE} pointer via @code{fopen}. If the
408 any multi-threaded locking. Otherwise return the @code{FILE} pointer
416 Free an argument vector that was built using @code{buildargv}. Simply
418 the terminating @code{NULL} is found, and then frees @var{vector}
427 Opens and returns a @code{FILE} pointer via @code{freopen}. If the
429 any multi-threaded locking. Otherwise return the @code{FILE} pointer
450 @code{NULL} and @code{errno} is set. If @var{pathname} is a null pointer,
451 @code{getcwd} will obtain @var{len} bytes of space using
452 @code{malloc}.
470 result on the assumption that the process will not call @code{chdir}
471 between calls to @code{getpwd}.
488 call to @code{hex_p} or @code{hex_value}. If you fail to call it, a
498 @code{unsigned char} within the macro.
508 @code{unsigned char} within the macro.
510 The @code{hex_value} macro returns @code{unsigned int}, rather than
511 signed @code{int}, to make it easier to use in parsing addresses from
512 hex dump files: a signed @code{int} would be sign-extended when
513 converted to a wider unsigned type --- like @code{bfd_vma}, on some
526 @ftable @code
552 initially empty (all the hash table entries are @code{HTAB_EMPTY_ENTRY}).
553 The function returns the created hash table, or @code{NULL} if memory
562 the string @var{s}, or @code{NULL} if not found. The use of @code{index} is
563 deprecated in new programs in favor of @code{strchr}.
573 @code{insque} routine inserts @var{elem} in the queue immediately
574 after @var{pred}. The @code{remque} routine removes @var{elem} from
606 @code{ISALPHA} returns true for alphabetic characters and false for
612 values representable by @code{signed char} and @code{unsigned char}, and
613 for @code{EOF}.
617 @multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada}
618 @item @code{ALPHA} @tab @kbd{A-Za-z}
619 @item @code{ALNUM} @tab @kbd{A-Za-z0-9}
620 @item @code{BLANK} @tab @kbd{space tab}
621 @item @code{CNTRL} @tab @code{!PRINT}
622 @item @code{DIGIT} @tab @kbd{0-9}
623 @item @code{GRAPH} @tab @code{ALNUM || PUNCT}
624 @item @code{LOWER} @tab @kbd{a-z}
625 @item @code{PRINT} @tab @code{GRAPH ||} @kbd{space}
626 @item @code{PUNCT} @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?}
627 @item @code{SPACE} @tab @kbd{space tab \n \r \f \v}
628 @item @code{UPPER} @tab @kbd{A-Z}
629 @item @code{XDIGIT} @tab @kbd{0-9A-Fa-f}
633 all these macros will return false for all values of @code{char} outside
651 @multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada}
652 @item @code{IDNUM} @tab @kbd{A-Za-z0-9_}
653 @item @code{IDST} @tab @kbd{A-Za-z_}
654 @item @code{VSPACE} @tab @kbd{\r \n}
655 @item @code{NVSPACE} @tab @kbd{space tab \f \v \0}
656 @item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE}
657 @item @code{ISOBASIC} @tab @code{VSPACE || NVSPACE || PRINT}
673 and a path ending in @code{/} returns the empty string after it.
683 @code{malloc}, or @code{NULL} will be returned on a memory allocation error.
699 @code{make_relative_prefix} will search @env{PATH} to find a program
703 For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta},
704 @var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is
705 @code{/red/green/blue/gcc}, then this function will return
706 @code{/red/green/blue/../../omega/}.
708 The return value is normally allocated via @code{malloc}. If no
709 relative prefix can be found, return @code{NULL}.
716 Return a temporary file name (as a string) or @code{NULL} if unable to
718 string is @code{malloc}ed, and the temporary file has been created.
726 This function searches memory starting at @code{*@var{s}} for the
730 found within @var{length} characters of @code{*@var{s}}, a pointer
731 to the character is returned. If @var{c} is not found, then @code{NULL} is
763 Returns @code{NULL} if not found.
816 yet called @code{pex_get_times} or @code{pex_get_status}, this will
828 to @code{pex_run}. Returns 0 on error, 1 on success.
839 order of the calls to @code{pex_run}. Returns 0 on error, 1 on
842 @code{struct pex_time} has the following fields of the type
843 @code{unsigned long}: @code{user_seconds},
844 @code{user_microseconds}, @code{system_seconds},
845 @code{system_microseconds}. On systems which do not support reporting
846 process times, all the fields will be set to @code{0}.
860 @table @code
879 temporary files; it may be @code{NULL} to use a randomly chosen name.
891 @code{pex_run} uses to choose output file names, based on
892 @var{in_name}, @var{obj} and the @code{PEX_SUFFIX} bit in @var{flags}.
894 Don't call @code{fclose} on the returned stream; the first call to
895 @code{pex_run} closes it automatically.
897 If @var{flags} includes @code{PEX_BINARY_OUTPUT}, open the stream in
899 @code{PEX_BINARY_OUTPUT} in @var{flags} has no effect on Unix.
908 You must have passed @code{PEX_USE_PIPES} to the @code{pex_init} call
911 You must close @var{fp} using @code{fclose} yourself when you have
918 @code{NULL}, and sets @code{errno} to @code{EINVAL}. If you would
919 like to write code that is portable to all systems the @code{pex}
920 functions support, consider using @code{pex_input_file} instead.
923 @code{pex_input_pipe}:
931 continue. @code{pex_input_pipe} makes no promises about the
934 @code{pex_input_file} instead.
937 Using @code{pex_input_pipe} and @code{pex_read_output} together
956 for a call to @code{pex_run}. @var{flags} is restricted to a
957 combination of @code{PEX_SEARCH}, @code{PEX_STDERR_TO_STDOUT}, and
958 @code{PEX_BINARY_OUTPUT}. @var{outname} is interpreted as if
959 @code{PEX_LAST} were set. On a successful return, @code{*@var{status}} will
968 Returns a @code{FILE} pointer which may be used to read the standard
970 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After
971 this is called, @code{pex_run} may no longer be called with the same
973 opened in binary mode. Don't call @code{fclose} on the returned file;
974 it will be closed by @code{pex_free}.
982 Returns a @code{FILE} pointer which may be used to read the standard
984 @code{PEX_LAST} should not be used in a call to @code{pex_run}. After
985 this is called, @code{pex_run} may no longer be called with the same
987 opened in binary mode. Don't call @code{fclose} on the returned file;
988 it will be closed by @code{pex_free}.
998 @code{NULL}. On failure it returns an error message, a statically
1001 @var{obj} is returned by a previous call to @code{pex_init}.
1005 @table @code
1012 @code{NULL}, to the standard output of the calling program. Do @emph{not}
1013 set this bit if you want to call @code{pex_read_output}
1014 (described below). After a call to @code{pex_run} with this bit set,
1040 @code{pex_run} using @code{PEX_BINARY_OUTPUT} should be followed by a
1041 call using @code{PEX_BINARY_INPUT}.
1046 cannot be specified together with @code{PEX_STDERR_TO_STDOUT}. This
1052 arguments to pass to the program; normally @code{@var{argv}[0]} will
1060 if @code{PEX_LAST} is not set in @var{flags}, and @code{PEX_USE_PIPES}
1061 was set in the call to @code{pex_init}, and the system supports pipes
1064 if @code{PEX_LAST} is set in @var{flags}, and @var{outname} is
1065 @code{NULL}
1069 Otherwise the code will use a file to hold standard
1070 output. If @code{PEX_LAST} is not set, this file is considered to be
1072 @code{PEX_SAVE_TEMPS} was set in the call to @code{pex_init}.
1079 @code{PEX_SUFFIX} is set in @var{flags}. In this case
1080 @var{outname} may not be @code{NULL}. If the @var{tempbase} parameter
1081 to @code{pex_init} was not @code{NULL}, then the output file name is
1083 @var{tempbase} was @code{NULL}, then the output file name is a random
1087 @code{PEX_SUFFIX} was not set in @var{flags}. In this
1088 case, if @var{outname} is not @code{NULL}, it is used as the output
1089 file name. If @var{outname} is @code{NULL}, and @var{tempbase} was
1096 it is @code{NULL}, standard error is the same as the caller's.
1099 On an error return, the code sets @code{*@var{err}} to an @code{errno}
1100 value, or to 0 if there is no relevant @code{errno}.
1112 as for @code{pex_run}.
1116 form @code{VAR=VALUE}, with the exception of the last element that must be
1117 @code{NULL}.
1145 Uses @code{setenv} or @code{unsetenv} to put @var{string} into
1166 Random number functions. @code{random} returns a random number in the
1167 range 0 to @code{LONG_MAX}. @code{srandom} initializes the random
1169 (else, the values returned by @code{random} are always the same for each
1170 run of the program). @code{initstate} and @code{setstate} allow fine-grained
1177 @dots{}, @code{NULL})
1179 Same as @code{concat}, except that if @var{optr} is not @code{NULL} it
1202 the string @var{s}, or @code{NULL} if not found. The use of @code{rindex} is
1203 deprecated in new programs in favor of @code{strrchr}.
1212 @code{setenv} adds @var{name} to the environment with value
1215 The companion @code{unsetenv} function removes @var{name} from the
1216 environment. This implementation is not safe for multithreaded code.
1233 @code{sys_siglist} supplied by the system, it is possible for there to
1235 manual page for @code{psignal(3b)} explicitly warns that one should
1236 check the size of the table (@code{NSIG}) before indexing it, since
1238 the table. Thus @code{NSIG} might be smaller than value implied by
1239 the largest signo value defined in @code{<signal.h>}.
1251 be the value @code{1}).
1261 together without error, return @code{NULL}. Otherwise, return an
1262 error message and set @code{*@var{err}} to an errno value or @code{0}
1274 @code{simple_object_attributes_release} is called, even if
1277 On error this returns @code{NULL}, sets @code{*@var{errmsg}} to an
1278 error message, and sets @code{*@var{err}} to an errno value or
1279 @code{0} if there is no relevant errno.
1291 If found, return 1 and set @code{*@var{offset}} to the offset in the
1292 file of the section contents and set @code{*@var{length}} to the
1293 length of the section contents. The value in @code{*@var{offset}}
1295 @code{simple_object_open_read}.
1298 @code{simple_object_find_section} returns @code{0} and set
1299 @code{*@var{errmsg}} to @code{NULL}.
1301 If an error occurs, @code{simple_object_find_section} returns
1302 @code{0}, sets @code{*@var{errmsg}} to an error message, and sets
1303 @code{*@var{err}} to an errno value or @code{0} if there is no
1318 @code{simple_object_open_read}. The @var{data} argument to this
1321 If @var{pfn} returns @code{0}, the loop over the sections stops and
1322 @code{simple_object_find_sections} returns. If @var{pfn} returns some
1325 On success @code{simple_object_find_sections} returns. On error it
1326 returns an error string, and sets @code{*@var{err}} to an errno value
1327 or @code{0} if there is no relevant errno.
1337 @code{simple_object_read} pointer which may be passed to other
1342 @var{offset} is the offset into the file; this will be @code{0} in the
1351 If an error occurs, this functions returns @code{NULL} and sets
1352 @code{*@var{errmsg}} to an error string and sets @code{*@var{err}} to
1353 an errno value or @code{0} if there is no relevant errno.
1397 On error @code{simple_object_start_write} returns @code{NULL}, sets
1398 @code{*@var{ERRMSG}} to an error message, and sets @code{*@var{err}}
1399 to an errno value or @code{0} if there is no relevant errno.
1412 must persist until @code{simple_object_write_to_file} is called. is
1415 On success this returns @code{NULL}. On error this returns an error
1416 message, and sets @code{*@var{err}} to an errno value or 0 if there is
1433 file until @code{simple_object_write_to_file} is called.
1435 On error this returns @code{NULL}, sets @code{*@var{errmsg}} to an
1436 error message, and sets @code{*@var{err}} to an errno value or
1437 @code{0} if there is no relevant errno.
1447 @code{simple_object_write_create_section} and
1450 This returns @code{NULL} on success. On error this returns an error
1451 message and sets @code{*@var{err}} to an errno value or @code{0} if
1460 This function is similar to @code{sprintf}, but it will write to
1461 @var{buf} at most @code{@var{n}-1} bytes of text, followed by a
1531 A case-insensitive @code{strcmp}.
1539 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the
1548 @code{malloc}, or @code{NULL} if insufficient memory was available.
1556 in @code{errno}), returns a pointer to a string containing the
1557 symbolic name of that error number, as found in @code{<errno.h>}.
1565 indices, then returns @code{NULL}.
1568 valid until the next call to @code{strerrno}.
1575 Maps an @code{errno} number to an error message string, the contents
1577 external variables @code{sys_nerr} and @code{sys_errlist}, these
1578 strings will be the same as the ones used by @code{perror}.
1581 the @code{sys_errlist}, but no message is available for the particular
1586 @code{sys_errlist}, returns @code{NULL}.
1589 next call to @code{strerror}.
1596 A case-insensitive @code{strncmp}.
1605 @code{strcmp}.
1613 in memory obtained from @code{malloc}, or @code{NULL} if insufficient
1621 Returns the length of @var{s}, as with @code{strlen}, but never looks
1632 the string @var{s}, or @code{NULL} if not found. If @var{c} is itself the
1642 variable @code{sys_siglist}, these strings will be the same as the
1643 ones used by @code{psignal()}.
1646 the @code{sys_siglist}, but no message is available for the particular
1651 @code{sys_siglist}, returns @code{NULL}.
1654 call to @code{strsignal}.
1662 symbolic name of that signal number, as found in @code{<signal.h>}.
1670 indices, then returns @code{NULL}.
1673 valid until the next call to @code{strsigno}.
1682 to the first occurrence of @var{sub} is returned, or @code{NULL} if the
1693 @code{double}. If @var{endptr} is not @code{NULL}, a pointer to the
1704 Given the symbolic name of a error number (e.g., @code{EACCES}), map it
1715 The @code{strtol} function converts the string in @var{string} to a
1718 is 0, @code{strtol} will look for the prefixes @code{0} and @code{0x}
1721 @code{0x} is allowed. The handling of @var{endptr} is as that of
1722 @code{strtod} above. The @code{strtoul} function is the same, except
1733 The @code{strtoll} function converts the string in @var{string} to a
1736 is 0, @code{strtoll} will look for the prefixes @code{0} and @code{0x}
1739 @code{0x} is allowed. The handling of @var{endptr} is as that of
1740 @code{strtod} above. The @code{strtoull} function is the same, except
1755 The @code{strverscmp} function compares the string @var{s1} against
1757 value follows the same conventions as found in the @code{strverscmp}
1759 @code{strverscmp} behaves like @code{strcmp}.
1820 will be a valid file name yet not exist when @code{tmpnam} checks for
1821 it. @var{s} must point to a buffer of at least @code{L_tmpnam} bytes,
1822 or be @code{NULL}. Use of this function creates a security risk, and it must
1823 not be used in new projects. Use @code{mkstemp} instead.
1841 @code{stdin}, @code{stdout} and @code{stderr} are setup to avoid any
1850 avoid any multi-threaded locking. Otherwise leave the @code{FILE}
1851 pointer unchanged. If the @var{stream} is @code{NULL} do nothing.
1859 Like @code{vsprintf}, but instead of passing a pointer to a buffer,
1861 of the buffer needed, allocate memory with @code{malloc}, and store a
1862 pointer to the allocated memory in @code{*@var{resptr}}. The value
1863 returned is the same as @code{vsprintf} would return. If memory could
1864 not be allocated, minus one is returned and @code{NULL} is stored in
1865 @code{*@var{resptr}}.
1872 Emulates @code{vfork} by calling @code{fork} and returning its value.
1883 These functions are the same as @code{printf}, @code{fprintf}, and
1884 @code{sprintf}, respectively, except that they are called with a
1885 @code{va_list} instead of a variable number of arguments. Note that
1886 they do not call @code{va_end}; this is the application's
1888 nonstandard but common function @code{_doprnt}.
1896 This function is similar to @code{vsprintf}, but it will write to
1897 @var{buf} at most @code{@var{n}-1} bytes of text, followed by a
1911 This is a wrapper around the @code{wait} function. Any ``special''
1912 values of @var{pid} depend on your implementation of @code{wait}, as
1929 Behaves as the standard @code{atexit} function, but with no limit on
1931 failure. If you use @code{xatexit} to register functions, you must use
1932 @code{xexit} to terminate your program.
1940 like @code{calloc}, but will behave the same as @code{xmalloc} if memory
1946 @deftypefn Replacement void xexit (int @var{code})
1949 the @code{xatexit} replacement function, they will be called first.
1950 Termination is handled via the system's normal @code{exit} call.
1957 Allocate memory without fail. If @code{malloc} fails, this will print
1958 a message to @code{stderr} (using the name set by
1959 @code{xmalloc_set_program_name},
1960 if any) and then call @code{xexit}. Note that it is therefore safe for
1961 a program to contain @code{#define malloc xmalloc} in its source.
1968 This function is not meant to be called by client code, and is listed
1978 @code{xmalloc_failed} when printing a failure message.
1995 Reallocate memory without fail. This routine functions like @code{realloc},
1996 but will behave the same as @code{xmalloc} if memory cannot be found.
2003 Duplicates a character string without fail, using @code{xmalloc} to
2011 Behaves exactly like the standard @code{strerror} function, but
2012 will never return a @code{NULL} pointer.
2020 without fail, using @code{xmalloc} to obtain memory. The result is