---
name: "gd_flags"
section: "3"
platform: "linux"
package: "libgetdata-doc"
version: "0.11.0-15"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gd_flags"
---

# gd\_flags(3)

alter GetData operational flags

## NAME

gd\_flags — 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)](/dirfile/5.md) 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)](/gd_cbopen/3.md)). These are:\
  .TP 8 **GD\_PRETTY\_PRINT** When dirfile metadata are flushed to disk (either explicitly via [**gd\_metaflush**(3)](/gd_metaflush/3.md), [**gd\_rewrite\_fragment**(3)](/gd_rewrite_fragment/3.md), or  [**gd\_flush**(3)](/gd_flush/3.md) 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.\
  .TP 8 **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)](/gd_error_string/3.md), should be written on the caller's standard error stream ([**stderr**(3)](/stderr/3.md)) by GetData.  The error string may be prefixed by a string specified by the caller; see [**gd\_verbose\_prefix**(3)](/gd_verbose_prefix/3.md). 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_open/3.md), [**gd\_verbose\_prefix**(3)](/gd_verbose_prefix/3.md), [dirfile(5)](/dirfile/5.md)
