Lines Matching refs:var

83 testing to see whether the @code{char *} variable @var{p} points to a
85 @code{!*@var{p}} or @code{*@var{p} == '\0'}.
230 @deftypefun size_t strlen (const char *@var{s})
234 string @var{s} in bytes. (In other words, it returns the offset of the
256 But beware, this will not work unless @var{string} is the
296 @deftypefun size_t wcslen (const wchar_t *@var{ws})
301 wide string pointed to by @var{ws} (this is also the offset of
302 the terminating null wide character of @var{ws}).
311 @deftypefun size_t strnlen (const char *@var{s}, size_t @var{maxlen})
314 If the array @var{s} of size @var{maxlen} contains a null byte,
315 the @code{strnlen} function returns the length of the string @var{s} in
317 returns @var{maxlen}. Therefore this function is equivalent to
318 @code{(strlen (@var{s}) < @var{maxlen} ? strlen (@var{s}) : @var{maxlen})}
320 is more efficient and works even if @var{s} is not null-terminated so
321 long as @var{maxlen} does not exceed the size of @var{s}'s array.
334 @deftypefun size_t wcsnlen (const wchar_t *@var{ws}, size_t @var{maxlen})
338 @var{maxlen} parameter specifies the maximum number of wide characters.
380 @deftypefun {void *} memcpy (void *restrict @var{to}, const void *restrict @var{from}, size_t @var{…
383 The @code{memcpy} function copies @var{size} bytes from the object
384 beginning at @var{from} into the object beginning at @var{to}. The
385 behavior of this function is undefined if the two arrays @var{to} and
386 @var{from} overlap; use @code{memmove} instead if overlapping is possible.
388 The value returned by @code{memcpy} is the value of @var{to}.
401 …ypefun {wchar_t *} wmemcpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom}, size…
404 The @code{wmemcpy} function copies @var{size} wide characters from the object
405 beginning at @var{wfrom} into the object beginning at @var{wto}. The
406 behavior of this function is undefined if the two arrays @var{wto} and
407 @var{wfrom} overlap; use @code{wmemmove} instead if overlapping is possible.
421 The value returned by @code{wmemcpy} is the value of @var{wto}.
426 @deftypefun {void *} mempcpy (void *restrict @var{to}, const void *restrict @var{from}, size_t @var
430 function. It copies @var{size} bytes from the object beginning at
431 @code{from} into the object pointed to by @var{to}. But instead of
432 returning the value of @var{to} it returns a pointer to the byte
433 following the last written byte in the object beginning at @var{to}.
434 I.e., the value is @code{((void *) ((char *) @var{to} + @var{size}))}.
453 …pefun {wchar_t *} wmempcpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom}, size…
457 function. It copies @var{size} wide characters from the object
458 beginning at @code{wfrom} into the object pointed to by @var{wto}. But
459 instead of returning the value of @var{wto} it returns a pointer to the
461 beginning at @var{wto}. I.e., the value is @code{@var{wto} + @var{size}}.
481 @deftypefun {void *} memmove (void *@var{to}, const void *@var{from}, size_t @var{size})
484 @code{memmove} copies the @var{size} bytes at @var{from} into the
485 @var{size} bytes at @var{to}, even if those two blocks of space
487 original values of the bytes in the block at @var{from}, including those
488 bytes which also belong to the block at @var{to}.
490 The value returned by @code{memmove} is the value of @var{to}.
493 @deftypefun {wchar_t *} wmemmove (wchar_t *@var{wto}, const wchar_t *@var{wfrom}, size_t @var{size})
496 @code{wmemmove} copies the @var{size} wide characters at @var{wfrom}
497 into the @var{size} wide characters at @var{wto}, even if those two
500 at @var{wfrom}, including those wide characters which also belong to the
501 block at @var{wto}.
515 The value returned by @code{wmemmove} is the value of @var{wto}.
520 …ftypefun {void *} memccpy (void *restrict @var{to}, const void *restrict @var{from}, int @var{c}, …
523 This function copies no more than @var{size} bytes from @var{from} to
524 @var{to}, stopping if a byte matching @var{c} is found. The return
525 value is a pointer into @var{to} one byte past where @var{c} was copied,
526 or a null pointer if no byte matching @var{c} appeared in the first
527 @var{size} bytes of @var{from}.
530 @deftypefun {void *} memset (void *@var{block}, int @var{c}, size_t @var{size})
533 This function copies the value of @var{c} (converted to an
534 @code{unsigned char}) into each of the first @var{size} bytes of the
535 object beginning at @var{block}. It returns the value of @var{block}.
538 @deftypefun {wchar_t *} wmemset (wchar_t *@var{block}, wchar_t @var{wc}, size_t @var{size})
541 This function copies the value of @var{wc} into each of the first
542 @var{size} wide characters of the object beginning at @var{block}. It
543 returns the value of @var{block}.
546 @deftypefun {char *} strcpy (char *restrict @var{to}, const char *restrict @var{from})
549 This copies bytes from the string @var{from} (up to and including
550 the terminating null byte) into the string @var{to}. Like
552 overlap. The return value is the value of @var{to}.
555 @deftypefun {wchar_t *} wcscpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom})
558 This copies wide characters from the wide string @var{wfrom} (up to and
560 @var{wto}. Like @code{wmemcpy}, this function has undefined results if
561 the strings overlap. The return value is the value of @var{wto}.
564 @deftypefun {char *} strdup (const char *@var{s})
567 This function copies the string @var{s} into a newly
574 @deftypefun {wchar_t *} wcsdup (const wchar_t *@var{ws})
577 This function copies the wide string @var{ws}
586 @deftypefun {char *} stpcpy (char *restrict @var{to}, const char *restrict @var{from})
590 the end of the string @var{to} (that is, the address of the terminating
608 @deftypefun {wchar_t *} wcpcpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom})
612 the end of the string @var{wto} (that is, the address of the terminating
623 @deftypefn {Macro} {char *} strdupa (const char *@var{s})
640 Please note that calling @code{strtok} using @var{path} directly is
649 @deftypefun void bcopy (const void *@var{from}, void *@var{to}, size_t @var{size})
657 @deftypefun void bzero (void *@var{block}, size_t @var{size})
678 @deftypefun {char *} strcat (char *restrict @var{to}, const char *restrict @var{from})
682 bytes from @var{from} are concatenated or appended to the end of
683 @var{to}, instead of overwriting it. That is, the first byte from
684 @var{from} overwrites the null byte marking the end of @var{to}.
702 @deftypefun {wchar_t *} wcscat (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom})
706 wide characters from @var{wfrom} are concatenated or appended to the end of
707 @var{wto}, instead of overwriting it. That is, the first wide character from
708 @var{wfrom} overwrites the null wide character marking the end of @var{wto}.
862 @deftypefun {char *} strncpy (char *restrict @var{to}, const char *restrict @var{from}, size_t @var
866 @var{size} bytes into @var{to}.
868 If @var{from} does not contain a null byte in its first @var{size}
869 bytes, @code{strncpy} copies just the first @var{size} bytes. In this
870 case no null terminator is written into @var{to}.
872 Otherwise @var{from} must be a string with length less than
873 @var{size}. In this case @code{strncpy} copies all of @var{from},
874 followed by enough null bytes to add up to @var{size} bytes in all.
880 all @var{size} bytes of the destination, even when @var{size} is much
881 greater than the length of @var{from}. As noted below, this function
885 …ypefun {wchar_t *} wcsncpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom}, size…
889 @var{size} wide characters into @var{wto}.
891 If @var{wfrom} does not contain a null wide character in its first
892 @var{size} wide characters, then @code{wcsncpy} copies just the first
893 @var{size} wide characters. In this case no null terminator is
894 written into @var{wto}.
896 Otherwise @var{wfrom} must be a wide string with length less than
897 @var{size}. In this case @code{wcsncpy} copies all of @var{wfrom},
898 followed by enough null wide characters to add up to @var{size} wide
909 @deftypefun {char *} strndup (const char *@var{s}, size_t @var{size})
913 @var{size} bytes into the newly allocated string.
915 If the length of @var{s} is more than @var{size}, then @code{strndup}
916 copies just the first @var{size} bytes and adds a closing null byte.
928 @deftypefn {Macro} {char *} strndupa (const char *@var{s}, size_t @var{size})
946 @deftypefun {char *} stpncpy (char *restrict @var{to}, const char *restrict @var{from}, size_t @var
950 @var{size} bytes into @var{to}.
952 If the length of @var{from} is more than @var{size}, then @code{stpncpy}
953 copies just the first @var{size} bytes and returns a pointer to the
955 this case there is no null terminator written into @var{to}.
957 If the length of @var{from} is less than @var{size}, then @code{stpncpy}
958 copies all of @var{from}, followed by enough null bytes to add up
959 to @var{size} bytes in all. This behavior is rarely useful, but it
974 …ypefun {wchar_t *} wcpncpy (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom}, size…
978 @var{wsize} wide characters into @var{wto}.
980 If the length of @var{wfrom} is more than @var{size}, then
981 @code{wcpncpy} copies just the first @var{size} wide characters and
984 there is no null terminator written into @var{wto}.
986 If the length of @var{wfrom} is less than @var{size}, then @code{wcpncpy}
987 copies all of @var{wfrom}, followed by enough null wide characters to add up
988 to @var{size} wide characters in all. This behavior is rarely useful, but it
1004 @deftypefun {char *} strncat (char *restrict @var{to}, const char *restrict @var{from}, size_t @var
1007 This function is like @code{strcat} except that not more than @var{size}
1008 bytes from @var{from} are appended to the end of @var{to}, and
1009 @var{from} need not be null-terminated. A single null byte is also
1010 always appended to @var{to}, so the total
1011 allocated size of @var{to} must be at least @code{@var{size} + 1} bytes
1038 …ypefun {wchar_t *} wcsncat (wchar_t *restrict @var{wto}, const wchar_t *restrict @var{wfrom}, size…
1041 This function is like @code{wcscat} except that not more than @var{size}
1042 wide characters from @var{from} are appended to the end of @var{to},
1043 and @var{from} need not be null-terminated. A single null wide
1044 character is also always appended to @var{to}, so the total allocated
1045 size of @var{to} must be at least @code{wcsnlen (@var{wfrom},
1046 @var{size}) + 1} wide characters longer than its initial length.
1126 @deftypefun int memcmp (const void *@var{a1}, const void *@var{a2}, size_t @var{size})
1129 The function @code{memcmp} compares the @var{size} bytes of memory
1130 beginning at @var{a1} against the @var{size} bytes of memory beginning
1131 at @var{a2}. The value returned has the same sign as the difference
1139 @deftypefun int wmemcmp (const wchar_t *@var{a1}, const wchar_t *@var{a2}, size_t @var{size})
1142 The function @code{wmemcmp} compares the @var{size} wide characters
1143 beginning at @var{a1} against the @var{size} wide characters beginning
1144 at @var{a2}. The value returned is smaller than or larger than zero
1145 depending on whether the first differing wide character is @var{a1} is
1146 smaller or larger than the corresponding wide character in @var{a2}.
1191 @deftypefun int strcmp (const char *@var{s1}, const char *@var{s2})
1194 The @code{strcmp} function compares the string @var{s1} against
1195 @var{s2}, returning a value that has the same sign as the difference
1201 A consequence of the ordering used by @code{strcmp} is that if @var{s1}
1202 is an initial substring of @var{s2}, then @var{s1} is considered to be
1203 ``less than'' @var{s2}.
1210 @deftypefun int wcscmp (const wchar_t *@var{ws1}, const wchar_t *@var{ws2})
1214 The @code{wcscmp} function compares the wide string @var{ws1}
1215 against @var{ws2}. The value returned is smaller than or larger than zero
1216 depending on whether the first differing wide character is @var{ws1} is
1217 smaller or larger than the corresponding wide character in @var{ws2}.
1221 A consequence of the ordering used by @code{wcscmp} is that if @var{ws1}
1222 is an initial substring of @var{ws2}, then @var{ws1} is considered to be
1223 ``less than'' @var{ws2}.
1230 @deftypefun int strcasecmp (const char *@var{s1}, const char *@var{s2})
1248 @deftypefun int wcscasecmp (const wchar_t *@var{ws1}, const wchar_t *@var{ws2})
1263 @deftypefun int strncmp (const char *@var{s1}, const char *@var{s2}, size_t @var{size})
1267 @var{size} bytes are compared. In other words, if the two
1268 strings are the same in their first @var{size} bytes, the
1272 @deftypefun int wcsncmp (const wchar_t *@var{ws1}, const wchar_t *@var{ws2}, size_t @var{size})
1276 @var{size} wide characters are compared. In other words, if the two
1277 strings are the same in their first @var{size} wide characters, the
1281 @deftypefun int strncasecmp (const char *@var{s1}, const char *@var{s2}, size_t @var{n})
1294 @deftypefun int wcsncasecmp (const wchar_t *@var{ws1}, const wchar_t *@var{s2}, size_t @var{n})
1327 @deftypefun int strverscmp (const char *@var{s1}, const char *@var{s2})
1331 The @code{strverscmp} function compares the string @var{s1} against
1332 @var{s2}, considering them as holding indices/version numbers. The
1334 @code{strcmp} function. In fact, if @var{s1} and @var{s2} contain no
1407 @deftypefun int bcmp (const void *@var{a1}, const void *@var{a2}, size_t @var{size})
1454 @deftypefun int strcoll (const char *@var{s1}, const char *@var{s2})
1464 @deftypefun int wcscoll (const wchar_t *@var{ws1}, const wchar_t *@var{ws2})
1505 @deftypefun size_t strxfrm (char *restrict @var{to}, const char *restrict @var{from}, size_t @var{s…
1509 @var{from} using the
1511 collation, and stores the transformed string in the array @var{to}. Up
1512 to @var{size} bytes (including a terminating null byte) are
1515 The behavior is undefined if the strings @var{to} and @var{from}
1519 value is not affected by the value of @var{size}, but if it is greater
1520 or equal than @var{size}, it means that the transformed string did not
1521 entirely fit in the array @var{to}. In this case, only as much of the
1528 If @var{size} is zero, no bytes are stored in @var{to}. In this
1532 @var{to} is if @var{size} is zero; @var{to} may even be a null pointer.
1535 @deftypefun size_t wcsxfrm (wchar_t *restrict @var{wto}, const wchar_t *@var{wfrom}, size_t @var{si…
1538 The function @code{wcsxfrm} transforms wide string @var{wfrom}
1541 @var{wto}. Up to @var{size} wide characters (including a terminating null
1544 The behavior is undefined if the strings @var{wto} and @var{wfrom}
1548 string. This value is not affected by the value of @var{size}, but if
1549 it is greater or equal than @var{size}, it means that the transformed
1550 wide string did not entirely fit in the array @var{wto}. In
1558 If @var{size} is zero, no wide characters are stored in @var{to}. In this
1563 @var{wto} is if @var{size} is zero; @var{wto} may even be a null pointer.
1694 @deftypefun {void *} memchr (const void *@var{block}, int @var{c}, size_t @var{size})
1697 This function finds the first occurrence of the byte @var{c} (converted
1698 to an @code{unsigned char}) in the initial @var{size} bytes of the
1699 object beginning at @var{block}. The return value is a pointer to the
1703 @deftypefun {wchar_t *} wmemchr (const wchar_t *@var{block}, wchar_t @var{wc}, size_t @var{size})
1706 This function finds the first occurrence of the wide character @var{wc}
1707 in the initial @var{size} wide characters of the object beginning at
1708 @var{block}. The return value is a pointer to the located wide
1712 @deftypefun {void *} rawmemchr (const void *@var{block}, int @var{c})
1716 byte @var{c} is available in the memory block specified by the
1717 parameters. But this means that the @var{size} parameter is not really
1723 that the @var{size} parameter is missing. The function will look beyond
1724 the end of the block pointed to by @var{block} in case the programmer
1725 made an error in assuming that the byte @var{c} is present in the block.
1742 @deftypefun {void *} memrchr (const void *@var{block}, int @var{c}, size_t @var{size})
1746 backwards from the end of the block defined by @var{block} and @var{size}
1752 @deftypefun {char *} strchr (const char *@var{string}, int @var{c})
1756 @var{c} (converted to a @code{char}) in the string
1757 beginning at @var{string}. The return value is a pointer to the located
1770 specifying zero as the value of the @var{c} argument.
1778 @deftypefun {wchar_t *} wcschr (const wchar_t *@var{wstring}, wchar_t @var{wc})
1782 character @var{wc} in the wide string
1783 beginning at @var{wstring}. The return value is a pointer to the
1789 value of the @var{wc} argument. It would be better (but less portable)
1793 @deftypefun {char *} strchrnul (const char *@var{string}, int @var{c})
1803 @deftypefun {wchar_t *} wcschrnul (const wchar_t *@var{wstring}, wchar_t @var{wc})
1838 @deftypefun {char *} strrchr (const char *@var{string}, int @var{c})
1842 backwards from the end of the string @var{string} (instead of forwards
1852 @deftypefun {wchar_t *} wcsrchr (const wchar_t *@var{wstring}, wchar_t @var{wc})
1856 backwards from the end of the string @var{wstring} (instead of forwards
1860 @deftypefun {char *} strstr (const char *@var{haystack}, const char *@var{needle})
1863 This is like @code{strchr}, except that it searches @var{haystack} for a
1864 substring @var{needle} rather than just a single byte. It
1865 returns a pointer into the string @var{haystack} that is the first
1867 @var{needle} is an empty string, the function returns @var{haystack}.
1878 @deftypefun {wchar_t *} wcsstr (const wchar_t *@var{haystack}, const wchar_t *@var{needle})
1881 This is like @code{wcschr}, except that it searches @var{haystack} for a
1882 substring @var{needle} rather than just a single wide character. It
1883 returns a pointer into the string @var{haystack} that is the first wide
1885 @var{needle} is an empty string, the function returns @var{haystack}.
1888 @deftypefun {wchar_t *} wcswcs (const wchar_t *@var{haystack}, const wchar_t *@var{needle})
1897 @deftypefun {char *} strcasestr (const char *@var{haystack}, const char *@var{needle})
1918 …pefun {void *} memmem (const void *@var{haystack}, size_t @var{haystack-len},@*const void *@var{ne…
1921 This is like @code{strstr}, but @var{needle} and @var{haystack} are byte
1922 arrays rather than strings. @var{needle-len} is the
1923 length of @var{needle} and @var{haystack-len} is the length of
1924 @var{haystack}.
1929 @deftypefun size_t strspn (const char *@var{string}, const char *@var{skipset})
1933 initial substring of @var{string} that consists entirely of bytes that
1934 are members of the set specified by the string @var{skipset}. The order
1935 of the bytes in @var{skipset} is not important.
1948 @deftypefun size_t wcsspn (const wchar_t *@var{wstring}, const wchar_t *@var{skipset})
1952 length of the initial substring of @var{wstring} that consists entirely
1954 @var{skipset}. The order of the wide characters in @var{skipset} is not
1958 @deftypefun size_t strcspn (const char *@var{string}, const char *@var{stopset})
1962 of the initial substring of @var{string} that consists entirely of bytes
1963 that are @emph{not} members of the set specified by the string @var{stopset}.
1964 (In other words, it returns the offset of the first byte in @var{string}
1965 that is a member of the set @var{stopset}.)
1978 @deftypefun size_t wcscspn (const wchar_t *@var{wstring}, const wchar_t *@var{stopset})
1982 returns the length of the initial substring of @var{wstring} that
1984 set specified by the string @var{stopset}. (In other words, it returns
1985 the offset of the first wide character in @var{string} that is a member of
1986 the set @var{stopset}.)
1989 @deftypefun {char *} strpbrk (const char *@var{string}, const char *@var{stopset})
1994 in @var{string} that is a member of the set @var{stopset} instead of the
1996 byte from @var{stopset} is found.
2012 @deftypefun {wchar_t *} wcspbrk (const wchar_t *@var{wstring}, const wchar_t *@var{stopset})
2017 wide character in @var{wstring} that is a member of the set
2018 @var{stopset} instead of the length of the initial substring. It
2019 returns a null pointer if no such wide character from @var{stopset} is found.
2025 @deftypefun {char *} index (const char *@var{string}, int @var{c})
2034 @deftypefun {char *} rindex (const char *@var{string}, int @var{c})
2055 @deftypefun {char *} strtok (char *restrict @var{newstring}, const char *restrict @var{delimiters})
2061 The string to be split up is passed as the @var{newstring} argument on
2065 the @var{newstring} argument. Calling @code{strtok} with another
2066 non-null @var{newstring} argument reinitializes the state information.
2070 The @var{delimiters} argument is a string that specifies a set of delimiters
2076 original string @var{newstring} is overwritten by a null byte, and the
2077 pointer to the beginning of the token in @var{newstring} is returned.
2081 Note that the set of delimiters @var{delimiters} do not have to be the
2084 If the end of the string @var{newstring} is reached, or if the remainder of
2093 @deftypefun {wchar_t *} wcstok (wchar_t *@var{newstring}, const wchar_t *@var{delimiters}, wchar_t …
2099 The string to be split up is passed as the @var{newstring} argument on
2103 null pointer as the @var{newstring} argument, which causes the pointer
2104 previously stored in @var{save_ptr} to be used instead.
2106 The @var{delimiters} argument is a wide string that specifies
2113 string @var{newstring} is overwritten by a null wide character, the
2114 pointer past the overwritten wide character is saved in @var{save_ptr},
2115 and the pointer to the beginning of the token in @var{newstring} is
2120 Note that the set of delimiters @var{delimiters} do not have to be the
2123 If the end of the wide string @var{newstring} is reached, or
2183 @deftypefun {char *} strtok_r (char *@var{newstring}, const char *@var{delimiters}, char **@var{sav…
2190 @var{save_ptr}, which is a pointer to a string pointer. Calling
2191 @code{strtok_r} with a null pointer for @var{newstring} and leaving
2192 @var{save_ptr} between the calls unchanged does the job without
2199 @deftypefun {char *} strsep (char **@var{string_ptr}, const char *@var{delimiter})
2203 @var{newstring} argument replaced by the @var{save_ptr} argument. The
2206 separated by @var{delimiter}, returning the address of the next token
2207 and updating @var{string_ptr} to point to the beginning of the next
2211 input string contains more than one byte from @var{delimiter} in a
2213 from @var{delimiter}. This means that a program normally should test
2250 @deftypefun {char *} basename (const char *@var{filename})
2254 component of the path in @var{filename}. This function is the preferred
2255 usage, since it does not modify the argument, @var{filename}, and
2285 @deftypefun {char *} basename (char *@var{path})
2289 spirit to the GNU version, but may modify the @var{path} by removing
2290 trailing '/' bytes. If the @var{path} is made up entirely of '/'
2291 bytes, then "/" will be returned. Also, if @var{path} is
2320 @deftypefun {char *} dirname (char *@var{path})
2325 by @var{path}. If @var{path} is @code{NULL}, an empty string, or
2401 @deftypefun void explicit_bzero (void *@var{block}, size_t @var{len})
2405 @code{explicit_bzero} writes zero into @var{len} bytes of memory
2406 beginning at @var{block}, just as @code{bzero} would. The zeroes are
2414 inline memory writes, and it may assume that @var{block} cannot be a
2439 @deftypefun {char *} strfry (char *@var{string})
2444 @code{strfry} performs an in-place shuffle on @var{string}. Each
2452 The return value of @code{strfry} is always @var{string}.
2479 @deftypefun {void *} memfrob (void *@var{mem}, size_t @var{length})
2483 The function @code{memfrob} obfuscates @var{length} bytes of data
2484 beginning at @var{mem}, in place. Each byte is bitwise xor-ed with
2486 always @var{mem}.
2504 @deftypefun {char *} l64a (long int @var{n})
2509 contains an encoded version of @var{n}. To encode a series of bytes the
2511 the empty string if @var{n} is zero, which is somewhat bizarre but
2517 value of @code{l64a} is undefined if @var{n} is negative. In the GNU
2519 return a sensible encoding for any nonzero @var{n}; however, portable
2579 @deftypefun {long int} a64l (const char *@var{string})
2582 The parameter @var{string} should contain a string which was produced by
2665 @deftypefun {error_t} argz_create (char *const @var{argv}[], char **@var{argz}, size_t *@var{argz_l…
2669 @var{argv} (a vector of pointers to normal C strings, terminated by
2671 the same elements, which is returned in @var{argz} and @var{argz_len}.
2674 …ypefun {error_t} argz_create_sep (const char *@var{string}, int @var{sep}, char **@var{argz}, size…
2678 @var{string} into an argz vector (returned in @var{argz} and
2679 @var{argz_len}) by splitting it into elements at every occurrence of the
2680 byte @var{sep}.
2683 @deftypefun {size_t} argz_count (const char *@var{argz}, size_t @var{argz_len})
2686 Returns the number of elements in the argz vector @var{argz} and
2687 @var{argz_len}.
2690 @deftypefun {void} argz_extract (const char *@var{argz}, size_t @var{argz_len}, char **@var{argv})
2693 The @code{argz_extract} function converts the argz vector @var{argz} and
2694 @var{argz_len} into a Unix-style argument vector stored in @var{argv},
2695 by putting pointers to every element in @var{argz} into successive
2696 positions in @var{argv}, followed by a terminator of @code{0}.
2697 @var{Argv} must be pre-allocated with enough space to hold all the
2698 elements in @var{argz} plus the terminating @code{(char *)0}
2699 (@code{(argz_count (@var{argz}, @var{argz_len}) + 1) * sizeof (char *)}
2701 @var{argv} point into @var{argz}---they are not copies---and so
2702 @var{argz} must be copied if it will be changed while @var{argv} is
2704 @var{argz} to an exec function (@pxref{Executing a File}).
2707 @deftypefun {void} argz_stringify (char *@var{argz}, size_t @var{len}, int @var{sep})
2710 The @code{argz_stringify} converts @var{argz} into a normal string with
2711 the elements separated by the byte @var{sep}, by replacing each
2712 @code{'\0'} inside @var{argz} (except the last one, which terminates the
2713 string) with @var{sep}. This is handy for printing @var{argz} in a
2717 @deftypefun {error_t} argz_add (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str})
2721 The @code{argz_add} function adds the string @var{str} to the end of the
2722 argz vector @code{*@var{argz}}, and updates @code{*@var{argz}} and
2723 @code{*@var{argz_len}} accordingly.
2726 …deftypefun {error_t} argz_add_sep (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str…
2730 @var{str} is split into separate elements in the result at occurrences of
2731 the byte @var{delim}. This is useful, for instance, for
2733 a value of @code{':'} for @var{delim}.
2736 …deftypefun {error_t} argz_append (char **@var{argz}, size_t *@var{argz_len}, const char *@var{buf}…
2739 The @code{argz_append} function appends @var{buf_len} bytes starting at
2740 @var{buf} to the argz vector @code{*@var{argz}}, reallocating
2741 @code{*@var{argz}} to accommodate it, and adding @var{buf_len} to
2742 @code{*@var{argz_len}}.
2745 @deftypefun {void} argz_delete (char **@var{argz}, size_t *@var{argz_len}, char *@var{entry})
2749 If @var{entry} points to the beginning of one of the elements in the
2750 argz vector @code{*@var{argz}}, the @code{argz_delete} function will
2751 remove this entry and reallocate @code{*@var{argz}}, modifying
2752 @code{*@var{argz}} and @code{*@var{argz_len}} accordingly. Note that as
2754 pointers into argz vectors such as @var{entry} will then become invalid.
2757 …eftypefun {error_t} argz_insert (char **@var{argz}, size_t *@var{argz_len}, char *@var{before}, co…
2761 The @code{argz_insert} function inserts the string @var{entry} into the
2762 argz vector @code{*@var{argz}} at a point just before the existing
2763 element pointed to by @var{before}, reallocating @code{*@var{argz}} and
2764 updating @code{*@var{argz}} and @code{*@var{argz_len}}. If @var{before}
2765 is @code{0}, @var{entry} is added to the end instead (as if by
2767 @code{*@var{argz}}, passing in @code{*@var{argz}} as the value of
2768 @var{before} will result in @var{entry} being inserted at the beginning.
2771 @deftypefun {char *} argz_next (const char *@var{argz}, size_t @var{argz_len}, const char *@var{ent…
2775 over the elements in the argz vector @var{argz}. It returns a pointer
2776 to the next element in @var{argz} after the element @var{entry}, or
2777 @code{0} if there are no elements following @var{entry}. If @var{entry}
2778 is @code{0}, the first element of @var{argz} is returned.
2784 while ((entry = argz_next (@var{argz}, @var{argz_len}, entry)))
2785 @var{action};
2793 for (entry = @var{argz};
2795 entry = argz_next (@var{argz}, @var{argz_len}, entry))
2796 @var{action};
2799 Note that the latter depends on @var{argz} having a value of @code{0} if
2804 …rgz_replace (@w{char **@var{argz}, size_t *@var{argz_len}}, @w{const char *@var{str}, const char *…
2807 Replace any occurrences of the string @var{str} in @var{argz} with
2808 @var{with}, reallocating @var{argz} as necessary. If
2809 @var{replace_count} is non-zero, @code{*@var{replace_count}} will be
2839 @deftypefun {char *} envz_entry (const char *@var{envz}, size_t @var{envz_len}, const char *@var{na…
2842 The @code{envz_entry} function finds the entry in @var{envz} with the name
2843 @var{name}, and returns a pointer to the whole entry---that is, the argz
2844 element which begins with @var{name} followed by a @code{'='} byte. If
2848 @deftypefun {char *} envz_get (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name…
2851 The @code{envz_get} function finds the entry in @var{envz} with the name
2852 @var{name} (like @code{envz_entry}), and returns a pointer to the value
2857 …deftypefun {error_t} envz_add (char **@var{envz}, size_t *@var{envz_len}, const char *@var{name}, …
2862 The @code{envz_add} function adds an entry to @code{*@var{envz}}
2863 (updating @code{*@var{envz}} and @code{*@var{envz_len}}) with the name
2864 @var{name}, and value @var{value}. If an entry with the same name
2865 already exists in @var{envz}, it is removed first. If @var{value} is
2870 …{error_t} envz_merge (char **@var{envz}, size_t *@var{envz_len}, const char *@var{envz2}, size_t @
2873 The @code{envz_merge} function adds each entry in @var{envz2} to @var{envz},
2874 as if with @code{envz_add}, updating @code{*@var{envz}} and
2875 @code{*@var{envz_len}}. If @var{override} is true, then values in @var{envz2}
2876 will supersede those with the same name in @var{envz}, otherwise not.
2879 entry in @var{envz} can prevent an entry of the same name in @var{envz2} from
2880 being added to @var{envz}, if @var{override} is false.
2883 @deftypefun {void} envz_strip (char **@var{envz}, size_t *@var{envz_len})
2886 The @code{envz_strip} function removes any null entries from @var{envz},
2887 updating @code{*@var{envz}} and @code{*@var{envz_len}}.
2890 @deftypefun {void} envz_remove (char **@var{envz}, size_t *@var{envz_len}, const char *@var{name})
2893 The @code{envz_remove} function removes an entry named @var{name} from
2894 @var{envz}, updating @code{*@var{envz}} and @code{*@var{envz_len}}.