|
Packit Service |
db8eaa |
/*
|
|
Packit Service |
db8eaa |
* ALSA lib - local header file
|
|
Packit Service |
db8eaa |
* Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* This library is free software; you can redistribute it and/or modify
|
|
Packit Service |
db8eaa |
* it under the terms of the GNU Lesser General Public License as
|
|
Packit Service |
db8eaa |
* published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
db8eaa |
* the License, or (at your option) any later version.
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
db8eaa |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
db8eaa |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
db8eaa |
* GNU Lesser General Public License for more details.
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
db8eaa |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
db8eaa |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
*/
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifndef __LOCAL_H
|
|
Packit Service |
db8eaa |
#define __LOCAL_H
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include "config.h"
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include <unistd.h>
|
|
Packit Service |
db8eaa |
#include <stdio.h>
|
|
Packit Service |
db8eaa |
#include <stdlib.h>
|
|
Packit Service |
db8eaa |
#include <string.h>
|
|
Packit Service |
db8eaa |
#include <fcntl.h>
|
|
Packit Service |
db8eaa |
#include <assert.h>
|
|
Packit Service |
db8eaa |
#ifdef HAVE_ENDIAN_H
|
|
Packit Service |
db8eaa |
#include <endian.h>
|
|
Packit Service |
db8eaa |
#elif defined(HAVE_SYS_ENDIAN_H)
|
|
Packit Service |
db8eaa |
#include <sys/endian.h>
|
|
Packit Service |
db8eaa |
#ifndef __BYTE_ORDER
|
|
Packit Service |
db8eaa |
#define __BYTE_ORDER BYTE_ORDER
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#ifndef __LITTLE_ENDIAN
|
|
Packit Service |
db8eaa |
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#ifndef __BIG_ENDIAN
|
|
Packit Service |
db8eaa |
#define __BIG_ENDIAN BIG_ENDIAN
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#else
|
|
Packit Service |
db8eaa |
#error Header defining endianness not defined
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#include <stdarg.h>
|
|
Packit Service |
db8eaa |
#include <poll.h>
|
|
Packit Service |
db8eaa |
#include <sys/types.h>
|
|
Packit Service |
db8eaa |
#include <errno.h>
|
|
Packit Service |
db8eaa |
#if defined(__linux__)
|
|
Packit Service |
db8eaa |
#include <linux/types.h>
|
|
Packit Service |
db8eaa |
#include <linux/ioctl.h>
|
|
Packit Service |
db8eaa |
#else
|
|
Packit Service |
db8eaa |
#include "type_compat.h"
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifdef SUPPORT_RESMGR
|
|
Packit Service |
db8eaa |
#include <resmgr.h>
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#ifdef HAVE_LIBDL
|
|
Packit Service |
db8eaa |
#include <dlfcn.h>
|
|
Packit Service |
db8eaa |
#else
|
|
Packit Service |
db8eaa |
#define RTLD_NOW 0
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
Packit Service |
db8eaa |
#define SND_LITTLE_ENDIAN
|
|
Packit Service |
db8eaa |
#define SNDRV_LITTLE_ENDIAN
|
|
Packit Service |
db8eaa |
#elif __BYTE_ORDER == __BIG_ENDIAN
|
|
Packit Service |
db8eaa |
#define SND_BIG_ENDIAN
|
|
Packit Service |
db8eaa |
#define SNDRV_BIG_ENDIAN
|
|
Packit Service |
db8eaa |
#else
|
|
Packit Service |
db8eaa |
#error "Unsupported endian..."
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define _snd_config_iterator list_head
|
|
Packit Service |
db8eaa |
#define _snd_interval snd_interval
|
|
Packit Service |
db8eaa |
#define _snd_pcm_info snd_pcm_info
|
|
Packit Service |
db8eaa |
#define _snd_pcm_hw_params snd_pcm_hw_params
|
|
Packit Service |
db8eaa |
#define _snd_pcm_sw_params snd_pcm_sw_params
|
|
Packit Service |
db8eaa |
#define _snd_pcm_status snd_pcm_status
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define _snd_ctl_card_info snd_ctl_card_info
|
|
Packit Service |
db8eaa |
#define _snd_ctl_elem_id snd_ctl_elem_id
|
|
Packit Service |
db8eaa |
#define _snd_ctl_elem_list snd_ctl_elem_list
|
|
Packit Service |
db8eaa |
#define _snd_ctl_elem_info snd_ctl_elem_info
|
|
Packit Service |
db8eaa |
#define _snd_ctl_elem_value snd_ctl_elem_value
|
|
Packit Service |
db8eaa |
#define _snd_ctl_event snd_ctl_event
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define _snd_rawmidi_info snd_rawmidi_info
|
|
Packit Service |
db8eaa |
#define _snd_rawmidi_params snd_rawmidi_params
|
|
Packit Service |
db8eaa |
#define _snd_rawmidi_status snd_rawmidi_status
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define _snd_hwdep_info snd_hwdep_info
|
|
Packit Service |
db8eaa |
#define _snd_hwdep_dsp_status snd_hwdep_dsp_status
|
|
Packit Service |
db8eaa |
#define _snd_hwdep_dsp_image snd_hwdep_dsp_image
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define _snd_seq_queue_tempo snd_seq_queue_tempo
|
|
Packit Service |
db8eaa |
#define _snd_seq_client_info snd_seq_client_info
|
|
Packit Service |
db8eaa |
#define _snd_seq_port_info snd_seq_port_info
|
|
Packit Service |
db8eaa |
#define _snd_seq_system_info snd_seq_system_info
|
|
Packit Service |
db8eaa |
#define _snd_seq_queue_info snd_seq_queue_info
|
|
Packit Service |
db8eaa |
#define _snd_seq_queue_status snd_seq_queue_status
|
|
Packit Service |
db8eaa |
#define _snd_seq_queue_timer snd_seq_queue_timer
|
|
Packit Service |
db8eaa |
#define _snd_seq_port_subscribe snd_seq_port_subscribe
|
|
Packit Service |
db8eaa |
#define _snd_seq_query_subscribe snd_seq_query_subs
|
|
Packit Service |
db8eaa |
#define _snd_seq_client_pool snd_seq_client_pool
|
|
Packit Service |
db8eaa |
#define _snd_seq_remove_events snd_seq_remove_events
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define _snd_timer_id snd_timer_id
|
|
Packit Service |
db8eaa |
#define _snd_timer_ginfo snd_timer_ginfo
|
|
Packit Service |
db8eaa |
#define _snd_timer_gparams snd_timer_gparams
|
|
Packit Service |
db8eaa |
#define _snd_timer_gstatus snd_timer_gstatus
|
|
Packit Service |
db8eaa |
#define _snd_timer_select snd_timer_select
|
|
Packit Service |
db8eaa |
#define _snd_timer_info snd_timer_info
|
|
Packit Service |
db8eaa |
#define _snd_timer_params snd_timer_params
|
|
Packit Service |
db8eaa |
#define _snd_timer_status snd_timer_status
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define ALSA_LIBRARY_BUILD
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* rename some types for avoiding conflicts with alsalib's definitions */
|
|
Packit Service |
db8eaa |
#define snd_aes_iec958 sndrv_aes_iec958
|
|
Packit Service |
db8eaa |
#define snd_pcm_uframes_t sndrv_pcm_uframes_t
|
|
Packit Service |
db8eaa |
#define snd_pcm_sframes_t sndrv_pcm_sframes_t
|
|
Packit Service |
db8eaa |
#define snd_pcm_access_t sndrv_pcm_access_t
|
|
Packit Service |
db8eaa |
#define snd_pcm_format_t sndrv_pcm_format_t
|
|
Packit Service |
db8eaa |
#define snd_pcm_subformat_t sndrv_pcm_subformat_t
|
|
Packit Service |
db8eaa |
#define snd_pcm_state_t sndrv_pcm_state_t
|
|
Packit Service |
db8eaa |
#define snd_interval sndrv_interval
|
|
Packit Service |
db8eaa |
#define snd_mask sndrv_mask
|
|
Packit Service |
db8eaa |
#define snd_ctl_elem_type_t sndrv_ctl_elem_type_t
|
|
Packit Service |
db8eaa |
#define snd_ctl_elem_iface_t sndrv_ctl_elem_iface_t
|
|
Packit Service |
db8eaa |
#define snd_ctl_tlv sndrv_ctl_tlv
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* kill and replace kernel-specific types */
|
|
Packit Service |
db8eaa |
#ifndef __user
|
|
Packit Service |
db8eaa |
#define __user
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#ifndef __force
|
|
Packit Service |
db8eaa |
#define __force
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include <sound/asound.h>
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* take back superfluous renames; some can be kept as is */
|
|
Packit Service |
db8eaa |
#undef snd_aes_iec958
|
|
Packit Service |
db8eaa |
#undef snd_pcm_uframes_t
|
|
Packit Service |
db8eaa |
#undef snd_pcm_sframes_t
|
|
Packit Service |
db8eaa |
#undef snd_pcm_access_t
|
|
Packit Service |
db8eaa |
#undef snd_pcm_format_t
|
|
Packit Service |
db8eaa |
#undef snd_pcm_subformat_t
|
|
Packit Service |
db8eaa |
#undef snd_pcm_state_t
|
|
Packit Service |
db8eaa |
#undef snd_ctl_elem_type_t
|
|
Packit Service |
db8eaa |
#undef snd_ctl_elem_iface_t
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include "asoundef.h"
|
|
Packit Service |
db8eaa |
#include "alsa-symbols.h"
|
|
Packit Service |
db8eaa |
#include "version.h"
|
|
Packit Service |
db8eaa |
#include "global.h"
|
|
Packit Service |
db8eaa |
#include "input.h"
|
|
Packit Service |
db8eaa |
#include "output.h"
|
|
Packit Service |
db8eaa |
#include "error.h"
|
|
Packit Service |
db8eaa |
#include "conf.h"
|
|
Packit Service |
db8eaa |
#include "pcm.h"
|
|
Packit Service |
db8eaa |
#include "pcm_plugin.h"
|
|
Packit Service |
db8eaa |
#include "rawmidi.h"
|
|
Packit Service |
db8eaa |
#include "timer.h"
|
|
Packit Service |
db8eaa |
#include "hwdep.h"
|
|
Packit Service |
db8eaa |
#include "control.h"
|
|
Packit Service |
db8eaa |
#include "mixer.h"
|
|
Packit Service |
db8eaa |
#include "seq_event.h"
|
|
Packit Service |
db8eaa |
#include "seq.h"
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* rename some types for avoiding conflicts with alsalib's definitions */
|
|
Packit Service |
db8eaa |
#define snd_seq_addr sndrv_seq_addr
|
|
Packit Service |
db8eaa |
#define snd_seq_tick_time_t sndrv_seq_tick_time_t
|
|
Packit Service |
db8eaa |
#define snd_seq_real_time sndrv_seq_real_time
|
|
Packit Service |
db8eaa |
#define snd_seq_timestamp sndrv_seq_timestamp
|
|
Packit Service |
db8eaa |
#define snd_seq_event_type_t sndrv_seq_event_type_t
|
|
Packit Service |
db8eaa |
#define snd_seq_event sndrv_seq_event
|
|
Packit Service |
db8eaa |
#define snd_seq_connect sndrv_seq_connect
|
|
Packit Service |
db8eaa |
#define snd_seq_ev_note sndrv_seq_ev_note
|
|
Packit Service |
db8eaa |
#define snd_seq_ev_ctrl sndrv_seq_ev_ctrl
|
|
Packit Service |
db8eaa |
#define snd_seq_ev_raw8 sndrv_seq_ev_raw8
|
|
Packit Service |
db8eaa |
#define snd_seq_ev_raw32 sndrv_seq_ev_raw32
|
|
Packit Service |
db8eaa |
#define snd_seq_ev_ext sndrv_seq_ev_ext
|
|
Packit Service |
db8eaa |
#define snd_seq_result sndrv_seq_result
|
|
Packit Service |
db8eaa |
#define snd_seq_queue_skew sndrv_seq_queue_skew
|
|
Packit Service |
db8eaa |
#define snd_seq_ev_queue_control sndrv_seq_ev_queue_control
|
|
Packit Service |
db8eaa |
#define snd_seq_client_t sndrv_seq_client_t
|
|
Packit Service |
db8eaa |
#define snd_seq_client_type_t sndrv_seq_client_type_t
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include <sound/asequencer.h>
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* take back some renames */
|
|
Packit Service |
db8eaa |
#undef snd_seq_client_t
|
|
Packit Service |
db8eaa |
#undef snd_seq_client_type_t
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include "seqmid.h"
|
|
Packit Service |
db8eaa |
#include "seq_midi_event.h"
|
|
Packit Service |
db8eaa |
#include "list.h"
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct _snd_async_handler {
|
|
Packit Service |
db8eaa |
enum {
|
|
Packit Service |
db8eaa |
SND_ASYNC_HANDLER_GENERIC,
|
|
Packit Service |
db8eaa |
SND_ASYNC_HANDLER_CTL,
|
|
Packit Service |
db8eaa |
SND_ASYNC_HANDLER_PCM,
|
|
Packit Service |
db8eaa |
SND_ASYNC_HANDLER_TIMER,
|
|
Packit Service |
db8eaa |
} type;
|
|
Packit Service |
db8eaa |
int fd;
|
|
Packit Service |
db8eaa |
union {
|
|
Packit Service |
db8eaa |
snd_ctl_t *ctl;
|
|
Packit Service |
db8eaa |
snd_pcm_t *pcm;
|
|
Packit Service |
db8eaa |
snd_timer_t *timer;
|
|
Packit Service |
db8eaa |
} u;
|
|
Packit Service |
db8eaa |
snd_async_callback_t callback;
|
|
Packit Service |
db8eaa |
void *private_data;
|
|
Packit Service |
db8eaa |
struct list_head glist;
|
|
Packit Service |
db8eaa |
struct list_head hlist;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
typedef enum _snd_set_mode {
|
|
Packit Service |
db8eaa |
SND_CHANGE,
|
|
Packit Service |
db8eaa |
SND_TRY,
|
|
Packit Service |
db8eaa |
SND_TEST,
|
|
Packit Service |
db8eaa |
} snd_set_mode_t;
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
size_t page_align(size_t size);
|
|
Packit Service |
db8eaa |
size_t page_size(void);
|
|
Packit Service |
db8eaa |
size_t page_ptr(size_t object_offset, size_t object_size, size_t *offset, size_t *mmap_offset);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int safe_strtol(const char *str, long *val);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int snd_send_fd(int sock, void *data, size_t len, int fd);
|
|
Packit Service |
db8eaa |
int snd_receive_fd(int sock, void *data, size_t len, int *fd);
|
|
Packit Service |
db8eaa |
size_t snd_strlcpy(char *dst, const char *src, size_t size);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/*
|
|
Packit Service |
db8eaa |
* error messages
|
|
Packit Service |
db8eaa |
*/
|
|
Packit Service |
db8eaa |
#ifndef NDEBUG
|
|
Packit Service |
db8eaa |
#define CHECK_SANITY(x) x
|
|
Packit Service |
db8eaa |
extern snd_lib_error_handler_t snd_err_msg;
|
|
Packit Service |
db8eaa |
#define SNDMSG(args...) snd_err_msg(__FILE__, __LINE__, __func__, 0, ##args)
|
|
Packit Service |
db8eaa |
#define SYSMSG(args...) snd_err_msg(__FILE__, __LINE__, __func__, errno, ##args)
|
|
Packit Service |
db8eaa |
#else
|
|
Packit Service |
db8eaa |
#define CHECK_SANITY(x) 0 /* not evaluated */
|
|
Packit Service |
db8eaa |
#define SNDMSG(args...) /* nop */
|
|
Packit Service |
db8eaa |
#define SYSMSG(args...) /* nop */
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/*
|
|
Packit Service |
db8eaa |
*/
|
|
Packit Service |
db8eaa |
#define HAVE_GNU_LD
|
|
Packit Service |
db8eaa |
#define HAVE_ELF
|
|
Packit Service |
db8eaa |
#define HAVE_ASM_PREVIOUS_DIRECTIVE
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* Stolen from libc-symbols.h in GNU glibc */
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* When a reference to SYMBOL is encountered, the linker will emit a
|
|
Packit Service |
db8eaa |
warning message MSG. */
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define ASM_NAME(name) __SYMBOL_PREFIX name
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifdef HAVE_GNU_LD
|
|
Packit Service |
db8eaa |
# ifdef HAVE_ELF
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
|
|
Packit Service |
db8eaa |
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
|
|
Packit Service |
db8eaa |
# define __make_section_unallocated(section_string) \
|
|
Packit Service |
db8eaa |
asm (".section " section_string "\n\t.previous");
|
|
Packit Service |
db8eaa |
# elif defined HAVE_ASM_POPSECTION_DIRECTIVE
|
|
Packit Service |
db8eaa |
# define __make_section_unallocated(section_string) \
|
|
Packit Service |
db8eaa |
asm (".pushsection " section_string "\n\t.popsection");
|
|
Packit Service |
db8eaa |
# else
|
|
Packit Service |
db8eaa |
# define __make_section_unallocated(section_string)
|
|
Packit Service |
db8eaa |
# endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
|
|
Packit Service |
db8eaa |
section attributes on what looks like a comment to the assembler. */
|
|
Packit Service |
db8eaa |
# ifdef HAVE_SECTION_QUOTES
|
|
Packit Service |
db8eaa |
# define link_warning(symbol, msg) \
|
|
Packit Service |
db8eaa |
__make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
|
|
Packit Service |
db8eaa |
static const char __evoke_link_warning_##symbol[] \
|
|
Packit Service |
db8eaa |
__attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\"\n\t#\""))) = msg;
|
|
Packit Service |
db8eaa |
# else
|
|
Packit Service |
db8eaa |
# define link_warning(symbol, msg) \
|
|
Packit Service |
db8eaa |
__make_section_unallocated (".gnu.warning." ASM_NAME(#symbol)) \
|
|
Packit Service |
db8eaa |
static const char __evoke_link_warning_##symbol[] \
|
|
Packit Service |
db8eaa |
__attribute__ ((section (".gnu.warning." ASM_NAME(#symbol) "\n\t#"))) = msg;
|
|
Packit Service |
db8eaa |
# endif
|
|
Packit Service |
db8eaa |
# else
|
|
Packit Service |
db8eaa |
# define link_warning(symbol, msg) \
|
|
Packit Service |
db8eaa |
asm (".stabs \"" msg "\",30,0,0,0\n\t" \
|
|
Packit Service |
db8eaa |
".stabs \"" ASM_NAME(#symbol) "\",1,0,0,0\n");
|
|
Packit Service |
db8eaa |
# endif
|
|
Packit Service |
db8eaa |
#else
|
|
Packit Service |
db8eaa |
/* We will never be heard; they will all die horribly. */
|
|
Packit Service |
db8eaa |
# define link_warning(symbol, msg)
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
static inline int snd_open_device(const char *filename, int fmode)
|
|
Packit Service |
db8eaa |
{
|
|
Packit Service |
db8eaa |
int fd;
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifdef O_CLOEXEC
|
|
Packit Service |
db8eaa |
fmode |= O_CLOEXEC;
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
fd = open(filename, fmode);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* open with resmgr */
|
|
Packit Service |
db8eaa |
#ifdef SUPPORT_RESMGR
|
|
Packit Service |
db8eaa |
if (fd < 0) {
|
|
Packit Service |
db8eaa |
if (errno == EAGAIN || errno == EBUSY)
|
|
Packit Service |
db8eaa |
return fd;
|
|
Packit Service |
db8eaa |
if (! access(filename, F_OK))
|
|
Packit Service |
db8eaa |
fd = rsm_open_device(filename, fmode);
|
|
Packit Service |
db8eaa |
}
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
#ifndef O_CLOEXEC
|
|
Packit Service |
db8eaa |
if (fd >= 0)
|
|
Packit Service |
db8eaa |
fcntl(fd, F_SETFD, FD_CLOEXEC);
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
return fd;
|
|
Packit Service |
db8eaa |
}
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* make local functions really local */
|
|
Packit Service |
db8eaa |
#define snd_dlobj_cache_get \
|
|
Packit Service |
db8eaa |
snd1_dlobj_cache_get
|
|
Packit Service |
db8eaa |
#define snd_dlobj_cache_get2 \
|
|
Packit Service |
db8eaa |
snd1_dlobj_cache_get2
|
|
Packit Service |
db8eaa |
#define snd_dlobj_cache_put \
|
|
Packit Service |
db8eaa |
snd1_dlobj_cache_put
|
|
Packit Service |
db8eaa |
#define snd_dlobj_cache_cleanup \
|
|
Packit Service |
db8eaa |
snd1_dlobj_cache_cleanup
|
|
Packit Service |
db8eaa |
#define snd_config_set_hop \
|
|
Packit Service |
db8eaa |
snd1_config_set_hop
|
|
Packit Service |
db8eaa |
#define snd_config_check_hop \
|
|
Packit Service |
db8eaa |
snd1_config_check_hop
|
|
Packit Service |
db8eaa |
#define snd_config_search_alias_hooks \
|
|
Packit Service |
db8eaa |
snd1_config_search_alias_hooks
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* dlobj cache */
|
|
Packit Service |
db8eaa |
void *snd_dlobj_cache_get(const char *lib, const char *name, const char *version, int verbose);
|
|
Packit Service |
db8eaa |
void *snd_dlobj_cache_get2(const char *lib, const char *name, const char *version, int verbose);
|
|
Packit Service |
db8eaa |
int snd_dlobj_cache_put(void *open_func);
|
|
Packit Service |
db8eaa |
void snd_dlobj_cache_cleanup(void);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* for recursive checks */
|
|
Packit Service |
db8eaa |
void snd_config_set_hop(snd_config_t *conf, int hop);
|
|
Packit Service |
db8eaa |
int snd_config_check_hop(snd_config_t *conf);
|
|
Packit Service |
db8eaa |
#define SND_CONF_MAX_HOPS 64
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int snd_config_search_alias_hooks(snd_config_t *config,
|
|
Packit Service |
db8eaa |
const char *base, const char *key,
|
|
Packit Service |
db8eaa |
snd_config_t **result);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int _snd_conf_generic_id(const char *id);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int _snd_config_load_with_include(snd_config_t *config, snd_input_t *in,
|
|
Packit Service |
db8eaa |
int override, const char * const *default_include_path);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
/* convenience macros */
|
|
Packit Service |
db8eaa |
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define container_of(ptr, type, member) ({ \
|
|
Packit Service |
db8eaa |
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
|
Packit Service |
db8eaa |
(type *)( (char *)__mptr - offsetof(type,member) );})
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifdef INTERNAL
|
|
Packit Service |
db8eaa |
void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen);
|
|
Packit Service |
db8eaa |
#endif
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#endif
|