Loading...
Searching...
No Matches
output.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __ALSA_OUTPUT_H
#define __ALSA_OUTPUT_H
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _snd_output snd_output_t;
typedef enum _snd_output_type {
SND_OUTPUT_STDIO,
SND_OUTPUT_BUFFER
} snd_output_type_t;
int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode);
int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close);
int snd_output_buffer_open(snd_output_t **outputp);
size_t snd_output_buffer_string(snd_output_t *output, char **buf);
size_t snd_output_buffer_steal(snd_output_t *output, char **buf);
int snd_output_close(snd_output_t *output);
int snd_output_printf(snd_output_t *output, const char *format, ...)
#ifndef DOC_HIDDEN
__attribute__ ((format (printf, 2, 3)))
#endif
;
int snd_output_vprintf(snd_output_t *output, const char *format, va_list args);
int snd_output_puts(snd_output_t *output, const char *str);
int snd_output_putc(snd_output_t *output, int c);
int snd_output_flush(snd_output_t *output);
#ifdef __cplusplus
}
#endif
#endif /* __ALSA_OUTPUT_H */
snd_output_buffer_steal
size_t snd_output_buffer_steal(snd_output_t *output, char **buf)
Returns the address of the buffer of a SND_OUTPUT_BUFFER output handle.
Definition output.c:365
snd_output_t
struct _snd_output snd_output_t
Internal structure for an output object.
Definition output.h:56
snd_output_printf
int snd_output_printf(snd_output_t *output, const char *format,...)
Writes formatted output (like fprintf(3)) to an output handle.
Definition output.c:71
snd_output_type_t
snd_output_type_t
Definition output.h:59
snd_output_putc
int snd_output_putc(snd_output_t *output, int c)
Writes a character to an output handle (like putc(3)).
Definition output.c:110
snd_output_flush
int snd_output_flush(snd_output_t *output)
Flushes an output handle (like fflush(3)).
Definition output.c:124
snd_output_puts
int snd_output_puts(snd_output_t *output, const char *str)
Writes a string to an output handle (like fputs(3)).
Definition output.c:99
snd_output_buffer_string
size_t snd_output_buffer_string(snd_output_t *output, char **buf)
Returns the address of the buffer of a SND_OUTPUT_BUFFER output handle.
Definition output.c:348
snd_output_close
int snd_output_close(snd_output_t *output)
Closes an output handle.
Definition output.c:57
snd_output_stdio_attach
int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close)
Creates a new output object using an existing stdio FILE pointer.
Definition output.c:188
snd_output_vprintf
int snd_output_vprintf(snd_output_t *output, const char *format, va_list args)
Writes formatted output (like fprintf(3)) to an output handle.
Definition output.c:88
snd_output_stdio_open
int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode)
Creates a new output object writing to a file.
Definition output.c:218
snd_output_buffer_open
int snd_output_buffer_open(snd_output_t **outputp)
Creates a new output object with an auto-extending memory buffer.
Definition output.c:383
SND_OUTPUT_BUFFER
@ SND_OUTPUT_BUFFER
Definition output.h:63
SND_OUTPUT_STDIO
@ SND_OUTPUT_STDIO
Definition output.h:61