gd_entry_list, gd_field_list, gd_field_list_by_type
- Provided by: libgetdata-doc (Version: 0.9.0-2.2)
- Source: libgetdata
- Report a bug
#include <getdata.h>
const char **gd_entry_list(DIRFILE *dirfile, const char *parent, unsigned int type, unsigned int flags);
const char **gd_field_list(DIRFILE *dirfile);
const char **gd_field_list_by_type(DIRFILE *dirfile, gd_entype_t type);
const char **gd_mfield_list(DIRFILE *dirfile, const char *parent);
const char **gd_mfield_list_by_type(DIRFILE *dirfile, const char *parent, gd_entype_t type);
const char **gd_mvector_list(DIRFILE *dirfile, const char *parent);
const char **gd_vector_list(DIRFILE *dirfile);
The gd_entry_list() function queries a dirfile(5) database specified by dirfile and returns a list of names of field entries satisfying the supplied criteria. If parent is non-NULL, metafields under the field specified by parent are considered; otherwise, top-level fields are considered, and metafields ignored.
The type argument should be one of the following symbols indicating an explicit entry type to list:
(GD_INDEX_ENTRY is a special field type for the implicit INDEX field) or else one of the following special symbols:
The flags argument should be zero or more of the following flags, bitwise or'd together:
The array returned will be de-allocated by a call to gd_close(3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order. The array is terminated by a NULL pointer. The number of elements in the array, excluding the terminating NULL, can be obtained from an equivalent call to gd_nentries(3).
The caller may not modify any strings in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid at least until gd_entry_list() is called again on the same DIRFILE object, or until the array is de-allocated by a call to gd_close(3). (Although the data may have become obsolete, if metadata have been modified in the interrim.)
The call
is equivalent to
The call
is equivalent to
The call
is equivalent to
The call
is equivalent to
The call
is equivalent to
The call
is equivalent to
Upon successful completion, these functions returns a pointer to an array of strings containing the names of all the entries in the database satisfying the supplied criteria. On error, they return zero and sets the dirfile error to a non-zero error value. Possible error values are:
The dirfile error may be retrieved by calling gd_error(3). A descriptive error string for the last error encountered can be obtained from a call to gd_error_string(3).
dirfile(5), gd_open(3), gd_error(3), gd_error_string(3), gd_hidden(3), gd_nentries(3)