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

NAME

14       gd_invalid_dirfile — obtain an pointer to an invalid DIRFILE object
15
16

SYNOPSIS

18       #include <getdata.h>
19
20       DIRFILE* gd_invalid_dirfile(void);
21
22

DESCRIPTION

24       The  gd_invalid_dirfile()  returns  a pointer to a newly allocated, in‐
25       valid DIRFILE object.  Like  any  other  DIRFILE  object,  the  invalid
26       DIRFILE  object  should  be  de-allocated  by  calling  gd_close(3)  or
27       gd_discard(3) when it is no longer needed.
28
29       The DIRFILE object returned may be passed to any other GetData function
30       which  requires  one, but doing so will inevitably result in that func‐
31       tion failing with the GD_BAD_DIRFILE error.
32
33       A similar effect can be achieved by making an invalid gd_open(3)  call,
34       such as:
35
36              gd_open("", 0);
37
38       which also returns a pointer to an invalid DIRFILE object.  The differ‐
39       ence is that an invalid DIRFILE created in this way has a non-zero  er‐
40       ror  code (obtainable with gd_error(3)), while the dirfile error of the
41       invalid DIRFILE returned by gd_invalid_dirfile(3) is  zero  (indicating
42       success).
43
44

RETURN VALUE

46       This  function  always  returns a pointer to a newly allocated, invalid
47       DIRFILE object, except when it is unable to  allocate  memory  for  the
48       DIRFILE, in which case it returns NULL.
49
50

HISTORY

52       The gd_invalid_dirfile() function appeared in GetData-0.7.0.
53
54

SEE ALSO

56       gd_close(3), gd_discard(3), gd_error(3), gd_open(3)
57
58
59
60Version 0.10.0                 25 December 2016          gd_invalid_dirfile(3)
Impressum