OSDN Git Service

topology: Support configuring physical DAIs by C API
[android-x86/external-alsa-lib.git] / include / global.h
index 60a6737..16a26dc 100644 (file)
@@ -1,14 +1,14 @@
 /**
- * \file <alsa/global.h>
+ * \file include/global.h
  * \brief Application interface library for the ALSA driver
- * \author Jaroslav Kysela <perex@suse.cz>
+ * \author Jaroslav Kysela <perex@perex.cz>
  * \author Abramo Bagnara <abramo@alsa-project.org>
  * \author Takashi Iwai <tiwai@suse.de>
  * \date 1998-2001
  *
  * Application interface library for the ALSA driver
- *
- *
+ */
+/*
  *   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
@@ -28,6 +28,9 @@
 #ifndef __ALSA_GLOBAL_H_
 #define __ALSA_GLOBAL_H_
 
+/* for timeval and timespec */
+#include <time.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -41,6 +44,8 @@ extern "C" {
  *  \{
  */
 
+const char *snd_asoundlib_version(void);
+
 #ifndef ATTRIBUTE_UNUSED
 /** do not print warning (gcc) when function parameter is not used */
 #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
@@ -97,6 +102,9 @@ void *snd_dlsym(void *handle, const char *name, const char *version);
 int snd_dlclose(void *handle);
 
 
+/** \brief alloca helper macro. */
+#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
+
 /**
  * \brief Internal structure for an async notification client handler.
  *
@@ -119,13 +127,26 @@ 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);
 
-/**
- * \brief Internal structure for an IPC shm area manager.
- */
 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
+
 /** Timestamp */
 typedef struct timeval snd_timestamp_t;
 /** Hi-res timestamp */