gd_invalid_dirfile(3)

NAME
gd_invalid_dirfile — obtain an pointer to an invalid DIRFILE object

SYNOPSIS
#include <getdata.h>

DIRFILE* gd_invalid_dirfile(void);

DESCRIPTION
The returns a pointer to a newly allocated, invalid DIRFILE object. Like any other DIRFILE object, the invalid DIRFILE object should be de-allocated by calling or when it is no longer needed. The DIRFILE object returned may be passed to any other GetData function which requires one, but doing so will inevitably result in that function failing with the GD_BAD_DIRFILE error. A similar effect can be achieved by making an invalid call, such as:

    gd_open("", 0);

which also returns a pointer to an invalid DIRFILE object. The difference is that an invalid DIRFILE created in this way has a non-zero error code (obtainable with while the dirfile error of the invalid DIRFILE returned by is zero (indicating success).

RETURN VALUE
This function always returns a pointer to a newly allocated, invalid DIRFILE object, except when it is unable to allocate memory for the DIRFILE, in which case it returns NULL.

HISTORY
The function appeared in GetData-0.7.0.

SEE ALSO