Back to index

glibc  2.9
nldbl-compat.c
Go to the documentation of this file.
00001 /* *printf* family compatibility routines for IEEE double as long double
00002    Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #include <stdarg.h>
00022 #include <stdio.h>
00023 #include <libioP.h>
00024 #include <wchar.h>
00025 #include <printf.h>
00026 #include <monetary.h>
00027 #include <locale/localeinfo.h>
00028 #include <sys/syslog.h>
00029 #include <bits/libc-lock.h>
00030 
00031 #include "nldbl-compat.h"
00032 
00033 libc_hidden_proto (__nldbl_vfprintf)
00034 libc_hidden_proto (__nldbl_vsscanf)
00035 libc_hidden_proto (__nldbl_vsprintf)
00036 libc_hidden_proto (__nldbl_vfscanf)
00037 libc_hidden_proto (__nldbl_vfwscanf)
00038 libc_hidden_proto (__nldbl_vdprintf)
00039 libc_hidden_proto (__nldbl_vswscanf)
00040 libc_hidden_proto (__nldbl_vfwprintf)
00041 libc_hidden_proto (__nldbl_vswprintf)
00042 libc_hidden_proto (__nldbl_vsnprintf)
00043 libc_hidden_proto (__nldbl_vasprintf)
00044 libc_hidden_proto (__nldbl_obstack_vprintf)
00045 libc_hidden_proto (__nldbl___vfwprintf_chk)
00046 libc_hidden_proto (__nldbl___vsnprintf_chk)
00047 libc_hidden_proto (__nldbl___vfprintf_chk)
00048 libc_hidden_proto (__nldbl___vsyslog_chk)
00049 libc_hidden_proto (__nldbl___vsprintf_chk)
00050 libc_hidden_proto (__nldbl___vswprintf_chk)
00051 libc_hidden_proto (__nldbl___vasprintf_chk)
00052 libc_hidden_proto (__nldbl___vdprintf_chk)
00053 libc_hidden_proto (__nldbl___obstack_vprintf_chk)
00054 libc_hidden_proto (__nldbl___vstrfmon)
00055 libc_hidden_proto (__nldbl___vstrfmon_l)
00056 libc_hidden_proto (__nldbl___isoc99_vsscanf)
00057 libc_hidden_proto (__nldbl___isoc99_vfscanf)
00058 libc_hidden_proto (__nldbl___isoc99_vswscanf)
00059 libc_hidden_proto (__nldbl___isoc99_vfwscanf)
00060 
00061 static void
00062 __nldbl_cleanup (void *arg)
00063 {
00064   __no_long_double = 0;
00065 }
00066 
00067 #define set_no_long_double() \
00068   __libc_cleanup_push (__nldbl_cleanup, NULL); __no_long_double = 1
00069 #define clear_no_long_double() \
00070   __no_long_double = 0; __libc_cleanup_pop (0)
00071 
00072 /* Compatibility with IEEE double as long double.
00073    IEEE quad long double is used by default for most programs, so
00074    we don't need to split this into one file per function for the
00075    sake of statically linked programs.  */
00076 
00077 int
00078 attribute_compat_text_section
00079 __nldbl___asprintf (char **string_ptr, const char *fmt, ...)
00080 {
00081   va_list arg;
00082   int done;
00083 
00084   va_start (arg, fmt);
00085   done = __nldbl_vasprintf (string_ptr, fmt, arg);
00086   va_end (arg);
00087 
00088   return done;
00089 }
00090 weak_alias (__nldbl___asprintf, __nldbl_asprintf)
00091 
00092 int
00093 attribute_compat_text_section
00094 __nldbl_dprintf (int d, const char *fmt, ...)
00095 {
00096   va_list arg;
00097   int done;
00098 
00099   va_start (arg, fmt);
00100   done = __nldbl_vdprintf (d, fmt, arg);
00101   va_end (arg);
00102 
00103   return done;
00104 }
00105 
00106 int
00107 attribute_compat_text_section
00108 __nldbl_fprintf (FILE *stream, const char *fmt, ...)
00109 {
00110   va_list arg;
00111   int done;
00112 
00113   va_start (arg, fmt);
00114   done = __nldbl_vfprintf (stream, fmt, arg);
00115   va_end (arg);
00116 
00117   return done;
00118 }
00119 weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf)
00120 
00121 int
00122 attribute_compat_text_section weak_function
00123 __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
00124 {
00125   va_list arg;
00126   int done;
00127 
00128   va_start (arg, fmt);
00129   done = __nldbl_vfwprintf (stream, fmt, arg);
00130   va_end (arg);
00131 
00132   return done;
00133 }
00134 
00135 int
00136 attribute_compat_text_section
00137 __nldbl_printf (const char *fmt, ...)
00138 {
00139   va_list arg;
00140   int done;
00141 
00142   va_start (arg, fmt);
00143   done = __nldbl_vfprintf (stdout, fmt, arg);
00144   va_end (arg);
00145 
00146   return done;
00147 }
00148 strong_alias (__nldbl_printf, __nldbl__IO_printf)
00149 
00150 int
00151 attribute_compat_text_section
00152 __nldbl_sprintf (char *s, const char *fmt, ...)
00153 {
00154   va_list arg;
00155   int done;
00156 
00157   va_start (arg, fmt);
00158   done = __nldbl_vsprintf (s, fmt, arg);
00159   va_end (arg);
00160 
00161   return done;
00162 }
00163 strong_alias (__nldbl_sprintf, __nldbl__IO_sprintf)
00164 
00165 int
00166 attribute_compat_text_section
00167 __nldbl_vfprintf (FILE *s, const char *fmt, va_list ap)
00168 {
00169   int done;
00170   set_no_long_double ();
00171   done = INTUSE(_IO_vfprintf) (s, fmt, ap);
00172   clear_no_long_double ();
00173   return done;
00174 }
00175 libc_hidden_def (__nldbl_vfprintf)
00176 strong_alias (__nldbl_vfprintf, __nldbl__IO_vfprintf)
00177 
00178 int
00179 attribute_compat_text_section
00180 __nldbl__IO_vsprintf (char *string, const char *fmt, va_list ap)
00181 {
00182   int done;
00183   __no_long_double = 1;
00184   done = INTUSE(_IO_vsprintf) (string, fmt, ap);
00185   __no_long_double = 0;
00186   return done;
00187 }
00188 weak_alias (__nldbl__IO_vsprintf, __nldbl_vsprintf)
00189 libc_hidden_def (__nldbl_vsprintf)
00190 
00191 int
00192 attribute_compat_text_section
00193 __nldbl_obstack_vprintf (struct obstack *obstack, const char *fmt,
00194                       va_list ap)
00195 {
00196   int done;
00197   __no_long_double = 1;
00198   done = _IO_obstack_vprintf (obstack, fmt, ap);
00199   __no_long_double = 0;
00200   return done;
00201 }
00202 libc_hidden_def (__nldbl_obstack_vprintf)
00203 
00204 int
00205 attribute_compat_text_section
00206 __nldbl_obstack_printf (struct obstack *obstack, const char *fmt, ...)
00207 {
00208   int result;
00209   va_list ap;
00210   va_start (ap, fmt);
00211   result = __nldbl_obstack_vprintf (obstack, fmt, ap);
00212   va_end (ap);
00213   return result;
00214 }
00215 
00216 int
00217 attribute_compat_text_section weak_function
00218 __nldbl_snprintf (char *s, size_t maxlen, const char *fmt, ...)
00219 {
00220   va_list arg;
00221   int done;
00222 
00223   va_start (arg, fmt);
00224   done = __nldbl_vsnprintf (s, maxlen, fmt, arg);
00225   va_end (arg);
00226 
00227   return done;
00228 }
00229 
00230 int
00231 attribute_compat_text_section
00232 __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
00233 {
00234   va_list arg;
00235   int done;
00236 
00237   va_start (arg, fmt);
00238   done = __nldbl_vswprintf (s, n, fmt, arg);
00239   va_end (arg);
00240 
00241   return done;
00242 }
00243 
00244 int
00245 attribute_compat_text_section weak_function
00246 __nldbl_vasprintf (char **result_ptr, const char *fmt, va_list ap)
00247 {
00248   int res;
00249   __no_long_double = 1;
00250   res = _IO_vasprintf (result_ptr, fmt, ap);
00251   __no_long_double = 0;
00252   return res;
00253 }
00254 libc_hidden_def (__nldbl_vasprintf)
00255 
00256 int
00257 attribute_compat_text_section
00258 __nldbl_vdprintf (int d, const char *fmt, va_list arg)
00259 {
00260   int res;
00261   set_no_long_double ();
00262   res = _IO_vdprintf (d, fmt, arg);
00263   clear_no_long_double ();
00264   return res;
00265 }
00266 libc_hidden_def (__nldbl_vdprintf)
00267 
00268 int
00269 attribute_compat_text_section weak_function
00270 __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
00271 {
00272   int res;
00273   set_no_long_double ();
00274   res = _IO_vfwprintf (s, fmt, ap);
00275   clear_no_long_double ();
00276   return res;
00277 }
00278 libc_hidden_def (__nldbl_vfwprintf)
00279 
00280 int
00281 attribute_compat_text_section
00282 __nldbl_vprintf (const char *fmt, va_list ap)
00283 {
00284   return __nldbl_vfprintf (stdout, fmt, ap);
00285 }
00286 
00287 int
00288 attribute_compat_text_section
00289 __nldbl_vsnprintf (char *string, size_t maxlen, const char *fmt,
00290                  va_list ap)
00291 {
00292   int res;
00293   __no_long_double = 1;
00294   res = _IO_vsnprintf (string, maxlen, fmt, ap);
00295   __no_long_double = 0;
00296   return res;
00297 }
00298 libc_hidden_def (__nldbl_vsnprintf)
00299 weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf)
00300 
00301 int
00302 attribute_compat_text_section weak_function
00303 __nldbl_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *fmt,
00304                  va_list ap)
00305 {
00306   int res;
00307   __no_long_double = 1;
00308   res = _IO_vswprintf (string, maxlen, fmt, ap);
00309   __no_long_double = 0;
00310   return res;
00311 }
00312 libc_hidden_def (__nldbl_vswprintf)
00313 
00314 int
00315 attribute_compat_text_section
00316 __nldbl_vwprintf (const wchar_t *fmt, va_list ap)
00317 {
00318   return __nldbl_vfwprintf (stdout, fmt, ap);
00319 }
00320 
00321 int
00322 attribute_compat_text_section
00323 __nldbl_wprintf (const wchar_t *fmt, ...)
00324 {
00325   va_list arg;
00326   int done;
00327 
00328   va_start (arg, fmt);
00329   done = __nldbl_vfwprintf (stdout, fmt, arg);
00330   va_end (arg);
00331 
00332   return done;
00333 }
00334 
00335 int
00336 attribute_compat_text_section
00337 __nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
00338                   int *errp)
00339 {
00340   int res;
00341   set_no_long_double ();
00342   res = INTUSE(_IO_vfscanf) (s, fmt, ap, errp);
00343   clear_no_long_double ();
00344   return res;
00345 }
00346 
00347 int
00348 attribute_compat_text_section
00349 __nldbl___vfscanf (FILE *s, const char *fmt, va_list ap)
00350 {
00351   int res;
00352   set_no_long_double ();
00353   res = INTUSE(_IO_vfscanf) (s, fmt, ap, NULL);
00354   clear_no_long_double ();
00355   return res;
00356 }
00357 weak_alias (__nldbl___vfscanf, __nldbl_vfscanf)
00358 libc_hidden_def (__nldbl_vfscanf)
00359 
00360 int
00361 attribute_compat_text_section
00362 __nldbl_sscanf (const char *s, const char *fmt, ...)
00363 {
00364   va_list arg;
00365   int done;
00366 
00367   va_start (arg, fmt);
00368   done = __nldbl_vsscanf (s, fmt, arg);
00369   va_end (arg);
00370 
00371   return done;
00372 }
00373 strong_alias (__nldbl_sscanf, __nldbl__IO_sscanf)
00374 
00375 int
00376 attribute_compat_text_section
00377 __nldbl___vsscanf (const char *string, const char *fmt, va_list ap)
00378 {
00379   int res;
00380   __no_long_double = 1;
00381   res = _IO_vsscanf (string, fmt, ap);
00382   __no_long_double = 0;
00383   return res;
00384 }
00385 weak_alias (__nldbl___vsscanf, __nldbl_vsscanf)
00386 libc_hidden_def (__nldbl_vsscanf)
00387 
00388 int
00389 attribute_compat_text_section weak_function
00390 __nldbl_vscanf (const char *fmt, va_list ap)
00391 {
00392   return __nldbl_vfscanf (stdin, fmt, ap);
00393 }
00394 
00395 int
00396 attribute_compat_text_section
00397 __nldbl_fscanf (FILE *stream, const char *fmt, ...)
00398 {
00399   va_list arg;
00400   int done;
00401 
00402   va_start (arg, fmt);
00403   done = __nldbl_vfscanf (stream, fmt, arg);
00404   va_end (arg);
00405 
00406   return done;
00407 }
00408 
00409 int
00410 attribute_compat_text_section
00411 __nldbl_scanf (const char *fmt, ...)
00412 {
00413   va_list arg;
00414   int done;
00415 
00416   va_start (arg, fmt);
00417   done = __nldbl_vfscanf (stdin, fmt, arg);
00418   va_end (arg);
00419 
00420   return done;
00421 }
00422 
00423 int
00424 attribute_compat_text_section
00425 __nldbl_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
00426 {
00427   int res;
00428   set_no_long_double ();
00429   res = _IO_vfwscanf (s, fmt, ap, NULL);
00430   clear_no_long_double ();
00431   return res;
00432 }
00433 libc_hidden_def (__nldbl_vfwscanf)
00434 
00435 int
00436 attribute_compat_text_section
00437 __nldbl_swscanf (const wchar_t *s, const wchar_t *fmt, ...)
00438 {
00439   va_list arg;
00440   int done;
00441 
00442   va_start (arg, fmt);
00443   done = __nldbl_vswscanf (s, fmt, arg);
00444   va_end (arg);
00445 
00446   return done;
00447 }
00448 
00449 int
00450 attribute_compat_text_section
00451 __nldbl_vswscanf (const wchar_t *string, const wchar_t *fmt, va_list ap)
00452 {
00453   int res;
00454   __no_long_double = 1;
00455   res = vswscanf (string, fmt, ap);
00456   __no_long_double = 0;
00457   return res;
00458 }
00459 libc_hidden_def (__nldbl_vswscanf)
00460 
00461 int
00462 attribute_compat_text_section weak_function
00463 __nldbl_vwscanf (const wchar_t *fmt, va_list ap)
00464 {
00465   return __nldbl_vfwscanf (stdin, fmt, ap);
00466 }
00467 
00468 int
00469 attribute_compat_text_section
00470 __nldbl_fwscanf (FILE *stream, const wchar_t *fmt, ...)
00471 {
00472   va_list arg;
00473   int done;
00474 
00475   va_start (arg, fmt);
00476   done = __nldbl_vfwscanf (stream, fmt, arg);
00477   va_end (arg);
00478 
00479   return done;
00480 }
00481 
00482 int
00483 attribute_compat_text_section
00484 __nldbl_wscanf (const wchar_t *fmt, ...)
00485 {
00486   va_list arg;
00487   int done;
00488 
00489   va_start (arg, fmt);
00490   done = __nldbl_vfwscanf (stdin, fmt, arg);
00491   va_end (arg);
00492 
00493   return done;
00494 }
00495 
00496 int
00497 attribute_compat_text_section
00498 __nldbl___fprintf_chk (FILE *stream, int flag, const char *fmt, ...)
00499 {
00500   va_list arg;
00501   int done;
00502 
00503   va_start (arg, fmt);
00504   done = __nldbl___vfprintf_chk (stream, flag, fmt, arg);
00505   va_end (arg);
00506 
00507   return done;
00508 }
00509 
00510 int
00511 attribute_compat_text_section
00512 __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
00513 {
00514   va_list arg;
00515   int done;
00516 
00517   va_start (arg, fmt);
00518   done = __nldbl___vfwprintf_chk (stream, flag, fmt, arg);
00519   va_end (arg);
00520 
00521   return done;
00522 }
00523 
00524 int
00525 attribute_compat_text_section
00526 __nldbl___printf_chk (int flag, const char *fmt, ...)
00527 {
00528   va_list arg;
00529   int done;
00530 
00531   va_start (arg, fmt);
00532   done = __nldbl___vfprintf_chk (stdout, flag, fmt, arg);
00533   va_end (arg);
00534 
00535   return done;
00536 }
00537 
00538 int
00539 attribute_compat_text_section
00540 __nldbl___snprintf_chk (char *s, size_t maxlen, int flag, size_t slen,
00541                      const char *fmt, ...)
00542 {
00543   va_list arg;
00544   int done;
00545 
00546   va_start (arg, fmt);
00547   done = __nldbl___vsnprintf_chk (s, maxlen, flag, slen, fmt, arg);
00548   va_end (arg);
00549 
00550   return done;
00551 }
00552 
00553 int
00554 attribute_compat_text_section
00555 __nldbl___sprintf_chk (char *s, int flag, size_t slen, const char *fmt, ...)
00556 {
00557   va_list arg;
00558   int done;
00559 
00560   va_start (arg, fmt);
00561   done = __nldbl___vsprintf_chk (s, flag, slen, fmt, arg);
00562   va_end (arg);
00563 
00564   return done;
00565 }
00566 
00567 int
00568 attribute_compat_text_section
00569 __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
00570                      const wchar_t *fmt, ...)
00571 {
00572   va_list arg;
00573   int done;
00574 
00575   va_start (arg, fmt);
00576   done = __nldbl___vswprintf_chk (s, n, flag, slen, fmt, arg);
00577   va_end (arg);
00578 
00579   return done;
00580 }
00581 
00582 int
00583 attribute_compat_text_section
00584 __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
00585 {
00586   int res;
00587   set_no_long_double ();
00588   res = __vfprintf_chk (s, flag, fmt, ap);
00589   clear_no_long_double ();
00590   return res;
00591 }
00592 libc_hidden_def (__nldbl___vfprintf_chk)
00593 
00594 int
00595 attribute_compat_text_section
00596 __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
00597 {
00598   int res;
00599   set_no_long_double ();
00600   res = __vfwprintf_chk (s, flag, fmt, ap);
00601   clear_no_long_double ();
00602   return res;
00603 }
00604 libc_hidden_def (__nldbl___vfwprintf_chk)
00605 
00606 int
00607 attribute_compat_text_section
00608 __nldbl___vprintf_chk (int flag, const char *fmt, va_list ap)
00609 {
00610   return __nldbl___vfprintf_chk (stdout, flag, fmt, ap);
00611 }
00612 
00613 int
00614 attribute_compat_text_section
00615 __nldbl___vsnprintf_chk (char *string, size_t maxlen, int flag, size_t slen,
00616                       const char *fmt, va_list ap)
00617 {
00618   int res;
00619   __no_long_double = 1;
00620   res = __vsnprintf_chk (string, maxlen, flag, slen, fmt, ap);
00621   __no_long_double = 0;
00622   return res;
00623 }
00624 libc_hidden_def (__nldbl___vsnprintf_chk)
00625 
00626 int
00627 attribute_compat_text_section
00628 __nldbl___vsprintf_chk (char *string, int flag, size_t slen, const char *fmt,
00629                      va_list ap)
00630 {
00631   int res;
00632   __no_long_double = 1;
00633   res = __vsprintf_chk (string, flag, slen, fmt, ap);
00634   __no_long_double = 0;
00635   return res;
00636 }
00637 libc_hidden_def (__nldbl___vsprintf_chk)
00638 
00639 int
00640 attribute_compat_text_section
00641 __nldbl___vswprintf_chk (wchar_t *string, size_t maxlen, int flag, size_t slen,
00642                       const wchar_t *fmt, va_list ap)
00643 {
00644   int res;
00645   __no_long_double = 1;
00646   res = __vswprintf_chk (string, maxlen, flag, slen, fmt, ap);
00647   __no_long_double = 0;
00648   return res;
00649 }
00650 libc_hidden_def (__nldbl___vswprintf_chk)
00651 
00652 int
00653 attribute_compat_text_section
00654 __nldbl___vwprintf_chk (int flag, const wchar_t *fmt, va_list ap)
00655 {
00656   return __nldbl___vfwprintf_chk (stdout, flag, fmt, ap);
00657 }
00658 
00659 int
00660 attribute_compat_text_section
00661 __nldbl___wprintf_chk (int flag, const wchar_t *fmt, ...)
00662 {
00663   va_list arg;
00664   int done;
00665 
00666   va_start (arg, fmt);
00667   done = __nldbl___vfwprintf_chk (stdout, flag, fmt, arg);
00668   va_end (arg);
00669 
00670   return done;
00671 }
00672 
00673 int
00674 attribute_compat_text_section
00675 __nldbl___vasprintf_chk (char **ptr, int flag, const char *fmt, va_list arg)
00676 {
00677   int res;
00678   __no_long_double = 1;
00679   res = __vasprintf_chk (ptr, flag, fmt, arg);
00680   __no_long_double = 0;
00681   return res;
00682 }
00683 libc_hidden_def (__nldbl___vasprintf_chk)
00684 
00685 int
00686 attribute_compat_text_section
00687 __nldbl___asprintf_chk (char **ptr, int flag, const char *fmt, ...)
00688 {
00689   va_list arg;
00690   int done;
00691 
00692   va_start (arg, fmt);
00693   done = __nldbl___vasprintf_chk (ptr, flag, fmt, arg);
00694   va_end (arg);
00695 
00696   return done;
00697 }
00698 
00699 int
00700 attribute_compat_text_section
00701 __nldbl___vdprintf_chk (int d, int flag, const char *fmt, va_list arg)
00702 {
00703   int res;
00704   set_no_long_double ();
00705   res = __vdprintf_chk (d, flag, fmt, arg);
00706   clear_no_long_double ();
00707   return res;
00708 }
00709 libc_hidden_def (__nldbl___vdprintf_chk)
00710 
00711 int
00712 attribute_compat_text_section
00713 __nldbl___dprintf_chk (int d, int flag, const char *fmt, ...)
00714 {
00715   va_list arg;
00716   int done;
00717 
00718   va_start (arg, fmt);
00719   done = __nldbl___vdprintf_chk (d, flag, fmt, arg);
00720   va_end (arg);
00721 
00722   return done;
00723 }
00724 
00725 int
00726 attribute_compat_text_section
00727 __nldbl___obstack_vprintf_chk (struct obstack *obstack, int flag,
00728                             const char *fmt, va_list arg)
00729 {
00730   int res;
00731   __no_long_double = 1;
00732   res = __obstack_vprintf_chk (obstack, flag, fmt, arg);
00733   __no_long_double = 0;
00734   return res;
00735 }
00736 libc_hidden_def (__nldbl___obstack_vprintf_chk)
00737 
00738 int
00739 attribute_compat_text_section
00740 __nldbl___obstack_printf_chk (struct obstack *obstack, int flag,
00741                            const char *fmt, ...)
00742 {
00743   va_list arg;
00744   int done;
00745 
00746   va_start (arg, fmt);
00747   done = __nldbl___obstack_vprintf_chk (obstack, flag, fmt, arg);
00748   va_end (arg);
00749 
00750   return done;
00751 }
00752 
00753 extern __typeof (printf_size) __printf_size;
00754 
00755 int
00756 attribute_compat_text_section
00757 __nldbl_printf_size (FILE *fp, const struct printf_info *info,
00758                    const void *const *args)
00759 {
00760   struct printf_info info_no_ldbl = *info;
00761 
00762   info_no_ldbl.is_long_double = 0;
00763   return __printf_size (fp, &info_no_ldbl, args);
00764 }
00765 
00766 extern __typeof (__printf_fp) ___printf_fp;
00767 
00768 int
00769 attribute_compat_text_section
00770 __nldbl___printf_fp (FILE *fp, const struct printf_info *info,
00771                    const void *const *args)
00772 {
00773   struct printf_info info_no_ldbl = *info;
00774 
00775   info_no_ldbl.is_long_double = 0;
00776   return ___printf_fp (fp, &info_no_ldbl, args);
00777 }
00778 
00779 ssize_t
00780 attribute_compat_text_section
00781 __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
00782 {
00783   va_list ap;
00784   ssize_t res;
00785 
00786   va_start (ap, format);
00787   res = __nldbl___vstrfmon (s, maxsize, format, ap);
00788   va_end (ap);
00789   return res;
00790 }
00791 
00792 ssize_t
00793 attribute_compat_text_section
00794 __nldbl___strfmon_l (char *s, size_t maxsize, __locale_t loc,
00795                    const char *format, ...)
00796 {
00797   va_list ap;
00798   ssize_t res;
00799 
00800   va_start (ap, format);
00801   res = __nldbl___vstrfmon_l (s, maxsize, loc, format, ap);
00802   va_end (ap);
00803   return res;
00804 }
00805 weak_alias (__nldbl___strfmon_l, __nldbl_strfmon_l)
00806 
00807 ssize_t
00808 attribute_compat_text_section
00809 __nldbl___vstrfmon (char *s, size_t maxsize, const char *format, va_list ap)
00810 {
00811   ssize_t res;
00812   __no_long_double = 1;
00813   res = __vstrfmon_l (s, maxsize, _NL_CURRENT_LOCALE, format, ap);
00814   __no_long_double = 0;
00815   va_end (ap);
00816   return res;
00817 }
00818 libc_hidden_def (__nldbl___vstrfmon)
00819 
00820 ssize_t
00821 attribute_compat_text_section
00822 __nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
00823                     const char *format, va_list ap)
00824 {
00825   ssize_t res;
00826   __no_long_double = 1;
00827   res = __vstrfmon_l (s, maxsize, loc, format, ap);
00828   __no_long_double = 0;
00829   va_end (ap);
00830   return res;
00831 }
00832 libc_hidden_def (__nldbl___vstrfmon_l)
00833 
00834 void
00835 attribute_compat_text_section
00836 __nldbl_syslog (int pri, const char *fmt, ...)
00837 {
00838   va_list ap;
00839   va_start (ap, fmt);
00840   __nldbl___vsyslog_chk (pri, -1, fmt, ap);
00841   va_end (ap);
00842 }
00843 
00844 void
00845 attribute_compat_text_section
00846 __nldbl___syslog_chk (int pri, int flag, const char *fmt, ...)
00847 {
00848   va_list ap;
00849 
00850   va_start (ap, fmt);
00851   __nldbl___vsyslog_chk (pri, flag, fmt, ap);
00852   va_end(ap);
00853 }
00854 
00855 void
00856 attribute_compat_text_section
00857 __nldbl___vsyslog_chk (int pri, int flag, const char *fmt, va_list ap)
00858 {
00859   set_no_long_double ();
00860   __vsyslog_chk (pri, flag, fmt, ap);
00861   clear_no_long_double ();
00862 }
00863 libc_hidden_def (__nldbl___vsyslog_chk)
00864 
00865 void
00866 attribute_compat_text_section
00867 __nldbl_vsyslog (int pri, const char *fmt, va_list ap)
00868 {
00869   __nldbl___vsyslog_chk (pri, -1, fmt, ap);
00870 }
00871 
00872 int
00873 attribute_compat_text_section
00874 __nldbl___isoc99_vfscanf (FILE *s, const char *fmt, va_list ap)
00875 {
00876   int res;
00877   set_no_long_double ();
00878   res = __isoc99_vfscanf (s, fmt, ap);
00879   clear_no_long_double ();
00880   return res;
00881 }
00882 libc_hidden_def (__nldbl___isoc99_vfscanf)
00883 
00884 int
00885 attribute_compat_text_section
00886 __nldbl___isoc99_sscanf (const char *s, const char *fmt, ...)
00887 {
00888   va_list arg;
00889   int done;
00890 
00891   va_start (arg, fmt);
00892   done = __nldbl___isoc99_vsscanf (s, fmt, arg);
00893   va_end (arg);
00894 
00895   return done;
00896 }
00897 
00898 int
00899 attribute_compat_text_section
00900 __nldbl___isoc99_vsscanf (const char *string, const char *fmt, va_list ap)
00901 {
00902   int res;
00903   __no_long_double = 1;
00904   res = __isoc99_vsscanf (string, fmt, ap);
00905   __no_long_double = 0;
00906   return res;
00907 }
00908 libc_hidden_def (__nldbl___isoc99_vsscanf)
00909 
00910 int
00911 attribute_compat_text_section
00912 __nldbl___isoc99_vscanf (const char *fmt, va_list ap)
00913 {
00914   return __nldbl___isoc99_vfscanf (stdin, fmt, ap);
00915 }
00916 
00917 int
00918 attribute_compat_text_section
00919 __nldbl___isoc99_fscanf (FILE *stream, const char *fmt, ...)
00920 {
00921   va_list arg;
00922   int done;
00923 
00924   va_start (arg, fmt);
00925   done = __nldbl___isoc99_vfscanf (stream, fmt, arg);
00926   va_end (arg);
00927 
00928   return done;
00929 }
00930 
00931 int
00932 attribute_compat_text_section
00933 __nldbl___isoc99_scanf (const char *fmt, ...)
00934 {
00935   va_list arg;
00936   int done;
00937 
00938   va_start (arg, fmt);
00939   done = __nldbl___isoc99_vfscanf (stdin, fmt, arg);
00940   va_end (arg);
00941 
00942   return done;
00943 }
00944 
00945 int
00946 attribute_compat_text_section
00947 __nldbl___isoc99_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
00948 {
00949   int res;
00950   set_no_long_double ();
00951   res = __isoc99_vfwscanf (s, fmt, ap);
00952   clear_no_long_double ();
00953   return res;
00954 }
00955 libc_hidden_def (__nldbl___isoc99_vfwscanf)
00956 
00957 int
00958 attribute_compat_text_section
00959 __nldbl___isoc99_swscanf (const wchar_t *s, const wchar_t *fmt, ...)
00960 {
00961   va_list arg;
00962   int done;
00963 
00964   va_start (arg, fmt);
00965   done = __nldbl___isoc99_vswscanf (s, fmt, arg);
00966   va_end (arg);
00967 
00968   return done;
00969 }
00970 
00971 int
00972 attribute_compat_text_section
00973 __nldbl___isoc99_vswscanf (const wchar_t *string, const wchar_t *fmt,
00974                         va_list ap)
00975 {
00976   int res;
00977   __no_long_double = 1;
00978   res = __isoc99_vswscanf (string, fmt, ap);
00979   __no_long_double = 0;
00980   return res;
00981 }
00982 libc_hidden_def (__nldbl___isoc99_vswscanf)
00983 
00984 int
00985 attribute_compat_text_section
00986 __nldbl___isoc99_vwscanf (const wchar_t *fmt, va_list ap)
00987 {
00988   return __nldbl___isoc99_vfwscanf (stdin, fmt, ap);
00989 }
00990 
00991 int
00992 attribute_compat_text_section
00993 __nldbl___isoc99_fwscanf (FILE *stream, const wchar_t *fmt, ...)
00994 {
00995   va_list arg;
00996   int done;
00997 
00998   va_start (arg, fmt);
00999   done = __nldbl___isoc99_vfwscanf (stream, fmt, arg);
01000   va_end (arg);
01001 
01002   return done;
01003 }
01004 
01005 int
01006 attribute_compat_text_section
01007 __nldbl___isoc99_wscanf (const wchar_t *fmt, ...)
01008 {
01009   va_list arg;
01010   int done;
01011 
01012   va_start (arg, fmt);
01013   done = __nldbl___isoc99_vfwscanf (stdin, fmt, arg);
01014   va_end (arg);
01015 
01016   return done;
01017 }
01018 
01019 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
01020 compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
01021 compat_symbol (libc, __nldbl__IO_sprintf, _IO_sprintf, GLIBC_2_0);
01022 compat_symbol (libc, __nldbl__IO_vfprintf, _IO_vfprintf, GLIBC_2_0);
01023 compat_symbol (libc, __nldbl__IO_vsprintf, _IO_vsprintf, GLIBC_2_0);
01024 compat_symbol (libc, __nldbl_dprintf, dprintf, GLIBC_2_0);
01025 compat_symbol (libc, __nldbl_fprintf, fprintf, GLIBC_2_0);
01026 compat_symbol (libc, __nldbl_printf, printf, GLIBC_2_0);
01027 compat_symbol (libc, __nldbl_sprintf, sprintf, GLIBC_2_0);
01028 compat_symbol (libc, __nldbl_vfprintf, vfprintf, GLIBC_2_0);
01029 compat_symbol (libc, __nldbl_vprintf, vprintf, GLIBC_2_0);
01030 compat_symbol (libc, __nldbl__IO_fprintf, _IO_fprintf, GLIBC_2_0);
01031 compat_symbol (libc, __nldbl___vsnprintf, __vsnprintf, GLIBC_2_0);
01032 compat_symbol (libc, __nldbl_asprintf, asprintf, GLIBC_2_0);
01033 compat_symbol (libc, __nldbl_obstack_printf, obstack_printf, GLIBC_2_0);
01034 compat_symbol (libc, __nldbl_obstack_vprintf, obstack_vprintf, GLIBC_2_0);
01035 compat_symbol (libc, __nldbl_snprintf, snprintf, GLIBC_2_0);
01036 compat_symbol (libc, __nldbl_vasprintf, vasprintf, GLIBC_2_0);
01037 compat_symbol (libc, __nldbl_vdprintf, vdprintf, GLIBC_2_0);
01038 compat_symbol (libc, __nldbl_vsnprintf, vsnprintf, GLIBC_2_0);
01039 compat_symbol (libc, __nldbl_vsprintf, vsprintf, GLIBC_2_0);
01040 compat_symbol (libc, __nldbl__IO_sscanf, _IO_sscanf, GLIBC_2_0);
01041 compat_symbol (libc, __nldbl__IO_vfscanf, _IO_vfscanf, GLIBC_2_0);
01042 compat_symbol (libc, __nldbl___vfscanf, __vfscanf, GLIBC_2_0);
01043 compat_symbol (libc, __nldbl___vsscanf, __vsscanf, GLIBC_2_0);
01044 compat_symbol (libc, __nldbl_fscanf, fscanf, GLIBC_2_0);
01045 compat_symbol (libc, __nldbl_scanf, scanf, GLIBC_2_0);
01046 compat_symbol (libc, __nldbl_sscanf, sscanf, GLIBC_2_0);
01047 compat_symbol (libc, __nldbl_vfscanf, vfscanf, GLIBC_2_0);
01048 compat_symbol (libc, __nldbl_vscanf, vscanf, GLIBC_2_0);
01049 compat_symbol (libc, __nldbl_vsscanf, vsscanf, GLIBC_2_0);
01050 compat_symbol (libc, __nldbl___printf_fp, __printf_fp, GLIBC_2_0);
01051 compat_symbol (libc, __nldbl_strfmon, strfmon, GLIBC_2_0);
01052 compat_symbol (libc, __nldbl_syslog, syslog, GLIBC_2_0);
01053 compat_symbol (libc, __nldbl_vsyslog, vsyslog, GLIBC_2_0);
01054 #endif
01055 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
01056 compat_symbol (libc, __nldbl___asprintf, __asprintf, GLIBC_2_1);
01057 compat_symbol (libc, __nldbl_printf_size, printf_size, GLIBC_2_1);
01058 compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1);
01059 #endif
01060 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
01061 compat_symbol (libc, __nldbl_swprintf, swprintf, GLIBC_2_2);
01062 compat_symbol (libc, __nldbl_vwprintf, vwprintf, GLIBC_2_2);
01063 compat_symbol (libc, __nldbl_wprintf, wprintf, GLIBC_2_2);
01064 compat_symbol (libc, __nldbl_fwprintf, fwprintf, GLIBC_2_2);
01065 compat_symbol (libc, __nldbl_vfwprintf, vfwprintf, GLIBC_2_2);
01066 compat_symbol (libc, __nldbl_vswprintf, vswprintf, GLIBC_2_2);
01067 compat_symbol (libc, __nldbl_fwscanf, fwscanf, GLIBC_2_2);
01068 compat_symbol (libc, __nldbl_swscanf, swscanf, GLIBC_2_2);
01069 compat_symbol (libc, __nldbl_vfwscanf, vfwscanf, GLIBC_2_2);
01070 compat_symbol (libc, __nldbl_vswscanf, vswscanf, GLIBC_2_2);
01071 compat_symbol (libc, __nldbl_vwscanf, vwscanf, GLIBC_2_2);
01072 compat_symbol (libc, __nldbl_wscanf, wscanf, GLIBC_2_2);
01073 #endif
01074 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
01075 compat_symbol (libc, __nldbl_strfmon_l, strfmon_l, GLIBC_2_3);
01076 #endif
01077 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3_4)
01078 compat_symbol (libc, __nldbl___sprintf_chk, __sprintf_chk, GLIBC_2_3_4);
01079 compat_symbol (libc, __nldbl___vsprintf_chk, __vsprintf_chk, GLIBC_2_3_4);
01080 compat_symbol (libc, __nldbl___snprintf_chk, __snprintf_chk, GLIBC_2_3_4);
01081 compat_symbol (libc, __nldbl___vsnprintf_chk, __vsnprintf_chk, GLIBC_2_3_4);
01082 compat_symbol (libc, __nldbl___printf_chk, __printf_chk, GLIBC_2_3_4);
01083 compat_symbol (libc, __nldbl___fprintf_chk, __fprintf_chk, GLIBC_2_3_4);
01084 compat_symbol (libc, __nldbl___vprintf_chk, __vprintf_chk, GLIBC_2_3_4);
01085 compat_symbol (libc, __nldbl___vfprintf_chk, __vfprintf_chk, GLIBC_2_3_4);
01086 #endif