XDF_DEFINE_ARRAYS(3)
π XDF_DEFINE_ARRAYS(3) π
okay bestie, so this one's from the xdffileio library manual and it's literally the glow-up moment where you tell your transfer how many arrays it's getting and how they're spaced. it's giving β¨setup eraβ¨. let's get into it π«Ά
πΈ NAME πΈ
xdf_define_arrays β Specify the number of input/output arrays π
π SYNOPSIS π
#include <xdfio.h>
int xdf_define_arrays(struct xdf* xdf,
unsigned int narrays, const size_t *strides);
no cap, that's the whole vibe right there β
π¦ DESCRIPTION π¦
so xdf_define_arrays() specifies the number of arrays and its strides for the upcoming calls to xdf_write(3) and xdf_read(3) that are gonna use xdf. it's the function you use to configure the upcoming transfer. and because it's the setup step, it must be called before xdf_prepare_transfer(3) β like, calling it after will straight up produce an error π no skipping steps, bestie.
but here's the cute part: you can call this function several times. it's not a one-and-done. just know that only the last call is meaningful for the transfer β everything before it is giving "deleted draft" energy π
narrays specifies the number of arrays that will be provided in the argument list of xdf_write(3) or xdf_read(3). so like, how many little containers are you showing up with π
strides argument should point to an array of narrays unsigned int corresponding respectively to the stride of each arrays that will be supplied to the upcoming call to xdf_write(3) or xdf_read(3). and what even is a stride, you ask? π§ the stride corresponds to the length in byte between two consecutive samples of the same channel in the array. that's it. that's the whole thing. it's the distance between your samples, measured in bytes. periodt π
π RETURN VALUE π
xdf_define_arrays() returns 0 in case of success π otherwise it returns -1 and errno is set appropriately π (she's dramatic but she's honest)
π ERRORS π
ENOMEMβ the system is unable to allocate resources. not enough room, bestie, the vibes are constrained π
π₯ SEE ALSO π₯
go read those too, they're all part of the same friend group fr fr π«Ά
and that's the whole page, bestie β¨ this one came from EPFL, 2010 β so yeah, it's been slaying since 2010 and it's still iconic π mwah, take care of your strides πΈπ
π¦ 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