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

# gd\_entry\_type(3)

retrieve the type of a Dirfile field

## NAME

gd\_entry\_type — retrieve the type of a Dirfile field

## SYNOPSIS

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

**gd\_entype\_t gd\_entry\_type(const DIRFILE \****dirfile***, const char** **\****field\_code***);**

## DESCRIPTION

The **gd\_entry\_type**() function queries a [dirfile(5)](/dirfile/5.md) database specified by *dirfile* and returns the field type of the field specified by *field\_code*. If *field\_code* contains a valid representation suffix, it will be ignored.

The **gd\_entype\_t** type is an enumerated type which may take any of the following values:

-

  **GD\_BIT\_ENTRY**, **GD\_CARRAY\_ENTRY**, **GD\_CONST\_ENTRY**, **GD\_DIVIDE\_ENTRY**, **GD\_INDEX\_ENTRY**, **GD\_INDIR\_ENTRY**, **GD\_LINCOM\_ENTRY**, **GD\_LINTERP\_ENTRY**, **GD\_MPLEX\_ENTRY**, **GD\_MULTIPLY\_ENTRY**, **GD\_PHASE\_ENTRY**, **GD\_POLYNOM\_ENTRY**, **GD\_RAW\_ENTRY**, **GD\_RECIP\_ENTRY**, **GD\_SARRAY\_ENTRY**, **GD\_SBIT\_ENTRY**, **GD\_SINDIR\_ENTRY**, **GD\_STRING\_ENTRY**, **GD\_WINDOW\_ENTRY**.

## RETURN VALUE

Upon successful completion, **gd\_entry\_type**() returns the field type of the specified field.  On error, **gd\_entry\_type**() returns **GD\_NO\_ENTRY** and stores a negative-valued error code in the **DIRFILE** object which may be retrieved by a subsequent call to [**gd\_error**(3)](/gd_error/3.md). Possible error codes are:\
  .TP 8 **GD\_E\_BAD\_DIRFILE** The supplied dirfile was invalid.\
  .TP 8 **GD\_E\_BAD\_CODE** The field specified by *field\_code* was not found in the database.

A descriptive error string for the error may be obtained by calling [**gd\_error\_string**(3)](/gd_error_string/3.md).

## HISTORY

The **get\_entry\_type**() function appeared in GetData-0.5.0.

In GetData-0.7.0, this function was renamed to **gd\_entry\_type**().

## SEE ALSO

[**gd\_entry**(3)](/gd_entry/3.md), [**gd\_error**(3)](/gd_error/3.md), [**gd\_error\_string**(3)](/gd_error_string/3.md), [**gd\_fragmentname**(3)](/gd_fragmentname/3.md), [**gd\_open**(3)](/gd_open/3.md), [**gd\_parent\_fragment**(3)](/gd_parent_fragment/3.md), [dirfile(5)](/dirfile/5.md)
