1get_protection(3)                   GETDATA                  get_protection(3)
2
3
4

NAME

6       get_protection — report the protection level of a dirfile fragment
7

SYNOPSIS

9       #include <getdata.h>
10
11       int get_protection(DIRFILE *dirfile, int fragment_index);
12

DESCRIPTION

14       The  get_protection()  function queries a dirfile(5) database specified
15       by dirfile and returns the advisory protection level for  the  fragment
16       indexed by fragment_index.
17
18

RETURN VALUE

20       Upon  successful completion, get_protection() returns the advisory pro‐
21       tection level of the specified fragment, which will be one of the  fol‐
22       lowing symbols.
23
24              GD_PROTECT_NONE, GD_PROTECT_FORMAT, GD_PROTECT_DATA,
25              GD_PROTECT_ALL.
26
27       The meaning of these symbols are explained  in  the  dirfile_protect(3)
28       man page.  On error, it returns -1 and sets the dirfile error to a non-
29       zero error value.  Possible error values are:
30
31       GD_E_BAD_DIRFILE
32               The supplied dirfile was invalid.
33
34       GD_E_BAD_INDEX
35               The supplied index was out of range.
36
37       The dirfile error may be retrieved by calling get_error(3).  A descrip‐
38       tive error string for the last error encountered can be obtained from a
39       call to get_error_string(3).
40

SEE ALSO

42       dirfile_open(3), dirfile_protect(3), getdata(3), get_error(3),  get_er‐
43       ror_string(3), dirfile(5), dirfile-format(5)
44
45
46
47Version 0.5.0                  14 December 2008              get_protection(3)
Impressum