1/** 2 * \file include/input.h 3 * \brief Application interface library for the ALSA driver 4 * \author Jaroslav Kysela <perex@perex.cz> 5 * \author Abramo Bagnara <abramo@alsa-project.org> 6 * \author Takashi Iwai <tiwai@suse.de> 7 * \date 1998-2001 8 * 9 * Application interface library for the ALSA driver 10 */ 11/* 12 * This library is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU Lesser General Public License as 14 * published by the Free Software Foundation; either version 2.1 of 15 * the License, or (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this library; if not, write to the Free Software 24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 * 26 */ 27 28#ifndef __ALSA_INPUT_H 29#define __ALSA_INPUT_H 30 31#include <stdarg.h> 32 33#ifdef __cplusplus 34extern "C" { 35#endif 36 37/** 38 * \defgroup Input Input Interface 39 * 40 * The input functions present an interface similar to the stdio functions 41 * on top of different underlying input sources. 42 * 43 * The #snd_config_load function uses such an input handle to be able to 44 * load configurations not only from standard files but also from other 45 * sources, e.g. from memory buffers. 46 * 47 * \{ 48 */ 49 50/** 51 * \brief Internal structure for an input object. 52 * 53 * The ALSA library uses a pointer to this structure as a handle to an 54 * input object. Applications don't access its contents directly. 55 */ 56typedef struct _snd_input snd_input_t; 57 58/** Input type. */ 59typedef enum _snd_input_type { 60 /** Input from a stdio stream. */ 61 SND_INPUT_STDIO, 62 /** Input from a memory buffer. */ 63 SND_INPUT_BUFFER 64} snd_input_type_t; 65 66int snd_input_stdio_open(snd_input_t **inputp, const char *file, const char *mode); 67int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int _close); 68int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, ssize_t size); 69int snd_input_close(snd_input_t *input); 70int snd_input_scanf(snd_input_t *input, const char *format, ...) 71#ifndef DOC_HIDDEN 72 __attribute__ ((format (scanf, 2, 3))) 73#endif 74 ; 75char *snd_input_gets(snd_input_t *input, char *str, size_t size); 76int snd_input_getc(snd_input_t *input); 77int snd_input_ungetc(snd_input_t *input, int c); 78 79/** \} */ 80 81#ifdef __cplusplus 82} 83#endif 84 85#endif /* __ALSA_INPUT_H */ 86