gd_flags - Man Page

alter GetData operational flags

Synopsis

#include <getdata.h>

unsigned long gd_flags(DIRFILE *dirfile, unsigned long set, unsigned long reset);

Description

The gd_flags() function modifies the operational flags of the dirfile(5) database specified by dirfile, and returns the new value of the flags register.

The flags which may be queried or modified with this interface are a subset of the open flags (see gd_cbopen(3)). These are:

GD_PRETTY_PRINT

When dirfile metadata are flushed to disk (either explicitly via gd_metaflush(3), gd_rewrite_fragment(3), or gd_flush(3) or implicitly by closing the dirfile), an attempt will be made to create a nicer looking format specification (from a human-readable standpoint).  What this explicitly means is not part of the API, and any particular behaviour should not be relied on.  If the dirfile has been opened read-only, this flag is ignored.

GD_VERBOSE

Specifies that whenever an error is triggered by the library when working on this dirfile, the corresponding error string, which can be retrieved by calling gd_error_string(3), should be written on the caller's standard error stream (stderr(3)) by GetData.  The error string may be prefixed by a string specified by the caller; see gd_verbose_prefix(3). Without this flag, GetData writes nothing to standard error.  (GetData never writes to standard output.)

Flags which appear only in set will be turned on (enabled); flags which appear only in reset will be turned off (disabled); flags which appear in both set and reset will be toggled.  Flags which appear in neither of these are left unchanged. Accordingly, to simply query the current flags, both set and reset should be zero, and to explicitly specify all the flags, ignoring their old values, the new flags register should be given in set, and it's bitwise complement in reset.

Return Value

The gd_flags() function returns a bitwise or'd collection those of the above flags which are enabled after performing the modifications specified (if any).  This function does not fail.

History

The gd_flags() function appeared in GetData-0.8.0.

See Also

gd_open(3), gd_verbose_prefix(3), dirfile(5)

Referenced By

gd_error(3), gd_open(3), gd_verbose_prefix(3).

25 December 2016 Version 0.10.0 GETDATA