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


#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 *

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

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 *

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);


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.


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.


These functions are a GNU extension. Handle with care.


Argz vectors without a terminating null byte may lead to Segmentation Faults.




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−pages/.

More Linux Commands

UNIVERSAL(3pm) - base class for ALL classes (blessed referen
UNIVERSAL is the base class from which all blessed references inherit. See perlobj. UNIVERSAL provides the following methods: $obj-&gt;isa( TYPE ) CLASS-&gt;isa( TYPE

XML::DOM::Text(3pm) - A piece of XML text in XML::DOM.......
XML::DOM::Text extends XML::DOM::CharacterData, which extends XML::DOM::Node. The Text interface represents the textual content (termed character data in XML )

CPAN::Version(3pm) - utility functions to compare CPAN versi
This module mediates between some version that perl sees in a package and the version that is published by the CPAN indexer. Its only written as a helper module

systemd-remount-fs.service(8) Remount root and kernel file s
systemd-remount-fs.service is an early-boot service that applies mount options listed in fstab(5) to the root file system, the /usr file system and the kernel A

cexp2l(3) - base-2 exponent of a complex number (Man Page)
The function returns 2 raised to the power of z. CONFORMING TO These function names are reserved for future use in C99. AVAILABILITY Not yet in glibc, as at ver

Xvnc(1) the X VNC server (Commands - Linux manual page).....
Xvnc is the X VNC (Virtual Network Computing) server. It is based on a standard X server, but it has a virtual screen rather than a physical one. X applications

XTestFakeMotionEvent(3) - XTest extension functions.........
This extension is a minimal set of client and server extensions required to completely test the X11 server with no user intervention. This extension is not inte

glGetMapiv(3gl) - return evaluator parameters (Man Page)....
glMap1 and glMap2 define evaluators. glGetMap returns evaluator parameters. target chooses a map, query selects a specific parameter, and v points to storage wh

Tk_CanvasTkwin(3) - utility procedures for canvas type manag
These procedures are called by canvas type managers to perform various utility functions. Tk_CanvasTkwin returns the Tk_Window associated with a particular canv

gnutls_x509_crl_sign2(3) - API function - Linux manual page
gnutls_x509_crl_sign2.3 - This function will sign the CRL with the issuers private key, and will copy the issuers information into the CRL. This must be the las

Tcl_AppendAllObjTypes(3) - manipulate Tcl object types......
The procedures in this man page manage Tcl object types. They are used to register new object types, look up types, and force conversions from one type to anoth

mouse(4) - serial mouse interface - Linux manual page.......
Introduction The pinout of the usual 9 pin plug as used for serial mice is: This is the specification, in fact 9 V suffices with most mice. The mouse driver can

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