1
2
3
4
5
6
7
8
9gd_aliases(3)                       GETDATA                      gd_aliases(3)
10
11
12

NAME

14       gd_aliases  — retrieve a list of aliases for a field in a Dirfile data‐
15       base
16
17

SYNOPSIS

19       #include <getdata.h>
20
21       const char **gd_aliases(DIRFILE *dirfile, const char *field_code);
22
23

DESCRIPTION

25       The gd_aliases() function queries a dirfile(5)  database  specified  by
26       dirfile  and returns a read-only list of aliases of the field specified
27       by field_code.
28
29       The dirfile argument must point to a valid  DIRFILE  object  previously
30       created by a call to gd_open(3).
31
32       The  array  returned  will be de-allocated by a call to gd_close(3) and
33       should not be de-allocated by the caller.  The list returned should not
34       be assumed to be in any particular order.  The array is terminated by a
35       NULL pointer.  The number of strings in the array can be obtained  from
36       a call to gd_naliases(3).
37
38       The  caller  may  not modify any strings in the array, or the array it‐
39       self.  Doing so may cause database corruption.  The pointer returned is
40       guaranteed to be valid until gd_aliases() is called again with the same
41       arguments, or until the array is de-allocated by a call to gd_close(3).
42
43

RETURN VALUE

45       Upon successful completion, gd_aliases() returns a pointer to an  array
46       of  strings  containing the values of all the aliases for the specified
47       field.  The array is terminated by a NULL pointer.  If successful, this
48       list will always contain at least one entry, to wit: field_code.
49
50       On error it returns NULL and sets the dirfile error to a non-zero error
51       value.  Possible error values are:
52
53       GD_E_ALLOC
54               The library was unable to allocate memory.
55
56       GD_E_BAD_CODE
57               The specified field code was not found in the database.
58
59       GD_E_BAD_DIRFILE
60               The supplied dirfile was invalid.
61
62       The dirfile error may be retrieved by calling gd_error(3).  A  descrip‐
63       tive error string for the last error encountered can be obtained from a
64       call to gd_error_string(3).
65
66

HISTORY

68       The gd_aliases() function appeared in GetData-0.8.0.
69
70

SEE ALSO

72       gd_open(3), gd_alias_target(3), gd_naliases(3), dirfile(5)
73
74
75
76Version 0.10.0                 25 December 2016                  gd_aliases(3)
Impressum