| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#ifndef __ALSA_GLOBAL_H_ |
| 29 |
#define __ALSA_GLOBAL_H_ |
| 30 |
|
| 31 |
|
| 32 |
#include <time.h> |
| 33 |
|
| 34 |
#ifdef __cplusplus |
| 35 |
extern "C" { |
| 36 |
#endif |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
const char *snd_asoundlib_version(void); |
| 48 |
|
| 49 |
#ifndef ATTRIBUTE_UNUSED |
| 50 |
|
| 51 |
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
| 52 |
#endif |
| 53 |
|
| 54 |
#ifdef PIC |
| 55 |
|
| 56 |
|
| 57 |
#define __SND_DLSYM_VERSION(name, version) _ ## name ## version |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version); |
| 63 |
|
| 64 |
#else |
| 65 |
|
| 66 |
struct snd_dlsym_link { |
| 67 |
struct snd_dlsym_link *next; |
| 68 |
const char *dlsym_name; |
| 69 |
const void *dlsym_ptr; |
| 70 |
}; |
| 71 |
|
| 72 |
extern struct snd_dlsym_link *snd_dlsym_start; |
| 73 |
|
| 74 |
|
| 75 |
#define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
#define SND_DLSYM_BUILD_VERSION(name, version) \ |
| 81 |
static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \ |
| 82 |
void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \ |
| 83 |
void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \ |
| 84 |
__SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \ |
| 85 |
__SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = # name; \ |
| 86 |
__SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \ |
| 87 |
snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \ |
| 88 |
} |
| 89 |
|
| 90 |
#endif |
| 91 |
|
| 92 |
#ifndef __STRING |
| 93 |
|
| 94 |
#define __STRING(x) #x |
| 95 |
#endif |
| 96 |
|
| 97 |
|
| 98 |
#define SND_DLSYM_VERSION(version) __STRING(version) |
| 99 |
|
| 100 |
void *snd_dlopen(const char *file, int mode); |
| 101 |
void *snd_dlsym(void *handle, const char *name, const char *version); |
| 102 |
int snd_dlclose(void *handle); |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
typedef struct _snd_async_handler snd_async_handler_t; |
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
typedef void (*snd_async_callback_t)(snd_async_handler_t *handler); |
| 122 |
|
| 123 |
int snd_async_add_handler(snd_async_handler_t **handler, int fd, |
| 124 |
snd_async_callback_t callback, void *private_data); |
| 125 |
int snd_async_del_handler(snd_async_handler_t *handler); |
| 126 |
int snd_async_handler_get_fd(snd_async_handler_t *handler); |
| 127 |
int snd_async_handler_get_signo(snd_async_handler_t *handler); |
| 128 |
void *snd_async_handler_get_callback_private(snd_async_handler_t *handler); |
| 129 |
|
| 130 |
struct snd_shm_area *snd_shm_area_create(int shmid, void *ptr); |
| 131 |
struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area); |
| 132 |
int snd_shm_area_destroy(struct snd_shm_area *area); |
| 133 |
|
| 134 |
int snd_user_file(const char *file, char **result); |
| 135 |
|
| 136 |
#ifdef __GLIBC__ |
| 137 |
#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE) |
| 138 |
struct timeval { |
| 139 |
time_t tv_sec; |
| 140 |
long tv_usec; |
| 141 |
}; |
| 142 |
|
| 143 |
struct timespec { |
| 144 |
time_t tv_sec; |
| 145 |
long tv_nsec; |
| 146 |
}; |
| 147 |
#endif |
| 148 |
#endif |
| 149 |
|
| 150 |
|
| 151 |
typedef struct timeval snd_timestamp_t; |
| 152 |
|
| 153 |
typedef struct timespec snd_htimestamp_t; |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
#ifdef __cplusplus |
| 158 |
} |
| 159 |
#endif |
| 160 |
|
| 161 |
#endif |