XDF_GET_EVENT(3)

πŸ’– XDF_GET_EVENT(3) πŸ’–

okay bestie, welcome to the xdffileio library manual β€” yes this is a C thing, yes it's real, and yes you're gonna get it. this is xdf_get_event, and it's about to spill the tea on your data file's events. πŸŽ€


✨ NAME ✨

xdf_get_event β€” get the deets of an event in a data file. like, the actual details. not vibes. details. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <xdfio.h>

int xdf_get_event(struct xdf* xdf, unsigned int index,
                  int* evttype, double* onset, double* dur);

look at that signature. she's giving structured. 😌


🌸 DESCRIPTION 🌸

so here's the situation, bestie: xdf_get_event() hands you back the info for the index-th event of the file that the handle xdf is pointing at. that's it. that's the whole job. 🫢

and it doesn't just dump everything in one blob β€” no no, she's organized. she writes the results into three separate pointers, so:

  • the event type goes to evttype
  • the start of the event, in seconds goes to onset
  • the duration of the event, also in seconds goes to dur

three pointers, three answers, zero confusion. we love a clean interface. ✨


πŸ”₯ RETURN VALUE πŸ”₯

  • she returns 0 when everything slays β€” success, periodt. πŸ‘‘
  • if it doesn't go well, she returns -1 and sets errno appropriately. so like, check your errno, bestie. she's trying to tell you something. 😭

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” one of xdf, evttype, onset or dur is NULL. yeah. you passed a whole void. not the vibe. πŸ™ˆ
  • ERANGE β€” index is bigger than the number of events in the file. you're reaching for an event that literally does not exist. it's not there. stop asking. πŸ’€

🧚 SEE ALSO 🧚


and that's the whole page, bestie! this gorgeous piece of documentation was brought to you by EPFL in 2010, and the page itself is XDF_GET_EVENT(3). stan an institution that ships manpages. πŸ’œ