<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>input.c File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.18 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindex" href="examples.html">Examples</a> </center> <hr><h1>input.c File Reference</h1>Generic stdio-like input interface. <a href="#_details">More...</a> <p> <table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a0">snd_input_close</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> *input)</td></tr> <tr><td> </td><td><font size=-1><em>Closes an input handle.</em> <a href="#a0"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a1">snd_input_scanf</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> *input, const char *format,...)</td></tr> <tr><td> </td><td><font size=-1><em>Reads formatted input (like <code>fscanf(3))</code> from an input handle.</em> <a href="#a1"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>char * </td><td valign=bottom><a class="el" href="input_8c.html#a2">snd_input_gets</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> *input, char *str, size_t size)</td></tr> <tr><td> </td><td><font size=-1><em>Reads a line from an input handle (like <code>fgets(3))</code>.</em> <a href="#a2"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a3">snd_input_getc</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> *input)</td></tr> <tr><td> </td><td><font size=-1><em>Reads a character from an input handle (like <code>fgetc(3))</code>.</em> <a href="#a3"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a4">snd_input_ungetc</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> *input, int c)</td></tr> <tr><td> </td><td><font size=-1><em>Puts the last character read back to an input handle (like <code>ungetc(3))</code>.</em> <a href="#a4"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a5">snd_input_stdio_attach</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> **inputp, FILE *fp, int _close)</td></tr> <tr><td> </td><td><font size=-1><em>Creates a new input object using an existing stdio <code>FILE</code> pointer.</em> <a href="#a5"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a6">snd_input_stdio_open</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> **inputp, const char *file, const char *mode)</td></tr> <tr><td> </td><td><font size=-1><em>Creates a new input object reading from a file.</em> <a href="#a6"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="input_8c.html#a7">snd_input_buffer_open</a> (<a class="el" href="group___input.html#a0">snd_input_t</a> **inputp, const char *buf, ssize_t size)</td></tr> <tr><td> </td><td><font size=-1><em>Creates a new input object from a memory buffer.</em> <a href="#a7"></a><em></em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Generic stdio-like input interface. <p> <p> <dl compact><dt><b>Author: </b></dt><dd> Abramo Bagnara <<a href="mailto:abramo@alsa-project.org">abramo@alsa-project.org</a>> </dl><dl compact><dt><b>Date: </b></dt><dd> 2000</dl>Generic stdio-like input interface <p> <hr><h2>Function Documentation</h2> <a name="a7" doxytag="input.c::snd_input_buffer_open"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_buffer_open </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> ** </td> <td class="mdname" nowrap> <em>inputp</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>buf</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>ssize_t </td> <td class="mdname" nowrap> <em>size</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Creates a new input object from a memory buffer. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>inputp</em> </td><td> The function puts the pointer to the new input object at the address specified by <code>inputp</code>. </td></tr> <tr><td valign=top><em>buf</em> </td><td> Address of the input buffer. </td></tr> <tr><td valign=top><em>size</em> </td><td> Size of the input buffer. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise a negative error code.</dl>This functions creates a copy of the input buffer, so the application is not required to preserve the buffer after this function has been called. </td> </tr> </table> <a name="a0" doxytag="input.c::snd_input_close"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_close </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> * </td> <td class="mdname1" valign="top" nowrap> <em>input</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Closes an input handle. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>input</em> </td><td> The input handle to be closed. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise a negative error code. </dl> </td> </tr> </table> <a name="a3" doxytag="input.c::snd_input_getc"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_getc </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> * </td> <td class="mdname1" valign="top" nowrap> <em>input</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Reads a character from an input handle (like <code>fgetc(3))</code>. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>input</em> </td><td> The input handle. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> The character read, or <code>EOF</code> on end of file or error. </dl> </td> </tr> </table> <a name="a2" doxytag="input.c::snd_input_gets"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> char* snd_input_gets </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> * </td> <td class="mdname" nowrap> <em>input</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>str</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t </td> <td class="mdname" nowrap> <em>size</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Reads a line from an input handle (like <code>fgets(3))</code>. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>input</em> </td><td> The input handle. </td></tr> <tr><td valign=top><em>str</em> </td><td> Address of the destination buffer. </td></tr> <tr><td valign=top><em>size</em> </td><td> The size of the destination buffer. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Pointer to the buffer if successful, otherwise <code>NULL</code>.</dl>Like <code>fgets</code>, the returned string is zero-terminated, and contains the new-line character '<code>\n</code>' if the line fits into the buffer. </td> </tr> </table> <a name="a1" doxytag="input.c::snd_input_scanf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_scanf </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> * </td> <td class="mdname" nowrap> <em>input</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>... </td> <td class="mdname" nowrap> </td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Reads formatted input (like <code>fscanf(3))</code> from an input handle. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>input</em> </td><td> The input handle. </td></tr> <tr><td valign=top><em>format</em> </td><td> Format string in <code>fscanf</code> format. </td></tr> <tr><td valign=top><em>...</em> </td><td> Other <code>fscanf</code> arguments. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> The number of input items assigned, or <code>EOF</code>.</dl><dl compact><dt><b><a class="el" href="bug.html#_bug000001">Bug: </a></b></dt><dd> Reading from a memory buffer doesn't work. </dl> </td> </tr> </table> <a name="a5" doxytag="input.c::snd_input_stdio_attach"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_stdio_attach </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> ** </td> <td class="mdname" nowrap> <em>inputp</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>FILE * </td> <td class="mdname" nowrap> <em>fp</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>_close</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Creates a new input object using an existing stdio <code>FILE</code> pointer. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>inputp</em> </td><td> The function puts the pointer to the new input object at the address specified by <code>inputp</code>. </td></tr> <tr><td valign=top><em>fp</em> </td><td> The <code>FILE</code> pointer to read from. Reading begins at the current file position. </td></tr> <tr><td valign=top><em>close</em> </td><td> Close flag. Set this to 1 if <a class="el" href="input_8c.html#a0">snd_input_close</a> should close <code>fp</code> by calling <code>fclose</code>. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise a negative error code. </dl> </td> </tr> </table> <a name="a6" doxytag="input.c::snd_input_stdio_open"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_stdio_open </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> ** </td> <td class="mdname" nowrap> <em>inputp</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>mode</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Creates a new input object reading from a file. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>inputp</em> </td><td> The functions puts the pointer to the new input object at the address specified by <code>inputp</code>. </td></tr> <tr><td valign=top><em>file</em> </td><td> The name of the file to read from. </td></tr> <tr><td valign=top><em>mode</em> </td><td> The open mode, like <code>fopen(3)</code>. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Zero if successful, otherwise a negative error code. </dl> </td> </tr> </table> <a name="a4" doxytag="input.c::snd_input_ungetc"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int snd_input_ungetc </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group___input.html#a0">snd_input_t</a> * </td> <td class="mdname" nowrap> <em>input</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>c</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Puts the last character read back to an input handle (like <code>ungetc(3))</code>. <p> <dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>input</em> </td><td> The input handle. </td></tr> <tr><td valign=top><em>c</em> </td><td> The character to push back. </td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> The character pushed back, or <code>EOF</code> on error. </dl> </td> </tr> </table> <hr><address style="align: right;"><small>Generated on Wed Apr 2 16:06:34 2003 for ALSA project - the C library reference by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address> </body> </html>