argz(3)


NAME

   argz_add,    argz_add_sep,    argz_append,   argz_count,   argz_create,
   argz_create_sep,  argz_delete,  argz_extract,  argz_insert,  argz_next,
   argz_replace, argz_stringify - functions to handle an argz list

SYNOPSIS

   #include <argz.h>

   error_t argz_add(char **argz, size_t *argz_len, const char *str);

   error_t argz_add_sep(char **argz, size_t *argz_len,
                        const char *str, int delim);

   error_t argz_append(char **argz, size_t *argz_len,
                        const char *buf, size_t buf_len);

   size_t argz_count(const char *argz, size_t argz_len);

   error_t argz_create(char * const argv[], char **argz,
                        size_t *argz_len);

   error_t argz_create_sep(const char *str, int sep, char **argz,
                        size_t *argz_len);

   void argz_delete(char **argz, size_t *argz_len, char *entry);

   void argz_extract(const char *argz, size_t argz_len, char  **argv);

   error_t argz_insert(char **argz, size_t *argz_len, char *before,
                        const char *entry);

   char *argz_next(const char *argz, size_t argz_len, const char *entry);

   error_t argz_replace(char **argz, size_t *argz_len, const char *str,
                        const char *with, unsigned int *replace_count);

   void argz_stringify(char *argz, size_t 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.

   argz_add() adds the string str at the  end  of  the  array  *argz,  and
   updates *argz and *argz_len.

   argz_add_sep()  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 ':'.

   argz_append()    appends   the   argz   vector   (buf, buf_len)   after
   (*argz, *argz_len) and updates *argz and *argz_len.   (Thus,  *argz_len
   will be increased by buf_len.)

   argz_count()  counts the number of strings, that is, the number of null
   bytes ('\0'), in (argz, argz_len).

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

   argz_create_sep()  converts the null-terminated string str into an argz
   vector (*argz, *argz_len) by breaking it up at every occurrence of  the
   separator sep.

   argz_delete()  removes  the substring pointed to by entry from the argz
   vector (*argz, *argz_len) and updates *argz and *argz_len.

   argz_extract() is the opposite of argz_create().   It  takes  the  argz
   vector  (argz, argz_len)  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 argz_count(argz, argz_len) +
   1 pointers.

   argz_insert()  is  the  opposite  of  argz_delete().   It  inserts  the
   argument    entry   at   position   before   into   the   argz   vector
   (*argz, *argz_len) and updates *argz and *argz_len.  If before is NULL,
   then entry will inserted at the end.

   argz_next()  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.

   argz_replace()  replaces each occurrence of str with with, reallocating
   argz as necessary.  If replace_count is non-NULL,  *replace_count  will
   be incremented by the number of replacements.

   argz_stringify()  is  the opposite of argz_create_sep().  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
   error_t, 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   
   
   argz_add(), argz_add_sep(),        Thread safety  MT-Safe 
   argz_append(), argz_count(),                              
   argz_create(), argz_create_sep(),                         
   argz_delete(), argz_extract(),                            
   argz_insert(), argz_next(),                               
   argz_replace(), argz_stringify()                          
   

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

   envz_add(3)

COLOPHON

   This  page  is  part of release 4.09 of the Linux man-pages project.  A
   description of the project, information about reporting bugs,  and  the
   latest     version     of     this    page,    can    be    found    at
   https://www.kernel.org/doc/man-pages/.

                              2015-03-02                       ARGZ_ADD(3)


More Linux Commands

manpages/FcAtomicReplaceOrig.3.html
FcAtomicReplaceOrig(3) - replace original with new (ManPage)
Replaces the original file referenced by atomic with the new file. Returns FcFalse if the file cannot be replaced due to permission issues in the filesystem. Ot

manpages/gnutls_openpgp_keyring_check_id.3.html
gnutls_openpgp_keyring_check_id(3) - API function (ManPage)
Check if a given key ID exists in the keyring. RETURNS GNUTLS_E_SUCCESS on success (if keyid exists) and a negative error code on failure. REPORTING BUGS Report

manpages/ExtUtils::XSSymSet.3pm.html
ExtUtils::XSSymSet(3pm) - keep sets of symbol names palatabl
Since the VMS linker distinguishes symbols based only on the first 31 characters of their names, it is occasionally necessary to shorten symbol names in order t

manpages/uselocale.3.html
uselocale(3) set get the locale for the calling thread......
The uselocale() function sets the current locale for the calling thread, and returns the threads previously current locale. After a successful call to uselocale

manpages/git-shortlog.1.html
git-shortlog(1) - Summarize git log output - Linux man page
Summarizes git log output in a format suitable for inclusion in release announcements. Each commit will be grouped by author and title. Additionally, [PATCH] wi

manpages/SDL_CDResume.3.html
SDL_CDResume(3) - Resumes a CDROM - Linux manual page.......
Resumes play on the given cdrom. RETURN VALUE Returns 0 on success, or -1 on an error. SEE ALSO SDL_CDPlay, SDL_CDPause SDL_CDResume.3 (Library - Linux manual p

manpages/rateup.1.html
rateup(1) backend tool used by mrtg - Linux manual page.....
This manual page documents briefly the rateup command. This manual page was written for the Debian GNU/Linux distribution because the original program does not

manpages/gnucash.1.html
gnucash(1) personal finance manager - Linux manual page.....
GnuCash is a personal accounting package that allows you to record and track income, expenses, assets, and investments. It supports reconciliation, has substant

manpages/gnutls_credentials_set.3.html
gnutls_credentials_set(3) - API function - Linux man page...
Sets the needed credentials for the specified type. Eg username, password - or public and private keys etc. The cred parameter is a structure that depends on th

manpages/rt_tgsigqueueinfo.2.html
rt_tgsigqueueinfo(2) - queue a signal and data to a process
RETURN VALUE ERRORS VERSIONS CONFORMING TO NOTES SEE ALSO COLOPHON NAME rt_sigqueueinfo - queue a signal and data to a process SYNOPSIS long sys_rt_sigqueueinfo

manpages/fputwc.3.html
fputwc(3) - write a wide character to a FILE stream.........
fputwc.3 - The fputwc() function is the wide-character equivalent of the fputc(3) function. It writes the wide character wc to stream. If ferror(stream) becomes

manpages/frexpl.3.html
frexpl(3) - convert floating-point number to fractional and
The frexp() function is used to split the number x into a normalized fraction and an exponent which is stored in exp. RETURN VALUE The frexp() function returns





We can't live, work or learn in freedom unless the software we use is free.