ARGZ_ADD


HOME

ARGZ_ADD

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
CONFORMING TO
BUGS
SEE ALSO
COLOPHON

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 (bufbuf_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 (argzargz_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 (argzargz_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.

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 3.69 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 http://www.kernel.org/doc/man−pages/.




More Linux Commands

manpages/ExtUtils::Mksymlists.3pm.html
ExtUtils::Mksymlists(3pm) - write linker options files for d
ExtUtils::Mksymlists produces files used by the linker under some OSs during the creation of shared libraries for dynamic extensions. It is normally called from

manpages/Tcl_OpenCommandChannel.3.html
Tcl_OpenCommandChannel(3) - buffered I/O facilities using ch
The Tcl channel mechanism provides a device-independent and platform-independent mechanism for performing buffered input and output operations on a variety of f

manpages/exp.3.html
exp(3) - base-e exponential function - Linux manual page....
The exp() function returns the value of e (the base of natural logarithms) raised to the power of x. RETURN VALUE On success, these functions return the exponen

manpages/atanf.3.html
atanf(3) - arc tangent function (Library - Linux man page)
The atan() function calculates the principal value of the arc tangent of x; that is the value whose tangent is x. RETURN VALUE On success, these functions retur

manpages/sed.1.html
sed(1) - stream editor for filtering and transforming text
Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). While in some ways s

manpages/resizecons.8.html
resizecons(8) change kernel idea of the console size........
The resizecons command tries to change the videomode of the console. There are several aspects to this: (a) the kernel must know about it, (b) the hardware must

manpages/XcmsTekHVCQueryMaxVSamples.3.html
XcmsTekHVCQueryMaxVSamples(3) - obtain the TekHVC coordinate
The XcmsTekHVCQueryMaxC function, given a Hue and Value, determines the maximum Chroma in TekHVC color space displayable by the screen. It returns the maximum C

manpages/slattach.8.html
slattach(8) - attach a network interface to a serial line...
Slattach is a tiny little program that can be used to put a normal terminal (serial) line into one of several network modes, thus allowing you to use it for poi

manpages/gnutls_x509_trust_list_deinit.3.html
gnutls_x509_trust_list_deinit(3) - API function (Man Page)
This function will deinitialize a trust list. SINCE 3.0.0 REPORTING BUGS Report bugs to &lt;bug-gnutls@gnu.org&gt;. GnuTLS home page: http://www.gnu.org/software/gnut

manpages/TAP::Parser::Aggregator.3pm.html
TAP::Parser::Aggregator(3pm) - Aggregate TAP::Parser results
TAP::Parser::Aggregator collects parser objects and allows reporting/querying their aggregate results. METHODS Class Methods new my $aggregate = TAP::Parser::Ag

manpages/qecvt_r.3.html
qecvt_r(3) - convert a floating-point number to a string....
qecvt_r.3 - The functions ecvt_r(), fcvt_r(), qecvt_r() and qfcvt_r() are identical to ecvt(3), fcvt(3), qecvt(3) and qfcvt(3), respectively, except that they d

manpages/crl.1ssl.html
crl(1ssl) - CRL utility (Commands - Linux manual page)......
The crl command processes CRL files in DER or PEM format. COMMAND OPTIONS -inform DER|PEM This specifies the input format. DER format is DER encoded CRL structu





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