Reputation: 16359
On line 63 of this example header file there is a typedef:
typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
There are multiple examples of typedefs like that through the code.
My goal is to get to the actual definition of the structure _snd_ctl_elem_info
but I have grepped the source and googled but found no traces of the actual definition. Because of this search failure, I've started to think I might be missing some concepts and it might be something to do with kernel and backwards compatibility?
My motivation for this is to be able to gdb step through alsa and have an overview of the structures.
Is this some form of a low level structure definition pattern?
Upvotes: 1
Views: 187
Reputation: 180260
This structure is also used by alsa-lib to communicate with the kernel, so it just reuses the kernel's definition.
The kernel header would be installed as /usr/include/sound/asound.h
, but to avoid a dependence on the kernel headers being installed correctly, alsa-lib has its own copy of this file in alsa-lib/include/sound/asound.h
.
Applications are not supposed to access the members of this structure directly, so alsa-lib does not include asound.h
from its official headers (and does not even install it; it's used only when compiling alsa-lib).
To get the actual definition, you would need #include <sound/asound.h>
.
Upvotes: 1
Reputation:
It is defined in API header snd/asound.h. This is what client code is supposed to #include
.
Upvotes: 0
Reputation: 56572
It sounds like it gets renamed from a typedef:
#define _snd_ctl_elem_info sndrv_ctl_elem_info
So you're looking for sndrv_ctl_elem_info
, which is way easier to find.
It is defined in asound.h
at line 809.
It's pretty massive so I won't paste it here.
Upvotes: 1