OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / stdio / scanf.c
index d30eaeb..8def91c 100644 (file)
@@ -43,7 +43,6 @@
  * standards and from an official C standard defect report.
  */
 
-
 #define _ISOC99_SOURCE                 /* for LLONG_MAX primarily... */
 #define _GNU_SOURCE
 #include <features.h>
 #include <bits/uClibc_fpmax.h>
 #endif /* __UCLIBC_HAS_FLOATS__ */
 
+libc_hidden_proto(memcmp)
+libc_hidden_proto(memset)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(ungetc)
+libc_hidden_proto(vfscanf)
+libc_hidden_proto(vsscanf)
+libc_hidden_proto(fclose)
+libc_hidden_proto(getc_unlocked)
+libc_hidden_proto(__fgetc_unlocked)
+#ifdef __UCLIBC_HAS_WCHAR__
+libc_hidden_proto(wcslen)
+libc_hidden_proto(vfwscanf)
+libc_hidden_proto(vswscanf)
+libc_hidden_proto(mbsrtowcs)
+libc_hidden_proto(mbrtowc)
+libc_hidden_proto(ungetwc)
+libc_hidden_proto(iswspace)
+libc_hidden_proto(fgetwc_unlocked)
+#endif
+
 #ifdef __UCLIBC_HAS_SCANF_GLIBC_A_FLAG__
 #ifdef L_vfscanf
 /* only emit this once */
@@ -151,6 +171,8 @@ int fscanf(FILE * __restrict stream, const char * __restrict format, ...)
 
        return rv;
 }
+libc_hidden_proto(fscanf)
+libc_hidden_def(fscanf)
 
 #endif
 /**********************************************************************/
@@ -185,6 +207,8 @@ int sscanf(const char * __restrict str, const char * __restrict format, ...)
 
        return rv;
 }
+libc_hidden_proto(sscanf)
+libc_hidden_def(sscanf)
 
 #else  /* __STDIO_HAS_VSSCANF */
 #warning Skipping sscanf since no vsscanf!
@@ -198,6 +222,8 @@ int vscanf(const char * __restrict format, va_list arg)
 {
        return vfscanf(stdin, format, arg);
 }
+libc_hidden_proto(vscanf)
+libc_hidden_def(vscanf)
 
 #endif
 /**********************************************************************/
@@ -249,6 +275,7 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap)
 
        return vfscanf(&f, fmt, ap);
 }
+libc_hidden_def(vsscanf)
 
 #elif !defined(__UCLIBC_HAS_WCHAR__)
 
@@ -287,6 +314,7 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap)
 
        return vfscanf(&f.f, fmt, ap);
 }
+libc_hidden_def(vsscanf)
 
 #elif defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__)
 
@@ -302,6 +330,7 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap)
 
        return rv;
 }
+libc_hidden_def(vsscanf)
 
 #else
 #warning Skipping vsscanf since no buffering, no custom streams, and wchar enabled!
@@ -418,6 +447,7 @@ int vswscanf(const wchar_t * __restrict str, const wchar_t * __restrict format,
 
        return vfwscanf(&f, format, arg);
 }
+libc_hidden_def(vswscanf)
 #else  /* __STDIO_BUFFERS */
 #warning Skipping vswscanf since no buffering!
 #endif /* __STDIO_BUFFERS */
@@ -648,16 +678,16 @@ typedef struct {
 /**********************************************************************/
 
 extern void __init_scan_cookie(register struct scan_cookie *sc,
-                                                          register FILE *fp);
-extern int __scan_getc(register struct scan_cookie *sc);
-extern void __scan_ungetc(register struct scan_cookie *sc);
+                                                          register FILE *fp) attribute_hidden;
+extern int __scan_getc(register struct scan_cookie *sc) attribute_hidden;
+extern void __scan_ungetc(register struct scan_cookie *sc) attribute_hidden;
 
 #ifdef __UCLIBC_HAS_FLOATS__
 extern int __scan_strtold(long double *ld, struct scan_cookie *sc);
 #endif /* __UCLIBC_HAS_FLOATS__ */
 
-extern int __psfs_parse_spec(psfs_t *psfs);
-extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc);
+extern int __psfs_parse_spec(psfs_t *psfs) attribute_hidden;
+extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc) attribute_hidden;
 
 /**********************************************************************/
 #ifdef L___scan_cookie
@@ -669,7 +699,7 @@ extern int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc);
 static const char decpt_str[] = ".";
 #endif
 
-void __init_scan_cookie(register struct scan_cookie *sc,
+void attribute_hidden __init_scan_cookie(register struct scan_cookie *sc,
                                                register FILE *fp)
 {
        sc->fp = fp;
@@ -710,7 +740,7 @@ void __init_scan_cookie(register struct scan_cookie *sc,
 
 }
 
-int __scan_getc(register struct scan_cookie *sc)
+int attribute_hidden __scan_getc(register struct scan_cookie *sc)
 {
        int c;
 
@@ -758,7 +788,7 @@ int __scan_getc(register struct scan_cookie *sc)
        return sc->cc = sc->ungot_char;
 }
 
-void __scan_ungetc(register struct scan_cookie *sc)
+void attribute_hidden __scan_ungetc(register struct scan_cookie *sc)
 {
        ++sc->width;
        if (sc->ungot_flag == 2) {      /* last was EOF */
@@ -784,7 +814,7 @@ static const unsigned char qual_chars[] = QUAL_CHARS;
 static const unsigned char spec_ranges[] = SPEC_RANGES;
 static const unsigned short spec_allowed[] = SPEC_ALLOWED_FLAGS;
 
-int __psfs_parse_spec(register psfs_t *psfs)
+int attribute_hidden __psfs_parse_spec(register psfs_t *psfs)
 {
        const unsigned char *p;
        const unsigned char *fmt0 = psfs->fmt;
@@ -1736,6 +1766,7 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
 
        return psfs.cnt;
 }
+libc_hidden_def(VFSCANF)
 #endif
 /**********************************************************************/
 #ifdef L___psfs_do_numeric
@@ -1743,7 +1774,7 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
 static const unsigned char spec_base[] = SPEC_BASE;
 static const unsigned char nil_string[] = "(nil)";
 
-int __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
+int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
 {
        unsigned char *b;
        const unsigned char *p;