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

NAME

14       gd_fragment_index — retrieve the fragment containing a Dirfile field
15
16

SYNOPSIS

18       #include <getdata.h>
19
20       int gd_fragment_index(const DIRFILE *dirfile, const char *entry_name);
21
22

DESCRIPTION

24       The  gd_fragment_index()  function queries a dirfile(5) database speci‐
25       fied by dirfile and returns the index number of the  fragment  defining
26       the field or alias named entry_name.
27
28       This  is one of the few GetData functions which does not resolve alias‐
29       es: supplying the name of an alias as entry_name will return the  index
30       of the fragment containing the alias itself and not that of its target.
31
32

RETURN VALUE

34       Upon  successful  completion, gd_fragment_index() returns the requested
35       fragment index, which is never negative.  On error, gd_fragment_index()
36       returns a negative-valued error code.  Possible error codes are:
37
38       GD_E_BAD_CODE
39               The  entry  specified  by entry_name was not found in the data‐
40               base.
41
42       GD_E_BAD_DIRFILE
43               The supplied dirfile was invalid.
44
45       The error code is also stored in the DIRFILE  object  and  may  be  re‐
46       trieved after this function returns by calling gd_error(3).  A descrip‐
47       tive  error  string  for  the  error  may  be   obtained   by   calling
48       gd_error_string(3).
49
50

HISTORY

52       The get_fragment_index() function appeared in GetData-0.5.0.
53
54       In GetData-0.7.0, this function was renamed to gd_fragment_index().
55
56       In  GetData-0.10.0, the error return from this function changed from -1
57       to a negative-valued error code.
58
59

SEE ALSO

61       gd_open(3),     gd_entry(3),      gd_error(3),      gd_error_string(3),
62       gd_fragmentname(3), gd_parent_fragment(3), dirfile(5)
63
64
65
66Version 0.10.0                 25 December 2016           gd_fragment_index(3)
Impressum