XDF_ADD_EVENT(3)

✨ NAME ✨

xdf_add_event β€” bestie, this is the one that appends an event to the data file πŸ’–

So like, xdf_add_event is from the xdffileio library manual, section 3, and it's giving "I add events to your file" energy. Iconic.


🌸 SYNOPSIS 🌸

#include <xdfio.h>

int xdf_add_event(struct xdf* xdf, int evttype,
                  double onset, double dur);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk. xdf_add_event() appends an event to the file that the handle xdf points at β€” and like, that file has to have been opened for writing, no cap. The event you're adding is of type evttype, it starts at time onset, and it lasts for a duration of dur, which is measured in seconds ⏱️

If your event is one of those "no concept of time, I simply am" events with no notion of duration? Set dur to 0. Periodt.

And evttype?? That has to be a value that came back from a successful call to xdf_add_evttype(3). You can't just make up a number and manifest it into existence, bestie, the library will notice πŸ™ˆ


πŸ’… RETURN VALUE πŸ’…

  • 0 β€” slay, success, we ate πŸŽ€
  • -1 β€” not slay, it failed, and errno gets set appropriately so you can go find out why

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” either xdf is NULL, or evttype was never previously created by xdf_add_evttype(3). Like, you skipped a step, girl 😭
  • ENOMEM β€” the system is unable to allocate resources. It's not you, it's the memory.
  • EPERM β€” the file referenced by xdf has not been opened for writing, or its file format straight up does not support events. Permission said no 🚫

πŸ‘‘ SEE ALSO πŸ‘‘


mwah πŸ’œ that's the whole page. this absolute banger of a man page was brought to you by EPFL, dated 2010, and it lives in the xdffileio library manual as XDF_ADD_EVENT(3). 🫢✨