Manual Pages for Linux CentOS command on man argz_append
MyWebUniversity

Manual Pages for Linux CentOS command on man argz_append

ARGZADD(3) Linux Programmer's Manual ARGZADD(3)

NAME argzadd, argzaddsep, argzappend, argzcount, argzcreate, argzcre‐ atesep, argzdelete, argzextract, argzinsert, argznext,

argzreplace, argzstringify - functions to handle an argz list SYNOPSIS

#include errort argzadd(char **argz, sizet *argzlen, const char *str); errort argzaddsep(char **argz, sizet *argzlen, const char *str, int delim); errort argzappend(char **argz, sizet *argzlen, const char *buf, sizet buflen); sizet argzcount(const char *argz, sizet argzlen); errort argzcreate(char * const argv[], char **argz, sizet *argzlen); errort argzcreatesep(const char *str, int sep, char **argz, sizet *argzlen); errort argzdelete(char **argz, sizet *argzlen, char *entry); void argzextract(char *argz, sizet argzlen, char **argv); errort argzinsert(char **argz, sizet *argzlen, char *before, const char *entry); char *argznext(char *argz, sizet argzlen, const char *entry); errort argzreplace(char **argz, sizet *argzlen, const char *str, const char *with, unsigned int *replacecount); void argzstringify(char *argz, sizet len, int sep); DESCRIPTION

These functions are glibc-specific. An argz vector is a pointer to a character buffer together with a length. The intended interpretation of the character buffer is an array of strings, where the strings are separated by null bytes ('\0'). If the length is nonzero, the last byte of the buffer must be a null byte. These functions are for handling argz vectors. The pair (NULL,0) is an argz vector, and, conversely, argz vectors of length 0 must have NULL pointer. Allocation of nonempty argz vectors is done using malloc(3), so that free(3) can be used to dispose of them again. argzadd() adds the string str at the end of the array *argz, and updates *argz and *argzlen. argzaddsep() is similar, but splits the string str into substrings separated by the delimiter delim. For example, one might use this on a UNIX search path with delimiter ':'. argzappend() appends the argz vector (buf, buflen) after (*argz, *argzlen) and updates *argz and *argzlen. (Thus, *argzlen will be increased by buflen.) argzcount() counts the number of strings, that is, the number of null bytes ('\0'), in (argz, argzlen).

argzcreate() converts a UNIX-style argument vector argv, terminated by (char *) 0, into an argz vector (*argz, *argzlen).

argzcreatesep() converts the null-terminated string str into an argz vector (*argz, *argzlen) by breaking it up at every occurrence of the separator sep. argzdelete() removes the substring pointed to by entry from the argz vector (*argz, *argzlen) and updates *argz and *argzlen. argzextract() is the opposite of argzcreate(). It takes the argz vector (argz, argzlen) and fills the array starting at argv with

pointers to the substrings, and a final NULL, making a UNIX-style argv vector. The array argv must have room for argzcount(argz,argzlen) + 1 pointers. argzinsert() is the opposite of argzdelete(). It inserts the argu‐ ment entry at position before into the argz vector (*argz, *argzlen) and updates *argz and *argzlen. If before is NULL, then entry will inserted at the end. argznext() is a function to step trough the argz vector. If entry is NULL, the first entry is returned. Otherwise, the entry following is returned. It returns NULL if there is no following entry. argzreplace() replaces each occurrence of str with with, reallocating

argz as necessary. If replacecount is non-NULL, *replacecount will be incremented by the number of replacements. argzstringify() is the opposite of argzcreatesep(). It transforms the argz vector into a normal string by replacing all null bytes ('\0') except the last by sep. RETURN VALUE All argz functions that do memory allocation have a return type of errort, and return 0 for success, and ENOMEM if an allocation error occurs. ATTRIBUTES For an explanation of the terms used in this section, see attributes(7). ┌──────────────────────────────────┬───────────────┬─────────┐ │Interface │ Attribute │ Value │ ├──────────────────────────────────┼───────────────┼─────────┤

│argzadd(), argzaddsep(), │ Thread safety │ MT-Safe │ │argzappend(), argzcount(), │ │ │ │argzcreate(), argzcreatesep(), │ │ │ │argzdelete(), argzextract(), │ │ │ │argzinsert(), argznext(), │ │ │ │argzreplace(), argzstringify() │ │ │ └──────────────────────────────────┴───────────────┴─────────┘ CONFORMING TO These functions are a GNU extension. Handle with care. BUGS Argz vectors without a terminating null byte may lead to Segmentation Faults. SEE ALSO envzadd(3) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

2007-05-18 ARGZADD(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™