4 % NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE FROM "makedoc"
5 \global\long\def\example{%
7 \let\aboveenvbreak=\par
8 \let\afterenvbreak=\par
11 \global\long\def\Eexample{%
14 \vskip -\parskip% to cancel out effect of following \par
16 % END LOCAL WHITESPACE KLUGE
23 * libc:: The ANSI C library.
29 This file documents the ANSI C library.
31 Copyright (C) 1992, 1993, 1994-2004 Red Hat, Inc.
33 @file{libc} includes software developed by the
34 University of California, Berkeley and its contributors.
36 libc includes software developed by Martin Jackson, Graham Haley
37 and Steve Chamberlain of Tadpole Technology and released to Cygnus.
39 libc uses floating-point conversion software developed at AT&T, which
40 includes this copyright information:
42 The author of this software is David M. Gay.
44 Copyright (c) 1991 by AT&T.
46 Permission to use, copy, modify, and distribute this software for any
47 purpose without fee is hereby granted, provided that this entire notice
48 is included in all copies of any software which is or includes a copy
49 or modification of this software and in all copies of the supporting
50 documentation for such software.
52 THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
53 WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
54 REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
55 OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
57 Permission is granted to make and distribute verbatim copies of
58 this manual provided the copyright notice and this permission notice
59 are preserved on all copies.
62 Permission is granted to process this file through Tex and print the
63 results, provided the printed document carries copying permission
64 notice identical to this one except for the removal of this paragraph
65 (this paragraph not being relevant to the printed manual).
68 Permission is granted to copy and distribute modified versions of this
69 manual under the conditions for verbatim copying, subject to the terms
70 of the GNU General Public License, which includes the provision that the
71 entire resulting derived work is distributed under the terms of a
72 permission notice identical to this one.
74 Permission is granted to copy and distribute translations of this manual
75 into another language, under the above conditions for modified versions.
81 @setchapternewpage odd
82 @settitle Red Hat newlib C Library, Full
84 @title The Red Hat newlib C Library
85 @subtitle Full Configuration
87 @subtitle @code{libc} 1.12.0
88 @subtitle January 2004
89 @author {Steve Chamberlain}
90 @author {Roland Pesch}
91 @author {Red Hat Support}
92 @author {Jeff Johnston}
97 sac@@cygnus.com, pesch@@cygnus.com, jjohnstn@@redhat.com\hfill {\it The Red Hat newlib C Library}\par
98 Copyright \copyright{} 1992, 1993, 1994-2004 Red Hat Inc.
100 \global\parindent=0pt % Steve likes it this way
103 @file{libc} includes software developed by the
104 University of California, Berkeley and its contributors.
106 @file{libc} includes software developed by Martin Jackson, Graham Haley
107 and Steve Chamberlain of Tadpole Technology and released to Cygnus.
109 @file{libc} uses floating-point conversion software developed at AT&T,
110 which includes this copyright information:
114 The author of this software is David M. Gay.
116 Copyright (c) 1991 by AT&T.
118 Permission to use, copy, modify, and distribute this software for any
119 purpose without fee is hereby granted, provided that this entire notice
120 is included in all copies of any software which is or includes a copy
121 or modification of this software and in all copies of the supporting
122 documentation for such software.
124 THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
125 WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY
126 REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
127 OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
131 Permission is granted to make and distribute verbatim copies of
132 this manual provided the copyright notice and this permission notice
133 are preserved on all copies.
135 Permission is granted to copy and distribute modified versions of this
136 manual under the conditions for verbatim copying, subject to the terms
137 of the GNU General Public License, which includes the provision that the
138 entire resulting derived work is distributed under the terms of a
139 permission notice identical to this one.
141 Permission is granted to copy and distribute translations of this manual
142 into another language, under the above conditions for modified versions.
148 @top The Red Hat newlib C Library
150 @c The menu contents depend on the configuration, so we include them
151 @c as a separate file
153 @c switch to set SIGNALS on or off, according to whether config picks up
154 @c signal subdirectory:
157 @include stdio64.texi
158 @include iconvset.texi
189 @include targetdep.tex
192 @chapter Variable Argument Lists
194 The @code{printf} family of functions is defined to accept a variable
195 number of arguments, rather than a fixed argument list. You can define
196 your own functions with a variable argument list, by using macro
197 definitions from either @file{stdarg.h} (for compatibility with ANSI C)
198 or from @file{varargs.h} (for compatibility with a popular convention
207 @section ANSI-standard macros, @file{stdarg.h}
209 In ANSI C, a function has a variable number of arguments when its
210 parameter list ends in an ellipsis (@code{...}). The parameter list
211 must also include at least one explicitly named argument; that argument
212 is used to initialize the variable list data structure.
214 ANSI C defines three macros (@code{va_start}, @code{va_arg}, and
215 @code{va_end}) to operate on variable argument lists. @file{stdarg.h}
216 also defines a special type to represent variable argument lists: this
217 type is called @code{va_list}.
227 @subsection Initialize variable argument list
232 void va_start(va_list @var{ap}, @var{rightmost});
235 @strong{Description}@*
236 Use @code{va_start} to initialize the variable argument list @var{ap},
237 so that @code{va_arg} can extract values from it. @var{rightmost} is
238 the name of the last explicit argument in the parameter list (the
239 argument immediately preceding the ellipsis @samp{...} that flags
240 variable arguments in an ANSI C function header). You can only use
241 @code{va_start} in a function declared using this ellipsis notation
242 (not, for example, in one of its subfunctions).
245 @code{va_start} does not return a result.
247 @strong{Portability}@*
248 ANSI C requires @code{va_start}.
252 @subsection Extract a value from argument list
257 @var{type} va_arg(va_list @var{ap}, @var{type});
260 @strong{Description}@*
261 @code{va_arg} returns the next unprocessed value from a variable
262 argument list @var{ap} (which you must previously create with
263 @var{va_start}). Specify the type for the value as the second parameter
264 to the macro, @var{type}.
266 You may pass a @code{va_list} object @var{ap} to a subfunction, and use
267 @code{va_arg} from the subfunction rather than from the function
268 actually declared with an ellipsis in the header; however, in that case
269 you may @emph{only} use @code{va_arg} from the subfunction. ANSI C does
270 not permit extracting successive values from a single variable-argument
271 list from different levels of the calling stack.
273 There is no mechanism for testing whether there is actually a next
274 argument available; you might instead pass an argument count (or some
275 other data that implies an argument count) as one of the fixed arguments
276 in your function call.
279 @code{va_arg} returns the next argument, an object of type @var{type}.
281 @strong{Portability}@*
282 ANSI C requires @code{va_arg}.
286 @subsection Abandon a variable argument list
291 void va_end(va_list @var{ap});
294 @strong{Description}@*
295 Use @code{va_end} to declare that your program will not use the variable
296 argument list @var{ap} any further.
299 @code{va_end} does not return a result.
301 @strong{Portability}@*
302 ANSI C requires @code{va_end}.
305 @section Traditional macros, @file{varargs.h}
307 If your C compiler predates ANSI C, you may still be able to use
308 variable argument lists using the macros from the @file{varargs.h}
309 header file. These macros resemble their ANSI counterparts, but have
310 important differences in usage. In particular, since traditional C has
311 no declaration mechanism for variable argument lists, two additional
312 macros are provided simply for the purpose of defining functions with
313 variable argument lists.
315 As with @file{stdarg.h}, the type @code{va_list} is used to hold a data
316 structure representing a variable argument list.
327 @subsection Declare variable arguments
333 @var{function}(va_alist)
337 @strong{Description}@*
338 To use the @file{varargs.h} version of variable argument lists, you must
339 declare your function with a call to the macro @code{va_alist} as its
340 argument list, and use @code{va_dcl} as the declaration. @emph{Do not
341 use a semicolon after @code{va_dcl}.}
344 These macros cannot be used in a context where a return is syntactically
347 @strong{Portability}@*
348 @var{va_alist} and @var{va_dcl} were the most widespread method of
349 declaring variable argument lists prior to ANSI C.
353 @subsection Initialize variable argument list
362 @strong{Description}@*
363 With the @file{varargs.h} macros, use @code{va_start} to initialize a
364 data structure @var{ap} to permit manipulating a variable argument list.
365 @var{ap} must have the type @var{va_alist}.
368 @code{va_start} does not return a result.
370 @strong{Portability}@*
371 @code{va_start} is also defined as a macro in ANSI C, but the
372 definitions are incompatible; the ANSI version has another parameter
377 @subsection Extract a value from argument list
382 @var{type} va_arg(va_list @var{ap}, @var{type});
385 @strong{Description}@*
386 @code{va_arg} returns the next unprocessed value from a variable
387 argument list @var{ap} (which you must previously create with
388 @var{va_start}). Specify the type for the value as the second parameter
389 to the macro, @var{type}.
392 @code{va_arg} returns the next argument, an object of type @var{type}.
394 @strong{Portability}@*
395 The @code{va_arg} defined in @file{varargs.h} has the same syntax and
396 usage as the ANSI C version from @file{stdarg.h}.
400 @subsection Abandon a variable argument list
405 va_end(va_list @var{ap});
408 @strong{Description}@*
409 Use @code{va_end} to declare that your program will not use the variable
410 argument list @var{ap} any further.
413 @code{va_end} does not return a result.
415 @strong{Portability}@*
416 The @code{va_end} defined in @file{varargs.h} has the same syntax and
417 usage as the ANSI C version from @file{stdarg.h}.
424 % I think something like @colophon should be in texinfo. In the
426 \long\def\colophon{\hbox to0pt{}\vfill
427 \centerline{The body of this manual is set in}
428 \centerline{\fontname\tenrm,}
429 \centerline{with headings in {\bf\fontname\tenbf}}
430 \centerline{and examples in {\tt\fontname\tentt}.}
431 \centerline{{\it\fontname\tenit\/} and}
432 \centerline{{\sl\fontname\tensl\/}}
433 \centerline{are used for emphasis.}\vfill}
435 % Blame: pesch@cygnus.com, 28mar91.