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

NAME

14       gd_uninclude — remove a format specification fragment from a Dirfile
15
16

SYNOPSIS

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

DESCRIPTION

24       The gd_uninclude() removes the format specification fragment indexed by
25       fragment_index from the specified dirfile, as well as any fragments the
26       indicated  fragment  INCLUDEs.  Fields defined in the removed fragments
27       will be removed from the dirfile.
28
29       Before removing the specified fragment, all pending writes are  flushed
30       to RAW fields defined the the removed fragments.  If del is zero, meta‐
31       data changes will also be written to the removed fragments.  If del  is
32       non-zero, the format specification fragments will be deleted from disk,
33       if possible.  Regardless of the value of del, binary data files associ‐
34       ated  with  RAW  fields  defined  in  the removed fragments will not be
35       deleted.  To delete these binary files, use gd_delete(3) before calling
36       this function.
37
38       The  primary format specification (the fragment indexed by zero) cannot
39       be removed from the dirfile.
40
41

RETURN VALUE

43       On success, gd_uninclude() returns zero.  On error,  a  negative-valued
44       error code is returned.  Possible error codes are:
45
46       GD_E_ACCMODE
47               The supplied dirfile was opened in read-only mode.
48
49       GD_E_ALLOC
50               The library was unable to allocate memory.
51
52       GD_E_BAD_DIRFILE
53               The supplied dirfile was invalid.
54
55       GD_E_BAD_INDEX
56               The supplied fragment index was out of range, or an attempt was
57               made to remove the primary format specification.
58
59       GD_E_IO An I/O error occurred while trying to write  modified  data  or
60               metadata to disk.
61
62       GD_E_PROTECTED
63               The  metadata  of the fragment which included the removed frag‐
64               ment was protected from change.
65
66       The error code is also stored in the DIRFILE  object  and  may  be  re‐
67       trieved after this function returns by calling gd_error(3).  A descrip‐
68       tive  error  string  for  the  error  may  be   obtained   by   calling
69       gd_error_string(3).
70
71

NOTES

73       This  function re-arranges the remaining format specification fragments
74       in some unspecified way, except for  the  primary  fragment,  which  is
75       guaranteed  to remain at index zero.  Callers which cache format speci‐
76       fication fragment indices must re-initialise their cache after  calling
77       this function.
78
79

HISTORY

81       The dirfile_uninclude() function appeared in GetData-0.5.0.
82
83       In GetData-0.7.0, this function was renamed to gd_uninclude().
84
85       In  GetData-0.10.0, the error return from this function changed from -1
86       to a negative-valued error code.
87
88

SEE ALSO

90       gd_delete(3),       gd_include(3),       gd_open(3),       gd_error(3),
91       gd_error_string(3),        gd_fragmentname(3),        gd_nfragments(3),
92       gd_reference(3), dirfile(5), dirfile-encoding(5), dirfile-format(5)
93
94
95
96Version 0.10.0                 25 December 2016                gd_uninclude(3)
Impressum