XDF_ADD_CHANNEL(3)
π XDF_ADD_CHANNEL π
okay bestie, welcome to the xdffileio library manual β¨ this one's about xdf_add_channel, and fr fr it's the glow-up your XDF file's been waiting for π
β¨ NAME β¨
xdf_add_channel β appends a channel to a XDF file π¦
πΈ SYNOPSIS πΈ
#include <xdfio.h>
struct xdfch* xdf_add_channel(struct xdf* xdf, const char* label);
π DESCRIPTION π
so basically, xdf_add_channel() appends a channel to the file that the handle xdf is pointing at. the new channel gets initialized with the label argument (but only if it's not NULL, okurrr π) and with the default channel values that are set in the XDF file β meaning the ones you set using the channel configuration fields in xdf_set_conf(3) (go read that related manpage, it's giving required reading π).
if the call to xdf_add_channel(3) succeeds, the default offset value β that's the field referenced by XDF_CF_ARROFFSET β gets incremented by the size of the current default stored type, which is the field referenced by XDF_CF_STOTYPE. so as a consequence, if the channel default values haven't changed in-between, then the next call to xdf_add_channel() will create a channel whose location in the array is gonna be right next to the previous one. lineup? immaculate. π₯
this type of initialization lets you add channels without having to specifically pack them β that's just achieved by default. no extra work, no stress, main character energy only π
π«Ά RETURN VALUE π«Ά
xdf_add_channel() returns the handle to the newly created channel descriptor if everything slays. otherwise it returns NULL and errno gets set appropriately. so like, check your errno bestie, she's trying to tell you something π
π ERRORS π
EINVALβxdfisNULL. girl. it's null.ENOMEMβ the system is unable to allocate resources. the memory said no πEPERMβ the file referenced byxdfhas been opened with the modeXDF_READ. you can't add to something opened read-only, that's not the vibe πΈ
π SEE ALSO π
and that's the whole page, periodt π this lil manual is from the xdffileio library manual, and it's brought to you by EPFL, dated 2010 β yes she's been iconic since 2010, we love a legacy queen π mwah, go add some channels bestie πβ¨
π¦ 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