1
2
3
4
5
6
7
8
9gd_alias_target(3) GETDATA gd_alias_target(3)
10
11
12
14 gd_alias_target — determine the target of an alias defined in a Dirfile
15 database
16
17
19 #include <getdata.h>
20
21 const char *gd_alias_target(DIRFILE *dirfile, const char *alias_name);
22
23
25 The gd_alias_target() function queries a dirfile(5) database specified
26 by dirfile and determines the target field code of the alias specified
27 by alias_name.
28
29 The dirfile argument must point to a valid DIRFILE object previously
30 created by a call to gd_open(3).
31
32 Note: the target may itself be the an alias, which will have its own
33 target. To obtain the canonical name of the field ultimately refer‐
34 enced by alias_name, pass it to gd_entry(3) and inspect the field mem‐
35 ber of the gd_entry_t structure returned.
36
37
39 Upon successful completion, gd_alias_target() returns a pointer to a
40 read-only character string containing the name of the target of the
41 specified alias. On error, gd_alias_target() returns NULL and sets the
42 dirfile error a non-zero error value. Possible error values are:
43
44 GD_E_BAD_CODE
45 The name alias_name was not found in the dirfile.
46 GD_E_BAD_DIRFILE The supplied dirfile was invalid.
47
48 GD_E_BAD_FIELD_TYPE
49 The entry specified by alias_name was not an alias.
50
51 The dirfile error may be retrieved by calling gd_error(3). A descrip‐
52 tive error string for the last error encountered can be obtained from a
53 call to gd_error_string(3).
54
55
57 The function gd_alias_target() appeared in GetData-0.8.0.
58
59
61 gd_aliases(3), gd_entry(3), gd_open(3), dirfile(5)
62
63
64
65Version 0.10.0 25 December 2016 gd_alias_target(3)