1get_nfields_by_type(3) GETDATA get_nfields_by_type(3)
2
3
4
6 get_nfields_by_type — report the number of fields of a given type in a
7 dirfile
8
10 #include <getdata.h>
11
12 unsigned int get_nfields_by_type(DIRFILE *dirfile, gd_entype_t type);
13
15 The get_nfields_by_type() function queries a dirfile(5) database speci‐
16 fied by dirfile and returns the number of fields of type type defined
17 in the database. Notably, this count does not include /META fields.
18
19 The dirfile argument must point to a valid DIRFILE object previously
20 created by a call to dirfile_open(3). The type argument should be one
21 of the following symbols indicating the type of field to count:
22
23 GD_RAW_ENTRY, GD_LINCOM_ENTRY, GD_LINTERP_ENTRY,
24 GD_BIT_ENTRY, GD_MULTIPLY_ENTRY, GD_PHASE_ENTRY,
25 GD_CONST_ENTRY, GD_STRING_ENTRY, GD_INDEX_ENTRY
26
27
29 Upon successful completion, get_nfields_by_type() returns the number of
30 defined fields in the dirfile. On error, it returns zero and sets the
31 dirfile error to a non-zero error value. Possible error values are:
32
33 GD_E_BAD_DIRFILE
34 The supplied dirfile was invalid.
35
36 The dirfile error may be retrieved by calling get_error(3). A descrip‐
37 tive error string for the last error encountered can be obtained from a
38 call to get_error_string(3).
39
41 dirfile(5), dirfile_open(3), getdata(3), get_error(3), get_er‐
42 ror_string(3), get_field_list_by_type(3), get_nfields(3), get_nm‐
43 fields_by_type(3)
44
45
46
47Version 0.5.0 8 December 2008 get_nfields_by_type(3)