---
name: "xdf_get_event"
section: "3"
platform: "linux"
package: "libxdffileio-dev"
version: "0.3-4+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/xdf_get_event"
---

# xdf\_get\_event(3)

Get details of an event of a data file

## NAME

xdf\_get\_event - Get details of an event of a data file

## SYNOPSIS

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

**int xdf\_get\_event(struct xdf\*** *xdf***, unsigned int** *index***,**\
                   **int\*** *evttype***, double\*** *onset***, double\*** *dur***);**\

## DESCRIPTION

**xdf\_get\_event**() returns the information of the *index*-th event of the file referenced by the handle *xdf*. The event type, start (in seconds) and duration (in seconds) of the event are returned respectively to the pointers *evttype*, *onset* and *dur*.

## RETURN VALUE

**xdf\_get\_event**() returns 0 in case of success. Otherwise -1 is returned and *errno* is set appropriately.

## ERRORS

- **EINVAL**

  *xdf*, *evttype*, *onset* or *dur* is NULL.

- **ERANGE**

  *index* is bigger than the number event in the file.

- [**xdf\_add\_evttype**(3)](/xdf_add_evttype/3.md)

  ## SEE ALSO
