1get_field_list(3)                   GETDATA                  get_field_list(3)
2
3
4

NAME

6       get_field_list — retrieve a list of fields in a dirfile
7

SYNOPSIS

9       #include <getdata.h>
10
11       const char **get_field_list(DIRFILE *dirfile);
12

DESCRIPTION

14       The  get_field_list()  function queries a dirfile(5) database specified
15       by dirfile and returns a read-only list of names of the all fields  de‐
16       fined  in the database.  Notably, this list does not include /META sub‐
17       fields.
18
19       The dirfile argument must point to a valid  DIRFILE  object  previously
20       created by a call to dirfile_open(3).
21
22       The  array  returned will be de-allocated by a call to dirfile_close(3)
23       and should not be de-allocated by the caller.  The list returned should
24       not  be assumed to be in any particular order.  The array is terminated
25       by a NULL pointer.  The number of strings in the array can be  obtained
26       from a call to get_nfields(3).
27
28       The  caller  may  not modify any strings in the array, or the array it‐
29       self.  Doing so may cause database corruption.  The pointer returned is
30       guaranteed  to  be  valid until get_field_list() is called again on the
31       same DIRFILE object, or until the array is deallocated  by  a  call  to
32       dirfile_close(3).
33
34

RETURN VALUE

36       Upon  successful  completion,  get_field_list() returns a pointer to an
37       array of strings containing the names of all the fields defined in  the
38       dirfile  database.  On error it returns NULL and sets the dirfile error
39       to a non-zero error value.  Possible error values are:
40
41       GD_E_ALLOC
42               The library was unable to allocate memory.
43
44       GD_E_BAD_DIRFILE
45               The supplied dirfile was invalid.
46
47       The dirfile error may be retrieved by calling get_error(3).  A descrip‐
48       tive error string for the last error encountered can be obtained from a
49       call to get_error_string(3).
50

SEE ALSO

52       dirfile(5),   dirfile_open(3),    get_error(3),    get_error_string(3),
53       get_field_list_by_type(3), get_mfield_list(3), get_nfields(3), get_vec‐
54       tor_list(3)
55
56
57
58Version 0.5.0                   8 December 2008              get_field_list(3)
Impressum