ALSA project - the C library reference

Loading...
Searching...
No Matches
input.h
Go to the documentation of this file.
1
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#if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
29/* don't use ALSA_LIBRARY_BUILD define in sources outside alsa-lib */
30#warning "use #include <alsa/asoundlib.h>, <alsa/input.h> should not be used directly"
31#include <alsa/asoundlib.h>
32#endif
33
34#ifndef __ALSA_INPUT_H
35#define __ALSA_INPUT_H
36
37#include <stdarg.h>
38
39#ifdef __cplusplus
40 extern "C" {
41#endif
42
62 typedef struct _snd_input snd_input_t;
63
65 typedef enum _snd_input_type {
67 SND_INPUT_STDIO,
69 SND_INPUT_BUFFER
70} snd_input_type_t;
71
72 int snd_input_stdio_open(snd_input_t **inputp, const char *file, const char *mode);
73 int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int _close);
74 int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, ssize_t size);
75 int snd_input_close(snd_input_t *input);
76 int snd_input_scanf(snd_input_t *input, const char *format, ...)
77#ifndef DOC_HIDDEN
78 __attribute__ ((format (scanf, 2, 3)))
79#endif
80 ;
81 char *snd_input_gets(snd_input_t *input, char *str, size_t size);
82 int snd_input_getc(snd_input_t *input);
83 int snd_input_ungetc(snd_input_t *input, int c);
84
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* __ALSA_INPUT_H */
snd_input_scanf
int snd_input_scanf(snd_input_t *input, const char *format,...)
Reads formatted input (like fscanf(3)) from an input handle.
Definition input.c:74
snd_input_t
struct _snd_input snd_input_t
Internal structure for an input object.
Definition input.h:62
snd_input_buffer_open
int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, ssize_t size)
Creates a new input object from a memory buffer.
Definition input.c:306
snd_input_close
int snd_input_close(snd_input_t *input)
Closes an input handle.
Definition input.c:58
snd_input_stdio_open
int snd_input_stdio_open(snd_input_t **inputp, const char *file, const char *mode)
Creates a new input object reading from a file.
Definition input.c:209
snd_input_stdio_attach
int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int _close)
Creates a new input object using an existing stdio FILE pointer.
Definition input.c:179
snd_input_type_t
snd_input_type_t
Definition input.h:65
snd_input_ungetc
int snd_input_ungetc(snd_input_t *input, int c)
Puts the last character read back to an input handle (like ungetc(3)).
Definition input.c:115
snd_input_gets
char * snd_input_gets(snd_input_t *input, char *str, size_t size)
Reads a line from an input handle (like fgets(3)).
Definition input.c:94
snd_input_getc
int snd_input_getc(snd_input_t *input)
Reads a character from an input handle (like fgetc(3)).
Definition input.c:104
SND_INPUT_BUFFER
@ SND_INPUT_BUFFER
Definition input.h:69
SND_INPUT_STDIO
@ SND_INPUT_STDIO
Definition input.h:67
format
uint16_t format
Definition ump_msg.h:2