~ubuntu-branches/ubuntu/trusty/gnutls26/trusty

« back to all changes in this revision

Viewing changes to lib/gl/stdio.in.h

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-10-01 15:28:13 UTC
  • mfrom: (12.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20111001152813-yygm1c4cxonfxhzy
* New upstream version.
  + Allow CA importing of 0 certificates to succeed. Closes: #640639
* Add libp11-kit-dev to libgnutls-dev dependencies. (see #643811)
* [20_guiledocstring.diff] guile: Fix docstring extraction with CPP 4.5+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* A GNU-like <stdio.h>.
2
2
 
3
 
   Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
 
3
   Copyright (C) 2004, 2007-2011 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify
6
6
   it under the terms of the GNU Lesser General Public License as published by
19
19
#if __GNUC__ >= 3
20
20
@PRAGMA_SYSTEM_HEADER@
21
21
#endif
 
22
@PRAGMA_COLUMNS@
22
23
 
23
 
#if defined __need_FILE || defined __need___FILE
24
 
/* Special invocation convention inside glibc header files.  */
 
24
#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
 
25
/* Special invocation convention:
 
26
   - Inside glibc header files.
 
27
   - On OSF/1 5.1 we have a sequence of nested includes
 
28
     <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
 
29
     <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
 
30
     In this situation, the functions are not yet declared, therefore we cannot
 
31
     provide the C++ aliases.  */
25
32
 
26
33
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
27
34
 
28
35
#else
29
36
/* Normal invocation convention.  */
30
37
 
31
 
#ifndef _GL_STDIO_H
 
38
#ifndef _@GUARD_PREFIX@_STDIO_H
 
39
 
 
40
#define _GL_ALREADY_INCLUDING_STDIO_H
32
41
 
33
42
/* The include_next requires a split double-inclusion guard.  */
34
43
#@INCLUDE_NEXT@ @NEXT_STDIO_H@
35
44
 
36
 
#ifndef _GL_STDIO_H
37
 
#define _GL_STDIO_H
 
45
#undef _GL_ALREADY_INCLUDING_STDIO_H
 
46
 
 
47
#ifndef _@GUARD_PREFIX@_STDIO_H
 
48
#define _@GUARD_PREFIX@_STDIO_H
38
49
 
39
50
/* Get va_list.  Needed on many systems, including glibc 2.8.  */
40
51
#include <stdarg.h>
41
52
 
42
53
#include <stddef.h>
43
54
 
44
 
/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8.  */
 
55
/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
 
56
   and eglibc 2.11.2.  */
45
57
#include <sys/types.h>
46
58
 
47
 
#ifndef __attribute__
48
59
/* The __attribute__ feature is available in gcc versions 2.5 and later.
49
60
   The __-protected variants of the attributes 'format' and 'printf' are
50
61
   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
51
 
   We enable __attribute__ only if these are supported too, because
 
62
   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
52
63
   gnulib and libintl do '#define printf __printf__' when they override
53
64
   the 'printf' function.  */
54
 
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
55
 
#  define __attribute__(Spec)   /* empty */
56
 
# endif
 
65
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
 
66
# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
 
67
#else
 
68
# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 
69
#endif
 
70
 
 
71
/* _GL_ATTRIBUTE_FORMAT_PRINTF
 
72
   indicates to GCC that the function takes a format string and arguments,
 
73
   where the format string directives are the ones standardized by ISO C99
 
74
   and POSIX.  */
 
75
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
 
76
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
 
77
   _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
 
78
#else
 
79
# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
 
80
   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
 
81
#endif
 
82
 
 
83
/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
 
84
   except that it indicates to GCC that the supported format string directives
 
85
   are the ones of the system printf(), rather than the ones standardized by
 
86
   ISO C99 and POSIX.  */
 
87
#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
 
88
  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
 
89
 
 
90
/* _GL_ATTRIBUTE_FORMAT_SCANF
 
91
   indicates to GCC that the function takes a format string and arguments,
 
92
   where the format string directives are the ones standardized by ISO C99
 
93
   and POSIX.  */
 
94
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
 
95
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
 
96
   _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
 
97
#else
 
98
# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
 
99
   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
 
100
#endif
 
101
 
 
102
/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
 
103
   except that it indicates to GCC that the supported format string directives
 
104
   are the ones of the system scanf(), rather than the ones standardized by
 
105
   ISO C99 and POSIX.  */
 
106
#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
 
107
  _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
 
108
 
 
109
/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
 
110
/* But in any case avoid namespace pollution on glibc systems.  */
 
111
#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
 
112
    && ! defined __GLIBC__
 
113
# include <unistd.h>
57
114
#endif
58
115
 
59
116
 
74
131
#   define dprintf rpl_dprintf
75
132
#  endif
76
133
_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
77
 
                                __attribute__ ((__format__ (__printf__, 2, 3)))
 
134
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
78
135
                                _GL_ARG_NONNULL ((2)));
79
136
_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
80
137
# else
81
138
#  if !@HAVE_DPRINTF@
82
139
_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
83
 
                                __attribute__ ((__format__ (__printf__, 2, 3)))
 
140
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
84
141
                                _GL_ARG_NONNULL ((2)));
85
142
#  endif
86
143
_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
137
194
                 "use gnulib module fflush for portable POSIX compliance");
138
195
#endif
139
196
 
140
 
/* It is very rare that the developer ever has full control of stdin,
141
 
   so any use of gets warrants an unconditional warning.  Assume it is
142
 
   always declared, since it is required by C89.  */
143
 
#undef gets
144
 
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 
197
#if @GNULIB_FGETC@
 
198
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
199
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
200
#   undef fgetc
 
201
#   define fgetc rpl_fgetc
 
202
#  endif
 
203
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
 
204
_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
 
205
# else
 
206
_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
 
207
# endif
 
208
_GL_CXXALIASWARN (fgetc);
 
209
#endif
 
210
 
 
211
#if @GNULIB_FGETS@
 
212
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
213
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
214
#   undef fgets
 
215
#   define fgets rpl_fgets
 
216
#  endif
 
217
_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
 
218
                                 _GL_ARG_NONNULL ((1, 3)));
 
219
_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
 
220
# else
 
221
_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
 
222
# endif
 
223
_GL_CXXALIASWARN (fgets);
 
224
#endif
145
225
 
146
226
#if @GNULIB_FOPEN@
147
227
# if @REPLACE_FOPEN@
165
245
 
166
246
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
167
247
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
168
 
     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
 
248
     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
169
249
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
170
250
#   define fprintf rpl_fprintf
171
251
#  endif
172
252
#  define GNULIB_overrides_fprintf 1
173
 
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
174
 
                                __attribute__ ((__format__ (__printf__, 2, 3)))
175
 
                                _GL_ARG_NONNULL ((1, 2)));
 
253
#  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 
254
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
 
255
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
 
256
                                _GL_ARG_NONNULL ((1, 2)));
 
257
#  else
 
258
_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
 
259
                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
 
260
                                _GL_ARG_NONNULL ((1, 2)));
 
261
#  endif
176
262
_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
177
263
# else
178
264
_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
218
304
#endif
219
305
 
220
306
#if @GNULIB_FPUTC@
221
 
# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
 
307
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
222
308
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
223
309
#   undef fputc
224
310
#   define fputc rpl_fputc
232
318
#endif
233
319
 
234
320
#if @GNULIB_FPUTS@
235
 
# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
 
321
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
236
322
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
237
323
#   undef fputs
238
324
#   define fputs rpl_fputs
246
332
_GL_CXXALIASWARN (fputs);
247
333
#endif
248
334
 
 
335
#if @GNULIB_FREAD@
 
336
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
337
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
338
#   undef fread
 
339
#   define fread rpl_fread
 
340
#  endif
 
341
_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
 
342
                                 _GL_ARG_NONNULL ((4)));
 
343
_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
 
344
# else
 
345
_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
 
346
# endif
 
347
_GL_CXXALIASWARN (fread);
 
348
#endif
 
349
 
249
350
#if @GNULIB_FREOPEN@
250
351
# if @REPLACE_FREOPEN@
251
352
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
265
366
#elif defined GNULIB_POSIXCHECK
266
367
# undef freopen
267
368
/* Assume freopen is always declared.  */
268
 
_GL_WARN_ON_USE (freopen, "freopen on Win32 platforms is not POSIX compatible - "
 
369
_GL_WARN_ON_USE (freopen,
 
370
                 "freopen on Win32 platforms is not POSIX compatible - "
269
371
                 "use gnulib module freopen for portability");
270
372
#endif
271
373
 
 
374
#if @GNULIB_FSCANF@
 
375
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
376
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
377
#   undef fscanf
 
378
#   define fscanf rpl_fscanf
 
379
#  endif
 
380
_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
 
381
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
 
382
                               _GL_ARG_NONNULL ((1, 2)));
 
383
_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
 
384
# else
 
385
_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
 
386
# endif
 
387
_GL_CXXALIASWARN (fscanf);
 
388
#endif
 
389
 
272
390
 
273
391
/* Set up the following warnings, based on which modules are in use.
274
392
   GNU Coding Standards discourage the use of fseek, since it imposes
336
454
                               _GL_ARG_NONNULL ((1)));
337
455
_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
338
456
# else
339
 
#  if ! @HAVE_FSEEKO@
 
457
#  if ! @HAVE_DECL_FSEEKO@
340
458
_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
341
459
                               _GL_ARG_NONNULL ((1)));
342
460
#  endif
343
461
_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
344
462
# endif
345
463
_GL_CXXALIASWARN (fseeko);
346
 
# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
347
 
   /* Provide an fseek function that is consistent with fseeko.  */
348
 
   /* In order to avoid that fseek gets defined as a macro here, the
349
 
      developer can request the 'fseek' module.  */
350
 
#  undef fseek
351
 
#  define fseek rpl_fseek
352
 
static inline int _GL_ARG_NONNULL ((1))
353
 
rpl_fseek (FILE *fp, long offset, int whence)
354
 
{
355
 
#  if @REPLACE_FSEEKO@
356
 
  return rpl_fseeko (fp, offset, whence);
357
 
#  else
358
 
  return fseeko (fp, offset, whence);
359
 
#  endif
360
 
}
361
 
# endif
362
464
#elif defined GNULIB_POSIXCHECK
363
465
# define _GL_FSEEK_WARN /* Category 1, above.  */
364
466
# undef fseek
412
514
_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
413
515
_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
414
516
# else
415
 
#  if ! @HAVE_FTELLO@
 
517
#  if ! @HAVE_DECL_FTELLO@
416
518
_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
417
519
#  endif
418
520
_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
419
521
# endif
420
522
_GL_CXXALIASWARN (ftello);
421
 
# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
422
 
   /* Provide an ftell function that is consistent with ftello.  */
423
 
   /* In order to avoid that ftell gets defined as a macro here, the
424
 
      developer can request the 'ftell' module.  */
425
 
#  undef ftell
426
 
#  define ftell rpl_ftell
427
 
static inline long _GL_ARG_NONNULL ((1))
428
 
rpl_ftell (FILE *f)
429
 
{
430
 
#  if @REPLACE_FTELLO@
431
 
  return rpl_ftello (f);
432
 
#  else
433
 
  return ftello (f);
434
 
#  endif
435
 
}
436
 
# endif
437
523
#elif defined GNULIB_POSIXCHECK
438
524
# define _GL_FTELL_WARN /* Category 1, above.  */
439
525
# undef ftell
455
541
 
456
542
 
457
543
#if @GNULIB_FWRITE@
458
 
# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
 
544
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
459
545
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
460
546
#   undef fwrite
461
547
#   define fwrite rpl_fwrite
468
554
# else
469
555
_GL_CXXALIAS_SYS (fwrite, size_t,
470
556
                  (const void *ptr, size_t s, size_t n, FILE *stream));
 
557
 
 
558
/* Work around glibc bug 11959
 
559
   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
 
560
   which sometimes causes an unwanted diagnostic for fwrite calls.
 
561
   This affects only function declaration attributes, so it's not
 
562
   needed for C++.  */
 
563
#  if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
 
564
static inline size_t _GL_ARG_NONNULL ((1, 4))
 
565
rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
 
566
{
 
567
  size_t r = fwrite (ptr, s, n, stream);
 
568
  (void) r;
 
569
  return r;
 
570
}
 
571
#   undef fwrite
 
572
#   define fwrite rpl_fwrite
 
573
#  endif
471
574
# endif
472
575
_GL_CXXALIASWARN (fwrite);
473
576
#endif
474
577
 
 
578
#if @GNULIB_GETC@
 
579
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
580
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
581
#   undef getc
 
582
#   define getc rpl_fgetc
 
583
#  endif
 
584
_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
 
585
_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
 
586
# else
 
587
_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
 
588
# endif
 
589
_GL_CXXALIASWARN (getc);
 
590
#endif
 
591
 
 
592
#if @GNULIB_GETCHAR@
 
593
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
594
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
595
#   undef getchar
 
596
#   define getchar rpl_getchar
 
597
#  endif
 
598
_GL_FUNCDECL_RPL (getchar, int, (void));
 
599
_GL_CXXALIAS_RPL (getchar, int, (void));
 
600
# else
 
601
_GL_CXXALIAS_SYS (getchar, int, (void));
 
602
# endif
 
603
_GL_CXXALIASWARN (getchar);
 
604
#endif
 
605
 
475
606
#if @GNULIB_GETDELIM@
476
607
/* Read input, up to (and including) the next occurrence of DELIMITER, from
477
608
   STREAM, store it in *LINEPTR (and NUL-terminate it).
548
679
# endif
549
680
#endif
550
681
 
 
682
#if @GNULIB_GETS@
 
683
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
684
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
685
#   undef gets
 
686
#   define gets rpl_gets
 
687
#  endif
 
688
_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
 
689
_GL_CXXALIAS_RPL (gets, char *, (char *s));
 
690
# else
 
691
_GL_CXXALIAS_SYS (gets, char *, (char *s));
 
692
#  undef gets
 
693
# endif
 
694
_GL_CXXALIASWARN (gets);
 
695
/* It is very rare that the developer ever has full control of stdin,
 
696
   so any use of gets warrants an unconditional warning.  Assume it is
 
697
   always declared, since it is required by C89.  */
 
698
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 
699
#endif
 
700
 
 
701
 
551
702
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
552
703
struct obstack;
553
704
/* Grow an obstack with formatted output.  Return the number of
561
712
#  endif
562
713
_GL_FUNCDECL_RPL (obstack_printf, int,
563
714
                  (struct obstack *obs, const char *format, ...)
564
 
                  __attribute__ ((__format__ (__printf__, 2, 3)))
 
715
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
565
716
                  _GL_ARG_NONNULL ((1, 2)));
566
717
_GL_CXXALIAS_RPL (obstack_printf, int,
567
718
                  (struct obstack *obs, const char *format, ...));
569
720
#  if !@HAVE_DECL_OBSTACK_PRINTF@
570
721
_GL_FUNCDECL_SYS (obstack_printf, int,
571
722
                  (struct obstack *obs, const char *format, ...)
572
 
                  __attribute__ ((__format__ (__printf__, 2, 3)))
 
723
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
573
724
                  _GL_ARG_NONNULL ((1, 2)));
574
725
#  endif
575
726
_GL_CXXALIAS_SYS (obstack_printf, int,
582
733
#  endif
583
734
_GL_FUNCDECL_RPL (obstack_vprintf, int,
584
735
                  (struct obstack *obs, const char *format, va_list args)
585
 
                  __attribute__ ((__format__ (__printf__, 2, 0)))
 
736
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
586
737
                  _GL_ARG_NONNULL ((1, 2)));
587
738
_GL_CXXALIAS_RPL (obstack_vprintf, int,
588
739
                  (struct obstack *obs, const char *format, va_list args));
590
741
#  if !@HAVE_DECL_OBSTACK_PRINTF@
591
742
_GL_FUNCDECL_SYS (obstack_vprintf, int,
592
743
                  (struct obstack *obs, const char *format, va_list args)
593
 
                  __attribute__ ((__format__ (__printf__, 2, 0)))
 
744
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
594
745
                  _GL_ARG_NONNULL ((1, 2)));
595
746
#  endif
596
747
_GL_CXXALIAS_SYS (obstack_vprintf, int,
643
794
 
644
795
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
645
796
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
646
 
     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
 
797
     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
647
798
#  if defined __GNUC__
648
799
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
649
800
/* Don't break __attribute__((format(printf,M,N))).  */
650
801
#    define printf __printf__
651
802
#   endif
652
 
_GL_FUNCDECL_RPL_1 (__printf__, int,
653
 
                    (const char *format, ...)
654
 
                    __asm__ (@ASM_SYMBOL_PREFIX@
655
 
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
656
 
                    __attribute__ ((__format__ (__printf__, 1, 2)))
657
 
                    _GL_ARG_NONNULL ((1)));
 
803
#   if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 
804
_GL_FUNCDECL_RPL_1 (__printf__, int,
 
805
                    (const char *format, ...)
 
806
                    __asm__ (@ASM_SYMBOL_PREFIX@
 
807
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
 
808
                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
 
809
                    _GL_ARG_NONNULL ((1)));
 
810
#   else
 
811
_GL_FUNCDECL_RPL_1 (__printf__, int,
 
812
                    (const char *format, ...)
 
813
                    __asm__ (@ASM_SYMBOL_PREFIX@
 
814
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
 
815
                    _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
 
816
                    _GL_ARG_NONNULL ((1)));
 
817
#   endif
658
818
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
659
819
#  else
 
820
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
821
#    define printf rpl_printf
 
822
#   endif
660
823
_GL_FUNCDECL_RPL (printf, int,
661
824
                  (const char *format, ...)
662
 
                  __attribute__ ((__format__ (__printf__, 1, 2)))
 
825
                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
663
826
                  _GL_ARG_NONNULL ((1)));
664
 
_GL_CXXALIAS_RPL (printf, printf, int, (const char *format, ...));
 
827
_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
665
828
#  endif
666
829
#  define GNULIB_overrides_printf 1
667
830
# else
680
843
#endif
681
844
 
682
845
#if @GNULIB_PUTC@
683
 
# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
 
846
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
684
847
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
685
848
#   undef putc
686
849
#   define putc rpl_fputc
694
857
#endif
695
858
 
696
859
#if @GNULIB_PUTCHAR@
697
 
# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
 
860
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
698
861
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
699
862
#   undef putchar
700
863
#   define putchar rpl_putchar
708
871
#endif
709
872
 
710
873
#if @GNULIB_PUTS@
711
 
# if @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
 
874
# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
712
875
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
713
876
#   undef puts
714
877
#   define puts rpl_puts
792
955
# endif
793
956
#endif
794
957
 
 
958
#if @GNULIB_SCANF@
 
959
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
960
#  if defined __GNUC__
 
961
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
962
#    undef scanf
 
963
/* Don't break __attribute__((format(scanf,M,N))).  */
 
964
#    define scanf __scanf__
 
965
#   endif
 
966
_GL_FUNCDECL_RPL_1 (__scanf__, int,
 
967
                    (const char *format, ...)
 
968
                    __asm__ (@ASM_SYMBOL_PREFIX@
 
969
                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
 
970
                    _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
 
971
                    _GL_ARG_NONNULL ((1)));
 
972
_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
 
973
#  else
 
974
#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
975
#    undef scanf
 
976
#    define scanf rpl_scanf
 
977
#   endif
 
978
_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
 
979
                              _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
 
980
                              _GL_ARG_NONNULL ((1)));
 
981
_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
 
982
#  endif
 
983
# else
 
984
_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
 
985
# endif
 
986
_GL_CXXALIASWARN (scanf);
 
987
#endif
 
988
 
795
989
#if @GNULIB_SNPRINTF@
796
990
# if @REPLACE_SNPRINTF@
797
991
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
799
993
#  endif
800
994
_GL_FUNCDECL_RPL (snprintf, int,
801
995
                  (char *str, size_t size, const char *format, ...)
802
 
                  __attribute__ ((__format__ (__printf__, 3, 4)))
 
996
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
803
997
                  _GL_ARG_NONNULL ((3)));
804
998
_GL_CXXALIAS_RPL (snprintf, int,
805
999
                  (char *str, size_t size, const char *format, ...));
807
1001
#  if !@HAVE_DECL_SNPRINTF@
808
1002
_GL_FUNCDECL_SYS (snprintf, int,
809
1003
                  (char *str, size_t size, const char *format, ...)
810
 
                  __attribute__ ((__format__ (__printf__, 3, 4)))
 
1004
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
811
1005
                  _GL_ARG_NONNULL ((3)));
812
1006
#  endif
813
1007
_GL_CXXALIAS_SYS (snprintf, int,
837
1031
#   define sprintf rpl_sprintf
838
1032
#  endif
839
1033
_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
840
 
                                __attribute__ ((__format__ (__printf__, 2, 3)))
 
1034
                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
841
1035
                                _GL_ARG_NONNULL ((1, 2)));
842
1036
_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
843
1037
# else
882
1076
#  endif
883
1077
_GL_FUNCDECL_RPL (asprintf, int,
884
1078
                  (char **result, const char *format, ...)
885
 
                  __attribute__ ((__format__ (__printf__, 2, 3)))
 
1079
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
886
1080
                  _GL_ARG_NONNULL ((1, 2)));
887
1081
_GL_CXXALIAS_RPL (asprintf, int,
888
1082
                  (char **result, const char *format, ...));
890
1084
#  if !@HAVE_VASPRINTF@
891
1085
_GL_FUNCDECL_SYS (asprintf, int,
892
1086
                  (char **result, const char *format, ...)
893
 
                  __attribute__ ((__format__ (__printf__, 2, 3)))
 
1087
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
894
1088
                  _GL_ARG_NONNULL ((1, 2)));
895
1089
#  endif
896
1090
_GL_CXXALIAS_SYS (asprintf, int,
903
1097
#  endif
904
1098
_GL_FUNCDECL_RPL (vasprintf, int,
905
1099
                  (char **result, const char *format, va_list args)
906
 
                  __attribute__ ((__format__ (__printf__, 2, 0)))
 
1100
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
907
1101
                  _GL_ARG_NONNULL ((1, 2)));
908
1102
_GL_CXXALIAS_RPL (vasprintf, int,
909
1103
                  (char **result, const char *format, va_list args));
911
1105
#  if !@HAVE_VASPRINTF@
912
1106
_GL_FUNCDECL_SYS (vasprintf, int,
913
1107
                  (char **result, const char *format, va_list args)
914
 
                  __attribute__ ((__format__ (__printf__, 2, 0)))
 
1108
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
915
1109
                  _GL_ARG_NONNULL ((1, 2)));
916
1110
#  endif
917
1111
_GL_CXXALIAS_SYS (vasprintf, int,
926
1120
#   define vdprintf rpl_vdprintf
927
1121
#  endif
928
1122
_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
929
 
                                 __attribute__ ((__format__ (__printf__, 2, 0)))
 
1123
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
930
1124
                                 _GL_ARG_NONNULL ((2)));
931
1125
_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
932
1126
# else
933
1127
#  if !@HAVE_VDPRINTF@
934
1128
_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
935
 
                                 __attribute__ ((__format__ (__printf__, 2, 0)))
 
1129
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
936
1130
                                 _GL_ARG_NONNULL ((2)));
937
1131
#  endif
938
1132
/* Need to cast, because on Solaris, the third parameter will likely be
951
1145
 
952
1146
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
953
1147
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
954
 
     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
 
1148
     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
955
1149
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
956
1150
#   define vfprintf rpl_vfprintf
957
1151
#  endif
958
1152
#  define GNULIB_overrides_vfprintf 1
959
 
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
960
 
                                 __attribute__ ((__format__ (__printf__, 2, 0)))
961
 
                                 _GL_ARG_NONNULL ((1, 2)));
 
1153
#  if @GNULIB_VFPRINTF_POSIX@
 
1154
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
 
1155
                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
 
1156
                                 _GL_ARG_NONNULL ((1, 2)));
 
1157
#  else
 
1158
_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
 
1159
                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
 
1160
                                 _GL_ARG_NONNULL ((1, 2)));
 
1161
#  endif
962
1162
_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
963
1163
# else
964
1164
/* Need to cast, because on Solaris, the third parameter is
979
1179
                      "POSIX compliance");
980
1180
#endif
981
1181
 
 
1182
#if @GNULIB_VFSCANF@
 
1183
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
1184
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1185
#   undef vfscanf
 
1186
#   define vfscanf rpl_vfscanf
 
1187
#  endif
 
1188
_GL_FUNCDECL_RPL (vfscanf, int,
 
1189
                  (FILE *stream, const char *format, va_list args)
 
1190
                  _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
 
1191
                  _GL_ARG_NONNULL ((1, 2)));
 
1192
_GL_CXXALIAS_RPL (vfscanf, int,
 
1193
                  (FILE *stream, const char *format, va_list args));
 
1194
# else
 
1195
_GL_CXXALIAS_SYS (vfscanf, int,
 
1196
                  (FILE *stream, const char *format, va_list args));
 
1197
# endif
 
1198
_GL_CXXALIASWARN (vfscanf);
 
1199
#endif
 
1200
 
982
1201
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
983
1202
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
984
 
     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
 
1203
     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
985
1204
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
986
1205
#   define vprintf rpl_vprintf
987
1206
#  endif
988
1207
#  define GNULIB_overrides_vprintf 1
989
 
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
990
 
                                __attribute__ ((__format__ (__printf__, 1, 0)))
991
 
                                _GL_ARG_NONNULL ((1)));
 
1208
#  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 
1209
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
 
1210
                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
 
1211
                                _GL_ARG_NONNULL ((1)));
 
1212
#  else
 
1213
_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
 
1214
                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
 
1215
                                _GL_ARG_NONNULL ((1)));
 
1216
#  endif
992
1217
_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
993
1218
# else
994
1219
/* Need to cast, because on Solaris, the second parameter is
1008
1233
                 "POSIX compliance");
1009
1234
#endif
1010
1235
 
 
1236
#if @GNULIB_VSCANF@
 
1237
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
 
1238
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
1239
#   undef vscanf
 
1240
#   define vscanf rpl_vscanf
 
1241
#  endif
 
1242
_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
 
1243
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
 
1244
                               _GL_ARG_NONNULL ((1)));
 
1245
_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
 
1246
# else
 
1247
_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
 
1248
# endif
 
1249
_GL_CXXALIASWARN (vscanf);
 
1250
#endif
 
1251
 
1011
1252
#if @GNULIB_VSNPRINTF@
1012
1253
# if @REPLACE_VSNPRINTF@
1013
1254
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1015
1256
#  endif
1016
1257
_GL_FUNCDECL_RPL (vsnprintf, int,
1017
1258
                  (char *str, size_t size, const char *format, va_list args)
1018
 
                  __attribute__ ((__format__ (__printf__, 3, 0)))
 
1259
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1019
1260
                  _GL_ARG_NONNULL ((3)));
1020
1261
_GL_CXXALIAS_RPL (vsnprintf, int,
1021
1262
                  (char *str, size_t size, const char *format, va_list args));
1023
1264
#  if !@HAVE_DECL_VSNPRINTF@
1024
1265
_GL_FUNCDECL_SYS (vsnprintf, int,
1025
1266
                  (char *str, size_t size, const char *format, va_list args)
1026
 
                  __attribute__ ((__format__ (__printf__, 3, 0)))
 
1267
                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
1027
1268
                  _GL_ARG_NONNULL ((3)));
1028
1269
#  endif
1029
1270
_GL_CXXALIAS_SYS (vsnprintf, int,
1045
1286
#  endif
1046
1287
_GL_FUNCDECL_RPL (vsprintf, int,
1047
1288
                  (char *str, const char *format, va_list args)
1048
 
                  __attribute__ ((__format__ (__printf__, 2, 0)))
 
1289
                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
1049
1290
                  _GL_ARG_NONNULL ((1, 2)));
1050
1291
_GL_CXXALIAS_RPL (vsprintf, int,
1051
1292
                  (char *str, const char *format, va_list args));
1066
1307
#endif
1067
1308
 
1068
1309
 
1069
 
#endif /* _GL_STDIO_H */
1070
 
#endif /* _GL_STDIO_H */
 
1310
#endif /* _@GUARD_PREFIX@_STDIO_H */
 
1311
#endif /* _@GUARD_PREFIX@_STDIO_H */
1071
1312
#endif