output.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * \file include/output.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25. *
  26. */
  27. #ifndef __ALSA_OUTPUT_H
  28. #define __ALSA_OUTPUT_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /**
  33. * \defgroup Output Output Interface
  34. *
  35. * The output functions present an interface similar to the stdio functions
  36. * on top of different underlying output destinations.
  37. *
  38. * Many PCM debugging functions (\c snd_pcm_xxx_dump_xxx) use such an output
  39. * handle to be able to write not only to the screen but also to other
  40. * destinations, e.g. to files or to memory buffers.
  41. *
  42. * \{
  43. */
  44. /**
  45. * \brief Internal structure for an output object.
  46. *
  47. * The ALSA library uses a pointer to this structure as a handle to an
  48. * output object. Applications don't access its contents directly.
  49. */
  50. typedef struct _snd_output snd_output_t;
  51. /** Output type. */
  52. typedef enum _snd_output_type {
  53. /** Output to a stdio stream. */
  54. SND_OUTPUT_STDIO,
  55. /** Output to a memory buffer. */
  56. SND_OUTPUT_BUFFER
  57. } snd_output_type_t;
  58. int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode);
  59. int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close);
  60. int snd_output_buffer_open(snd_output_t **outputp);
  61. size_t snd_output_buffer_string(snd_output_t *output, char **buf);
  62. int snd_output_close(snd_output_t *output);
  63. int snd_output_printf(snd_output_t *output, const char *format, ...)
  64. #ifndef DOC_HIDDEN
  65. __attribute__ ((format (printf, 2, 3)))
  66. #endif
  67. ;
  68. int snd_output_vprintf(snd_output_t *output, const char *format, va_list args);
  69. int snd_output_puts(snd_output_t *output, const char *str);
  70. int snd_output_putc(snd_output_t *output, int c);
  71. int snd_output_flush(snd_output_t *output);
  72. /** \} */
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __ALSA_OUTPUT_H */