28#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
30#warning "use #include <alsa/asoundlib.h>, <alsa/global.h> should not be used directly"
31#include <alsa/asoundlib.h>
34#ifndef __ALSA_GLOBAL_H_
35#define __ALSA_GLOBAL_H_
52#ifndef ATTRIBUTE_UNUSED
54#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
65#define __SND_DLSYM_VERSION(name, version) _ ## name ## version
70#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version);
74struct snd_dlsym_link {
75 struct snd_dlsym_link *next;
76 const char *dlsym_name;
77 const void *dlsym_ptr;
80extern struct snd_dlsym_link *snd_dlsym_start;
83#define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version
88#define SND_DLSYM_BUILD_VERSION(name, version) \
89 static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \
90 void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \
91 void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \
92 __SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \
93 __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = __STRING(name); \
94 __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \
95 snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \
101#define SND_DLSYM_VERSION(version) __STRING(version)
103int snd_dlpath(
char *path,
size_t path_len,
const char *name);
104void *
snd_dlopen(
const char *file,
int mode,
char *errbuf,
size_t errbuflen);
105void *
snd_dlsym(
void *handle,
const char *name,
const char *version);
110#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
141#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
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_async_del_handler(snd_async_handler_t *handler)
Deletes an async handler.
Definition async.c:150
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 timespec snd_htimestamp_t
Definition global.h:157
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:118
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:210
struct snd_shm_area * snd_shm_area_create(int shmid, void *ptr)
Create a shm area record.
Definition shmarea.c:68
const char * snd_asoundlib_version(void)
Returns the ALSA sound library version in ASCII format.
Definition error.c:143
int snd_async_handler_get_fd(snd_async_handler_t *handler)
Returns the file descriptor assigned to an async handler.
Definition async.c:221
struct timeval snd_timestamp_t
Definition global.h:155
void * snd_async_handler_get_callback_private(snd_async_handler_t *handler)
Returns the private data assigned to an async handler.
Definition async.c:232
int snd_dlpath(char *path, size_t path_len, const char *name)
Compose the dynamic path.
Definition dlmisc.c:90
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
void(* snd_async_callback_t)(snd_async_handler_t *handler)
Async notification callback.
Definition global.h:125
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