(linenum→info "unix/slp.c:2238")

binutils/2.18/libiberty/functions.texi

    1: @c Automatically generated from *.c and others (the comments before
    2: @c each entry tell you which file and where in that file).  DO NOT EDIT!
    3: @c Edit the *.c files, configure with --enable-maintainer-mode,
    4: @c and let gather-docs build you a new copy.
    5: 
    6: @c safe-ctype.c:25
    7: @defvr Extension HOST_CHARSET
    8: This macro indicates the basic character set and encoding used by the
    9: host: more precisely, the encoding used for character constants in
   10: preprocessor @samp{#if} statements (the C "execution character set").
   11: It is defined by @file{safe-ctype.h}, and will be an integer constant
   12: with one of the following values:
   13: 
   14: @ftable @code
   15: @item HOST_CHARSET_UNKNOWN
   16: The host character set is unknown - that is, not one of the next two
   17: possibilities.
   18: 
   19: @item HOST_CHARSET_ASCII
   20: The host character set is ASCII.
   21: 
   22: @item HOST_CHARSET_EBCDIC
   23: The host character set is some variant of EBCDIC.  (Only one of the
   24: nineteen EBCDIC varying characters is tested; exercise caution.)
   25: @end ftable
   26: @end defvr
   27: 
   28: @c alloca.c:26
   29: @deftypefn Replacement void* alloca (size_t @var{size})
   30: 
   31: This function allocates memory which will be automatically reclaimed
   32: after the procedure exits.  The @libib{} implementation does not free
   33: the memory immediately but will do so eventually during subsequent
   34: calls to this function.  Memory is allocated using @code{xmalloc} under
   35: normal circumstances.
   36: 
   37: The header file @file{alloca-conf.h} can be used in conjunction with the
   38: GNU Autoconf test @code{AC_FUNC_ALLOCA} to test for and properly make
   39: available this function.  The @code{AC_FUNC_ALLOCA} test requires that
   40: client code use a block of preprocessor code to be safe (see the Autoconf
   41: manual for more); this header incorporates that logic and more, including
   42: the possibility of a GCC built-in function.
   43: 
   44: @end deftypefn
   45: 
   46: @c asprintf.c:32
   47: @deftypefn Extension int asprintf (char **@var{resptr}, const char *@var{format}, ...)
   48: 
   49: Like @code{sprintf}, but instead of passing a pointer to a buffer, you
   50: pass a pointer to a pointer.  This function will compute the size of
   51: the buffer needed, allocate memory with @code{malloc}, and store a
   52: pointer to the allocated memory in @code{*@var{resptr}}.  The value
   53: returned is the same as @code{sprintf} would return.  If memory could
   54: not be allocated, minus one is returned and @code{NULL} is stored in
   55: @code{*@var{resptr}}.
   56: 
   57: @end deftypefn
   58: 
   59: @c atexit.c:6
   60: @deftypefn Supplemental int atexit (void (*@var{f})())
   61: 
   62: Causes function @var{f} to be called at exit.  Returns 0.
   63: 
   64: @end deftypefn
   65: 
   66: @c basename.c:6
   67: @deftypefn Supplemental char* basename (const char *@var{name})
   68: 
   69: Returns a pointer to the last component of pathname @var{name}.
   70: Behavior is undefined if the pathname ends in a directory separator.
   71: 
   72: @end deftypefn
   73: 
   74: @c bcmp.c:6
   75: @deftypefn Supplemental int bcmp (char *@var{x}, char *@var{y}, int @var{count})
   76: 
   77: Compares the first @var{count} bytes of two areas of memory.  Returns
   78: zero if they are the same, nonzero otherwise.  Returns zero if
   79: @var{count} is zero.  A nonzero result only indicates a difference,
   80: it does not indicate any sorting order (say, by having a positive
   81: result mean @var{x} sorts before @var{y}).
   82: 
   83: @end deftypefn
   84: 
   85: @c bcopy.c:3
   86: @deftypefn Supplemental void bcopy (char *@var{in}, char *@var{out}, int @var{length})
   87: 
   88: Copies @var{length} bytes from memory region @var{in} to region
   89: @var{out}.  The use of @code{bcopy} is deprecated in new programs.
   90: 
   91: @end deftypefn
   92: 
   93: @c bsearch.c:33
   94: @deftypefn Supplemental void* bsearch (const void *@var{key}, const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, int (*@var{compar})(const void *, const void *))
   95: 
   96: Performs a search over an array of @var{nmemb} elements pointed to by
   97: @var{base} for a member that matches the object pointed to by @var{key}.
   98: The size of each member is specified by @var{size}.  The array contents
   99: should be sorted in ascending order according to the @var{compar}
  100: comparison function.  This routine should take two arguments pointing to
  101: the @var{key} and to an array member, in that order, and should return an
  102: integer less than, equal to, or greater than zero if the @var{key} object
  103: is respectively less than, matching, or greater than the array member.
  104: 
  105: @end deftypefn
  106: 
  107: @c argv.c:124
  108: @deftypefn Extension char** buildargv (char *@var{sp})
  109: 
  110: Given a pointer to a string, parse the string extracting fields
  111: separated by whitespace and optionally enclosed within either single
  112: or double quotes (which are stripped off), and build a vector of
  113: pointers to copies of the string for each field.  The input string
  114: remains unchanged.  The last element of the vector is followed by a
  115: @code{NULL} element.
  116: 
  117: All of the memory for the pointer array and copies of the string
  118: is obtained from @code{malloc}.  All of the memory can be returned to the
  119: system with the single function call @code{freeargv}, which takes the
  120: returned result of @code{buildargv}, as it's argument.
  121: 
  122: Returns a pointer to the argument vector if successful.  Returns
  123: @code{NULL} if @var{sp} is @code{NULL} or if there is insufficient
  124: memory to complete building the argument vector.
  125: 
  126: If the input is a null string (as opposed to a @code{NULL} pointer),
  127: then buildarg returns an argument vector that has one arg, a null
  128: string.
  129: 
  130: @end deftypefn
  131: 
  132: @c bzero.c:6
  133: @deftypefn Supplemental void bzero (char *@var{mem}, int @var{count})
  134: 
  135: Zeros @var{count} bytes starting at @var{mem}.  Use of this function
  136: is deprecated in favor of @code{memset}.
  137: 
  138: @end deftypefn
  139: 
  140: @c calloc.c:6
  141: @deftypefn Supplemental void* calloc (size_t @var{nelem}, size_t @var{elsize})
  142: 
  143: Uses @code{malloc} to allocate storage for @var{nelem} objects of
  144: @var{elsize} bytes each, then zeros the memory.
  145: 
  146: @end deftypefn
  147: 
  148: @c choose-temp.c:42
  149: @deftypefn Extension char* choose_temp_base (void)
  150: 
  151: Return a prefix for temporary file names or @code{NULL} if unable to
  152: find one.  The current directory is chosen if all else fails so the
  153: program is exited if a temporary directory can't be found (@code{mktemp}
  154: fails).  The buffer for the result is obtained with @code{xmalloc}.
  155: 
  156: This function is provided for backwards compatibility only.  Its use is
  157: not recommended.
  158: 
  159: @end deftypefn
  160: 
  161: @c make-temp-file.c:87
  162: @deftypefn Replacement char* choose_tmpdir ()
  163: 
  164: Returns a pointer to a directory path suitable for creating temporary
  165: files in.
  166: 
  167: @end deftypefn
  168: 
  169: @c clock.c:27
  170: @deftypefn Supplemental long clock (void)
  171: 
  172: Returns an approximation of the CPU time used by the process as a
  173: @code{clock_t}; divide this number by @samp{CLOCKS_PER_SEC} to get the
  174: number of seconds used.
  175: 
  176: @end deftypefn
  177: 
  178: @c concat.c:24
  179: @deftypefn Extension char* concat (const char *@var{s1}, const char *@var{s2}, @dots{}, @code{NULL})
  180: 
  181: Concatenate zero or more of strings and return the result in freshly
  182: @code{xmalloc}ed memory.  Returns @code{NULL} if insufficient memory is
  183: available.  The argument list is terminated by the first @code{NULL}
  184: pointer encountered.  Pointers to empty strings are ignored.
  185: 
  186: @end deftypefn
  187: 
  188: @c argv.c:52
  189: @deftypefn Extension char** dupargv (char **@var{vector})
  190: 
  191: Duplicate an argument vector.  Simply scans through @var{vector},
  192: duplicating each argument until the terminating @code{NULL} is found.
  193: Returns a pointer to the argument vector if successful.  Returns
  194: @code{NULL} if there is insufficient memory to complete building the
  195: argument vector.
  196: 
  197: @end deftypefn
  198: 
  199: @c strerror.c:567
  200: @deftypefn Extension int errno_max (void)
  201: 
  202: Returns the maximum @code{errno} value for which a corresponding
  203: symbolic name or message is available.  Note that in the case where we
  204: use the @code{sys_errlist} supplied by the system, it is possible for
  205: there to be more symbolic names than messages, or vice versa.  In
  206: fact, the manual page for @code{perror(3C)} explicitly warns that one
  207: should check the size of the table (@code{sys_nerr}) before indexing
  208: it, since new error codes may be added to the system before they are
  209: added to the table.  Thus @code{sys_nerr} might be smaller than value
  210: implied by the largest @code{errno} value defined in @code{<errno.h>}.
  211: 
  212: We return the maximum value that can be used to obtain a meaningful
  213: symbolic name or message.
  214: 
  215: @end deftypefn
  216: 
  217: @c argv.c:348
  218: @deftypefn Extension void expandargv (int *@var{argcp}, char ***@var{argvp})
  219: 
  220: The @var{argcp} and @code{argvp} arguments are pointers to the usual
  221: @code{argc} and @code{argv} arguments to @code{main}.  This function
  222: looks for arguments that begin with the character @samp{@@}.  Any such
  223: arguments are interpreted as ``response files''.  The contents of the
  224: response file are interpreted as additional command line options.  In
  225: particular, the file is separated into whitespace-separated strings;
  226: each such string is taken as a command-line option.  The new options
  227: are inserted in place of the option naming the response file, and
  228: @code{*argcp} and @code{*argvp} will be updated.  If the value of
  229: @code{*argvp} is modified by this function, then the new value has
  230: been dynamically allocated and can be deallocated by the caller with
  231: @code{freeargv}.  However, most callers will simply call
  232: @code{expandargv} near the beginning of @code{main} and allow the
  233: operating system to free the memory when the program exits.
  234: 
  235: @end deftypefn
  236: 
  237: @c fdmatch.c:23
  238: @deftypefn Extension int fdmatch (int @var{fd1}, int @var{fd2})
  239: 
  240: Check to see if two open file descriptors refer to the same file.
  241: This is useful, for example, when we have an open file descriptor for
  242: an unnamed file, and the name of a file that we believe to correspond
  243: to that fd.  This can happen when we are exec'd with an already open
  244: file (@code{stdout} for example) or from the SVR4 @file{/proc} calls
  245: that return open file descriptors for mapped address spaces.  All we
  246: have to do is open the file by name and check the two file descriptors
  247: for a match, which is done by comparing major and minor device numbers
  248: and inode numbers.
  249: 
  250: @end deftypefn
  251: 
  252: @c fopen_unlocked.c:48
  253: @deftypefn Extension {FILE *} fdopen_unlocked (int @var{fildes}, const char * @var{mode})
  254: 
  255: Opens and returns a @code{FILE} pointer via @code{fdopen}.  If the
  256: operating system supports it, ensure that the stream is setup to avoid
  257: any multi-threaded locking.  Otherwise return the @code{FILE} pointer
  258: unchanged.
  259: 
  260: @end deftypefn
  261: 
  262: @c ffs.c:3
  263: @deftypefn Supplemental int ffs (int @var{valu})
  264: 
  265: Find the first (least significant) bit set in @var{valu}.  Bits are
  266: numbered from right to left, starting with bit 1 (corresponding to the
  267: value 1).  If @var{valu} is zero, zero is returned.
  268: 
  269: @end deftypefn
  270: 
  271: @c filename_cmp.c:32
  272: @deftypefn Extension int filename_cmp (const char *@var{s1}, const char *@var{s2})
  273: 
  274: Return zero if the two file names @var{s1} and @var{s2} are equivalent.
  275: If not equivalent, the returned value is similar to what @code{strcmp}
  276: would return.  In other words, it returns a negative value if @var{s1}
  277: is less than @var{s2}, or a positive value if @var{s2} is greater than
  278: @var{s2}.
  279: 
  280: This function does not normalize file names.  As a result, this function
  281: will treat filenames that are spelled differently as different even in
  282: the case when the two filenames point to the same underlying file.
  283: However, it does handle the fact that on DOS-like file systems, forward
  284: and backward slashes are equal.
  285: 
  286: @end deftypefn
  287: 
  288: @c fnmatch.txh:1
  289: @deftypefn Replacement int fnmatch (const char *@var{pattern}, const char *@var{string}, int @var{flags})
  290: 
  291: Matches @var{string} against @var{pattern}, returning zero if it
  292: matches, @code{FNM_NOMATCH} if not.  @var{pattern} may contain the
  293: wildcards @code{?} to match any one character, @code{*} to match any
  294: zero or more characters, or a set of alternate characters in square
  295: brackets, like @samp{[a-gt8]}, which match one character (@code{a}
  296: through @code{g}, or @code{t}, or @code{8}, in this example) if that one
  297: character is in the set.  A set may be inverted (i.e., match anything
  298: except what's in the set) by giving @code{^} or @code{!} as the first
  299: character in the set.  To include those characters in the set, list them
  300: as anything other than the first character of the set.  To include a
  301: dash in the set, list it last in the set.  A backslash character makes
  302: the following character not special, so for example you could match
  303: against a literal asterisk with @samp{\*}.  To match a literal
  304: backslash, use @samp{\\}.
  305: 
  306: @code{flags} controls various aspects of the matching process, and is a
  307: boolean OR of zero or more of the following values (defined in
  308: @code{<fnmatch.h>}):
  309: 
  310: @table @code
  311: 
  312: @item FNM_PATHNAME
  313: @itemx FNM_FILE_NAME
  314: @var{string} is assumed to be a path name.  No wildcard will ever match
  315: @code{/}.
  316: 
  317: @item FNM_NOESCAPE
  318: Do not interpret backslashes as quoting the following special character.
  319: 
  320: @item FNM_PERIOD
  321: A leading period (at the beginning of @var{string}, or if
  322: @code{FNM_PATHNAME} after a slash) is not matched by @code{*} or
  323: @code{?} but must be matched explicitly.
  324: 
  325: @item FNM_LEADING_DIR
  326: Means that @var{string} also matches @var{pattern} if some initial part
  327: of @var{string} matches, and is followed by @code{/} and zero or more
  328: characters.  For example, @samp{foo*} would match either @samp{foobar}
  329: or @samp{foobar/grill}.
  330: 
  331: @item FNM_CASEFOLD
  332: Ignores case when performing the comparison.
  333: 
  334: @end table
  335: 
  336: @end deftypefn
  337: 
  338: @c fopen_unlocked.c:39
  339: @deftypefn Extension {FILE *} fopen_unlocked (const char *@var{path}, const char * @var{mode})
  340: 
  341: Opens and returns a @code{FILE} pointer via @code{fopen}.  If the
  342: operating system supports it, ensure that the stream is setup to avoid
  343: any multi-threaded locking.  Otherwise return the @code{FILE} pointer
  344: unchanged.
  345: 
  346: @end deftypefn
  347: 
  348: @c argv.c:97
  349: @deftypefn Extension void freeargv (char **@var{vector})
  350: 
  351: Free an argument vector that was built using @code{buildargv}.  Simply
  352: scans through @var{vector}, freeing the memory for each argument until
  353: the terminating @code{NULL} is found, and then frees @var{vector}
  354: itself.
  355: 
  356: @end deftypefn
  357: 
  358: @c fopen_unlocked.c:57
  359: @deftypefn Extension {FILE *} freopen_unlocked (const char * @var{path}, const char * @var{mode}, FILE * @var{stream})
  360: 
  361: Opens and returns a @code{FILE} pointer via @code{freopen}.  If the
  362: operating system supports it, ensure that the stream is setup to avoid
  363: any multi-threaded locking.  Otherwise return the @code{FILE} pointer
  364: unchanged.
  365: 
  366: @end deftypefn
  367: 
  368: @c getruntime.c:82
  369: @deftypefn Replacement long get_run_time (void)
  370: 
  371: Returns the time used so far, in microseconds.  If possible, this is
  372: the time used by this process, else it is the elapsed time since the
  373: process started.
  374: 
  375: @end deftypefn
  376: 
  377: @c getcwd.c:6
  378: @deftypefn Supplemental char* getcwd (char *@var{pathname}, int @var{len})
  379: 
  380: Copy the absolute pathname for the current working directory into
  381: @var{pathname}, which is assumed to point to a buffer of at least
  382: @var{len} bytes, and return a pointer to the buffer.  If the current
  383: directory's path doesn't fit in @var{len} characters, the result is
  384: @code{NULL} and @code{errno} is set.  If @var{pathname} is a null pointer,
  385: @code{getcwd} will obtain @var{len} bytes of space using
  386: @code{malloc}.
  387: 
  388: @end deftypefn
  389: 
  390: @c getpagesize.c:5
  391: @deftypefn Supplemental int getpagesize (void)
  392: 
  393: Returns the number of bytes in a page of memory.  This is the
  394: granularity of many of the system memory management routines.  No
  395: guarantee is made as to whether or not it is the same as the basic
  396: memory management hardware page size.
  397: 
  398: @end deftypefn
  399: 
  400: @c getpwd.c:5
  401: @deftypefn Supplemental char* getpwd (void)
  402: 
  403: Returns the current working directory.  This implementation caches the
  404: result on the assumption that the process will not call @code{chdir}
  405: between calls to @code{getpwd}.
  406: 
  407: @end deftypefn
  408: 
  409: @c gettimeofday.c:12
  410: @deftypefn Supplemental int gettimeofday (struct timeval *@var{tp}, void *@var{tz})
  411: 
  412: Writes the current time to @var{tp}.  This implementation requires
  413: that @var{tz} be NULL.  Returns 0 on success, -1 on failure.
  414: 
  415: @end deftypefn
  416: 
  417: @c hex.c:33
  418: @deftypefn Extension void hex_init (void)
  419: 
  420: Initializes the array mapping the current character set to
  421: corresponding hex values.  This function must be called before any
  422: call to @code{hex_p} or @code{hex_value}.  If you fail to call it, a
  423: default ASCII-based table will normally be used on ASCII systems.
  424: 
  425: @end deftypefn
  426: 
  427: @c hex.c:42
  428: @deftypefn Extension int hex_p (int @var{c})
  429: 
  430: Evaluates to non-zero if the given character is a valid hex character,
  431: or zero if it is not.  Note that the value you pass will be cast to
  432: @code{unsigned char} within the macro.
  433: 
  434: @end deftypefn
  435: 
  436: @c hex.c:50
  437: @deftypefn Extension {unsigned int} hex_value (int @var{c})
  438: 
  439: Returns the numeric equivalent of the given character when interpreted
  440: as a hexadecimal digit.  The result is undefined if you pass an
  441: invalid hex digit.  Note that the value you pass will be cast to
  442: @code{unsigned char} within the macro.
  443: 
  444: The @code{hex_value} macro returns @code{unsigned int}, rather than
  445: signed @code{int}, to make it easier to use in parsing addresses from
  446: hex dump files: a signed @code{int} would be sign-extended when
  447: converted to a wider unsigned type --- like @code{bfd_vma}, on some
  448: systems.
  449: 
  450: @end deftypefn
  451: 
  452: @c index.c:5
  453: @deftypefn Supplemental char* index (char *@var{s}, int @var{c})
  454: 
  455: Returns a pointer to the first occurrence of the character @var{c} in
  456: the string @var{s}, or @code{NULL} if not found.  The use of @code{index} is
  457: deprecated in new programs in favor of @code{strchr}.
  458: 
  459: @end deftypefn
  460: 
  461: @c insque.c:6
  462: @deftypefn Supplemental void insque (struct qelem *@var{elem}, struct qelem *@var{pred})
  463: @deftypefnx Supplemental void remque (struct qelem *@var{elem})
  464: 
  465: Routines to manipulate queues built from doubly linked lists.  The
  466: @code{insque} routine inserts @var{elem} in the queue immediately
  467: after @var{pred}.  The @code{remque} routine removes @var{elem} from
  468: its containing queue.  These routines expect to be passed pointers to
  469: structures which have as their first members a forward pointer and a
  470: back pointer, like this prototype (although no prototype is provided):
  471: 
  472: @example
  473: struct qelem @{
  474:   struct qelem *q_forw;
  475:   struct qelem *q_back;
  476:   char q_data[];
  477: @};
  478: @end example
  479: 
  480: @end deftypefn
  481: 
  482: @c safe-ctype.c:46
  483: @deffn  Extension ISALPHA  (@var{c})
  484: @deffnx Extension ISALNUM  (@var{c})
  485: @deffnx Extension ISBLANK  (@var{c})
  486: @deffnx Extension ISCNTRL  (@var{c})
  487: @deffnx Extension ISDIGIT  (@var{c})
  488: @deffnx Extension ISGRAPH  (@var{c})
  489: @deffnx Extension ISLOWER  (@var{c})
  490: @deffnx Extension ISPRINT  (@var{c})
  491: @deffnx Extension ISPUNCT  (@var{c})
  492: @deffnx Extension ISSPACE  (@var{c})
  493: @deffnx Extension ISUPPER  (@var{c})
  494: @deffnx Extension ISXDIGIT (@var{c})
  495: 
  496: These twelve macros are defined by @file{safe-ctype.h}.  Each has the
  497: same meaning as the corresponding macro (with name in lowercase)
  498: defined by the standard header @file{ctype.h}.  For example,
  499: @code{ISALPHA} returns true for alphabetic characters and false for
  500: others.  However, there are two differences between these macros and
  501: those provided by @file{ctype.h}:
  502: 
  503: @itemize @bullet
  504: @item These macros are guaranteed to have well-defined behavior for all 
  505: values representable by @code{signed char} and @code{unsigned char}, and
  506: for @code{EOF}.
  507: 
  508: @item These macros ignore the current locale; they are true for these
  509: fixed sets of characters:
  510: @multitable {@code{XDIGIT}} {yada yada yada yada yada yada yada yada}
  511: @item @code{ALPHA}  @tab @kbd{A-Za-z}
  512: @item @code{ALNUM}  @tab @kbd{A-Za-z0-9}
  513: @item @code{BLANK}  @tab @kbd{space tab}
  514: @item @code{CNTRL}  @tab @code{!PRINT}
  515: @item @code{DIGIT}  @tab @kbd{0-9}
  516: @item @code{GRAPH}  @tab @code{ALNUM || PUNCT}
  517: @item @code{LOWER}  @tab @kbd{a-z}
  518: @item @code{PRINT}  @tab @code{GRAPH ||} @kbd{space}
  519: @item @code{PUNCT}  @tab @kbd{`~!@@#$%^&*()_-=+[@{]@}\|;:'",<.>/?}
  520: @item @code{SPACE}  @tab @kbd{space tab \n \r \f \v}
  521: @item @code{UPPER}  @tab @kbd{A-Z}
  522: @item @code{XDIGIT} @tab @kbd{0-9A-Fa-f}
  523: @end multitable
  524: 
  525: Note that, if the host character set is ASCII or a superset thereof,
  526: all these macros will return false for all values of @code{char} outside
  527: the range of 7-bit ASCII.  In particular, both ISPRINT and ISCNTRL return
  528: false for characters with numeric values from 128 to 255.
  529: @end itemize
  530: @end deffn
  531: 
  532: @c safe-ctype.c:95
  533: @deffn  Extension ISIDNUM         (@var{c})
  534: @deffnx Extension ISIDST          (@var{c})
  535: @deffnx Extension IS_VSPACE       (@var{c})
  536: @deffnx Extension IS_NVSPACE      (@var{c})
  537: @deffnx Extension IS_SPACE_OR_NUL (@var{c})
  538: @deffnx Extension IS_ISOBASIC     (@var{c})
  539: These six macros are defined by @file{safe-ctype.h} and provide
  540: additional character classes which are useful when doing lexical
  541: analysis of C or similar languages.  They are true for the following
  542: sets of characters:
  543: 
  544: @multitable {@code{SPACE_OR_NUL}} {yada yada yada yada yada yada yada yada}
  545: @item @code{IDNUM}        @tab @kbd{A-Za-z0-9_}
  546: @item @code{IDST}         @tab @kbd{A-Za-z_}
  547: @item @code{VSPACE}       @tab @kbd{\r \n}
  548: @item @code{NVSPACE}      @tab @kbd{space tab \f \v \0}
  549: @item @code{SPACE_OR_NUL} @tab @code{VSPACE || NVSPACE}
  550: @item @code{ISOBASIC}     @tab @code{VSPACE || NVSPACE || PRINT}
  551: @end multitable
  552: @end deffn
  553: 
  554: @c lbasename.c:23
  555: @deftypefn Replacement {const char*} lbasename (const char *@var{name})
  556: 
  557: Given a pointer to a string containing a typical pathname
  558: (@samp{/usr/src/cmd/ls/ls.c} for example), returns a pointer to the
  559: last component of the pathname (@samp{ls.c} in this case).  The
  560: returned pointer is guaranteed to lie within the original
  561: string.  This latter fact is not true of many vendor C
  562: libraries, which return special strings or modify the passed
  563: strings for particular input.
  564: 
  565: In particular, the empty string returns the same empty string,
  566: and a path ending in @code{/} returns the empty string after it.
  567: 
  568: @end deftypefn
  569: 
  570: @c lrealpath.c:25
  571: @deftypefn Replacement {const char*} lrealpath (const char *@var{name})
  572: 
  573: Given a pointer to a string containing a pathname, returns a canonical
  574: version of the filename.  Symlinks will be resolved, and ``.'' and ``..''
  575: components will be simplified.  The returned value will be allocated using
  576: @code{malloc}, or @code{NULL} will be returned on a memory allocation error.
  577: 
  578: @end deftypefn
  579: 
  580: @c make-relative-prefix.c:24
  581: @deftypefn Extension {const char*} make_relative_prefix (const char *@var{progname}, const char *@var{bin_prefix}, const char *@var{prefix})
  582: 
  583: Given three paths @var{progname}, @var{bin_prefix}, @var{prefix},
  584: return the path that is in the same position relative to
  585: @var{progname}'s directory as @var{prefix} is relative to
  586: @var{bin_prefix}.  That is, a string starting with the directory
  587: portion of @var{progname}, followed by a relative pathname of the
  588: difference between @var{bin_prefix} and @var{prefix}.
  589: 
  590: If @var{progname} does not contain any directory separators,
  591: @code{make_relative_prefix} will search @env{PATH} to find a program
  592: named @var{progname}.  Also, if @var{progname} is a symbolic link,
  593: the symbolic link will be resolved.
  594: 
  595: For example, if @var{bin_prefix} is @code{/alpha/beta/gamma/gcc/delta},
  596: @var{prefix} is @code{/alpha/beta/gamma/omega/}, and @var{progname} is
  597: @code{/red/green/blue/gcc}, then this function will return
  598: @code{/red/green/blue/../../omega/}.
  599: 
  600: The return value is normally allocated via @code{malloc}.  If no
  601: relative prefix can be found, return @code{NULL}.
  602: 
  603: @end deftypefn
  604: 
  605: @c make-temp-file.c:137
  606: @deftypefn Replacement char* make_temp_file (const char *@var{suffix})
  607: 
  608: Return a temporary file name (as a string) or @code{NULL} if unable to
  609: create one.  @var{suffix} is a suffix to append to the file name.  The
  610: string is @code{malloc}ed, and the temporary file has been created.
  611: 
  612: @end deftypefn
  613: 
  614: @c memchr.c:3
  615: @deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, size_t @var{n})
  616: 
  617: This function searches memory starting at @code{*@var{s}} for the
  618: character @var{c}.  The search only ends with the first occurrence of
  619: @var{c}, or after @var{length} characters; in particular, a null
  620: character does not terminate the search.  If the character @var{c} is
  621: found within @var{length} characters of @code{*@var{s}}, a pointer
  622: to the character is returned.  If @var{c} is not found, then @code{NULL} is
  623: returned.
  624: 
  625: @end deftypefn
  626: 
  627: @c memcmp.c:6
  628: @deftypefn Supplemental int memcmp (const void *@var{x}, const void *@var{y}, size_t @var{count})
  629: 
  630: Compares the first @var{count} bytes of two areas of memory.  Returns
  631: zero if they are the same, a value less than zero if @var{x} is
  632: lexically less than @var{y}, or a value greater than zero if @var{x}
  633: is lexically greater than @var{y}.  Note that lexical order is determined
  634: as if comparing unsigned char arrays.
  635: 
  636: @end deftypefn
  637: 
  638: @c memcpy.c:6
  639: @deftypefn Supplemental void* memcpy (void *@var{out}, const void *@var{in}, size_t @var{length})
  640: 
  641: Copies @var{length} bytes from memory region @var{in} to region
  642: @var{out}.  Returns a pointer to @var{out}.
  643: 
  644: @end deftypefn
  645: 
  646: @c memmove.c:6
  647: @deftypefn Supplemental void* memmove (void *@var{from}, const void *@var{to}, size_t @var{count})
  648: 
  649: Copies @var{count} bytes from memory area @var{from} to memory area
  650: @var{to}, returning a pointer to @var{to}.
  651: 
  652: @end deftypefn
  653: 
  654: @c mempcpy.c:23
  655: @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, size_t @var{length})
  656: 
  657: Copies @var{length} bytes from memory region @var{in} to region
  658: @var{out}.  Returns a pointer to @var{out} + @var{length}.
  659: 
  660: @end deftypefn
  661: 
  662: @c memset.c:6
  663: @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count})
  664: 
  665: Sets the first @var{count} bytes of @var{s} to the constant byte
  666: @var{c}, returning a pointer to @var{s}.
  667: 
  668: @end deftypefn
  669: 
  670: @c mkstemps.c:58
  671: @deftypefn Replacement int mkstemps (char *@var{pattern}, int @var{suffix_len})
  672: 
  673: Generate a unique temporary file name from @var{pattern}.
  674: @var{pattern} has the form:
  675: 
  676: @example
  677:    @var{path}/ccXXXXXX@var{suffix}
  678: @end example
  679: 
  680: @var{suffix_len} tells us how long @var{suffix} is (it can be zero
  681: length).  The last six characters of @var{pattern} before @var{suffix}
  682: must be @samp{XXXXXX}; they are replaced with a string that makes the
  683: filename unique.  Returns a file descriptor open on the file for
  684: reading and writing.
  685: 
  686: @end deftypefn
  687: 
  688: @c pexecute.txh:266
  689: @deftypefn Extension void pex_free (struct pex_obj @var{obj})
  690: 
  691: Clean up and free all data associated with @var{obj}.
  692: 
  693: @end deftypefn
  694: 
  695: @c pexecute.txh:241
  696: @deftypefn Extension int pex_get_status (struct pex_obj *@var{obj}, int @var{count}, int *@var{vector})
  697: 
  698: Returns the exit status of all programs run using @var{obj}.
  699: @var{count} is the number of results expected.  The results will be
  700: placed into @var{vector}.  The results are in the order of the calls
  701: to @code{pex_run}.  Returns 0 on error, 1 on success.
  702: 
  703: @end deftypefn
  704: 
  705: @c pexecute.txh:250
  706: @deftypefn Extension int pex_get_times (struct pex_obj *@var{obj}, int @var{count}, struct pex_time *@var{vector})
  707: 
  708: Returns the process execution times of all programs run using
  709: @var{obj}.  @var{count} is the number of results expected.  The
  710: results will be placed into @var{vector}.  The results are in the
  711: order of the calls to @code{pex_run}.  Returns 0 on error, 1 on
  712: success.
  713: 
  714: @code{struct pex_time} has the following fields of the type
  715: @code{unsigned long}: @code{user_seconds},
  716: @code{user_microseconds}, @code{system_seconds},
  717: @code{system_microseconds}.  On systems which do not support reporting
  718: