All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
global.h
Go to the documentation of this file.
/*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __ALSA_GLOBAL_H_
#define __ALSA_GLOBAL_H_
/* for timeval and timespec */
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
const char *snd_asoundlib_version(void);
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
#ifdef PIC /* dynamic build */
#define __SND_DLSYM_VERSION(name, version) _ ## name ## version
#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version);
#else /* static build */
struct snd_dlsym_link {
struct snd_dlsym_link *next;
const char *dlsym_name;
const void *dlsym_ptr;
};
extern struct snd_dlsym_link *snd_dlsym_start;
#define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version
#define SND_DLSYM_BUILD_VERSION(name, version) \
static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \
void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \
void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \
__SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \
__SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = # name; \
__SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \
snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \
}
#endif
#ifndef __STRING
#define __STRING(x) #x
#endif
#define SND_DLSYM_VERSION(version) __STRING(version)
void *snd_dlopen(const char *file, int mode);
void *snd_dlsym(void *handle, const char *name, const char *version);
int snd_dlclose(void *handle);
#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
typedef struct _snd_async_handler snd_async_handler_t;
typedef void (*snd_async_callback_t)(snd_async_handler_t *handler);
int snd_async_add_handler(snd_async_handler_t **handler, int fd,
snd_async_callback_t callback, void *private_data);
int snd_async_del_handler(snd_async_handler_t *handler);
int snd_async_handler_get_fd(snd_async_handler_t *handler);
int snd_async_handler_get_signo(snd_async_handler_t *handler);
void *snd_async_handler_get_callback_private(snd_async_handler_t *handler);
struct snd_shm_area *snd_shm_area_create(int shmid, void *ptr);
struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area);
int snd_shm_area_destroy(struct snd_shm_area *area);
int snd_user_file(const char *file, char **result);
#ifdef __GLIBC__
#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
struct timeval {
time_t tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
#endif
#endif
typedef struct timeval snd_timestamp_t;
typedef struct timespec snd_htimestamp_t;
#ifdef __cplusplus
}
#endif
#endif /* __ALSA_GLOBAL_H */
snd_dlsym
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:162
snd_async_handler_get_signo
int snd_async_handler_get_signo(snd_async_handler_t *handler)
Returns the signal number assigned to an async handler.
Definition: async.c:185
snd_async_callback_t
void(* snd_async_callback_t)(snd_async_handler_t *handler)
Async notification callback.
Definition: global.h:121
snd_async_add_handler
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:100
snd_asoundlib_version
const char * snd_asoundlib_version(void)
Returns the ALSA sound library version in ASCII format.
Definition: error.c:143
snd_async_handler_get_fd
int snd_async_handler_get_fd(snd_async_handler_t *handler)
Returns the file descriptor assigned to an async handler.
Definition: async.c:196
snd_htimestamp_t
struct timespec snd_htimestamp_t
Definition: global.h:153
snd_dlopen
void * snd_dlopen(const char *file, int mode)
Opens a dynamic library - ALSA wrapper for dlopen.
Definition: dlmisc.c:51
snd_dlclose
int snd_dlclose(void *handle)
Closes a dynamic library - ALSA wrapper for dlclose.
Definition: dlmisc.c:102
snd_async_handler_t
struct _snd_async_handler snd_async_handler_t
Internal structure for an async notification client handler.
Definition: global.h:114
snd_timestamp_t
struct timeval snd_timestamp_t
Definition: global.h:151
snd_user_file
int snd_user_file(const char *file, char **result)
Get the full file name.
Definition: userfile.c:72
snd_async_handler_get_callback_private
void * snd_async_handler_get_callback_private(snd_async_handler_t *handler)
Returns the private data assigned to an async handler.
Definition: async.c:207
snd_async_del_handler
int snd_async_del_handler(snd_async_handler_t *handler)
Deletes an async handler.
Definition: async.c:138
ptr
void * ptr
Definition: seq_event.h:199