You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1099 lines
113 KiB
HTML
1099 lines
113 KiB
HTML
<!-- HTML header for doxygen 1.8.7-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.6.3"/>
|
|
<!--BEGIN PROJECT_NAME--><title>avr-libc: avr-libc: stdio.h Source File</title><!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME--><title>avr-libc: stdio.h Source File</title><!--END !PROJECT_NAME-->
|
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
|
$treeview
|
|
$search
|
|
$mathjax
|
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
|
$extrastylesheet
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
|
|
<!--BEGIN TITLEAREA-->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<!--BEGIN PROJECT_LOGO-->
|
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
|
<!--END PROJECT_LOGO-->
|
|
<!--BEGIN PROJECT_NAME-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">avr-libc
|
|
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">2.0.0</span><!--END PROJECT_NUMBER-->
|
|
</div>
|
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
|
</td>
|
|
<!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME-->
|
|
<!--BEGIN PROJECT_BRIEF-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectbrief">$projectbrief</div>
|
|
</td>
|
|
<!--END PROJECT_BRIEF-->
|
|
<!--END !PROJECT_NAME-->
|
|
<!--BEGIN DISABLE_INDEX-->
|
|
<!--BEGIN SEARCHENGINE-->
|
|
<td>$searchbox</td>
|
|
<!--END SEARCHENGINE-->
|
|
<!--END DISABLE_INDEX-->
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<tr>
|
|
<td align="left"><a href="http://www.nongnu.org/avr-libc/"><h2>AVR Libc Home Page</h2></a></td>
|
|
<td align="center" colspan=4><img src="avrs.png" alt="AVRs" align="middle" border="0"></td>
|
|
<td align="right"><a href="https://savannah.nongnu.org/projects/avr-libc/"><h2>AVR Libc Development Pages</h2></a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="20%"><a href="index.html"><h2>Main Page</h2></a></td>
|
|
<td align="center" width="20%"><a href="pages.html"><h2>User Manual</h2></a></td>
|
|
<td align="center" width="20%"><a href="modules.html"><h2>Library Reference</h2></a></td>
|
|
<td align="center" width="20%"><a href="FAQ.html"><h2>FAQ</h2></a></td>
|
|
<td align="center" width="20%"><a href="group__demos.html"><h2>Example Projects</h2></a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!--END TITLEAREA-->
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.6.3 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<h1>stdio.h</h1><a href="stdio_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Copyright (c) 2002, 2005, 2007 Joerg Wunsch</span>
|
|
<a name="l00002"></a>00002 <span class="comment"> All rights reserved.</span>
|
|
<a name="l00003"></a>00003 <span class="comment"></span>
|
|
<a name="l00004"></a>00004 <span class="comment"> Portions of documentation Copyright (c) 1990, 1991, 1993</span>
|
|
<a name="l00005"></a>00005 <span class="comment"> The Regents of the University of California.</span>
|
|
<a name="l00006"></a>00006 <span class="comment"></span>
|
|
<a name="l00007"></a>00007 <span class="comment"> All rights reserved.</span>
|
|
<a name="l00008"></a>00008 <span class="comment"></span>
|
|
<a name="l00009"></a>00009 <span class="comment"> Redistribution and use in source and binary forms, with or without</span>
|
|
<a name="l00010"></a>00010 <span class="comment"> modification, are permitted provided that the following conditions are met:</span>
|
|
<a name="l00011"></a>00011 <span class="comment"></span>
|
|
<a name="l00012"></a>00012 <span class="comment"> * Redistributions of source code must retain the above copyright</span>
|
|
<a name="l00013"></a>00013 <span class="comment"> notice, this list of conditions and the following disclaimer.</span>
|
|
<a name="l00014"></a>00014 <span class="comment"></span>
|
|
<a name="l00015"></a>00015 <span class="comment"> * Redistributions in binary form must reproduce the above copyright</span>
|
|
<a name="l00016"></a>00016 <span class="comment"> notice, this list of conditions and the following disclaimer in</span>
|
|
<a name="l00017"></a>00017 <span class="comment"> the documentation and/or other materials provided with the</span>
|
|
<a name="l00018"></a>00018 <span class="comment"> distribution.</span>
|
|
<a name="l00019"></a>00019 <span class="comment"></span>
|
|
<a name="l00020"></a>00020 <span class="comment"> * Neither the name of the copyright holders nor the names of</span>
|
|
<a name="l00021"></a>00021 <span class="comment"> contributors may be used to endorse or promote products derived</span>
|
|
<a name="l00022"></a>00022 <span class="comment"> from this software without specific prior written permission.</span>
|
|
<a name="l00023"></a>00023 <span class="comment"></span>
|
|
<a name="l00024"></a>00024 <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span>
|
|
<a name="l00025"></a>00025 <span class="comment"> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
|
|
<a name="l00026"></a>00026 <span class="comment"> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
|
|
<a name="l00027"></a>00027 <span class="comment"> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE</span>
|
|
<a name="l00028"></a>00028 <span class="comment"> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span>
|
|
<a name="l00029"></a>00029 <span class="comment"> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span>
|
|
<a name="l00030"></a>00030 <span class="comment"> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span>
|
|
<a name="l00031"></a>00031 <span class="comment"> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span>
|
|
<a name="l00032"></a>00032 <span class="comment"> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span>
|
|
<a name="l00033"></a>00033 <span class="comment"> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span>
|
|
<a name="l00034"></a>00034 <span class="comment"> POSSIBILITY OF SUCH DAMAGE.</span>
|
|
<a name="l00035"></a>00035 <span class="comment"></span>
|
|
<a name="l00036"></a>00036 <span class="comment"> $Id$</span>
|
|
<a name="l00037"></a>00037 <span class="comment">*/</span>
|
|
<a name="l00038"></a>00038
|
|
<a name="l00039"></a>00039 <span class="preprocessor">#ifndef _STDIO_H_</span>
|
|
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define _STDIO_H_ 1</span>
|
|
<a name="l00041"></a>00041 <span class="preprocessor"></span>
|
|
<a name="l00042"></a>00042 <span class="preprocessor">#ifndef __ASSEMBLER__</span>
|
|
<a name="l00043"></a>00043 <span class="preprocessor"></span>
|
|
<a name="l00044"></a>00044 <span class="preprocessor">#include <<a class="code" href="inttypes_8h.html">inttypes.h</a>></span>
|
|
<a name="l00045"></a>00045 <span class="preprocessor">#include <stdarg.h></span>
|
|
<a name="l00046"></a>00046
|
|
<a name="l00047"></a>00047 <span class="preprocessor">#ifndef __DOXYGEN__</span>
|
|
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define __need_NULL</span>
|
|
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define __need_size_t</span>
|
|
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#include <stddef.h></span>
|
|
<a name="l00051"></a>00051 <span class="preprocessor">#endif </span><span class="comment">/* !__DOXYGEN__ */</span>
|
|
<a name="l00052"></a>00052 <span class="comment"></span>
|
|
<a name="l00053"></a>00053 <span class="comment">/** \file */</span><span class="comment"></span>
|
|
<a name="l00054"></a>00054 <span class="comment">/** \defgroup avr_stdio <stdio.h>: Standard IO facilities</span>
|
|
<a name="l00055"></a>00055 <span class="comment"> \code #include <stdio.h> \endcode</span>
|
|
<a name="l00056"></a>00056 <span class="comment"></span>
|
|
<a name="l00057"></a>00057 <span class="comment"> <h3>Introduction to the Standard IO facilities</h3></span>
|
|
<a name="l00058"></a>00058 <span class="comment"></span>
|
|
<a name="l00059"></a>00059 <span class="comment"> This file declares the standard IO facilities that are implemented</span>
|
|
<a name="l00060"></a>00060 <span class="comment"> in \c avr-libc. Due to the nature of the underlying hardware,</span>
|
|
<a name="l00061"></a>00061 <span class="comment"> only a limited subset of standard IO is implemented. There is no</span>
|
|
<a name="l00062"></a>00062 <span class="comment"> actual file implementation available, so only device IO can be</span>
|
|
<a name="l00063"></a>00063 <span class="comment"> performed. Since there's no operating system, the application</span>
|
|
<a name="l00064"></a>00064 <span class="comment"> needs to provide enough details about their devices in order to</span>
|
|
<a name="l00065"></a>00065 <span class="comment"> make them usable by the standard IO facilities.</span>
|
|
<a name="l00066"></a>00066 <span class="comment"></span>
|
|
<a name="l00067"></a>00067 <span class="comment"> Due to space constraints, some functionality has not been</span>
|
|
<a name="l00068"></a>00068 <span class="comment"> implemented at all (like some of the \c printf conversions that</span>
|
|
<a name="l00069"></a>00069 <span class="comment"> have been left out). Nevertheless, potential users of this</span>
|
|
<a name="l00070"></a>00070 <span class="comment"> implementation should be warned: the \c printf and \c scanf families of functions, although</span>
|
|
<a name="l00071"></a>00071 <span class="comment"> usually associated with presumably simple things like the</span>
|
|
<a name="l00072"></a>00072 <span class="comment"> famous "Hello, world!" program, are actually fairly complex</span>
|
|
<a name="l00073"></a>00073 <span class="comment"> which causes their inclusion to eat up a fair amount of code space.</span>
|
|
<a name="l00074"></a>00074 <span class="comment"> Also, they are not fast due to the nature of interpreting the</span>
|
|
<a name="l00075"></a>00075 <span class="comment"> format string at run-time. Whenever possible, resorting to the</span>
|
|
<a name="l00076"></a>00076 <span class="comment"> (sometimes non-standard) predetermined conversion facilities that are</span>
|
|
<a name="l00077"></a>00077 <span class="comment"> offered by avr-libc will usually cost much less in terms of speed</span>
|
|
<a name="l00078"></a>00078 <span class="comment"> and code size.</span>
|
|
<a name="l00079"></a>00079 <span class="comment"></span>
|
|
<a name="l00080"></a>00080 <span class="comment"> <h3>Tunable options for code size vs. feature set</h3></span>
|
|
<a name="l00081"></a>00081 <span class="comment"></span>
|
|
<a name="l00082"></a>00082 <span class="comment"> In order to allow programmers a code size vs. functionality tradeoff,</span>
|
|
<a name="l00083"></a>00083 <span class="comment"> the function vfprintf() which is the heart of the printf family can be</span>
|
|
<a name="l00084"></a>00084 <span class="comment"> selected in different flavours using linker options. See the</span>
|
|
<a name="l00085"></a>00085 <span class="comment"> documentation of vfprintf() for a detailed description. The same</span>
|
|
<a name="l00086"></a>00086 <span class="comment"> applies to vfscanf() and the \c scanf family of functions.</span>
|
|
<a name="l00087"></a>00087 <span class="comment"></span>
|
|
<a name="l00088"></a>00088 <span class="comment"> <h3>Outline of the chosen API</h3></span>
|
|
<a name="l00089"></a>00089 <span class="comment"></span>
|
|
<a name="l00090"></a>00090 <span class="comment"> The standard streams \c stdin, \c stdout, and \c stderr are</span>
|
|
<a name="l00091"></a>00091 <span class="comment"> provided, but contrary to the C standard, since avr-libc has no</span>
|
|
<a name="l00092"></a>00092 <span class="comment"> knowledge about applicable devices, these streams are not already</span>
|
|
<a name="l00093"></a>00093 <span class="comment"> pre-initialized at application startup. Also, since there is no</span>
|
|
<a name="l00094"></a>00094 <span class="comment"> notion of "file" whatsoever to avr-libc, there is no function</span>
|
|
<a name="l00095"></a>00095 <span class="comment"> \c fopen() that could be used to associate a stream to some device.</span>
|
|
<a name="l00096"></a>00096 <span class="comment"> (See \ref stdio_note1 "note 1".) Instead, the function \c fdevopen()</span>
|
|
<a name="l00097"></a>00097 <span class="comment"> is provided to associate a stream to a device, where the device</span>
|
|
<a name="l00098"></a>00098 <span class="comment"> needs to provide a function to send a character, to receive a</span>
|
|
<a name="l00099"></a>00099 <span class="comment"> character, or both. There is no differentiation between "text" and</span>
|
|
<a name="l00100"></a>00100 <span class="comment"> "binary" streams inside avr-libc. Character \c \\n is sent</span>
|
|
<a name="l00101"></a>00101 <span class="comment"> literally down to the device's \c put() function. If the device</span>
|
|
<a name="l00102"></a>00102 <span class="comment"> requires a carriage return (\c \\r) character to be sent before</span>
|
|
<a name="l00103"></a>00103 <span class="comment"> the linefeed, its \c put() routine must implement this (see</span>
|
|
<a name="l00104"></a>00104 <span class="comment"> \ref stdio_note2 "note 2").</span>
|
|
<a name="l00105"></a>00105 <span class="comment"></span>
|
|
<a name="l00106"></a>00106 <span class="comment"> As an alternative method to fdevopen(), the macro</span>
|
|
<a name="l00107"></a>00107 <span class="comment"> fdev_setup_stream() might be used to setup a user-supplied FILE</span>
|
|
<a name="l00108"></a>00108 <span class="comment"> structure.</span>
|
|
<a name="l00109"></a>00109 <span class="comment"></span>
|
|
<a name="l00110"></a>00110 <span class="comment"> It should be noted that the automatic conversion of a newline</span>
|
|
<a name="l00111"></a>00111 <span class="comment"> character into a carriage return - newline sequence breaks binary</span>
|
|
<a name="l00112"></a>00112 <span class="comment"> transfers. If binary transfers are desired, no automatic</span>
|
|
<a name="l00113"></a>00113 <span class="comment"> conversion should be performed, but instead any string that aims</span>
|
|
<a name="l00114"></a>00114 <span class="comment"> to issue a CR-LF sequence must use <tt>"\r\n"</tt> explicitly.</span>
|
|
<a name="l00115"></a>00115 <span class="comment"></span>
|
|
<a name="l00116"></a>00116 <span class="comment"> For convenience, the first call to \c fdevopen() that opens a</span>
|
|
<a name="l00117"></a>00117 <span class="comment"> stream for reading will cause the resulting stream to be aliased</span>
|
|
<a name="l00118"></a>00118 <span class="comment"> to \c stdin. Likewise, the first call to \c fdevopen() that opens</span>
|
|
<a name="l00119"></a>00119 <span class="comment"> a stream for writing will cause the resulting stream to be aliased</span>
|
|
<a name="l00120"></a>00120 <span class="comment"> to both, \c stdout, and \c stderr. Thus, if the open was done</span>
|
|
<a name="l00121"></a>00121 <span class="comment"> with both, read and write intent, all three standard streams will</span>
|
|
<a name="l00122"></a>00122 <span class="comment"> be identical. Note that these aliases are indistinguishable from</span>
|
|
<a name="l00123"></a>00123 <span class="comment"> each other, thus calling \c fclose() on such a stream will also</span>
|
|
<a name="l00124"></a>00124 <span class="comment"> effectively close all of its aliases (\ref stdio_note3 "note 3").</span>
|
|
<a name="l00125"></a>00125 <span class="comment"></span>
|
|
<a name="l00126"></a>00126 <span class="comment"> It is possible to tie additional user data to a stream, using</span>
|
|
<a name="l00127"></a>00127 <span class="comment"> fdev_set_udata(). The backend put and get functions can then</span>
|
|
<a name="l00128"></a>00128 <span class="comment"> extract this user data using fdev_get_udata(), and act</span>
|
|
<a name="l00129"></a>00129 <span class="comment"> appropriately. For example, a single put function could be used</span>
|
|
<a name="l00130"></a>00130 <span class="comment"> to talk to two different UARTs that way, or the put and get</span>
|
|
<a name="l00131"></a>00131 <span class="comment"> functions could keep internal state between calls there.</span>
|
|
<a name="l00132"></a>00132 <span class="comment"></span>
|
|
<a name="l00133"></a>00133 <span class="comment"> <h3>Format strings in flash ROM</h3></span>
|
|
<a name="l00134"></a>00134 <span class="comment"></span>
|
|
<a name="l00135"></a>00135 <span class="comment"> All the \c printf and \c scanf family functions come in two flavours: the</span>
|
|
<a name="l00136"></a>00136 <span class="comment"> standard name, where the format string is expected to be in</span>
|
|
<a name="l00137"></a>00137 <span class="comment"> SRAM, as well as a version with the suffix "_P" where the format</span>
|
|
<a name="l00138"></a>00138 <span class="comment"> string is expected to reside in the flash ROM. The macro</span>
|
|
<a name="l00139"></a>00139 <span class="comment"> \c PSTR (explained in \ref avr_pgmspace) becomes very handy</span>
|
|
<a name="l00140"></a>00140 <span class="comment"> for declaring these format strings.</span>
|
|
<a name="l00141"></a>00141 <span class="comment"></span>
|
|
<a name="l00142"></a>00142 <span class="comment"> \anchor stdio_without_malloc</span>
|
|
<a name="l00143"></a>00143 <span class="comment"> <h3>Running stdio without malloc()</h3></span>
|
|
<a name="l00144"></a>00144 <span class="comment"></span>
|
|
<a name="l00145"></a>00145 <span class="comment"> By default, fdevopen() requires malloc(). As this is often</span>
|
|
<a name="l00146"></a>00146 <span class="comment"> not desired in the limited environment of a microcontroller, an</span>
|
|
<a name="l00147"></a>00147 <span class="comment"> alternative option is provided to run completely without malloc().</span>
|
|
<a name="l00148"></a>00148 <span class="comment"></span>
|
|
<a name="l00149"></a>00149 <span class="comment"> The macro fdev_setup_stream() is provided to prepare a</span>
|
|
<a name="l00150"></a>00150 <span class="comment"> user-supplied FILE buffer for operation with stdio.</span>
|
|
<a name="l00151"></a>00151 <span class="comment"></span>
|
|
<a name="l00152"></a>00152 <span class="comment"> <h4>Example</h4></span>
|
|
<a name="l00153"></a>00153 <span class="comment"></span>
|
|
<a name="l00154"></a>00154 <span class="comment"> \code</span>
|
|
<a name="l00155"></a>00155 <span class="comment"> #include <stdio.h></span>
|
|
<a name="l00156"></a>00156 <span class="comment"></span>
|
|
<a name="l00157"></a>00157 <span class="comment"> static int uart_putchar(char c, FILE *stream);</span>
|
|
<a name="l00158"></a>00158 <span class="comment"></span>
|
|
<a name="l00159"></a>00159 <span class="comment"> static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,</span>
|
|
<a name="l00160"></a>00160 <span class="comment"> _FDEV_SETUP_WRITE);</span>
|
|
<a name="l00161"></a>00161 <span class="comment"></span>
|
|
<a name="l00162"></a>00162 <span class="comment"> static int</span>
|
|
<a name="l00163"></a>00163 <span class="comment"> uart_putchar(char c, FILE *stream)</span>
|
|
<a name="l00164"></a>00164 <span class="comment"> {</span>
|
|
<a name="l00165"></a>00165 <span class="comment"></span>
|
|
<a name="l00166"></a>00166 <span class="comment"> if (c == '\n')</span>
|
|
<a name="l00167"></a>00167 <span class="comment"> uart_putchar('\r', stream);</span>
|
|
<a name="l00168"></a>00168 <span class="comment"> loop_until_bit_is_set(UCSRA, UDRE);</span>
|
|
<a name="l00169"></a>00169 <span class="comment"> UDR = c;</span>
|
|
<a name="l00170"></a>00170 <span class="comment"> return 0;</span>
|
|
<a name="l00171"></a>00171 <span class="comment"> }</span>
|
|
<a name="l00172"></a>00172 <span class="comment"></span>
|
|
<a name="l00173"></a>00173 <span class="comment"> int</span>
|
|
<a name="l00174"></a>00174 <span class="comment"> main(void)</span>
|
|
<a name="l00175"></a>00175 <span class="comment"> {</span>
|
|
<a name="l00176"></a>00176 <span class="comment"> init_uart();</span>
|
|
<a name="l00177"></a>00177 <span class="comment"> stdout = &mystdout;</span>
|
|
<a name="l00178"></a>00178 <span class="comment"> printf("Hello, world!\n");</span>
|
|
<a name="l00179"></a>00179 <span class="comment"></span>
|
|
<a name="l00180"></a>00180 <span class="comment"> return 0;</span>
|
|
<a name="l00181"></a>00181 <span class="comment"> }</span>
|
|
<a name="l00182"></a>00182 <span class="comment"> \endcode</span>
|
|
<a name="l00183"></a>00183 <span class="comment"></span>
|
|
<a name="l00184"></a>00184 <span class="comment"> This example uses the initializer form FDEV_SETUP_STREAM() rather</span>
|
|
<a name="l00185"></a>00185 <span class="comment"> than the function-like fdev_setup_stream(), so all data</span>
|
|
<a name="l00186"></a>00186 <span class="comment"> initialization happens during C start-up.</span>
|
|
<a name="l00187"></a>00187 <span class="comment"></span>
|
|
<a name="l00188"></a>00188 <span class="comment"> If streams initialized that way are no longer needed, they can be</span>
|
|
<a name="l00189"></a>00189 <span class="comment"> destroyed by first calling the macro fdev_close(), and then</span>
|
|
<a name="l00190"></a>00190 <span class="comment"> destroying the object itself. No call to fclose() should be</span>
|
|
<a name="l00191"></a>00191 <span class="comment"> issued for these streams. While calling fclose() itself is</span>
|
|
<a name="l00192"></a>00192 <span class="comment"> harmless, it will cause an undefined reference to free() and thus</span>
|
|
<a name="l00193"></a>00193 <span class="comment"> cause the linker to link the malloc module into the application.</span>
|
|
<a name="l00194"></a>00194 <span class="comment"></span>
|
|
<a name="l00195"></a>00195 <span class="comment"> <h3>Notes</h3></span>
|
|
<a name="l00196"></a>00196 <span class="comment"></span>
|
|
<a name="l00197"></a>00197 <span class="comment"> \anchor stdio_note1 \par Note 1:</span>
|
|
<a name="l00198"></a>00198 <span class="comment"> It might have been possible to implement a device abstraction that</span>
|
|
<a name="l00199"></a>00199 <span class="comment"> is compatible with \c fopen() but since this would have required</span>
|
|
<a name="l00200"></a>00200 <span class="comment"> to parse a string, and to take all the information needed either</span>
|
|
<a name="l00201"></a>00201 <span class="comment"> out of this string, or out of an additional table that would need to be</span>
|
|
<a name="l00202"></a>00202 <span class="comment"> provided by the application, this approach was not taken.</span>
|
|
<a name="l00203"></a>00203 <span class="comment"></span>
|
|
<a name="l00204"></a>00204 <span class="comment"> \anchor stdio_note2 \par Note 2:</span>
|
|
<a name="l00205"></a>00205 <span class="comment"> This basically follows the Unix approach: if a device such as a</span>
|
|
<a name="l00206"></a>00206 <span class="comment"> terminal needs special handling, it is in the domain of the</span>
|
|
<a name="l00207"></a>00207 <span class="comment"> terminal device driver to provide this functionality. Thus, a</span>
|
|
<a name="l00208"></a>00208 <span class="comment"> simple function suitable as \c put() for \c fdevopen() that talks</span>
|
|
<a name="l00209"></a>00209 <span class="comment"> to a UART interface might look like this:</span>
|
|
<a name="l00210"></a>00210 <span class="comment"></span>
|
|
<a name="l00211"></a>00211 <span class="comment"> \code</span>
|
|
<a name="l00212"></a>00212 <span class="comment"> int</span>
|
|
<a name="l00213"></a>00213 <span class="comment"> uart_putchar(char c, FILE *stream)</span>
|
|
<a name="l00214"></a>00214 <span class="comment"> {</span>
|
|
<a name="l00215"></a>00215 <span class="comment"></span>
|
|
<a name="l00216"></a>00216 <span class="comment"> if (c == '\n')</span>
|
|
<a name="l00217"></a>00217 <span class="comment"> uart_putchar('\r');</span>
|
|
<a name="l00218"></a>00218 <span class="comment"> loop_until_bit_is_set(UCSRA, UDRE);</span>
|
|
<a name="l00219"></a>00219 <span class="comment"> UDR = c;</span>
|
|
<a name="l00220"></a>00220 <span class="comment"> return 0;</span>
|
|
<a name="l00221"></a>00221 <span class="comment"> }</span>
|
|
<a name="l00222"></a>00222 <span class="comment"> \endcode</span>
|
|
<a name="l00223"></a>00223 <span class="comment"></span>
|
|
<a name="l00224"></a>00224 <span class="comment"> \anchor stdio_note3 \par Note 3:</span>
|
|
<a name="l00225"></a>00225 <span class="comment"> This implementation has been chosen because the cost of maintaining</span>
|
|
<a name="l00226"></a>00226 <span class="comment"> an alias is considerably smaller than the cost of maintaining full</span>
|
|
<a name="l00227"></a>00227 <span class="comment"> copies of each stream. Yet, providing an implementation that offers</span>
|
|
<a name="l00228"></a>00228 <span class="comment"> the complete set of standard streams was deemed to be useful. Not</span>
|
|
<a name="l00229"></a>00229 <span class="comment"> only that writing \c printf() instead of <tt>fprintf(mystream, ...)</tt></span>
|
|
<a name="l00230"></a>00230 <span class="comment"> saves typing work, but since avr-gcc needs to resort to pass all</span>
|
|
<a name="l00231"></a>00231 <span class="comment"> arguments of variadic functions on the stack (as opposed to passing</span>
|
|
<a name="l00232"></a>00232 <span class="comment"> them in registers for functions that take a fixed number of</span>
|
|
<a name="l00233"></a>00233 <span class="comment"> parameters), the ability to pass one parameter less by implying</span>
|
|
<a name="l00234"></a>00234 <span class="comment"> \c stdin or stdout will also save some execution time.</span>
|
|
<a name="l00235"></a>00235 <span class="comment">*/</span>
|
|
<a name="l00236"></a>00236
|
|
<a name="l00237"></a>00237 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00238"></a>00238 <span class="preprocessor"></span>
|
|
<a name="l00239"></a>00239 <span class="comment">/*</span>
|
|
<a name="l00240"></a>00240 <span class="comment"> * This is an internal structure of the library that is subject to be</span>
|
|
<a name="l00241"></a>00241 <span class="comment"> * changed without warnings at any time. Please do *never* reference</span>
|
|
<a name="l00242"></a>00242 <span class="comment"> * elements of it beyond by using the official interfaces provided.</span>
|
|
<a name="l00243"></a>00243 <span class="comment"> */</span>
|
|
<a name="l00244"></a>00244 <span class="keyword">struct </span>__file {
|
|
<a name="l00245"></a>00245 <span class="keywordtype">char</span> *buf; <span class="comment">/* buffer pointer */</span>
|
|
<a name="l00246"></a>00246 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> unget; <span class="comment">/* ungetc() buffer */</span>
|
|
<a name="l00247"></a>00247 <a class="code" href="group__avr__stdint.html#gaba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> flags; <span class="comment">/* flags, see below */</span>
|
|
<a name="l00248"></a>00248 <span class="preprocessor">#define __SRD 0x0001 </span><span class="comment">/* OK to read */</span>
|
|
<a name="l00249"></a>00249 <span class="preprocessor">#define __SWR 0x0002 </span><span class="comment">/* OK to write */</span>
|
|
<a name="l00250"></a>00250 <span class="preprocessor">#define __SSTR 0x0004 </span><span class="comment">/* this is an sprintf/snprintf string */</span>
|
|
<a name="l00251"></a>00251 <span class="preprocessor">#define __SPGM 0x0008 </span><span class="comment">/* fmt string is in progmem */</span>
|
|
<a name="l00252"></a>00252 <span class="preprocessor">#define __SERR 0x0010 </span><span class="comment">/* found error */</span>
|
|
<a name="l00253"></a>00253 <span class="preprocessor">#define __SEOF 0x0020 </span><span class="comment">/* found EOF */</span>
|
|
<a name="l00254"></a>00254 <span class="preprocessor">#define __SUNGET 0x040 </span><span class="comment">/* ungetc() happened */</span>
|
|
<a name="l00255"></a>00255 <span class="preprocessor">#define __SMALLOC 0x80 </span><span class="comment">/* handle is malloc()ed */</span>
|
|
<a name="l00256"></a>00256 <span class="preprocessor">#if 0</span>
|
|
<a name="l00257"></a>00257 <span class="preprocessor"></span><span class="comment">/* possible future extensions, will require uint16_t flags */</span>
|
|
<a name="l00258"></a>00258 <span class="preprocessor">#define __SRW 0x0100 </span><span class="comment">/* open for reading & writing */</span>
|
|
<a name="l00259"></a>00259 <span class="preprocessor">#define __SLBF 0x0200 </span><span class="comment">/* line buffered */</span>
|
|
<a name="l00260"></a>00260 <span class="preprocessor">#define __SNBF 0x0400 </span><span class="comment">/* unbuffered */</span>
|
|
<a name="l00261"></a>00261 <span class="preprocessor">#define __SMBF 0x0800 </span><span class="comment">/* buf is from malloc */</span>
|
|
<a name="l00262"></a>00262 <span class="preprocessor">#endif</span>
|
|
<a name="l00263"></a>00263 <span class="preprocessor"></span> <span class="keywordtype">int</span> size; <span class="comment">/* size of buffer */</span>
|
|
<a name="l00264"></a>00264 <span class="keywordtype">int</span> len; <span class="comment">/* characters read or written so far */</span>
|
|
<a name="l00265"></a>00265 int (*put)(char, <span class="keyword">struct </span>__file *); <span class="comment">/* function to write one char to device */</span>
|
|
<a name="l00266"></a>00266 int (*<span class="keyword">get</span>)(<span class="keyword">struct </span>__file *); <span class="comment">/* function to read one char from device */</span>
|
|
<a name="l00267"></a>00267 <span class="keywordtype">void</span> *udata; <span class="comment">/* User defined and accessible data. */</span>
|
|
<a name="l00268"></a>00268 };
|
|
<a name="l00269"></a>00269
|
|
<a name="l00270"></a>00270 <span class="preprocessor">#endif </span><span class="comment">/* not __DOXYGEN__ */</span>
|
|
<a name="l00271"></a>00271 <span class="comment"></span>
|
|
<a name="l00272"></a>00272 <span class="comment">/*@{*/</span><span class="comment"></span>
|
|
<a name="l00273"></a>00273 <span class="comment">/**</span>
|
|
<a name="l00274"></a>00274 <span class="comment"> \c FILE is the opaque structure that is passed around between the</span>
|
|
<a name="l00275"></a>00275 <span class="comment"> various standard IO functions.</span>
|
|
<a name="l00276"></a>00276 <span class="comment">*/</span>
|
|
<a name="l00277"></a><a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">00277</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>__file <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a>;
|
|
<a name="l00278"></a>00278 <span class="comment"></span>
|
|
<a name="l00279"></a>00279 <span class="comment">/**</span>
|
|
<a name="l00280"></a>00280 <span class="comment"> Stream that will be used as an input stream by the simplified</span>
|
|
<a name="l00281"></a>00281 <span class="comment"> functions that don't take a \c stream argument.</span>
|
|
<a name="l00282"></a>00282 <span class="comment"></span>
|
|
<a name="l00283"></a>00283 <span class="comment"> The first stream opened with read intent using \c fdevopen()</span>
|
|
<a name="l00284"></a>00284 <span class="comment"> will be assigned to \c stdin.</span>
|
|
<a name="l00285"></a>00285 <span class="comment">*/</span>
|
|
<a name="l00286"></a><a class="code" href="group__avr__stdio.html#gaaca70138f0cb63ddb026921afc635179">00286</a> <span class="preprocessor">#define stdin (__iob[0])</span>
|
|
<a name="l00287"></a>00287 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00288"></a>00288 <span class="comment">/**</span>
|
|
<a name="l00289"></a>00289 <span class="comment"> Stream that will be used as an output stream by the simplified</span>
|
|
<a name="l00290"></a>00290 <span class="comment"> functions that don't take a \c stream argument.</span>
|
|
<a name="l00291"></a>00291 <span class="comment"></span>
|
|
<a name="l00292"></a>00292 <span class="comment"> The first stream opened with write intent using \c fdevopen()</span>
|
|
<a name="l00293"></a>00293 <span class="comment"> will be assigned to both, \c stdin, and \c stderr.</span>
|
|
<a name="l00294"></a>00294 <span class="comment">*/</span>
|
|
<a name="l00295"></a><a class="code" href="group__avr__stdio.html#ga0c0ef221f95f64e8632451312fd18cc8">00295</a> <span class="preprocessor">#define stdout (__iob[1])</span>
|
|
<a name="l00296"></a>00296 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00297"></a>00297 <span class="comment">/**</span>
|
|
<a name="l00298"></a>00298 <span class="comment"> Stream destined for error output. Unless specifically assigned,</span>
|
|
<a name="l00299"></a>00299 <span class="comment"> identical to \c stdout.</span>
|
|
<a name="l00300"></a>00300 <span class="comment"></span>
|
|
<a name="l00301"></a>00301 <span class="comment"> If \c stderr should point to another stream, the result of</span>
|
|
<a name="l00302"></a>00302 <span class="comment"> another \c fdevopen() must be explicitly assigned to it without</span>
|
|
<a name="l00303"></a>00303 <span class="comment"> closing the previous \c stderr (since this would also close</span>
|
|
<a name="l00304"></a>00304 <span class="comment"> \c stdout).</span>
|
|
<a name="l00305"></a>00305 <span class="comment">*/</span>
|
|
<a name="l00306"></a><a class="code" href="group__avr__stdio.html#ga5ce35bd5ba5021fd3b2e951e8f497656">00306</a> <span class="preprocessor">#define stderr (__iob[2])</span>
|
|
<a name="l00307"></a>00307 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00308"></a>00308 <span class="comment">/**</span>
|
|
<a name="l00309"></a>00309 <span class="comment"> \c EOF declares the value that is returned by various standard IO</span>
|
|
<a name="l00310"></a>00310 <span class="comment"> functions in case of an error. Since the AVR platform (currently)</span>
|
|
<a name="l00311"></a>00311 <span class="comment"> doesn't contain an abstraction for actual files, its origin as</span>
|
|
<a name="l00312"></a>00312 <span class="comment"> "end of file" is somewhat meaningless here.</span>
|
|
<a name="l00313"></a>00313 <span class="comment">*/</span>
|
|
<a name="l00314"></a><a class="code" href="group__avr__stdio.html#ga59adc4c82490d23754cd39c2fb99b0da">00314</a> <span class="preprocessor">#define EOF (-1)</span>
|
|
<a name="l00315"></a>00315 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00316"></a>00316 <span class="comment">/** This macro inserts a pointer to user defined data into a FILE</span>
|
|
<a name="l00317"></a>00317 <span class="comment"> stream object.</span>
|
|
<a name="l00318"></a>00318 <span class="comment"></span>
|
|
<a name="l00319"></a>00319 <span class="comment"> The user data can be useful for tracking state in the put and get</span>
|
|
<a name="l00320"></a>00320 <span class="comment"> functions supplied to the fdevopen() function. */</span>
|
|
<a name="l00321"></a><a class="code" href="group__avr__stdio.html#ga793fcb8f10b6b8746d4186012929ddf1">00321</a> <span class="preprocessor">#define fdev_set_udata(stream, u) do { (stream)->udata = u; } while(0)</span>
|
|
<a name="l00322"></a>00322 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00323"></a>00323 <span class="comment">/** This macro retrieves a pointer to user defined data from a FILE</span>
|
|
<a name="l00324"></a>00324 <span class="comment"> stream object. */</span>
|
|
<a name="l00325"></a><a class="code" href="group__avr__stdio.html#gac04f5faa8e86a4ce4ae084d85386af40">00325</a> <span class="preprocessor">#define fdev_get_udata(stream) ((stream)->udata)</span>
|
|
<a name="l00326"></a>00326 <span class="preprocessor"></span>
|
|
<a name="l00327"></a>00327 <span class="preprocessor">#if defined(__DOXYGEN__)</span>
|
|
<a name="l00328"></a>00328 <span class="preprocessor"></span><span class="comment">/**</span>
|
|
<a name="l00329"></a>00329 <span class="comment"> \brief Setup a user-supplied buffer as an stdio stream</span>
|
|
<a name="l00330"></a>00330 <span class="comment"></span>
|
|
<a name="l00331"></a>00331 <span class="comment"> This macro takes a user-supplied buffer \c stream, and sets it up</span>
|
|
<a name="l00332"></a>00332 <span class="comment"> as a stream that is valid for stdio operations, similar to one that</span>
|
|
<a name="l00333"></a>00333 <span class="comment"> has been obtained dynamically from fdevopen(). The buffer to setup</span>
|
|
<a name="l00334"></a>00334 <span class="comment"> must be of type FILE.</span>
|
|
<a name="l00335"></a>00335 <span class="comment"></span>
|
|
<a name="l00336"></a>00336 <span class="comment"> The arguments \c put and \c get are identical to those that need to</span>
|
|
<a name="l00337"></a>00337 <span class="comment"> be passed to fdevopen().</span>
|
|
<a name="l00338"></a>00338 <span class="comment"></span>
|
|
<a name="l00339"></a>00339 <span class="comment"> The \c rwflag argument can take one of the values _FDEV_SETUP_READ,</span>
|
|
<a name="l00340"></a>00340 <span class="comment"> _FDEV_SETUP_WRITE, or _FDEV_SETUP_RW, for read, write, or read/write</span>
|
|
<a name="l00341"></a>00341 <span class="comment"> intent, respectively.</span>
|
|
<a name="l00342"></a>00342 <span class="comment"></span>
|
|
<a name="l00343"></a>00343 <span class="comment"> \note No assignments to the standard streams will be performed by</span>
|
|
<a name="l00344"></a>00344 <span class="comment"> fdev_setup_stream(). If standard streams are to be used, these</span>
|
|
<a name="l00345"></a>00345 <span class="comment"> need to be assigned by the user. See also under</span>
|
|
<a name="l00346"></a>00346 <span class="comment"> \ref stdio_without_malloc "Running stdio without malloc()".</span>
|
|
<a name="l00347"></a>00347 <span class="comment"> */</span>
|
|
<a name="l00348"></a><a class="code" href="group__avr__stdio.html#gaf41f158c022cbb6203ccd87d27301226">00348</a> <span class="preprocessor">#define fdev_setup_stream(stream, put, get, rwflag)</span>
|
|
<a name="l00349"></a>00349 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* !DOXYGEN */</span>
|
|
<a name="l00350"></a>00350 <span class="preprocessor">#define fdev_setup_stream(stream, p, g, f) \</span>
|
|
<a name="l00351"></a>00351 <span class="preprocessor"> do { \</span>
|
|
<a name="l00352"></a>00352 <span class="preprocessor"> (stream)->put = p; \</span>
|
|
<a name="l00353"></a>00353 <span class="preprocessor"> (stream)->get = g; \</span>
|
|
<a name="l00354"></a>00354 <span class="preprocessor"> (stream)->flags = f; \</span>
|
|
<a name="l00355"></a>00355 <span class="preprocessor"> (stream)->udata = 0; \</span>
|
|
<a name="l00356"></a>00356 <span class="preprocessor"> } while(0)</span>
|
|
<a name="l00357"></a>00357 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DOXYGEN */</span>
|
|
<a name="l00358"></a>00358
|
|
<a name="l00359"></a><a class="code" href="group__avr__stdio.html#ga79826a1c733e4f67843256d34ad64352">00359</a> <span class="preprocessor">#define _FDEV_SETUP_READ __SRD </span><span class="comment">/**< fdev_setup_stream() with read intent */</span>
|
|
<a name="l00360"></a><a class="code" href="group__avr__stdio.html#ga822a791a1c06a12b95c14ace75b48ad2">00360</a> <span class="preprocessor">#define _FDEV_SETUP_WRITE __SWR </span><span class="comment">/**< fdev_setup_stream() with write intent */</span>
|
|
<a name="l00361"></a><a class="code" href="group__avr__stdio.html#ga93db55caeeaf13488a635f8896a6bdf3">00361</a> <span class="preprocessor">#define _FDEV_SETUP_RW (__SRD|__SWR) </span><span class="comment">/**< fdev_setup_stream() with read/write intent */</span>
|
|
<a name="l00362"></a>00362 <span class="comment"></span>
|
|
<a name="l00363"></a>00363 <span class="comment">/**</span>
|
|
<a name="l00364"></a>00364 <span class="comment"> * Return code for an error condition during device read.</span>
|
|
<a name="l00365"></a>00365 <span class="comment"> *</span>
|
|
<a name="l00366"></a>00366 <span class="comment"> * To be used in the get function of fdevopen().</span>
|
|
<a name="l00367"></a>00367 <span class="comment"> */</span>
|
|
<a name="l00368"></a><a class="code" href="group__avr__stdio.html#ga132917c782a0ba854c3ae9abe57c3b12">00368</a> <span class="preprocessor">#define _FDEV_ERR (-1)</span>
|
|
<a name="l00369"></a>00369 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00370"></a>00370 <span class="comment">/**</span>
|
|
<a name="l00371"></a>00371 <span class="comment"> * Return code for an end-of-file condition during device read.</span>
|
|
<a name="l00372"></a>00372 <span class="comment"> *</span>
|
|
<a name="l00373"></a>00373 <span class="comment"> * To be used in the get function of fdevopen().</span>
|
|
<a name="l00374"></a>00374 <span class="comment"> */</span>
|
|
<a name="l00375"></a><a class="code" href="group__avr__stdio.html#ga280c47b9edff2751b8dbb9a715dc44c5">00375</a> <span class="preprocessor">#define _FDEV_EOF (-2)</span>
|
|
<a name="l00376"></a>00376 <span class="preprocessor"></span>
|
|
<a name="l00377"></a>00377 <span class="preprocessor">#if defined(__DOXYGEN__)</span>
|
|
<a name="l00378"></a>00378 <span class="preprocessor"></span><span class="comment">/**</span>
|
|
<a name="l00379"></a>00379 <span class="comment"> \brief Initializer for a user-supplied stdio stream</span>
|
|
<a name="l00380"></a>00380 <span class="comment"></span>
|
|
<a name="l00381"></a>00381 <span class="comment"> This macro acts similar to fdev_setup_stream(), but it is to be</span>
|
|
<a name="l00382"></a>00382 <span class="comment"> used as the initializer of a variable of type FILE.</span>
|
|
<a name="l00383"></a>00383 <span class="comment"></span>
|
|
<a name="l00384"></a>00384 <span class="comment"> The remaining arguments are to be used as explained in</span>
|
|
<a name="l00385"></a>00385 <span class="comment"> fdev_setup_stream().</span>
|
|
<a name="l00386"></a>00386 <span class="comment"> */</span>
|
|
<a name="l00387"></a><a class="code" href="group__avr__stdio.html#gaea2b6be92ead4673bc487b271b7227fb">00387</a> <span class="preprocessor">#define FDEV_SETUP_STREAM(put, get, rwflag)</span>
|
|
<a name="l00388"></a>00388 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* !DOXYGEN */</span>
|
|
<a name="l00389"></a>00389 <span class="preprocessor">#define FDEV_SETUP_STREAM(p, g, f) \</span>
|
|
<a name="l00390"></a>00390 <span class="preprocessor"> { \</span>
|
|
<a name="l00391"></a>00391 <span class="preprocessor"> .put = p, \</span>
|
|
<a name="l00392"></a>00392 <span class="preprocessor"> .get = g, \</span>
|
|
<a name="l00393"></a>00393 <span class="preprocessor"> .flags = f, \</span>
|
|
<a name="l00394"></a>00394 <span class="preprocessor"> .udata = 0, \</span>
|
|
<a name="l00395"></a>00395 <span class="preprocessor"> }</span>
|
|
<a name="l00396"></a>00396 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DOXYGEN */</span>
|
|
<a name="l00397"></a>00397
|
|
<a name="l00398"></a>00398 <span class="preprocessor">#ifdef __cplusplus</span>
|
|
<a name="l00399"></a>00399 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
|
|
<a name="l00400"></a>00400 <span class="preprocessor">#endif</span>
|
|
<a name="l00401"></a>00401 <span class="preprocessor"></span>
|
|
<a name="l00402"></a>00402 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00403"></a>00403 <span class="preprocessor"></span><span class="comment">/*</span>
|
|
<a name="l00404"></a>00404 <span class="comment"> * Doxygen documentation can be found in fdevopen.c.</span>
|
|
<a name="l00405"></a>00405 <span class="comment"> */</span>
|
|
<a name="l00406"></a>00406
|
|
<a name="l00407"></a>00407 <span class="keyword">extern</span> <span class="keyword">struct </span>__file *__iob[];
|
|
<a name="l00408"></a>00408
|
|
<a name="l00409"></a>00409 <span class="preprocessor">#if defined(__STDIO_FDEVOPEN_COMPAT_12)</span>
|
|
<a name="l00410"></a>00410 <span class="preprocessor"></span><span class="comment">/*</span>
|
|
<a name="l00411"></a>00411 <span class="comment"> * Declare prototype for the discontinued version of fdevopen() that</span>
|
|
<a name="l00412"></a>00412 <span class="comment"> * has been in use up to avr-libc 1.2.x. The new implementation has</span>
|
|
<a name="l00413"></a>00413 <span class="comment"> * some backwards compatibility with the old version.</span>
|
|
<a name="l00414"></a>00414 <span class="comment"> */</span>
|
|
<a name="l00415"></a>00415 <span class="keyword">extern</span> <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *<a class="code" href="group__avr__stdio.html#gab599ddf60819df4cc993c724a83cb1a4">fdevopen</a>(<span class="keywordtype">int</span> (*__put)(<span class="keywordtype">char</span>), <span class="keywordtype">int</span> (*__get)(<span class="keywordtype">void</span>),
|
|
<a name="l00416"></a>00416 <span class="keywordtype">int</span> __opts <a class="code" href="group__avr__watchdog.html#gadaa6dd28b5d08df35e49b1248d7e5fb0">__attribute__</a>((unused)));
|
|
<a name="l00417"></a>00417 <span class="preprocessor">#else </span><span class="comment">/* !defined(__STDIO_FDEVOPEN_COMPAT_12) */</span>
|
|
<a name="l00418"></a>00418 <span class="comment">/* New prototype for avr-libc 1.4 and above. */</span>
|
|
<a name="l00419"></a>00419 <span class="keyword">extern</span> <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *<a class="code" href="group__avr__stdio.html#gab599ddf60819df4cc993c724a83cb1a4">fdevopen</a>(<span class="keywordtype">int</span> (*__put)(<span class="keywordtype">char</span>, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a>*), <span class="keywordtype">int</span> (*__get)(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a>*));
|
|
<a name="l00420"></a>00420 <span class="preprocessor">#endif </span><span class="comment">/* defined(__STDIO_FDEVOPEN_COMPAT_12) */</span>
|
|
<a name="l00421"></a>00421
|
|
<a name="l00422"></a>00422 <span class="preprocessor">#endif </span><span class="comment">/* not __DOXYGEN__ */</span>
|
|
<a name="l00423"></a>00423 <span class="comment"></span>
|
|
<a name="l00424"></a>00424 <span class="comment">/**</span>
|
|
<a name="l00425"></a>00425 <span class="comment"> This function closes \c stream, and disallows and further</span>
|
|
<a name="l00426"></a>00426 <span class="comment"> IO to and from it.</span>
|
|
<a name="l00427"></a>00427 <span class="comment"></span>
|
|
<a name="l00428"></a>00428 <span class="comment"> When using fdevopen() to setup the stream, a call to fclose() is</span>
|
|
<a name="l00429"></a>00429 <span class="comment"> needed in order to free the internal resources allocated.</span>
|
|
<a name="l00430"></a>00430 <span class="comment"></span>
|
|
<a name="l00431"></a>00431 <span class="comment"> If the stream has been set up using fdev_setup_stream() or</span>
|
|
<a name="l00432"></a>00432 <span class="comment"> FDEV_SETUP_STREAM(), use fdev_close() instead.</span>
|
|
<a name="l00433"></a>00433 <span class="comment"></span>
|
|
<a name="l00434"></a>00434 <span class="comment"> It currently always returns 0 (for success).</span>
|
|
<a name="l00435"></a>00435 <span class="comment">*/</span>
|
|
<a name="l00436"></a>00436 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gad3d27a6dcc225237171196dd0739bb10">fclose</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00437"></a>00437 <span class="comment"></span>
|
|
<a name="l00438"></a>00438 <span class="comment">/**</span>
|
|
<a name="l00439"></a>00439 <span class="comment"> This macro frees up any library resources that might be associated</span>
|
|
<a name="l00440"></a>00440 <span class="comment"> with \c stream. It should be called if \c stream is no longer</span>
|
|
<a name="l00441"></a>00441 <span class="comment"> needed, right before the application is going to destroy the</span>
|
|
<a name="l00442"></a>00442 <span class="comment"> \c stream object itself.</span>
|
|
<a name="l00443"></a>00443 <span class="comment"></span>
|
|
<a name="l00444"></a>00444 <span class="comment"> (Currently, this macro evaluates to nothing, but this might change</span>
|
|
<a name="l00445"></a>00445 <span class="comment"> in future versions of the library.)</span>
|
|
<a name="l00446"></a>00446 <span class="comment">*/</span>
|
|
<a name="l00447"></a>00447 <span class="preprocessor">#if defined(__DOXYGEN__)</span>
|
|
<a name="l00448"></a><a class="code" href="group__avr__stdio.html#gaa1226b8f734a1b5148d931ae2908c45d">00448</a> <span class="preprocessor"></span><span class="preprocessor"># define fdev_close()</span>
|
|
<a name="l00449"></a>00449 <span class="preprocessor"></span><span class="preprocessor">#else</span>
|
|
<a name="l00450"></a>00450 <span class="preprocessor"></span><span class="preprocessor"># define fdev_close() ((void)0)</span>
|
|
<a name="l00451"></a>00451 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
|
|
<a name="l00452"></a>00452 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00453"></a>00453 <span class="comment">/**</span>
|
|
<a name="l00454"></a>00454 <span class="comment"> \c vfprintf is the central facility of the \c printf family of</span>
|
|
<a name="l00455"></a>00455 <span class="comment"> functions. It outputs values to \c stream under control of a</span>
|
|
<a name="l00456"></a>00456 <span class="comment"> format string passed in \c fmt. The actual values to print are</span>
|
|
<a name="l00457"></a>00457 <span class="comment"> passed as a variable argument list \c ap.</span>
|
|
<a name="l00458"></a>00458 <span class="comment"></span>
|
|
<a name="l00459"></a>00459 <span class="comment"> \c vfprintf returns the number of characters written to \c stream,</span>
|
|
<a name="l00460"></a>00460 <span class="comment"> or \c EOF in case of an error. Currently, this will only happen</span>
|
|
<a name="l00461"></a>00461 <span class="comment"> if \c stream has not been opened with write intent.</span>
|
|
<a name="l00462"></a>00462 <span class="comment"></span>
|
|
<a name="l00463"></a>00463 <span class="comment"> The format string is composed of zero or more directives: ordinary</span>
|
|
<a name="l00464"></a>00464 <span class="comment"> characters (not \c %), which are copied unchanged to the output</span>
|
|
<a name="l00465"></a>00465 <span class="comment"> stream; and conversion specifications, each of which results in</span>
|
|
<a name="l00466"></a>00466 <span class="comment"> fetching zero or more subsequent arguments. Each conversion</span>
|
|
<a name="l00467"></a>00467 <span class="comment"> specification is introduced by the \c % character. The arguments must</span>
|
|
<a name="l00468"></a>00468 <span class="comment"> properly correspond (after type promotion) with the conversion</span>
|
|
<a name="l00469"></a>00469 <span class="comment"> specifier. After the \c %, the following appear in sequence:</span>
|
|
<a name="l00470"></a>00470 <span class="comment"></span>
|
|
<a name="l00471"></a>00471 <span class="comment"> - Zero or more of the following flags:</span>
|
|
<a name="l00472"></a>00472 <span class="comment"> <ul></span>
|
|
<a name="l00473"></a>00473 <span class="comment"> <li> \c # The value should be converted to an "alternate form". For</span>
|
|
<a name="l00474"></a>00474 <span class="comment"> c, d, i, s, and u conversions, this option has no effect.</span>
|
|
<a name="l00475"></a>00475 <span class="comment"> For o conversions, the precision of the number is</span>
|
|
<a name="l00476"></a>00476 <span class="comment"> increased to force the first character of the output</span>
|
|
<a name="l00477"></a>00477 <span class="comment"> string to a zero (except if a zero value is printed with</span>
|
|
<a name="l00478"></a>00478 <span class="comment"> an explicit precision of zero). For x and X conversions,</span>
|
|
<a name="l00479"></a>00479 <span class="comment"> a non-zero result has the string `0x' (or `0X' for X</span>
|
|
<a name="l00480"></a>00480 <span class="comment"> conversions) prepended to it.</li></span>
|
|
<a name="l00481"></a>00481 <span class="comment"> <li> \c 0 (zero) Zero padding. For all conversions, the converted</span>
|
|
<a name="l00482"></a>00482 <span class="comment"> value is padded on the left with zeros rather than blanks.</span>
|
|
<a name="l00483"></a>00483 <span class="comment"> If a precision is given with a numeric conversion (d, i,</span>
|
|
<a name="l00484"></a>00484 <span class="comment"> o, u, i, x, and X), the 0 flag is ignored.</li></span>
|
|
<a name="l00485"></a>00485 <span class="comment"> <li> \c - A negative field width flag; the converted value is to be</span>
|
|
<a name="l00486"></a>00486 <span class="comment"> left adjusted on the field boundary. The converted value</span>
|
|
<a name="l00487"></a>00487 <span class="comment"> is padded on the right with blanks, rather than on the</span>
|
|
<a name="l00488"></a>00488 <span class="comment"> left with blanks or zeros. A - overrides a 0 if both are</span>
|
|
<a name="l00489"></a>00489 <span class="comment"> given.</li></span>
|
|
<a name="l00490"></a>00490 <span class="comment"> <li> ' ' (space) A blank should be left before a positive number</span>
|
|
<a name="l00491"></a>00491 <span class="comment"> produced by a signed conversion (d, or i).</li></span>
|
|
<a name="l00492"></a>00492 <span class="comment"> <li> \c + A sign must always be placed before a number produced by a</span>
|
|
<a name="l00493"></a>00493 <span class="comment"> signed conversion. A + overrides a space if both are</span>
|
|
<a name="l00494"></a>00494 <span class="comment"> used.</li></span>
|
|
<a name="l00495"></a>00495 <span class="comment"> </ul></span>
|
|
<a name="l00496"></a>00496 <span class="comment"> </span>
|
|
<a name="l00497"></a>00497 <span class="comment"> - An optional decimal digit string specifying a minimum field width.</span>
|
|
<a name="l00498"></a>00498 <span class="comment"> If the converted value has fewer characters than the field width, it</span>
|
|
<a name="l00499"></a>00499 <span class="comment"> will be padded with spaces on the left (or right, if the left-adjustment</span>
|
|
<a name="l00500"></a>00500 <span class="comment"> flag has been given) to fill out the field width.</span>
|
|
<a name="l00501"></a>00501 <span class="comment"> - An optional precision, in the form of a period . followed by an</span>
|
|
<a name="l00502"></a>00502 <span class="comment"> optional digit string. If the digit string is omitted, the</span>
|
|
<a name="l00503"></a>00503 <span class="comment"> precision is taken as zero. This gives the minimum number of</span>
|
|
<a name="l00504"></a>00504 <span class="comment"> digits to appear for d, i, o, u, x, and X conversions, or the</span>
|
|
<a name="l00505"></a>00505 <span class="comment"> maximum number of characters to be printed from a string for \c s</span>
|
|
<a name="l00506"></a>00506 <span class="comment"> conversions.</span>
|
|
<a name="l00507"></a>00507 <span class="comment"> - An optional \c l or \c h length modifier, that specifies that the</span>
|
|
<a name="l00508"></a>00508 <span class="comment"> argument for the d, i, o, u, x, or X conversion is a \c "long int"</span>
|
|
<a name="l00509"></a>00509 <span class="comment"> rather than \c int. The \c h is ignored, as \c "short int" is</span>
|
|
<a name="l00510"></a>00510 <span class="comment"> equivalent to \c int.</span>
|
|
<a name="l00511"></a>00511 <span class="comment"> - A character that specifies the type of conversion to be applied.</span>
|
|
<a name="l00512"></a>00512 <span class="comment"></span>
|
|
<a name="l00513"></a>00513 <span class="comment"> The conversion specifiers and their meanings are:</span>
|
|
<a name="l00514"></a>00514 <span class="comment"></span>
|
|
<a name="l00515"></a>00515 <span class="comment"> - \c diouxX The int (or appropriate variant) argument is converted</span>
|
|
<a name="l00516"></a>00516 <span class="comment"> to signed decimal (d and i), unsigned octal (o), unsigned</span>
|
|
<a name="l00517"></a>00517 <span class="comment"> decimal (u), or unsigned hexadecimal (x and X) notation.</span>
|
|
<a name="l00518"></a>00518 <span class="comment"> The letters "abcdef" are used for x conversions; the</span>
|
|
<a name="l00519"></a>00519 <span class="comment"> letters "ABCDEF" are used for X conversions. The</span>
|
|
<a name="l00520"></a>00520 <span class="comment"> precision, if any, gives the minimum number of digits that</span>
|
|
<a name="l00521"></a>00521 <span class="comment"> must appear; if the converted value requires fewer digits,</span>
|
|
<a name="l00522"></a>00522 <span class="comment"> it is padded on the left with zeros.</span>
|
|
<a name="l00523"></a>00523 <span class="comment"> - \c p The <tt>void *</tt> argument is taken as an unsigned integer,</span>
|
|
<a name="l00524"></a>00524 <span class="comment"> and converted similarly as a <tt>%\#x</tt> command would do.</span>
|
|
<a name="l00525"></a>00525 <span class="comment"> - \c c The \c int argument is converted to an \c "unsigned char", and the</span>
|
|
<a name="l00526"></a>00526 <span class="comment"> resulting character is written.</span>
|
|
<a name="l00527"></a>00527 <span class="comment"> - \c s The \c "char *" argument is expected to be a pointer to an array</span>
|
|
<a name="l00528"></a>00528 <span class="comment"> of character type (pointer to a string). Characters from</span>
|
|
<a name="l00529"></a>00529 <span class="comment"> the array are written up to (but not including) a</span>
|
|
<a name="l00530"></a>00530 <span class="comment"> terminating NUL character; if a precision is specified, no</span>
|
|
<a name="l00531"></a>00531 <span class="comment"> more than the number specified are written. If a precision</span>
|
|
<a name="l00532"></a>00532 <span class="comment"> is given, no null character need be present; if the</span>
|
|
<a name="l00533"></a>00533 <span class="comment"> precision is not specified, or is greater than the size of</span>
|
|
<a name="l00534"></a>00534 <span class="comment"> the array, the array must contain a terminating NUL</span>
|
|
<a name="l00535"></a>00535 <span class="comment"> character.</span>
|
|
<a name="l00536"></a>00536 <span class="comment"> - \c % A \c % is written. No argument is converted. The complete</span>
|
|
<a name="l00537"></a>00537 <span class="comment"> conversion specification is "%%".</span>
|
|
<a name="l00538"></a>00538 <span class="comment"> - \c eE The double argument is rounded and converted in the format</span>
|
|
<a name="l00539"></a>00539 <span class="comment"> \c "[-]d.ddde±dd" where there is one digit before the</span>
|
|
<a name="l00540"></a>00540 <span class="comment"> decimal-point character and the number of digits after it</span>
|
|
<a name="l00541"></a>00541 <span class="comment"> is equal to the precision; if the precision is missing, it</span>
|
|
<a name="l00542"></a>00542 <span class="comment"> is taken as 6; if the precision is zero, no decimal-point</span>
|
|
<a name="l00543"></a>00543 <span class="comment"> character appears. An \e E conversion uses the letter \c 'E'</span>
|
|
<a name="l00544"></a>00544 <span class="comment"> (rather than \c 'e') to introduce the exponent. The exponent</span>
|
|
<a name="l00545"></a>00545 <span class="comment"> always contains two digits; if the value is zero,</span>
|
|
<a name="l00546"></a>00546 <span class="comment"> the exponent is 00.</span>
|
|
<a name="l00547"></a>00547 <span class="comment"> - \c fF The double argument is rounded and converted to decimal notation</span>
|
|
<a name="l00548"></a>00548 <span class="comment"> in the format \c "[-]ddd.ddd", where the number of digits after the</span>
|
|
<a name="l00549"></a>00549 <span class="comment"> decimal-point character is equal to the precision specification.</span>
|
|
<a name="l00550"></a>00550 <span class="comment"> If the precision is missing, it is taken as 6; if the precision</span>
|
|
<a name="l00551"></a>00551 <span class="comment"> is explicitly zero, no decimal-point character appears. If a</span>
|
|
<a name="l00552"></a>00552 <span class="comment"> decimal point appears, at least one digit appears before it.</span>
|
|
<a name="l00553"></a>00553 <span class="comment"> - \c gG The double argument is converted in style \c f or \c e (or</span>
|
|
<a name="l00554"></a>00554 <span class="comment"> \c F or \c E for \c G conversions). The precision</span>
|
|
<a name="l00555"></a>00555 <span class="comment"> specifies the number of significant digits. If the</span>
|
|
<a name="l00556"></a>00556 <span class="comment"> precision is missing, 6 digits are given; if the precision</span>
|
|
<a name="l00557"></a>00557 <span class="comment"> is zero, it is treated as 1. Style \c e is used if the</span>
|
|
<a name="l00558"></a>00558 <span class="comment"> exponent from its conversion is less than -4 or greater</span>
|
|
<a name="l00559"></a>00559 <span class="comment"> than or equal to the precision. Trailing zeros are removed</span>
|
|
<a name="l00560"></a>00560 <span class="comment"> from the fractional part of the result; a decimal point</span>
|
|
<a name="l00561"></a>00561 <span class="comment"> appears only if it is followed by at least one digit.</span>
|
|
<a name="l00562"></a>00562 <span class="comment"> - \c S Similar to the \c s format, except the pointer is expected to</span>
|
|
<a name="l00563"></a>00563 <span class="comment"> point to a program-memory (ROM) string instead of a RAM string.</span>
|
|
<a name="l00564"></a>00564 <span class="comment"></span>
|
|
<a name="l00565"></a>00565 <span class="comment"> In no case does a non-existent or small field width cause truncation of a</span>
|
|
<a name="l00566"></a>00566 <span class="comment"> numeric field; if the result of a conversion is wider than the field</span>
|
|
<a name="l00567"></a>00567 <span class="comment"> width, the field is expanded to contain the conversion result.</span>
|
|
<a name="l00568"></a>00568 <span class="comment"></span>
|
|
<a name="l00569"></a>00569 <span class="comment"> Since the full implementation of all the mentioned features becomes</span>
|
|
<a name="l00570"></a>00570 <span class="comment"> fairly large, three different flavours of vfprintf() can be</span>
|
|
<a name="l00571"></a>00571 <span class="comment"> selected using linker options. The default vfprintf() implements</span>
|
|
<a name="l00572"></a>00572 <span class="comment"> all the mentioned functionality except floating point conversions.</span>
|
|
<a name="l00573"></a>00573 <span class="comment"> A minimized version of vfprintf() is available that only implements</span>
|
|
<a name="l00574"></a>00574 <span class="comment"> the very basic integer and string conversion facilities, but only</span>
|
|
<a name="l00575"></a>00575 <span class="comment"> the \c # additional option can be specified using conversion</span>
|
|
<a name="l00576"></a>00576 <span class="comment"> flags (these flags are parsed correctly from the format</span>
|
|
<a name="l00577"></a>00577 <span class="comment"> specification, but then simply ignored). This version can be</span>
|
|
<a name="l00578"></a>00578 <span class="comment"> requested using the following \ref gcc_minusW "compiler options":</span>
|
|
<a name="l00579"></a>00579 <span class="comment"></span>
|
|
<a name="l00580"></a>00580 <span class="comment"> \code</span>
|
|
<a name="l00581"></a>00581 <span class="comment"> -Wl,-u,vfprintf -lprintf_min</span>
|
|
<a name="l00582"></a>00582 <span class="comment"> \endcode</span>
|
|
<a name="l00583"></a>00583 <span class="comment"></span>
|
|
<a name="l00584"></a>00584 <span class="comment"> If the full functionality including the floating point conversions</span>
|
|
<a name="l00585"></a>00585 <span class="comment"> is required, the following options should be used:</span>
|
|
<a name="l00586"></a>00586 <span class="comment"></span>
|
|
<a name="l00587"></a>00587 <span class="comment"> \code</span>
|
|
<a name="l00588"></a>00588 <span class="comment"> -Wl,-u,vfprintf -lprintf_flt -lm</span>
|
|
<a name="l00589"></a>00589 <span class="comment"> \endcode</span>
|
|
<a name="l00590"></a>00590 <span class="comment"></span>
|
|
<a name="l00591"></a>00591 <span class="comment"> \par Limitations:</span>
|
|
<a name="l00592"></a>00592 <span class="comment"> - The specified width and precision can be at most 255.</span>
|
|
<a name="l00593"></a>00593 <span class="comment"></span>
|
|
<a name="l00594"></a>00594 <span class="comment"> \par Notes:</span>
|
|
<a name="l00595"></a>00595 <span class="comment"> - For floating-point conversions, if you link default or minimized</span>
|
|
<a name="l00596"></a>00596 <span class="comment"> version of vfprintf(), the symbol \c ? will be output and double</span>
|
|
<a name="l00597"></a>00597 <span class="comment"> argument will be skiped. So you output below will not be crashed.</span>
|
|
<a name="l00598"></a>00598 <span class="comment"> For default version the width field and the "pad to left" ( symbol</span>
|
|
<a name="l00599"></a>00599 <span class="comment"> minus ) option will work in this case.</span>
|
|
<a name="l00600"></a>00600 <span class="comment"> - The \c hh length modifier is ignored (\c char argument is</span>
|
|
<a name="l00601"></a>00601 <span class="comment"> promouted to \c int). More exactly, this realization does not check</span>
|
|
<a name="l00602"></a>00602 <span class="comment"> the number of \c h symbols.</span>
|
|
<a name="l00603"></a>00603 <span class="comment"> - But the \c ll length modifier will to abort the output, as this</span>
|
|
<a name="l00604"></a>00604 <span class="comment"> realization does not operate \c long \c long arguments.</span>
|
|
<a name="l00605"></a>00605 <span class="comment"> - The variable width or precision field (an asterisk \c * symbol)</span>
|
|
<a name="l00606"></a>00606 <span class="comment"> is not realized and will to abort the output.</span>
|
|
<a name="l00607"></a>00607 <span class="comment"></span>
|
|
<a name="l00608"></a>00608 <span class="comment"> */</span>
|
|
<a name="l00609"></a>00609
|
|
<a name="l00610"></a>00610 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gaa3b98c0d17b35642c0f3e4649092b9f1">vfprintf</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list __ap);
|
|
<a name="l00611"></a>00611 <span class="comment"></span>
|
|
<a name="l00612"></a>00612 <span class="comment">/**</span>
|
|
<a name="l00613"></a>00613 <span class="comment"> Variant of \c vfprintf() that uses a \c fmt string that resides</span>
|
|
<a name="l00614"></a>00614 <span class="comment"> in program memory.</span>
|
|
<a name="l00615"></a>00615 <span class="comment">*/</span>
|
|
<a name="l00616"></a>00616 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga55b25ecbfd3811ea4495d1f235e2e186">vfprintf_P</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list __ap);
|
|
<a name="l00617"></a>00617 <span class="comment"></span>
|
|
<a name="l00618"></a>00618 <span class="comment">/**</span>
|
|
<a name="l00619"></a>00619 <span class="comment"> The function \c fputc sends the character \c c (though given as type</span>
|
|
<a name="l00620"></a>00620 <span class="comment"> \c int) to \c stream. It returns the character, or \c EOF in case</span>
|
|
<a name="l00621"></a>00621 <span class="comment"> an error occurred.</span>
|
|
<a name="l00622"></a>00622 <span class="comment">*/</span>
|
|
<a name="l00623"></a>00623 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gaf3387285b3eb0ce4e0e7ca3ccaed9014">fputc</a>(<span class="keywordtype">int</span> __c, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00624"></a>00624
|
|
<a name="l00625"></a>00625 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00626"></a>00626 <span class="preprocessor"></span>
|
|
<a name="l00627"></a>00627 <span class="comment">/* putc() function implementation, required by standard */</span>
|
|
<a name="l00628"></a>00628 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga247111653f3e91bf2cb4930d590d8201">putc</a>(<span class="keywordtype">int</span> __c, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00629"></a>00629
|
|
<a name="l00630"></a>00630 <span class="comment">/* putchar() function implementation, required by standard */</span>
|
|
<a name="l00631"></a>00631 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga61e2590ae5f2f2e351365640d2ac755a">putchar</a>(<span class="keywordtype">int</span> __c);
|
|
<a name="l00632"></a>00632
|
|
<a name="l00633"></a>00633 <span class="preprocessor">#endif </span><span class="comment">/* not __DOXYGEN__ */</span>
|
|
<a name="l00634"></a>00634 <span class="comment"></span>
|
|
<a name="l00635"></a>00635 <span class="comment">/**</span>
|
|
<a name="l00636"></a>00636 <span class="comment"> The macro \c putc used to be a "fast" macro implementation with a</span>
|
|
<a name="l00637"></a>00637 <span class="comment"> functionality identical to fputc(). For space constraints, in</span>
|
|
<a name="l00638"></a>00638 <span class="comment"> \c avr-libc, it is just an alias for \c fputc.</span>
|
|
<a name="l00639"></a>00639 <span class="comment">*/</span>
|
|
<a name="l00640"></a><a class="code" href="group__avr__stdio.html#ga247111653f3e91bf2cb4930d590d8201">00640</a> <span class="preprocessor">#define putc(__c, __stream) fputc(__c, __stream)</span>
|
|
<a name="l00641"></a>00641 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00642"></a>00642 <span class="comment">/**</span>
|
|
<a name="l00643"></a>00643 <span class="comment"> The macro \c putchar sends character \c c to \c stdout.</span>
|
|
<a name="l00644"></a>00644 <span class="comment">*/</span>
|
|
<a name="l00645"></a><a class="code" href="group__avr__stdio.html#ga61e2590ae5f2f2e351365640d2ac755a">00645</a> <span class="preprocessor">#define putchar(__c) fputc(__c, stdout)</span>
|
|
<a name="l00646"></a>00646 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00647"></a>00647 <span class="comment">/**</span>
|
|
<a name="l00648"></a>00648 <span class="comment"> The function \c printf performs formatted output to stream</span>
|
|
<a name="l00649"></a>00649 <span class="comment"> \c stdout. See \c vfprintf() for details.</span>
|
|
<a name="l00650"></a>00650 <span class="comment">*/</span>
|
|
<a name="l00651"></a>00651 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga4c04da4953607fa5fa4d3908fecde449">printf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00652"></a>00652 <span class="comment"></span>
|
|
<a name="l00653"></a>00653 <span class="comment">/**</span>
|
|
<a name="l00654"></a>00654 <span class="comment"> Variant of \c printf() that uses a \c fmt string that resides</span>
|
|
<a name="l00655"></a>00655 <span class="comment"> in program memory.</span>
|
|
<a name="l00656"></a>00656 <span class="comment">*/</span>
|
|
<a name="l00657"></a>00657 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga418e63921ed6259e873cd21b6c5c8e6e">printf_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00658"></a>00658 <span class="comment"></span>
|
|
<a name="l00659"></a>00659 <span class="comment">/**</span>
|
|
<a name="l00660"></a>00660 <span class="comment"> The function \c vprintf performs formatted output to stream</span>
|
|
<a name="l00661"></a>00661 <span class="comment"> \c stdout, taking a variable argument list as in vfprintf().</span>
|
|
<a name="l00662"></a>00662 <span class="comment"></span>
|
|
<a name="l00663"></a>00663 <span class="comment"> See vfprintf() for details.</span>
|
|
<a name="l00664"></a>00664 <span class="comment">*/</span>
|
|
<a name="l00665"></a>00665 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga0b15be24dd9db93355e1f62937fdfd9a">vprintf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list __ap);
|
|
<a name="l00666"></a>00666 <span class="comment"></span>
|
|
<a name="l00667"></a>00667 <span class="comment">/**</span>
|
|
<a name="l00668"></a>00668 <span class="comment"> Variant of \c printf() that sends the formatted characters</span>
|
|
<a name="l00669"></a>00669 <span class="comment"> to string \c s.</span>
|
|
<a name="l00670"></a>00670 <span class="comment">*/</span>
|
|
<a name="l00671"></a>00671 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga6017094d9fd800fa02600d35399f2a2a">sprintf</a>(<span class="keywordtype">char</span> *__s, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00672"></a>00672 <span class="comment"></span>
|
|
<a name="l00673"></a>00673 <span class="comment">/**</span>
|
|
<a name="l00674"></a>00674 <span class="comment"> Variant of \c sprintf() that uses a \c fmt string that resides</span>
|
|
<a name="l00675"></a>00675 <span class="comment"> in program memory.</span>
|
|
<a name="l00676"></a>00676 <span class="comment">*/</span>
|
|
<a name="l00677"></a>00677 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga2b829d696b17dedbf181cd5dc4d7a31d">sprintf_P</a>(<span class="keywordtype">char</span> *__s, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00678"></a>00678 <span class="comment"></span>
|
|
<a name="l00679"></a>00679 <span class="comment">/**</span>
|
|
<a name="l00680"></a>00680 <span class="comment"> Like \c sprintf(), but instead of assuming \c s to be of infinite</span>
|
|
<a name="l00681"></a>00681 <span class="comment"> size, no more than \c n characters (including the trailing NUL</span>
|
|
<a name="l00682"></a>00682 <span class="comment"> character) will be converted to \c s.</span>
|
|
<a name="l00683"></a>00683 <span class="comment"></span>
|
|
<a name="l00684"></a>00684 <span class="comment"> Returns the number of characters that would have been written to</span>
|
|
<a name="l00685"></a>00685 <span class="comment"> \c s if there were enough space.</span>
|
|
<a name="l00686"></a>00686 <span class="comment">*/</span>
|
|
<a name="l00687"></a>00687 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga77070c245d4ca4f7ec7d7144260fb875">snprintf</a>(<span class="keywordtype">char</span> *__s, <span class="keywordtype">size_t</span> __n, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00688"></a>00688 <span class="comment"></span>
|
|
<a name="l00689"></a>00689 <span class="comment">/**</span>
|
|
<a name="l00690"></a>00690 <span class="comment"> Variant of \c snprintf() that uses a \c fmt string that resides</span>
|
|
<a name="l00691"></a>00691 <span class="comment"> in program memory.</span>
|
|
<a name="l00692"></a>00692 <span class="comment">*/</span>
|
|
<a name="l00693"></a>00693 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga53ff61856759709eeceae10aaa10a0a3">snprintf_P</a>(<span class="keywordtype">char</span> *__s, <span class="keywordtype">size_t</span> __n, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00694"></a>00694 <span class="comment"></span>
|
|
<a name="l00695"></a>00695 <span class="comment">/**</span>
|
|
<a name="l00696"></a>00696 <span class="comment"> Like \c sprintf() but takes a variable argument list for the</span>
|
|
<a name="l00697"></a>00697 <span class="comment"> arguments.</span>
|
|
<a name="l00698"></a>00698 <span class="comment">*/</span>
|
|
<a name="l00699"></a>00699 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gaaeb1bbe21a1b9b50b207ab059a67993f">vsprintf</a>(<span class="keywordtype">char</span> *__s, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list ap);
|
|
<a name="l00700"></a>00700 <span class="comment"></span>
|
|
<a name="l00701"></a>00701 <span class="comment">/**</span>
|
|
<a name="l00702"></a>00702 <span class="comment"> Variant of \c vsprintf() that uses a \c fmt string that resides</span>
|
|
<a name="l00703"></a>00703 <span class="comment"> in program memory.</span>
|
|
<a name="l00704"></a>00704 <span class="comment">*/</span>
|
|
<a name="l00705"></a>00705 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gaf47f5141509d1e434f9da2b27287a707">vsprintf_P</a>(<span class="keywordtype">char</span> *__s, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list ap);
|
|
<a name="l00706"></a>00706 <span class="comment"></span>
|
|
<a name="l00707"></a>00707 <span class="comment">/**</span>
|
|
<a name="l00708"></a>00708 <span class="comment"> Like \c vsprintf(), but instead of assuming \c s to be of infinite</span>
|
|
<a name="l00709"></a>00709 <span class="comment"> size, no more than \c n characters (including the trailing NUL</span>
|
|
<a name="l00710"></a>00710 <span class="comment"> character) will be converted to \c s.</span>
|
|
<a name="l00711"></a>00711 <span class="comment"></span>
|
|
<a name="l00712"></a>00712 <span class="comment"> Returns the number of characters that would have been written to</span>
|
|
<a name="l00713"></a>00713 <span class="comment"> \c s if there were enough space.</span>
|
|
<a name="l00714"></a>00714 <span class="comment">*/</span>
|
|
<a name="l00715"></a>00715 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gac92e8c42a044c8f50aad5c2c69e638e0">vsnprintf</a>(<span class="keywordtype">char</span> *__s, <span class="keywordtype">size_t</span> __n, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list ap);
|
|
<a name="l00716"></a>00716 <span class="comment"></span>
|
|
<a name="l00717"></a>00717 <span class="comment">/**</span>
|
|
<a name="l00718"></a>00718 <span class="comment"> Variant of \c vsnprintf() that uses a \c fmt string that resides</span>
|
|
<a name="l00719"></a>00719 <span class="comment"> in program memory.</span>
|
|
<a name="l00720"></a>00720 <span class="comment">*/</span>
|
|
<a name="l00721"></a>00721 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga2071feb5c92bf50a6bd508a07ead9515">vsnprintf_P</a>(<span class="keywordtype">char</span> *__s, <span class="keywordtype">size_t</span> __n, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list ap);<span class="comment"></span>
|
|
<a name="l00722"></a>00722 <span class="comment">/**</span>
|
|
<a name="l00723"></a>00723 <span class="comment"> The function \c fprintf performs formatted output to \c stream.</span>
|
|
<a name="l00724"></a>00724 <span class="comment"> See \c vfprintf() for details.</span>
|
|
<a name="l00725"></a>00725 <span class="comment">*/</span>
|
|
<a name="l00726"></a>00726 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga0e41285401c397eb29692205a95fcd9c">fprintf</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00727"></a>00727 <span class="comment"></span>
|
|
<a name="l00728"></a>00728 <span class="comment">/**</span>
|
|
<a name="l00729"></a>00729 <span class="comment"> Variant of \c fprintf() that uses a \c fmt string that resides</span>
|
|
<a name="l00730"></a>00730 <span class="comment"> in program memory.</span>
|
|
<a name="l00731"></a>00731 <span class="comment">*/</span>
|
|
<a name="l00732"></a>00732 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga36173b4a8551b61811089198beec69d9">fprintf_P</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00733"></a>00733 <span class="comment"></span>
|
|
<a name="l00734"></a>00734 <span class="comment">/**</span>
|
|
<a name="l00735"></a>00735 <span class="comment"> Write the string pointed to by \c str to stream \c stream.</span>
|
|
<a name="l00736"></a>00736 <span class="comment"></span>
|
|
<a name="l00737"></a>00737 <span class="comment"> Returns 0 on success and EOF on error.</span>
|
|
<a name="l00738"></a>00738 <span class="comment">*/</span>
|
|
<a name="l00739"></a>00739 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga19c2bbe9ce4af9f0a7e3448387004fd3">fputs</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__str, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00740"></a>00740 <span class="comment"></span>
|
|
<a name="l00741"></a>00741 <span class="comment">/**</span>
|
|
<a name="l00742"></a>00742 <span class="comment"> Variant of fputs() where \c str resides in program memory.</span>
|
|
<a name="l00743"></a>00743 <span class="comment">*/</span>
|
|
<a name="l00744"></a>00744 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga3d25813cb225ca410518a3f48eb00caa">fputs_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__str, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00745"></a>00745 <span class="comment"></span>
|
|
<a name="l00746"></a>00746 <span class="comment">/**</span>
|
|
<a name="l00747"></a>00747 <span class="comment"> Write the string pointed to by \c str, and a trailing newline</span>
|
|
<a name="l00748"></a>00748 <span class="comment"> character, to \c stdout.</span>
|
|
<a name="l00749"></a>00749 <span class="comment">*/</span>
|
|
<a name="l00750"></a>00750 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga33f7bd99d40bf6f68a00d5507d65363d">puts</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__str);
|
|
<a name="l00751"></a>00751 <span class="comment"></span>
|
|
<a name="l00752"></a>00752 <span class="comment">/**</span>
|
|
<a name="l00753"></a>00753 <span class="comment"> Variant of puts() where \c str resides in program memory.</span>
|
|
<a name="l00754"></a>00754 <span class="comment">*/</span>
|
|
<a name="l00755"></a>00755 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gab4de83c560c79bf880fa39b997d61610">puts_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__str);
|
|
<a name="l00756"></a>00756 <span class="comment"></span>
|
|
<a name="l00757"></a>00757 <span class="comment">/**</span>
|
|
<a name="l00758"></a>00758 <span class="comment"> Write \c nmemb objects, \c size bytes each, to \c stream.</span>
|
|
<a name="l00759"></a>00759 <span class="comment"> The first byte of the first object is referenced by \c ptr.</span>
|
|
<a name="l00760"></a>00760 <span class="comment"></span>
|
|
<a name="l00761"></a>00761 <span class="comment"> Returns the number of objects successfully written, i. e.</span>
|
|
<a name="l00762"></a>00762 <span class="comment"> \c nmemb unless an output error occured.</span>
|
|
<a name="l00763"></a>00763 <span class="comment"> */</span>
|
|
<a name="l00764"></a>00764 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> <a class="code" href="group__avr__stdio.html#gadd5777719a41713629a62b68c239a774">fwrite</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *__ptr, <span class="keywordtype">size_t</span> __size, <span class="keywordtype">size_t</span> __nmemb,
|
|
<a name="l00765"></a>00765 <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00766"></a>00766 <span class="comment"></span>
|
|
<a name="l00767"></a>00767 <span class="comment">/**</span>
|
|
<a name="l00768"></a>00768 <span class="comment"> The function \c fgetc reads a character from \c stream. It returns</span>
|
|
<a name="l00769"></a>00769 <span class="comment"> the character, or \c EOF in case end-of-file was encountered or an</span>
|
|
<a name="l00770"></a>00770 <span class="comment"> error occurred. The routines feof() or ferror() must be used to</span>
|
|
<a name="l00771"></a>00771 <span class="comment"> distinguish between both situations.</span>
|
|
<a name="l00772"></a>00772 <span class="comment">*/</span>
|
|
<a name="l00773"></a>00773 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga818d63019adc9d518a13f9c36ed04f35">fgetc</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00774"></a>00774
|
|
<a name="l00775"></a>00775 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00776"></a>00776 <span class="preprocessor"></span>
|
|
<a name="l00777"></a>00777 <span class="comment">/* getc() function implementation, required by standard */</span>
|
|
<a name="l00778"></a>00778 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gacff255b3a0079ebb1516e8a4eb23a6fb">getc</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00779"></a>00779
|
|
<a name="l00780"></a>00780 <span class="comment">/* getchar() function implementation, required by standard */</span>
|
|
<a name="l00781"></a>00781 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gac0484b3e3a4d8361d91c3322440f9195">getchar</a>(<span class="keywordtype">void</span>);
|
|
<a name="l00782"></a>00782
|
|
<a name="l00783"></a>00783 <span class="preprocessor">#endif </span><span class="comment">/* not __DOXYGEN__ */</span>
|
|
<a name="l00784"></a>00784 <span class="comment"></span>
|
|
<a name="l00785"></a>00785 <span class="comment">/**</span>
|
|
<a name="l00786"></a>00786 <span class="comment"> The macro \c getc used to be a "fast" macro implementation with a</span>
|
|
<a name="l00787"></a>00787 <span class="comment"> functionality identical to fgetc(). For space constraints, in</span>
|
|
<a name="l00788"></a>00788 <span class="comment"> \c avr-libc, it is just an alias for \c fgetc.</span>
|
|
<a name="l00789"></a>00789 <span class="comment">*/</span>
|
|
<a name="l00790"></a><a class="code" href="group__avr__stdio.html#gacff255b3a0079ebb1516e8a4eb23a6fb">00790</a> <span class="preprocessor">#define getc(__stream) fgetc(__stream)</span>
|
|
<a name="l00791"></a>00791 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00792"></a>00792 <span class="comment">/**</span>
|
|
<a name="l00793"></a>00793 <span class="comment"> The macro \c getchar reads a character from \c stdin. Return</span>
|
|
<a name="l00794"></a>00794 <span class="comment"> values and error handling is identical to fgetc().</span>
|
|
<a name="l00795"></a>00795 <span class="comment">*/</span>
|
|
<a name="l00796"></a><a class="code" href="group__avr__stdio.html#gac0484b3e3a4d8361d91c3322440f9195">00796</a> <span class="preprocessor">#define getchar() fgetc(stdin)</span>
|
|
<a name="l00797"></a>00797 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00798"></a>00798 <span class="comment">/**</span>
|
|
<a name="l00799"></a>00799 <span class="comment"> The ungetc() function pushes the character \c c (converted to an</span>
|
|
<a name="l00800"></a>00800 <span class="comment"> unsigned char) back onto the input stream pointed to by \c stream.</span>
|
|
<a name="l00801"></a>00801 <span class="comment"> The pushed-back character will be returned by a subsequent read on</span>
|
|
<a name="l00802"></a>00802 <span class="comment"> the stream.</span>
|
|
<a name="l00803"></a>00803 <span class="comment"></span>
|
|
<a name="l00804"></a>00804 <span class="comment"> Currently, only a single character can be pushed back onto the</span>
|
|
<a name="l00805"></a>00805 <span class="comment"> stream.</span>
|
|
<a name="l00806"></a>00806 <span class="comment"> </span>
|
|
<a name="l00807"></a>00807 <span class="comment"> The ungetc() function returns the character pushed back after the</span>
|
|
<a name="l00808"></a>00808 <span class="comment"> conversion, or \c EOF if the operation fails. If the value of the</span>
|
|
<a name="l00809"></a>00809 <span class="comment"> argument \c c character equals \c EOF, the operation will fail and</span>
|
|
<a name="l00810"></a>00810 <span class="comment"> the stream will remain unchanged.</span>
|
|
<a name="l00811"></a>00811 <span class="comment">*/</span>
|
|
<a name="l00812"></a>00812 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gab4f9b130166e5811519513d6178c1ae3">ungetc</a>(<span class="keywordtype">int</span> __c, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00813"></a>00813 <span class="comment"></span>
|
|
<a name="l00814"></a>00814 <span class="comment">/**</span>
|
|
<a name="l00815"></a>00815 <span class="comment"> Read at most <tt>size - 1</tt> bytes from \c stream, until a</span>
|
|
<a name="l00816"></a>00816 <span class="comment"> newline character was encountered, and store the characters in the</span>
|
|
<a name="l00817"></a>00817 <span class="comment"> buffer pointed to by \c str. Unless an error was encountered while</span>
|
|
<a name="l00818"></a>00818 <span class="comment"> reading, the string will then be terminated with a \c NUL</span>
|
|
<a name="l00819"></a>00819 <span class="comment"> character.</span>
|
|
<a name="l00820"></a>00820 <span class="comment"></span>
|
|
<a name="l00821"></a>00821 <span class="comment"> If an error was encountered, the function returns NULL and sets the</span>
|
|
<a name="l00822"></a>00822 <span class="comment"> error flag of \c stream, which can be tested using ferror().</span>
|
|
<a name="l00823"></a>00823 <span class="comment"> Otherwise, a pointer to the string will be returned. */</span>
|
|
<a name="l00824"></a>00824 <span class="keyword">extern</span> <span class="keywordtype">char</span> *<a class="code" href="group__avr__stdio.html#ga00d34a8bff0293d2d6f4563d248d8fb2">fgets</a>(<span class="keywordtype">char</span> *__str, <span class="keywordtype">int</span> __size, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00825"></a>00825 <span class="comment"></span>
|
|
<a name="l00826"></a>00826 <span class="comment">/**</span>
|
|
<a name="l00827"></a>00827 <span class="comment"> Similar to fgets() except that it will operate on stream \c stdin,</span>
|
|
<a name="l00828"></a>00828 <span class="comment"> and the trailing newline (if any) will not be stored in the string.</span>
|
|
<a name="l00829"></a>00829 <span class="comment"> It is the caller's responsibility to provide enough storage to hold</span>
|
|
<a name="l00830"></a>00830 <span class="comment"> the characters read. */</span>
|
|
<a name="l00831"></a>00831 <span class="keyword">extern</span> <span class="keywordtype">char</span> *<a class="code" href="group__avr__stdio.html#gaf577dcba9afe50a9d068d0b69ac85d2f">gets</a>(<span class="keywordtype">char</span> *__str);
|
|
<a name="l00832"></a>00832 <span class="comment"></span>
|
|
<a name="l00833"></a>00833 <span class="comment">/**</span>
|
|
<a name="l00834"></a>00834 <span class="comment"> Read \c nmemb objects, \c size bytes each, from \c stream,</span>
|
|
<a name="l00835"></a>00835 <span class="comment"> to the buffer pointed to by \c ptr.</span>
|
|
<a name="l00836"></a>00836 <span class="comment"></span>
|
|
<a name="l00837"></a>00837 <span class="comment"> Returns the number of objects successfully read, i. e.</span>
|
|
<a name="l00838"></a>00838 <span class="comment"> \c nmemb unless an input error occured or end-of-file was</span>
|
|
<a name="l00839"></a>00839 <span class="comment"> encountered. feof() and ferror() must be used to distinguish</span>
|
|
<a name="l00840"></a>00840 <span class="comment"> between these two conditions.</span>
|
|
<a name="l00841"></a>00841 <span class="comment"> */</span>
|
|
<a name="l00842"></a>00842 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> <a class="code" href="group__avr__stdio.html#ga54fa47156a34c1659a29ed96e46e3518">fread</a>(<span class="keywordtype">void</span> *__ptr, <span class="keywordtype">size_t</span> __size, <span class="keywordtype">size_t</span> __nmemb,
|
|
<a name="l00843"></a>00843 <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00844"></a>00844 <span class="comment"></span>
|
|
<a name="l00845"></a>00845 <span class="comment">/**</span>
|
|
<a name="l00846"></a>00846 <span class="comment"> Clear the error and end-of-file flags of \c stream.</span>
|
|
<a name="l00847"></a>00847 <span class="comment"> */</span>
|
|
<a name="l00848"></a>00848 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="group__avr__stdio.html#gaaa6d255675688c736c99ebd32f2a7214">clearerr</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00849"></a>00849
|
|
<a name="l00850"></a>00850 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00851"></a>00851 <span class="preprocessor"></span><span class="comment">/* fast inlined version of clearerr() */</span>
|
|
<a name="l00852"></a>00852 <span class="preprocessor">#define clearerror(s) do { (s)->flags &= ~(__SERR | __SEOF); } while(0)</span>
|
|
<a name="l00853"></a>00853 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !defined(__DOXYGEN__) */</span>
|
|
<a name="l00854"></a>00854 <span class="comment"></span>
|
|
<a name="l00855"></a>00855 <span class="comment">/**</span>
|
|
<a name="l00856"></a>00856 <span class="comment"> Test the end-of-file flag of \c stream. This flag can only be cleared</span>
|
|
<a name="l00857"></a>00857 <span class="comment"> by a call to clearerr().</span>
|
|
<a name="l00858"></a>00858 <span class="comment"> */</span>
|
|
<a name="l00859"></a>00859 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga47b00053272d6443c9befdb1304002cb">feof</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00860"></a>00860
|
|
<a name="l00861"></a>00861 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00862"></a>00862 <span class="preprocessor"></span><span class="comment">/* fast inlined version of feof() */</span>
|
|
<a name="l00863"></a>00863 <span class="preprocessor">#define feof(s) ((s)->flags & __SEOF)</span>
|
|
<a name="l00864"></a>00864 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !defined(__DOXYGEN__) */</span>
|
|
<a name="l00865"></a>00865 <span class="comment"></span>
|
|
<a name="l00866"></a>00866 <span class="comment">/**</span>
|
|
<a name="l00867"></a>00867 <span class="comment"> Test the error flag of \c stream. This flag can only be cleared</span>
|
|
<a name="l00868"></a>00868 <span class="comment"> by a call to clearerr().</span>
|
|
<a name="l00869"></a>00869 <span class="comment"> */</span>
|
|
<a name="l00870"></a>00870 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gaa89248dd55efb5f59a96e82976c97758">ferror</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream);
|
|
<a name="l00871"></a>00871
|
|
<a name="l00872"></a>00872 <span class="preprocessor">#if !defined(__DOXYGEN__)</span>
|
|
<a name="l00873"></a>00873 <span class="preprocessor"></span><span class="comment">/* fast inlined version of ferror() */</span>
|
|
<a name="l00874"></a>00874 <span class="preprocessor">#define ferror(s) ((s)->flags & __SERR)</span>
|
|
<a name="l00875"></a>00875 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !defined(__DOXYGEN__) */</span>
|
|
<a name="l00876"></a>00876
|
|
<a name="l00877"></a>00877 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga67bae1ad3af79809fd770be392f90e21">vfscanf</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list __ap);
|
|
<a name="l00878"></a>00878 <span class="comment"></span>
|
|
<a name="l00879"></a>00879 <span class="comment">/**</span>
|
|
<a name="l00880"></a>00880 <span class="comment"> Variant of vfscanf() using a \c fmt string in program memory.</span>
|
|
<a name="l00881"></a>00881 <span class="comment"> */</span>
|
|
<a name="l00882"></a>00882 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga6c6b5b881ce8f4739777ff3a615e988a">vfscanf_P</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list __ap);
|
|
<a name="l00883"></a>00883 <span class="comment"></span>
|
|
<a name="l00884"></a>00884 <span class="comment">/**</span>
|
|
<a name="l00885"></a>00885 <span class="comment"> The function \c fscanf performs formatted input, reading the</span>
|
|
<a name="l00886"></a>00886 <span class="comment"> input data from \c stream.</span>
|
|
<a name="l00887"></a>00887 <span class="comment"></span>
|
|
<a name="l00888"></a>00888 <span class="comment"> See vfscanf() for details.</span>
|
|
<a name="l00889"></a>00889 <span class="comment"> */</span>
|
|
<a name="l00890"></a>00890 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga0beb4fd9ff6833a364e3ce60370de058">fscanf</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00891"></a>00891 <span class="comment"></span>
|
|
<a name="l00892"></a>00892 <span class="comment">/**</span>
|
|
<a name="l00893"></a>00893 <span class="comment"> Variant of fscanf() using a \c fmt string in program memory.</span>
|
|
<a name="l00894"></a>00894 <span class="comment"> */</span>
|
|
<a name="l00895"></a>00895 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga7aec94e711ad64724076666586a26839">fscanf_P</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *__stream, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00896"></a>00896 <span class="comment"></span>
|
|
<a name="l00897"></a>00897 <span class="comment">/**</span>
|
|
<a name="l00898"></a>00898 <span class="comment"> The function \c scanf performs formatted input from stream \c stdin.</span>
|
|
<a name="l00899"></a>00899 <span class="comment"></span>
|
|
<a name="l00900"></a>00900 <span class="comment"> See vfscanf() for details.</span>
|
|
<a name="l00901"></a>00901 <span class="comment"> */</span>
|
|
<a name="l00902"></a>00902 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga3f0edc16dcabb5344d59d42cf7682102">scanf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00903"></a>00903 <span class="comment"></span>
|
|
<a name="l00904"></a>00904 <span class="comment">/**</span>
|
|
<a name="l00905"></a>00905 <span class="comment"> Variant of scanf() where \c fmt resides in program memory.</span>
|
|
<a name="l00906"></a>00906 <span class="comment"> */</span>
|
|
<a name="l00907"></a>00907 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga0fb7fd70cd7618f27d8219c97e61bcf3">scanf_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00908"></a>00908 <span class="comment"></span>
|
|
<a name="l00909"></a>00909 <span class="comment">/**</span>
|
|
<a name="l00910"></a>00910 <span class="comment"> The function \c vscanf performs formatted input from stream</span>
|
|
<a name="l00911"></a>00911 <span class="comment"> \c stdin, taking a variable argument list as in vfscanf().</span>
|
|
<a name="l00912"></a>00912 <span class="comment"></span>
|
|
<a name="l00913"></a>00913 <span class="comment"> See vfscanf() for details.</span>
|
|
<a name="l00914"></a>00914 <span class="comment">*/</span>
|
|
<a name="l00915"></a>00915 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga8bd4b760f67791a54e73111734caa82f">vscanf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, va_list __ap);
|
|
<a name="l00916"></a>00916 <span class="comment"></span>
|
|
<a name="l00917"></a>00917 <span class="comment">/**</span>
|
|
<a name="l00918"></a>00918 <span class="comment"> The function \c sscanf performs formatted input, reading the</span>
|
|
<a name="l00919"></a>00919 <span class="comment"> input data from the buffer pointed to by \c buf.</span>
|
|
<a name="l00920"></a>00920 <span class="comment"></span>
|
|
<a name="l00921"></a>00921 <span class="comment"> See vfscanf() for details.</span>
|
|
<a name="l00922"></a>00922 <span class="comment"> */</span>
|
|
<a name="l00923"></a>00923 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#ga5507d0e1bbfd387fbb2ffcfd8f5dca6f">sscanf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__buf, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00924"></a>00924 <span class="comment"></span>
|
|
<a name="l00925"></a>00925 <span class="comment">/**</span>
|
|
<a name="l00926"></a>00926 <span class="comment"> Variant of sscanf() using a \c fmt string in program memory.</span>
|
|
<a name="l00927"></a>00927 <span class="comment"> */</span>
|
|
<a name="l00928"></a>00928 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gaeca11dc4b3757ed4ff2f2a4950eba117">sscanf_P</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *__buf, <span class="keyword">const</span> <span class="keywordtype">char</span> *__fmt, ...);
|
|
<a name="l00929"></a>00929
|
|
<a name="l00930"></a>00930 <span class="preprocessor">#if defined(__DOXYGEN__)</span>
|
|
<a name="l00931"></a>00931 <span class="preprocessor"></span><span class="comment">/**</span>
|
|
<a name="l00932"></a>00932 <span class="comment"> Flush \c stream.</span>
|
|
<a name="l00933"></a>00933 <span class="comment"></span>
|
|
<a name="l00934"></a>00934 <span class="comment"> This is a null operation provided for source-code compatibility</span>
|
|
<a name="l00935"></a>00935 <span class="comment"> only, as the standard IO implementation currently does not perform</span>
|
|
<a name="l00936"></a>00936 <span class="comment"> any buffering.</span>
|
|
<a name="l00937"></a>00937 <span class="comment"> */</span>
|
|
<a name="l00938"></a>00938 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gadb974f28765a31026ee6bf71d5175951">fflush</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream);
|
|
<a name="l00939"></a>00939 <span class="preprocessor">#else</span>
|
|
<a name="l00940"></a>00940 <span class="preprocessor"></span><span class="keyword">static</span> __inline__ <span class="keywordtype">int</span> <a class="code" href="group__avr__stdio.html#gadb974f28765a31026ee6bf71d5175951">fflush</a>(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream <a class="code" href="group__avr__watchdog.html#gadaa6dd28b5d08df35e49b1248d7e5fb0">__attribute__</a>((unused)))
|
|
<a name="l00941"></a>00941 {
|
|
<a name="l00942"></a>00942 <span class="keywordflow">return</span> 0;
|
|
<a name="l00943"></a>00943 }
|
|
<a name="l00944"></a>00944 <span class="preprocessor">#endif</span>
|
|
<a name="l00945"></a>00945 <span class="preprocessor"></span>
|
|
<a name="l00946"></a>00946 <span class="preprocessor">#ifndef __DOXYGEN__</span>
|
|
<a name="l00947"></a>00947 <span class="preprocessor"></span><span class="comment">/* only mentioned for libstdc++ support, not implemented in library */</span>
|
|
<a name="l00948"></a>00948 <span class="preprocessor">#define BUFSIZ 1024</span>
|
|
<a name="l00949"></a>00949 <span class="preprocessor"></span><span class="preprocessor">#define _IONBF 0</span>
|
|
<a name="l00950"></a>00950 <span class="preprocessor"></span>__extension__ <span class="keyword">typedef</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> fpos_t;
|
|
<a name="l00951"></a>00951 <span class="keyword">extern</span> <span class="keywordtype">int</span> fgetpos(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream, fpos_t *pos);
|
|
<a name="l00952"></a>00952 <span class="keyword">extern</span> <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *fopen(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *mode);
|
|
<a name="l00953"></a>00953 <span class="keyword">extern</span> <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *freopen(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *mode, <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream);
|
|
<a name="l00954"></a>00954 <span class="keyword">extern</span> <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *fdopen(<span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
|
|
<a name="l00955"></a>00955 <span class="keyword">extern</span> <span class="keywordtype">int</span> fseek(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream, <span class="keywordtype">long</span> offset, <span class="keywordtype">int</span> whence);
|
|
<a name="l00956"></a>00956 <span class="keyword">extern</span> <span class="keywordtype">int</span> fsetpos(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream, fpos_t *pos);
|
|
<a name="l00957"></a>00957 <span class="keyword">extern</span> <span class="keywordtype">long</span> ftell(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream);
|
|
<a name="l00958"></a>00958 <span class="keyword">extern</span> <span class="keywordtype">int</span> fileno(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *);
|
|
<a name="l00959"></a>00959 <span class="keyword">extern</span> <span class="keywordtype">void</span> perror(<span class="keyword">const</span> <span class="keywordtype">char</span> *s);
|
|
<a name="l00960"></a>00960 <span class="keyword">extern</span> <span class="keywordtype">int</span> <span class="keyword">remove</span>(<span class="keyword">const</span> <span class="keywordtype">char</span> *pathname);
|
|
<a name="l00961"></a>00961 <span class="keyword">extern</span> <span class="keywordtype">int</span> rename(<span class="keyword">const</span> <span class="keywordtype">char</span> *oldpath, <span class="keyword">const</span> <span class="keywordtype">char</span> *newpath);
|
|
<a name="l00962"></a>00962 <span class="keyword">extern</span> <span class="keywordtype">void</span> rewind(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream);
|
|
<a name="l00963"></a>00963 <span class="keyword">extern</span> <span class="keywordtype">void</span> setbuf(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream, <span class="keywordtype">char</span> *buf);
|
|
<a name="l00964"></a>00964 <span class="keyword">extern</span> <span class="keywordtype">int</span> setvbuf(<a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *stream, <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> mode, <span class="keywordtype">size_t</span> size);
|
|
<a name="l00965"></a>00965 <span class="keyword">extern</span> <a class="code" href="group__avr__stdio.html#gaed4dabeb9f7c518ded42f930a04abce8">FILE</a> *tmpfile(<span class="keywordtype">void</span>);
|
|
<a name="l00966"></a>00966 <span class="keyword">extern</span> <span class="keywordtype">char</span> *tmpnam (<span class="keywordtype">char</span> *s);
|
|
<a name="l00967"></a>00967 <span class="preprocessor">#endif </span><span class="comment">/* !__DOXYGEN__ */</span>
|
|
<a name="l00968"></a>00968
|
|
<a name="l00969"></a>00969 <span class="preprocessor">#ifdef __cplusplus</span>
|
|
<a name="l00970"></a>00970 <span class="preprocessor"></span>}
|
|
<a name="l00971"></a>00971 <span class="preprocessor">#endif</span>
|
|
<a name="l00972"></a>00972 <span class="preprocessor"></span><span class="comment"></span>
|
|
<a name="l00973"></a>00973 <span class="comment">/*@}*/</span>
|
|
<a name="l00974"></a>00974
|
|
<a name="l00975"></a>00975 <span class="preprocessor">#ifndef __DOXYGEN__</span>
|
|
<a name="l00976"></a>00976 <span class="preprocessor"></span><span class="comment">/*</span>
|
|
<a name="l00977"></a>00977 <span class="comment"> * The following constants are currently not used by avr-libc's</span>
|
|
<a name="l00978"></a>00978 <span class="comment"> * stdio subsystem. They are defined here since the gcc build</span>
|
|
<a name="l00979"></a>00979 <span class="comment"> * environment expects them to be here.</span>
|
|
<a name="l00980"></a>00980 <span class="comment"> */</span>
|
|
<a name="l00981"></a>00981 <span class="preprocessor">#define SEEK_SET 0</span>
|
|
<a name="l00982"></a>00982 <span class="preprocessor"></span><span class="preprocessor">#define SEEK_CUR 1</span>
|
|
<a name="l00983"></a>00983 <span class="preprocessor"></span><span class="preprocessor">#define SEEK_END 2</span>
|
|
<a name="l00984"></a>00984 <span class="preprocessor"></span>
|
|
<a name="l00985"></a>00985 <span class="preprocessor">#endif</span>
|
|
<a name="l00986"></a>00986 <span class="preprocessor"></span>
|
|
<a name="l00987"></a>00987 <span class="preprocessor">#endif </span><span class="comment">/* __ASSEMBLER */</span>
|
|
<a name="l00988"></a>00988
|
|
<a name="l00989"></a>00989 <span class="preprocessor">#endif </span><span class="comment">/* _STDLIB_H_ */</span>
|
|
</pre></div></div>
|
|
<!--- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Defines</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<!-- HTML footer for doxygen 1.8.7-->
|
|
<!-- start footer part -->
|
|
<!--BEGIN GENERATE_TREEVIEW-->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
$navpath
|
|
<li class="footer">$generatedby
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> 1.6.3 </li>
|
|
</ul>
|
|
</div>
|
|
<!--END GENERATE_TREEVIEW-->
|
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
|
|
</a> 1.6.3
|
|
</small></address>
|
|
<!--END !GENERATE_TREEVIEW-->
|
|
</body>
|
|
</html>
|