~ubuntu-branches/ubuntu/maverick/avr-libc/maverick

« back to all changes in this revision

Viewing changes to include/stdio.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2007-08-09 11:28:01 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070809112801-ps7wognnynio9kz7
Tags: 1:1.4.6-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002, 2005, Joerg Wunsch
 
1
/* Copyright (c) 2002, 2005, 2007 Joerg Wunsch
2
2
   All rights reserved.
3
3
 
4
4
   Portions of documentation Copyright (c) 1990, 1991, 1993
33
33
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
34
  POSSIBILITY OF SUCH DAMAGE.
35
35
 
36
 
  $Id: stdio.h,v 1.24.2.1 2006/03/02 20:08:50 joerg_wunsch Exp $
 
36
  $Id: stdio.h,v 1.24.2.3 2007/01/23 15:34:58 joerg_wunsch Exp $
37
37
*/
38
38
 
39
39
#ifndef _STDIO_H_
48
48
#define __need_size_t
49
49
#include <stddef.h>
50
50
 
 
51
/** \file */
51
52
/** \defgroup avr_stdio <stdio.h>: Standard IO facilities
52
53
    \code #include <stdio.h> \endcode
53
54
 
139
140
    \anchor stdio_without_malloc
140
141
    <h3>Running stdio without malloc()</h3>
141
142
 
142
 
    By default, fdevopen() as well as the floating-point versions of
143
 
    the printf and scanf family require malloc().  As this is often
 
143
    By default, fdevopen() requires malloc().  As this is often
144
144
    not desired in the limited environment of a microcontroller, an
145
145
    alternative option is provided to run completely without malloc().
146
146
 
147
147
    The macro fdev_setup_stream() is provided to prepare a
148
 
    user-supplied FILE buffer for operation with stdio.  If
149
 
    floating-point operation is desired, a user-supplied buffer can as
150
 
    well be passed for the internal buffering for the floating-point
151
 
    numbers (and processing of \%[ scanf data).
 
148
    user-supplied FILE buffer for operation with stdio.
152
149
 
153
150
    <h4>Example</h4>
154
151
 
975
972
     By default, all the conversions described above are available
976
973
     except the floating-point conversions, and the <tt>\%[</tt> conversion.
977
974
     These conversions will be available in the extended version
978
 
     provided by the library \c libscanf_flt.a.  Note that either of
979
 
     these conversions requires the availability of a buffer that
980
 
     needs to be obtained at run-time using malloc().  If this buffer
981
 
     cannot be obtained, the operation is aborted, returning the
982
 
     value \c EOF.  To link a program against the extended version,
 
975
     provided by the library \c libscanf_flt.a.  Note that these
 
976
     conversions require a 40-byte conversion buffer, so the
 
977
     extended version requires more stack space than the basic
 
978
     version irrespective of whether the actual call in progress
 
979
     actually uses this buffer or not.
 
980
     To link a program against the extended version,
983
981
     use the following compiler flags in the link stage:
984
982
 
985
983
     \code