1XDF_ADD_CHANNEL(3) xdffileio library manual XDF_ADD_CHANNEL(3)
2
3
4
6 xdf_add_channel - Appends a channel to a XDF file
7
9 #include <xdfio.h>
10
11 struct xdfch* xdf_add_channel(struct xdf* xdf, const char* label);
12
14 xdf_add_channel() appends a channel to the file referenced by the han‐
15 dle xdf. The new channel is initialized with the label argument (if not
16 NULL) and with the default channel values set in the XDF file, i.e.
17 those set using channel configuration fields in xdf_set_conf(3) (See
18 the related manpage).
19
20 If the call to xdf_add_channel(3) is successful, the default offset
21 value (the field referenced by XDF_CF_ARROFFSET) is incremented by the
22 size of the current default stored type (field referenced by
23 XDF_CF_STOTYPE). As a consequence, if the channel default values have
24 not changed in-between, the next call to xdf_add_channel() will create
25 a channel whose location is the array will be next to the previous one.
26
27 This type of initialization allows the user to add channels without
28 having to specifically pack them: this is achieved by default.
29
31 xdf_add_channel() returns the handle to newly created channel descrip‐
32 tor in case of success. Otherwise NULL is returned and errno is set
33 appropriately.
34
36 EINVAL xdf is NULL.
37
38 ENOMEM The system is unable to allocate resources.
39
40 EPERM the file referenced by xdf has been opened with the mode
41 XDF_READ
42
44 xdf_copy_chconf(3), xdf_set_conf(3), xdf_set_chconf(3)
45
46
47
48
49
50EPFL 2010 XDF_ADD_CHANNEL(3)