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

# gd\_error\_count(3)

report the number of errors encountered by the GetData library

## NAME

gd\_error\_count — report the number of errors encountered by the GetData library

## SYNOPSIS

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

**int gd\_error\_count(DIRFILE \****dirfile***);**

## DESCRIPTION

The first time **gd\_error\_count**() is called with the DIRFILE object *dirfile*, it returns the number of errors encountered by the GetData library while operating on *dirfile* since its creation.  Calling this function resets the internal count, so that subsequent calls to **gd\_error\_count**() return the number of errors encountered only since the previous call to this function, for the specified DIRFILE.

The errors themselves are not cached by the library.  The error status of the  *last* library call on *dirfile* (which might be **GD\_E\_OK**, indicating no error) can be obtained by calling [**gd\_error**(3)](/gd_error/3.md).

## RETURN VALUE

The **gd\_error\_count**() function always returns the number of GetData errors encountered since the last time it was called, or since the dirfile was created. This will be zero, if no error has occurred over the given time.

## HISTORY

The **gd\_error\_count**() function appeared in GetData-0.8.0.

## SEE ALSO

[**gd\_error**(3)](/gd_error/3.md), [**gd\_error\_string**(3)](/gd_error_string/3.md)
