28 #ifndef __ALSA_GLOBAL_H_
29 #define __ALSA_GLOBAL_H_
49 #ifndef ATTRIBUTE_UNUSED
51 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
56 #define __STRING(x) #x
62 #define __SND_DLSYM_VERSION(name, version) _ ## name ## version
67 #define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version);
71 struct snd_dlsym_link {
72 struct snd_dlsym_link *next;
73 const char *dlsym_name;
74 const void *dlsym_ptr;
77 extern struct snd_dlsym_link *snd_dlsym_start;
80 #define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version
85 #define SND_DLSYM_BUILD_VERSION(name, version) \
86 static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \
87 void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \
88 void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \
89 __SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \
90 __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = __STRING(name); \
91 __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \
92 snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \
98 #define SND_DLSYM_VERSION(version) __STRING(version)
100 int snd_dlpath(
char *path,
size_t path_len,
const char *name);
101 void *
snd_dlopen(
const char *file,
int mode,
char *errbuf,
size_t errbuflen);
102 void *
snd_dlsym(
void *handle,
const char *name,
const char *version);
107 #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
138 #if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
const char * snd_asoundlib_version(void)
Returns the ALSA sound library version in ASCII format.
Definition: error.c:143
int snd_async_del_handler(snd_async_handler_t *handler)
Deletes an async handler.
Definition: async.c:150
struct timespec snd_htimestamp_t
Definition: global.h:154
struct snd_shm_area * snd_shm_area_create(int shmid, void *ptr)
Create a shm area record.
Definition: shmarea.c:68
int snd_shm_area_destroy(struct snd_shm_area *area)
Release the shared area record.
Definition: shmarea.c:103
int snd_dlclose(void *handle)
Closes a dynamic library - ALSA wrapper for dlclose.
Definition: dlmisc.c:186
struct _snd_async_handler snd_async_handler_t
Internal structure for an async notification client handler.
Definition: global.h:115
void * snd_dlopen(const char *file, int mode, char *errbuf, size_t errbuflen)
Opens a dynamic library - ALSA wrapper for dlopen.
Definition: dlmisc.c:122
struct snd_shm_area * snd_shm_area_share(struct snd_shm_area *area)
Increase the reference counter of shm area record.
Definition: shmarea.c:87
int snd_user_file(const char *file, char **result)
Get the full file name.
Definition: userfile.c:72
int snd_async_handler_get_signo(snd_async_handler_t *handler)
Returns the signal number assigned to an async handler.
Definition: async.c:197
int snd_async_handler_get_fd(snd_async_handler_t *handler)
Returns the file descriptor assigned to an async handler.
Definition: async.c:208
void * snd_async_handler_get_callback_private(snd_async_handler_t *handler)
Returns the private data assigned to an async handler.
Definition: async.c:219
struct timeval snd_timestamp_t
Definition: global.h:152
void * snd_dlsym(void *handle, const char *name, const char *version)
Resolves a symbol from a dynamic library - ALSA wrapper for dlsym.
Definition: dlmisc.c:246
int snd_dlpath(char *path, size_t path_len, const char *name)
Compose the dynamic path.
Definition: dlmisc.c:90
void(* snd_async_callback_t)(snd_async_handler_t *handler)
Async notification callback.
Definition: global.h:122
int snd_async_add_handler(snd_async_handler_t **handler, int fd, snd_async_callback_t callback, void *private_data)
Registers an async handler.
Definition: async.c:112