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

# gd\_parser\_callback(3)

set the syntax error callback handler for a Dirfile

## NAME

gd\_parser\_callback — set the syntax error callback handler for a Dirfile

## SYNOPSIS

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

**void gd\_parser\_callback(DIRFILE \****dirfile***, gd\_parser\_callback\_t** *sehandler***, void \****extra***);**

## DESCRIPTION

The **gd\_parser\_callback**() function updates the syntax error callback function of the DIRFILE object *dirfile* to be *sehandler*, and the caller supplied extra pointer passed to the handler to be *extra*, discarding any syntax error handler and extra pointer which were previously registered for this DIRFILE.  If *sehandler* is NULL, the existing handler will be removed and the default behaviour (abort on error) restored.  See [**gd\_cbopen**(3)](/gd_cbopen/3.md) for a discussion on the requirements for the syntax handler.

Since parsing of an existing format specification occurs when the DIRFILE object is created, before this function can be called, this function is only useful to set or modify a callback function or its caller data before calling [**gd\_include**(3)](/gd_include/3.md), which will invoke the callback function if syntax errors are found in the included fragment.

This function always succeeds, and has no return value.

## HISTORY

The **dirfile\_parser\_callback**() function appeared in GetData-0.5.0.

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

## SEE ALSO

[**gd\_cbopen**(3)](/gd_cbopen/3.md), [**gd\_include**(3)](/gd_include/3.md), [dirfile(5)](/dirfile/5.md)
