Update.
[glibc.git] / libio / stdio.h
blob4fd2e994530a108ebf21fc0a0f9e6414b206ddcd
1 /* Define ISO C stdio on top of C++ iostreams.
2 Copyright (C) 1991, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 * ISO C Standard: 4.9 INPUT/OUTPUT <stdio.h>
23 #ifndef _STDIO_H
25 #ifndef __need_FILE
26 # define _STDIO_H 1
27 # include <features.h>
29 __BEGIN_DECLS
31 # define __need_size_t
32 # define __need_NULL
33 # include <stddef.h>
35 # ifndef __USE_XOPEN
36 # define __need___va_list
37 # endif
38 # include <stdarg.h>
40 # include <bits/types.h>
41 #endif /* Don't need FILE. */
42 #undef __need_FILE
45 #ifndef __FILE_defined
47 /* The opaque type of streams. */
48 typedef struct _IO_FILE FILE;
50 # define __FILE_defined 1
51 #endif /* FILE not defined. */
54 #ifdef _STDIO_H
55 #define _STDIO_USES_IOSTREAM
57 #include <libio.h>
59 #ifdef __cplusplus
60 # define __STDIO_INLINE inline
61 #else
62 # define __STDIO_INLINE extern __inline
63 #endif
65 /* The type of the second argument to `fgetpos' and `fsetpos'. */
66 #ifndef __USE_FILE_OFFSET64
67 typedef _G_fpos_t fpos_t;
68 #else
69 typedef _G_fpos64_t fpos_t;
70 #endif
71 #ifdef __USE_LARGEFILE64
72 typedef _G_fpos64_t fpos64_t;
73 #endif
75 /* The possibilities for the third argument to `setvbuf'. */
76 #define _IOFBF 0 /* Fully buffered. */
77 #define _IOLBF 1 /* Line buffered. */
78 #define _IONBF 2 /* No buffering. */
81 /* Default buffer size. */
82 #ifndef BUFSIZ
83 # define BUFSIZ _IO_BUFSIZ
84 #endif
87 /* End of file character.
88 Some things throughout the library rely on this being -1. */
89 #ifndef EOF
90 # define EOF (-1)
91 #endif
94 /* The possibilities for the third argument to `fseek'.
95 These values should not be changed. */
96 #define SEEK_SET 0 /* Seek from beginning of file. */
97 #define SEEK_CUR 1 /* Seek from current position. */
98 #define SEEK_END 2 /* Seek from end of file. */
101 #if defined __USE_SVID || defined __USE_XOPEN
102 /* Default path prefix for `tempnam' and `tmpnam'. */
103 # define P_tmpdir "/tmp"
104 #endif
107 /* Get the values:
108 L_tmpnam How long an array of chars must be to be passed to `tmpnam'.
109 TMP_MAX The minimum number of unique filenames generated by tmpnam
110 (and tempnam when it uses tmpnam's name space),
111 or tempnam (the two are separate).
112 L_ctermid How long an array to pass to `ctermid'.
113 L_cuserid How long an array to pass to `cuserid'.
114 FOPEN_MAX Minimum number of files that can be open at once.
115 FILENAME_MAX Maximum length of a filename. */
116 #include <bits/stdio_lim.h>
119 /* Standard streams. */
120 extern FILE *stdin; /* Standard input stream. */
121 extern FILE *stdout; /* Standard output stream. */
122 extern FILE *stderr; /* Standard error output stream. */
125 /* Remove file FILENAME. */
126 extern int remove __P ((__const char *__filename));
127 /* Rename file OLD to NEW. */
128 extern int rename __P ((__const char *__old, __const char *__new));
131 /* Create a temporary file and open it read/write. */
132 #ifndef __USE_FILE_OFFSET64
133 extern FILE *tmpfile __P ((void));
134 #else
135 # ifdef __REDIRECT
136 extern FILE *__REDIRECT (tmpfile, __P ((void)), tmpfile64);
137 # else
138 # define tmpfile tmpfile64
139 # endif
140 #endif
141 #ifdef __USE_LARGEFILE64
142 extern FILE *tmpfile64 __P ((void));
143 #endif
144 /* Generate a temporary filename. */
145 extern char *tmpnam __P ((char *__s));
147 #ifdef __USE_MISC
148 /* This is the reentrant variant of `tmpnam'. The only difference is
149 that it does not allow S to be NULL. */
150 extern char *tmpnam_r __P ((char *__s));
151 #endif
154 #if defined __USE_SVID || defined __USE_XOPEN
155 /* Generate a unique temporary filename using up to five characters of PFX
156 if it is not NULL. The directory to put this file in is searched for
157 as follows: First the environment variable "TMPDIR" is checked.
158 If it contains the name of a writable directory, that directory is used.
159 If not and if DIR is not NULL, that value is checked. If that fails,
160 P_tmpdir is tried and finally "/tmp". The storage for the filename
161 is allocated by `malloc'. */
162 extern char *tempnam __P ((__const char *__dir, __const char *__pfx));
163 #endif
166 /* Close STREAM. */
167 extern int fclose __P ((FILE *__stream));
168 /* Flush STREAM, or all streams if STREAM is NULL. */
169 extern int fflush __P ((FILE *__stream));
171 #ifdef __USE_MISC
172 /* Faster versions when locking is not required. */
173 extern int fflush_unlocked __P ((FILE *__stream));
174 #endif
176 #ifdef __USE_GNU
177 /* Close all streams. */
178 extern int fcloseall __P ((void));
179 #endif
182 #ifndef __USE_FILE_OFFSET64
183 /* Open a file and create a new stream for it. */
184 extern FILE *fopen __P ((__const char *__restrict __filename,
185 __const char *__restrict __modes));
186 /* Open a file, replacing an existing stream with it. */
187 extern FILE *freopen __P ((__const char *__restrict __filename,
188 __const char *__restrict __modes,
189 FILE *__restrict __stream));
190 #else
191 # ifdef __REDIRECT
192 extern FILE *__REDIRECT (fopen, __P ((__const char *__restrict __filename,
193 __const char *__restrict __modes)),
194 fopen64);
195 extern FILE *__REDIRECT (freopen, __P ((__const char *__restrict __filename,
196 __const char *__restrict __modes,
197 FILE *__restrict __stream)),
198 freopen64);
199 # else
200 # define fopen fopen64
201 # define freopen freopen64
202 # endif
203 #endif
204 #ifdef __USE_LARGEFILE64
205 extern FILE *fopen64 __P ((__const char *__restrict __filename,
206 __const char *__restrict __modes));
207 extern FILE *freopen64 __P ((__const char *__restrict __filename,
208 __const char *__restrict __modes,
209 FILE *__restrict __stream));
210 #endif
212 #ifdef __USE_POSIX
213 /* Create a new stream that refers to an existing system file descriptor. */
214 extern FILE *fdopen __P ((int __fd, __const char *__modes));
215 #endif
217 #ifdef __USE_GNU
218 /* Create a new stream that refers to the given magic cookie,
219 and uses the given functions for input and output. */
220 extern FILE *fopencookie __P ((void *__magic_cookie, __const char *__modes,
221 _IO_cookie_io_functions_t __io_funcs));
223 /* Open a stream that writes into a malloc'd buffer that is expanded as
224 necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
225 and the number of characters written on fflush or fclose. */
226 extern FILE *open_memstream __P ((char **__bufloc, size_t *__sizeloc));
227 #endif
230 /* If BUF is NULL, make STREAM unbuffered.
231 Else make it use buffer BUF, of size BUFSIZ. */
232 extern void setbuf __P ((FILE *__restrict __stream, char *__restrict __buf));
233 /* Make STREAM use buffering mode MODE.
234 If BUF is not NULL, use N bytes of it for buffering;
235 else allocate an internal buffer N bytes long. */
236 extern int setvbuf __P ((FILE *__restrict __stream, char *__restrict __buf,
237 int __modes, size_t __n));
239 #ifdef __USE_BSD
240 /* If BUF is NULL, make STREAM unbuffered.
241 Else make it use SIZE bytes of BUF for buffering. */
242 extern void setbuffer __P ((FILE *__stream, char *__buf, size_t __size));
244 /* Make STREAM line-buffered. */
245 extern void setlinebuf __P ((FILE *__stream));
246 #endif
249 /* Write formatted output to STREAM. */
250 extern int fprintf __P ((FILE *__restrict __stream,
251 __const char *__restrict __format, ...));
252 /* Write formatted output to stdout. */
253 extern int printf __P ((__const char *__restrict __format, ...));
254 /* Write formatted output to S. */
255 extern int sprintf __P ((char *__restrict __s,
256 __const char *__restrict __format, ...));
258 /* Write formatted output to S from argument list ARG. */
259 extern int vfprintf __P ((FILE *__restrict __s,
260 __const char *__restrict __format,
261 _G_va_list __arg));
262 /* Write formatted output to stdout from argument list ARG. */
263 extern int vprintf __P ((__const char *__restrict __format,
264 _G_va_list __arg));
265 /* Write formatted output to S from argument list ARG. */
266 extern int vsprintf __P ((char *__restrict __s,
267 __const char *__restrict __format,
268 _G_va_list __arg));
270 #ifdef __USE_EXTERN_INLINES
271 __STDIO_INLINE int
272 vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW
274 return vfprintf (stdout, __fmt, __arg);
276 #endif /* Use extern inlines. */
278 #if defined __USE_BSD || defined __USE_ISOC9X || defined __USE_UNIX98
279 /* Maximum chars of output to write in MAXLEN. */
280 extern int snprintf __P ((char *__restrict __s, size_t __maxlen,
281 __const char *__restrict __format, ...))
282 __attribute__ ((__format__ (__printf__, 3, 4)));
284 extern int __vsnprintf __P ((char *__restrict __s, size_t __maxlen,
285 __const char *__restrict __format,
286 _G_va_list __arg))
287 __attribute__ ((__format__ (__printf__, 3, 0)));
288 extern int vsnprintf __P ((char *__restrict __s, size_t __maxlen,
289 __const char *__restrict __format,
290 _G_va_list __arg))
291 __attribute__ ((__format__ (__printf__, 3, 0)));
292 #endif
294 #ifdef __USE_GNU
295 /* Write formatted output to a string dynamically allocated with `malloc'.
296 Store the address of the string in *PTR. */
297 extern int vasprintf __P ((char **__restrict __ptr,
298 __const char *__restrict __f, _G_va_list __arg))
299 __attribute__ ((__format__ (__printf__, 2, 0)));
300 extern int __asprintf __P ((char **__restrict __ptr,
301 __const char *__restrict __fmt, ...))
302 __attribute__ ((__format__ (__printf__, 2, 3)));
303 extern int asprintf __P ((char **__restrict __ptr,
304 __const char *__restrict __fmt, ...))
305 __attribute__ ((__format__ (__printf__, 2, 3)));
307 /* Write formatted output to a file descriptor. */
308 extern int vdprintf __P ((int __fd, __const char *__restrict __fmt,
309 _G_va_list __arg))
310 __attribute__ ((__format__ (__printf__, 2, 0)));
311 extern int dprintf __P ((int __fd, __const char *__restrict __fmt, ...))
312 __attribute__ ((__format__ (__printf__, 2, 3)));
313 #endif
316 /* Read formatted input from STREAM. */
317 extern int fscanf __P ((FILE *__restrict __stream,
318 __const char *__restrict __format, ...));
319 /* Read formatted input from stdin. */
320 extern int scanf __P ((__const char *__restrict __format, ...));
321 /* Read formatted input from S. */
322 extern int sscanf __P ((__const char *__restrict __s,
323 __const char *__restrict __format, ...));
325 #ifdef __USE_ISOC9X
326 /* Read formatted input from S into argument list ARG. */
327 extern int vfscanf __P ((FILE *__restrict __s,
328 __const char *__restrict __format,
329 _G_va_list __arg))
330 __attribute__ ((__format__ (__scanf__, 2, 0)));
332 /* Read formatted input from stdin into argument list ARG. */
333 extern int vscanf __P ((__const char *__restrict __format, _G_va_list __arg))
334 __attribute__ ((__format__ (__scanf__, 1, 0)));
336 /* Read formatted input from S into argument list ARG. */
337 extern int vsscanf __P ((__const char *__restrict __s,
338 __const char *__restrict __format,
339 _G_va_list __arg))
340 __attribute__ ((__format__ (__scanf__, 2, 0)));
341 #endif /* Use ISO C9x. */
344 /* Read a character from STREAM. */
345 extern int fgetc __P ((FILE *__stream));
346 extern int getc __P ((FILE *__stream));
348 /* Read a character from stdin. */
349 extern int getchar __P ((void));
351 /* The C standard explicitly says this is a macro, so we always do the
352 optimization for it. */
353 #define getc(_fp) _IO_getc (_fp)
355 #ifdef __USE_EXTERN_INLINES
356 __STDIO_INLINE int
357 getchar (void) __THROW
359 return _IO_getc (stdin);
361 #endif /* Use extern inlines. */
363 #if defined __USE_POSIX || defined __USE_MISC
364 /* These are defined in POSIX.1:1996. */
365 extern int getc_unlocked __P ((FILE *__stream));
366 extern int getchar_unlocked __P ((void));
368 # ifdef __USE_EXTERN_INLINES
369 __STDIO_INLINE int
370 getc_unlocked (FILE *__fp) __THROW
372 return _IO_getc_unlocked (__fp);
375 __STDIO_INLINE int
376 getchar_unlocked (void) __THROW
378 return _IO_getc_unlocked (stdin);
380 # endif /* Use extern inlines. */
381 #endif /* Use POSIX or MISC. */
384 /* Write a character to STREAM. */
385 extern int fputc __P ((int __c, FILE *__stream));
386 extern int putc __P ((int __c, FILE *__stream));
388 /* Write a character to stdout. */
389 extern int putchar __P ((int __c));
391 /* The C standard explicitly says this can be a macro,
392 so we always do the optimization for it. */
393 #define putc(_ch, _fp) _IO_putc (_ch, _fp)
395 #ifdef __USE_EXTERN_INLINES
396 __STDIO_INLINE int
397 putchar (int __c) __THROW
399 return _IO_putc (__c, stdout);
401 #endif /* Use extern inlines. */
403 #ifdef __USE_MISC
404 /* Faster version when locking is not necessary. */
405 extern int fputc_unlocked __P ((int __c, FILE *__stream));
407 # ifdef __USE_EXTERN_INLINES
408 __STDIO_INLINE int
409 fputc_unlocked (int __c, FILE *__stream) __THROW
411 return _IO_putc_unlocked (__c, __stream);
413 # endif /* Use extern inlines. */
414 #endif /* Use MISC. */
416 #if defined __USE_POSIX || defined __USE_MISC
417 /* These are defined in POSIX.1:1996. */
418 extern int putc_unlocked __P ((int __c, FILE *__stream));
419 extern int putchar_unlocked __P ((int __c));
421 # ifdef __USE_EXTERN_INLINES
422 __STDIO_INLINE int
423 putc_unlocked (int __c, FILE *__stream) __THROW
425 return _IO_putc_unlocked (__c, __stream);
428 __STDIO_INLINE int
429 putchar_unlocked (int __c) __THROW
431 return _IO_putc_unlocked (__c, stdout);
433 # endif /* Use extern inlines. */
434 #endif /* Use POSIX or MISC. */
437 #if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
438 /* Get a word (int) from STREAM. */
439 extern int getw __P ((FILE *__stream));
441 /* Write a word (int) to STREAM. */
442 extern int putw __P ((int __w, FILE *__stream));
443 #endif
446 /* Get a newline-terminated string of finite length from STREAM. */
447 extern char *fgets __P ((char *__restrict __s, int __n,
448 FILE *__restrict __stream));
450 #ifdef __USE_GNU
451 /* This function does the same as `fgets' but does not lock the stream. */
452 extern char *fgets_unlocked __P ((char *__restrict __s, int __n,
453 FILE *__restrict __stream));
454 #endif
456 /* Get a newline-terminated string from stdin, removing the newline.
457 DO NOT USE THIS FUNCTION!! There is no limit on how much it will read. */
458 extern char *gets __P ((char *__s));
461 #ifdef __USE_GNU
462 /* Read up to (and including) a DELIMITER from STREAM into *LINEPTR
463 (and null-terminate it). *LINEPTR is a pointer returned from malloc (or
464 NULL), pointing to *N characters of space. It is realloc'd as
465 necessary. Returns the number of characters read (not including the
466 null terminator), or -1 on error or EOF. */
467 extern _IO_ssize_t __getdelim __P ((char **__lineptr, size_t *__n,
468 int __delimiter, FILE *__stream));
469 extern _IO_ssize_t getdelim __P ((char **__lineptr, size_t *__n,
470 int __delimiter, FILE *__stream));
472 /* Like `getdelim', but reads up to a newline. */
473 extern _IO_ssize_t getline __P ((char **__lineptr, size_t *__n,
474 FILE *__stream));
476 # ifdef __USE_EXTERN_INLINES
477 __STDIO_INLINE _IO_ssize_t
478 getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW
480 return __getdelim (__lineptr, __n, '\n', __stream);
482 # endif /* Use extern inlines. */
483 #endif
486 /* Write a string to STREAM. */
487 extern int fputs __P ((__const char *__restrict __s,
488 FILE *__restrict __stream));
490 #ifdef __USE_GNU
491 /* This function does the same as `fputs' but does not lock the stream. */
492 extern int fputs_unlocked __P ((__const char *__restrict __s,
493 FILE *__restrict __stream));
494 #endif
496 /* Write a string, followed by a newline, to stdout. */
497 extern int puts __P ((__const char *__s));
500 /* Push a character back onto the input buffer of STREAM. */
501 extern int ungetc __P ((int __c, FILE *__stream));
504 /* Read chunks of generic data from STREAM. */
505 extern size_t fread __P ((void *__restrict __ptr, size_t __size,
506 size_t __n, FILE *__restrict __stream));
507 /* Write chunks of generic data to STREAM. */
508 extern size_t fwrite __P ((__const void *__restrict __ptr, size_t __size,
509 size_t __n, FILE *__restrict __s));
511 #ifdef __USE_MISC
512 /* Faster versions when locking is not necessary. */
513 extern size_t fread_unlocked __P ((void *__restrict __ptr, size_t __size,
514 size_t __n, FILE *__restrict __stream));
515 extern size_t fwrite_unlocked __P ((__const void *__restrict __ptr,
516 size_t __size, size_t __n,
517 FILE *__restrict __stream));
518 #endif
521 /* Seek to a certain position on STREAM. */
522 extern int fseek __P ((FILE *__stream, long int __off, int __whence));
523 /* Return the current position of STREAM. */
524 extern long int ftell __P ((FILE *__stream));
525 /* Rewind to the beginning of STREAM. */
526 extern void rewind __P ((FILE *__stream));
528 /* The Single Unix Specification, Version 2, specifies an alternative,
529 more adequate interface for the two functions above which deal with
530 file offset. `long int' is not the right type. These definitions
531 are originally defined in the Large File Support API. */
533 /* Types needed in these functions. */
534 #ifndef off_t
535 # ifndef __USE_FILE_OFFSET64
536 typedef __off_t off_t;
537 # else
538 typedef __off64_t off_t;
539 # endif
540 # define off_t off_t
541 #endif
543 #if defined __USE_LARGEFILE64 && !defined off64_t
544 typedef __off64_t off64_t;
545 # define off64_t off64_t
546 #endif
549 #ifndef __USE_FILE_OFFSET64
550 # ifdef __USE_UNIX98
551 /* Seek to a certain position on STREAM. */
552 extern int fseeko __P ((FILE *__stream, __off_t __off, int __whence));
553 /* Return the current position of STREAM. */
554 extern __off_t ftello __P ((FILE *__stream));
555 # endif
557 /* Get STREAM's position. */
558 extern int fgetpos __P ((FILE *__restrict __stream,
559 fpos_t *__restrict __pos));
560 /* Set STREAM's position. */
561 extern int fsetpos __P ((FILE *__stream, __const fpos_t *__pos));
562 #else
563 # ifdef __REDIRECT
564 # ifdef __USE_UNIX98
565 extern int __REDIRECT (fseeko,
566 __P ((FILE *__stream, __off64_t __off, int __whence)),
567 fseeko64);
568 extern __off64_t __REDIRECT (ftello, __P ((FILE *__stream)), ftello64);
569 # endif
570 extern int __REDIRECT (fgetpos, __P ((FILE *__restrict __stream,
571 fpos_t *__restrict __pos)), fgetpos64);
572 extern int __REDIRECT (fsetpos, __P ((FILE *__stream, __const fpos_t *__pos)),
573 fsetpos64);
574 # else
575 # ifdef __USE_UNIX98
576 # define fseeko fseeko64
577 # define ftello ftello64
578 # endif
579 # define fgetpos fgetpos64
580 # define fsetpos fsetpos64
581 # endif
582 #endif
584 #ifdef __USE_LARGEFILE64
585 # ifdef __USE_UNIX98
586 extern int fseeko64 __P ((FILE *__stream, __off64_t __off, int __whence));
587 extern __off64_t ftello64 __P ((FILE *__stream));
588 # endif
589 extern int fgetpos64 __P ((FILE *__restrict __stream,
590 fpos64_t *__restrict __pos));
591 extern int fsetpos64 __P ((FILE *__stream, __const fpos64_t *__pos));
592 #endif
594 /* Clear the error and EOF indicators for STREAM. */
595 extern void clearerr __P ((FILE *__stream));
596 /* Return the EOF indicator for STREAM. */
597 extern int feof __P ((FILE *__stream));
598 /* Return the error indicator for STREAM. */
599 extern int ferror __P ((FILE *__stream));
601 #ifdef __USE_MISC
602 /* Faster versions when locking is not required. */
603 extern void clearerr_unlocked __P ((FILE *__stream));
604 extern int feof_unlocked __P ((FILE *__stream));
605 extern int ferror_unlocked __P ((FILE *__stream));
607 # ifdef __USE_EXTERN_INLINES
608 __STDIO_INLINE int
609 feof_unlocked (FILE *__stream) __THROW
611 return _IO_feof_unlocked (__stream);
614 __STDIO_INLINE int
615 ferror_unlocked (FILE *__stream) __THROW
617 return _IO_ferror_unlocked (__stream);
619 # endif /* Use extern inlines. */
620 #endif
623 /* Print a message describing the meaning of the value of errno. */
624 extern void perror __P ((__const char *__s));
626 /* These variables normally should not be used directly. The `strerror'
627 function provides all the needed functionality. */
628 #ifdef __USE_BSD
629 extern int sys_nerr;
630 extern __const char *__const sys_errlist[];
631 #endif
632 #ifdef __USE_GNU
633 extern int _sys_nerr;
634 extern __const char *__const _sys_errlist[];
635 #endif
638 #ifdef __USE_POSIX
639 /* Return the system file descriptor for STREAM. */
640 extern int fileno __P ((FILE *__stream));
641 #endif /* Use POSIX. */
643 #ifdef __USE_MISC
644 /* Faster version when locking is not required. */
645 extern int fileno_unlocked __P ((FILE *__stream));
646 #endif
649 #if (defined __USE_POSIX2 || defined __USE_SVID || defined __USE_BSD || \
650 defined __USE_MISC)
651 /* Create a new stream connected to a pipe running the given command. */
652 extern FILE *popen __P ((__const char *__command, __const char *__modes));
654 /* Close a stream opened by popen and return the status of its child. */
655 extern int pclose __P ((FILE *__stream));
656 #endif
659 #ifdef __USE_POSIX
660 /* Return the name of the controlling terminal. */
661 extern char *ctermid __P ((char *__s));
662 #endif /* Use POSIX. */
665 #ifdef __USE_XOPEN
666 /* Return the name of the current user. */
667 extern char *cuserid __P ((char *__s));
668 #endif /* Use X/Open. */
671 #ifdef __USE_GNU
672 struct obstack; /* See <obstack.h>. */
674 /* Write formatted output to an obstack. */
675 extern int obstack_printf __P ((struct obstack *__obstack,
676 __const char *__format, ...));
677 extern int obstack_vprintf __P ((struct obstack *__obstack,
678 __const char *__format,
679 _G_va_list __args));
680 #endif /* Use GNU. */
683 #if defined __USE_POSIX || defined __USE_MISC
684 /* These are defined in POSIX.1:1996. */
686 /* Acquire ownership of STREAM. */
687 extern void flockfile __P ((FILE *__stream));
689 /* Try to acquire ownership of STREAM but do not block if it is not
690 possible. */
691 extern int ftrylockfile __P ((FILE *__stream));
693 /* Relinquish the ownership granted for STREAM. */
694 extern void funlockfile __P ((FILE *__stream));
695 #endif /* POSIX || misc */
697 #if defined __USE_XOPEN && !defined __USE_GNU
698 /* The X/Open standard requires some functions and variables to be
699 declared here which do not belong into this header. But we have to
700 follow. In GNU mode we don't do this nonsense. */
701 # define __need_getopt
702 # include <getopt.h>
703 #endif
705 __END_DECLS
707 /* Define helper macro. */
708 #undef __STDIO_INLINE
710 #endif /* <stdio.h> included. */
712 #endif /* !_STDIO_H */