XDF_ADD_EVTTYPE(3)
β¨ XDF_ADD_EVTTYPE(3) β¨
okay bestie, so this is a page from the xdffileio library manual and it's literally all about one tiny lil function that adds a type of event π buckle up
π NAME π
xdf_add_evttype β adds a type of event β¨
πΈ SYNOPSIS πΈ
#include <xdfio.h>
int xdf_add_evttype(struct xdf* xdf, int code, const char* desc);
like. that's it. that's the whole thing. short king π
π DESCRIPTION π
okay so xdf_add_evttype() adds an event type to the file referenced by the handle xdf, and no cap, that file has to be opened for writing β we do not do read-only situations here π
βοΈ
the event type it adds is specified by a combination of:
codeβ the event code, iconicdescβ the event description
and if there's, like, no description associated with the event type? then desc should be set to NULL. easy. NULL it. don't overthink it bestie π«Ά
now here's the tea β β if an event type with the same combination has already been added, then no new type will be added. instead, the previous type gets returned. so it's not a duplicate, it's a "hey girl, you already have this one" situation π and that's actually good, it's giving efficiency β¨
π RETURN VALUE π
the function returns the event type when things go well π
otherwise it returns -1 and errno is set appropriately. yeah. the classic -1. π
π¦ ERRORS π¦
here's the vibe check on what can go wrong, fr fr:
EINVALβxdfisNULLπ like bestie... you gave me nothingENOMEMβ the system is unable to allocate resources. the system said "no memory for you" πEPERMβ the file referenced byxdfhas not been opened for writing, OR its file format does not support events. permission denied energy, we hate to see it π€
β SEE ALSO β
xdf_add_event(3)β the related one, go read it, iykyk π
and that's the whole page bestie!! this lil beauty came from the EPFL era, dated 2010, and it lives in the xdffileio library manual π periodt. go add some event types, you've got this ππ¦β¨
π¦ where this page comes from
- debian bookworm: libxdffileio-dev 0.3-4 Β· LGPL-3.0-or-later
- debian trixie: libxdffileio-dev 0.3-4+b2 Β· LGPL-3.0-or-later
- fedora 43: xdffileio-devel 0.3-23.fc43 Β· LGPL-3.0-or-later
- fedora 43: xdffileio-devel 0.3-23.fc43 Β· LGPL-3.0-or-later
- fedora 44: xdffileio-devel 0.3-24.fc44 Β· LGPL-3.0-or-later
- fedora 44: xdffileio-devel 0.3-24.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libxdffileio-dev 0.3-4 Β· LGPL-3.0-or-later
- ubuntu noble: libxdffileio-dev 0.3-4ubuntu3 Β· LGPL-3.0-or-later
- ubuntu questing: libxdffileio-dev 0.3-4ubuntu3
- ubuntu resolute: libxdffileio-dev 0.3-4ubuntu4 Β· LGPL-3.0-or-later
- ubuntu stonking: libxdffileio-dev 0.3-4ubuntu4 Β· LGPL-3.0-or-later
- Copyright 2010 (c) EPFL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms