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

NAME

14       gd_protection — report the protection level of a Dirfile fragment
15
16

SYNOPSIS

18       #include <getdata.h>
19
20       int gd_protection(DIRFILE *dirfile, int fragment_index);
21
22

DESCRIPTION

24       The gd_protection() function queries a dirfile(5) database specified by
25       dirfile and determines the advisory protection level for  the  fragment
26       indexed by fragment_index.
27
28

RETURN VALUE

30       Upon  successful completion, gd_protection() returns a non-negative in‐
31       teger indicating the the advisory protection  level  of  the  specified
32       fragment.  This integer will equal one of the following symbols:
33
34              GD_PROTECT_NONE, GD_PROTECT_FORMAT, GD_PROTECT_DATA,
35              GD_PROTECT_ALL.
36
37       The   meaning   of    these    symbols    are    explained    in    the
38       gd_alter_protection(3)  man page.  On error, it returns a negative-val‐
39       ued error code.  Possible error codes are:
40
41       GD_E_BAD_DIRFILE
42               The supplied dirfile was invalid.
43
44       GD_E_BAD_INDEX
45               The supplied index was out of range.
46
47       The error code is also stored in the DIRFILE  object  and  may  be  re‐
48       trieved after this function returns by calling gd_error(3).  A descrip‐
49       tive  error  string  for  the  error  may  be   obtained   by   calling
50       gd_error_string(3).
51
52

HISTORY

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

SEE ALSO

63       gd_open(3),  gd_alter_protection(3),  gd_error(3),  gd_error_string(3),
64       dirfile(5), dirfile-format(5)
65
66
67
68Version 0.10.0                 25 December 2016               gd_protection(3)
Impressum