~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/msvcrt/scanf.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * general implementation of scanf used by scanf, sscanf, fscanf,
  3  * _cscanf, wscanf, swscanf and fwscanf
  4  *
  5  * Copyright 1996,1998 Marcus Meissner
  6  * Copyright 1996 Jukka Iivonen
  7  * Copyright 1997,2000 Uwe Bonnes
  8  * Copyright 2000 Jon Griffiths
  9  * Copyright 2002 Daniel Gudbjartsson
 10  *
 11  * This library is free software; you can redistribute it and/or
 12  * modify it under the terms of the GNU Lesser General Public
 13  * License as published by the Free Software Foundation; either
 14  * version 2.1 of the License, or (at your option) any later version.
 15  *
 16  * This library is distributed in the hope that it will be useful,
 17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 19  * Lesser General Public License for more details.
 20  *
 21  * You should have received a copy of the GNU Lesser General Public
 22  * License along with this library; if not, write to the Free Software
 23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 24  */
 25 
 26 #include <stdarg.h>
 27 
 28 #include "windef.h"
 29 #include "winbase.h"
 30 #include "winternl.h"
 31 #include "msvcrt.h"
 32 #include "wine/debug.h"
 33 
 34 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 35 
 36 extern MSVCRT_FILE MSVCRT__iob[];
 37 
 38 /* helper function for *scanf.  Returns the value of character c in the
 39  * given base, or -1 if the given character is not a digit of the base.
 40  */
 41 static int char2digit(char c, int base) {
 42     if ((c>='') && (c<='9') && (c<=''+base-1)) return (c-'');
 43     if (base<=10) return -1;
 44     if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
 45     if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
 46     return -1;
 47 }
 48 
 49 /* helper function for *wscanf.  Returns the value of character c in the
 50  * given base, or -1 if the given character is not a digit of the base.
 51  */
 52 static int wchar2digit(MSVCRT_wchar_t c, int base) {
 53     if ((c>='') && (c<='9') && (c<=''+base-1)) return (c-'');
 54     if (base<=10) return -1;
 55     if ((c>='A') && (c<='Z') && (c<='A'+base-11)) return (c-'A'+10);
 56     if ((c>='a') && (c<='z') && (c<='a'+base-11)) return (c-'a'+10);
 57     return -1;
 58 }
 59 
 60 /* vfscanf */
 61 #undef WIDE_SCANF
 62 #undef CONSOLE
 63 #undef STRING
 64 #include "scanf.h"
 65 
 66 /* vfwscanf */
 67 #define WIDE_SCANF 1
 68 #undef CONSOLE
 69 #undef STRING
 70 #include "scanf.h"
 71 
 72 /* vsscanf */
 73 #undef WIDE_SCANF
 74 #undef CONSOLE
 75 #define STRING 1
 76 #include "scanf.h"
 77 
 78 /* vswscanf */
 79 #define WIDE_SCANF 1
 80 #undef CONSOLE
 81 #define STRING 1
 82 #include "scanf.h"
 83 
 84 /* vcscanf */
 85 #undef WIDE_SCANF
 86 #define CONSOLE 1
 87 #undef STRING
 88 #include "scanf.h"
 89 
 90 
 91 /*********************************************************************
 92  *              fscanf (MSVCRT.@)
 93  */
 94 int CDECL MSVCRT_fscanf(MSVCRT_FILE *file, const char *format, ...)
 95 {
 96     __ms_va_list valist;
 97     int res;
 98 
 99     __ms_va_start(valist, format);
100     res = MSVCRT_vfscanf(file, format, valist);
101     __ms_va_end(valist);
102     return res;
103 }
104 
105 /*********************************************************************
106  *              scanf (MSVCRT.@)
107  */
108 int CDECL MSVCRT_scanf(const char *format, ...)
109 {
110     __ms_va_list valist;
111     int res;
112 
113     __ms_va_start(valist, format);
114     res = MSVCRT_vfscanf(MSVCRT_stdin, format, valist);
115     __ms_va_end(valist);
116     return res;
117 }
118 
119 /*********************************************************************
120  *              fwscanf (MSVCRT.@)
121  */
122 int CDECL MSVCRT_fwscanf(MSVCRT_FILE *file, const MSVCRT_wchar_t *format, ...)
123 {
124     __ms_va_list valist;
125     int res;
126 
127     __ms_va_start(valist, format);
128     res = MSVCRT_vfwscanf(file, format, valist);
129     __ms_va_end(valist);
130     return res;
131 }
132 
133 
134 /*********************************************************************
135  *              wscanf (MSVCRT.@)
136  */
137 int CDECL MSVCRT_wscanf(const MSVCRT_wchar_t *format, ...)
138 {
139     __ms_va_list valist;
140     int res;
141 
142     __ms_va_start(valist, format);
143     res = MSVCRT_vfwscanf(MSVCRT_stdin, format, valist);
144     __ms_va_end(valist);
145     return res;
146 }
147 
148 
149 /*********************************************************************
150  *              sscanf (MSVCRT.@)
151  */
152 int CDECL MSVCRT_sscanf(const char *str, const char *format, ...)
153 {
154     __ms_va_list valist;
155     int res;
156 
157     __ms_va_start(valist, format);
158     res = MSVCRT_vsscanf(str, format, valist);
159     __ms_va_end(valist);
160     return res;
161 }
162 
163 
164 /*********************************************************************
165  *              swscanf (MSVCRT.@)
166  */
167 int CDECL MSVCRT_swscanf(const MSVCRT_wchar_t *str, const MSVCRT_wchar_t *format, ...)
168 {
169     __ms_va_list valist;
170     int res;
171 
172     __ms_va_start(valist, format);
173     res = MSVCRT_vswscanf(str, format, valist);
174     __ms_va_end(valist);
175     return res;
176 }
177 
178 
179 /*********************************************************************
180  *              _cscanf (MSVCRT.@)
181  */
182 int CDECL _cscanf(const char *format, ...)
183 {
184     __ms_va_list valist;
185     int res;
186 
187     __ms_va_start(valist, format);
188     res = MSVCRT_vcscanf(format, valist);
189     __ms_va_end(valist);
190     return res;
191 }
192 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.