1
2
3
4
5
6
7
8
9gd_alter_protection(3) GETDATA gd_alter_protection(3)
10
11
12
14 gd_alter_protection — modify the protection level of a Dirfile fragment
15
16
18 #include <getdata.h>
19
20 int gd_alter_protection(DIRFILE *dirfile, int protection_level, int
21 fragment_index);
22
23
25 The gd_alter_protection() function sets the advisory protection level
26 of the format specification fragment given by fragment_index to
27 protection_level in the dirfile(5) database specified by dirfile.
28
29 The protection_level argument should be one of the following:
30
31 GD_PROTECT_NONE
32 Indicating that the fragment should not be protected at all.
33
34 GD_PROTECT_FORMAT
35 Indicating that the fragment's metadata should be protected.
36
37 GD_PROTECT_DATA
38 Indicating that the fragment's binary data should be protected.
39
40 GD_PROTECT_ALL
41 Indicating that both the fragment's metadata and its binary da‐
42 ta should be protected. This symbol is equivalent to the bit‐
43 wise or of GD_PROTECT_FORMAT and GD_PROTECT_DATA.
44
45 In addition to being simply a valid fragment index, fragment_index may
46 also be the special value GD_ALL_FRAGMENTS, which indicates that the
47 protection level of all fragments in the database should be changed.
48
49
51 Upon successful completion, gd_alter_protection() returns zero. On er‐
52 ror, it returns a negative-valued error code. Possible error codes
53 are:
54
55 GD_E_ACCMODE
56 The specified dirfile was opened read-only.
57
58 GD_E_ARGUMENT
59 The supplied protection_level was invalid.
60
61 GD_E_BAD_DIRFILE
62 The supplied dirfile was invalid.
63
64 GD_E_BAD_INDEX
65 The supplied index was out of range.
66
67 GD_E_BAD_PROTECTION
68 The supplied protection level was invalid.
69
70 The error code is also stored in the DIRFILE object and may be re‐
71 trieved after this function returns by calling gd_error(3). A descrip‐
72 tive error string for the error may be obtained by calling
73 gd_error_string(3).
74
75
77 This is the only GetData function which ignores the (existing) protec‐
78 tion level of a format specification fragment.
79
80
82 The function dirfile_protect() appeared in GetData-0.5.0.
83
84 In GetData-0.7.0, this function was renamed to gd_alter_protection().
85
86 In GetData-0.10.0, the error return from this function changed from -1
87 to a negative-valued error code.
88
89
91 gd_error(3), gd_error_string(3), gd_protection(3), gd_open(3)
92
93
94
95Version 0.10.0 25 December 2016 gd_alter_protection(3)