gd_nentries, gd_nfields, gd_nfields_by_type gd_nmfields,
- Provided by: libgetdata-doc (Version: 0.9.0-2.2)
- Source: libgetdata
- Report a bug
#include <getdata.h>
unsigned int gd_nentries(DIRFILE *dirfile, const char *parent, unsigned int type, unsigned int flags);
unsigned int gd_nfields(DIRFILE *dirfile);
unsigned int gd_nfields_by_type(DIRFILE *dirfile, gd_entype_t type);
unsigned int gd_nmfields(DIRFILE *dirfile, const char *parent);
unsigned int gd_nmfields_by_type(DIRFILE *dirfile, const char *parent, gd_entype_t type);
unsigned int gd_nmvectors(DIRFILE *dirfile, const char *parent);
unsigned int gd_nvectors(DIRFILE *dirfile);
The gd_nentries() function queries a dirfile(5) database specified by dirfile and returns a count of metadata 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 count:
(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 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 return the number of 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_entry_list(3), gd_error(3), gd_error_string(3), gd_hidden(3)