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

# gd\_hide(3)

hide or unhide a Dirfile database entry

## NAME

gd\_hide, gd\_unhide — hide or unhide a Dirfile database entry

## SYNOPSIS

**#include \<getdata.h\>**

**int gd\_hide(const DIRFILE \****dirfile***, const char** **\****entry\_name***);**

**int gd\_unhide(const DIRFILE \****dirfile***, const char** **\****entry\_name***);**

## DESCRIPTION

The **gd\_hide**() function hides the field or alias called *entry\_name* in the [dirfile(5)](/dirfile/5.md) database specified by *dirfile* and indicates whether the field or alias called is hidden or not.  Similarly, the **gd\_unhide**() function unhides the specified entry.  An entry can also be hidden or unhidden using [**gd\_alter\_entry**(3)](/gd_alter_entry/3.md).

By default, a hidden entry does not appear in the lists returned by the functions [**gd\_match\_entries**(3)](/gd_match_entries/3.md), [**gd\_entry\_list**(3)](/gd_entry_list/3.md) [**gd\_constants**(3)](/gd_constants/3.md), or [**gd\_strings**(3)](/gd_strings/3.md), including the special-case versions of [**gd\_entry\_list**(3)](/gd_entry_list/3.md) such as [**gd\_field\_list**(3)](/gd_field_list/3.md). These omissions are also reflected in the counts returned by the corresponding field counting function [**gd\_nentries**(3)](/gd_nentries/3.md) and it's special-case versions ([**gd\_nfields**(3)](/gd_nfields/3.md), &c.).

## RETURN VALUE

Upon successful completion, **gd\_hide**() and **gd\_unhide**() return zero.  On error, they return a negative-valued error code.  Possible error codes are:\
  .TP 8 **GD\_E\_ACCMODE** The specified dirfile was opened read-only.\
  .TP 8 **GD\_E\_BAD\_CODE** The field specified by *field\_code* was not found in the database.\
  .TP 8 **GD\_E\_BAD\_DIRFILE** The supplied dirfile was invalid.\
  .TP 8 **GD\_E\_PROTECTED** The metadata of the affected format specification fragments was protected from change.

The error code is also stored in the **DIRFILE** object and may be retrieved after this function returns by calling [**gd\_error**(3)](/gd_error/3.md). A descriptive error string for the error may be obtained by calling [**gd\_error\_string**(3)](/gd_error_string/3.md).

## HISTORY

The **gd\_hide**() and **gd\_unhide**() functions appeared in GetData-0.8.0.

In GetData-0.10.0, the error return from these functions changed from -1 to a negative-valued error code.

## SEE ALSO

[**gd\_alter\_entry**(3)](/gd_alter_entry/3.md), [**gd\_field\_list**(3)](/gd_field_list/3.md), [**gd\_hidden**(3)](/gd_hidden/3.md), [**gd\_nfields**(3)](/gd_nfields/3.md), [**gd\_open**(3)](/gd_open/3.md), [dirfile(5)](/dirfile/5.md)
