maintainers: D3dxof is a D3D helper library too.
[wine.git] / dlls / msvcp90 / locale.c
blob96f22217d13abe63f1dd6d5a1013e3888f90a5cb
1 /*
2 * Copyright 2010 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This 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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "config.h"
21 #include <stdarg.h>
23 #include "assert.h"
24 #include "locale.h"
25 #include "errno.h"
26 #include "limits.h"
27 #include "math.h"
28 #include "mbctype.h"
29 #include "stdio.h"
30 #include "wchar.h"
31 #include "wctype.h"
32 #include "time.h"
33 #include "windef.h"
34 #include "winbase.h"
35 #include "winnls.h"
36 #include "msvcp90.h"
37 #include "wine/unicode.h"
38 #include "wine/list.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
43 typedef enum {
44 DATEORDER_no_order,
45 DATEORDER_dmy,
46 DATEORDER_mdy,
47 DATEORDER_ymd,
48 DATEORDER_ydm
49 } dateorder;
51 char* __cdecl _Getdays(void);
52 wchar_t* __cdecl _W_Getdays(void);
53 char* __cdecl _Getmonths(void);
54 wchar_t* __cdecl _W_Getmonths(void);
55 void* __cdecl _Gettnames(void);
56 unsigned int __cdecl ___lc_codepage_func(void);
57 int __cdecl ___lc_collate_cp_func(void);
58 const unsigned short* __cdecl __pctype_func(void);
59 const locale_facet* __thiscall locale__Getfacet(const locale*, MSVCP_size_t);
60 MSVCP_size_t __cdecl _Strftime(char*, MSVCP_size_t, const char*,
61 const struct tm*, struct __lc_time_data*);
62 const locale* __cdecl locale_classic(void);
64 #if _MSVCP_VER >= 110
65 wchar_t ** __cdecl ___lc_locale_name_func(void);
66 #else
67 LCID* __cdecl ___lc_handle_func(void);
68 #endif
70 #if _MSVCP_VER < 100
71 #define locale_string basic_string_char
72 #define locale_string_char_ctor(this) MSVCP_basic_string_char_ctor(this)
73 #define locale_string_char_ctor_cstr(this,str) MSVCP_basic_string_char_ctor_cstr(this,str)
74 #define locale_string_char_copy_ctor(this,copy) MSVCP_basic_string_char_copy_ctor(this,copy)
75 #define locale_string_char_dtor(this) MSVCP_basic_string_char_dtor(this)
76 #define locale_string_char_c_str(this) MSVCP_basic_string_char_c_str(this)
77 #define locale_string_char_assign(this,assign) MSVCP_basic_string_char_assign(this,assign)
78 #else
79 #define locale_string _Yarn_char
80 #define locale_string_char_ctor(this) _Yarn_char_ctor(this)
81 #define locale_string_char_ctor_cstr(this,str) _Yarn_char_ctor_cstr(this,str)
82 #define locale_string_char_copy_ctor(this,copy) _Yarn_char_copy_ctor(this,copy)
83 #define locale_string_char_dtor(this) _Yarn_char_dtor(this)
84 #define locale_string_char_c_str(this) _Yarn_char_c_str(this)
85 #define locale_string_char_assign(this,assign) _Yarn_char_op_assign(this,assign)
87 #define locale_string_wchar _Yarn_wchar
88 #define locale_string_wchar_ctor(this) _Yarn_wchar_ctor(this)
89 #define locale_string_wchar_dtor(this) _Yarn_wchar_dtor(this)
90 #define locale_string_wchar_c_str(this) _Yarn_wchar__C_str(this)
91 #define locale_string_wchar_assign(this,str) _Yarn_wchar_op_assign_cstr(this,str)
92 #endif
94 typedef int category;
96 typedef struct {
97 MSVCP_size_t id;
98 } locale_id;
100 typedef struct _locale__Locimp {
101 locale_facet facet;
102 locale_facet **facetvec;
103 MSVCP_size_t facet_cnt;
104 category catmask;
105 MSVCP_bool transparent;
106 locale_string name;
107 } locale__Locimp;
109 typedef struct {
110 void *timeptr;
111 } _Timevec;
113 typedef struct {
114 _Lockit lock;
115 locale_string days;
116 locale_string months;
117 #if _MSVCP_VER >= 110
118 locale_string_wchar wdays;
119 locale_string_wchar wmonths;
120 #endif
121 locale_string oldlocname;
122 locale_string newlocname;
123 } _Locinfo;
125 typedef struct {
126 #if _MSVCP_VER < 110
127 LCID handle;
128 #endif
129 unsigned page;
130 #if _MSVCP_VER >= 110
131 wchar_t *lc_name;
132 #endif
133 } _Collvec;
135 typedef struct {
136 locale_facet facet;
137 _Collvec coll;
138 } collate;
140 typedef struct {
141 locale_facet facet;
142 const char *grouping;
143 char dp;
144 char sep;
145 const char *false_name;
146 const char *true_name;
147 } numpunct_char;
149 typedef struct {
150 locale_facet facet;
151 const char *grouping;
152 wchar_t dp;
153 wchar_t sep;
154 const wchar_t *false_name;
155 const wchar_t *true_name;
156 } numpunct_wchar;
158 typedef struct {
159 locale_facet facet;
160 _Timevec time;
161 _Cvtvec cvt;
162 } time_put;
164 typedef struct {
165 locale_facet facet;
166 const char *days;
167 const char *months;
168 dateorder dateorder;
169 _Cvtvec cvt;
170 } time_get_char;
172 /* ?_Id_cnt@id@locale@std@@0HA */
173 int locale_id__Id_cnt = 0;
175 static locale classic_locale;
177 /* ?_Global@_Locimp@locale@std@@0PAV123@A */
178 /* ?_Global@_Locimp@locale@std@@0PEAV123@EA */
179 locale__Locimp *global_locale = NULL;
181 /* ?_Clocptr@_Locimp@locale@std@@0PAV123@A */
182 /* ?_Clocptr@_Locimp@locale@std@@0PEAV123@EA */
183 locale__Locimp *locale__Locimp__Clocptr = NULL;
185 static char istreambuf_iterator_char_val(istreambuf_iterator_char *this)
187 if(this->strbuf && !this->got) {
188 int c = basic_streambuf_char_sgetc(this->strbuf);
189 if(c == EOF)
190 this->strbuf = NULL;
191 else
192 this->val = c;
195 this->got = TRUE;
196 return this->val;
199 static wchar_t istreambuf_iterator_wchar_val(istreambuf_iterator_wchar *this)
201 if(this->strbuf && !this->got) {
202 unsigned short c = basic_streambuf_wchar_sgetc(this->strbuf);
203 if(c == WEOF)
204 this->strbuf = NULL;
205 else
206 this->val = c;
209 this->got = TRUE;
210 return this->val;
213 static void istreambuf_iterator_char_inc(istreambuf_iterator_char *this)
215 if(!this->strbuf || basic_streambuf_char_sbumpc(this->strbuf)==EOF) {
216 this->strbuf = NULL;
217 this->got = TRUE;
218 }else {
219 this->got = FALSE;
220 istreambuf_iterator_char_val(this);
224 static void istreambuf_iterator_wchar_inc(istreambuf_iterator_wchar *this)
226 if(!this->strbuf || basic_streambuf_wchar_sbumpc(this->strbuf)==WEOF) {
227 this->strbuf = NULL;
228 this->got = TRUE;
229 }else {
230 this->got = FALSE;
231 istreambuf_iterator_wchar_val(this);
235 static void ostreambuf_iterator_char_put(ostreambuf_iterator_char *this, char ch)
237 if(this->failed || basic_streambuf_char_sputc(this->strbuf, ch)==EOF)
238 this->failed = TRUE;
241 static void ostreambuf_iterator_wchar_put(ostreambuf_iterator_wchar *this, wchar_t ch)
243 if(this->failed || basic_streambuf_wchar_sputc(this->strbuf, ch)==WEOF)
244 this->failed = TRUE;
247 /* ??1facet@locale@std@@UAE@XZ */
248 /* ??1facet@locale@std@@UEAA@XZ */
249 /* ??1facet@locale@std@@MAA@XZ */
250 /* ??1facet@locale@std@@MAE@XZ */
251 /* ??1facet@locale@std@@MEAA@XZ */
252 DEFINE_THISCALL_WRAPPER(locale_facet_dtor, 4)
253 void __thiscall locale_facet_dtor(locale_facet *this)
255 TRACE("(%p)\n", this);
258 DEFINE_THISCALL_WRAPPER(locale_facet_vector_dtor, 8)
259 #define call_locale_facet_vector_dtor(this, flags) CALL_VTBL_FUNC(this, 0, \
260 locale_facet*, (locale_facet*, unsigned int), (this, flags))
261 locale_facet* __thiscall locale_facet_vector_dtor(locale_facet *this, unsigned int flags)
263 TRACE("(%p %x)\n", this, flags);
264 if(flags & 2) {
265 /* we have an array, with the number of elements stored before the first object */
266 INT_PTR i, *ptr = (INT_PTR *)this-1;
268 for(i=*ptr-1; i>=0; i--)
269 locale_facet_dtor(this+i);
270 MSVCRT_operator_delete(ptr);
271 } else {
272 locale_facet_dtor(this);
273 if(flags & 1)
274 MSVCRT_operator_delete(this);
277 return this;
280 typedef struct
282 locale_facet *fac;
283 struct list entry;
284 } facets_elem;
285 static struct list lazy_facets = LIST_INIT(lazy_facets);
287 /* Not exported from msvcp90 */
288 /* ?facet_Register@facet@locale@std@@CAXPAV123@@Z */
289 /* ?facet_Register@facet@locale@std@@CAXPEAV123@@Z */
290 void __cdecl locale_facet_register(locale_facet *add)
292 facets_elem *head = MSVCRT_operator_new(sizeof(*head));
293 if(!head) {
294 ERR("Out of memory\n");
295 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
298 head->fac = add;
299 list_add_head(&lazy_facets, &head->entry);
302 /* Not exported from msvcp90 */
303 /* ?_Register@facet@locale@std@@QAEXXZ */
304 /* ?_Register@facet@locale@std@@QEAAXXZ */
305 DEFINE_THISCALL_WRAPPER(locale_facet__Register, 4)
306 void __thiscall locale_facet__Register(locale_facet *this)
308 TRACE("(%p)\n", this);
309 locale_facet_register(this);
312 /* Not exported from msvcp90 */
313 /* ??_7facet@locale@std@@6B@ */
314 extern const vtable_ptr MSVCP_locale_facet_vtable;
316 /* ??0id@locale@std@@QAE@I@Z */
317 /* ??0id@locale@std@@QEAA@_K@Z */
318 DEFINE_THISCALL_WRAPPER(locale_id_ctor_id, 8)
319 locale_id* __thiscall locale_id_ctor_id(locale_id *this, MSVCP_size_t id)
321 TRACE("(%p %lu)\n", this, id);
323 this->id = id;
324 return this;
327 /* ??_Fid@locale@std@@QAEXXZ */
328 /* ??_Fid@locale@std@@QEAAXXZ */
329 DEFINE_THISCALL_WRAPPER(locale_id_ctor, 4)
330 locale_id* __thiscall locale_id_ctor(locale_id *this)
332 TRACE("(%p)\n", this);
334 this->id = 0;
335 return this;
338 /* ??Bid@locale@std@@QAEIXZ */
339 /* ??Bid@locale@std@@QEAA_KXZ */
340 DEFINE_THISCALL_WRAPPER(locale_id_operator_size_t, 4)
341 MSVCP_size_t __thiscall locale_id_operator_size_t(locale_id *this)
343 _Lockit lock;
345 TRACE("(%p)\n", this);
347 if(!this->id) {
348 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
349 this->id = ++locale_id__Id_cnt;
350 _Lockit_dtor(&lock);
353 return this->id;
356 /* ?_Id_cnt_func@id@locale@std@@CAAAHXZ */
357 /* ?_Id_cnt_func@id@locale@std@@CAAEAHXZ */
358 int* __cdecl locale_id__Id_cnt_func(void)
360 TRACE("\n");
361 return &locale_id__Id_cnt;
364 /* ??_Ffacet@locale@std@@QAEXXZ */
365 /* ??_Ffacet@locale@std@@QEAAXXZ */
366 DEFINE_THISCALL_WRAPPER(locale_facet_ctor, 4)
367 locale_facet* __thiscall locale_facet_ctor(locale_facet *this)
369 TRACE("(%p)\n", this);
370 this->vtable = &MSVCP_locale_facet_vtable;
371 this->refs = 0;
372 return this;
375 /* ??0facet@locale@std@@IAE@I@Z */
376 /* ??0facet@locale@std@@IEAA@_K@Z */
377 DEFINE_THISCALL_WRAPPER(locale_facet_ctor_refs, 8)
378 locale_facet* __thiscall locale_facet_ctor_refs(locale_facet *this, MSVCP_size_t refs)
380 TRACE("(%p %lu)\n", this, refs);
381 this->vtable = &MSVCP_locale_facet_vtable;
382 this->refs = refs;
383 return this;
386 /* ?_Incref@facet@locale@std@@QAEXXZ */
387 /* ?_Incref@facet@locale@std@@QEAAXXZ */
388 /* ?_Incref@facet@locale@std@@UAEXXZ */
389 /* ?_Incref@facet@locale@std@@UEAAXXZ */
390 #if _MSVCP_VER >= 110
391 #define call_locale_facet__Incref(this) CALL_VTBL_FUNC(this, 4, void, (locale_facet*), (this))
392 #else
393 #define call_locale_facet__Incref locale_facet__Incref
394 #endif
395 DEFINE_THISCALL_WRAPPER(locale_facet__Incref, 4)
396 void __thiscall locale_facet__Incref(locale_facet *this)
398 _Lockit lock;
400 TRACE("(%p)\n", this);
402 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
403 this->refs++;
404 _Lockit_dtor(&lock);
407 /* ?_Decref@facet@locale@std@@QAEPAV123@XZ */
408 /* ?_Decref@facet@locale@std@@QEAAPEAV123@XZ */
409 /* ?_Decref@facet@locale@std@@UAEPAV_Facet_base@3@XZ */
410 /* ?_Decref@facet@locale@std@@UEAAPEAV_Facet_base@3@XZ */
411 #if _MSVCP_VER >= 110
412 #define call_locale_facet__Decref(this) CALL_VTBL_FUNC(this, 8, \
413 locale_facet*, (locale_facet*), (this))
414 #else
415 #define call_locale_facet__Decref locale_facet__Decref
416 #endif
417 DEFINE_THISCALL_WRAPPER(locale_facet__Decref, 4)
418 locale_facet* __thiscall locale_facet__Decref(locale_facet *this)
420 _Lockit lock;
421 locale_facet *ret;
423 TRACE("(%p)\n", this);
425 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
426 if(this->refs)
427 this->refs--;
429 ret = this->refs ? NULL : this;
430 _Lockit_dtor(&lock);
432 return ret;
435 /* ?_Getcat@facet@locale@std@@SAIPAPBV123@PBV23@@Z */
436 /* ?_Getcat@facet@locale@std@@SA_KPEAPEBV123@PEBV23@@Z */
437 MSVCP_size_t __cdecl locale_facet__Getcat(const locale_facet **facet, const locale *loc)
439 TRACE("(%p %p)\n", facet, loc);
440 return -1;
443 /* ?_Getcat@facet@locale@std@@SAIPAPBV123@@Z */
444 /* ?_Getcat@facet@locale@std@@SA_KPEAPEBV123@@Z */
445 MSVCP_size_t __cdecl locale_facet__Getcat_old(const locale_facet **facet)
447 TRACE("(%p)\n", facet);
448 return -1;
451 /* ??0_Timevec@std@@QAE@ABV01@@Z */
452 /* ??0_Timevec@std@@QEAA@AEBV01@@Z */
453 /* This copy constructor modifies copied object */
454 DEFINE_THISCALL_WRAPPER(_Timevec_copy_ctor, 8)
455 _Timevec* __thiscall _Timevec_copy_ctor(_Timevec *this, _Timevec *copy)
457 TRACE("(%p %p)\n", this, copy);
458 this->timeptr = copy->timeptr;
459 copy->timeptr = NULL;
460 return this;
463 /* ??0_Timevec@std@@QAE@PAX@Z */
464 /* ??0_Timevec@std@@QEAA@PEAX@Z */
465 DEFINE_THISCALL_WRAPPER(_Timevec_ctor_timeptr, 8)
466 _Timevec* __thiscall _Timevec_ctor_timeptr(_Timevec *this, void *timeptr)
468 TRACE("(%p %p)\n", this, timeptr);
469 this->timeptr = timeptr;
470 return this;
473 /* ??_F_Timevec@std@@QAEXXZ */
474 /* ??_F_Timevec@std@@QEAAXXZ */
475 DEFINE_THISCALL_WRAPPER(_Timevec_ctor, 4)
476 _Timevec* __thiscall _Timevec_ctor(_Timevec *this)
478 TRACE("(%p)\n", this);
479 this->timeptr = NULL;
480 return this;
483 /* ??1_Timevec@std@@QAE@XZ */
484 /* ??1_Timevec@std@@QEAA@XZ */
485 DEFINE_THISCALL_WRAPPER(_Timevec_dtor, 4)
486 void __thiscall _Timevec_dtor(_Timevec *this)
488 TRACE("(%p)\n", this);
489 free(this->timeptr);
492 /* ??4_Timevec@std@@QAEAAV01@ABV01@@Z */
493 /* ??4_Timevec@std@@QEAAAEAV01@AEBV01@@Z */
494 DEFINE_THISCALL_WRAPPER(_Timevec_op_assign, 8)
495 _Timevec* __thiscall _Timevec_op_assign(_Timevec *this, _Timevec *right)
497 TRACE("(%p %p)\n", this, right);
498 this->timeptr = right->timeptr;
499 right->timeptr = NULL;
500 return this;
503 /* ?_Getptr@_Timevec@std@@QBEPAXXZ */
504 /* ?_Getptr@_Timevec@std@@QEBAPEAXXZ */
505 DEFINE_THISCALL_WRAPPER(_Timevec__Getptr, 4)
506 void* __thiscall _Timevec__Getptr(_Timevec *this)
508 TRACE("(%p)\n", this);
509 return this->timeptr;
512 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@HPBD@Z */
513 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@HPEBD@Z */
514 _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cat_cstr(_Locinfo *locinfo, int category, const char *locstr)
516 const char *locale = NULL;
518 /* This function is probably modifying more global objects */
519 FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr);
521 if(!locstr)
522 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
524 _Lockit_ctor_locktype(&locinfo->lock, _LOCK_LOCALE);
525 locale_string_char_ctor(&locinfo->days);
526 locale_string_char_ctor(&locinfo->months);
527 #if _MSVCP_VER >= 110
528 locale_string_wchar_ctor(&locinfo->wdays);
529 locale_string_wchar_ctor(&locinfo->wmonths);
530 #endif
531 locale_string_char_ctor_cstr(&locinfo->oldlocname, setlocale(LC_ALL, NULL));
533 if(category)
534 locale = setlocale(LC_ALL, locstr);
535 else
536 locale = setlocale(LC_ALL, NULL);
538 if(locale)
539 locale_string_char_ctor_cstr(&locinfo->newlocname, locale);
540 else
541 locale_string_char_ctor_cstr(&locinfo->newlocname, "*");
543 return locinfo;
546 /* ??0_Locinfo@std@@QAE@HPBD@Z */
547 /* ??0_Locinfo@std@@QEAA@HPEBD@Z */
548 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_cat_cstr, 12)
549 _Locinfo* __thiscall _Locinfo_ctor_cat_cstr(_Locinfo *this, int category, const char *locstr)
551 return _Locinfo__Locinfo_ctor_cat_cstr(this, category, locstr);
554 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
555 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
556 _Locinfo* __cdecl _Locinfo__Locinfo_ctor_bstr(_Locinfo *locinfo, const basic_string_char *locstr)
558 return _Locinfo__Locinfo_ctor_cat_cstr(locinfo, 1/*FIXME*/, MSVCP_basic_string_char_c_str(locstr));
561 /* ??0_Locinfo@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z */
562 /* ??0_Locinfo@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z */
563 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_bstr, 8)
564 _Locinfo* __thiscall _Locinfo_ctor_bstr(_Locinfo *this, const basic_string_char *locstr)
566 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, MSVCP_basic_string_char_c_str(locstr));
569 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z */
570 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z */
571 _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cstr(_Locinfo *locinfo, const char *locstr)
573 return _Locinfo__Locinfo_ctor_cat_cstr(locinfo, 1/*FIXME*/, locstr);
576 /* ??0_Locinfo@std@@QAE@PBD@Z */
577 /* ??0_Locinfo@std@@QEAA@PEBD@Z */
578 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_cstr, 8)
579 _Locinfo* __thiscall _Locinfo_ctor_cstr(_Locinfo *this, const char *locstr)
581 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, locstr);
584 /* ?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z */
585 /* ?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z */
586 void __cdecl _Locinfo__Locinfo_dtor(_Locinfo *locinfo)
588 TRACE("(%p)\n", locinfo);
590 setlocale(LC_ALL, locale_string_char_c_str(&locinfo->oldlocname));
591 locale_string_char_dtor(&locinfo->days);
592 locale_string_char_dtor(&locinfo->months);
593 #if _MSVCP_VER >= 110
594 locale_string_wchar_dtor(&locinfo->wdays);
595 locale_string_wchar_dtor(&locinfo->wmonths);
596 #endif
597 locale_string_char_dtor(&locinfo->oldlocname);
598 locale_string_char_dtor(&locinfo->newlocname);
599 _Lockit_dtor(&locinfo->lock);
602 /* ??_F_Locinfo@std@@QAEXXZ */
603 /* ??_F_Locinfo@std@@QEAAXXZ */
604 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor, 4)
605 _Locinfo* __thiscall _Locinfo_ctor(_Locinfo *this)
607 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, "C");
610 /* ??1_Locinfo@std@@QAE@XZ */
611 /* ??1_Locinfo@std@@QEAA@XZ */
612 DEFINE_THISCALL_WRAPPER(_Locinfo_dtor, 4)
613 void __thiscall _Locinfo_dtor(_Locinfo *this)
615 _Locinfo__Locinfo_dtor(this);
618 /* ?_Locinfo_Addcats@_Locinfo@std@@SAAAV12@PAV12@HPBD@Z */
619 /* ?_Locinfo_Addcats@_Locinfo@std@@SAAEAV12@PEAV12@HPEBD@Z */
620 _Locinfo* __cdecl _Locinfo__Locinfo_Addcats(_Locinfo *locinfo, int category, const char *locstr)
622 const char *locale = NULL;
624 /* This function is probably modifying more global objects */
625 FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr);
626 if(!locstr)
627 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
629 locale_string_char_dtor(&locinfo->newlocname);
631 if(category)
632 locale = setlocale(LC_ALL, locstr);
633 else
634 locale = setlocale(LC_ALL, NULL);
636 if(locale)
637 locale_string_char_ctor_cstr(&locinfo->newlocname, locale);
638 else
639 locale_string_char_ctor_cstr(&locinfo->newlocname, "*");
641 return locinfo;
644 /* ?_Addcats@_Locinfo@std@@QAEAAV12@HPBD@Z */
645 /* ?_Addcats@_Locinfo@std@@QEAAAEAV12@HPEBD@Z */
646 DEFINE_THISCALL_WRAPPER(_Locinfo__Addcats, 12)
647 _Locinfo* __thiscall _Locinfo__Addcats(_Locinfo *this, int category, const char *locstr)
649 return _Locinfo__Locinfo_Addcats(this, category, locstr);
652 static _Collvec* getcoll(_Collvec *ret)
654 TRACE("\n");
656 ret->page = ___lc_collate_cp_func();
657 #if _MSVCP_VER < 110
658 ret->handle = ___lc_handle_func()[LC_COLLATE];
659 #else
660 ret->lc_name = ___lc_locale_name_func()[LC_COLLATE];
661 #endif
662 return ret;
665 /* _Getcoll */
666 #if defined(__i386__) || _MSVCP_VER<110
667 ULONGLONG __cdecl _Getcoll(void)
669 ULONGLONG ret;
671 C_ASSERT(sizeof(_Collvec) <= sizeof(ULONGLONG));
673 getcoll((_Collvec*)&ret);
674 return ret;
676 #else
677 _Collvec* __cdecl _Getcoll(_Collvec *ret)
679 return getcoll(ret);
681 #endif
683 /* ?_Getcoll@_Locinfo@std@@QBE?AU_Collvec@@XZ */
684 /* ?_Getcoll@_Locinfo@std@@QEBA?AU_Collvec@@XZ */
685 DEFINE_THISCALL_WRAPPER(_Locinfo__Getcoll, 8)
686 _Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret)
688 return getcoll(ret);
691 /* _Getctype */
692 _Ctypevec* __cdecl _Getctype(_Ctypevec *ret)
694 short *table;
695 #if _MSVCP_VER >= 110
696 wchar_t *name;
697 MSVCP_size_t size;
698 #endif
700 TRACE("\n");
702 ret->page = ___lc_codepage_func();
703 #if _MSVCP_VER < 110
704 ret->handle = ___lc_handle_func()[LC_COLLATE];
705 #else
706 if((name = ___lc_locale_name_func()[LC_COLLATE])) {
707 size = wcslen(name)+1;
708 ret->name = malloc(size*sizeof(*name));
709 if(!ret->name) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
710 memcpy(ret->name, name, size*sizeof(*name));
711 } else {
712 ret->name = NULL;
714 #endif
715 ret->delfl = TRUE;
716 table = malloc(sizeof(short[256]));
717 if(!table) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
718 memcpy(table, __pctype_func(), sizeof(short[256]));
719 ret->table = table;
720 return ret;
723 /* ?_Getctype@_Locinfo@std@@QBE?AU_Ctypevec@@XZ */
724 /* ?_Getctype@_Locinfo@std@@QEBA?AU_Ctypevec@@XZ */
725 DEFINE_THISCALL_WRAPPER(_Locinfo__Getctype, 8)
726 _Ctypevec* __thiscall _Locinfo__Getctype(const _Locinfo *this, _Ctypevec *ret)
728 return _Getctype(ret);
731 /* _Getcvt */
732 #if _MSVCP_VER < 110
733 ULONGLONG __cdecl _Getcvt(void)
735 union {
736 _Cvtvec cvtvec;
737 ULONGLONG ull;
738 } ret;
740 TRACE("\n");
742 ret.cvtvec.page = ___lc_codepage_func();
743 ret.cvtvec.handle = ___lc_handle_func()[LC_CTYPE];
744 return ret.ull;
746 #else
747 _Cvtvec* __cdecl _Getcvt(_Cvtvec *ret)
749 int i;
751 TRACE("\n");
753 memset(ret, 0, sizeof(*ret));
754 ret->page = ___lc_codepage_func();
755 ret->mb_max = ___mb_cur_max_func();
757 if(ret->mb_max > 1) {
758 for(i=0; i<256; i++)
759 if(_ismbblead(i)) ret->isleadbyte[i/8] |= 1 << (i&7);
761 return ret;
763 #endif
765 /* ?_Getcvt@_Locinfo@std@@QBE?AU_Cvtvec@@XZ */
766 /* ?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@XZ */
767 DEFINE_THISCALL_WRAPPER(_Locinfo__Getcvt, 8)
768 _Cvtvec* __thiscall _Locinfo__Getcvt(const _Locinfo *this, _Cvtvec *ret)
770 #if _MSVCP_VER < 110
771 ULONGLONG ull = _Getcvt();
772 memcpy(ret, &ull, sizeof(ull));
773 #else
774 _Cvtvec cvtvec;
775 _Getcvt(&cvtvec);
776 memcpy(ret, &cvtvec, sizeof(cvtvec));
777 #endif
778 return ret;
781 int __cdecl _Getdateorder(void)
783 WCHAR date_fmt[2];
785 #if _MSVCP_VER < 110
786 if(!GetLocaleInfoW(___lc_handle_func()[LC_TIME], LOCALE_ILDATE,
787 date_fmt, sizeof(date_fmt)/sizeof(*date_fmt)))
788 return DATEORDER_no_order;
789 #else
790 if(!GetLocaleInfoEx(___lc_locale_name_func()[LC_TIME], LOCALE_ILDATE,
791 date_fmt, sizeof(date_fmt)/sizeof(*date_fmt)))
792 return DATEORDER_no_order;
793 #endif
795 if(*date_fmt == '0') return DATEORDER_mdy;
796 if(*date_fmt == '1') return DATEORDER_dmy;
797 if(*date_fmt == '2') return DATEORDER_ymd;
798 return DATEORDER_no_order;
801 /* ?_Getdateorder@_Locinfo@std@@QBEHXZ */
802 /* ?_Getdateorder@_Locinfo@std@@QEBAHXZ */
803 DEFINE_THISCALL_WRAPPER(_Locinfo__Getdateorder, 4)
804 int __thiscall _Locinfo__Getdateorder(const _Locinfo *this)
806 TRACE("(%p)\n", this);
807 return _Getdateorder();
810 /* ?_Getdays@_Locinfo@std@@QBEPBDXZ */
811 /* ?_Getdays@_Locinfo@std@@QEBAPEBDXZ */
812 DEFINE_THISCALL_WRAPPER(_Locinfo__Getdays, 4)
813 const char* __thiscall _Locinfo__Getdays(const _Locinfo *this)
815 char *days = _Getdays();
816 const char *ret;
818 TRACE("(%p)\n", this);
820 if(days) {
821 locale_string_char_dtor((locale_string *)&this->days);
822 locale_string_char_ctor_cstr((locale_string *)&this->days, days);
823 free(days);
826 ret = locale_string_char_c_str(&this->days);
827 if (!ret[0]) ret = ":Sun:Sunday:Mon:Monday:Tue:Tuesday:Wed:Wednesday:Thu:Thursday:Fri:Friday:Sat:Saturday";
828 return ret;
831 #if _MSVCP_VER >= 110
832 /* ?_W_Getdays@_Locinfo@std@@QBEPBGXZ */
833 /* ?_W_Getdays@_Locinfo@std@@QEBAPEBGXZ */
834 DEFINE_THISCALL_WRAPPER(_Locinfo__W_Getdays, 4)
835 const wchar_t* __thiscall _Locinfo__W_Getdays(const _Locinfo *this)
837 static const wchar_t defdays[] =
839 ':','S','u','n',':','S','u','n','d','a','y',
840 ':','M','o','n',':','M','o','n','d','a','y',
841 ':','T','u','e',':','T','u','e','s','d','a','y',
842 ':','W','e','d',':','W','e','d','n','e','s','d','a','y',
843 ':','T','h','u',':','T','h','u','r','s','d','a','y',
844 ':','F','r','i',':','F','r','i','d','a','y',
845 ':','S','a','t',':','S','a','t','u','r','d','a','y'
847 wchar_t *wdays = _W_Getdays();
848 const wchar_t *ret;
850 TRACE("(%p)\n", this);
852 if(wdays) {
853 locale_string_wchar_assign((locale_string_wchar *)&this->wdays, wdays);
854 free(wdays);
857 ret = locale_string_wchar_c_str(&this->wdays);
858 if (!ret[0]) ret = defdays;
859 return ret;
862 /* ?_W_Getmonths@_Locinfo@std@@QBEPBGXZ */
863 /* ?_W_Getmonths@_Locinfo@std@@QEBAPEBGXZ */
864 DEFINE_THISCALL_WRAPPER(_Locinfo__W_Getmonths, 4)
865 const wchar_t* __thiscall _Locinfo__W_Getmonths(const _Locinfo *this)
867 static const wchar_t defmonths[] =
869 ':','J','a','n',':','J','a','n','u','a','r','y',
870 ':','F','e','b',':','F','e','b','r','u','a','r','y',
871 ':','M','a','r',':','M','a','r','c','h',
872 ':','A','p','r',':','A','p','r','i','l',
873 ':','M','a','y',':','M','a','y',
874 ':','J','u','n',':','J','u','n','e',
875 ':','J','u','l',':','J','u','l','y',
876 ':','A','u','g',':','A','u','g','u','s','t',
877 ':','S','e','p',':','S','e','p','t','e','m','b','e','r',
878 ':','O','c','t',':','O','c','t','o','b','e','r',
879 ':','N','o','v',':','N','o','v','e','m','b','e','r',
880 ':','D','e','c',':','D','e','c','e','m','b','e','r'
882 wchar_t *wmonths = _W_Getmonths();
883 const wchar_t *ret;
885 TRACE("(%p)\n", this);
887 if(wmonths) {
888 locale_string_wchar_assign((locale_string_wchar *)&this->wmonths, wmonths);
889 free(wmonths);
892 ret = locale_string_wchar_c_str(&this->wmonths);
893 if (!ret[0]) ret = defmonths;
894 return ret;
896 #endif
898 /* ?_Getmonths@_Locinfo@std@@QBEPBDXZ */
899 /* ?_Getmonths@_Locinfo@std@@QEBAPEBDXZ */
900 DEFINE_THISCALL_WRAPPER(_Locinfo__Getmonths, 4)
901 const char* __thiscall _Locinfo__Getmonths(const _Locinfo *this)
903 char *months = _Getmonths();
904 const char *ret;
906 TRACE("(%p)\n", this);
908 if(months) {
909 locale_string_char_dtor((locale_string *)&this->months);
910 locale_string_char_ctor_cstr((locale_string *)&this->months, months);
911 free(months);
914 ret = locale_string_char_c_str(&this->months);
915 if (!ret[0]) ret = ":Jan:January:Feb:February:Mar:March:Apr:April:May:May:Jun:June:Jul:July"
916 ":Aug:August:Sep:September:Oct:October:Nov:November:Dec:December";
917 return ret;
920 /* ?_Getfalse@_Locinfo@std@@QBEPBDXZ */
921 /* ?_Getfalse@_Locinfo@std@@QEBAPEBDXZ */
922 DEFINE_THISCALL_WRAPPER(_Locinfo__Getfalse, 4)
923 const char* __thiscall _Locinfo__Getfalse(const _Locinfo *this)
925 TRACE("(%p)\n", this);
926 return "false";
929 /* ?_Gettrue@_Locinfo@std@@QBEPBDXZ */
930 /* ?_Gettrue@_Locinfo@std@@QEBAPEBDXZ */
931 DEFINE_THISCALL_WRAPPER(_Locinfo__Gettrue, 4)
932 const char* __thiscall _Locinfo__Gettrue(const _Locinfo *this)
934 TRACE("(%p)\n", this);
935 return "true";
938 /* ?_Getlconv@_Locinfo@std@@QBEPBUlconv@@XZ */
939 /* ?_Getlconv@_Locinfo@std@@QEBAPEBUlconv@@XZ */
940 DEFINE_THISCALL_WRAPPER(_Locinfo__Getlconv, 4)
941 const struct lconv* __thiscall _Locinfo__Getlconv(const _Locinfo *this)
943 TRACE("(%p)\n", this);
944 return localeconv();
947 /* ?_Gettnames@_Locinfo@std@@QBE?AV_Timevec@2@XZ */
948 /* ?_Gettnames@_Locinfo@std@@QEBA?AV_Timevec@2@XZ */
949 DEFINE_THISCALL_WRAPPER(_Locinfo__Gettnames, 8)
950 _Timevec*__thiscall _Locinfo__Gettnames(const _Locinfo *this, _Timevec *ret)
952 TRACE("(%p)\n", this);
954 _Timevec_ctor_timeptr(ret, _Gettnames());
955 return ret;
958 /* ?id@?$collate@D@std@@2V0locale@2@A */
959 locale_id collate_char_id = {0};
961 /* ??_7?$collate@D@std@@6B@ */
962 extern const vtable_ptr MSVCP_collate_char_vtable;
964 /* ?_Init@?$collate@D@std@@IAEXABV_Locinfo@2@@Z */
965 /* ?_Init@?$collate@D@std@@IEAAXAEBV_Locinfo@2@@Z */
966 DEFINE_THISCALL_WRAPPER(collate_char__Init, 8)
967 void __thiscall collate_char__Init(collate *this, const _Locinfo *locinfo)
969 TRACE("(%p %p)\n", this, locinfo);
970 _Locinfo__Getcoll(locinfo, &this->coll);
973 /* ??0?$collate@D@std@@IAE@PBDI@Z */
974 /* ??0?$collate@D@std@@IEAA@PEBD_K@Z */
975 DEFINE_THISCALL_WRAPPER(collate_char_ctor_name, 12)
976 collate* __thiscall collate_char_ctor_name(collate *this, const char *name, MSVCP_size_t refs)
978 _Locinfo locinfo;
980 TRACE("(%p %s %lu)\n", this, name, refs);
982 locale_facet_ctor_refs(&this->facet, refs);
983 this->facet.vtable = &MSVCP_collate_char_vtable;
985 _Locinfo_ctor_cstr(&locinfo, name);
986 collate_char__Init(this, &locinfo);
987 _Locinfo_dtor(&locinfo);
988 return this;
991 /* ??0?$collate@D@std@@QAE@ABV_Locinfo@1@I@Z */
992 /* ??0?$collate@D@std@@QEAA@AEBV_Locinfo@1@_K@Z */
993 DEFINE_THISCALL_WRAPPER(collate_char_ctor_locinfo, 12)
994 collate* __thiscall collate_char_ctor_locinfo(collate *this, const _Locinfo *locinfo, MSVCP_size_t refs)
996 TRACE("(%p %p %lu)\n", this, locinfo, refs);
998 locale_facet_ctor_refs(&this->facet, refs);
999 this->facet.vtable = &MSVCP_collate_char_vtable;
1000 collate_char__Init(this, locinfo);
1001 return this;
1004 /* ??0?$collate@D@std@@QAE@I@Z */
1005 /* ??0?$collate@D@std@@QEAA@_K@Z */
1006 DEFINE_THISCALL_WRAPPER(collate_char_ctor_refs, 8)
1007 collate* __thiscall collate_char_ctor_refs(collate *this, MSVCP_size_t refs)
1009 return collate_char_ctor_name(this, "C", refs);
1012 /* ??1?$collate@D@std@@UAE@XZ */
1013 /* ??1?$collate@D@std@@UEAA@XZ */
1014 /* ??1?$collate@D@std@@MAE@XZ */
1015 /* ??1?$collate@D@std@@MEAA@XZ */
1016 DEFINE_THISCALL_WRAPPER(collate_char_dtor, 4)
1017 void __thiscall collate_char_dtor(collate *this)
1019 TRACE("(%p)\n", this);
1022 DEFINE_THISCALL_WRAPPER(collate_char_vector_dtor, 8)
1023 collate* __thiscall collate_char_vector_dtor(collate *this, unsigned int flags)
1025 TRACE("(%p %x)\n", this, flags);
1026 if(flags & 2) {
1027 /* we have an array, with the number of elements stored before the first object */
1028 INT_PTR i, *ptr = (INT_PTR *)this-1;
1030 for(i=*ptr-1; i>=0; i--)
1031 collate_char_dtor(this+i);
1032 MSVCRT_operator_delete(ptr);
1033 } else {
1034 collate_char_dtor(this);
1035 if(flags & 1)
1036 MSVCRT_operator_delete(this);
1039 return this;
1042 /* ??_F?$collate@D@std@@QAEXXZ */
1043 /* ??_F?$collate@D@std@@QEAAXXZ */
1044 DEFINE_THISCALL_WRAPPER(collate_char_ctor, 4)
1045 collate* __thiscall collate_char_ctor(collate *this)
1047 return collate_char_ctor_name(this, "C", 0);
1050 /* ?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1051 /* ?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1052 MSVCP_size_t __cdecl collate_char__Getcat(const locale_facet **facet, const locale *loc)
1054 TRACE("(%p %p)\n", facet, loc);
1056 if(facet && !*facet) {
1057 *facet = MSVCRT_operator_new(sizeof(collate));
1058 if(!*facet) {
1059 ERR("Out of memory\n");
1060 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
1061 return 0;
1063 collate_char_ctor_name((collate*)*facet,
1064 locale_string_char_c_str(&loc->ptr->name), 0);
1067 return LC_COLLATE;
1070 /* ?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@@Z */
1071 /* ?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@@Z */
1072 MSVCP_size_t __cdecl collate_char__Getcat_old(const locale_facet **facet)
1074 return collate_char__Getcat(facet, locale_classic());
1077 static collate* collate_char_use_facet(const locale *loc)
1079 static collate *obj = NULL;
1081 _Lockit lock;
1082 const locale_facet *fac;
1084 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
1085 fac = locale__Getfacet(loc, locale_id_operator_size_t(&collate_char_id));
1086 if(fac) {
1087 _Lockit_dtor(&lock);
1088 return (collate*)fac;
1091 if(obj) {
1092 _Lockit_dtor(&lock);
1093 return obj;
1096 collate_char__Getcat(&fac, loc);
1097 obj = (collate*)fac;
1098 call_locale_facet__Incref(&obj->facet);
1099 locale_facet_register(&obj->facet);
1100 _Lockit_dtor(&lock);
1102 return obj;
1105 /* _Strcoll */
1106 int __cdecl _Strcoll(const char *first1, const char *last1, const char *first2,
1107 const char *last2, const _Collvec *coll)
1109 LCID lcid;
1111 TRACE("(%s %s)\n", debugstr_an(first1, last1-first1), debugstr_an(first2, last2-first2));
1113 #if _MSVCP_VER < 110
1114 lcid = (coll ? coll->handle : ___lc_handle_func()[LC_COLLATE]);
1115 #else
1116 lcid = LocaleNameToLCID(coll ? coll->lc_name : ___lc_locale_name_func()[LC_COLLATE], 0);
1117 #endif
1118 return CompareStringA(lcid, 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL;
1121 /* ?do_compare@?$collate@D@std@@MBEHPBD000@Z */
1122 /* ?do_compare@?$collate@D@std@@MEBAHPEBD000@Z */
1123 DEFINE_THISCALL_WRAPPER(collate_char_do_compare, 20)
1124 #if _MSVCP_VER <= 100
1125 #define call_collate_char_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 4, int, \
1126 (const collate*, const char*, const char*, const char*, const char*), \
1127 (this, first1, last1, first2, last2))
1128 #else
1129 #define call_collate_char_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 12, int, \
1130 (const collate*, const char*, const char*, const char*, const char*), \
1131 (this, first1, last1, first2, last2))
1132 #endif
1133 int __thiscall collate_char_do_compare(const collate *this, const char *first1,
1134 const char *last1, const char *first2, const char *last2)
1136 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
1137 return _Strcoll(first1, last1, first2, last2, &this->coll);
1140 /* ?compare@?$collate@D@std@@QBEHPBD000@Z */
1141 /* ?compare@?$collate@D@std@@QEBAHPEBD000@Z */
1142 DEFINE_THISCALL_WRAPPER(collate_char_compare, 20)
1143 int __thiscall collate_char_compare(const collate *this, const char *first1,
1144 const char *last1, const char *first2, const char *last2)
1146 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
1147 return call_collate_char_do_compare(this, first1, last1, first2, last2);
1150 /* ?do_hash@?$collate@D@std@@MBEJPBD0@Z */
1151 /* ?do_hash@?$collate@D@std@@MEBAJPEBD0@Z */
1152 DEFINE_THISCALL_WRAPPER(collate_char_do_hash, 12)
1153 #if _MSVCP_VER <= 100
1154 #define call_collate_char_do_hash(this, first, last) CALL_VTBL_FUNC(this, 12, LONG, \
1155 (const collate*, const char*, const char*), (this, first, last))
1156 #else
1157 #define call_collate_char_do_hash(this, first, last) CALL_VTBL_FUNC(this, 20, LONG, \
1158 (const collate*, const char*, const char*), (this, first, last))
1159 #endif
1160 LONG __thiscall collate_char_do_hash(const collate *this,
1161 const char *first, const char *last)
1163 ULONG ret = 0;
1165 TRACE("(%p %p %p)\n", this, first, last);
1167 for(; first<last; first++)
1168 ret = (ret<<8 | ret>>24) + *first;
1169 return ret;
1172 /* ?hash@?$collate@D@std@@QBEJPBD0@Z */
1173 /* ?hash@?$collate@D@std@@QEBAJPEBD0@Z */
1174 DEFINE_THISCALL_WRAPPER(collate_char_hash, 12)
1175 LONG __thiscall collate_char_hash(const collate *this,
1176 const char *first, const char *last)
1178 TRACE("(%p %p %p)\n", this, first, last);
1179 return call_collate_char_do_hash(this, first, last);
1182 /* ?do_transform@?$collate@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PBD0@Z */
1183 /* ?do_transform@?$collate@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PEBD0@Z */
1184 DEFINE_THISCALL_WRAPPER(collate_char_do_transform, 16)
1185 basic_string_char* __thiscall collate_char_do_transform(const collate *this,
1186 basic_string_char *ret, const char *first, const char *last)
1188 FIXME("(%p %p %p) stub\n", this, first, last);
1189 return ret;
1192 /* ?transform@?$collate@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PBD0@Z */
1193 /* ?transform@?$collate@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PEBD0@Z */
1194 DEFINE_THISCALL_WRAPPER(collate_char_transform, 16)
1195 basic_string_char* __thiscall collate_char_transform(const collate *this,
1196 basic_string_char *ret, const char *first, const char *last)
1198 FIXME("(%p %p %p) stub\n", this, first, last);
1199 return ret;
1202 /* ?id@?$collate@_W@std@@2V0locale@2@A */
1203 locale_id collate_wchar_id = {0};
1204 /* ?id@?$collate@G@std@@2V0locale@2@A */
1205 locale_id collate_short_id = {0};
1207 /* ??_7?$collate@_W@std@@6B@ */
1208 extern const vtable_ptr MSVCP_collate_wchar_vtable;
1209 /* ??_7?$collate@G@std@@6B@ */
1210 extern const vtable_ptr MSVCP_collate_short_vtable;
1212 /* ?_Init@?$collate@_W@std@@IAEXABV_Locinfo@2@@Z */
1213 /* ?_Init@?$collate@_W@std@@IEAAXAEBV_Locinfo@2@@Z */
1214 /* ?_Init@?$collate@G@std@@IAEXABV_Locinfo@2@@Z */
1215 /* ?_Init@?$collate@G@std@@IEAAXAEBV_Locinfo@2@@Z */
1216 DEFINE_THISCALL_WRAPPER(collate_wchar__Init, 8)
1217 void __thiscall collate_wchar__Init(collate *this, const _Locinfo *locinfo)
1219 TRACE("(%p %p)\n", this, locinfo);
1220 _Locinfo__Getcoll(locinfo, &this->coll);
1223 /* ??0?$collate@_W@std@@IAE@PBDI@Z */
1224 /* ??0?$collate@_W@std@@IEAA@PEBD_K@Z */
1225 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_name, 12)
1226 collate* __thiscall collate_wchar_ctor_name(collate *this, const char *name, MSVCP_size_t refs)
1228 _Locinfo locinfo;
1230 TRACE("(%p %s %lu)\n", this, name, refs);
1232 locale_facet_ctor_refs(&this->facet, refs);
1233 this->facet.vtable = &MSVCP_collate_wchar_vtable;
1235 _Locinfo_ctor_cstr(&locinfo, name);
1236 collate_wchar__Init(this, &locinfo);
1237 _Locinfo_dtor(&locinfo);
1238 return this;
1241 /* ??0?$collate@G@std@@IAE@PBDI@Z */
1242 /* ??0?$collate@G@std@@IEAA@PEBD_K@Z */
1243 DEFINE_THISCALL_WRAPPER(collate_short_ctor_name, 12)
1244 collate* __thiscall collate_short_ctor_name(collate *this, const char *name, MSVCP_size_t refs)
1246 collate *ret = collate_wchar_ctor_name(this, name, refs);
1247 ret->facet.vtable = &MSVCP_collate_short_vtable;
1248 return ret;
1251 /* ??0?$collate@_W@std@@QAE@ABV_Locinfo@1@I@Z */
1252 /* ??0?$collate@_W@std@@QEAA@AEBV_Locinfo@1@_K@Z */
1253 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_locinfo, 12)
1254 collate* __thiscall collate_wchar_ctor_locinfo(collate *this, const _Locinfo *locinfo, MSVCP_size_t refs)
1256 TRACE("(%p %p %lu)\n", this, locinfo, refs);
1258 locale_facet_ctor_refs(&this->facet, refs);
1259 this->facet.vtable = &MSVCP_collate_wchar_vtable;
1260 collate_wchar__Init(this, locinfo);
1261 return this;
1264 /* ??0?$collate@G@std@@QAE@ABV_Locinfo@1@I@Z */
1265 /* ??0?$collate@G@std@@QEAA@AEBV_Locinfo@1@_K@Z */
1266 DEFINE_THISCALL_WRAPPER(collate_short_ctor_locinfo, 12)
1267 collate* __thiscall collate_short_ctor_locinfo(collate *this, const _Locinfo *locinfo, MSVCP_size_t refs)
1269 collate *ret = collate_wchar_ctor_locinfo(this, locinfo, refs);
1270 ret->facet.vtable = &MSVCP_collate_short_vtable;
1271 return ret;
1274 /* ??0?$collate@_W@std@@QAE@I@Z */
1275 /* ??0?$collate@_W@std@@QEAA@_K@Z */
1276 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_refs, 8)
1277 collate* __thiscall collate_wchar_ctor_refs(collate *this, MSVCP_size_t refs)
1279 return collate_wchar_ctor_name(this, "C", refs);
1282 /* ??0?$collate@G@std@@QAE@I@Z */
1283 /* ??0?$collate@G@std@@QEAA@_K@Z */
1284 DEFINE_THISCALL_WRAPPER(collate_short_ctor_refs, 8)
1285 collate* __thiscall collate_short_ctor_refs(collate *this, MSVCP_size_t refs)
1287 collate *ret = collate_wchar_ctor_refs(this, refs);
1288 ret->facet.vtable = &MSVCP_collate_short_vtable;
1289 return ret;
1292 /* ??1?$collate@G@std@@UAE@XZ */
1293 /* ??1?$collate@G@std@@UEAA@XZ */
1294 /* ??1?$collate@_W@std@@MAE@XZ */
1295 /* ??1?$collate@_W@std@@MEAA@XZ */
1296 /* ??1?$collate@G@std@@MAE@XZ */
1297 /* ??1?$collate@G@std@@MEAA@XZ */
1298 DEFINE_THISCALL_WRAPPER(collate_wchar_dtor, 4)
1299 void __thiscall collate_wchar_dtor(collate *this)
1301 TRACE("(%p)\n", this);
1304 DEFINE_THISCALL_WRAPPER(collate_wchar_vector_dtor, 8)
1305 collate* __thiscall collate_wchar_vector_dtor(collate *this, unsigned int flags)
1307 TRACE("(%p %x)\n", this, flags);
1308 if(flags & 2) {
1309 /* we have an array, with the number of elements stored before the first object */
1310 INT_PTR i, *ptr = (INT_PTR *)this-1;
1312 for(i=*ptr-1; i>=0; i--)
1313 collate_wchar_dtor(this+i);
1314 MSVCRT_operator_delete(ptr);
1315 } else {
1316 collate_wchar_dtor(this);
1317 if(flags & 1)
1318 MSVCRT_operator_delete(this);
1321 return this;
1324 /* ??_F?$collate@_W@std@@QAEXXZ */
1325 /* ??_F?$collate@_W@std@@QEAAXXZ */
1326 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor, 4)
1327 collate* __thiscall collate_wchar_ctor(collate *this)
1329 return collate_wchar_ctor_name(this, "C", 0);
1332 /* ??_F?$collate@G@std@@QAEXXZ */
1333 /* ??_F?$collate@G@std@@QEAAXXZ */
1334 DEFINE_THISCALL_WRAPPER(collate_short_ctor, 4)
1335 collate* __thiscall collate_short_ctor(collate *this)
1337 collate *ret = collate_wchar_ctor(this);
1338 ret->facet.vtable = &MSVCP_collate_short_vtable;
1339 return ret;
1342 /* ?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1343 /* ?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1344 MSVCP_size_t __cdecl collate_wchar__Getcat(const locale_facet **facet, const locale *loc)
1346 TRACE("(%p %p)\n", facet, loc);
1348 if(facet && !*facet) {
1349 *facet = MSVCRT_operator_new(sizeof(collate));
1350 if(!*facet) {
1351 ERR("Out of memory\n");
1352 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
1353 return 0;
1355 collate_wchar_ctor_name((collate*)*facet,
1356 locale_string_char_c_str(&loc->ptr->name), 0);
1359 return LC_COLLATE;
1362 /* ?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@@Z */
1363 /* ?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z */
1364 MSVCP_size_t __cdecl collate_wchar__Getcat_old(const locale_facet **facet)
1366 return collate_wchar__Getcat(facet, locale_classic());
1369 static collate* collate_wchar_use_facet(const locale *loc)
1371 static collate *obj = NULL;
1373 _Lockit lock;
1374 const locale_facet *fac;
1376 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
1377 fac = locale__Getfacet(loc, locale_id_operator_size_t(&collate_wchar_id));
1378 if(fac) {
1379 _Lockit_dtor(&lock);
1380 return (collate*)fac;
1383 if(obj) {
1384 _Lockit_dtor(&lock);
1385 return obj;
1388 collate_wchar__Getcat(&fac, loc);
1389 obj = (collate*)fac;
1390 call_locale_facet__Incref(&obj->facet);
1391 locale_facet_register(&obj->facet);
1392 _Lockit_dtor(&lock);
1394 return obj;
1397 /* ?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1398 /* ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1399 MSVCP_size_t __cdecl collate_short__Getcat(const locale_facet **facet, const locale *loc)
1401 if(facet && !*facet) {
1402 collate_wchar__Getcat(facet, loc);
1403 (*(locale_facet**)facet)->vtable = &MSVCP_collate_short_vtable;
1406 return LC_COLLATE;
1409 /* ?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@@Z */
1410 /* ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@@Z */
1411 MSVCP_size_t __cdecl collate_short__Getcat_old(const locale_facet **facet)
1413 return collate_short__Getcat(facet, locale_classic());
1416 static collate* collate_short_use_facet(const locale *loc)
1418 static collate *obj = NULL;
1420 _Lockit lock;
1421 const locale_facet *fac;
1423 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
1424 fac = locale__Getfacet(loc, locale_id_operator_size_t(&collate_short_id));
1425 if(fac) {
1426 _Lockit_dtor(&lock);
1427 return (collate*)fac;
1430 if(obj) {
1431 _Lockit_dtor(&lock);
1432 return obj;
1435 collate_short__Getcat(&fac, loc);
1436 obj = (collate*)fac;
1437 call_locale_facet__Incref(&obj->facet);
1438 locale_facet_register(&obj->facet);
1439 _Lockit_dtor(&lock);
1441 return obj;
1444 /* _Wcscoll */
1445 int __cdecl _Wcscoll(const wchar_t *first1, const wchar_t *last1, const wchar_t *first2,
1446 const wchar_t *last2, const _Collvec *coll)
1448 TRACE("(%s %s)\n", debugstr_wn(first1, last1-first1), debugstr_wn(first2, last2-first2));
1450 #if _MSVCP_VER < 110
1451 return CompareStringW(coll ? coll->handle : ___lc_handle_func()[LC_COLLATE],
1452 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL;
1453 #else
1454 return CompareStringEx(coll ? coll->lc_name : ___lc_locale_name_func()[LC_COLLATE],
1455 0, first1, last1-first1, first2, last2-first2, NULL, NULL, 0)-CSTR_EQUAL;
1456 #endif
1459 /* ?do_compare@?$collate@_W@std@@MBEHPB_W000@Z */
1460 /* ?do_compare@?$collate@_W@std@@MEBAHPEB_W000@Z */
1461 /* ?do_compare@?$collate@G@std@@MBEHPBG000@Z */
1462 /* ?do_compare@?$collate@G@std@@MEBAHPEBG000@Z */
1463 DEFINE_THISCALL_WRAPPER(collate_wchar_do_compare, 20)
1464 #if _MSVCP_VER <= 100
1465 #define call_collate_wchar_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 4, int, \
1466 (const collate*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*), \
1467 (this, first1, last1, first2, last2))
1468 #else
1469 #define call_collate_wchar_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 12, int, \
1470 (const collate*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*), \
1471 (this, first1, last1, first2, last2))
1472 #endif
1473 int __thiscall collate_wchar_do_compare(const collate *this, const wchar_t *first1,
1474 const wchar_t *last1, const wchar_t *first2, const wchar_t *last2)
1476 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
1477 return _Wcscoll(first1, last1, first2, last2, &this->coll);
1480 /* ?compare@?$collate@_W@std@@QBEHPB_W000@Z */
1481 /* ?compare@?$collate@_W@std@@QEBAHPEB_W000@Z */
1482 /* ?compare@?$collate@G@std@@QBEHPBG000@Z */
1483 /* ?compare@?$collate@G@std@@QEBAHPEBG000@Z */
1484 DEFINE_THISCALL_WRAPPER(collate_wchar_compare, 20)
1485 int __thiscall collate_wchar_compare(const collate *this, const wchar_t *first1,
1486 const wchar_t *last1, const wchar_t *first2, const wchar_t *last2)
1488 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
1489 return call_collate_wchar_do_compare(this, first1, last1, first2, last2);
1492 /* ?do_hash@?$collate@_W@std@@MBEJPB_W0@Z */
1493 /* ?do_hash@?$collate@_W@std@@MEBAJPEB_W0@Z */
1494 /* ?do_hash@?$collate@G@std@@MBEJPBG0@Z */
1495 /* ?do_hash@?$collate@G@std@@MEBAJPEBG0@Z */
1496 DEFINE_THISCALL_WRAPPER(collate_wchar_do_hash, 12)
1497 #if _MSVCP_VER <= 100
1498 #define call_collate_wchar_do_hash(this, first, last) CALL_VTBL_FUNC(this, 12, LONG, \
1499 (const collate*, const wchar_t*, const wchar_t*), (this, first, last))
1500 #else
1501 #define call_collate_wchar_do_hash(this, first, last) CALL_VTBL_FUNC(this, 20, LONG, \
1502 (const collate*, const wchar_t*, const wchar_t*), (this, first, last))
1503 #endif
1504 LONG __thiscall collate_wchar_do_hash(const collate *this,
1505 const wchar_t *first, const wchar_t *last)
1507 ULONG ret = 0;
1509 TRACE("(%p %p %p)\n", this, first, last);
1511 for(; first<last; first++)
1512 ret = (ret<<8 | ret>>24) + *first;
1513 return ret;
1516 /* ?hash@?$collate@_W@std@@QBEJPB_W0@Z */
1517 /* ?hash@?$collate@_W@std@@QEBAJPEB_W0@Z */
1518 /* ?hash@?$collate@G@std@@QBEJPBG0@Z */
1519 /* ?hash@?$collate@G@std@@QEBAJPEBG0@Z */
1520 DEFINE_THISCALL_WRAPPER(collate_wchar_hash, 12)
1521 LONG __thiscall collate_wchar_hash(const collate *this,
1522 const wchar_t *first, const wchar_t *last)
1524 TRACE("(%p %p %p)\n", this, first, last);
1525 return call_collate_wchar_do_hash(this, first, last);
1528 /* ?do_transform@?$collate@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PB_W0@Z */
1529 /* ?do_transform@?$collate@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z */
1530 /* ?do_transform@?$collate@G@std@@MBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PBG0@Z */
1531 /* ?do_transform@?$collate@G@std@@MEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PEBG0@Z */
1532 DEFINE_THISCALL_WRAPPER(collate_wchar_do_transform, 16)
1533 basic_string_wchar* __thiscall collate_wchar_do_transform(const collate *this,
1534 basic_string_wchar *ret, const wchar_t *first, const wchar_t *last)
1536 FIXME("(%p %p %p) stub\n", this, first, last);
1537 return ret;
1540 /* ?transform@?$collate@_W@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PB_W0@Z */
1541 /* ?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z */
1542 /* ?transform@?$collate@G@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PBG0@Z */
1543 /* ?transform@?$collate@G@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PEBG0@Z */
1544 DEFINE_THISCALL_WRAPPER(collate_wchar_transform, 16)
1545 basic_string_wchar* __thiscall collate_wchar_transform(const collate *this,
1546 basic_string_wchar *ret, const wchar_t *first, const wchar_t *last)
1548 FIXME("(%p %p %p) stub\n", this, first, last);
1549 return ret;
1552 /* ??_7ctype_base@std@@6B@ */
1553 extern const vtable_ptr MSVCP_ctype_base_vtable;
1555 /* ??0ctype_base@std@@QAE@I@Z */
1556 /* ??0ctype_base@std@@QEAA@_K@Z */
1557 DEFINE_THISCALL_WRAPPER(ctype_base_ctor_refs, 8)
1558 ctype_base* __thiscall ctype_base_ctor_refs(ctype_base *this, MSVCP_size_t refs)
1560 TRACE("(%p %lu)\n", this, refs);
1561 locale_facet_ctor_refs(&this->facet, refs);
1562 this->facet.vtable = &MSVCP_ctype_base_vtable;
1563 return this;
1566 /* ??_Fctype_base@std@@QAEXXZ */
1567 /* ??_Fctype_base@std@@QEAAXXZ */
1568 DEFINE_THISCALL_WRAPPER(ctype_base_ctor, 4)
1569 ctype_base* __thiscall ctype_base_ctor(ctype_base *this)
1571 TRACE("(%p)\n", this);
1572 locale_facet_ctor_refs(&this->facet, 0);
1573 this->facet.vtable = &MSVCP_ctype_base_vtable;
1574 return this;
1577 /* ??1ctype_base@std@@UAE@XZ */
1578 /* ??1ctype_base@std@@UEAA@XZ */
1579 DEFINE_THISCALL_WRAPPER(ctype_base_dtor, 4)
1580 void __thiscall ctype_base_dtor(ctype_base *this)
1582 TRACE("(%p)\n", this);
1585 DEFINE_THISCALL_WRAPPER(ctype_base_vector_dtor, 8)
1586 ctype_base* __thiscall ctype_base_vector_dtor(ctype_base *this, unsigned int flags)
1588 TRACE("(%p %x)\n", this, flags);
1589 if(flags & 2) {
1590 /* we have an array, with the number of elements stored before the first object */
1591 INT_PTR i, *ptr = (INT_PTR *)this-1;
1593 for(i=*ptr-1; i>=0; i--)
1594 ctype_base_dtor(this+i);
1595 MSVCRT_operator_delete(ptr);
1596 } else {
1597 ctype_base_dtor(this);
1598 if(flags & 1)
1599 MSVCRT_operator_delete(this);
1602 return this;
1605 /* ?_Xran@ctype_base@std@@KAXXZ */
1606 void __cdecl ctype_base__Xran(void)
1608 throw_exception(EXCEPTION_OUT_OF_RANGE, "out of range in ctype<T>");
1611 /* ?id@?$ctype@D@std@@2V0locale@2@A */
1612 locale_id ctype_char_id = {0};
1613 /* ?table_size@?$ctype@D@std@@2IB */
1614 /* ?table_size@?$ctype@D@std@@2_KB */
1615 MSVCP_size_t ctype_char_table_size = 256;
1617 /* ??_7?$ctype@D@std@@6B@ */
1618 extern const vtable_ptr MSVCP_ctype_char_vtable;
1620 /* ?_Id_func@?$ctype@D@std@@SAAAVid@locale@2@XZ */
1621 /* ?_Id_func@?$ctype@D@std@@SAAEAVid@locale@2@XZ */
1622 locale_id* __cdecl ctype_char__Id_func(void)
1624 TRACE("()\n");
1625 return &ctype_char_id;
1628 /* ?_Init@?$ctype@D@std@@IAEXABV_Locinfo@2@@Z */
1629 /* ?_Init@?$ctype@D@std@@IEAAXAEBV_Locinfo@2@@Z */
1630 DEFINE_THISCALL_WRAPPER(ctype_char__Init, 8)
1631 void __thiscall ctype_char__Init(ctype_char *this, const _Locinfo *locinfo)
1633 TRACE("(%p %p)\n", this, locinfo);
1634 _Locinfo__Getctype(locinfo, &this->ctype);
1637 /* ?_Tidy@?$ctype@D@std@@IAEXXZ */
1638 /* ?_Tidy@?$ctype@D@std@@IEAAXXZ */
1639 DEFINE_THISCALL_WRAPPER(ctype_char__Tidy, 4)
1640 void __thiscall ctype_char__Tidy(ctype_char *this)
1642 TRACE("(%p)\n", this);
1644 if(this->ctype.delfl)
1645 free((short*)this->ctype.table);
1646 #if _MSVCP_VER >= 110
1647 free(this->ctype.name);
1648 #endif
1651 /* ?classic_table@?$ctype@D@std@@KAPBFXZ */
1652 /* ?classic_table@?$ctype@D@std@@KAPEBFXZ */
1653 const short* __cdecl ctype_char_classic_table(void)
1655 ctype_char *ctype;
1657 TRACE("()\n");
1658 ctype = ctype_char_use_facet( locale_classic() );
1659 return ctype->ctype.table;
1662 /* ??0?$ctype@D@std@@QAE@ABV_Locinfo@1@I@Z */
1663 /* ??0?$ctype@D@std@@QEAA@AEBV_Locinfo@1@_K@Z */
1664 DEFINE_THISCALL_WRAPPER(ctype_char_ctor_locinfo, 12)
1665 ctype_char* __thiscall ctype_char_ctor_locinfo(ctype_char *this,
1666 const _Locinfo *locinfo, MSVCP_size_t refs)
1668 TRACE("(%p %p %lu)\n", this, locinfo, refs);
1669 ctype_base_ctor_refs(&this->base, refs);
1670 this->base.facet.vtable = &MSVCP_ctype_char_vtable;
1671 ctype_char__Init(this, locinfo);
1672 return this;
1675 /* ??0?$ctype@D@std@@QAE@PBF_NI@Z */
1676 /* ??0?$ctype@D@std@@QEAA@PEBF_N_K@Z */
1677 DEFINE_THISCALL_WRAPPER(ctype_char_ctor_table, 16)
1678 ctype_char* __thiscall ctype_char_ctor_table(ctype_char *this,
1679 const short *table, MSVCP_bool delete, MSVCP_size_t refs)
1681 _Locinfo locinfo;
1683 TRACE("(%p %p %d %lu)\n", this, table, delete, refs);
1685 ctype_base_ctor_refs(&this->base, refs);
1686 this->base.facet.vtable = &MSVCP_ctype_char_vtable;
1688 _Locinfo_ctor(&locinfo);
1689 ctype_char__Init(this, &locinfo);
1690 _Locinfo_dtor(&locinfo);
1692 if(table) {
1693 ctype_char__Tidy(this);
1694 this->ctype.table = table;
1695 this->ctype.delfl = delete;
1697 return this;
1700 /* ??_F?$ctype@D@std@@QAEXXZ */
1701 /* ??_F?$ctype@D@std@@QEAAXXZ */
1702 DEFINE_THISCALL_WRAPPER(ctype_char_ctor, 4)
1703 ctype_char* __thiscall ctype_char_ctor(ctype_char *this)
1705 return ctype_char_ctor_table(this, NULL, FALSE, 0);
1708 /* ??1?$ctype@D@std@@UAE@XZ */
1709 /* ??1?$ctype@D@std@@UEAA@XZ */
1710 /* ??1?$ctype@D@std@@MAE@XZ */
1711 /* ??1?$ctype@D@std@@MEAA@XZ */
1712 DEFINE_THISCALL_WRAPPER(ctype_char_dtor, 4)
1713 void __thiscall ctype_char_dtor(ctype_char *this)
1715 TRACE("(%p)\n", this);
1716 ctype_char__Tidy(this);
1719 DEFINE_THISCALL_WRAPPER(ctype_char_vector_dtor, 8)
1720 ctype_char* __thiscall ctype_char_vector_dtor(ctype_char *this, unsigned int flags)
1722 TRACE("(%p %x)\n", this, flags);
1723 if(flags & 2) {
1724 /* we have an array, with the number of elements stored before the first object */
1725 INT_PTR i, *ptr = (INT_PTR *)this-1;
1727 for(i=*ptr-1; i>=0; i--)
1728 ctype_char_dtor(this+i);
1729 MSVCRT_operator_delete(ptr);
1730 } else {
1731 ctype_char_dtor(this);
1732 if(flags & 1)
1733 MSVCRT_operator_delete(this);
1736 return this;
1739 /* ?do_narrow@?$ctype@D@std@@MBEDDD@Z */
1740 /* ?do_narrow@?$ctype@D@std@@MEBADDD@Z */
1741 DEFINE_THISCALL_WRAPPER(ctype_char_do_narrow_ch, 12)
1742 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1743 #define call_ctype_char_do_narrow_ch(this, ch, unused) CALL_VTBL_FUNC(this, 36, \
1744 char, (const ctype_char*, char, char), (this, ch, unused))
1745 #elif _MSVCP_VER <= 100
1746 #define call_ctype_char_do_narrow_ch(this, ch, unused) CALL_VTBL_FUNC(this, 32, \
1747 char, (const ctype_char*, char, char), (this, ch, unused))
1748 #else
1749 #define call_ctype_char_do_narrow_ch(this, ch, unused) CALL_VTBL_FUNC(this, 40, \
1750 char, (const ctype_char*, char, char), (this, ch, unused))
1751 #endif
1752 char __thiscall ctype_char_do_narrow_ch(const ctype_char *this, char ch, char unused)
1754 TRACE("(%p %c %c)\n", this, ch, unused);
1755 return ch;
1758 /* ?do_narrow@?$ctype@D@std@@MBEPBDPBD0DPAD@Z */
1759 /* ?do_narrow@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD@Z */
1760 DEFINE_THISCALL_WRAPPER(ctype_char_do_narrow, 20)
1761 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
1762 #define call_ctype_char_do_narrow(this, first, last, unused, dest) CALL_VTBL_FUNC(this, 32, \
1763 const char*, (const ctype_char*, const char*, const char*, char, char*), \
1764 (this, first, last, unused, dest))
1765 #elif _MSVCP_VER <= 100
1766 #define call_ctype_char_do_narrow(this, first, last, unused, dest) CALL_VTBL_FUNC(this, 28, \
1767 const char*, (const ctype_char*, const char*, const char*, char, char*), \
1768 (this, first, last, unused, dest))
1769 #else
1770 #define call_ctype_char_do_narrow(this, first, last, unused, dest) CALL_VTBL_FUNC(this, 36, \
1771 const char*, (const ctype_char*, const char*, const char*, char, char*), \
1772 (this, first, last, unused, dest))
1773 #endif
1774 const char* __thiscall ctype_char_do_narrow(const ctype_char *this,
1775 const char *first, const char *last, char unused, char *dest)
1777 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1778 memcpy(dest, first, last-first);
1779 return last;
1782 /* ?_Do_narrow_s@?$ctype@D@std@@MBEPBDPBD0DPADI@Z */
1783 /* ?_Do_narrow_s@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD_K@Z */
1784 DEFINE_THISCALL_WRAPPER(ctype_char__Do_narrow_s, 24)
1785 #define call_ctype_char__Do_narrow_s(this, first, last, unused, dest, size) CALL_VTBL_FUNC(this, 40, \
1786 const char*, (const ctype_char*, const char*, const char*, char, char*, MSVCP_size_t), \
1787 (this, first, last, unused, dest, size))
1788 const char* __thiscall ctype_char__Do_narrow_s(const ctype_char *this, const char *first,
1789 const char *last, char unused, char *dest, MSVCP_size_t size)
1791 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1792 memcpy_s(dest, size, first, last-first);
1793 return last;
1796 /* ?narrow@?$ctype@D@std@@QBEDDD@Z */
1797 /* ?narrow@?$ctype@D@std@@QEBADDD@Z */
1798 DEFINE_THISCALL_WRAPPER(ctype_char_narrow_ch, 12)
1799 char __thiscall ctype_char_narrow_ch(const ctype_char *this, char ch, char dflt)
1801 TRACE("(%p %c %c)\n", this, ch, dflt);
1802 return call_ctype_char_do_narrow_ch(this, ch, dflt);
1805 /* ?narrow@?$ctype@D@std@@QBEPBDPBD0DPAD@Z */
1806 /* ?narrow@?$ctype@D@std@@QEBAPEBDPEBD0DPEAD@Z */
1807 DEFINE_THISCALL_WRAPPER(ctype_char_narrow, 20)
1808 const char* __thiscall ctype_char_narrow(const ctype_char *this,
1809 const char *first, const char *last, char dflt, char *dest)
1811 TRACE("(%p %p %p %c %p)\n", this, first, last, dflt, dest);
1812 return call_ctype_char_do_narrow(this, first, last, dflt, dest);
1815 /* ?_Narrow_s@?$ctype@D@std@@QBEPBDPBD0DPADI@Z */
1816 /* ?_Narrow_s@?$ctype@D@std@@QEBAPEBDPEBD0DPEAD_K@Z */
1817 DEFINE_THISCALL_WRAPPER(ctype_char__Narrow_s, 24)
1818 const char* __thiscall ctype_char__Narrow_s(const ctype_char *this, const char *first,
1819 const char *last, char dflt, char *dest, MSVCP_size_t size)
1821 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1822 return call_ctype_char__Do_narrow_s(this, first, last, dflt, dest, size);
1825 /* ?do_widen@?$ctype@D@std@@MBEDD@Z */
1826 /* ?do_widen@?$ctype@D@std@@MEBADD@Z */
1827 DEFINE_THISCALL_WRAPPER(ctype_char_do_widen_ch, 8)
1828 #if _MSVCP_VER <= 100
1829 #define call_ctype_char_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 24, \
1830 char, (const ctype_char*, char), (this, ch))
1831 #else
1832 #define call_ctype_char_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 32, \
1833 char, (const ctype_char*, char), (this, ch))
1834 #endif
1835 char __thiscall ctype_char_do_widen_ch(const ctype_char *this, char ch)
1837 TRACE("(%p %c)\n", this, ch);
1838 return ch;
1841 /* ?do_widen@?$ctype@D@std@@MBEPBDPBD0PAD@Z */
1842 /* ?do_widen@?$ctype@D@std@@MEBAPEBDPEBD0PEAD@Z */
1843 DEFINE_THISCALL_WRAPPER(ctype_char_do_widen, 16)
1844 #if _MSVCP_VER <= 100
1845 #define call_ctype_char_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 20, \
1846 const char*, (const ctype_char*, const char*, const char*, char*), \
1847 (this, first, last, dest))
1848 #else
1849 #define call_ctype_char_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 28, \
1850 const char*, (const ctype_char*, const char*, const char*, char*), \
1851 (this, first, last, dest))
1852 #endif
1853 const char* __thiscall ctype_char_do_widen(const ctype_char *this,
1854 const char *first, const char *last, char *dest)
1856 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1857 memcpy(dest, first, last-first);
1858 return last;
1861 /* ?_Do_widen_s@?$ctype@D@std@@MBEPBDPBD0PADI@Z */
1862 /* ?_Do_widen_s@?$ctype@D@std@@MEBAPEBDPEBD0PEAD_K@Z */
1863 DEFINE_THISCALL_WRAPPER(ctype_char__Do_widen_s, 20)
1864 #define call_ctype_char__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 28, \
1865 const char*, (const ctype_char*, const char*, const char*, char*, MSVCP_size_t), \
1866 (this, first, last, dest, size))
1867 const char* __thiscall ctype_char__Do_widen_s(const ctype_char *this,
1868 const char *first, const char *last, char *dest, MSVCP_size_t size)
1870 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1871 memcpy_s(dest, size, first, last-first);
1872 return last;
1875 /* ?widen@?$ctype@D@std@@QBEDD@Z */
1876 /* ?widen@?$ctype@D@std@@QEBADD@Z */
1877 DEFINE_THISCALL_WRAPPER(ctype_char_widen_ch, 8)
1878 char __thiscall ctype_char_widen_ch(const ctype_char *this, char ch)
1880 TRACE("(%p %c)\n", this, ch);
1881 return call_ctype_char_do_widen_ch(this, ch);
1884 /* ?widen@?$ctype@D@std@@QBEPBDPBD0PAD@Z */
1885 /* ?widen@?$ctype@D@std@@QEBAPEBDPEBD0PEAD@Z */
1886 DEFINE_THISCALL_WRAPPER(ctype_char_widen, 16)
1887 const char* __thiscall ctype_char_widen(const ctype_char *this,
1888 const char *first, const char *last, char *dest)
1890 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1891 return call_ctype_char_do_widen(this, first, last, dest);
1894 /* ?_Widen_s@?$ctype@D@std@@QBEPBDPBD0PADI@Z */
1895 /* ?_Widen_s@?$ctype@D@std@@QEBAPEBDPEBD0PEAD_K@Z */
1896 DEFINE_THISCALL_WRAPPER(ctype_char__Widen_s, 20)
1897 const char* __thiscall ctype_char__Widen_s(const ctype_char *this,
1898 const char *first, const char *last, char *dest, MSVCP_size_t size)
1900 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1901 return call_ctype_char__Do_widen_s(this, first, last, dest, size);
1904 /* ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1905 /* ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1906 MSVCP_size_t __cdecl ctype_char__Getcat(const locale_facet **facet, const locale *loc)
1908 TRACE("(%p %p)\n", facet, loc);
1910 if(facet && !*facet) {
1911 _Locinfo locinfo;
1913 *facet = MSVCRT_operator_new(sizeof(ctype_char));
1914 if(!*facet) {
1915 ERR("Out of memory\n");
1916 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
1917 return 0;
1920 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
1921 ctype_char_ctor_locinfo((ctype_char*)*facet, &locinfo, 0);
1922 _Locinfo_dtor(&locinfo);
1925 return LC_CTYPE;
1928 /* ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@@Z */
1929 /* ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@@Z */
1930 MSVCP_size_t __cdecl ctype_char__Getcat_old(const locale_facet **facet)
1932 return ctype_char__Getcat(facet, locale_classic());
1935 ctype_char* ctype_char_use_facet(const locale *loc)
1937 static ctype_char *obj = NULL;
1939 _Lockit lock;
1940 const locale_facet *fac;
1942 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
1943 fac = locale__Getfacet(loc, locale_id_operator_size_t(&ctype_char_id));
1944 if(fac) {
1945 _Lockit_dtor(&lock);
1946 return (ctype_char*)fac;
1949 if(obj) {
1950 _Lockit_dtor(&lock);
1951 return obj;
1954 ctype_char__Getcat(&fac, loc);
1955 obj = (ctype_char*)fac;
1956 call_locale_facet__Incref(&obj->base.facet);
1957 locale_facet_register(&obj->base.facet);
1958 _Lockit_dtor(&lock);
1960 return obj;
1963 /* _Tolower */
1964 int __cdecl _Tolower(int ch, const _Ctypevec *ctype)
1966 unsigned int cp;
1968 TRACE("%d %p\n", ch, ctype);
1970 if(ctype)
1971 cp = ctype->page;
1972 else
1973 cp = ___lc_codepage_func();
1975 /* Don't convert to unicode in case of C locale */
1976 if(!cp) {
1977 if(ch>='A' && ch<='Z')
1978 ch = ch-'A'+'a';
1979 return ch;
1980 } else {
1981 WCHAR wide, lower;
1982 char str[2];
1983 int size;
1985 if(ch > 255) {
1986 str[0] = (ch>>8) & 255;
1987 str[1] = ch & 255;
1988 size = 2;
1989 } else {
1990 str[0] = ch & 255;
1991 size = 1;
1994 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, str, size, &wide, 1))
1995 return ch;
1997 lower = tolowerW(wide);
1998 if(lower == wide)
1999 return ch;
2001 WideCharToMultiByte(cp, 0, &lower, 1, str, 2, NULL, NULL);
2003 return str[0] + (str[1]<<8);
2007 /* ?do_tolower@?$ctype@D@std@@MBEDD@Z */
2008 /* ?do_tolower@?$ctype@D@std@@MEBADD@Z */
2009 #if _MSVCP_VER <= 100
2010 #define call_ctype_char_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 8, \
2011 char, (const ctype_char*, char), (this, ch))
2012 #else
2013 #define call_ctype_char_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 16, \
2014 char, (const ctype_char*, char), (this, ch))
2015 #endif
2016 DEFINE_THISCALL_WRAPPER(ctype_char_do_tolower_ch, 8)
2017 char __thiscall ctype_char_do_tolower_ch(const ctype_char *this, char ch)
2019 TRACE("(%p %c)\n", this, ch);
2020 return _Tolower(ch, &this->ctype);
2023 /* ?do_tolower@?$ctype@D@std@@MBEPBDPADPBD@Z */
2024 /* ?do_tolower@?$ctype@D@std@@MEBAPEBDPEADPEBD@Z */
2025 #if _MSVCP_VER <= 100
2026 #define call_ctype_char_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 4, \
2027 const char*, (const ctype_char*, char*, const char*), (this, first, last))
2028 #else
2029 #define call_ctype_char_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 12, \
2030 const char*, (const ctype_char*, char*, const char*), (this, first, last))
2031 #endif
2032 DEFINE_THISCALL_WRAPPER(ctype_char_do_tolower, 12)
2033 const char* __thiscall ctype_char_do_tolower(const ctype_char *this, char *first, const char *last)
2035 TRACE("(%p %p %p)\n", this, first, last);
2036 for(; first<last; first++)
2037 *first = _Tolower(*first, &this->ctype);
2038 return last;
2041 /* ?tolower@?$ctype@D@std@@QBEDD@Z */
2042 /* ?tolower@?$ctype@D@std@@QEBADD@Z */
2043 DEFINE_THISCALL_WRAPPER(ctype_char_tolower_ch, 8)
2044 char __thiscall ctype_char_tolower_ch(const ctype_char *this, char ch)
2046 TRACE("(%p %c)\n", this, ch);
2047 return call_ctype_char_do_tolower_ch(this, ch);
2050 /* ?tolower@?$ctype@D@std@@QBEPBDPADPBD@Z */
2051 /* ?tolower@?$ctype@D@std@@QEBAPEBDPEADPEBD@Z */
2052 DEFINE_THISCALL_WRAPPER(ctype_char_tolower, 12)
2053 const char* __thiscall ctype_char_tolower(const ctype_char *this, char *first, const char *last)
2055 TRACE("(%p %p %p)\n", this, first, last);
2056 return call_ctype_char_do_tolower(this, first, last);
2059 /* _Toupper */
2060 int __cdecl _Toupper(int ch, const _Ctypevec *ctype)
2062 unsigned int cp;
2064 TRACE("%d %p\n", ch, ctype);
2066 if(ctype)
2067 cp = ctype->page;
2068 else
2069 cp = ___lc_codepage_func();
2071 /* Don't convert to unicode in case of C locale */
2072 if(!cp) {
2073 if(ch>='a' && ch<='z')
2074 ch = ch-'a'+'A';
2075 return ch;
2076 } else {
2077 WCHAR wide, upper;
2078 char str[2];
2079 int size;
2081 if(ch > 255) {
2082 str[0] = (ch>>8) & 255;
2083 str[1] = ch & 255;
2084 size = 2;
2085 } else {
2086 str[0] = ch & 255;
2087 size = 1;
2090 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, str, size, &wide, 1))
2091 return ch;
2093 upper = toupperW(wide);
2094 if(upper == wide)
2095 return ch;
2097 WideCharToMultiByte(cp, 0, &upper, 1, str, 2, NULL, NULL);
2099 return str[0] + (str[1]<<8);
2103 /* ?do_toupper@?$ctype@D@std@@MBEDD@Z */
2104 /* ?do_toupper@?$ctype@D@std@@MEBADD@Z */
2105 #if _MSVCP_VER <= 100
2106 #define call_ctype_char_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 16, \
2107 char, (const ctype_char*, char), (this, ch))
2108 #else
2109 #define call_ctype_char_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 24, \
2110 char, (const ctype_char*, char), (this, ch))
2111 #endif
2112 DEFINE_THISCALL_WRAPPER(ctype_char_do_toupper_ch, 8)
2113 char __thiscall ctype_char_do_toupper_ch(const ctype_char *this, char ch)
2115 TRACE("(%p %c)\n", this, ch);
2116 return _Toupper(ch, &this->ctype);
2119 /* ?do_toupper@?$ctype@D@std@@MBEPBDPADPBD@Z */
2120 /* ?do_toupper@?$ctype@D@std@@MEBAPEBDPEADPEBD@Z */
2121 #if _MSVCP_VER <= 100
2122 #define call_ctype_char_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 12, \
2123 const char*, (const ctype_char*, char*, const char*), (this, first, last))
2124 #else
2125 #define call_ctype_char_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 20, \
2126 const char*, (const ctype_char*, char*, const char*), (this, first, last))
2127 #endif
2128 DEFINE_THISCALL_WRAPPER(ctype_char_do_toupper, 12)
2129 const char* __thiscall ctype_char_do_toupper(const ctype_char *this,
2130 char *first, const char *last)
2132 TRACE("(%p %p %p)\n", this, first, last);
2133 for(; first<last; first++)
2134 *first = _Toupper(*first, &this->ctype);
2135 return last;
2138 /* ?toupper@?$ctype@D@std@@QBEDD@Z */
2139 /* ?toupper@?$ctype@D@std@@QEBADD@Z */
2140 DEFINE_THISCALL_WRAPPER(ctype_char_toupper_ch, 8)
2141 char __thiscall ctype_char_toupper_ch(const ctype_char *this, char ch)
2143 TRACE("(%p %c)\n", this, ch);
2144 return call_ctype_char_do_toupper_ch(this, ch);
2147 /* ?toupper@?$ctype@D@std@@QBEPBDPADPBD@Z */
2148 /* ?toupper@?$ctype@D@std@@QEBAPEBDPEADPEBD@Z */
2149 DEFINE_THISCALL_WRAPPER(ctype_char_toupper, 12)
2150 const char* __thiscall ctype_char_toupper(const ctype_char *this, char *first, const char *last)
2152 TRACE("(%p %p %p)\n", this, first, last);
2153 return call_ctype_char_do_toupper(this, first, last);
2156 /* ?is@?$ctype@D@std@@QBE_NFD@Z */
2157 /* ?is@?$ctype@D@std@@QEBA_NFD@Z */
2158 DEFINE_THISCALL_WRAPPER(ctype_char_is_ch, 12)
2159 MSVCP_bool __thiscall ctype_char_is_ch(const ctype_char *this, short mask, char ch)
2161 TRACE("(%p %x %c)\n", this, mask, ch);
2162 return (this->ctype.table[(unsigned char)ch] & mask) != 0;
2165 /* ?is@?$ctype@D@std@@QBEPBDPBD0PAF@Z */
2166 /* ?is@?$ctype@D@std@@QEBAPEBDPEBD0PEAF@Z */
2167 DEFINE_THISCALL_WRAPPER(ctype_char_is, 16)
2168 const char* __thiscall ctype_char_is(const ctype_char *this, const char *first, const char *last, short *dest)
2170 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2171 for(; first<last; first++)
2172 *dest++ = this->ctype.table[(unsigned char)*first];
2173 return last;
2176 /* ?scan_is@?$ctype@D@std@@QBEPBDFPBD0@Z */
2177 /* ?scan_is@?$ctype@D@std@@QEBAPEBDFPEBD0@Z */
2178 DEFINE_THISCALL_WRAPPER(ctype_char_scan_is, 16)
2179 const char* __thiscall ctype_char_scan_is(const ctype_char *this, short mask, const char *first, const char *last)
2181 TRACE("(%p %x %p %p)\n", this, mask, first, last);
2182 for(; first<last; first++)
2183 if(!ctype_char_is_ch(this, mask, *first))
2184 break;
2185 return first;
2188 /* ?scan_not@?$ctype@D@std@@QBEPBDFPBD0@Z */
2189 /* ?scan_not@?$ctype@D@std@@QEBAPEBDFPEBD0@Z */
2190 DEFINE_THISCALL_WRAPPER(ctype_char_scan_not, 16)
2191 const char* __thiscall ctype_char_scan_not(const ctype_char *this, short mask, const char *first, const char *last)
2193 TRACE("(%p %x %p %p)\n", this, mask, first, last);
2194 for(; first<last; first++)
2195 if(ctype_char_is_ch(this, mask, *first))
2196 break;
2197 return first;
2200 /* ?table@?$ctype@D@std@@IBEPBFXZ */
2201 /* ?table@?$ctype@D@std@@IEBAPEBFXZ */
2202 DEFINE_THISCALL_WRAPPER(ctype_char_table, 4)
2203 const short* __thiscall ctype_char_table(const ctype_char *this)
2205 TRACE("(%p)\n", this);
2206 return this->ctype.table;
2209 /* ?id@?$ctype@_W@std@@2V0locale@2@A */
2210 locale_id ctype_wchar_id = {0};
2211 /* ?id@?$ctype@G@std@@2V0locale@2@A */
2212 locale_id ctype_short_id = {0};
2214 /* ??_7?$ctype@_W@std@@6B@ */
2215 extern const vtable_ptr MSVCP_ctype_wchar_vtable;
2216 /* ??_7?$ctype@G@std@@6B@ */
2217 extern const vtable_ptr MSVCP_ctype_short_vtable;
2219 /* ?_Id_func@?$ctype@_W@std@@SAAAVid@locale@2@XZ */
2220 /* ?_Id_func@?$ctype@_W@std@@SAAEAVid@locale@2@XZ */
2221 locale_id* __cdecl ctype_wchar__Id_func(void)
2223 TRACE("()\n");
2224 return &ctype_wchar_id;
2227 /* ?_Id_func@?$ctype@G@std@@SAAAVid@locale@2@XZ */
2228 /* ?_Id_func@?$ctype@G@std@@SAAEAVid@locale@2@XZ */
2229 locale_id* __cdecl ctype_short__Id_func(void)
2231 TRACE("()\n");
2232 return &ctype_short_id;
2235 /* ?_Init@?$ctype@_W@std@@IAEXABV_Locinfo@2@@Z */
2236 /* ?_Init@?$ctype@_W@std@@IEAAXAEBV_Locinfo@2@@Z */
2237 /* ?_Init@?$ctype@G@std@@IAEXABV_Locinfo@2@@Z */
2238 /* ?_Init@?$ctype@G@std@@IEAAXAEBV_Locinfo@2@@Z */
2239 DEFINE_THISCALL_WRAPPER(ctype_wchar__Init, 8)
2240 void __thiscall ctype_wchar__Init(ctype_wchar *this, const _Locinfo *locinfo)
2242 TRACE("(%p %p)\n", this, locinfo);
2243 _Locinfo__Getctype(locinfo, &this->ctype);
2244 _Locinfo__Getcvt(locinfo, &this->cvt);
2247 /* ??0?$ctype@_W@std@@QAE@ABV_Locinfo@1@I@Z */
2248 /* ??0?$ctype@_W@std@@QEAA@AEBV_Locinfo@1@_K@Z */
2249 DEFINE_THISCALL_WRAPPER(ctype_wchar_ctor_locinfo, 12)
2250 ctype_wchar* __thiscall ctype_wchar_ctor_locinfo(ctype_wchar *this,
2251 const _Locinfo *locinfo, MSVCP_size_t refs)
2253 TRACE("(%p %p %lu)\n", this, locinfo, refs);
2254 ctype_base_ctor_refs(&this->base, refs);
2255 this->base.facet.vtable = &MSVCP_ctype_wchar_vtable;
2256 ctype_wchar__Init(this, locinfo);
2257 return this;
2260 /* ??0?$ctype@G@std@@QAE@ABV_Locinfo@1@I@Z */
2261 /* ??0?$ctype@G@std@@QEAA@AEBV_Locinfo@1@_K@Z */
2262 DEFINE_THISCALL_WRAPPER(ctype_short_ctor_locinfo, 12)
2263 ctype_wchar* __thiscall ctype_short_ctor_locinfo(ctype_wchar *this,
2264 const _Locinfo *locinfo, MSVCP_size_t refs)
2266 ctype_wchar *ret = ctype_wchar_ctor_locinfo(this, locinfo, refs);
2267 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
2268 return ret;
2271 /* ??0?$ctype@_W@std@@QAE@I@Z */
2272 /* ??0?$ctype@_W@std@@QEAA@_K@Z */
2273 DEFINE_THISCALL_WRAPPER(ctype_wchar_ctor_refs, 8)
2274 ctype_wchar* __thiscall ctype_wchar_ctor_refs(ctype_wchar *this, MSVCP_size_t refs)
2276 _Locinfo locinfo;
2278 TRACE("(%p %lu)\n", this, refs);
2280 ctype_base_ctor_refs(&this->base, refs);
2281 this->base.facet.vtable = &MSVCP_ctype_wchar_vtable;
2283 _Locinfo_ctor(&locinfo);
2284 ctype_wchar__Init(this, &locinfo);
2285 _Locinfo_dtor(&locinfo);
2286 return this;
2289 /* ??0?$ctype@G@std@@QAE@I@Z */
2290 /* ??0?$ctype@G@std@@QEAA@_K@Z */
2291 DEFINE_THISCALL_WRAPPER(ctype_short_ctor_refs, 8)
2292 ctype_wchar* __thiscall ctype_short_ctor_refs(ctype_wchar *this, MSVCP_size_t refs)
2294 ctype_wchar *ret = ctype_wchar_ctor_refs(this, refs);
2295 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
2296 return ret;
2299 /* ??0?$ctype@G@std@@IAE@PBDI@Z */
2300 /* ??0?$ctype@G@std@@IEAA@PEBD_K@Z */
2301 DEFINE_THISCALL_WRAPPER(ctype_short_ctor_name, 12)
2302 ctype_wchar* __thiscall ctype_short_ctor_name(ctype_wchar *this,
2303 const char *name, MSVCP_size_t refs)
2305 _Locinfo locinfo;
2307 TRACE("(%p %s %lu)\n", this, debugstr_a(name), refs);
2309 ctype_base_ctor_refs(&this->base, refs);
2310 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
2312 _Locinfo_ctor_cstr(&locinfo, name);
2313 ctype_wchar__Init(this, &locinfo);
2314 _Locinfo_dtor(&locinfo);
2315 return this;
2318 /* ??_F?$ctype@_W@std@@QAEXXZ */
2319 /* ??_F?$ctype@_W@std@@QEAAXXZ */
2320 DEFINE_THISCALL_WRAPPER(ctype_wchar_ctor, 4)
2321 ctype_wchar* __thiscall ctype_wchar_ctor(ctype_wchar *this)
2323 TRACE("(%p)\n", this);
2324 return ctype_short_ctor_refs(this, 0);
2327 /* ??_F?$ctype@G@std@@QAEXXZ */
2328 /* ??_F?$ctype@G@std@@QEAAXXZ */
2329 DEFINE_THISCALL_WRAPPER(ctype_short_ctor, 4)
2330 ctype_wchar* __thiscall ctype_short_ctor(ctype_wchar *this)
2332 ctype_wchar *ret = ctype_wchar_ctor(this);
2333 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
2334 return ret;
2337 /* ??1?$ctype@G@std@@UAE@XZ */
2338 /* ??1?$ctype@G@std@@UEAA@XZ */
2339 /* ??1?$ctype@_W@std@@MAE@XZ */
2340 /* ??1?$ctype@_W@std@@MEAA@XZ */
2341 /* ??1?$ctype@G@std@@MAE@XZ */
2342 /* ??1?$ctype@G@std@@MEAA@XZ */
2343 DEFINE_THISCALL_WRAPPER(ctype_wchar_dtor, 4)
2344 void __thiscall ctype_wchar_dtor(ctype_wchar *this)
2346 TRACE("(%p)\n", this);
2347 if(this->ctype.delfl)
2348 free((void*)this->ctype.table);
2349 #if _MSVCP_VER >= 110
2350 free(this->ctype.name);
2351 #endif
2354 DEFINE_THISCALL_WRAPPER(ctype_wchar_vector_dtor, 8)
2355 ctype_wchar* __thiscall ctype_wchar_vector_dtor(ctype_wchar *this, unsigned int flags)
2357 TRACE("(%p %x)\n", this, flags);
2358 if(flags & 2) {
2359 /* we have an array, with the number of elements stored before the first object */
2360 INT_PTR i, *ptr = (INT_PTR *)this-1;
2362 for(i=*ptr-1; i>=0; i--)
2363 ctype_wchar_dtor(this+i);
2364 MSVCRT_operator_delete(ptr);
2365 } else {
2366 ctype_wchar_dtor(this);
2367 if(flags & 1)
2368 MSVCRT_operator_delete(this);
2371 return this;
2374 /* _Wcrtomb */
2375 int __cdecl _Wcrtomb(char *s, wchar_t wch, int *state, const _Cvtvec *cvt)
2377 int cp, size;
2378 BOOL def;
2380 TRACE("%p %d %p %p\n", s, wch, state, cvt);
2382 if(cvt)
2383 cp = cvt->page;
2384 else
2385 cp = ___lc_codepage_func();
2387 if(!cp) {
2388 if(wch > 255) {
2389 *_errno() = EILSEQ;
2390 return -1;
2393 *s = wch & 255;
2394 return 1;
2397 size = WideCharToMultiByte(cp, 0, &wch, 1, s, MB_LEN_MAX, NULL, &def);
2398 if(!size || def) {
2399 *_errno() = EILSEQ;
2400 return -1;
2403 return size;
2406 /* ?_Donarrow@?$ctype@_W@std@@IBED_WD@Z */
2407 /* ?_Donarrow@?$ctype@_W@std@@IEBAD_WD@Z */
2408 /* ?_Donarrow@?$ctype@G@std@@IBEDGD@Z */
2409 /* ?_Donarrow@?$ctype@G@std@@IEBADGD@Z */
2410 DEFINE_THISCALL_WRAPPER(ctype_wchar__Donarrow, 12)
2411 char __thiscall ctype_wchar__Donarrow(const ctype_wchar *this, wchar_t ch, char dflt)
2413 char buf[MB_LEN_MAX];
2415 TRACE("(%p %d %d)\n", this, ch, dflt);
2417 return _Wcrtomb(buf, ch, NULL, &this->cvt)==1 ? buf[0] : dflt;
2420 /* ?do_narrow@?$ctype@_W@std@@MBED_WD@Z */
2421 /* ?do_narrow@?$ctype@_W@std@@MEBAD_WD@Z */
2422 /* ?do_narrow@?$ctype@G@std@@MBEDGD@Z */
2423 /* ?do_narrow@?$ctype@G@std@@MEBADGD@Z */
2424 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_narrow_ch, 12)
2425 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2426 #define call_ctype_wchar_do_narrow_ch(this, ch, dflt) CALL_VTBL_FUNC(this, 52, \
2427 char, (const ctype_wchar*, wchar_t, char), (this, ch, dflt))
2428 #elif _MSVCP_VER <= 100
2429 #define call_ctype_wchar_do_narrow_ch(this, ch, dflt) CALL_VTBL_FUNC(this, 48, \
2430 char, (const ctype_wchar*, wchar_t, char), (this, ch, dflt))
2431 #else
2432 #define call_ctype_wchar_do_narrow_ch(this, ch, dflt) CALL_VTBL_FUNC(this, 56, \
2433 char, (const ctype_wchar*, wchar_t, char), (this, ch, dflt))
2434 #endif
2435 char __thiscall ctype_wchar_do_narrow_ch(const ctype_wchar *this, wchar_t ch, char dflt)
2437 return ctype_wchar__Donarrow(this, ch, dflt);
2440 /* ?do_narrow@?$ctype@_W@std@@MBEPB_WPB_W0DPAD@Z */
2441 /* ?do_narrow@?$ctype@_W@std@@MEBAPEB_WPEB_W0DPEAD@Z */
2442 /* ?do_narrow@?$ctype@G@std@@MBEPBGPBG0DPAD@Z */
2443 /* ?do_narrow@?$ctype@G@std@@MEBAPEBGPEBG0DPEAD@Z */
2444 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_narrow, 20)
2445 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
2446 #define call_ctype_wchar_do_narrow(this, first, last, dflt, dest) CALL_VTBL_FUNC(this, 48, \
2447 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*), \
2448 (this, first, last, dflt, dest))
2449 #elif _MSVCP_VER <= 100
2450 #define call_ctype_wchar_do_narrow(this, first, last, dflt, dest) CALL_VTBL_FUNC(this, 44, \
2451 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*), \
2452 (this, first, last, dflt, dest))
2453 #else
2454 #define call_ctype_wchar_do_narrow(this, first, last, dflt, dest) CALL_VTBL_FUNC(this, 52, \
2455 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*), \
2456 (this, first, last, dflt, dest))
2457 #endif
2458 const wchar_t* __thiscall ctype_wchar_do_narrow(const ctype_wchar *this,
2459 const wchar_t *first, const wchar_t *last, char dflt, char *dest)
2461 TRACE("(%p %p %p %d %p)\n", this, first, last, dflt, dest);
2462 for(; first<last; first++)
2463 *dest++ = ctype_wchar__Donarrow(this, *first, dflt);
2464 return last;
2467 /* ?_Do_narrow_s@?$ctype@_W@std@@MBEPB_WPB_W0DPADI@Z */
2468 /* ?_Do_narrow_s@?$ctype@_W@std@@MEBAPEB_WPEB_W0DPEAD_K@Z */
2469 /* ?_Do_narrow_s@?$ctype@G@std@@MBEPBGPBG0DPADI@Z */
2470 /* ?_Do_narrow_s@?$ctype@G@std@@MEBAPEBGPEBG0DPEAD_K@Z */
2471 DEFINE_THISCALL_WRAPPER(ctype_wchar__Do_narrow_s, 24)
2472 #define call_ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size) CALL_VTBL_FUNC(this, 56, \
2473 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*, MSVCP_size_t), \
2474 (this, first, last, dflt, dest, size))
2475 const wchar_t* __thiscall ctype_wchar__Do_narrow_s(const ctype_wchar *this,
2476 const wchar_t *first, const wchar_t *last, char dflt, char *dest, MSVCP_size_t size)
2478 TRACE("(%p %p %p %d %p %lu)\n", this, first, last, dflt, dest, size);
2479 /* This function converts all multi-byte characters to dflt,
2480 * thanks to it result size is known before converting */
2481 if(last-first > size)
2482 ctype_base__Xran();
2483 return ctype_wchar_do_narrow(this, first, last, dflt, dest);
2486 /* ?narrow@?$ctype@_W@std@@QBED_WD@Z */
2487 /* ?narrow@?$ctype@_W@std@@QEBAD_WD@Z */
2488 /* ?narrow@?$ctype@G@std@@QBEDGD@Z */
2489 /* ?narrow@?$ctype@G@std@@QEBADGD@Z */
2490 DEFINE_THISCALL_WRAPPER(ctype_wchar_narrow_ch, 12)
2491 char __thiscall ctype_wchar_narrow_ch(const ctype_wchar *this, wchar_t ch, char dflt)
2493 TRACE("(%p %d %d)\n", this, ch, dflt);
2494 return call_ctype_wchar_do_narrow_ch(this, ch, dflt);
2497 /* ?narrow@?$ctype@_W@std@@QBEPB_WPB_W0DPAD@Z */
2498 /* ?narrow@?$ctype@_W@std@@QEBAPEB_WPEB_W0DPEAD@Z */
2499 /* ?narrow@?$ctype@G@std@@QBEPBGPBG0DPAD@Z */
2500 /* ?narrow@?$ctype@G@std@@QEBAPEBGPEBG0DPEAD@Z */
2501 DEFINE_THISCALL_WRAPPER(ctype_wchar_narrow, 20)
2502 const wchar_t* __thiscall ctype_wchar_narrow(const ctype_wchar *this,
2503 const wchar_t *first, const wchar_t *last, char dflt, char *dest)
2505 TRACE("(%p %p %p %d %p)\n", this, first, last, dflt, dest);
2506 return call_ctype_wchar_do_narrow(this, first, last, dflt, dest);
2509 /* ?_Narrow_s@?$ctype@_W@std@@QBEPB_WPB_W0DPADI@Z */
2510 /* ?_Narrow_s@?$ctype@_W@std@@QEBAPEB_WPEB_W0DPEAD_K@Z */
2511 /* ?_Narrow_s@?$ctype@G@std@@QBEPBGPBG0DPADI@Z */
2512 /* ?_Narrow_s@?$ctype@G@std@@QEBAPEBGPEBG0DPEAD_K@Z */
2513 DEFINE_THISCALL_WRAPPER(ctype_wchar__Narrow_s, 24)
2514 const wchar_t* __thiscall ctype_wchar__Narrow_s(const ctype_wchar *this, const wchar_t *first,
2515 const wchar_t *last, char dflt, char *dest, MSVCP_size_t size)
2517 TRACE("(%p %p %p %d %p %lu)\n", this, first, last, dflt, dest, size);
2518 return call_ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size);
2521 /* _Mbrtowc */
2522 int __cdecl _Mbrtowc(wchar_t *out, const char *in, MSVCP_size_t len, int *state, const _Cvtvec *cvt)
2524 int i, cp;
2525 CPINFO cp_info;
2526 BOOL is_lead;
2528 TRACE("(%p %p %lu %p %p)\n", out, in, len, state, cvt);
2530 if(!len)
2531 return 0;
2533 if(cvt)
2534 cp = cvt->page;
2535 else
2536 cp = ___lc_codepage_func();
2538 if(!cp) {
2539 if(out)
2540 *out = (unsigned char)*in;
2542 *state = 0;
2543 return *in ? 1 : 0;
2546 if(*state) {
2547 ((char*)state)[1] = *in;
2549 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, (char*)state, 2, out, out ? 1 : 0)) {
2550 *state = 0;
2551 *_errno() = EILSEQ;
2552 return -1;
2555 *state = 0;
2556 return 2;
2559 GetCPInfo(cp, &cp_info);
2560 is_lead = FALSE;
2561 for(i=0; i<MAX_LEADBYTES; i+=2) {
2562 if(!cp_info.LeadByte[i+1])
2563 break;
2564 if((unsigned char)*in>=cp_info.LeadByte[i] && (unsigned char)*in<=cp_info.LeadByte[i+1]) {
2565 is_lead = TRUE;
2566 break;
2570 if(is_lead) {
2571 if(len == 1) {
2572 *state = (unsigned char)*in;
2573 return -2;
2576 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, in, 2, out, out ? 1 : 0)) {
2577 *_errno() = EILSEQ;
2578 return -1;
2580 return 2;
2583 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, in, 1, out, out ? 1 : 0)) {
2584 *_errno() = EILSEQ;
2585 return -1;
2587 return 1;
2590 static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
2592 int state = 0;
2593 wchar_t ret;
2595 return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
2598 /* ?_Dowiden@?$ctype@_W@std@@IBE_WD@Z */
2599 /* ?_Dowiden@?$ctype@_W@std@@IEBA_WD@Z */
2600 /* ?_Dowiden@?$ctype@G@std@@IBEGD@Z */
2601 /* ?_Dowiden@?$ctype@G@std@@IEBAGD@Z */
2602 DEFINE_THISCALL_WRAPPER(ctype_wchar__Dowiden, 8)
2603 wchar_t __thiscall ctype_wchar__Dowiden(const ctype_wchar *this, char ch)
2605 wchar_t ret;
2606 int state = 0;
2607 TRACE("(%p %d)\n", this, ch);
2608 return _Mbrtowc(&ret, &ch, 1, &state, &this->cvt)<0 ? WEOF : ret;
2611 /* ?do_widen@?$ctype@_W@std@@MBE_WD@Z */
2612 /* ?do_widen@?$ctype@_W@std@@MEBA_WD@Z */
2613 /* ?do_widen@?$ctype@G@std@@MBEGD@Z */
2614 /* ?do_widen@?$ctype@G@std@@MEBAGD@Z */
2615 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_widen_ch, 8)
2616 #if _MSVCP_VER <= 100
2617 #define call_ctype_wchar_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 40, \
2618 wchar_t, (const ctype_wchar*, char), (this, ch))
2619 #else
2620 #define call_ctype_wchar_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 48, \
2621 wchar_t, (const ctype_wchar*, char), (this, ch))
2622 #endif
2623 wchar_t __thiscall ctype_wchar_do_widen_ch(const ctype_wchar *this, char ch)
2625 return ctype_wchar__Dowiden(this, ch);
2628 /* ?do_widen@?$ctype@_W@std@@MBEPBDPBD0PA_W@Z */
2629 /* ?do_widen@?$ctype@_W@std@@MEBAPEBDPEBD0PEA_W@Z */
2630 /* ?do_widen@?$ctype@G@std@@MBEPBDPBD0PAG@Z */
2631 /* ?do_widen@?$ctype@G@std@@MEBAPEBDPEBD0PEAG@Z */
2632 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_widen, 16)
2633 #if _MSVCP_VER <= 100
2634 #define call_ctype_wchar_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 36, \
2635 const char*, (const ctype_wchar*, const char*, const char*, wchar_t*), \
2636 (this, first, last, dest))
2637 #else
2638 #define call_ctype_wchar_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 44, \
2639 const char*, (const ctype_wchar*, const char*, const char*, wchar_t*), \
2640 (this, first, last, dest))
2641 #endif
2642 const char* __thiscall ctype_wchar_do_widen(const ctype_wchar *this,
2643 const char *first, const char *last, wchar_t *dest)
2645 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2646 for(; first<last; first++)
2647 *dest++ = ctype_wchar__Dowiden(this, *first);
2648 return last;
2651 /* ?_Do_widen_s@?$ctype@_W@std@@MBEPBDPBD0PA_WI@Z */
2652 /* ?_Do_widen_s@?$ctype@_W@std@@MEBAPEBDPEBD0PEA_W_K@Z */
2653 /* ?_Do_widen_s@?$ctype@G@std@@MBEPBDPBD0PAGI@Z */
2654 /* ?_Do_widen_s@?$ctype@G@std@@MEBAPEBDPEBD0PEAG_K@Z */
2655 DEFINE_THISCALL_WRAPPER(ctype_wchar__Do_widen_s, 20)
2656 #define call_ctype_wchar__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 44, \
2657 const char*, (const ctype_wchar*, const char*, const char*, wchar_t*, MSVCP_size_t), \
2658 (this, first, last, dest, size))
2659 const char* __thiscall ctype_wchar__Do_widen_s(const ctype_wchar *this,
2660 const char *first, const char *last, wchar_t *dest, MSVCP_size_t size)
2662 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
2663 /* This function converts all multi-byte characters to WEOF,
2664 * thanks to it result size is known before converting */
2665 if(size < last-first)
2666 ctype_base__Xran();
2667 return ctype_wchar_do_widen(this, first, last, dest);
2670 /* ?widen@?$ctype@_W@std@@QBE_WD@Z */
2671 /* ?widen@?$ctype@_W@std@@QEBA_WD@Z */
2672 /* ?widen@?$ctype@G@std@@QBEGD@Z */
2673 /* ?widen@?$ctype@G@std@@QEBAGD@Z */
2674 DEFINE_THISCALL_WRAPPER(ctype_wchar_widen_ch, 8)
2675 wchar_t __thiscall ctype_wchar_widen_ch(const ctype_wchar *this, char ch)
2677 TRACE("(%p %d)\n", this, ch);
2678 return call_ctype_wchar_do_widen_ch(this, ch);
2681 /* ?widen@?$ctype@_W@std@@QBEPBDPBD0PA_W@Z */
2682 /* ?widen@?$ctype@_W@std@@QEBAPEBDPEBD0PEA_W@Z */
2683 /* ?widen@?$ctype@G@std@@QBEPBDPBD0PAG@Z */
2684 /* ?widen@?$ctype@G@std@@QEBAPEBDPEBD0PEAG@Z */
2685 DEFINE_THISCALL_WRAPPER(ctype_wchar_widen, 16)
2686 const char* __thiscall ctype_wchar_widen(const ctype_wchar *this,
2687 const char *first, const char *last, wchar_t *dest)
2689 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2690 return call_ctype_wchar_do_widen(this, first, last, dest);
2693 /* ?_Widen_s@?$ctype@_W@std@@QBEPBDPBD0PA_WI@Z */
2694 /* ?_Widen_s@?$ctype@_W@std@@QEBAPEBDPEBD0PEA_W_K@Z */
2695 /* ?_Widen_s@?$ctype@G@std@@QBEPBDPBD0PAGI@Z */
2696 /* ?_Widen_s@?$ctype@G@std@@QEBAPEBDPEBD0PEAG_K@Z */
2697 DEFINE_THISCALL_WRAPPER(ctype_wchar__Widen_s, 20)
2698 const char* __thiscall ctype_wchar__Widen_s(const ctype_wchar *this,
2699 const char *first, const char *last, wchar_t *dest, MSVCP_size_t size)
2701 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
2702 return call_ctype_wchar__Do_widen_s(this, first, last, dest, size);
2705 /* ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
2706 /* ?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
2707 MSVCP_size_t __cdecl ctype_wchar__Getcat(const locale_facet **facet, const locale *loc)
2709 TRACE("(%p %p)\n", facet, loc);
2711 if(facet && !*facet) {
2712 _Locinfo locinfo;
2714 *facet = MSVCRT_operator_new(sizeof(ctype_wchar));
2715 if(!*facet) {
2716 ERR("Out of memory\n");
2717 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
2718 return 0;
2721 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
2722 ctype_wchar_ctor_locinfo((ctype_wchar*)*facet, &locinfo, 0);
2723 _Locinfo_dtor(&locinfo);
2726 return LC_CTYPE;
2729 /* ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@@Z */
2730 /* ?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z */
2731 MSVCP_size_t __cdecl ctype_wchar__Getcat_old(const locale_facet **facet)
2733 return ctype_wchar__Getcat(facet, locale_classic());
2736 /* ?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
2737 /* ?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
2738 MSVCP_size_t __cdecl ctype_short__Getcat(const locale_facet **facet, const locale *loc)
2740 if(facet && !*facet) {
2741 ctype_wchar__Getcat(facet, loc);
2742 (*(locale_facet**)facet)->vtable = &MSVCP_ctype_short_vtable;
2745 return LC_CTYPE;
2748 /* ?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@@Z */
2749 /* ?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@@Z */
2750 MSVCP_size_t __cdecl ctype_short__Getcat_old(const locale_facet **facet)
2752 return ctype_short__Getcat(facet, locale_classic());
2755 /* _Towlower */
2756 wchar_t __cdecl _Towlower(wchar_t ch, const _Ctypevec *ctype)
2758 TRACE("(%d %p)\n", ch, ctype);
2759 return tolowerW(ch);
2762 ctype_wchar* ctype_wchar_use_facet(const locale *loc)
2764 static ctype_wchar *obj = NULL;
2766 _Lockit lock;
2767 const locale_facet *fac;
2769 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
2770 fac = locale__Getfacet(loc, locale_id_operator_size_t(&ctype_wchar_id));
2771 if(fac) {
2772 _Lockit_dtor(&lock);
2773 return (ctype_wchar*)fac;
2776 if(obj) {
2777 _Lockit_dtor(&lock);
2778 return obj;
2781 ctype_wchar__Getcat(&fac, loc);
2782 obj = (ctype_wchar*)fac;
2783 call_locale_facet__Incref(&obj->base.facet);
2784 locale_facet_register(&obj->base.facet);
2785 _Lockit_dtor(&lock);
2787 return obj;
2790 ctype_wchar* ctype_short_use_facet(const locale *loc)
2792 static ctype_wchar *obj = NULL;
2794 _Lockit lock;
2795 const locale_facet *fac;
2797 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
2798 fac = locale__Getfacet(loc, locale_id_operator_size_t(&ctype_short_id));
2799 if(fac) {
2800 _Lockit_dtor(&lock);
2801 return (ctype_wchar*)fac;
2804 if(obj) {
2805 _Lockit_dtor(&lock);
2806 return obj;
2809 ctype_short__Getcat(&fac, loc);
2810 obj = (ctype_wchar*)fac;
2811 call_locale_facet__Incref(&obj->base.facet);
2812 locale_facet_register(&obj->base.facet);
2813 _Lockit_dtor(&lock);
2815 return obj;
2818 /* ?do_tolower@?$ctype@_W@std@@MBE_W_W@Z */
2819 /* ?do_tolower@?$ctype@_W@std@@MEBA_W_W@Z */
2820 /* ?do_tolower@?$ctype@G@std@@MBEGG@Z */
2821 /* ?do_tolower@?$ctype@G@std@@MEBAGG@Z */
2822 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_tolower_ch, 8)
2823 #if _MSVCP_VER <= 100
2824 #define call_ctype_wchar_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 24, \
2825 wchar_t, (const ctype_wchar*, wchar_t), (this, ch))
2826 #else
2827 #define call_ctype_wchar_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 32, \
2828 wchar_t, (const ctype_wchar*, wchar_t), (this, ch))
2829 #endif
2830 wchar_t __thiscall ctype_wchar_do_tolower_ch(const ctype_wchar *this, wchar_t ch)
2832 return _Towlower(ch, &this->ctype);
2835 /* ?do_tolower@?$ctype@_W@std@@MBEPB_WPA_WPB_W@Z */
2836 /* ?do_tolower@?$ctype@_W@std@@MEBAPEB_WPEA_WPEB_W@Z */
2837 /* ?do_tolower@?$ctype@G@std@@MBEPBGPAGPBG@Z */
2838 /* ?do_tolower@?$ctype@G@std@@MEBAPEBGPEAGPEBG@Z */
2839 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_tolower, 12)
2840 #if _MSVCP_VER <= 100
2841 #define call_ctype_wchar_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 20, \
2842 const wchar_t*, (const ctype_wchar*, wchar_t*, const wchar_t*), \
2843 (this, first, last))
2844 #else
2845 #define call_ctype_wchar_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 28, \
2846 const wchar_t*, (const ctype_wchar*, wchar_t*, const wchar_t*), \
2847 (this, first, last))
2848 #endif
2849 const wchar_t* __thiscall ctype_wchar_do_tolower(const ctype_wchar *this,
2850 wchar_t *first, const wchar_t *last)
2852 TRACE("(%p %p %p)\n", this, first, last);
2853 for(; first<last; first++)
2854 *first = _Towlower(*first, &this->ctype);
2855 return last;
2858 /* ?tolower@?$ctype@_W@std@@QBE_W_W@Z */
2859 /* ?tolower@?$ctype@_W@std@@QEBA_W_W@Z */
2860 /* ?tolower@?$ctype@G@std@@QBEGG@Z */
2861 /* ?tolower@?$ctype@G@std@@QEBAGG@Z */
2862 DEFINE_THISCALL_WRAPPER(ctype_wchar_tolower_ch, 8)
2863 wchar_t __thiscall ctype_wchar_tolower_ch(const ctype_wchar *this, wchar_t ch)
2865 TRACE("(%p %d)\n", this, ch);
2866 return call_ctype_wchar_do_tolower_ch(this, ch);
2869 /* ?tolower@?$ctype@_W@std@@QBEPB_WPA_WPB_W@Z */
2870 /* ?tolower@?$ctype@_W@std@@QEBAPEB_WPEA_WPEB_W@Z */
2871 /* ?tolower@?$ctype@G@std@@QBEPBGPAGPBG@Z */
2872 /* ?tolower@?$ctype@G@std@@QEBAPEBGPEAGPEBG@Z */
2873 DEFINE_THISCALL_WRAPPER(ctype_wchar_tolower, 12)
2874 const wchar_t* __thiscall ctype_wchar_tolower(const ctype_wchar *this,
2875 wchar_t *first, const wchar_t *last)
2877 TRACE("(%p %p %p)\n", this, first, last);
2878 return call_ctype_wchar_do_tolower(this, first, last);
2881 /* _Towupper */
2882 wchar_t __cdecl _Towupper(wchar_t ch, const _Ctypevec *ctype)
2884 TRACE("(%d %p)\n", ch, ctype);
2885 return toupperW(ch);
2888 /* ?do_toupper@?$ctype@_W@std@@MBE_W_W@Z */
2889 /* ?do_toupper@?$ctype@_W@std@@MEBA_W_W@Z */
2890 /* ?do_toupper@?$ctype@G@std@@MBEGG@Z */
2891 /* ?do_toupper@?$ctype@G@std@@MEBAGG@Z */
2892 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_toupper_ch, 8)
2893 #if _MSVCP_VER <= 100
2894 #define call_ctype_wchar_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 32, \
2895 wchar_t, (const ctype_wchar*, wchar_t), (this, ch))
2896 #else
2897 #define call_ctype_wchar_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 40, \
2898 wchar_t, (const ctype_wchar*, wchar_t), (this, ch))
2899 #endif
2900 wchar_t __thiscall ctype_wchar_do_toupper_ch(const ctype_wchar *this, wchar_t ch)
2902 return _Towupper(ch, &this->ctype);
2905 /* ?do_toupper@?$ctype@_W@std@@MBEPB_WPA_WPB_W@Z */
2906 /* ?do_toupper@?$ctype@_W@std@@MEBAPEB_WPEA_WPEB_W@Z */
2907 /* ?do_toupper@?$ctype@G@std@@MBEPBGPAGPBG@Z */
2908 /* ?do_toupper@?$ctype@G@std@@MEBAPEBGPEAGPEBG@Z */
2909 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_toupper, 12)
2910 #if _MSVCP_VER <= 100
2911 #define call_ctype_wchar_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 28, \
2912 const wchar_t*, (const ctype_wchar*, wchar_t*, const wchar_t*), \
2913 (this, first, last))
2914 #else
2915 #define call_ctype_wchar_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 36, \
2916 const wchar_t*, (const ctype_wchar*, wchar_t*, const wchar_t*), \
2917 (this, first, last))
2918 #endif
2919 const wchar_t* __thiscall ctype_wchar_do_toupper(const ctype_wchar *this,
2920 wchar_t *first, const wchar_t *last)
2922 TRACE("(%p %p %p)\n", this, first, last);
2923 for(; first<last; first++)
2924 *first = _Towupper(*first, &this->ctype);
2925 return last;
2928 /* ?toupper@?$ctype@_W@std@@QBE_W_W@Z */
2929 /* ?toupper@?$ctype@_W@std@@QEBA_W_W@Z */
2930 /* ?toupper@?$ctype@G@std@@QBEGG@Z */
2931 /* ?toupper@?$ctype@G@std@@QEBAGG@Z */
2932 DEFINE_THISCALL_WRAPPER(ctype_wchar_toupper_ch, 8)
2933 wchar_t __thiscall ctype_wchar_toupper_ch(const ctype_wchar *this, wchar_t ch)
2935 TRACE("(%p %d)\n", this, ch);
2936 return call_ctype_wchar_do_toupper_ch(this, ch);
2939 /* ?toupper@?$ctype@_W@std@@QBEPB_WPA_WPB_W@Z */
2940 /* ?toupper@?$ctype@_W@std@@QEBAPEB_WPEA_WPEB_W@Z */
2941 /* ?toupper@?$ctype@G@std@@QBEPBGPAGPBG@Z */
2942 /* ?toupper@?$ctype@G@std@@QEBAPEBGPEAGPEBG@Z */
2943 DEFINE_THISCALL_WRAPPER(ctype_wchar_toupper, 12)
2944 const wchar_t* __thiscall ctype_wchar_toupper(const ctype_wchar *this,
2945 wchar_t *first, const wchar_t *last)
2947 TRACE("(%p %p %p)\n", this, first, last);
2948 return call_ctype_wchar_do_toupper(this, first, last);
2951 /* _Getwctypes */
2952 const wchar_t* __cdecl _Getwctypes(const wchar_t *first, const wchar_t *last,
2953 short *mask, const _Ctypevec *ctype)
2955 TRACE("(%p %p %p %p)\n", first, last, mask, ctype);
2956 GetStringTypeW(CT_CTYPE1, first, last-first, (WORD*)mask);
2957 return last;
2960 /* _Getwctype */
2961 short __cdecl _Getwctype(wchar_t ch, const _Ctypevec *ctype)
2963 short mask = 0;
2964 _Getwctypes(&ch, &ch+1, &mask, ctype);
2965 return mask;
2968 /* ?do_is@?$ctype@_W@std@@MBE_NF_W@Z */
2969 /* ?do_is@?$ctype@_W@std@@MEBA_NF_W@Z */
2970 /* ?do_is@?$ctype@G@std@@MBE_NFG@Z */
2971 /* ?do_is@?$ctype@G@std@@MEBA_NFG@Z */
2972 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_is_ch, 12)
2973 #if _MSVCP_VER <= 100
2974 #define call_ctype_wchar_do_is_ch(this, mask, ch) CALL_VTBL_FUNC(this, 8, \
2975 MSVCP_bool, (const ctype_wchar*, short, wchar_t), (this, mask, ch))
2976 #else
2977 #define call_ctype_wchar_do_is_ch(this, mask, ch) CALL_VTBL_FUNC(this, 16, \
2978 MSVCP_bool, (const ctype_wchar*, short, wchar_t), (this, mask, ch))
2979 #endif
2980 MSVCP_bool __thiscall ctype_wchar_do_is_ch(const ctype_wchar *this, short mask, wchar_t ch)
2982 TRACE("(%p %x %d)\n", this, mask, ch);
2983 return (_Getwctype(ch, &this->ctype) & mask) != 0;
2986 /* ?do_is@?$ctype@_W@std@@MBEPB_WPB_W0PAF@Z */
2987 /* ?do_is@?$ctype@_W@std@@MEBAPEB_WPEB_W0PEAF@Z */
2988 /* ?do_is@?$ctype@G@std@@MBEPBGPBG0PAF@Z */
2989 /* ?do_is@?$ctype@G@std@@MEBAPEBGPEBG0PEAF@Z */
2990 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_is, 16)
2991 #if _MSVCP_VER <= 100
2992 #define call_ctype_wchar_do_is(this, first, last, dest) CALL_VTBL_FUNC(this, 4, \
2993 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, short*), \
2994 (this, first, last, dest))
2995 #else
2996 #define call_ctype_wchar_do_is(this, first, last, dest) CALL_VTBL_FUNC(this, 12, \
2997 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, short*), \
2998 (this, first, last, dest))
2999 #endif
3000 const wchar_t* __thiscall ctype_wchar_do_is(const ctype_wchar *this,
3001 const wchar_t *first, const wchar_t *last, short *dest)
3003 TRACE("(%p %p %p %p)\n", this, first, last, dest);
3004 return _Getwctypes(first, last, dest, &this->ctype);
3007 /* ?is@?$ctype@_W@std@@QBE_NF_W@Z */
3008 /* ?is@?$ctype@_W@std@@QEBA_NF_W@Z */
3009 /* ?is@?$ctype@G@std@@QBE_NFG@Z */
3010 /* ?is@?$ctype@G@std@@QEBA_NFG@Z */
3011 DEFINE_THISCALL_WRAPPER(ctype_wchar_is_ch, 12)
3012 MSVCP_bool __thiscall ctype_wchar_is_ch(const ctype_wchar *this, short mask, wchar_t ch)
3014 TRACE("(%p %x %d)\n", this, mask, ch);
3015 return call_ctype_wchar_do_is_ch(this, mask, ch);
3018 /* ?is@?$ctype@_W@std@@QBEPB_WPB_W0PAF@Z */
3019 /* ?is@?$ctype@_W@std@@QEBAPEB_WPEB_W0PEAF@Z */
3020 /* ?is@?$ctype@G@std@@QBEPBGPBG0PAF@Z */
3021 /* ?is@?$ctype@G@std@@QEBAPEBGPEBG0PEAF@Z */
3022 DEFINE_THISCALL_WRAPPER(ctype_wchar_is, 16)
3023 const wchar_t* __thiscall ctype_wchar_is(const ctype_wchar *this,
3024 const wchar_t *first, const wchar_t *last, short *dest)
3026 TRACE("(%p %p %p %p)\n", this, first, last, dest);
3027 return call_ctype_wchar_do_is(this, first, last, dest);
3030 /* ?do_scan_is@?$ctype@_W@std@@MBEPB_WFPB_W0@Z */
3031 /* ?do_scan_is@?$ctype@_W@std@@MEBAPEB_WFPEB_W0@Z */
3032 /* ?do_scan_is@?$ctype@G@std@@MBEPBGFPBG0@Z */
3033 /* ?do_scan_is@?$ctype@G@std@@MEBAPEBGFPEBG0@Z */
3034 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_scan_is, 16)
3035 #if _MSVCP_VER <= 100
3036 #define call_ctype_wchar_do_scan_is(this, mask, first, last) CALL_VTBL_FUNC(this, 12, \
3037 const wchar_t*, (const ctype_wchar*, short, const wchar_t*, const wchar_t*), \
3038 (this, mask, first, last))
3039 #else
3040 #define call_ctype_wchar_do_scan_is(this, mask, first, last) CALL_VTBL_FUNC(this, 20, \
3041 const wchar_t*, (const ctype_wchar*, short, const wchar_t*, const wchar_t*), \
3042 (this, mask, first, last))
3043 #endif
3044 const wchar_t* __thiscall ctype_wchar_do_scan_is(const ctype_wchar *this,
3045 short mask, const wchar_t *first, const wchar_t *last)
3047 TRACE("(%p %d %p %p)\n", this, mask, first, last);
3048 for(; first<last; first++)
3049 if(!ctype_wchar_is_ch(this, mask, *first))
3050 break;
3051 return first;
3054 /* ?scan_is@?$ctype@_W@std@@QBEPB_WFPB_W0@Z */
3055 /* ?scan_is@?$ctype@_W@std@@QEBAPEB_WFPEB_W0@Z */
3056 /* ?scan_is@?$ctype@G@std@@QBEPBGFPBG0@Z */
3057 /* ?scan_is@?$ctype@G@std@@QEBAPEBGFPEBG0@Z */
3058 DEFINE_THISCALL_WRAPPER(ctype_wchar_scan_is, 16)
3059 const wchar_t* __thiscall ctype_wchar_scan_is(const ctype_wchar *this,
3060 short mask, const wchar_t *first, const wchar_t *last)
3062 TRACE("(%p %x %p %p)\n", this, mask, first, last);
3063 return call_ctype_wchar_do_scan_is(this, mask, first, last);
3066 /* ?do_scan_not@?$ctype@_W@std@@MBEPB_WFPB_W0@Z */
3067 /* ?do_scan_not@?$ctype@_W@std@@MEBAPEB_WFPEB_W0@Z */
3068 /* ?do_scan_not@?$ctype@G@std@@MBEPBGFPBG0@Z */
3069 /* ?do_scan_not@?$ctype@G@std@@MEBAPEBGFPEBG0@Z */
3070 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_scan_not, 16)
3071 #if _MSVCP_VER <= 100
3072 #define call_ctype_wchar_do_scan_not(this, mask, first, last) CALL_VTBL_FUNC(this, 16, \
3073 const wchar_t*, (const ctype_wchar*, short, const wchar_t*, const wchar_t*), \
3074 (this, mask, first, last))
3075 #else
3076 #define call_ctype_wchar_do_scan_not(this, mask, first, last) CALL_VTBL_FUNC(this, 24, \
3077 const wchar_t*, (const ctype_wchar*, short, const wchar_t*, const wchar_t*), \
3078 (this, mask, first, last))
3079 #endif
3080 const wchar_t* __thiscall ctype_wchar_do_scan_not(const ctype_wchar *this,
3081 short mask, const wchar_t *first, const wchar_t *last)
3083 TRACE("(%p %x %p %p)\n", this, mask, first, last);
3084 for(; first<last; first++)
3085 if(ctype_wchar_is_ch(this, mask, *first))
3086 break;
3087 return first;
3090 /* ?scan_not@?$ctype@_W@std@@QBEPB_WFPB_W0@Z */
3091 /* ?scan_not@?$ctype@_W@std@@QEBAPEB_WFPEB_W0@Z */
3092 /* ?scan_not@?$ctype@G@std@@QBEPBGFPBG0@Z */
3093 /* ?scan_not@?$ctype@G@std@@QEBAPEBGFPEBG0@Z */
3094 DEFINE_THISCALL_WRAPPER(ctype_wchar_scan_not, 16)
3095 const wchar_t* __thiscall ctype_wchar_scan_not(const ctype_wchar *this,
3096 short mask, const wchar_t *first, const wchar_t *last)
3098 TRACE("(%p %x %p %p)\n", this, mask, first, last);
3099 return call_ctype_wchar_do_scan_not(this, mask, first, last);
3102 /* ??_7codecvt_base@std@@6B@ */
3103 extern const vtable_ptr MSVCP_codecvt_base_vtable;
3105 /* ??0codecvt_base@std@@QAE@I@Z */
3106 /* ??0codecvt_base@std@@QEAA@_K@Z */
3107 DEFINE_THISCALL_WRAPPER(codecvt_base_ctor_refs, 8)
3108 codecvt_base* __thiscall codecvt_base_ctor_refs(codecvt_base *this, MSVCP_size_t refs)
3110 TRACE("(%p %lu)\n", this, refs);
3111 locale_facet_ctor_refs(&this->facet, refs);
3112 this->facet.vtable = &MSVCP_codecvt_base_vtable;
3113 return this;
3116 /* ??_Fcodecvt_base@std@@QAEXXZ */
3117 /* ??_Fcodecvt_base@std@@QEAAXXZ */
3118 DEFINE_THISCALL_WRAPPER(codecvt_base_ctor, 4)
3119 codecvt_base* __thiscall codecvt_base_ctor(codecvt_base *this)
3121 return codecvt_base_ctor_refs(this, 0);
3124 /* ??1codecvt_base@std@@UAE@XZ */
3125 /* ??1codecvt_base@std@@UEAA@XZ */
3126 DEFINE_THISCALL_WRAPPER(codecvt_base_dtor, 4)
3127 void __thiscall codecvt_base_dtor(codecvt_base *this)
3129 TRACE("(%p)\n", this);
3130 locale_facet_dtor(&this->facet);
3133 DEFINE_THISCALL_WRAPPER(codecvt_base_vector_dtor, 8)
3134 codecvt_base* __thiscall codecvt_base_vector_dtor(codecvt_base *this, unsigned int flags)
3136 TRACE("(%p %x)\n", this, flags);
3137 if(flags & 2) {
3138 /* we have an array, with the number of elements stored before the first object */
3139 INT_PTR i, *ptr = (INT_PTR *)this-1;
3141 for(i=*ptr-1; i>=0; i--)
3142 codecvt_base_dtor(this+i);
3143 MSVCRT_operator_delete(ptr);
3144 } else {
3145 codecvt_base_dtor(this);
3146 if(flags & 1)
3147 MSVCRT_operator_delete(this);
3150 return this;
3153 /* ?do_always_noconv@codecvt_base@std@@MBE_NXZ */
3154 /* ?do_always_noconv@codecvt_base@std@@MEBA_NXZ */
3155 #if _MSVCP_VER <= 100
3156 #define call_codecvt_base_do_always_noconv(this) CALL_VTBL_FUNC(this, 4, \
3157 MSVCP_bool, (const codecvt_base*), (this))
3158 #else
3159 #define call_codecvt_base_do_always_noconv(this) CALL_VTBL_FUNC(this, 12, \
3160 MSVCP_bool, (const codecvt_base*), (this))
3161 #endif
3162 DEFINE_THISCALL_WRAPPER(codecvt_base_do_always_noconv, 4)
3163 MSVCP_bool __thiscall codecvt_base_do_always_noconv(const codecvt_base *this)
3165 TRACE("(%p)\n", this);
3166 return TRUE;
3169 /* ?always_noconv@codecvt_base@std@@QBE_NXZ */
3170 /* ?always_noconv@codecvt_base@std@@QEBA_NXZ */
3171 DEFINE_THISCALL_WRAPPER(codecvt_base_always_noconv, 4)
3172 MSVCP_bool __thiscall codecvt_base_always_noconv(const codecvt_base *this)
3174 TRACE("(%p)\n", this);
3175 return call_codecvt_base_do_always_noconv(this);
3178 /* ?do_max_length@codecvt_base@std@@MBEHXZ */
3179 /* ?do_max_length@codecvt_base@std@@MEBAHXZ */
3180 #if _MSVCP_VER <= 100
3181 #define call_codecvt_base_do_max_length(this) CALL_VTBL_FUNC(this, 8, \
3182 int, (const codecvt_base*), (this))
3183 #else
3184 #define call_codecvt_base_do_max_length(this) CALL_VTBL_FUNC(this, 16, \
3185 int, (const codecvt_base*), (this))
3186 #endif
3187 DEFINE_THISCALL_WRAPPER(codecvt_base_do_max_length, 4)
3188 int __thiscall codecvt_base_do_max_length(const codecvt_base *this)
3190 TRACE("(%p)\n", this);
3191 return 1;
3194 /* ?max_length@codecvt_base@std@@QBEHXZ */
3195 /* ?max_length@codecvt_base@std@@QEBAHXZ */
3196 DEFINE_THISCALL_WRAPPER(codecvt_base_max_length, 4)
3197 int __thiscall codecvt_base_max_length(const codecvt_base *this)
3199 TRACE("(%p)\n", this);
3200 return call_codecvt_base_do_max_length(this);
3203 /* ?do_encoding@codecvt_base@std@@MBEHXZ */
3204 /* ?do_encoding@codecvt_base@std@@MEBAHXZ */
3205 #if _MSVCP_VER <= 100
3206 #define call_codecvt_base_do_encoding(this) CALL_VTBL_FUNC(this, 12, \
3207 int, (const codecvt_base*), (this))
3208 #else
3209 #define call_codecvt_base_do_encoding(this) CALL_VTBL_FUNC(this, 20, \
3210 int, (const codecvt_base*), (this))
3211 #endif
3212 DEFINE_THISCALL_WRAPPER(codecvt_base_do_encoding, 4)
3213 int __thiscall codecvt_base_do_encoding(const codecvt_base *this)
3215 TRACE("(%p)\n", this);
3216 return 1;
3219 /* ?encoding@codecvt_base@std@@QBEHXZ */
3220 /* ?encoding@codecvt_base@std@@QEBAHXZ */
3221 DEFINE_THISCALL_WRAPPER(codecvt_base_encoding, 4)
3222 int __thiscall codecvt_base_encoding(const codecvt_base *this)
3224 TRACE("(%p)\n", this);
3225 return call_codecvt_base_do_encoding(this);
3228 /* ?id@?$codecvt@DDH@std@@2V0locale@2@A */
3229 locale_id codecvt_char_id = {0};
3231 /* ??_7?$codecvt@DDH@std@@6B@ */
3232 extern const vtable_ptr MSVCP_codecvt_char_vtable;
3234 /* ?_Init@?$codecvt@DDH@std@@IAEXABV_Locinfo@2@@Z */
3235 /* ?_Init@?$codecvt@DDH@std@@IEAAXAEBV_Locinfo@2@@Z */
3236 DEFINE_THISCALL_WRAPPER(codecvt_char__Init, 8)
3237 void __thiscall codecvt_char__Init(codecvt_char *this, const _Locinfo *locinfo)
3239 TRACE("(%p %p)\n", this, locinfo);
3242 /* ??0?$codecvt@DDH@std@@QAE@ABV_Locinfo@1@I@Z */
3243 /* ??0?$codecvt@DDH@std@@QEAA@AEBV_Locinfo@1@_K@Z */
3244 DEFINE_THISCALL_WRAPPER(codecvt_char_ctor_locinfo, 12)
3245 codecvt_char* __thiscall codecvt_char_ctor_locinfo(codecvt_char *this, const _Locinfo *locinfo, MSVCP_size_t refs)
3247 TRACE("(%p %p %lu)\n", this, locinfo, refs);
3248 codecvt_base_ctor_refs(&this->base, refs);
3249 this->base.facet.vtable = &MSVCP_codecvt_char_vtable;
3250 return this;
3253 /* ??0?$codecvt@DDH@std@@QAE@I@Z */
3254 /* ??0?$codecvt@DDH@std@@QEAA@_K@Z */
3255 DEFINE_THISCALL_WRAPPER(codecvt_char_ctor_refs, 8)
3256 codecvt_char* __thiscall codecvt_char_ctor_refs(codecvt_char *this, MSVCP_size_t refs)
3258 return codecvt_char_ctor_locinfo(this, NULL, refs);
3261 /* ??_F?$codecvt@DDH@std@@QAEXXZ */
3262 /* ??_F?$codecvt@DDH@std@@QEAAXXZ */
3263 DEFINE_THISCALL_WRAPPER(codecvt_char_ctor, 4)
3264 codecvt_char* __thiscall codecvt_char_ctor(codecvt_char *this)
3266 return codecvt_char_ctor_locinfo(this, NULL, 0);
3269 /* ??1?$codecvt@DDH@std@@UAE@XZ */
3270 /* ??1?$codecvt@DDH@std@@UEAA@XZ */
3271 /* ??1?$codecvt@DDH@std@@MAE@XZ */
3272 /* ??1?$codecvt@DDH@std@@MEAA@XZ */
3273 DEFINE_THISCALL_WRAPPER(codecvt_char_dtor, 4)
3274 void __thiscall codecvt_char_dtor(codecvt_char *this)
3276 TRACE("(%p)\n", this);
3277 codecvt_base_dtor(&this->base);
3280 DEFINE_THISCALL_WRAPPER(codecvt_char_vector_dtor, 8)
3281 codecvt_char* __thiscall codecvt_char_vector_dtor(codecvt_char *this, unsigned int flags)
3283 TRACE("(%p %x)\n", this, flags);
3284 if(flags & 2) {
3285 /* we have an array, with the number of elements stored before the first object */
3286 INT_PTR i, *ptr = (INT_PTR *)this-1;
3288 for(i=*ptr-1; i>=0; i--)
3289 codecvt_char_dtor(this+i);
3290 MSVCRT_operator_delete(ptr);
3291 } else {
3292 codecvt_char_dtor(this);
3293 if(flags & 1)
3294 MSVCRT_operator_delete(this);
3297 return this;
3300 /* ?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3301 /* ?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3302 MSVCP_size_t __cdecl codecvt_char__Getcat(const locale_facet **facet, const locale *loc)
3304 TRACE("(%p %p)\n", facet, loc);
3306 if(facet && !*facet) {
3307 *facet = MSVCRT_operator_new(sizeof(codecvt_char));
3308 if(!*facet) {
3309 ERR("Out of memory\n");
3310 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3311 return 0;
3313 codecvt_char_ctor((codecvt_char*)*facet);
3316 return LC_CTYPE;
3319 /* ?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@@Z */
3320 /* ?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@@Z */
3321 MSVCP_size_t __cdecl codecvt_char__Getcat_old(const locale_facet **facet)
3323 return codecvt_char__Getcat(facet, locale_classic());
3326 codecvt_char* codecvt_char_use_facet(const locale *loc)
3328 static codecvt_char *obj = NULL;
3330 _Lockit lock;
3331 const locale_facet *fac;
3333 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3334 fac = locale__Getfacet(loc, locale_id_operator_size_t(&codecvt_char_id));
3335 if(fac) {
3336 _Lockit_dtor(&lock);
3337 return (codecvt_char*)fac;
3340 if(obj) {
3341 _Lockit_dtor(&lock);
3342 return obj;
3345 codecvt_char__Getcat(&fac, loc);
3346 obj = (codecvt_char*)fac;
3347 call_locale_facet__Incref(&obj->base.facet);
3348 locale_facet_register(&obj->base.facet);
3349 _Lockit_dtor(&lock);
3351 return obj;
3354 /* ?do_in@?$codecvt@DDH@std@@MBEHAAHPBD1AAPBDPAD3AAPAD@Z */
3355 /* ?do_in@?$codecvt@DDH@std@@MEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
3356 #if _MSVCP_VER <= 100
3357 #define call_codecvt_char_do_in(this, state, from, from_end, from_next, to, to_end, to_next) \
3358 CALL_VTBL_FUNC(this, 16, int, \
3359 (const codecvt_char*, int*, const char*, const char*, const char**, char*, char*, char**), \
3360 (this, state, from, from_end, from_next, to, to_end, to_next))
3361 #else
3362 #define call_codecvt_char_do_in(this, state, from, from_end, from_next, to, to_end, to_next) \
3363 CALL_VTBL_FUNC(this, 24, int, \
3364 (const codecvt_char*, int*, const char*, const char*, const char**, char*, char*, char**), \
3365 (this, state, from, from_end, from_next, to, to_end, to_next))
3366 #endif
3367 DEFINE_THISCALL_WRAPPER(codecvt_char_do_in, 32)
3368 int __thiscall codecvt_char_do_in(const codecvt_char *this, int *state,
3369 const char *from, const char *from_end, const char **from_next,
3370 char *to, char *to_end, char **to_next)
3372 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from, from_end,
3373 from_next, to, to_end, to_next);
3374 *from_next = from;
3375 *to_next = to;
3376 return CODECVT_noconv;
3379 /* ?in@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z */
3380 /* ?in@?$codecvt@DDH@std@@QEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
3381 DEFINE_THISCALL_WRAPPER(codecvt_char_in, 32)
3382 int __thiscall codecvt_char_in(const codecvt_char *this, int *state,
3383 const char *from, const char *from_end, const char **from_next,
3384 char *to, char *to_end, char **to_next)
3386 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from, from_end,
3387 from_next, to, to_end, to_next);
3388 return call_codecvt_char_do_in(this, state, from, from_end, from_next,
3389 to, to_end, to_next);
3392 /* ?do_out@?$codecvt@DDH@std@@MBEHAAHPBD1AAPBDPAD3AAPAD@Z */
3393 /* ?do_out@?$codecvt@DDH@std@@MEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
3394 #if _MSVCP_VER <= 100
3395 #define call_codecvt_char_do_out(this, state, from, from_end, from_next, to, to_end, to_next) \
3396 CALL_VTBL_FUNC(this, 20, int, \
3397 (const codecvt_char*, int*, const char*, const char*, const char**, char*, char*, char**), \
3398 (this, state, from, from_end, from_next, to, to_end, to_next))
3399 #else
3400 #define call_codecvt_char_do_out(this, state, from, from_end, from_next, to, to_end, to_next) \
3401 CALL_VTBL_FUNC(this, 28, int, \
3402 (const codecvt_char*, int*, const char*, const char*, const char**, char*, char*, char**), \
3403 (this, state, from, from_end, from_next, to, to_end, to_next))
3404 #endif
3405 DEFINE_THISCALL_WRAPPER(codecvt_char_do_out, 32)
3406 int __thiscall codecvt_char_do_out(const codecvt_char *this, int *state,
3407 const char *from, const char *from_end, const char **from_next,
3408 char *to, char *to_end, char **to_next)
3410 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3411 from_end, from_next, to, to_end, to_next);
3412 *from_next = from;
3413 *to_next = to;
3414 return CODECVT_noconv;
3417 /* ?out@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z */
3418 /* ?out@?$codecvt@DDH@std@@QEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
3419 DEFINE_THISCALL_WRAPPER(codecvt_char_out, 32)
3420 int __thiscall codecvt_char_out(const codecvt_char *this, int *state,
3421 const char *from, const char *from_end, const char **from_next,
3422 char *to, char *to_end, char **to_next)
3424 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from, from_end,
3425 from_next, to, to_end, to_next);
3426 return call_codecvt_char_do_out(this, state, from, from_end, from_next,
3427 to, to_end, to_next);
3430 /* ?do_unshift@?$codecvt@DDH@std@@MBEHAAHPAD1AAPAD@Z */
3431 /* ?do_unshift@?$codecvt@DDH@std@@MEBAHAEAHPEAD1AEAPEAD@Z */
3432 #if _MSVCP_VER <= 100
3433 #define call_codecvt_char_do_unshift(this, state, to, to_end, to_next) CALL_VTBL_FUNC(this, 24, \
3434 int, (const codecvt_char*, int*, char*, char*, char**), (this, state, to, to_end, to_next))
3435 #else
3436 #define call_codecvt_char_do_unshift(this, state, to, to_end, to_next) CALL_VTBL_FUNC(this, 32, \
3437 int, (const codecvt_char*, int*, char*, char*, char**), (this, state, to, to_end, to_next))
3438 #endif
3439 DEFINE_THISCALL_WRAPPER(codecvt_char_do_unshift, 20)
3440 int __thiscall codecvt_char_do_unshift(const codecvt_char *this,
3441 int *state, char *to, char *to_end, char **to_next)
3443 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
3444 *to_next = to;
3445 return CODECVT_noconv;
3448 /* ?unshift@?$codecvt@DDH@std@@QBEHAAHPAD1AAPAD@Z */
3449 /* ?unshift@?$codecvt@DDH@std@@QEBAHAEAHPEAD1AEAPEAD@Z */
3450 DEFINE_THISCALL_WRAPPER(codecvt_char_unshift, 20)
3451 int __thiscall codecvt_char_unshift(const codecvt_char *this,
3452 int *state, char *to, char *to_end, char **to_next)
3454 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
3455 return call_codecvt_char_do_unshift(this, state, to, to_end, to_next);
3458 /* ?do_length@?$codecvt@DDH@std@@MBEHABHPBD1I@Z */
3459 /* ?do_length@?$codecvt@DDH@std@@MEBAHAEBHPEBD1_K@Z */
3460 #if _MSVCP_VER <= 100
3461 #define call_codecvt_char_do_length(this, state, from, from_end, max) CALL_VTBL_FUNC(this, 28, \
3462 int, (const codecvt_char*, const int*, const char*, const char*, MSVCP_size_t), \
3463 (this, state, from, from_end, max))
3464 #else
3465 #define call_codecvt_char_do_length(this, state, from, from_end, max) CALL_VTBL_FUNC(this, 36, \
3466 int, (const codecvt_char*, const int*, const char*, const char*, MSVCP_size_t), \
3467 (this, state, from, from_end, max))
3468 #endif
3469 DEFINE_THISCALL_WRAPPER(codecvt_char_do_length, 20)
3470 int __thiscall codecvt_char_do_length(const codecvt_char *this, const int *state,
3471 const char *from, const char *from_end, MSVCP_size_t max)
3473 TRACE("(%p %p %p %p %lu)\n", this, state, from, from_end, max);
3474 return (from_end-from > max ? max : from_end-from);
3477 /* ?length@?$codecvt@DDH@std@@QBEHABHPBD1I@Z */
3478 /* ?length@?$codecvt@DDH@std@@QEBAHAEBHPEBD1_K@Z */
3479 DEFINE_THISCALL_WRAPPER(codecvt_char_length, 20)
3480 int __thiscall codecvt_char_length(const codecvt_char *this, const int *state,
3481 const char *from, const char *from_end, MSVCP_size_t max)
3483 TRACE("(%p %p %p %p %lu)\n", this, state, from, from_end, max);
3484 return call_codecvt_char_do_length(this, state, from, from_end, max);
3487 /* ?id@?$codecvt@_WDH@std@@2V0locale@2@A */
3488 locale_id codecvt_wchar_id = {0};
3489 /* ?id@?$codecvt@GDH@std@@2V0locale@2@A */
3490 locale_id codecvt_short_id = {0};
3492 /* ??_7?$codecvt@_WDH@std@@6B@ */
3493 extern const vtable_ptr MSVCP_codecvt_wchar_vtable;
3494 /* ??_7?$codecvt@GDH@std@@6B@ */
3495 extern const vtable_ptr MSVCP_codecvt_short_vtable;
3497 /* ?_Init@?$codecvt@GDH@std@@IAEXABV_Locinfo@2@@Z */
3498 /* ?_Init@?$codecvt@GDH@std@@IEAAXAEBV_Locinfo@2@@Z */
3499 /* ?_Init@?$codecvt@_WDH@std@@IAEXABV_Locinfo@2@@Z */
3500 /* ?_Init@?$codecvt@_WDH@std@@IEAAXAEBV_Locinfo@2@@Z */
3501 DEFINE_THISCALL_WRAPPER(codecvt_wchar__Init, 8)
3502 void __thiscall codecvt_wchar__Init(codecvt_wchar *this, const _Locinfo *locinfo)
3504 TRACE("(%p %p)\n", this, locinfo);
3505 _Locinfo__Getcvt(locinfo, &this->cvt);
3508 /* ??0?$codecvt@_WDH@std@@QAE@ABV_Locinfo@1@I@Z */
3509 /* ??0?$codecvt@_WDH@std@@QEAA@AEBV_Locinfo@1@_K@Z */
3510 DEFINE_THISCALL_WRAPPER(codecvt_wchar_ctor_locinfo, 12)
3511 codecvt_wchar* __thiscall codecvt_wchar_ctor_locinfo(codecvt_wchar *this, const _Locinfo *locinfo, MSVCP_size_t refs)
3513 TRACE("(%p %p %ld)\n", this, locinfo, refs);
3515 codecvt_base_ctor_refs(&this->base, refs);
3516 this->base.facet.vtable = &MSVCP_codecvt_wchar_vtable;
3518 codecvt_wchar__Init(this, locinfo);
3519 return this;
3522 /* ??0?$codecvt@GDH@std@@QAE@ABV_Locinfo@1@I@Z */
3523 /* ??0?$codecvt@GDH@std@@QEAA@AEBV_Locinfo@1@_K@Z */
3524 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor_locinfo, 12)
3525 codecvt_wchar* __thiscall codecvt_short_ctor_locinfo(codecvt_wchar *this, const _Locinfo *locinfo, MSVCP_size_t refs)
3527 TRACE("(%p %p %ld)\n", this, locinfo, refs);
3529 codecvt_wchar_ctor_locinfo(this, locinfo, refs);
3530 this->base.facet.vtable = &MSVCP_codecvt_short_vtable;
3531 return this;
3534 /* ??0?$codecvt@_WDH@std@@QAE@I@Z */
3535 /* ??0?$codecvt@_WDH@std@@QEAA@_K@Z */
3536 DEFINE_THISCALL_WRAPPER(codecvt_wchar_ctor_refs, 8)
3537 codecvt_wchar* __thiscall codecvt_wchar_ctor_refs(codecvt_wchar *this, MSVCP_size_t refs)
3539 _Locinfo locinfo;
3541 TRACE("(%p %ld)\n", this, refs);
3543 _Locinfo_ctor(&locinfo);
3544 codecvt_wchar_ctor_locinfo(this, &locinfo, refs);
3545 _Locinfo_dtor(&locinfo);
3546 return this;
3549 /* ??0?$codecvt@GDH@std@@QAE@I@Z */
3550 /* ??0?$codecvt@GDH@std@@QEAA@_K@Z */
3551 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor_refs, 8)
3552 codecvt_wchar* __thiscall codecvt_short_ctor_refs(codecvt_wchar *this, MSVCP_size_t refs)
3554 _Locinfo locinfo;
3556 TRACE("(%p %ld)\n", this, refs);
3558 _Locinfo_ctor(&locinfo);
3559 codecvt_short_ctor_locinfo(this, &locinfo, refs);
3560 _Locinfo_dtor(&locinfo);
3561 return this;
3564 /* ??0?$codecvt@GDH@std@@IAE@PBDI@Z */
3565 /* ??0?$codecvt@GDH@std@@IEAA@PEBD_K@Z */
3566 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor_name, 12)
3567 codecvt_wchar* __thiscall codecvt_short_ctor_name(codecvt_wchar *this, const char *name, MSVCP_size_t refs)
3569 _Locinfo locinfo;
3571 TRACE("(%p %s %ld)\n", this, name, refs);
3573 _Locinfo_ctor_cstr(&locinfo, name);
3574 codecvt_short_ctor_locinfo(this, &locinfo, refs);
3575 _Locinfo_dtor(&locinfo);
3576 return this;
3579 /* ??_F?$codecvt@_WDH@std@@QAEXXZ */
3580 /* ??_F?$codecvt@_WDH@std@@QEAAXXZ */
3581 DEFINE_THISCALL_WRAPPER(codecvt_wchar_ctor, 4)
3582 codecvt_wchar* __thiscall codecvt_wchar_ctor(codecvt_wchar *this)
3584 return codecvt_wchar_ctor_refs(this, 0);
3587 /* ??_F?$codecvt@GDH@std@@QAEXXZ */
3588 /* ??_F?$codecvt@GDH@std@@QEAAXXZ */
3589 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor, 4)
3590 codecvt_wchar* __thiscall codecvt_short_ctor(codecvt_wchar *this)
3592 return codecvt_short_ctor_refs(this, 0);
3595 /* ??1?$codecvt@GDH@std@@UAE@XZ */
3596 /* ??1?$codecvt@GDH@std@@UEAA@XZ */
3597 /* ??1?$codecvt@GDH@std@@MAE@XZ */
3598 /* ??1?$codecvt@GDH@std@@MEAA@XZ */
3599 /* ??1?$codecvt@_WDH@std@@MAE@XZ */
3600 /* ??1?$codecvt@_WDH@std@@MEAA@XZ */
3601 DEFINE_THISCALL_WRAPPER(codecvt_wchar_dtor, 4)
3602 void __thiscall codecvt_wchar_dtor(codecvt_wchar *this)
3604 TRACE("(%p)\n", this);
3605 codecvt_base_dtor(&this->base);
3608 DEFINE_THISCALL_WRAPPER(codecvt_wchar_vector_dtor, 8)
3609 codecvt_wchar* __thiscall codecvt_wchar_vector_dtor(codecvt_wchar *this, unsigned int flags)
3611 TRACE("(%p %x)\n", this, flags);
3612 if(flags & 2) {
3613 /* we have an array, with the number of elements stored before the first object */
3614 INT_PTR i, *ptr = (INT_PTR *)this-1;
3616 for(i=*ptr-1; i>=0; i--)
3617 codecvt_wchar_dtor(this+i);
3618 MSVCRT_operator_delete(ptr);
3619 } else {
3620 codecvt_wchar_dtor(this);
3621 if(flags & 1)
3622 MSVCRT_operator_delete(this);
3625 return this;
3628 /* ?_Getcat@?$codecvt@_WDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3629 /* ?_Getcat@?$codecvt@_WDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3630 MSVCP_size_t __cdecl codecvt_wchar__Getcat(const locale_facet **facet, const locale *loc)
3632 TRACE("(%p %p)\n", facet, loc);
3634 if(facet && !*facet) {
3635 _Locinfo locinfo;
3637 *facet = MSVCRT_operator_new(sizeof(codecvt_wchar));
3638 if(!*facet) {
3639 ERR("Out of memory\n");
3640 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3641 return 0;
3644 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
3645 codecvt_wchar_ctor_locinfo((codecvt_wchar*)*facet, &locinfo, 0);
3646 _Locinfo_dtor(&locinfo);
3649 return LC_CTYPE;
3652 /* ?_Getcat@?$codecvt@_WDH@std@@SAIPAPBVfacet@locale@2@@Z */
3653 /* ?_Getcat@?$codecvt@_WDH@std@@SA_KPEAPEBVfacet@locale@2@@Z */
3654 MSVCP_size_t __cdecl codecvt_wchar__Getcat_old(const locale_facet **facet)
3656 return codecvt_wchar__Getcat(facet, locale_classic());
3659 codecvt_wchar* codecvt_wchar_use_facet(const locale *loc)
3661 static codecvt_wchar *obj = NULL;
3663 _Lockit lock;
3664 const locale_facet *fac;
3666 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3667 fac = locale__Getfacet(loc, locale_id_operator_size_t(&codecvt_wchar_id));
3668 if(fac) {
3669 _Lockit_dtor(&lock);
3670 return (codecvt_wchar*)fac;
3673 if(obj) {
3674 _Lockit_dtor(&lock);
3675 return obj;
3678 codecvt_wchar__Getcat(&fac, loc);
3679 obj = (codecvt_wchar*)fac;
3680 call_locale_facet__Incref(&obj->base.facet);
3681 locale_facet_register(&obj->base.facet);
3682 _Lockit_dtor(&lock);
3684 return obj;
3687 /* ?_Getcat@?$codecvt@GDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3688 /* ?_Getcat@?$codecvt@GDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3689 MSVCP_size_t __cdecl codecvt_short__Getcat(const locale_facet **facet, const locale *loc)
3691 TRACE("(%p %p)\n", facet, loc);
3693 if(facet && !*facet) {
3694 _Locinfo locinfo;
3696 *facet = MSVCRT_operator_new(sizeof(codecvt_wchar));
3697 if(!*facet) {
3698 ERR("Out of memory\n");
3699 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3700 return 0;
3703 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
3704 codecvt_short_ctor((codecvt_wchar*)*facet);
3705 _Locinfo_dtor(&locinfo);
3708 return LC_CTYPE;
3711 /* ?_Getcat@?$codecvt@GDH@std@@SAIPAPBVfacet@locale@2@@Z */
3712 /* ?_Getcat@?$codecvt@GDH@std@@SA_KPEAPEBVfacet@locale@2@@Z */
3713 MSVCP_size_t __cdecl codecvt_short__Getcat_old(const locale_facet **facet)
3715 return codecvt_short__Getcat(facet, locale_classic());
3718 codecvt_wchar* codecvt_short_use_facet(const locale *loc)
3720 static codecvt_wchar *obj = NULL;
3722 _Lockit lock;
3723 const locale_facet *fac;
3725 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3726 fac = locale__Getfacet(loc, locale_id_operator_size_t(&codecvt_short_id));
3727 if(fac) {
3728 _Lockit_dtor(&lock);
3729 return (codecvt_wchar*)fac;
3732 if(obj) {
3733 _Lockit_dtor(&lock);
3734 return obj;
3737 codecvt_short__Getcat(&fac, loc);
3738 obj = (codecvt_wchar*)fac;
3739 call_locale_facet__Incref(&obj->base.facet);
3740 locale_facet_register(&obj->base.facet);
3741 _Lockit_dtor(&lock);
3743 return obj;
3746 /* ?_Id_func@?$codecvt@_WDH@std@@SAAAVid@locale@2@XZ */
3747 /* ?_Id_func@?$codecvt@_WDH@std@@SAAEAVid@locale@2@XZ */
3748 locale_id* __cdecl codecvt_wchar__Id_func(void)
3750 TRACE("()\n");
3751 return &codecvt_wchar_id;
3754 /* ?_Id_func@?$codecvt@GDH@std@@SAAAVid@locale@2@XZ */
3755 /* ?_Id_func@?$codecvt@GDH@std@@SAAEAVid@locale@2@XZ */
3756 locale_id* __cdecl codecvt_short__Id_func(void)
3758 TRACE("()\n");
3759 return &codecvt_short_id;
3762 /* ?do_always_noconv@?$codecvt@GDH@std@@MBE_NXZ */
3763 /* ?do_always_noconv@?$codecvt@GDH@std@@MEBA_NXZ */
3764 /* ?do_always_noconv@?$codecvt@_WDH@std@@MBE_NXZ */
3765 /* ?do_always_noconv@?$codecvt@_WDH@std@@MEBA_NXZ */
3766 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_always_noconv, 4)
3767 MSVCP_bool __thiscall codecvt_wchar_do_always_noconv(const codecvt_wchar *this)
3769 TRACE("(%p)\n", this);
3770 return FALSE;
3773 /* ?do_max_length@?$codecvt@GDH@std@@MBEHXZ */
3774 /* ?do_max_length@?$codecvt@GDH@std@@MEBAHXZ */
3775 /* ?do_max_length@?$codecvt@_WDH@std@@MBEHXZ */
3776 /* ?do_max_length@?$codecvt@_WDH@std@@MEBAHXZ */
3777 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_max_length, 4)
3778 int __thiscall codecvt_wchar_do_max_length(const codecvt_wchar *this)
3780 TRACE("(%p)\n", this);
3781 return MB_LEN_MAX;
3784 /* ?do_encoding@?$codecvt@GDH@std@@MBEHXZ */
3785 /* ?do_encoding@?$codecvt@GDH@std@@MEBAHXZ */
3786 /* ?do_encoding@?$codecvt@_WDH@std@@MBEHXZ */
3787 /* ?do_encoding@?$codecvt@_WDH@std@@MEBAHXZ */
3788 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_encoding, 4)
3789 int __thiscall codecvt_wchar_do_encoding(const codecvt_wchar *this)
3791 TRACE("(%p)\n", this);
3792 return 0;
3795 /* ?do_in@?$codecvt@GDH@std@@MBEHAAHPBD1AAPBDPAG3AAPAG@Z */
3796 /* ?do_in@?$codecvt@GDH@std@@MEBAHAEAHPEBD1AEAPEBDPEAG3AEAPEAG@Z */
3797 /* ?do_in@?$codecvt@_WDH@std@@MBEHAAHPBD1AAPBDPA_W3AAPA_W@Z */
3798 /* ?do_in@?$codecvt@_WDH@std@@MEBAHAEAHPEBD1AEAPEBDPEA_W3AEAPEA_W@Z */
3799 #if _MSVCP_VER <= 100
3800 #define call_codecvt_wchar_do_in(this, state, from, from_end, from_next, to, to_end, to_next) \
3801 CALL_VTBL_FUNC(this, 16, int, \
3802 (const codecvt_wchar*, int*, const char*, const char*, const char**, wchar_t*, wchar_t*, wchar_t**), \
3803 (this, state, from, from_end, from_next, to, to_end, to_next))
3804 #else
3805 #define call_codecvt_wchar_do_in(this, state, from, from_end, from_next, to, to_end, to_next) \
3806 CALL_VTBL_FUNC(this, 24, int, \
3807 (const codecvt_wchar*, int*, const char*, const char*, const char**, wchar_t*, wchar_t*, wchar_t**), \
3808 (this, state, from, from_end, from_next, to, to_end, to_next))
3809 #endif
3810 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_in, 32)
3811 int __thiscall codecvt_wchar_do_in(const codecvt_wchar *this, int *state,
3812 const char *from, const char *from_end, const char **from_next,
3813 wchar_t *to, wchar_t *to_end, wchar_t **to_next)
3815 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3816 from_end, from_next, to, to_end, to_next);
3818 *from_next = from;
3819 *to_next = to;
3821 while(*from_next!=from_end && *to_next!=to_end) {
3822 switch(_Mbrtowc(*to_next, *from_next, from_end-*from_next, state, &this->cvt)) {
3823 case -2:
3824 *from_next = from_end;
3825 return CODECVT_partial;
3826 case -1:
3827 return CODECVT_error;
3828 case 2:
3829 (*from_next)++;
3830 /* fall through */
3831 case 0:
3832 case 1:
3833 (*from_next)++;
3834 (*to_next)++;
3838 return CODECVT_ok;
3841 /* ?in@?$codecvt@GDH@std@@QBEHAAHPBD1AAPBDPAG3AAPAG@Z */
3842 /* ?in@?$codecvt@GDH@std@@QEBAHAEAHPEBD1AEAPEBDPEAG3AEAPEAG@Z */
3843 /* ?in@?$codecvt@_WDH@std@@QBEHAAHPBD1AAPBDPA_W3AAPA_W@Z */
3844 /* ?in@?$codecvt@_WDH@std@@QEBAHAEAHPEBD1AEAPEBDPEA_W3AEAPEA_W@Z */
3845 DEFINE_THISCALL_WRAPPER(codecvt_wchar_in, 32)
3846 int __thiscall codecvt_wchar_in(const codecvt_wchar *this, int *state,
3847 const char *from, const char *from_end, const char **from_next,
3848 wchar_t *to, wchar_t *to_end, wchar_t **to_next)
3850 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3851 from_end, from_next, to, to_end, to_next);
3852 return call_codecvt_wchar_do_in(this, state, from,
3853 from_end, from_next, to, to_end, to_next);
3856 /* ?do_out@?$codecvt@GDH@std@@MBEHAAHPBG1AAPBGPAD3AAPAD@Z */
3857 /* ?do_out@?$codecvt@GDH@std@@MEBAHAEAHPEBG1AEAPEBGPEAD3AEAPEAD@Z */
3858 /* ?do_out@?$codecvt@_WDH@std@@MBEHAAHPB_W1AAPB_WPAD3AAPAD@Z */
3859 /* ?do_out@?$codecvt@_WDH@std@@MEBAHAEAHPEB_W1AEAPEB_WPEAD3AEAPEAD@Z */
3860 #if _MSVCP_VER <= 100
3861 #define call_codecvt_wchar_do_out(this, state, from, from_end, from_next, to, to_end, to_next) \
3862 CALL_VTBL_FUNC(this, 20, int, \
3863 (const codecvt_wchar*, int*, const wchar_t*, const wchar_t*, const wchar_t**, char*, char*, char**), \
3864 (this, state, from, from_end, from_next, to, to_end, to_next))
3865 #else
3866 #define call_codecvt_wchar_do_out(this, state, from, from_end, from_next, to, to_end, to_next) \
3867 CALL_VTBL_FUNC(this, 28, int, \
3868 (const codecvt_wchar*, int*, const wchar_t*, const wchar_t*, const wchar_t**, char*, char*, char**), \
3869 (this, state, from, from_end, from_next, to, to_end, to_next))
3870 #endif
3871 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_out, 32)
3872 int __thiscall codecvt_wchar_do_out(const codecvt_wchar *this, int *state,
3873 const wchar_t *from, const wchar_t *from_end, const wchar_t **from_next,
3874 char *to, char *to_end, char **to_next)
3876 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3877 from_end, from_next, to, to_end, to_next);
3879 *from_next = from;
3880 *to_next = to;
3882 while(*from_next!=from_end && *to_next!=to_end) {
3883 int old_state = *state, size;
3884 char buf[MB_LEN_MAX];
3886 switch((size = _Wcrtomb(buf, **from_next, state, &this->cvt))) {
3887 case -1:
3888 return CODECVT_error;
3889 default:
3890 if(size > from_end-*from_next) {
3891 *state = old_state;
3892 return CODECVT_partial;
3895 (*from_next)++;
3896 memcpy_s(*to_next, to_end-*to_next, buf, size);
3897 (*to_next) += size;
3901 return CODECVT_ok;
3904 /* ?out@?$codecvt@GDH@std@@QBEHAAHPBG1AAPBGPAD3AAPAD@Z */
3905 /* ?out@?$codecvt@GDH@std@@QEBAHAEAHPEBG1AEAPEBGPEAD3AEAPEAD@Z */
3906 /* ?out@?$codecvt@_WDH@std@@QBEHAAHPB_W1AAPB_WPAD3AAPAD@Z */
3907 /* ?out@?$codecvt@_WDH@std@@QEBAHAEAHPEB_W1AEAPEB_WPEAD3AEAPEAD@Z */
3908 DEFINE_THISCALL_WRAPPER(codecvt_wchar_out, 32)
3909 int __thiscall codecvt_wchar_out(const codecvt_wchar *this, int *state,
3910 const wchar_t *from, const wchar_t *from_end, const wchar_t **from_next,
3911 char *to, char *to_end, char **to_next)
3913 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3914 from_end, from_next, to, to_end, to_next);
3915 return call_codecvt_wchar_do_out(this, state, from,
3916 from_end, from_next, to, to_end, to_next);
3919 /* ?do_unshift@?$codecvt@GDH@std@@MBEHAAHPAD1AAPAD@Z */
3920 /* ?do_unshift@?$codecvt@GDH@std@@MEBAHAEAHPEAD1AEAPEAD@Z */
3921 /* ?do_unshift@?$codecvt@_WDH@std@@MBEHAAHPAD1AAPAD@Z */
3922 /* ?do_unshift@?$codecvt@_WDH@std@@MEBAHAEAHPEAD1AEAPEAD@Z */
3923 #if _MSVCP_VER <= 100
3924 #define call_codecvt_wchar_do_unshift(this, state, to, to_end, to_next) CALL_VTBL_FUNC(this, 24, \
3925 int, (const codecvt_wchar*, int*, char*, char*, char**), (this, state, to, to_end, to_next))
3926 #else
3927 #define call_codecvt_wchar_do_unshift(this, state, to, to_end, to_next) CALL_VTBL_FUNC(this, 32, \
3928 int, (const codecvt_wchar*, int*, char*, char*, char**), (this, state, to, to_end, to_next))
3929 #endif
3930 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_unshift, 20)
3931 int __thiscall codecvt_wchar_do_unshift(const codecvt_wchar *this,
3932 int *state, char *to, char *to_end, char **to_next)
3934 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
3935 if(*state)
3936 WARN("unexpected state: %x\n", *state);
3938 *to_next = to;
3939 return CODECVT_ok;
3942 /* ?unshift@?$codecvt@GDH@std@@QBEHAAHPAD1AAPAD@Z */
3943 /* ?unshift@?$codecvt@GDH@std@@QEBAHAEAHPEAD1AEAPEAD@Z */
3944 /* ?unshift@?$codecvt@_WDH@std@@QBEHAAHPAD1AAPAD@Z */
3945 /* ?unshift@?$codecvt@_WDH@std@@QEBAHAEAHPEAD1AEAPEAD@Z */
3946 DEFINE_THISCALL_WRAPPER(codecvt_wchar_unshift, 20)
3947 int __thiscall codecvt_wchar_unshift(const codecvt_wchar *this,
3948 int *state, char *to, char *to_end, char **to_next)
3950 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
3951 return call_codecvt_wchar_do_unshift(this, state, to, to_end, to_next);
3954 /* ?do_length@?$codecvt@GDH@std@@MBEHABHPBD1I@Z */
3955 /* ?do_length@?$codecvt@GDH@std@@MEBAHAEBHPEBD1_K@Z */
3956 /* ?do_length@?$codecvt@_WDH@std@@MBEHABHPBD1I@Z */
3957 /* ?do_length@?$codecvt@_WDH@std@@MEBAHAEBHPEBD1_K@Z */
3958 #if _MSVCP_VER <= 100
3959 #define call_codecvt_wchar_do_length(this, state, from, from_end, max) CALL_VTBL_FUNC(this, 28, \
3960 int, (const codecvt_wchar*, const int*, const char*, const char*, MSVCP_size_t), \
3961 (this, state, from, from_end, max))
3962 #else
3963 #define call_codecvt_wchar_do_length(this, state, from, from_end, max) CALL_VTBL_FUNC(this, 36, \
3964 int, (const codecvt_wchar*, const int*, const char*, const char*, MSVCP_size_t), \
3965 (this, state, from, from_end, max))
3966 #endif
3967 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_length, 20)
3968 int __thiscall codecvt_wchar_do_length(const codecvt_wchar *this, const int *state,
3969 const char *from, const char *from_end, MSVCP_size_t max)
3971 int tmp_state = *state, ret=0;
3973 TRACE("(%p %p %p %p %ld)\n", this, state, from, from_end, max);
3975 while(ret<max && from!=from_end) {
3976 switch(_Mbrtowc(NULL, from, from_end-from, &tmp_state, &this->cvt)) {
3977 case -2:
3978 case -1:
3979 return ret;
3980 case 2:
3981 from++;
3982 /* fall through */
3983 case 0:
3984 case 1:
3985 from++;
3986 ret++;
3990 return ret;
3993 /* ?length@?$codecvt@GDH@std@@QBEHABHPBD1I@Z */
3994 /* ?length@?$codecvt@GDH@std@@QEBAHAEBHPEBD1_K@Z */
3995 /* ?length@?$codecvt@_WDH@std@@QBEHABHPBD1I@Z */
3996 /* ?length@?$codecvt@_WDH@std@@QEBAHAEBHPEBD1_K@Z */
3997 DEFINE_THISCALL_WRAPPER(codecvt_wchar_length, 20)
3998 int __thiscall codecvt_wchar_length(const codecvt_wchar *this, const int *state,
3999 const char *from, const char *from_end, MSVCP_size_t max)
4001 TRACE("(%p %p %p %p %ld)\n", this, state, from, from_end, max);
4002 return call_codecvt_wchar_do_length(this, state, from, from_end, max);
4005 /* ?id@?$numpunct@D@std@@2V0locale@2@A */
4006 locale_id numpunct_char_id = {0};
4008 /* ??_7?$numpunct@D@std@@6B@ */
4009 extern const vtable_ptr MSVCP_numpunct_char_vtable;
4011 /* ?_Init@?$numpunct@D@std@@IAEXABV_Locinfo@2@_N@Z */
4012 /* ?_Init@?$numpunct@D@std@@IEAAXAEBV_Locinfo@2@_N@Z */
4013 DEFINE_THISCALL_WRAPPER(numpunct_char__Init, 12)
4014 void __thiscall numpunct_char__Init(numpunct_char *this, const _Locinfo *locinfo, MSVCP_bool isdef)
4016 int len;
4018 TRACE("(%p %p %d)\n", this, locinfo, isdef);
4020 len = strlen(_Locinfo__Getfalse(locinfo))+1;
4021 this->false_name = MSVCRT_operator_new(len);
4022 if(this->false_name)
4023 memcpy((char*)this->false_name, _Locinfo__Getfalse(locinfo), len);
4025 len = strlen(_Locinfo__Gettrue(locinfo))+1;
4026 this->true_name = MSVCRT_operator_new(len);
4027 if(this->true_name)
4028 memcpy((char*)this->true_name, _Locinfo__Gettrue(locinfo), len);
4030 if(isdef) {
4031 this->grouping = MSVCRT_operator_new(1);
4032 if(this->grouping)
4033 *(char*)this->grouping = 0;
4035 this->dp = '.';
4036 this->sep = ',';
4037 } else {
4038 const struct lconv *lc = _Locinfo__Getlconv(locinfo);
4040 len = strlen(lc->grouping)+1;
4041 this->grouping = MSVCRT_operator_new(len);
4042 if(this->grouping)
4043 memcpy((char*)this->grouping, lc->grouping, len);
4045 this->dp = lc->decimal_point[0];
4046 this->sep = lc->thousands_sep[0];
4049 if(!this->false_name || !this->true_name || !this->grouping) {
4050 MSVCRT_operator_delete((char*)this->grouping);
4051 MSVCRT_operator_delete((char*)this->false_name);
4052 MSVCRT_operator_delete((char*)this->true_name);
4054 ERR("Out of memory\n");
4055 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4059 /* ?_Tidy@?$numpunct@D@std@@AAEXXZ */
4060 /* ?_Tidy@?$numpunct@D@std@@AEAAXXZ */
4061 DEFINE_THISCALL_WRAPPER(numpunct_char__Tidy, 4)
4062 void __thiscall numpunct_char__Tidy(numpunct_char *this)
4064 TRACE("(%p)\n", this);
4066 MSVCRT_operator_delete((char*)this->grouping);
4067 MSVCRT_operator_delete((char*)this->false_name);
4068 MSVCRT_operator_delete((char*)this->true_name);
4071 /* ??0?$numpunct@D@std@@QAE@ABV_Locinfo@1@I_N@Z */
4072 /* ??0?$numpunct@D@std@@QEAA@AEBV_Locinfo@1@_K_N@Z */
4073 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor_locinfo, 16)
4074 numpunct_char* __thiscall numpunct_char_ctor_locinfo(numpunct_char *this,
4075 const _Locinfo *locinfo, MSVCP_size_t refs, MSVCP_bool usedef)
4077 TRACE("(%p %p %lu %d)\n", this, locinfo, refs, usedef);
4078 locale_facet_ctor_refs(&this->facet, refs);
4079 this->facet.vtable = &MSVCP_numpunct_char_vtable;
4080 numpunct_char__Init(this, locinfo, usedef);
4081 return this;
4084 /* ??0?$numpunct@D@std@@IAE@PBDI_N@Z */
4085 /* ??0?$numpunct@D@std@@IEAA@PEBD_K_N@Z */
4086 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor_name, 16)
4087 numpunct_char* __thiscall numpunct_char_ctor_name(numpunct_char *this,
4088 const char *name, MSVCP_size_t refs, MSVCP_bool usedef)
4090 _Locinfo locinfo;
4092 TRACE("(%p %s %lu %d)\n", this, debugstr_a(name), refs, usedef);
4093 locale_facet_ctor_refs(&this->facet, refs);
4094 this->facet.vtable = &MSVCP_numpunct_char_vtable;
4096 _Locinfo_ctor_cstr(&locinfo, name);
4097 numpunct_char__Init(this, &locinfo, usedef);
4098 _Locinfo_dtor(&locinfo);
4099 return this;
4102 /* ??0?$numpunct@D@std@@QAE@I@Z */
4103 /* ??0?$numpunct@D@std@@QEAA@_K@Z */
4104 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor_refs, 8)
4105 numpunct_char* __thiscall numpunct_char_ctor_refs(numpunct_char *this, MSVCP_size_t refs)
4107 TRACE("(%p %lu)\n", this, refs);
4108 return numpunct_char_ctor_name(this, "C", refs, FALSE);
4111 /* ??_F?$numpunct@D@std@@QAEXXZ */
4112 /* ??_F?$numpunct@D@std@@QEAAXXZ */
4113 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor, 4)
4114 numpunct_char* __thiscall numpunct_char_ctor(numpunct_char *this)
4116 return numpunct_char_ctor_refs(this, 0);
4119 /* ??1?$numpunct@D@std@@UAE@XZ */
4120 /* ??1?$numpunct@D@std@@UEAA@XZ */
4121 /* ??1?$numpunct@D@std@@MAE@XZ */
4122 /* ??1?$numpunct@D@std@@MEAA@XZ */
4123 DEFINE_THISCALL_WRAPPER(numpunct_char_dtor, 4)
4124 void __thiscall numpunct_char_dtor(numpunct_char *this)
4126 TRACE("(%p)\n", this);
4127 numpunct_char__Tidy(this);
4130 DEFINE_THISCALL_WRAPPER(numpunct_char_vector_dtor, 8)
4131 numpunct_char* __thiscall numpunct_char_vector_dtor(numpunct_char *this, unsigned int flags)
4133 TRACE("(%p %x)\n", this, flags);
4134 if(flags & 2) {
4135 /* we have an array, with the number of elements stored before the first object */
4136 INT_PTR i, *ptr = (INT_PTR *)this-1;
4138 for(i=*ptr-1; i>=0; i--)
4139 numpunct_char_dtor(this+i);
4140 MSVCRT_operator_delete(ptr);
4141 } else {
4142 numpunct_char_dtor(this);
4143 if(flags & 1)
4144 MSVCRT_operator_delete(this);
4147 return this;
4150 /* ?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
4151 /* ?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
4152 MSVCP_size_t __cdecl numpunct_char__Getcat(const locale_facet **facet, const locale *loc)
4154 TRACE("(%p %p)\n", facet, loc);
4156 if(facet && !*facet) {
4157 *facet = MSVCRT_operator_new(sizeof(numpunct_char));
4158 if(!*facet) {
4159 ERR("Out of memory\n");
4160 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4161 return 0;
4163 numpunct_char_ctor_name((numpunct_char*)*facet,
4164 locale_string_char_c_str(&loc->ptr->name), 0, TRUE);
4167 return LC_NUMERIC;
4170 /* ?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@@Z */
4171 /* ?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@@Z */
4172 MSVCP_size_t __cdecl numpunct_char__Getcat_old(const locale_facet **facet)
4174 return numpunct_char__Getcat(facet, locale_classic());
4177 static numpunct_char* numpunct_char_use_facet(const locale *loc)
4179 static numpunct_char *obj = NULL;
4181 _Lockit lock;
4182 const locale_facet *fac;
4184 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
4185 fac = locale__Getfacet(loc, locale_id_operator_size_t(&numpunct_char_id));
4186 if(fac) {
4187 _Lockit_dtor(&lock);
4188 return (numpunct_char*)fac;
4191 if(obj) {
4192 _Lockit_dtor(&lock);
4193 return obj;
4196 numpunct_char__Getcat(&fac, loc);
4197 obj = (numpunct_char*)fac;
4198 call_locale_facet__Incref(&obj->facet);
4199 locale_facet_register(&obj->facet);
4200 _Lockit_dtor(&lock);
4202 return obj;
4205 /* ?do_decimal_point@?$numpunct@D@std@@MBEDXZ */
4206 /* ?do_decimal_point@?$numpunct@D@std@@MEBADXZ */
4207 DEFINE_THISCALL_WRAPPER(numpunct_char_do_decimal_point, 4)
4208 #if _MSVCP_VER <= 100
4209 #define call_numpunct_char_do_decimal_point(this) CALL_VTBL_FUNC(this, 4, \
4210 char, (const numpunct_char *this), (this))
4211 #else
4212 #define call_numpunct_char_do_decimal_point(this) CALL_VTBL_FUNC(this, 12, \
4213 char, (const numpunct_char *this), (this))
4214 #endif
4215 char __thiscall numpunct_char_do_decimal_point(const numpunct_char *this)
4217 TRACE("(%p)\n", this);
4218 return this->dp;
4221 /* ?decimal_point@?$numpunct@D@std@@QBEDXZ */
4222 /* ?decimal_point@?$numpunct@D@std@@QEBADXZ */
4223 DEFINE_THISCALL_WRAPPER(numpunct_char_decimal_point, 4)
4224 char __thiscall numpunct_char_decimal_point(const numpunct_char *this)
4226 TRACE("(%p)\n", this);
4227 return call_numpunct_char_do_decimal_point(this);
4230 /* ?do_thousands_sep@?$numpunct@D@std@@MBEDXZ */
4231 /* ?do_thousands_sep@?$numpunct@D@std@@MEBADXZ */
4232 DEFINE_THISCALL_WRAPPER(numpunct_char_do_thousands_sep, 4)
4233 #if _MSVCP_VER <= 100
4234 #define call_numpunct_char_do_thousands_sep(this) CALL_VTBL_FUNC(this, 8, \
4235 char, (const numpunct_char*), (this))
4236 #else
4237 #define call_numpunct_char_do_thousands_sep(this) CALL_VTBL_FUNC(this, 16, \
4238 char, (const numpunct_char*), (this))
4239 #endif
4240 char __thiscall numpunct_char_do_thousands_sep(const numpunct_char *this)
4242 TRACE("(%p)\n", this);
4243 return this->sep;
4246 /* ?thousands_sep@?$numpunct@D@std@@QBEDXZ */
4247 /* ?thousands_sep@?$numpunct@D@std@@QEBADXZ */
4248 DEFINE_THISCALL_WRAPPER(numpunct_char_thousands_sep, 4)
4249 char __thiscall numpunct_char_thousands_sep(const numpunct_char *this)
4251 TRACE("(%p)\n", this);
4252 return call_numpunct_char_do_thousands_sep(this);
4255 /* ?do_grouping@?$numpunct@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4256 /* ?do_grouping@?$numpunct@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4257 DEFINE_THISCALL_WRAPPER(numpunct_char_do_grouping, 8)
4258 #if _MSVCP_VER <= 100
4259 #define call_numpunct_char_do_grouping(this, ret) CALL_VTBL_FUNC(this, 12, \
4260 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
4261 #else
4262 #define call_numpunct_char_do_grouping(this, ret) CALL_VTBL_FUNC(this, 20, \
4263 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
4264 #endif
4265 basic_string_char* __thiscall numpunct_char_do_grouping(
4266 const numpunct_char *this, basic_string_char *ret)
4268 TRACE("(%p)\n", this);
4269 return MSVCP_basic_string_char_ctor_cstr(ret, this->grouping);
4272 /* ?grouping@?$numpunct@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4273 /* ?grouping@?$numpunct@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4274 DEFINE_THISCALL_WRAPPER(numpunct_char_grouping, 8)
4275 basic_string_char* __thiscall numpunct_char_grouping(const numpunct_char *this, basic_string_char *ret)
4277 TRACE("(%p)\n", this);
4278 return call_numpunct_char_do_grouping(this, ret);
4281 /* ?do_falsename@?$numpunct@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4282 /* ?do_falsename@?$numpunct@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4283 DEFINE_THISCALL_WRAPPER(numpunct_char_do_falsename, 8)
4284 #if _MSVCP_VER <= 100
4285 #define call_numpunct_char_do_falsename(this, ret) CALL_VTBL_FUNC(this, 16, \
4286 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
4287 #else
4288 #define call_numpunct_char_do_falsename(this, ret) CALL_VTBL_FUNC(this, 24, \
4289 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
4290 #endif
4291 basic_string_char* __thiscall numpunct_char_do_falsename(
4292 const numpunct_char *this, basic_string_char *ret)
4294 TRACE("(%p)\n", this);
4295 return MSVCP_basic_string_char_ctor_cstr(ret, this->false_name);
4298 /* ?falsename@?$numpunct@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4299 /* ?falsename@?$numpunct@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4300 DEFINE_THISCALL_WRAPPER(numpunct_char_falsename, 8)
4301 basic_string_char* __thiscall numpunct_char_falsename(const numpunct_char *this, basic_string_char *ret)
4303 TRACE("(%p)\n", this);
4304 return call_numpunct_char_do_falsename(this, ret);
4307 /* ?do_truename@?$numpunct@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4308 /* ?do_truename@?$numpunct@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4309 DEFINE_THISCALL_WRAPPER(numpunct_char_do_truename, 8)
4310 #if _MSVCP_VER <= 100
4311 #define call_numpunct_char_do_truename(this, ret) CALL_VTBL_FUNC(this, 20, \
4312 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
4313 #else
4314 #define call_numpunct_char_do_truename(this, ret) CALL_VTBL_FUNC(this, 28, \
4315 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
4316 #endif
4317 basic_string_char* __thiscall numpunct_char_do_truename(
4318 const numpunct_char *this, basic_string_char *ret)
4320 TRACE("(%p)\n", this);
4321 return MSVCP_basic_string_char_ctor_cstr(ret, this->true_name);
4324 /* ?truename@?$numpunct@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4325 /* ?truename@?$numpunct@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4326 DEFINE_THISCALL_WRAPPER(numpunct_char_truename, 8)
4327 basic_string_char* __thiscall numpunct_char_truename(const numpunct_char *this, basic_string_char *ret)
4329 TRACE("(%p)\n", this);
4330 return call_numpunct_char_do_truename(this, ret);
4333 /* ?id@?$numpunct@_W@std@@2V0locale@2@A */
4334 locale_id numpunct_wchar_id = {0};
4335 /* ?id@?$numpunct@G@std@@2V0locale@2@A */
4336 locale_id numpunct_short_id = {0};
4338 /* ??_7?$numpunct@_W@std@@6B@ */
4339 extern const vtable_ptr MSVCP_numpunct_wchar_vtable;
4340 /* ??_7?$numpunct@G@std@@6B@ */
4341 extern const vtable_ptr MSVCP_numpunct_short_vtable;
4343 /* ?_Init@?$numpunct@_W@std@@IAEXABV_Locinfo@2@_N@Z */
4344 /* ?_Init@?$numpunct@_W@std@@IEAAXAEBV_Locinfo@2@_N@Z */
4345 /* ?_Init@?$numpunct@G@std@@IAEXABV_Locinfo@2@_N@Z */
4346 /* ?_Init@?$numpunct@G@std@@IEAAXAEBV_Locinfo@2@_N@Z */
4347 DEFINE_THISCALL_WRAPPER(numpunct_wchar__Init, 12)
4348 void __thiscall numpunct_wchar__Init(numpunct_wchar *this,
4349 const _Locinfo *locinfo, MSVCP_bool isdef)
4351 const char *to_convert;
4352 _Cvtvec cvt;
4353 int len;
4355 TRACE("(%p %p %d)\n", this, locinfo, isdef);
4357 _Locinfo__Getcvt(locinfo, &cvt);
4359 to_convert = _Locinfo__Getfalse(locinfo);
4360 len = MultiByteToWideChar(cvt.page, 0, to_convert, -1, NULL, 0);
4361 this->false_name = MSVCRT_operator_new(len*sizeof(WCHAR));
4362 if(this->false_name)
4363 MultiByteToWideChar(cvt.page, 0, to_convert, -1,
4364 (wchar_t*)this->false_name, len);
4366 to_convert = _Locinfo__Gettrue(locinfo);
4367 len = MultiByteToWideChar(cvt.page, 0, to_convert, -1, NULL, 0);
4368 this->true_name = MSVCRT_operator_new(len*sizeof(WCHAR));
4369 if(this->true_name)
4370 MultiByteToWideChar(cvt.page, 0, to_convert, -1,
4371 (wchar_t*)this->true_name, len);
4373 if(isdef) {
4374 this->grouping = MSVCRT_operator_new(1);
4375 if(this->grouping)
4376 *(char*)this->grouping = 0;
4378 this->dp = '.';
4379 this->sep = ',';
4380 } else {
4381 const struct lconv *lc = _Locinfo__Getlconv(locinfo);
4383 len = strlen(lc->grouping)+1;
4384 this->grouping = MSVCRT_operator_new(len);
4385 if(this->grouping)
4386 memcpy((char*)this->grouping, lc->grouping, len);
4388 this->dp = mb_to_wc(lc->decimal_point[0], &cvt);
4389 this->sep = mb_to_wc(lc->thousands_sep[0], &cvt);
4392 if(!this->false_name || !this->true_name || !this->grouping) {
4393 MSVCRT_operator_delete((char*)this->grouping);
4394 MSVCRT_operator_delete((wchar_t*)this->false_name);
4395 MSVCRT_operator_delete((wchar_t*)this->true_name);
4397 ERR("Out of memory\n");
4398 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4402 /* ?_Tidy@?$numpunct@_W@std@@AAEXXZ */
4403 /* ?_Tidy@?$numpunct@_W@std@@AEAAXXZ */
4404 /* ?_Tidy@?$numpunct@G@std@@AAEXXZ */
4405 /* ?_Tidy@?$numpunct@G@std@@AEAAXXZ */
4406 DEFINE_THISCALL_WRAPPER(numpunct_wchar__Tidy, 4)
4407 void __thiscall numpunct_wchar__Tidy(numpunct_wchar *this)
4409 TRACE("(%p)\n", this);
4411 MSVCRT_operator_delete((char*)this->grouping);
4412 MSVCRT_operator_delete((wchar_t*)this->false_name);
4413 MSVCRT_operator_delete((wchar_t*)this->true_name);
4416 /* ??0?$numpunct@_W@std@@QAE@ABV_Locinfo@1@I_N@Z */
4417 /* ??0?$numpunct@_W@std@@QEAA@AEBV_Locinfo@1@_K_N@Z */
4418 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor_locinfo, 16)
4419 numpunct_wchar* __thiscall numpunct_wchar_ctor_locinfo(numpunct_wchar *this,
4420 const _Locinfo *locinfo, MSVCP_size_t refs, MSVCP_bool usedef)
4422 TRACE("(%p %p %lu %d)\n", this, locinfo, refs, usedef);
4423 locale_facet_ctor_refs(&this->facet, refs);
4424 this->facet.vtable = &MSVCP_numpunct_wchar_vtable;
4425 numpunct_wchar__Init(this, locinfo, usedef);
4426 return this;
4429 /* ??0?$numpunct@G@std@@QAE@ABV_Locinfo@1@I_N@Z */
4430 /* ??0?$numpunct@G@std@@QEAA@AEBV_Locinfo@1@_K_N@Z */
4431 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor_locinfo, 16)
4432 numpunct_wchar* __thiscall numpunct_short_ctor_locinfo(numpunct_wchar *this,
4433 const _Locinfo *locinfo, MSVCP_size_t refs, MSVCP_bool usedef)
4435 numpunct_wchar_ctor_locinfo(this, locinfo, refs, usedef);
4436 this->facet.vtable = &MSVCP_numpunct_short_vtable;
4437 return this;
4440 /* ??0?$numpunct@_W@std@@IAE@PBDI_N@Z */
4441 /* ??0?$numpunct@_W@std@@IEAA@PEBD_K_N@Z */
4442 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor_name, 16)
4443 numpunct_wchar* __thiscall numpunct_wchar_ctor_name(numpunct_wchar *this,
4444 const char *name, MSVCP_size_t refs, MSVCP_bool usedef)
4446 _Locinfo locinfo;
4448 TRACE("(%p %s %lu %d)\n", this, debugstr_a(name), refs, usedef);
4449 locale_facet_ctor_refs(&this->facet, refs);
4450 this->facet.vtable = &MSVCP_numpunct_wchar_vtable;
4452 _Locinfo_ctor_cstr(&locinfo, name);
4453 numpunct_wchar__Init(this, &locinfo, usedef);
4454 _Locinfo_dtor(&locinfo);
4455 return this;
4458 /* ??0?$numpunct@G@std@@IAE@PBDI_N@Z */
4459 /* ??0?$numpunct@G@std@@IEAA@PEBD_K_N@Z */
4460 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor_name, 16)
4461 numpunct_wchar* __thiscall numpunct_short_ctor_name(numpunct_wchar *this,
4462 const char *name, MSVCP_size_t refs, MSVCP_bool usedef)
4464 numpunct_wchar_ctor_name(this, name, refs, usedef);
4465 this->facet.vtable = &MSVCP_numpunct_short_vtable;
4466 return this;
4469 /* ??0?$numpunct@_W@std@@QAE@I@Z */
4470 /* ??0?$numpunct@_W@std@@QEAA@_K@Z */
4471 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor_refs, 8)
4472 numpunct_wchar* __thiscall numpunct_wchar_ctor_refs(numpunct_wchar *this, MSVCP_size_t refs)
4474 TRACE("(%p %lu)\n", this, refs);
4475 return numpunct_wchar_ctor_name(this, "C", refs, FALSE);
4478 /* ??0?$numpunct@G@std@@QAE@I@Z */
4479 /* ??0?$numpunct@G@std@@QEAA@_K@Z */
4480 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor_refs, 8)
4481 numpunct_wchar* __thiscall numpunct_short_ctor_refs(numpunct_wchar *this, MSVCP_size_t refs)
4483 numpunct_wchar_ctor_refs(this, refs);
4484 this->facet.vtable = &MSVCP_numpunct_short_vtable;
4485 return this;
4488 /* ??_F?$numpunct@_W@std@@QAEXXZ */
4489 /* ??_F?$numpunct@_W@std@@QEAAXXZ */
4490 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor, 4)
4491 numpunct_wchar* __thiscall numpunct_wchar_ctor(numpunct_wchar *this)
4493 return numpunct_wchar_ctor_refs(this, 0);
4496 /* ??_F?$numpunct@G@std@@QAEXXZ */
4497 /* ??_F?$numpunct@G@std@@QEAAXXZ */
4498 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor, 4)
4499 numpunct_wchar* __thiscall numpunct_short_ctor(numpunct_wchar *this)
4501 return numpunct_short_ctor_refs(this, 0);
4504 /* ??1?$numpunct@G@std@@UAE@XZ */
4505 /* ??1?$numpunct@G@std@@UEAA@XZ */
4506 /* ??1?$numpunct@_W@std@@MAE@XZ */
4507 /* ??1?$numpunct@_W@std@@MEAA@XZ */
4508 /* ??1?$numpunct@G@std@@MAE@XZ */
4509 /* ??1?$numpunct@G@std@@MEAA@XZ */
4510 DEFINE_THISCALL_WRAPPER(numpunct_wchar_dtor, 4)
4511 void __thiscall numpunct_wchar_dtor(numpunct_wchar *this)
4513 TRACE("(%p)\n", this);
4514 numpunct_wchar__Tidy(this);
4517 DEFINE_THISCALL_WRAPPER(numpunct_wchar_vector_dtor, 8)
4518 numpunct_wchar* __thiscall numpunct_wchar_vector_dtor(numpunct_wchar *this, unsigned int flags)
4520 TRACE("(%p %x)\n", this, flags);
4521 if(flags & 2) {
4522 /* we have an array, with the number of elements stored before the first object */
4523 INT_PTR i, *ptr = (INT_PTR *)this-1;
4525 for(i=*ptr-1; i>=0; i--)
4526 numpunct_wchar_dtor(this+i);
4527 MSVCRT_operator_delete(ptr);
4528 } else {
4529 numpunct_wchar_dtor(this);
4530 if(flags & 1)
4531 MSVCRT_operator_delete(this);
4534 return this;
4537 /* ?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
4538 /* ?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
4539 MSVCP_size_t __cdecl numpunct_wchar__Getcat(const locale_facet **facet, const locale *loc)
4541 TRACE("(%p %p)\n", facet, loc);
4543 if(facet && !*facet) {
4544 *facet = MSVCRT_operator_new(sizeof(numpunct_wchar));
4545 if(!*facet) {
4546 ERR("Out of memory\n");
4547 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4548 return 0;
4550 numpunct_wchar_ctor_name((numpunct_wchar*)*facet,
4551 locale_string_char_c_str(&loc->ptr->name), 0, TRUE);
4554 return LC_NUMERIC;
4557 /* ?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@@Z */
4558 /* ?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@@Z */
4559 MSVCP_size_t __cdecl numpunct_wchar__Getcat_old(const locale_facet **facet)
4561 return numpunct_wchar__Getcat(facet, locale_classic());
4564 static numpunct_wchar* numpunct_wchar_use_facet(const locale *loc)
4566 static numpunct_wchar *obj = NULL;
4568 _Lockit lock;
4569 const locale_facet *fac;
4571 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
4572 fac = locale__Getfacet(loc, locale_id_operator_size_t(&numpunct_wchar_id));
4573 if(fac) {
4574 _Lockit_dtor(&lock);
4575 return (numpunct_wchar*)fac;
4578 if(obj) {
4579 _Lockit_dtor(&lock);
4580 return obj;
4583 numpunct_wchar__Getcat(&fac, loc);
4584 obj = (numpunct_wchar*)fac;
4585 call_locale_facet__Incref(&obj->facet);
4586 locale_facet_register(&obj->facet);
4587 _Lockit_dtor(&lock);
4589 return obj;
4592 /* ?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
4593 /* ?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
4594 MSVCP_size_t __cdecl numpunct_short__Getcat(const locale_facet **facet, const locale *loc)
4596 TRACE("(%p %p)\n", facet, loc);
4598 if(facet && !*facet) {
4599 *facet = MSVCRT_operator_new(sizeof(numpunct_wchar));
4600 if(!*facet) {
4601 ERR("Out of memory\n");
4602 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4603 return 0;
4605 numpunct_short_ctor_name((numpunct_wchar*)*facet,
4606 locale_string_char_c_str(&loc->ptr->name), 0, TRUE);
4609 return LC_NUMERIC;
4612 /* ?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@@Z */
4613 /* ?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@@Z */
4614 MSVCP_size_t __cdecl numpunct_short__Getcat_old(const locale_facet **facet)
4616 return numpunct_short__Getcat(facet, locale_classic());
4619 static numpunct_wchar* numpunct_short_use_facet(const locale *loc)
4621 static numpunct_wchar *obj = NULL;
4623 _Lockit lock;
4624 const locale_facet *fac;
4626 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
4627 fac = locale__Getfacet(loc, locale_id_operator_size_t(&numpunct_short_id));
4628 if(fac) {
4629 _Lockit_dtor(&lock);
4630 return (numpunct_wchar*)fac;
4633 if(obj) {
4634 _Lockit_dtor(&lock);
4635 return obj;
4638 numpunct_short__Getcat(&fac, loc);
4639 obj = (numpunct_wchar*)fac;
4640 call_locale_facet__Incref(&obj->facet);
4641 locale_facet_register(&obj->facet);
4642 _Lockit_dtor(&lock);
4644 return obj;
4647 /* ?do_decimal_point@?$numpunct@_W@std@@MBE_WXZ */
4648 /* ?do_decimal_point@?$numpunct@_W@std@@MEBA_WXZ */
4649 /* ?do_decimal_point@?$numpunct@G@std@@MBEGXZ */
4650 /* ?do_decimal_point@?$numpunct@G@std@@MEBAGXZ */
4651 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_decimal_point, 4)
4652 #if _MSVCP_VER <= 100
4653 #define call_numpunct_wchar_do_decimal_point(this) CALL_VTBL_FUNC(this, 4, \
4654 wchar_t, (const numpunct_wchar *this), (this))
4655 #else
4656 #define call_numpunct_wchar_do_decimal_point(this) CALL_VTBL_FUNC(this, 12, \
4657 wchar_t, (const numpunct_wchar *this), (this))
4658 #endif
4659 wchar_t __thiscall numpunct_wchar_do_decimal_point(const numpunct_wchar *this)
4661 TRACE("(%p)\n", this);
4662 return this->dp;
4665 /* ?decimal_point@?$numpunct@_W@std@@QBE_WXZ */
4666 /* ?decimal_point@?$numpunct@_W@std@@QEBA_WXZ */
4667 /* ?decimal_point@?$numpunct@G@std@@QBEGXZ */
4668 /* ?decimal_point@?$numpunct@G@std@@QEBAGXZ */
4669 DEFINE_THISCALL_WRAPPER(numpunct_wchar_decimal_point, 4)
4670 wchar_t __thiscall numpunct_wchar_decimal_point(const numpunct_wchar *this)
4672 TRACE("(%p)\n", this);
4673 return call_numpunct_wchar_do_decimal_point(this);
4676 /* ?do_thousands_sep@?$numpunct@_W@std@@MBE_WXZ */
4677 /* ?do_thousands_sep@?$numpunct@_W@std@@MEBA_WXZ */
4678 /* ?do_thousands_sep@?$numpunct@G@std@@MBEGXZ */
4679 /* ?do_thousands_sep@?$numpunct@G@std@@MEBAGXZ */
4680 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_thousands_sep, 4)
4681 #if _MSVCP_VER <= 100
4682 #define call_numpunct_wchar_do_thousands_sep(this) CALL_VTBL_FUNC(this, 8, \
4683 wchar_t, (const numpunct_wchar *this), (this))
4684 #else
4685 #define call_numpunct_wchar_do_thousands_sep(this) CALL_VTBL_FUNC(this, 16, \
4686 wchar_t, (const numpunct_wchar *this), (this))
4687 #endif
4688 wchar_t __thiscall numpunct_wchar_do_thousands_sep(const numpunct_wchar *this)
4690 TRACE("(%p)\n", this);
4691 return this->sep;
4694 /* ?thousands_sep@?$numpunct@_W@std@@QBE_WXZ */
4695 /* ?thousands_sep@?$numpunct@_W@std@@QEBA_WXZ */
4696 /* ?thousands_sep@?$numpunct@G@std@@QBEGXZ */
4697 /* ?thousands_sep@?$numpunct@G@std@@QEBAGXZ */
4698 DEFINE_THISCALL_WRAPPER(numpunct_wchar_thousands_sep, 4)
4699 wchar_t __thiscall numpunct_wchar_thousands_sep(const numpunct_wchar *this)
4701 TRACE("(%p)\n", this);
4702 return call_numpunct_wchar_do_thousands_sep(this);
4705 /* ?do_grouping@?$numpunct@_W@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4706 /* ?do_grouping@?$numpunct@_W@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4707 /* ?do_grouping@?$numpunct@G@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4708 /* ?do_grouping@?$numpunct@G@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4709 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_grouping, 8)
4710 #if _MSVCP_VER <= 100
4711 #define call_numpunct_wchar_do_grouping(this, ret) CALL_VTBL_FUNC(this, 12, \
4712 basic_string_char*, (const numpunct_wchar*, basic_string_char*), (this, ret))
4713 #else
4714 #define call_numpunct_wchar_do_grouping(this, ret) CALL_VTBL_FUNC(this, 20, \
4715 basic_string_char*, (const numpunct_wchar*, basic_string_char*), (this, ret))
4716 #endif
4717 basic_string_char* __thiscall numpunct_wchar_do_grouping(const numpunct_wchar *this, basic_string_char *ret)
4719 TRACE("(%p)\n", this);
4720 return MSVCP_basic_string_char_ctor_cstr(ret, this->grouping);
4723 /* ?grouping@?$numpunct@_W@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4724 /* ?grouping@?$numpunct@_W@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4725 /* ?grouping@?$numpunct@G@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4726 /* ?grouping@?$numpunct@G@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4727 DEFINE_THISCALL_WRAPPER(numpunct_wchar_grouping, 8)
4728 basic_string_char* __thiscall numpunct_wchar_grouping(const numpunct_wchar *this, basic_string_char *ret)
4730 TRACE("(%p)\n", this);
4731 return call_numpunct_wchar_do_grouping(this, ret);
4734 /* ?do_falsename@?$numpunct@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4735 /* ?do_falsename@?$numpunct@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4736 /* ?do_falsename@?$numpunct@G@std@@MBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4737 /* ?do_falsename@?$numpunct@G@std@@MEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4738 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_falsename, 8)
4739 #if _MSVCP_VER <= 100
4740 #define call_numpunct_wchar_do_falsename(this, ret) CALL_VTBL_FUNC(this, 16, \
4741 basic_string_wchar*, (const numpunct_wchar*, basic_string_wchar*), (this, ret))
4742 #else
4743 #define call_numpunct_wchar_do_falsename(this, ret) CALL_VTBL_FUNC(this, 24, \
4744 basic_string_wchar*, (const numpunct_wchar*, basic_string_wchar*), (this, ret))
4745 #endif
4746 basic_string_wchar* __thiscall numpunct_wchar_do_falsename(const numpunct_wchar *this, basic_string_wchar *ret)
4748 TRACE("(%p)\n", this);
4749 return MSVCP_basic_string_wchar_ctor_cstr(ret, this->false_name);
4752 /* ?falsename@?$numpunct@_W@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4753 /* ?falsename@?$numpunct@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4754 /* ?falsename@?$numpunct@G@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4755 /* ?falsename@?$numpunct@G@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4756 DEFINE_THISCALL_WRAPPER(numpunct_wchar_falsename, 8)
4757 basic_string_wchar* __thiscall numpunct_wchar_falsename(const numpunct_wchar *this, basic_string_wchar *ret)
4759 TRACE("(%p)\n", this);
4760 return call_numpunct_wchar_do_falsename(this, ret);
4763 /* ?do_truename@?$numpunct@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4764 /* ?do_truename@?$numpunct@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4765 /* ?do_truename@?$numpunct@G@std@@MBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4766 /* ?do_truename@?$numpunct@G@std@@MEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4767 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_truename, 8)
4768 #if _MSVCP_VER <= 100
4769 #define call_numpunct_wchar_do_truename(this, ret) CALL_VTBL_FUNC(this, 20, \
4770 basic_string_wchar*, (const numpunct_wchar*, basic_string_wchar*), (this, ret))
4771 #else
4772 #define call_numpunct_wchar_do_truename(this, ret) CALL_VTBL_FUNC(this, 28, \
4773 basic_string_wchar*, (const numpunct_wchar*, basic_string_wchar*), (this, ret))
4774 #endif
4775 basic_string_wchar* __thiscall numpunct_wchar_do_truename(const numpunct_wchar *this, basic_string_wchar *ret)
4777 TRACE("(%p)\n", this);
4778 return MSVCP_basic_string_wchar_ctor_cstr(ret, this->true_name);
4781 /* ?truename@?$numpunct@_W@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4782 /* ?truename@?$numpunct@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4783 /* ?truename@?$numpunct@G@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4784 /* ?truename@?$numpunct@G@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4785 DEFINE_THISCALL_WRAPPER(numpunct_wchar_truename, 8)
4786 basic_string_wchar* __thiscall numpunct_wchar_truename(const numpunct_wchar *this, basic_string_wchar *ret)
4788 TRACE("(%p)\n", this);
4789 return call_numpunct_wchar_do_truename(this, ret);
4792 double __cdecl _Stod(const char *buf, char **buf_end, LONG exp)
4794 double ret = strtod(buf, buf_end);
4796 if(exp)
4797 ret *= pow(10, exp);
4798 return ret;
4801 double __cdecl _Stodx(const char *buf, char **buf_end, LONG exp, int *err)
4803 double ret;
4805 *err = *_errno();
4806 *_errno() = 0;
4807 ret = _Stod(buf, buf_end, exp);
4808 if(*_errno()) {
4809 *err = *_errno();
4810 }else {
4811 *_errno() = *err;
4812 *err = 0;
4814 return ret;
4817 float __cdecl _Stof(const char *buf, char **buf_end, LONG exp)
4819 return _Stod(buf, buf_end, exp);
4822 float __cdecl _Stofx(const char *buf, char **buf_end, LONG exp, int *err)
4824 return _Stodx(buf, buf_end, exp, err);
4827 __int64 __cdecl _Stoll(const char *buf, char **buf_end, int base)
4829 return _strtoi64(buf, buf_end, base);
4832 __int64 __cdecl _Stollx(const char *buf, char **buf_end, int base, int *err)
4834 __int64 ret;
4836 *err = *_errno();
4837 *_errno() = 0;
4838 ret = _strtoi64(buf, buf_end, base);
4839 if(*_errno()) {
4840 *err = *_errno();
4841 }else {
4842 *_errno() = *err;
4843 *err = 0;
4845 return ret;
4848 LONG __cdecl _Stolx(const char *buf, char **buf_end, int base, int *err)
4850 __int64 i = _Stollx(buf, buf_end, base, err);
4851 if(!*err && i!=(__int64)((LONG)i))
4852 *err = ERANGE;
4853 return i;
4856 unsigned __int64 __cdecl _Stoull(const char *buf, char **buf_end, int base)
4858 return _strtoui64(buf, buf_end, base);
4861 unsigned __int64 __cdecl _Stoullx(const char *buf, char **buf_end, int base, int *err)
4863 unsigned __int64 ret;
4865 *err = *_errno();
4866 *_errno() = 0;
4867 ret = _strtoui64(buf, buf_end, base);
4868 if(*_errno()) {
4869 *err = *_errno();
4870 }else {
4871 *_errno() = *err;
4872 *err = 0;
4874 return ret;
4877 ULONG __cdecl _Stoul(const char *buf, char **buf_end, int base)
4879 int err;
4880 unsigned __int64 i = _Stoullx(buf[0]=='-' ? buf+1 : buf, buf_end, base, &err);
4881 if(!err && i!=(unsigned __int64)((ULONG)i))
4882 *_errno() = ERANGE;
4883 return buf[0]=='-' ? -i : i;
4886 ULONG __cdecl _Stoulx(const char *buf, char **buf_end, int base, int *err)
4888 unsigned __int64 i = _Stoullx(buf[0]=='-' ? buf+1 : buf, buf_end, base, err);
4889 if(!*err && i!=(unsigned __int64)((ULONG)i))
4890 *err = ERANGE;
4891 return buf[0]=='-' ? -i : i;
4894 /* ?id@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@2V0locale@2@A */
4895 locale_id num_get_wchar_id = {0};
4896 /* ?id@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@2V0locale@2@A */
4897 locale_id num_get_short_id = {0};
4899 /* ??_7?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@6B@ */
4900 extern const vtable_ptr MSVCP_num_get_wchar_vtable;
4901 /* ??_7?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@6B@ */
4902 extern const vtable_ptr MSVCP_num_get_short_vtable;
4904 /* ?_Init@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
4905 /* ?_Init@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
4906 /* ?_Init@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
4907 /* ?_Init@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
4908 DEFINE_THISCALL_WRAPPER(num_get_wchar__Init, 8)
4909 void __thiscall num_get_wchar__Init(num_get *this, const _Locinfo *locinfo)
4911 TRACE("(%p %p)\n", this, locinfo);
4912 _Locinfo__Getcvt(locinfo, &this->cvt);
4915 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
4916 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
4917 DEFINE_THISCALL_WRAPPER(num_get_wchar_ctor_locinfo, 12)
4918 num_get* __thiscall num_get_wchar_ctor_locinfo(num_get *this,
4919 const _Locinfo *locinfo, MSVCP_size_t refs)
4921 TRACE("(%p %p %lu)\n", this, locinfo, refs);
4923 locale_facet_ctor_refs(&this->facet, refs);
4924 this->facet.vtable = &MSVCP_num_get_wchar_vtable;
4926 num_get_wchar__Init(this, locinfo);
4927 return this;
4930 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
4931 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
4932 DEFINE_THISCALL_WRAPPER(num_get_short_ctor_locinfo, 12)
4933 num_get* __thiscall num_get_short_ctor_locinfo(num_get *this,
4934 const _Locinfo *locinfo, MSVCP_size_t refs)
4936 num_get_wchar_ctor_locinfo(this, locinfo, refs);
4937 this->facet.vtable = &MSVCP_num_get_short_vtable;
4938 return this;
4941 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@I@Z */
4942 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@_K@Z */
4943 DEFINE_THISCALL_WRAPPER(num_get_wchar_ctor_refs, 8)
4944 num_get* __thiscall num_get_wchar_ctor_refs(num_get *this, MSVCP_size_t refs)
4946 _Locinfo locinfo;
4948 TRACE("(%p %lu)\n", this, refs);
4950 _Locinfo_ctor(&locinfo);
4951 num_get_wchar_ctor_locinfo(this, &locinfo, refs);
4952 _Locinfo_dtor(&locinfo);
4953 return this;
4956 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@I@Z */
4957 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@_K@Z */
4958 DEFINE_THISCALL_WRAPPER(num_get_short_ctor_refs, 8)
4959 num_get* __thiscall num_get_short_ctor_refs(num_get *this, MSVCP_size_t refs)
4961 num_get_wchar_ctor_refs(this, refs);
4962 this->facet.vtable = &MSVCP_num_get_short_vtable;
4963 return this;
4966 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
4967 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
4968 DEFINE_THISCALL_WRAPPER(num_get_wchar_ctor, 4)
4969 num_get* __thiscall num_get_wchar_ctor(num_get *this)
4971 return num_get_wchar_ctor_refs(this, 0);
4974 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
4975 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
4976 DEFINE_THISCALL_WRAPPER(num_get_short_ctor, 4)
4977 num_get* __thiscall num_get_short_ctor(num_get *this)
4979 return num_get_short_ctor_refs(this, 0);
4982 /* ??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@UAE@XZ */
4983 /* ??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@UEAA@XZ */
4984 /* ??1?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MAE@XZ */
4985 /* ??1?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEAA@XZ */
4986 /* ??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MAE@XZ */
4987 /* ??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEAA@XZ */
4988 DEFINE_THISCALL_WRAPPER(num_get_wchar_dtor, 4)
4989 void __thiscall num_get_wchar_dtor(num_get *this)
4991 TRACE("(%p)\n", this);
4992 locale_facet_dtor(&this->facet);
4995 DEFINE_THISCALL_WRAPPER(num_get_wchar_vector_dtor, 8)
4996 num_get* __thiscall num_get_wchar_vector_dtor(num_get *this, unsigned int flags)
4998 TRACE("(%p %x)\n", this, flags);
4999 if(flags & 2) {
5000 /* we have an array, with the number of elements stored before the first object */
5001 INT_PTR i, *ptr = (INT_PTR *)this-1;
5003 for(i=*ptr-1; i>=0; i--)
5004 num_get_wchar_dtor(this+i);
5005 MSVCRT_operator_delete(ptr);
5006 } else {
5007 num_get_wchar_dtor(this);
5008 if(flags & 1)
5009 MSVCRT_operator_delete(this);
5012 return this;
5015 /* ?_Getcat@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
5016 /* ?_Getcat@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
5017 MSVCP_size_t __cdecl num_get_wchar__Getcat(const locale_facet **facet, const locale *loc)
5019 TRACE("(%p %p)\n", facet, loc);
5021 if(facet && !*facet) {
5022 _Locinfo locinfo;
5024 *facet = MSVCRT_operator_new(sizeof(num_get));
5025 if(!*facet) {
5026 ERR("Out of memory\n");
5027 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
5028 return 0;
5031 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
5032 num_get_wchar_ctor_locinfo((num_get*)*facet, &locinfo, 0);
5033 _Locinfo_dtor(&locinfo);
5036 return LC_NUMERIC;
5039 /* ?_Getcat@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
5040 /* ?_Getcat@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
5041 MSVCP_size_t __cdecl num_get_wchar__Getcat_old(const locale_facet **facet)
5043 return num_get_wchar__Getcat(facet, locale_classic());
5046 num_get* num_get_wchar_use_facet(const locale *loc)
5048 static num_get *obj = NULL;
5050 _Lockit lock;
5051 const locale_facet *fac;
5053 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
5054 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_get_wchar_id));
5055 if(fac) {
5056 _Lockit_dtor(&lock);
5057 return (num_get*)fac;
5060 if(obj) {
5061 _Lockit_dtor(&lock);
5062 return obj;
5065 num_get_wchar__Getcat(&fac, loc);
5066 obj = (num_get*)fac;
5067 call_locale_facet__Incref(&obj->facet);
5068 locale_facet_register(&obj->facet);
5069 _Lockit_dtor(&lock);
5071 return obj;
5074 /* ?_Getcat@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
5075 /* ?_Getcat@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
5076 MSVCP_size_t __cdecl num_get_short__Getcat(const locale_facet **facet, const locale *loc)
5078 if(facet && !*facet) {
5079 num_get_wchar__Getcat(facet, loc);
5080 (*(locale_facet**)facet)->vtable = &MSVCP_num_get_short_vtable;
5083 return LC_NUMERIC;
5086 /* ?_Getcat@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
5087 /* ?_Getcat@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
5088 MSVCP_size_t __cdecl num_get_short__Getcat_old(const locale_facet **facet)
5090 return num_get_short__Getcat(facet, locale_classic());
5093 num_get* num_get_short_use_facet(const locale *loc)
5095 static num_get *obj = NULL;
5097 _Lockit lock;
5098 const locale_facet *fac;
5100 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
5101 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_get_short_id));
5102 if(fac) {
5103 _Lockit_dtor(&lock);
5104 return (num_get*)fac;
5107 if(obj) {
5108 _Lockit_dtor(&lock);
5109 return obj;
5112 num_get_short__Getcat(&fac, loc);
5113 obj = (num_get*)fac;
5114 call_locale_facet__Incref(&obj->facet);
5115 locale_facet_register(&obj->facet);
5116 _Lockit_dtor(&lock);
5118 return obj;
5121 static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
5122 istreambuf_iterator_wchar *last, const locale *loc, numpunct_wchar *numpunct)
5124 basic_string_char grouping_bstr;
5125 basic_string_char groups_found;
5126 int i, groups_no = 0, cur_group = 0, exp = 0;
5127 char *dest_beg = dest, *num_end = dest+25, *exp_end = dest+31;
5128 wchar_t sep = 0, digits[11], *digits_pos;
5129 const char *grouping, *groups;
5130 BOOL error = FALSE, got_digit = FALSE, got_nonzero = FALSE;
5132 TRACE("(%p %p %p %p)\n", dest, first, last, loc);
5134 for(i=0; i<10; i++)
5135 digits[i] = mb_to_wc('0'+i, &this->cvt);
5136 digits[10] = 0;
5138 numpunct_wchar_grouping(numpunct, &grouping_bstr);
5139 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
5140 #if _MSVCP_VER >= 70
5141 if (grouping[0]) sep = numpunct_wchar_thousands_sep(numpunct);
5142 #endif
5144 if(sep)
5145 MSVCP_basic_string_char_ctor(&groups_found);
5147 istreambuf_iterator_wchar_val(first);
5148 /* get sign */
5149 if(first->strbuf && first->val==mb_to_wc('-', &this->cvt)) {
5150 *dest++ = '-';
5151 istreambuf_iterator_wchar_inc(first);
5152 }else if(first->strbuf && first->val==mb_to_wc('+', &this->cvt)) {
5153 *dest++ = '+';
5154 istreambuf_iterator_wchar_inc(first);
5157 /* read possibly grouped numbers before decimal */
5158 for(; first->strbuf; istreambuf_iterator_wchar_inc(first)) {
5159 if(!(digits_pos = wcschr(digits, first->val))) {
5160 if(sep && first->val==sep) {
5161 if(!groups_no) break; /* empty group - stop parsing */
5162 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
5163 groups_no = 0;
5164 ++cur_group;
5165 }else {
5166 break;
5168 }else {
5169 got_digit = TRUE; /* found a digit, zero or non-zero */
5170 /* write digit to dest if not a leading zero (to not waste dest buffer) */
5171 if(!got_nonzero && first->val == digits[0])
5173 ++groups_no;
5174 continue;
5176 got_nonzero = TRUE;
5177 if(dest < num_end)
5178 *dest++ = '0'+digits_pos-digits;
5179 else
5180 exp++; /* too many digits, just multiply by 10 */
5181 if(sep && groups_no<CHAR_MAX)
5182 ++groups_no;
5186 /* if all leading zeroes, we didn't write anything so put a zero we check for a decimal */
5187 if(got_digit && !got_nonzero)
5188 *dest++ = '0';
5190 /* get decimal, if any */
5191 if(first->strbuf && first->val==numpunct_wchar_decimal_point(numpunct)) {
5192 if(dest < num_end)
5193 *dest++ = *localeconv()->decimal_point;
5194 istreambuf_iterator_wchar_inc(first);
5197 /* read non-grouped after decimal */
5198 for(; first->strbuf; istreambuf_iterator_wchar_inc(first)) {
5199 if(!(digits_pos = wcschr(digits, first->val)))
5200 break;
5201 else if(dest<num_end) {
5202 got_digit = TRUE;
5203 *dest++ = '0'+digits_pos-digits;
5207 /* read exponent, if any */
5208 if(first->strbuf && (first->val==mb_to_wc('e', &this->cvt) || first->val==mb_to_wc('E', &this->cvt))) {
5209 *dest++ = 'e';
5210 istreambuf_iterator_wchar_inc(first);
5212 if(first->strbuf && first->val==mb_to_wc('-', &this->cvt)) {
5213 *dest++ = '-';
5214 istreambuf_iterator_wchar_inc(first);
5215 }else if(first->strbuf && first->val==mb_to_wc('+', &this->cvt)) {
5216 *dest++ = '+';
5217 istreambuf_iterator_wchar_inc(first);
5220 got_digit = got_nonzero = FALSE;
5221 error = TRUE;
5222 /* skip any leading zeroes */
5223 for(; first->strbuf && first->val==digits[0]; istreambuf_iterator_wchar_inc(first))
5224 error = FALSE;
5226 for(; first->strbuf && (digits_pos = wcschr(digits, first->val)); istreambuf_iterator_wchar_inc(first)) {
5227 got_digit = got_nonzero = TRUE; /* leading zeroes would have been skipped, so first digit is non-zero */
5228 error = FALSE;
5229 if(dest<exp_end)
5230 *dest++ = '0'+digits_pos-digits;
5233 /* if just found zeroes for exponent, use that */
5234 if(got_digit && !got_nonzero)
5236 error = FALSE;
5237 if(dest<exp_end)
5238 *dest++ = '0';
5242 if(sep && groups_no)
5243 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
5245 if(!cur_group) /* no groups, skip loop */
5246 cur_group--;
5247 else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
5248 error = TRUE; /* trailing empty */
5250 for(; cur_group>=0 && !error; cur_group--) {
5251 if(*grouping == CHAR_MAX) {
5252 if(cur_group)
5253 error = TRUE;
5254 break;
5255 }else if((cur_group && *grouping!=groups[cur_group])
5256 || (!cur_group && *grouping<groups[cur_group])) {
5257 error = TRUE;
5258 break;
5259 }else if(grouping[1]) {
5260 grouping++;
5263 MSVCP_basic_string_char_dtor(&grouping_bstr);
5264 if(sep)
5265 MSVCP_basic_string_char_dtor(&groups_found);
5267 if(error) {
5268 *dest_beg = '\0';
5269 return 0;
5271 *dest++ = '\0';
5272 return exp;
5275 /* ?_Getffld@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@1ABVlocale@2@@Z */
5276 /* ?_Getffld@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@1AEBVlocale@2@@Z */
5277 int __cdecl num_get_wchar__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
5278 istreambuf_iterator_wchar *last, const locale *loc)
5280 return num_get__Getffld(this, dest, first, last, loc, numpunct_wchar_use_facet(loc));
5283 /* ?_Getffld@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@1ABVlocale@2@@Z */
5284 /* ?_Getffld@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@1AEBVlocale@2@@Z */
5285 int __cdecl num_get_short__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
5286 istreambuf_iterator_wchar *last, const locale *loc)
5288 return num_get__Getffld(this, dest, first, last, loc, numpunct_short_use_facet(loc));
5291 /* ?_Getffldx@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@1AAVios_base@2@PAH@Z */
5292 /* ?_Getffldx@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@1AEAVios_base@2@PEAH@Z */
5293 /* ?_Getffldx@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@1AAVios_base@2@PAH@Z */
5294 /* ?_Getffldx@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@1AEAVios_base@2@PEAH@Z */
5295 int __cdecl num_get_wchar__Getffldx(num_get *this, char *dest, istreambuf_iterator_wchar *first,
5296 istreambuf_iterator_wchar *last, ios_base *ios, int *phexexp)
5298 FIXME("(%p %p %p %p %p) stub\n", dest, first, last, ios, phexexp);
5299 return -1;
5302 static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
5303 istreambuf_iterator_wchar *last, int fmtflags, const locale *loc, numpunct_wchar *numpunct)
5305 wchar_t digits[23], *digits_pos, sep = 0;
5306 basic_string_char grouping_bstr;
5307 basic_string_char groups_found;
5308 int i, basefield, base, groups_no = 0, cur_group = 0;
5309 char *dest_beg = dest, *dest_end = dest+24;
5310 const char *grouping, *groups;
5311 BOOL error = TRUE, dest_empty = TRUE, found_zero = FALSE;
5313 TRACE("(%p %p %p %04x %p)\n", dest, first, last, fmtflags, loc);
5315 for(i=0; i<10; i++)
5316 digits[i] = mb_to_wc('0'+i, &this->cvt);
5317 for(i=0; i<6; i++) {
5318 digits[10+i] = mb_to_wc('a'+i, &this->cvt);
5319 digits[16+i] = mb_to_wc('A'+i, &this->cvt);
5322 numpunct_wchar_grouping(numpunct, &grouping_bstr);
5323 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
5324 #if _MSVCP_VER >= 70
5325 if (grouping[0]) sep = numpunct_wchar_thousands_sep(numpunct);
5326 #endif
5328 basefield = fmtflags & FMTFLAG_basefield;
5329 if(basefield == FMTFLAG_oct)
5330 base = 8;
5331 else if(basefield == FMTFLAG_hex)
5332 base = 22; /* equal to the size of digits buffer */
5333 else if(!basefield)
5334 base = 0;
5335 else
5336 base = 10;
5338 istreambuf_iterator_wchar_val(first);
5339 if(first->strbuf && first->val==mb_to_wc('-', &this->cvt)) {
5340 *dest++ = '-';
5341 istreambuf_iterator_wchar_inc(first);
5342 }else if(first->strbuf && first->val==mb_to_wc('+', &this->cvt)) {
5343 *dest++ = '+';
5344 istreambuf_iterator_wchar_inc(first);
5347 if(first->strbuf && first->val==digits[0]) {
5348 found_zero = TRUE;
5349 istreambuf_iterator_wchar_inc(first);
5350 if(first->strbuf && (first->val==mb_to_wc('x', &this->cvt) || first->val==mb_to_wc('X', &this->cvt))) {
5351 if(!base || base == 22) {
5352 found_zero = FALSE;
5353 istreambuf_iterator_wchar_inc(first);
5354 base = 22;
5355 }else {
5356 base = 10;
5358 }else {
5359 error = FALSE;
5360 if(!base) base = 8;
5362 }else {
5363 if(!base) base = 10;
5365 digits[base] = 0;
5367 if(sep) {
5368 MSVCP_basic_string_char_ctor(&groups_found);
5369 if(found_zero) ++groups_no;
5372 for(; first->strbuf; istreambuf_iterator_wchar_inc(first)) {
5373 if(!(digits_pos = wcschr(digits, first->val))) {
5374 if(sep && first->val==sep) {
5375 if(!groups_no) break; /* empty group - stop parsing */
5376 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
5377 groups_no = 0;
5378 ++cur_group;
5379 }else {
5380 break;
5382 }else {
5383 error = FALSE;
5384 if(dest_empty && first->val == digits[0]) {
5385 found_zero = TRUE;
5386 ++groups_no;
5387 continue;
5389 dest_empty = FALSE;
5390 /* skip digits that can't be copied to dest buffer, other
5391 * functions are responsible for detecting overflows */
5392 if(dest < dest_end)
5393 *dest++ = (digits_pos-digits<10 ? '0'+digits_pos-digits :
5394 (digits_pos-digits<16 ? 'a'+digits_pos-digits-10 :
5395 'A'+digits_pos-digits-16));
5396 if(sep && groups_no<CHAR_MAX)
5397 ++groups_no;
5401 if(sep && groups_no)
5402 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
5404 if(!cur_group) { /* no groups, skip loop */
5405 cur_group--;
5406 }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
5407 error = TRUE; /* trailing empty */
5408 found_zero = FALSE;
5411 for(; cur_group>=0 && !error; cur_group--) {
5412 if(*grouping == CHAR_MAX) {
5413 if(cur_group)
5414 error = TRUE;
5415 break;
5416 }else if((cur_group && *grouping!=groups[cur_group])
5417 || (!cur_group && *grouping<groups[cur_group])) {
5418 error = TRUE;
5419 break;
5420 }else if(grouping[1]) {
5421 grouping++;
5425 MSVCP_basic_string_char_dtor(&grouping_bstr);
5426 if(sep)
5427 MSVCP_basic_string_char_dtor(&groups_found);
5429 if(error) {
5430 if (found_zero)
5431 *dest++ = '0';
5432 else
5433 dest = dest_beg;
5434 }else if(dest_empty)
5435 *dest++ = '0';
5436 *dest = '\0';
5438 return (base==22 ? 16 : base);
5441 /* ?_Getifld@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@1HABVlocale@2@@Z */
5442 /* ?_Getifld@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@1HAEBVlocale@2@@Z */
5443 int __cdecl num_get_wchar__Getifld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
5444 istreambuf_iterator_wchar *last, int fmtflags, const locale *loc)
5446 return num_get__Getifld(this, dest, first, last,
5447 fmtflags, loc, numpunct_wchar_use_facet(loc));
5450 /* ?_Getifld@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@1HABVlocale@2@@Z */
5451 /* ?_Getifld@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@1HAEBVlocale@2@@Z */
5452 int __cdecl num_get_short__Getifld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
5453 istreambuf_iterator_wchar *last, int fmtflags, const locale *loc)
5455 return num_get__Getifld(this, dest, first, last,
5456 fmtflags, loc, numpunct_short_use_facet(loc));
5459 /* ?_Hexdig@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABEH_W000@Z */
5460 /* ?_Hexdig@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAH_W000@Z */
5461 /* ?_Hexdig@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABEHGGGG@Z */
5462 /* ?_Hexdig@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAHGGGG@Z */
5463 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_wchar__Hexdig, 20)
5464 int __thiscall MSVCP_num_get_wchar__Hexdig(num_get *this, wchar_t dig, wchar_t e0, wchar_t al, wchar_t au)
5466 FIXME("(%p %c %c %c %c) stub\n", this, dig, e0, al, au);
5467 return -1;
5470 static istreambuf_iterator_wchar* num_get_do_get_void(const num_get *this,
5471 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5472 istreambuf_iterator_wchar last, ios_base *base, int *state,
5473 void **pval, numpunct_wchar *numpunct)
5475 unsigned __int64 v;
5476 char tmp[25], *end;
5477 int err;
5479 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5481 v = _Stoullx(tmp, &end, num_get__Getifld(this, tmp, &first,
5482 &last, FMTFLAG_hex, IOS_LOCALE(base), numpunct), &err);
5483 if(v!=(unsigned __int64)((INT_PTR)v))
5484 *state |= IOSTATE_failbit;
5485 else if(end!=tmp && !err)
5486 *pval = (void*)((INT_PTR)v);
5487 else
5488 *state |= IOSTATE_failbit;
5490 if(!first.strbuf)
5491 *state |= IOSTATE_eofbit;
5493 *ret = first;
5494 return ret;
5497 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAPAX@Z */
5498 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAPEAX@Z */
5499 #if _MSVCP_VER <= 100
5500 #define call_num_get_wchar_do_get_void(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 4, istreambuf_iterator_wchar*, \
5501 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, void**), \
5502 (this, ret, first, last, base, state, pval))
5503 #else
5504 #define call_num_get_wchar_do_get_void(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_wchar*, \
5505 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, void**), \
5506 (this, ret, first, last, base, state, pval))
5507 #endif
5508 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_void,36)
5509 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_void(const num_get *this, istreambuf_iterator_wchar *ret,
5510 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, void **pval)
5512 return num_get_do_get_void(this, ret, first, last, base,
5513 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5516 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAPAX@Z */
5517 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAPEAX@Z */
5518 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_void,36)
5519 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_void(const num_get *this, istreambuf_iterator_wchar *ret,
5520 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, void **pval)
5522 return num_get_do_get_void(this, ret, first, last, base,
5523 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5526 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAPAX@Z */
5527 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAPEAX@Z */
5528 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAPAX@Z */
5529 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAPEAX@Z */
5530 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_void,36)
5531 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_void(const num_get *this, istreambuf_iterator_wchar *ret,
5532 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, void **pval)
5534 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5535 return call_num_get_wchar_do_get_void(this, ret, first, last, base, state, pval);
5538 static istreambuf_iterator_wchar* num_get_do_get_double(const num_get *this,
5539 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5540 istreambuf_iterator_wchar last, ios_base *base, int *state,
5541 double *pval, numpunct_wchar *numpunct)
5543 double v;
5544 char tmp[32], *end;
5545 int err;
5547 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5549 v = _Stodx(tmp, &end, num_get__Getffld(this, tmp, &first, &last, IOS_LOCALE(base), numpunct), &err);
5550 if(end!=tmp && !err)
5551 *pval = v;
5552 else
5553 *state |= IOSTATE_failbit;
5555 if(!first.strbuf)
5556 *state |= IOSTATE_eofbit;
5558 *ret = first;
5559 return ret;
5562 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAO@Z */
5563 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAO@Z */
5564 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAN@Z */
5565 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAN@Z */
5566 #if _MSVCP_VER <= 100
5567 #define call_num_get_wchar_do_get_ldouble(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 8, istreambuf_iterator_wchar*, \
5568 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, double*), \
5569 (this, ret, first, last, base, state, pval))
5570 #define call_num_get_wchar_do_get_double(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_wchar*, \
5571 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, double*), \
5572 (this, ret, first, last, base, state, pval))
5573 #else
5574 #define call_num_get_wchar_do_get_ldouble(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_wchar*, \
5575 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, double*), \
5576 (this, ret, first, last, base, state, pval))
5577 #define call_num_get_wchar_do_get_double(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_wchar*, \
5578 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, double*), \
5579 (this, ret, first, last, base, state, pval))
5580 #endif
5581 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_double,36)
5582 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_double(const num_get *this, istreambuf_iterator_wchar *ret,
5583 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
5585 return num_get_do_get_double(this, ret, first, last, base,
5586 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5589 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAO@Z */
5590 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAO@Z */
5591 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAN@Z */
5592 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAN@Z */
5593 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_double,36)
5594 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_double(const num_get *this, istreambuf_iterator_wchar *ret,
5595 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
5597 return num_get_do_get_double(this, ret, first, last, base,
5598 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5601 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAO@Z */
5602 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAO@Z */
5603 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAO@Z */
5604 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAO@Z */
5605 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_ldouble,36)
5606 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_ldouble(const num_get *this, istreambuf_iterator_wchar *ret,
5607 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
5609 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5610 return call_num_get_wchar_do_get_ldouble(this, ret, first, last, base, state, pval);
5613 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAN@Z */
5614 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAN@Z */
5615 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAN@Z */
5616 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAN@Z */
5617 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_double,36)
5618 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_double(const num_get *this, istreambuf_iterator_wchar *ret,
5619 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
5621 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5622 return call_num_get_wchar_do_get_double(this, ret, first, last, base, state, pval);
5625 static istreambuf_iterator_wchar* num_get_do_get_float(const num_get *this,
5626 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5627 istreambuf_iterator_wchar last, ios_base *base, int *state,
5628 float *pval, numpunct_wchar *numpunct)
5630 float v;
5631 char tmp[32], *end;
5632 int err;
5634 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5636 v = _Stofx(tmp, &end, num_get__Getffld(this, tmp, &first,
5637 &last, IOS_LOCALE(base), numpunct), &err);
5638 if(end!=tmp && !err)
5639 *pval = v;
5640 else
5641 *state |= IOSTATE_failbit;
5643 if(!first.strbuf)
5644 *state |= IOSTATE_eofbit;
5646 *ret = first;
5647 return ret;
5650 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAM@Z */
5651 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAM@Z */
5652 #if _MSVCP_VER <= 100
5653 #define call_num_get_wchar_do_get_float(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_wchar*, \
5654 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, float*), \
5655 (this, ret, first, last, base, state, pval))
5656 #else
5657 #define call_num_get_wchar_do_get_float(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_wchar*, \
5658 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, float*), \
5659 (this, ret, first, last, base, state, pval))
5660 #endif
5661 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_float,36)
5662 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_float(const num_get *this, istreambuf_iterator_wchar *ret,
5663 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, float *pval)
5665 return num_get_do_get_float(this, ret, first, last, base,
5666 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5669 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAM@Z */
5670 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAM@Z */
5671 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_float,36)
5672 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_float(const num_get *this, istreambuf_iterator_wchar *ret,
5673 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, float *pval)
5675 return num_get_do_get_float(this, ret, first, last, base,
5676 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5679 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAM@Z */
5680 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAM@Z */
5681 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAM@Z */
5682 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAM@Z */
5683 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_float,36)
5684 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_float(const num_get *this, istreambuf_iterator_wchar *ret,
5685 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, float *pval)
5687 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5688 return call_num_get_wchar_do_get_float(this, ret, first, last, base, state, pval);
5691 static istreambuf_iterator_wchar* num_get_do_get_uint64(const num_get *this,
5692 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5693 istreambuf_iterator_wchar last, ios_base *base, int *state,
5694 ULONGLONG *pval, numpunct_wchar *numpunct)
5696 unsigned __int64 v;
5697 char tmp[25], *end;
5698 int err;
5700 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5702 v = _Stoullx(tmp, &end, num_get__Getifld(this, tmp, &first,
5703 &last, base->fmtfl, IOS_LOCALE(base), numpunct), &err);
5704 if(end!=tmp && !err)
5705 *pval = v;
5706 else
5707 *state |= IOSTATE_failbit;
5709 if(!first.strbuf)
5710 *state |= IOSTATE_eofbit;
5712 *ret = first;
5713 return ret;
5716 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAA_K@Z */
5717 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEA_K@Z */
5718 #if _MSVCP_VER <= 100
5719 #define call_num_get_wchar_do_get_uint64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_wchar*, \
5720 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, ULONGLONG*), \
5721 (this, ret, first, last, base, state, pval))
5722 #else
5723 #define call_num_get_wchar_do_get_uint64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_wchar*, \
5724 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, ULONGLONG*), \
5725 (this, ret, first, last, base, state, pval))
5726 #endif
5727 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_uint64,36)
5728 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_uint64(const num_get *this, istreambuf_iterator_wchar *ret,
5729 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONGLONG *pval)
5731 return num_get_do_get_uint64(this, ret, first, last, base,
5732 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5735 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAA_K@Z */
5736 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEA_K@Z */
5737 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_uint64,36)
5738 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_uint64(const num_get *this, istreambuf_iterator_wchar *ret,
5739 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONGLONG *pval)
5741 return num_get_do_get_uint64(this, ret, first, last, base,
5742 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5745 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAA_K@Z */
5746 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEA_K@Z */
5747 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAA_K@Z */
5748 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEA_K@Z */
5749 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_uint64,36)
5750 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_uint64(const num_get *this, istreambuf_iterator_wchar *ret,
5751 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONGLONG *pval)
5753 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5754 return call_num_get_wchar_do_get_uint64(this, ret, first, last, base, state, pval);
5757 static istreambuf_iterator_wchar* num_get_do_get_int64(const num_get *this,
5758 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5759 istreambuf_iterator_wchar last, ios_base *base, int *state,
5760 LONGLONG *pval, numpunct_wchar *numpunct)
5762 __int64 v;
5763 char tmp[25], *end;
5764 int err;
5766 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5768 v = _Stollx(tmp, &end, num_get__Getifld(this, tmp, &first,
5769 &last, base->fmtfl, IOS_LOCALE(base), numpunct), &err);
5770 if(end!=tmp && !err)
5771 *pval = v;
5772 else
5773 *state |= IOSTATE_failbit;
5775 if(!first.strbuf)
5776 *state |= IOSTATE_eofbit;
5778 *ret = first;
5779 return ret;
5782 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAA_J@Z */
5783 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEA_J@Z */
5784 #if _MSVCP_VER <= 100
5785 #define call_num_get_wchar_do_get_int64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_wchar*, \
5786 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, LONGLONG*), \
5787 (this, ret, first, last, base, state, pval))
5788 #else
5789 #define call_num_get_wchar_do_get_int64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_wchar*, \
5790 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, LONGLONG*), \
5791 (this, ret, first, last, base, state, pval))
5792 #endif
5793 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_int64,36)
5794 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_int64(const num_get *this, istreambuf_iterator_wchar *ret,
5795 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONGLONG *pval)
5797 return num_get_do_get_int64(this, ret, first, last, base,
5798 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5801 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAA_J@Z */
5802 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEA_J@Z */
5803 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_int64,36)
5804 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_int64(const num_get *this, istreambuf_iterator_wchar *ret,
5805 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONGLONG *pval)
5807 return num_get_do_get_int64(this, ret, first, last, base,
5808 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5811 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAA_J@Z */
5812 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEA_J@Z */
5813 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAA_J@Z */
5814 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEA_J@Z */
5815 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_int64,36)
5816 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_int64(const num_get *this, istreambuf_iterator_wchar *ret,
5817 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONGLONG *pval)
5819 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5820 return call_num_get_wchar_do_get_int64(this, ret, first, last, base, state, pval);
5823 static istreambuf_iterator_wchar* num_get_do_get_ulong(const num_get *this,
5824 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5825 istreambuf_iterator_wchar last, ios_base *base, int *state,
5826 ULONG *pval, numpunct_wchar *numpunct)
5828 ULONG v;
5829 char tmp[25], *end;
5830 int err;
5832 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5834 v = _Stoulx(tmp, &end, num_get__Getifld(this, tmp, &first,
5835 &last, base->fmtfl, IOS_LOCALE(base), numpunct), &err);
5836 if(end!=tmp && !err)
5837 *pval = v;
5838 else
5839 *state |= IOSTATE_failbit;
5841 if(!first.strbuf)
5842 *state |= IOSTATE_eofbit;
5844 *ret = first;
5845 return ret;
5848 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAK@Z */
5849 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAK@Z */
5850 #if _MSVCP_VER <= 100
5851 #define call_num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_wchar*, \
5852 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, ULONG*), \
5853 (this, ret, first, last, base, state, pval))
5854 #else
5855 #define call_num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 36, istreambuf_iterator_wchar*, \
5856 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, ULONG*), \
5857 (this, ret, first, last, base, state, pval))
5858 #endif
5859 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_ulong,36)
5860 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_ulong(const num_get *this, istreambuf_iterator_wchar *ret,
5861 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONG *pval)
5863 return num_get_do_get_ulong(this, ret, first, last, base,
5864 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5867 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAK@Z */
5868 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAK@Z */
5869 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_ulong,36)
5870 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_ulong(const num_get *this, istreambuf_iterator_wchar *ret,
5871 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONG *pval)
5873 return num_get_do_get_ulong(this, ret, first, last, base,
5874 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5877 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAK@Z */
5878 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAK@Z */
5879 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAK@Z */
5880 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAK@Z */
5881 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_ulong,36)
5882 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_ulong(const num_get *this, istreambuf_iterator_wchar *ret,
5883 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONG *pval)
5885 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5886 return call_num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval);
5889 static istreambuf_iterator_wchar* num_get_do_get_long(const num_get *this,
5890 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5891 istreambuf_iterator_wchar last, ios_base *base, int *state,
5892 LONG *pval, numpunct_wchar *numpunct)
5894 LONG v;
5895 char tmp[25], *end;
5896 int err;
5898 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5900 v = _Stolx(tmp, &end, num_get__Getifld(this, tmp, &first,
5901 &last, base->fmtfl, IOS_LOCALE(base), numpunct), &err);
5902 if(end!=tmp && !err)
5903 *pval = v;
5904 else
5905 *state |= IOSTATE_failbit;
5907 if(!first.strbuf)
5908 *state |= IOSTATE_eofbit;
5910 *ret = first;
5911 return ret;
5914 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z */
5915 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAJ@Z */
5916 #if _MSVCP_VER <= 100
5917 #define call_num_get_wchar_do_get_long(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_wchar*, \
5918 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, LONG*), \
5919 (this, ret, first, last, base, state, pval))
5920 #else
5921 #define call_num_get_wchar_do_get_long(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 40, istreambuf_iterator_wchar*, \
5922 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, LONG*), \
5923 (this, ret, first, last, base, state, pval))
5924 #endif
5925 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_long,36)
5926 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_long(const num_get *this, istreambuf_iterator_wchar *ret,
5927 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONG *pval)
5929 return num_get_do_get_long(this, ret, first, last, base,
5930 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
5933 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z */
5934 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAJ@Z */
5935 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_long,36)
5936 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_long(const num_get *this, istreambuf_iterator_wchar *ret,
5937 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONG *pval)
5939 return num_get_do_get_long(this, ret, first, last, base,
5940 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
5943 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z */
5944 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAJ@Z */
5945 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z */
5946 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAJ@Z */
5947 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_long,36)
5948 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_long(const num_get *this, istreambuf_iterator_wchar *ret,
5949 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONG *pval)
5951 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5952 return call_num_get_wchar_do_get_long(this, ret, first, last, base, state, pval);
5955 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAI@Z */
5956 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAI@Z */
5957 #if _MSVCP_VER <= 100
5958 #define call_num_get_wchar_do_get_uint(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 36, istreambuf_iterator_wchar*, \
5959 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, unsigned int*), \
5960 (this, ret, first, last, base, state, pval))
5961 #else
5962 #define call_num_get_wchar_do_get_uint(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 44, istreambuf_iterator_wchar*, \
5963 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, unsigned int*), \
5964 (this, ret, first, last, base, state, pval))
5965 #endif
5966 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_uint,36)
5967 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_uint(const num_get *this, istreambuf_iterator_wchar *ret,
5968 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned int *pval)
5970 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5971 return num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval);
5974 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAI@Z */
5975 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAI@Z */
5976 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_uint,36)
5977 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_uint(const num_get *this, istreambuf_iterator_wchar *ret,
5978 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned int *pval)
5980 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5981 return num_get_short_do_get_ulong(this, ret, first, last, base, state, pval);
5984 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAI@Z */
5985 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAI@Z */
5986 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAI@Z */
5987 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAI@Z */
5988 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_uint,36)
5989 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_uint(const num_get *this, istreambuf_iterator_wchar *ret,
5990 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned int *pval)
5992 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5993 return call_num_get_wchar_do_get_uint(this, ret, first, last, base, state, pval);
5996 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAG@Z */
5997 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAG@Z */
5998 #if _MSVCP_VER <= 100
5999 #define call_num_get_wchar_do_get_ushort(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 40, istreambuf_iterator_wchar*, \
6000 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, unsigned short*), \
6001 (this, ret, first, last, base, state, pval))
6002 #else
6003 #define call_num_get_wchar_do_get_ushort(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 48, istreambuf_iterator_wchar*, \
6004 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, unsigned short*), \
6005 (this, ret, first, last, base, state, pval))
6006 #endif
6007 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_ushort,36)
6008 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_ushort(const num_get *this, istreambuf_iterator_wchar *ret,
6009 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned short *pval)
6011 ULONG v;
6012 char tmp[25], *beg, *end;
6013 int err, b;
6015 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6017 b = num_get_wchar__Getifld(this, tmp,
6018 &first, &last, base->fmtfl, IOS_LOCALE(base));
6019 beg = tmp + (tmp[0]=='-' ? 1 : 0);
6020 v = _Stoulx(beg, &end, b, &err);
6022 if(v != (ULONG)((unsigned short)v))
6023 *state |= IOSTATE_failbit;
6024 else if(end!=beg && !err)
6025 *pval = (tmp[0]=='-' ? -((unsigned short)v) : v);
6026 else
6027 *state |= IOSTATE_failbit;
6029 if(!first.strbuf)
6030 *state |= IOSTATE_eofbit;
6032 *ret = first;
6033 return ret;
6036 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAG@Z */
6037 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAG@Z */
6038 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_ushort,36)
6039 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_ushort(const num_get *this, istreambuf_iterator_wchar *ret,
6040 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned short *pval)
6042 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, state, pval);
6043 return ret;
6046 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAAG@Z */
6047 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEAG@Z */
6048 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAAG@ */
6049 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEAG@Z */
6050 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_ushort,36)
6051 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_ushort(const num_get *this, istreambuf_iterator_wchar *ret,
6052 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned short *pval)
6054 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6055 return call_num_get_wchar_do_get_ushort(this, ret, first, last, base, state, pval);
6058 static istreambuf_iterator_wchar* num_get_do_get_bool(const num_get *this,
6059 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
6060 istreambuf_iterator_wchar last, ios_base *base, int *state,
6061 MSVCP_bool *pval, numpunct_wchar *numpunct)
6063 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6065 if(base->fmtfl & FMTFLAG_boolalpha) {
6066 basic_string_wchar false_bstr, true_bstr;
6067 const wchar_t *pfalse, *ptrue;
6069 numpunct_wchar_falsename(numpunct, &false_bstr);
6070 numpunct_wchar_truename(numpunct, &true_bstr);
6071 pfalse = MSVCP_basic_string_wchar_c_str(&false_bstr);
6072 ptrue = MSVCP_basic_string_wchar_c_str(&true_bstr);
6074 for(istreambuf_iterator_wchar_val(&first); first.strbuf;) {
6075 if(pfalse && *pfalse && first.val!=*pfalse)
6076 pfalse = NULL;
6077 if(ptrue && *ptrue && first.val!=*ptrue)
6078 ptrue = NULL;
6080 if(pfalse && *pfalse && ptrue && !*ptrue)
6081 ptrue = NULL;
6082 if(ptrue && *ptrue && pfalse && !*pfalse)
6083 pfalse = NULL;
6085 if(pfalse)
6086 pfalse++;
6087 if(ptrue)
6088 ptrue++;
6090 if(pfalse || ptrue)
6091 istreambuf_iterator_wchar_inc(&first);
6093 if((!pfalse || !*pfalse) && (!ptrue || !*ptrue))
6094 break;
6097 if(ptrue)
6098 *pval = TRUE;
6099 else if(pfalse)
6100 *pval = FALSE;
6101 else
6102 *state |= IOSTATE_failbit;
6104 MSVCP_basic_string_wchar_dtor(&false_bstr);
6105 MSVCP_basic_string_wchar_dtor(&true_bstr);
6106 }else {
6107 char tmp[25], *end;
6108 int err;
6109 LONG v = _Stolx(tmp, &end, num_get__Getifld(this, tmp, &first,
6110 &last, base->fmtfl, IOS_LOCALE(base), numpunct), &err);
6112 if(end!=tmp && err==0 && (v==0 || v==1))
6113 *pval = v;
6114 else
6115 *state |= IOSTATE_failbit;
6118 if(!first.strbuf)
6119 *state |= IOSTATE_eofbit;
6120 memcpy(ret, &first, sizeof(first));
6121 return ret;
6124 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAA_N@Z */
6125 /* ?do_get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEA_N@Z */
6126 #if _MSVCP_VER <= 100
6127 #define call_num_get_wchar_do_get_bool(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 44, istreambuf_iterator_wchar*, \
6128 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, MSVCP_bool*), \
6129 (this, ret, first, last, base, state, pval))
6130 #else
6131 #define call_num_get_wchar_do_get_bool(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 52, istreambuf_iterator_wchar*, \
6132 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, MSVCP_bool*), \
6133 (this, ret, first, last, base, state, pval))
6134 #endif
6135 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_bool,36)
6136 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_bool(const num_get *this, istreambuf_iterator_wchar *ret,
6137 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, MSVCP_bool *pval)
6139 return num_get_do_get_bool(this, ret, first, last, base,
6140 state, pval, numpunct_wchar_use_facet(IOS_LOCALE(base)));
6143 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAA_N@Z */
6144 /* ?do_get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEA_N@Z */
6145 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_bool,36)
6146 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_bool(const num_get *this, istreambuf_iterator_wchar *ret,
6147 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, MSVCP_bool *pval)
6149 return num_get_do_get_bool(this, ret, first, last, base,
6150 state, pval, numpunct_short_use_facet(IOS_LOCALE(base)));
6153 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AAVios_base@2@AAHAA_N@Z */
6154 /* ?get@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@0AEAVios_base@2@AEAHAEA_N@Z */
6155 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AAVios_base@2@AAHAA_N@Z */
6156 /* ?get@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@GU?$char_traits@G@std@@@2@V32@0AEAVios_base@2@AEAHAEA_N@Z */
6157 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_bool,36)
6158 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_bool(const num_get *this, istreambuf_iterator_wchar *ret,
6159 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, MSVCP_bool *pval)
6161 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6162 return call_num_get_wchar_do_get_bool(this, ret, first, last, base, state, pval);
6165 /* ?id@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A */
6166 locale_id num_get_char_id = {0};
6168 /* ??_7?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@6B@ */
6169 extern const vtable_ptr MSVCP_num_get_char_vtable;
6171 /* ?_Init@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
6172 /* ?_Init@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
6173 DEFINE_THISCALL_WRAPPER(num_get_char__Init, 8)
6174 void __thiscall num_get_char__Init(num_get *this, const _Locinfo *locinfo)
6176 TRACE("(%p %p)\n", this, locinfo);
6177 _Locinfo__Getcvt(locinfo, &this->cvt);
6180 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
6181 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
6182 DEFINE_THISCALL_WRAPPER(num_get_char_ctor_locinfo, 12)
6183 num_get* __thiscall num_get_char_ctor_locinfo(num_get *this,
6184 const _Locinfo *locinfo, MSVCP_size_t refs)
6186 TRACE("(%p %p %lu)\n", this, locinfo, refs);
6188 locale_facet_ctor_refs(&this->facet, refs);
6189 this->facet.vtable = &MSVCP_num_get_char_vtable;
6191 num_get_char__Init(this, locinfo);
6192 return this;
6195 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */
6196 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */
6197 DEFINE_THISCALL_WRAPPER(num_get_char_ctor_refs, 8)
6198 num_get* __thiscall num_get_char_ctor_refs(num_get *this, MSVCP_size_t refs)
6200 _Locinfo locinfo;
6202 TRACE("(%p %lu)\n", this, refs);
6204 _Locinfo_ctor(&locinfo);
6205 num_get_char_ctor_locinfo(this, &locinfo, refs);
6206 _Locinfo_dtor(&locinfo);
6207 return this;
6210 /* ??_F?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */
6211 /* ??_F?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAAXXZ */
6212 DEFINE_THISCALL_WRAPPER(num_get_char_ctor, 4)
6213 num_get* __thiscall num_get_char_ctor(num_get *this)
6215 return num_get_char_ctor_refs(this, 0);
6218 /* ??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@UAE@XZ */
6219 /* ??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@UEAA@XZ */
6220 /* ??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */
6221 /* ??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEAA@XZ */
6222 DEFINE_THISCALL_WRAPPER(num_get_char_dtor, 4)
6223 void __thiscall num_get_char_dtor(num_get *this)
6225 TRACE("(%p)\n", this);
6226 locale_facet_dtor(&this->facet);
6229 DEFINE_THISCALL_WRAPPER(num_get_char_vector_dtor, 8)
6230 num_get* __thiscall num_get_char_vector_dtor(num_get *this, unsigned int flags)
6232 TRACE("(%p %x)\n", this, flags);
6233 if(flags & 2) {
6234 /* we have an array, with the number of elements stored before the first object */
6235 INT_PTR i, *ptr = (INT_PTR *)this-1;
6237 for(i=*ptr-1; i>=0; i--)
6238 num_get_char_dtor(this+i);
6239 MSVCRT_operator_delete(ptr);
6240 } else {
6241 num_get_char_dtor(this);
6242 if(flags & 1)
6243 MSVCRT_operator_delete(this);
6246 return this;
6249 /* ?_Getcat@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
6250 /* ?_Getcat@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
6251 MSVCP_size_t __cdecl num_get_char__Getcat(const locale_facet **facet, const locale *loc)
6253 TRACE("(%p %p)\n", facet, loc);
6255 if(facet && !*facet) {
6256 _Locinfo locinfo;
6258 *facet = MSVCRT_operator_new(sizeof(num_get));
6259 if(!*facet) {
6260 ERR("Out of memory\n");
6261 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
6262 return 0;
6265 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
6266 num_get_char_ctor_locinfo((num_get*)*facet, &locinfo, 0);
6267 _Locinfo_dtor(&locinfo);
6270 return LC_NUMERIC;
6273 /* ?_Getcat@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
6274 /* ?_Getcat@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
6275 MSVCP_size_t __cdecl num_get_char__Getcat_old(const locale_facet **facet)
6277 return num_get_char__Getcat(facet, locale_classic());
6280 num_get* num_get_char_use_facet(const locale *loc)
6282 static num_get *obj = NULL;
6284 _Lockit lock;
6285 const locale_facet *fac;
6287 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
6288 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_get_char_id));
6289 if(fac) {
6290 _Lockit_dtor(&lock);
6291 return (num_get*)fac;
6294 if(obj) {
6295 _Lockit_dtor(&lock);
6296 return obj;
6299 num_get_char__Getcat(&fac, loc);
6300 obj = (num_get*)fac;
6301 call_locale_facet__Incref(&obj->facet);
6302 locale_facet_register(&obj->facet);
6303 _Lockit_dtor(&lock);
6305 return obj;
6308 /* ?_Getffld@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@1ABVlocale@2@@Z */
6309 /* ?_Getffld@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@1AEBVlocale@2@@Z */
6310 /* Copies number to dest buffer, validates grouping and skips separators.
6311 * Updates first so it points past the number, all digits are skipped.
6312 * Returns how exponent needs to changed.
6313 * Size of dest buffer is not specified, assuming it's not smaller than 32:
6314 * strlen(+0.e+) + 22(digits) + 4(exponent) + 1(nullbyte)
6316 int __cdecl num_get_char__Getffld(const num_get *this, char *dest, istreambuf_iterator_char *first,
6317 istreambuf_iterator_char *last, const locale *loc)
6319 numpunct_char *numpunct = numpunct_char_use_facet(loc);
6320 basic_string_char grouping_bstr;
6321 basic_string_char groups_found;
6322 int groups_no = 0, cur_group = 0, exp = 0;
6323 char *dest_beg = dest, *num_end = dest+25, *exp_end = dest+31, sep = 0;
6324 const char *grouping, *groups;
6325 BOOL error = FALSE, got_digit = FALSE, got_nonzero = FALSE;
6327 TRACE("(%p %p %p %p)\n", dest, first, last, loc);
6329 numpunct_char_grouping(numpunct, &grouping_bstr);
6330 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
6331 #if _MSVCP_VER >= 70
6332 if (grouping[0]) sep = numpunct_char_thousands_sep(numpunct);
6333 #endif
6335 if(sep)
6336 MSVCP_basic_string_char_ctor(&groups_found);
6338 istreambuf_iterator_char_val(first);
6339 /* get sign */
6340 if(first->strbuf && (first->val=='-' || first->val=='+')) {
6341 *dest++ = first->val;
6342 istreambuf_iterator_char_inc(first);
6345 /* read possibly grouped numbers before decimal */
6346 for(; first->strbuf; istreambuf_iterator_char_inc(first)) {
6347 if(first->val<'0' || first->val>'9') {
6348 if(sep && first->val==sep) {
6349 if(!groups_no) break; /* empty group - stop parsing */
6350 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
6351 groups_no = 0;
6352 ++cur_group;
6353 }else {
6354 break;
6356 }else {
6357 got_digit = TRUE; /* found a digit, zero or non-zero */
6358 /* write digit to dest if not a leading zero (to not waste dest buffer) */
6359 if(!got_nonzero && first->val == '0')
6361 ++groups_no;
6362 continue;
6364 got_nonzero = TRUE;
6365 if(dest < num_end)
6366 *dest++ = first->val;
6367 else
6368 exp++; /* too many digits, just multiply by 10 */
6369 if(sep && groups_no<CHAR_MAX)
6370 ++groups_no;
6374 /* if all leading zeroes, we didn't write anything so put a zero we check for a decimal */
6375 if(got_digit && !got_nonzero)
6376 *dest++ = '0';
6378 /* get decimal, if any */
6379 if(first->strbuf && first->val==numpunct_char_decimal_point(numpunct)) {
6380 if(dest < num_end)
6381 *dest++ = *localeconv()->decimal_point;
6382 istreambuf_iterator_char_inc(first);
6385 /* read non-grouped after decimal */
6386 for(; first->strbuf; istreambuf_iterator_char_inc(first)) {
6387 if(first->val<'0' || first->val>'9')
6388 break;
6389 else if(dest<num_end) {
6390 got_digit = TRUE;
6391 *dest++ = first->val;
6395 /* read exponent, if any */
6396 if(first->strbuf && (first->val=='e' || first->val=='E')) {
6397 *dest++ = first->val;
6398 istreambuf_iterator_char_inc(first);
6400 if(first->strbuf && (first->val=='-' || first->val=='+')) {
6401 *dest++ = first->val;
6402 istreambuf_iterator_char_inc(first);
6405 got_digit = got_nonzero = FALSE;
6406 error = TRUE;
6407 /* skip any leading zeroes */
6408 for(; first->strbuf && first->val=='0'; istreambuf_iterator_char_inc(first))
6409 got_digit = TRUE;
6411 for(; first->strbuf && first->val>='0' && first->val<='9'; istreambuf_iterator_char_inc(first)) {
6412 got_digit = got_nonzero = TRUE; /* leading zeroes would have been skipped, so first digit is non-zero */
6413 error = FALSE;
6414 if(dest<exp_end)
6415 *dest++ = first->val;
6418 /* if just found zeroes for exponent, use that */
6419 if(got_digit && !got_nonzero)
6421 error = FALSE;
6422 if(dest<exp_end)
6423 *dest++ = '0';
6427 if(sep && groups_no)
6428 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
6430 if(!cur_group) /* no groups, skip loop */
6431 cur_group--;
6432 else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group])
6433 error = TRUE; /* trailing empty */
6435 for(; cur_group>=0 && !error; cur_group--) {
6436 if(*grouping == CHAR_MAX) {
6437 if(cur_group)
6438 error = TRUE;
6439 break;
6440 }else if((cur_group && *grouping!=groups[cur_group])
6441 || (!cur_group && *grouping<groups[cur_group])) {
6442 error = TRUE;
6443 break;
6444 }else if(grouping[1]) {
6445 grouping++;
6448 MSVCP_basic_string_char_dtor(&grouping_bstr);
6449 if(sep)
6450 MSVCP_basic_string_char_dtor(&groups_found);
6452 if(error) {
6453 *dest_beg = '\0';
6454 return 0;
6456 *dest++ = '\0';
6457 return exp;
6460 /* ?_Getffldx@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@1AAVios_base@2@PAH@Z */
6461 /* ?_Getffldx@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@1AEAVios_base@2@PEAH@Z */
6462 int __cdecl num_get_char__Getffldx(const num_get *this, char *dest, istreambuf_iterator_char *first,
6463 istreambuf_iterator_char *last, ios_base *ios, int *phexexp)
6465 FIXME("(%p %p %p %p %p) stub\n", dest, first, last, ios, phexexp);
6466 return -1;
6469 /* ?_Getifld@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@1HABVlocale@2@@Z */
6470 /* ?_Getifld@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHPEADAEAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@1HAEBVlocale@2@@Z */
6471 /* Copies number to dest buffer, validates grouping and skips separators.
6472 * Updates first so it points past the number, all digits are skipped.
6473 * Returns number base (8, 10 or 16).
6474 * Size of dest buffer is not specified, assuming it's not smaller than 25:
6475 * 22(8^22>2^64)+1(detect overflows)+1(sign)+1(nullbyte) = 25
6477 int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_iterator_char *first,
6478 istreambuf_iterator_char *last, int fmtflags, const locale *loc)
6480 static const char digits[] = "0123456789abcdefABCDEF";
6482 numpunct_char *numpunct = numpunct_char_use_facet(loc);
6483 basic_string_char grouping_bstr;
6484 basic_string_char groups_found;
6485 int basefield, base, groups_no = 0, cur_group = 0;
6486 char *dest_beg = dest, *dest_end = dest+24, sep = 0;
6487 const char *grouping, *groups;
6488 BOOL error = TRUE, dest_empty = TRUE, found_zero = FALSE;
6490 TRACE("(%p %p %p %04x %p)\n", dest, first, last, fmtflags, loc);
6492 numpunct_char_grouping(numpunct, &grouping_bstr);
6493 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
6494 #if _MSVCP_VER >= 70
6495 if (grouping[0]) sep = numpunct_char_thousands_sep(numpunct);
6496 #endif
6498 basefield = fmtflags & FMTFLAG_basefield;
6499 if(basefield == FMTFLAG_oct)
6500 base = 8;
6501 else if(basefield == FMTFLAG_hex)
6502 base = 22; /* equal to the size of digits buffer */
6503 else if(!basefield)
6504 base = 0;
6505 else
6506 base = 10;
6508 istreambuf_iterator_char_val(first);
6509 if(first->strbuf && (first->val=='-' || first->val=='+')) {
6510 *dest++ = first->val;
6511 istreambuf_iterator_char_inc(first);
6514 if(first->strbuf && first->val=='0') {
6515 found_zero = TRUE;
6516 istreambuf_iterator_char_inc(first);
6517 if(first->strbuf && (first->val=='x' || first->val=='X')) {
6518 if(!base || base == 22) {
6519 found_zero = FALSE;
6520 istreambuf_iterator_char_inc(first);
6521 base = 22;
6522 }else {
6523 base = 10;
6525 }else {
6526 error = FALSE;
6527 if(!base) base = 8;
6529 }else {
6530 if (!base) base = 10;
6533 if(sep)
6535 MSVCP_basic_string_char_ctor(&groups_found);
6536 if(found_zero) ++groups_no;
6539 for(; first->strbuf; istreambuf_iterator_char_inc(first)) {
6540 if(!memchr(digits, first->val, base)) {
6541 if(sep && first->val==sep) {
6542 if(!groups_no) break; /* empty group - stop parsing */
6543 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
6544 groups_no = 0;
6545 ++cur_group;
6546 }else {
6547 break;
6549 }else {
6550 error = FALSE;
6551 if(dest_empty && first->val == '0')
6553 found_zero = TRUE;
6554 ++groups_no;
6555 continue;
6557 dest_empty = FALSE;
6558 /* skip digits that can't be copied to dest buffer, other
6559 * functions are responsible for detecting overflows */
6560 if(dest < dest_end)
6561 *dest++ = first->val;
6562 if(sep && groups_no<CHAR_MAX)
6563 ++groups_no;
6567 if(sep && groups_no)
6568 MSVCP_basic_string_char_append_ch(&groups_found, groups_no);
6570 if(!cur_group) { /* no groups, skip loop */
6571 cur_group--;
6572 }else if(!(groups = MSVCP_basic_string_char_c_str(&groups_found))[cur_group]) {
6573 error = TRUE; /* trailing empty */
6574 found_zero = FALSE;
6577 for(; cur_group>=0 && !error; cur_group--) {
6578 if(*grouping == CHAR_MAX) {
6579 if(cur_group)
6580 error = TRUE;
6581 break;
6582 }else if((cur_group && *grouping!=groups[cur_group])
6583 || (!cur_group && *grouping<groups[cur_group])) {
6584 error = TRUE;
6585 break;
6586 }else if(grouping[1]) {
6587 grouping++;
6591 MSVCP_basic_string_char_dtor(&grouping_bstr);
6592 if(sep)
6593 MSVCP_basic_string_char_dtor(&groups_found);
6595 if(error) {
6596 if (found_zero)
6597 *dest++ = '0';
6598 else
6599 dest = dest_beg;
6600 }else if(dest_empty)
6601 *dest++ = '0';
6602 *dest = '\0';
6604 return (base==22 ? 16 : base);
6607 /* ?_Hexdig@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABEHD000@Z */
6608 /* ?_Hexdig@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHD000@Z */
6609 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_char__Hexdig, 20)
6610 int __thiscall MSVCP_num_get_char__Hexdig(num_get *this, char dig, char e0, char al, char au)
6612 FIXME("(%p %c %c %c %c) stub\n", this, dig, e0, al, au);
6613 return -1;
6616 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAPAX@Z */
6617 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAPEAX@Z */
6618 #if _MSVCP_VER <= 100
6619 #define call_num_get_char_do_get_void(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 4, istreambuf_iterator_char*, \
6620 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, void**), \
6621 (this, ret, first, last, base, state, pval))
6622 #else
6623 #define call_num_get_char_do_get_void(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_char*, \
6624 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, void**), \
6625 (this, ret, first, last, base, state, pval))
6626 #endif
6627 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_void,36)
6628 istreambuf_iterator_char *__thiscall num_get_char_do_get_void(const num_get *this, istreambuf_iterator_char *ret,
6629 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, void **pval)
6631 unsigned __int64 v;
6632 char tmp[25], *end;
6633 int err;
6635 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6637 v = _Stoullx(tmp, &end, num_get_char__Getifld(this, tmp,
6638 &first, &last, FMTFLAG_hex, IOS_LOCALE(base)), &err);
6639 if(v!=(unsigned __int64)((INT_PTR)v))
6640 *state |= IOSTATE_failbit;
6641 else if(end!=tmp && !err)
6642 *pval = (void*)((INT_PTR)v);
6643 else
6644 *state |= IOSTATE_failbit;
6646 if(!first.strbuf)
6647 *state |= IOSTATE_eofbit;
6649 *ret = first;
6650 return ret;
6653 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAPAX@Z */
6654 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAPEAX@Z */
6655 DEFINE_THISCALL_WRAPPER(num_get_char_get_void,36)
6656 istreambuf_iterator_char *__thiscall num_get_char_get_void(const num_get *this, istreambuf_iterator_char *ret,
6657 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, void **pval)
6659 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6660 return call_num_get_char_do_get_void(this, ret, first, last, base, state, pval);
6663 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAO@Z */
6664 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAO@Z */
6665 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAN@Z */
6666 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAN@Z */
6667 #if _MSVCP_VER <= 100
6668 #define call_num_get_char_do_get_ldouble(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 8, istreambuf_iterator_char*, \
6669 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, double*), \
6670 (this, ret, first, last, base, state, pval))
6671 #define call_num_get_char_do_get_double(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_char*, \
6672 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, double*), \
6673 (this, ret, first, last, base, state, pval))
6674 #else
6675 #define call_num_get_char_do_get_ldouble(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_char*, \
6676 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, double*), \
6677 (this, ret, first, last, base, state, pval))
6678 #define call_num_get_char_do_get_double(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_char*, \
6679 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, double*), \
6680 (this, ret, first, last, base, state, pval))
6681 #endif
6682 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_double,36)
6683 istreambuf_iterator_char *__thiscall num_get_char_do_get_double(const num_get *this, istreambuf_iterator_char *ret,
6684 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, double *pval)
6686 double v;
6687 char tmp[32], *end;
6688 int err;
6690 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6692 v = _Stodx(tmp, &end, num_get_char__Getffld(this, tmp, &first, &last, IOS_LOCALE(base)), &err);
6693 if(end!=tmp && !err)
6694 *pval = v;
6695 else
6696 *state |= IOSTATE_failbit;
6698 if(!first.strbuf)
6699 *state |= IOSTATE_eofbit;
6701 *ret = first;
6702 return ret;
6705 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAO@Z */
6706 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAO@Z */
6707 DEFINE_THISCALL_WRAPPER(num_get_char_get_ldouble,36)
6708 istreambuf_iterator_char *__thiscall num_get_char_get_ldouble(const num_get *this, istreambuf_iterator_char *ret,
6709 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, double *pval)
6711 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6712 return call_num_get_char_do_get_ldouble(this, ret, first, last, base, state, pval);
6715 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAN@Z */
6716 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAN@Z */
6717 DEFINE_THISCALL_WRAPPER(num_get_char_get_double,36)
6718 istreambuf_iterator_char *__thiscall num_get_char_get_double(const num_get *this, istreambuf_iterator_char *ret,
6719 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, double *pval)
6721 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6722 return call_num_get_char_do_get_double(this, ret, first, last, base, state, pval);
6725 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAM@Z */
6726 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAM@Z */
6727 #if _MSVCP_VER <= 100
6728 #define call_num_get_char_do_get_float(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_char*, \
6729 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, float*), \
6730 (this, ret, first, last, base, state, pval))
6731 #else
6732 #define call_num_get_char_do_get_float(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_char*, \
6733 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, float*), \
6734 (this, ret, first, last, base, state, pval))
6735 #endif
6736 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_float,36)
6737 istreambuf_iterator_char *__thiscall num_get_char_do_get_float(const num_get *this, istreambuf_iterator_char *ret,
6738 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, float *pval)
6740 float v;
6741 char tmp[32], *end;
6742 int err;
6744 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6746 v = _Stofx(tmp, &end, num_get_char__Getffld(this, tmp, &first, &last, IOS_LOCALE(base)), &err);
6747 if(end!=tmp && !err)
6748 *pval = v;
6749 else
6750 *state |= IOSTATE_failbit;
6752 if(!first.strbuf)
6753 *state |= IOSTATE_eofbit;
6755 *ret = first;
6756 return ret;
6759 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAM@Z */
6760 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAM@Z */
6761 DEFINE_THISCALL_WRAPPER(num_get_char_get_float,36)
6762 istreambuf_iterator_char *__thiscall num_get_char_get_float(const num_get *this, istreambuf_iterator_char *ret,
6763 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, float *pval)
6765 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6766 return call_num_get_char_do_get_float(this, ret, first, last, base, state, pval);
6769 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAA_K@Z */
6770 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEA_K@Z */
6771 #if _MSVCP_VER <= 100
6772 #define call_num_get_char_do_get_uint64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_char*, \
6773 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, ULONGLONG*), \
6774 (this, ret, first, last, base, state, pval))
6775 #else
6776 #define call_num_get_char_do_get_uint64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_char*, \
6777 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, ULONGLONG*), \
6778 (this, ret, first, last, base, state, pval))
6779 #endif
6780 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_uint64,36)
6781 istreambuf_iterator_char *__thiscall num_get_char_do_get_uint64(const num_get *this, istreambuf_iterator_char *ret,
6782 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONGLONG *pval)
6784 unsigned __int64 v;
6785 char tmp[25], *end;
6786 int err;
6788 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6790 v = _Stoullx(tmp, &end, num_get_char__Getifld(this, tmp,
6791 &first, &last, base->fmtfl, IOS_LOCALE(base)), &err);
6792 if(end!=tmp && !err)
6793 *pval = v;
6794 else
6795 *state |= IOSTATE_failbit;
6797 if(!first.strbuf)
6798 *state |= IOSTATE_eofbit;
6800 *ret = first;
6801 return ret;
6804 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAA_K@Z */
6805 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEA_K@Z */
6806 DEFINE_THISCALL_WRAPPER(num_get_char_get_uint64,36)
6807 istreambuf_iterator_char *__thiscall num_get_char_get_uint64(const num_get *this, istreambuf_iterator_char *ret,
6808 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONGLONG *pval)
6810 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6811 return call_num_get_char_do_get_uint64(this, ret, first, last, base, state, pval);
6814 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAA_J@Z */
6815 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEA_J@Z */
6816 #if _MSVCP_VER <= 100
6817 #define call_num_get_char_do_get_int64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_char*, \
6818 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, LONGLONG*), \
6819 (this, ret, first, last, base, state, pval))
6820 #else
6821 #define call_num_get_char_do_get_int64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_char*, \
6822 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, LONGLONG*), \
6823 (this, ret, first, last, base, state, pval))
6824 #endif
6825 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_int64,36)
6826 istreambuf_iterator_char *__thiscall num_get_char_do_get_int64(const num_get *this, istreambuf_iterator_char *ret,
6827 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONGLONG *pval)
6829 __int64 v;
6830 char tmp[25], *end;
6831 int err;
6833 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6835 v = _Stollx(tmp, &end, num_get_char__Getifld(this, tmp,
6836 &first, &last, base->fmtfl, IOS_LOCALE(base)), &err);
6837 if(end!=tmp && !err)
6838 *pval = v;
6839 else
6840 *state |= IOSTATE_failbit;
6842 if(!first.strbuf)
6843 *state |= IOSTATE_eofbit;
6845 *ret = first;
6846 return ret;
6849 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAA_J@Z */
6850 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEA_J@Z */
6851 DEFINE_THISCALL_WRAPPER(num_get_char_get_int64,36)
6852 istreambuf_iterator_char *__thiscall num_get_char_get_int64(const num_get *this, istreambuf_iterator_char *ret,
6853 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONGLONG *pval)
6855 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6856 return call_num_get_char_do_get_int64(this, ret, first, last, base, state, pval);
6859 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAK@Z */
6860 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAK@Z */
6861 #if _MSVCP_VER <= 100
6862 #define call_num_get_char_do_get_ulong(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_char*, \
6863 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, ULONG*), \
6864 (this, ret, first, last, base, state, pval))
6865 #else
6866 #define call_num_get_char_do_get_ulong(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 36, istreambuf_iterator_char*, \
6867 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, ULONG*), \
6868 (this, ret, first, last, base, state, pval))
6869 #endif
6870 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_ulong,36)
6871 istreambuf_iterator_char *__thiscall num_get_char_do_get_ulong(const num_get *this, istreambuf_iterator_char *ret,
6872 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONG *pval)
6874 ULONG v;
6875 char tmp[25], *end;
6876 int err;
6878 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6880 v = _Stoulx(tmp, &end, num_get_char__Getifld(this, tmp,
6881 &first, &last, base->fmtfl, IOS_LOCALE(base)), &err);
6882 if(end!=tmp && !err)
6883 *pval = v;
6884 else
6885 *state |= IOSTATE_failbit;
6887 if(!first.strbuf)
6888 *state |= IOSTATE_eofbit;
6890 *ret = first;
6891 return ret;
6894 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAK@Z */
6895 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAK@Z */
6896 DEFINE_THISCALL_WRAPPER(num_get_char_get_ulong,36)
6897 istreambuf_iterator_char *__thiscall num_get_char_get_ulong(const num_get *this, istreambuf_iterator_char *ret,
6898 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONG *pval)
6900 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6901 return call_num_get_char_do_get_ulong(this, ret, first, last, base, state, pval);
6904 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z */
6905 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAJ@Z */
6906 #if _MSVCP_VER <= 100
6907 #define call_num_get_char_do_get_long(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_char*, \
6908 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, LONG*), \
6909 (this, ret, first, last, base, state, pval))
6910 #else
6911 #define call_num_get_char_do_get_long(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 40, istreambuf_iterator_char*, \
6912 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, LONG*), \
6913 (this, ret, first, last, base, state, pval))
6914 #endif
6915 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_long,36)
6916 istreambuf_iterator_char *__thiscall num_get_char_do_get_long(const num_get *this, istreambuf_iterator_char *ret,
6917 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONG *pval)
6919 LONG v;
6920 char tmp[25], *end;
6921 int err;
6923 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6925 v = _Stolx(tmp, &end, num_get_char__Getifld(this, tmp,
6926 &first, &last, base->fmtfl, IOS_LOCALE(base)), &err);
6927 if(end!=tmp && !err)
6928 *pval = v;
6929 else
6930 *state |= IOSTATE_failbit;
6932 if(!first.strbuf)
6933 *state |= IOSTATE_eofbit;
6935 *ret = first;
6936 return ret;
6939 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAJ@Z */
6940 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAJ@Z */
6941 DEFINE_THISCALL_WRAPPER(num_get_char_get_long,36)
6942 istreambuf_iterator_char *__thiscall num_get_char_get_long(const num_get *this, istreambuf_iterator_char *ret,
6943 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONG *pval)
6945 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6946 return call_num_get_char_do_get_long(this, ret, first, last, base, state, pval);
6949 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAI@Z */
6950 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAI@Z */
6951 #if _MSVCP_VER <= 100
6952 #define call_num_get_char_do_get_uint(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 36, istreambuf_iterator_char*, \
6953 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, unsigned int*), \
6954 (this, ret, first, last, base, state, pval))
6955 #else
6956 #define call_num_get_char_do_get_uint(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 44, istreambuf_iterator_char*, \
6957 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, unsigned int*), \
6958 (this, ret, first, last, base, state, pval))
6959 #endif
6960 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_uint,36)
6961 istreambuf_iterator_char *__thiscall num_get_char_do_get_uint(const num_get *this, istreambuf_iterator_char *ret,
6962 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned int *pval)
6964 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6965 return num_get_char_do_get_ulong(this, ret, first, last, base, state, pval);
6968 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAI@Z */
6969 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAI@Z */
6970 DEFINE_THISCALL_WRAPPER(num_get_char_get_uint,36)
6971 istreambuf_iterator_char *__thiscall num_get_char_get_uint(const num_get *this, istreambuf_iterator_char *ret,
6972 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned int *pval)
6974 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6975 return call_num_get_char_do_get_uint(this, ret, first, last, base, state, pval);
6978 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAG@Z */
6979 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAG@Z */
6980 #if _MSVCP_VER <= 100
6981 #define call_num_get_char_do_get_ushort(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 40, istreambuf_iterator_char*, \
6982 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, unsigned short*), \
6983 (this, ret, first, last, base, state, pval))
6984 #else
6985 #define call_num_get_char_do_get_ushort(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 48, istreambuf_iterator_char*, \
6986 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, unsigned short*), \
6987 (this, ret, first, last, base, state, pval))
6988 #endif
6989 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_ushort,36)
6990 istreambuf_iterator_char *__thiscall num_get_char_do_get_ushort(const num_get *this, istreambuf_iterator_char *ret,
6991 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned short *pval)
6993 ULONG v;
6994 char tmp[25], *beg, *end;
6995 int err, b;
6997 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6999 b = num_get_char__Getifld(this, tmp,
7000 &first, &last, base->fmtfl, IOS_LOCALE(base));
7001 beg = tmp + (tmp[0]=='-' ? 1 : 0);
7002 v = _Stoulx(beg, &end, b, &err);
7004 if(v != (ULONG)((unsigned short)v))
7005 *state |= IOSTATE_failbit;
7006 else if(end!=beg && !err)
7007 *pval = (tmp[0]=='-' ? -((unsigned short)v) : v);
7008 else
7009 *state |= IOSTATE_failbit;
7011 if(!first.strbuf)
7012 *state |= IOSTATE_eofbit;
7014 *ret = first;
7015 return ret;
7018 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAAG@Z */
7019 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEAG@Z */
7020 DEFINE_THISCALL_WRAPPER(num_get_char_get_ushort,36)
7021 istreambuf_iterator_char *__thiscall num_get_char_get_ushort(const num_get *this, istreambuf_iterator_char *ret,
7022 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned short *pval)
7024 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
7025 return call_num_get_char_do_get_ushort(this, ret, first, last, base, state, pval);
7028 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAA_N@Z */
7029 /* ?do_get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEA_N@Z */
7030 #if _MSVCP_VER <= 100
7031 #define call_num_get_char_do_get_bool(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 44, istreambuf_iterator_char*, \
7032 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, MSVCP_bool*), \
7033 (this, ret, first, last, base, state, pval))
7034 #else
7035 #define call_num_get_char_do_get_bool(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 52, istreambuf_iterator_char*, \
7036 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, MSVCP_bool*), \
7037 (this, ret, first, last, base, state, pval))
7038 #endif
7039 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_bool,36)
7040 istreambuf_iterator_char *__thiscall num_get_char_do_get_bool(const num_get *this, istreambuf_iterator_char *ret,
7041 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, MSVCP_bool *pval)
7043 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
7045 if(base->fmtfl & FMTFLAG_boolalpha) {
7046 numpunct_char *numpunct = numpunct_char_use_facet(IOS_LOCALE(base));
7047 basic_string_char false_bstr, true_bstr;
7048 const char *pfalse, *ptrue;
7050 numpunct_char_falsename(numpunct, &false_bstr);
7051 numpunct_char_truename(numpunct, &true_bstr);
7052 pfalse = MSVCP_basic_string_char_c_str(&false_bstr);
7053 ptrue = MSVCP_basic_string_char_c_str(&true_bstr);
7055 for(istreambuf_iterator_char_val(&first); first.strbuf;) {
7056 if(pfalse && *pfalse && first.val!=*pfalse)
7057 pfalse = NULL;
7058 if(ptrue && *ptrue && first.val!=*ptrue)
7059 ptrue = NULL;
7061 if(pfalse && *pfalse && ptrue && !*ptrue)
7062 ptrue = NULL;
7063 if(ptrue && *ptrue && pfalse && !*pfalse)
7064 pfalse = NULL;
7066 if(pfalse)
7067 pfalse++;
7068 if(ptrue)
7069 ptrue++;
7071 if(pfalse || ptrue)
7072 istreambuf_iterator_char_inc(&first);
7074 if((!pfalse || !*pfalse) && (!ptrue || !*ptrue))
7075 break;
7078 if(ptrue)
7079 *pval = TRUE;
7080 else if(pfalse)
7081 *pval = FALSE;
7082 else
7083 *state |= IOSTATE_failbit;
7085 MSVCP_basic_string_char_dtor(&false_bstr);
7086 MSVCP_basic_string_char_dtor(&true_bstr);
7087 }else {
7088 char tmp[25], *end;
7089 int err;
7090 LONG v = _Stolx(tmp, &end, num_get_char__Getifld(this, tmp,
7091 &first, &last, base->fmtfl, IOS_LOCALE(base)), &err);
7093 if(end!=tmp && err==0 && (v==0 || v==1))
7094 *pval = v;
7095 else
7096 *state |= IOSTATE_failbit;
7099 if(!first.strbuf)
7100 *state |= IOSTATE_eofbit;
7101 memcpy(ret, &first, sizeof(first));
7102 return ret;
7105 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHAA_N@Z */
7106 /* ?get@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHAEA_N@Z */
7107 DEFINE_THISCALL_WRAPPER(num_get_char_get_bool,36)
7108 istreambuf_iterator_char *__thiscall num_get_char_get_bool(const num_get *this, istreambuf_iterator_char *ret,
7109 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, MSVCP_bool *pval)
7111 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
7112 return call_num_get_char_do_get_bool(this, ret, first, last, base, state, pval);
7115 /* ?id@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A */
7116 locale_id num_put_char_id = {0};
7118 /* num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@6B@ */
7119 extern const vtable_ptr MSVCP_num_put_char_vtable;
7121 /* ?_Init@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
7122 /* ?_Init@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
7123 DEFINE_THISCALL_WRAPPER(num_put_char__Init, 8)
7124 void __thiscall num_put_char__Init(num_put *this, const _Locinfo *locinfo)
7126 TRACE("(%p %p)\n", this, locinfo);
7127 #if _MSVCP_VER < 110
7128 _Locinfo__Getcvt(locinfo, &this->cvt);
7129 #endif
7132 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
7133 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
7134 DEFINE_THISCALL_WRAPPER(num_put_char_ctor_locinfo, 12)
7135 num_put* __thiscall num_put_char_ctor_locinfo(num_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
7137 TRACE("(%p %p %ld)\n", this, locinfo, refs);
7139 locale_facet_ctor_refs(&this->facet, refs);
7140 this->facet.vtable = &MSVCP_num_put_char_vtable;
7142 num_put_char__Init(this, locinfo);
7143 return this;
7146 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */
7147 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */
7148 DEFINE_THISCALL_WRAPPER(num_put_char_ctor_refs, 8)
7149 num_put* __thiscall num_put_char_ctor_refs(num_put *this, MSVCP_size_t refs)
7151 _Locinfo locinfo;
7153 TRACE("(%p %lu)\n", this, refs);
7155 _Locinfo_ctor(&locinfo);
7156 num_put_char_ctor_locinfo(this, &locinfo, refs);
7157 _Locinfo_dtor(&locinfo);
7158 return this;
7161 /* ??_F?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */
7162 /* ??_F?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAAXXZ */
7163 DEFINE_THISCALL_WRAPPER(num_put_char_ctor, 4)
7164 num_put* __thiscall num_put_char_ctor(num_put *this)
7166 return num_put_char_ctor_refs(this, 0);
7169 /* ??1?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@UAE@XZ */
7170 /* ??1?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@UEAA@XZ */
7171 /* ??1?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */
7172 /* ??1?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEAA@XZ */
7173 DEFINE_THISCALL_WRAPPER(num_put_char_dtor, 4)
7174 void __thiscall num_put_char_dtor(num_put *this)
7176 TRACE("(%p)\n", this);
7177 locale_facet_dtor(&this->facet);
7180 DEFINE_THISCALL_WRAPPER(num_put_char_vector_dtor, 8)
7181 num_put* __thiscall num_put_char_vector_dtor(num_put *this, unsigned int flags)
7183 TRACE("(%p %x)\n", this, flags);
7184 if(flags & 2) {
7185 /* we have an array, with the number of elements stored before the first object */
7186 INT_PTR i, *ptr = (INT_PTR *)this-1;
7188 for(i=*ptr-1; i>=0; i--)
7189 num_put_char_dtor(this+i);
7190 MSVCRT_operator_delete(ptr);
7191 } else {
7192 num_put_char_dtor(this);
7193 if(flags & 1)
7194 MSVCRT_operator_delete(this);
7197 return this;
7200 /* ?_Getcat@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
7201 /* ?_Getcat@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
7202 MSVCP_size_t __cdecl num_put_char__Getcat(const locale_facet **facet, const locale *loc)
7204 TRACE("(%p %p)\n", facet, loc);
7206 if(facet && !*facet) {
7207 _Locinfo locinfo;
7209 *facet = MSVCRT_operator_new(sizeof(num_put));
7210 if(!*facet) {
7211 ERR("Out of memory\n");
7212 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7213 return 0;
7216 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
7217 num_put_char_ctor_locinfo((num_put*)*facet, &locinfo, 0);
7218 _Locinfo_dtor(&locinfo);
7221 return LC_NUMERIC;
7224 /* ?_Getcat@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
7225 /* ?_Getcat@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
7226 MSVCP_size_t __cdecl num_put_char__Getcat_old(const locale_facet **facet)
7228 return num_put_char__Getcat(facet, locale_classic());
7231 num_put* num_put_char_use_facet(const locale *loc)
7233 static num_put *obj = NULL;
7235 _Lockit lock;
7236 const locale_facet *fac;
7238 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
7239 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_put_char_id));
7240 if(fac) {
7241 _Lockit_dtor(&lock);
7242 return (num_put*)fac;
7245 if(obj) {
7246 _Lockit_dtor(&lock);
7247 return obj;
7250 num_put_char__Getcat(&fac, loc);
7251 obj = (num_put*)fac;
7252 call_locale_facet__Incref(&obj->facet);
7253 locale_facet_register(&obj->facet);
7254 _Lockit_dtor(&lock);
7256 return obj;
7259 /* ?_Put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@PBDI@Z */
7260 /* ?_Put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@PEBD_K@Z */
7261 ostreambuf_iterator_char* __cdecl num_put_char__Put(const num_put *this, ostreambuf_iterator_char *ret,
7262 ostreambuf_iterator_char dest, const char *ptr, MSVCP_size_t count)
7264 TRACE("(%p %p %p %ld)\n", this, ret, ptr, count);
7266 for(; count>0; count--)
7267 ostreambuf_iterator_char_put(&dest, *ptr++);
7269 *ret = dest;
7270 return ret;
7273 /* ?_Putc@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@PBDI@Z */
7274 /* ?_Putc@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@PEBD_K@Z */
7275 ostreambuf_iterator_char* __cdecl num_put_char__Putc(const num_put *this, ostreambuf_iterator_char *ret,
7276 ostreambuf_iterator_char dest, const char *ptr, MSVCP_size_t count)
7278 TRACE("(%p %p %p %ld)\n", this, ret, ptr, count);
7280 for(; count>0; count--)
7281 ostreambuf_iterator_char_put(&dest, *ptr++);
7283 *ret = dest;
7284 return ret;
7287 /* ?_Putgrouped@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@PBDID@Z */
7288 /* ?_Putgrouped@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@PEBD_KD@Z */
7289 ostreambuf_iterator_char* __cdecl num_put_char__Putgrouped(const num_put *this, ostreambuf_iterator_char *ret,
7290 ostreambuf_iterator_char dest, const char *ptr, MSVCP_size_t count, char delim)
7292 FIXME("(%p %p %p %ld %d) stub\n", this, ret, ptr, count, delim);
7293 return NULL;
7296 /* ?_Rep@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@DI@Z */
7297 /* ?_Rep@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@D_K@Z */
7298 ostreambuf_iterator_char* __cdecl num_put_char__Rep(const num_put *this, ostreambuf_iterator_char *ret,
7299 ostreambuf_iterator_char dest, char c, MSVCP_size_t count)
7301 TRACE("(%p %p %d %ld)\n", this, ret, c, count);
7303 for(; count>0; count--)
7304 ostreambuf_iterator_char_put(&dest, c);
7306 *ret = dest;
7307 return ret;
7310 /* ?_Ffmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAPADPADDH@Z */
7311 /* ?_Ffmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAPEADPEADDH@Z */
7312 char* __cdecl num_put_char__Ffmt(const num_put *this, char *fmt, char spec, int fmtfl)
7314 int type = fmtfl & FMTFLAG_floatfield;
7315 char *p = fmt;
7317 TRACE("(%p %p %d %d)\n", this, fmt, spec, fmtfl);
7319 *p++ = '%';
7320 if(fmtfl & FMTFLAG_showpos)
7321 *p++ = '+';
7322 if(fmtfl & FMTFLAG_showpoint)
7323 *p++ = '#';
7324 *p++ = '.';
7325 *p++ = '*';
7326 if(spec)
7327 *p++ = spec;
7329 if(type == FMTFLAG_fixed)
7330 *p++ = 'f';
7331 else if(type == FMTFLAG_scientific)
7332 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'E' : 'e';
7333 else if(type == (FMTFLAG_fixed|FMTFLAG_scientific))
7334 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'A' : 'a';
7335 else
7336 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'G' : 'g';
7338 *p++ = '\0';
7339 return fmt;
7342 /* ?_Fput@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPBDIIII@Z */
7343 /* ?_Fput@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEBD_K333@Z */
7344 ostreambuf_iterator_char* __cdecl num_put_char__Fput(const num_put *this, ostreambuf_iterator_char *ret,
7345 ostreambuf_iterator_char dest, ios_base *base, char fill, const char *buf, MSVCP_size_t bef_point,
7346 MSVCP_size_t aft_point, MSVCP_size_t trailing, MSVCP_size_t count)
7348 FIXME("(%p %p %p %d %p %ld %ld %ld %ld) stub\n", this, ret, base,
7349 fill, buf, bef_point, aft_point, trailing, count);
7350 return NULL;
7353 /* TODO: This function should be removed when num_put_char__Fput is implemented */
7354 static ostreambuf_iterator_char* num_put_char_fput(const num_put *this, ostreambuf_iterator_char *ret,
7355 ostreambuf_iterator_char dest, ios_base *base, char fill, char *buf, MSVCP_size_t count)
7357 numpunct_char *numpunct = numpunct_char_use_facet(IOS_LOCALE(base));
7358 basic_string_char grouping_bstr;
7359 const char *grouping;
7360 char *p, sep = 0, dec_point = *localeconv()->decimal_point;
7361 int cur_group = 0, group_size = 0;
7362 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
7363 MSVCP_size_t pad;
7365 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
7367 /* Change decimal point */
7368 for(p=buf; p<buf+count; p++) {
7369 if(*p == dec_point) {
7370 *p = numpunct_char_decimal_point(numpunct);
7371 break;
7374 p--;
7376 /* Add separators to number */
7377 numpunct_char_grouping(numpunct, &grouping_bstr);
7378 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
7379 #if _MSVCP_VER >= 70
7380 if (grouping[0]) sep = numpunct_char_thousands_sep(numpunct);
7381 #endif
7383 for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
7384 group_size++;
7385 if(group_size == grouping[cur_group]) {
7386 group_size = 0;
7387 if(grouping[cur_group+1])
7388 cur_group++;
7390 memmove(p+1, p, buf+count-p);
7391 *p = sep;
7392 count++;
7395 MSVCP_basic_string_char_dtor(&grouping_bstr);
7397 /* Display number with padding */
7398 if(count >= base->wide)
7399 pad = 0;
7400 else
7401 pad = base->wide-count;
7402 base->wide = 0;
7404 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
7405 num_put_char__Putc(this, &dest, dest, buf, 1);
7406 buf++;
7408 if(adjustfield != FMTFLAG_left) {
7409 num_put_char__Rep(this, ret, dest, fill, pad);
7410 pad = 0;
7412 num_put_char__Putc(this, &dest, dest, buf, count);
7413 return num_put_char__Rep(this, ret, dest, fill, pad);
7416 /* ?_Ifmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAPADPADPBDH@Z */
7417 /* ?_Ifmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAPEADPEADPEBDH@Z */
7418 char* __cdecl num_put_char__Ifmt(const num_put *this, char *fmt, const char *spec, int fmtfl)
7420 int base = fmtfl & FMTFLAG_basefield;
7421 char *p = fmt;
7423 TRACE("(%p %p %p %d)\n", this, fmt, spec, fmtfl);
7425 *p++ = '%';
7426 if(fmtfl & FMTFLAG_showpos)
7427 *p++ = '+';
7428 if(fmtfl & FMTFLAG_showbase)
7429 *p++ = '#';
7431 *p++ = *spec++;
7432 if(*spec == 'l')
7433 *p++ = *spec++;
7435 if(base == FMTFLAG_oct)
7436 *p++ = 'o';
7437 else if(base == FMTFLAG_hex)
7438 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'X' : 'x';
7439 else
7440 *p++ = *spec;
7442 *p++ = '\0';
7443 return fmt;
7446 /* ?_Iput@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPADI@Z */
7447 /* ?_Iput@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEAD_K@Z */
7448 ostreambuf_iterator_char* __cdecl num_put_char__Iput(const num_put *this, ostreambuf_iterator_char *ret,
7449 ostreambuf_iterator_char dest, ios_base *base, char fill, char *buf, MSVCP_size_t count)
7451 numpunct_char *numpunct = numpunct_char_use_facet(IOS_LOCALE(base));
7452 basic_string_char grouping_bstr;
7453 const char *grouping;
7454 char *p, sep = 0;
7455 int cur_group = 0, group_size = 0;
7456 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
7457 MSVCP_size_t pad;
7459 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
7461 /* Add separators to number */
7462 numpunct_char_grouping(numpunct, &grouping_bstr);
7463 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
7464 #if _MSVCP_VER >= 70
7465 if (grouping[0]) sep = numpunct_char_thousands_sep(numpunct);
7466 #endif
7468 for(p=buf+count-1; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
7469 group_size++;
7470 if(group_size == grouping[cur_group]) {
7471 group_size = 0;
7472 if(grouping[cur_group+1])
7473 cur_group++;
7475 memmove(p+1, p, buf+count-p);
7476 *p = sep;
7477 count++;
7480 MSVCP_basic_string_char_dtor(&grouping_bstr);
7482 /* Display number with padding */
7483 if(count >= base->wide)
7484 pad = 0;
7485 else
7486 pad = base->wide-count;
7487 base->wide = 0;
7489 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
7490 num_put_char__Putc(this, &dest, dest, buf, 1);
7491 buf++;
7492 }else if((adjustfield & FMTFLAG_internal) && (buf[1]=='x' || buf[1]=='X')) {
7493 num_put_char__Putc(this, &dest, dest, buf, 2);
7494 buf += 2;
7496 if(adjustfield != FMTFLAG_left) {
7497 num_put_char__Rep(this, ret, dest, fill, pad);
7498 pad = 0;
7500 num_put_char__Putc(this, &dest, dest, buf, count);
7501 return num_put_char__Rep(this, ret, dest, fill, pad);
7504 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DJ@Z */
7505 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DJ@Z */
7506 #if _MSVCP_VER <= 100
7507 #define call_num_put_char_do_put_long(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 28, ostreambuf_iterator_char*, \
7508 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, LONG), \
7509 (this, ret, dest, base, fill, v))
7510 #else
7511 #define call_num_put_char_do_put_long(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 36, ostreambuf_iterator_char*, \
7512 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, LONG), \
7513 (this, ret, dest, base, fill, v))
7514 #endif
7515 #if _MSVCP_VER != 80
7516 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_long, 28)
7517 #else
7518 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_long, 32)
7519 #endif
7520 ostreambuf_iterator_char* __thiscall num_put_char_do_put_long(const num_put *this, ostreambuf_iterator_char *ret,
7521 ostreambuf_iterator_char dest, ios_base *base, char fill, LONG v)
7523 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7524 char fmt[7]; /* strlen("%+#lld")+1 */
7526 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7528 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
7529 sprintf(tmp, num_put_char__Ifmt(this, fmt, "ld", base->fmtfl), v));
7532 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DJ@Z */
7533 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DJ@Z */
7534 #if _MSVCP_VER != 80
7535 DEFINE_THISCALL_WRAPPER(num_put_char_put_long, 28)
7536 #else
7537 DEFINE_THISCALL_WRAPPER(num_put_char_put_long, 32)
7538 #endif
7539 ostreambuf_iterator_char* __thiscall num_put_char_put_long(const num_put *this, ostreambuf_iterator_char *ret,
7540 ostreambuf_iterator_char dest, ios_base *base, char fill, LONG v)
7542 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7543 return call_num_put_char_do_put_long(this, ret, dest, base, fill, v);
7546 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DK@Z */
7547 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DK@Z */
7548 #if _MSVCP_VER <= 100
7549 #define call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 24, ostreambuf_iterator_char*, \
7550 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, ULONG), \
7551 (this, ret, dest, base, fill, v))
7552 #else
7553 #define call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 32, ostreambuf_iterator_char*, \
7554 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, ULONG), \
7555 (this, ret, dest, base, fill, v))
7556 #endif
7557 #if _MSVCP_VER != 80
7558 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_ulong, 28)
7559 #else
7560 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_ulong, 32)
7561 #endif
7562 ostreambuf_iterator_char* __thiscall num_put_char_do_put_ulong(const num_put *this, ostreambuf_iterator_char *ret,
7563 ostreambuf_iterator_char dest, ios_base *base, char fill, ULONG v)
7565 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7566 char fmt[7]; /* strlen("%+#lld")+1 */
7568 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7570 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
7571 sprintf(tmp, num_put_char__Ifmt(this, fmt, "lu", base->fmtfl), v));
7574 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DK@Z */
7575 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DK@Z */
7576 #if _MSVCP_VER != 80
7577 DEFINE_THISCALL_WRAPPER(num_put_char_put_ulong, 28)
7578 #else
7579 DEFINE_THISCALL_WRAPPER(num_put_char_put_ulong, 32)
7580 #endif
7581 ostreambuf_iterator_char* __thiscall num_put_char_put_ulong(const num_put *this, ostreambuf_iterator_char *ret,
7582 ostreambuf_iterator_char dest, ios_base *base, char fill, ULONG v)
7584 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7585 return call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v);
7588 static inline unsigned get_precision(const ios_base *base)
7590 streamsize ret = base->prec <= 0 && !(base->fmtfl & FMTFLAG_fixed) ? 6 : base->prec;
7591 if(ret > UINT_MAX)
7592 ret = UINT_MAX;
7593 return ret;
7596 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DN@Z */
7597 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DN@Z */
7598 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DO@Z */
7599 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DO@Z */
7600 #if _MSVCP_VER <= 100
7601 #define call_num_put_char_do_put_double(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_char*, \
7602 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, double), \
7603 (this, ret, dest, base, fill, v))
7604 #define call_num_put_char_do_put_ldouble(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 8, ostreambuf_iterator_char*, \
7605 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, double), \
7606 (this, ret, dest, base, fill, v))
7607 #else
7608 #define call_num_put_char_do_put_double(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 20, ostreambuf_iterator_char*, \
7609 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, double), \
7610 (this, ret, dest, base, fill, v))
7611 #define call_num_put_char_do_put_ldouble(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 16, ostreambuf_iterator_char*, \
7612 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, double), \
7613 (this, ret, dest, base, fill, v))
7614 #endif
7615 #if _MSVCP_VER != 80
7616 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_double, 32)
7617 #else
7618 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_double, 36)
7619 #endif
7620 ostreambuf_iterator_char* __thiscall num_put_char_do_put_double(const num_put *this, ostreambuf_iterator_char *ret,
7621 ostreambuf_iterator_char dest, ios_base *base, char fill, double v)
7623 char *tmp;
7624 char fmt[8]; /* strlen("%+#.*lg")+1 */
7625 int size;
7626 unsigned prec;
7628 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
7630 num_put_char__Ffmt(this, fmt, '\0', base->fmtfl);
7631 prec = get_precision(base);
7632 size = _scprintf(fmt, prec, v);
7634 /* TODO: don't use dynamic allocation */
7635 tmp = MSVCRT_operator_new(size*2);
7636 if(!tmp) {
7637 ERR("Out of memory\n");
7638 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7640 num_put_char_fput(this, ret, dest, base, fill, tmp, sprintf(tmp, fmt, prec, v));
7641 MSVCRT_operator_delete(tmp);
7642 return ret;
7645 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DN@Z */
7646 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DN@Z */
7647 #if _MSVCP_VER != 80
7648 DEFINE_THISCALL_WRAPPER(num_put_char_put_double, 32)
7649 #else
7650 DEFINE_THISCALL_WRAPPER(num_put_char_put_double, 36)
7651 #endif
7652 ostreambuf_iterator_char* __thiscall num_put_char_put_double(const num_put *this, ostreambuf_iterator_char *ret,
7653 ostreambuf_iterator_char dest, ios_base *base, char fill, double v)
7655 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
7656 return call_num_put_char_do_put_double(this, ret, dest, base, fill, v);
7659 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DO@Z */
7660 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DO@Z */
7661 #if _MSVCP_VER != 80
7662 DEFINE_THISCALL_WRAPPER(num_put_char_put_ldouble, 32)
7663 #else
7664 DEFINE_THISCALL_WRAPPER(num_put_char_put_ldouble, 36)
7665 #endif
7666 ostreambuf_iterator_char* __thiscall num_put_char_put_ldouble(const num_put *this, ostreambuf_iterator_char *ret,
7667 ostreambuf_iterator_char dest, ios_base *base, char fill, double v)
7669 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
7670 return call_num_put_char_do_put_ldouble(this, ret, dest, base, fill, v);
7673 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPBX@Z */
7674 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEBX@Z */
7675 #if _MSVCP_VER <= 100
7676 #define call_num_put_char_do_put_ptr(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_char*, \
7677 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, const void*), \
7678 (this, ret, dest, base, fill, v))
7679 #else
7680 #define call_num_put_char_do_put_ptr(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_char*, \
7681 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, const void*), \
7682 (this, ret, dest, base, fill, v))
7683 #endif
7684 #if _MSVCP_VER != 80
7685 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_ptr, 28)
7686 #else
7687 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_ptr, 32)
7688 #endif
7689 ostreambuf_iterator_char* __thiscall num_put_char_do_put_ptr(const num_put *this, ostreambuf_iterator_char *ret,
7690 ostreambuf_iterator_char dest, ios_base *base, char fill, const void *v)
7692 char tmp[17]; /* 8(16^8==2^64)*2(separators beetwen every digit) + 1 */
7694 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
7696 return num_put_char__Iput(this, ret, dest, base, fill, tmp, sprintf(tmp, "%p", v));
7699 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPBX@Z */
7700 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEBX@Z */
7701 #if _MSVCP_VER != 80
7702 DEFINE_THISCALL_WRAPPER(num_put_char_put_ptr, 28)
7703 #else
7704 DEFINE_THISCALL_WRAPPER(num_put_char_put_ptr, 32)
7705 #endif
7706 ostreambuf_iterator_char* __thiscall num_put_char_put_ptr(const num_put *this, ostreambuf_iterator_char *ret,
7707 ostreambuf_iterator_char dest, ios_base *base, char fill, const void *v)
7709 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
7710 return call_num_put_char_do_put_ptr(this, ret, dest, base, fill, v);
7713 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_J@Z */
7714 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@D_J@Z */
7715 #if _MSVCP_VER <= 100
7716 #define call_num_put_char_do_put_int64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 20, ostreambuf_iterator_char*, \
7717 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, __int64), \
7718 (this, ret, dest, base, fill, v))
7719 #else
7720 #define call_num_put_char_do_put_int64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 28, ostreambuf_iterator_char*, \
7721 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, __int64), \
7722 (this, ret, dest, base, fill, v))
7723 #endif
7724 #if _MSVCP_VER != 80
7725 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_int64, 32)
7726 #else
7727 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_int64, 36)
7728 #endif
7729 ostreambuf_iterator_char* __thiscall num_put_char_do_put_int64(const num_put *this, ostreambuf_iterator_char *ret,
7730 ostreambuf_iterator_char dest, ios_base *base, char fill, __int64 v)
7732 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7733 char fmt[7]; /* strlen("%+#lld")+1 */
7735 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7737 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
7738 sprintf(tmp, num_put_char__Ifmt(this, fmt, "lld", base->fmtfl), v));
7741 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_J@Z */
7742 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@D_J@Z */
7743 #if _MSVCP_VER != 80
7744 DEFINE_THISCALL_WRAPPER(num_put_char_put_int64, 32)
7745 #else
7746 DEFINE_THISCALL_WRAPPER(num_put_char_put_int64, 36)
7747 #endif
7748 ostreambuf_iterator_char* __thiscall num_put_char_put_int64(const num_put *this, ostreambuf_iterator_char *ret,
7749 ostreambuf_iterator_char dest, ios_base *base, char fill, __int64 v)
7751 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7752 return call_num_put_char_do_put_int64(this, ret, dest, base, fill, v);
7755 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_K@Z */
7756 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@D_K@Z */
7757 #if _MSVCP_VER <= 100
7758 #define call_num_put_char_do_put_uint64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 16, ostreambuf_iterator_char*, \
7759 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, unsigned __int64), \
7760 (this, ret, dest, base, fill, v))
7761 #else
7762 #define call_num_put_char_do_put_uint64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 24, ostreambuf_iterator_char*, \
7763 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, unsigned __int64), \
7764 (this, ret, dest, base, fill, v))
7765 #endif
7766 #if _MSVCP_VER != 80
7767 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_uint64, 32)
7768 #else
7769 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_uint64, 36)
7770 #endif
7771 ostreambuf_iterator_char* __thiscall num_put_char_do_put_uint64(const num_put *this, ostreambuf_iterator_char *ret,
7772 ostreambuf_iterator_char dest, ios_base *base, char fill, unsigned __int64 v)
7774 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7775 char fmt[7]; /* strlen("%+#lld")+1 */
7777 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7779 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
7780 sprintf(tmp, num_put_char__Ifmt(this, fmt, "llu", base->fmtfl), v));
7783 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_K@Z */
7784 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@D_K@Z */
7785 #if _MSVCP_VER != 80
7786 DEFINE_THISCALL_WRAPPER(num_put_char_put_uint64, 32)
7787 #else
7788 DEFINE_THISCALL_WRAPPER(num_put_char_put_uint64, 36)
7789 #endif
7790 ostreambuf_iterator_char* __thiscall num_put_char_put_uint64(const num_put *this, ostreambuf_iterator_char *ret,
7791 ostreambuf_iterator_char dest, ios_base *base, char fill, unsigned __int64 v)
7793 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7794 return call_num_put_char_do_put_uint64(this, ret, dest, base, fill, v);
7797 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_N@Z */
7798 /* ?do_put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@D_N@Z */
7799 #if _MSVCP_VER <= 100
7800 #define call_num_put_char_do_put_bool(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 32, ostreambuf_iterator_char*, \
7801 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, MSVCP_bool), \
7802 (this, ret, dest, base, fill, v))
7803 #else
7804 #define call_num_put_char_do_put_bool(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 40, ostreambuf_iterator_char*, \
7805 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, MSVCP_bool), \
7806 (this, ret, dest, base, fill, v))
7807 #endif
7808 #if _MSVCP_VER != 80
7809 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_bool, 28)
7810 #else
7811 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_bool, 32)
7812 #endif
7813 ostreambuf_iterator_char* __thiscall num_put_char_do_put_bool(const num_put *this, ostreambuf_iterator_char *ret,
7814 ostreambuf_iterator_char dest, ios_base *base, char fill, MSVCP_bool v)
7816 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7818 if(base->fmtfl & FMTFLAG_boolalpha) {
7819 numpunct_char *numpunct = numpunct_char_use_facet(IOS_LOCALE(base));
7820 basic_string_char str;
7821 MSVCP_size_t pad, len;
7823 if(v)
7824 numpunct_char_truename(numpunct, &str);
7825 else
7826 numpunct_char_falsename(numpunct, &str);
7828 len = MSVCP_basic_string_char_length(&str);
7829 pad = (len>base->wide ? 0 : base->wide-len);
7830 base->wide = 0;
7832 if((base->fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7833 num_put_char__Rep(this, &dest, dest, fill, pad);
7834 pad = 0;
7836 num_put_char__Putc(this, &dest, dest, MSVCP_basic_string_char_c_str(&str), len);
7837 MSVCP_basic_string_char_dtor(&str);
7838 return num_put_char__Rep(this, ret, dest, fill, pad);
7841 return num_put_char_put_long(this, ret, dest, base, fill, v);
7844 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@D_N@Z */
7845 /* ?put@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@D_N@Z */
7846 #if _MSVCP_VER != 80
7847 DEFINE_THISCALL_WRAPPER(num_put_char_put_bool, 28)
7848 #else
7849 DEFINE_THISCALL_WRAPPER(num_put_char_put_bool, 32)
7850 #endif
7851 ostreambuf_iterator_char* __thiscall num_put_char_put_bool(const num_put *this, ostreambuf_iterator_char *ret,
7852 ostreambuf_iterator_char dest, ios_base *base, char fill, MSVCP_bool v)
7854 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7855 return call_num_put_char_do_put_bool(this, ret, dest, base, fill, v);
7858 /* ?id@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@2V0locale@2@A */
7859 locale_id num_put_wchar_id = {0};
7860 /* ?id@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@2V0locale@2@A */
7861 locale_id num_put_short_id = {0};
7863 /* num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@6B@ */
7864 extern const vtable_ptr MSVCP_num_put_wchar_vtable;
7865 /* num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@6B@ */
7866 extern const vtable_ptr MSVCP_num_put_short_vtable;
7868 /* ?_Init@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
7869 /* ?_Init@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
7870 DEFINE_THISCALL_WRAPPER(num_put_wchar__Init, 8)
7871 void __thiscall num_put_wchar__Init(num_put *this, const _Locinfo *locinfo)
7873 TRACE("(%p %p)\n", this, locinfo);
7874 #if _MSVCP_VER < 110
7875 _Locinfo__Getcvt(locinfo, &this->cvt);
7876 #endif
7879 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
7880 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
7881 DEFINE_THISCALL_WRAPPER(num_put_wchar_ctor_locinfo, 12)
7882 num_put* __thiscall num_put_wchar_ctor_locinfo(num_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
7884 TRACE("(%p %p %ld)\n", this, locinfo, refs);
7886 locale_facet_ctor_refs(&this->facet, refs);
7887 this->facet.vtable = &MSVCP_num_put_wchar_vtable;
7889 num_put_wchar__Init(this, locinfo);
7890 return this;
7893 /* ??0?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
7894 /* ??0?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
7895 DEFINE_THISCALL_WRAPPER(num_put_short_ctor_locinfo, 12)
7896 num_put* __thiscall num_put_short_ctor_locinfo(num_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
7898 num_put_wchar_ctor_locinfo(this, locinfo, refs);
7899 this->facet.vtable = &MSVCP_num_put_short_vtable;
7900 return this;
7903 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@I@Z */
7904 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@_K@Z */
7905 DEFINE_THISCALL_WRAPPER(num_put_wchar_ctor_refs, 8)
7906 num_put* __thiscall num_put_wchar_ctor_refs(num_put *this, MSVCP_size_t refs)
7908 _Locinfo locinfo;
7910 TRACE("(%p %lu)\n", this, refs);
7912 _Locinfo_ctor(&locinfo);
7913 num_put_wchar_ctor_locinfo(this, &locinfo, refs);
7914 _Locinfo_dtor(&locinfo);
7915 return this;
7918 /* ??0?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@I@Z */
7919 /* ??0?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@_K@Z */
7920 DEFINE_THISCALL_WRAPPER(num_put_short_ctor_refs, 8)
7921 num_put* __thiscall num_put_short_ctor_refs(num_put *this, MSVCP_size_t refs)
7923 num_put_wchar_ctor_refs(this, refs);
7924 this->facet.vtable = &MSVCP_num_put_short_vtable;
7925 return this;
7928 /* ??_F?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
7929 /* ??_F?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
7930 DEFINE_THISCALL_WRAPPER(num_put_wchar_ctor, 4)
7931 num_put* __thiscall num_put_wchar_ctor(num_put *this)
7933 return num_put_wchar_ctor_refs(this, 0);
7936 /* ??_F?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAEXXZ */
7937 /* ??_F?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAAXXZ */
7938 DEFINE_THISCALL_WRAPPER(num_put_short_ctor, 4)
7939 num_put* __thiscall num_put_short_ctor(num_put *this)
7941 return num_put_short_ctor_refs(this, 0);
7944 /* ??1?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@UAE@XZ */
7945 /* ??1?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@UEAA@XZ */
7946 /* ??1?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MAE@XZ */
7947 /* ??1?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEAA@XZ */
7948 /* ??1?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MAE@XZ */
7949 /* ??1?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEAA@XZ */
7950 DEFINE_THISCALL_WRAPPER(num_put_wchar_dtor, 4)
7951 void __thiscall num_put_wchar_dtor(num_put *this)
7953 TRACE("(%p)\n", this);
7954 locale_facet_dtor(&this->facet);
7957 DEFINE_THISCALL_WRAPPER(num_put_wchar_vector_dtor, 8)
7958 num_put* __thiscall num_put_wchar_vector_dtor(num_put *this, unsigned int flags)
7960 TRACE("(%p %x)\n", this, flags);
7961 if(flags & 2) {
7962 /* we have an array, with the number of elements stored before the first object */
7963 INT_PTR i, *ptr = (INT_PTR *)this-1;
7965 for(i=*ptr-1; i>=0; i--)
7966 num_put_wchar_dtor(this+i);
7967 MSVCRT_operator_delete(ptr);
7968 } else {
7969 num_put_wchar_dtor(this);
7970 if(flags & 1)
7971 MSVCRT_operator_delete(this);
7974 return this;
7977 /* ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
7978 /* ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
7979 MSVCP_size_t __cdecl num_put_wchar__Getcat(const locale_facet **facet, const locale *loc)
7981 TRACE("(%p %p)\n", facet, loc);
7983 if(facet && !*facet) {
7984 _Locinfo locinfo;
7986 *facet = MSVCRT_operator_new(sizeof(num_put));
7987 if(!*facet) {
7988 ERR("Out of memory\n");
7989 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7990 return 0;
7993 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
7994 num_put_wchar_ctor_locinfo((num_put*)*facet, &locinfo, 0);
7995 _Locinfo_dtor(&locinfo);
7998 return LC_NUMERIC;
8001 /* ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
8002 /* ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
8003 MSVCP_size_t __cdecl num_put_wchar__Getcat_old(const locale_facet **facet)
8005 return num_put_wchar__Getcat(facet, locale_classic());
8008 /* ?_Getcat@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
8009 /* ?_Getcat@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
8010 MSVCP_size_t __cdecl num_put_short__Getcat(const locale_facet **facet, const locale *loc)
8012 TRACE("(%p %p)\n", facet, loc);
8014 if(facet && !*facet) {
8015 _Locinfo locinfo;
8017 *facet = MSVCRT_operator_new(sizeof(num_put));
8018 if(!*facet) {
8019 ERR("Out of memory\n");
8020 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
8021 return 0;
8024 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
8025 num_put_short_ctor_locinfo((num_put*)*facet, &locinfo, 0);
8026 _Locinfo_dtor(&locinfo);
8029 return LC_NUMERIC;
8032 /* ?_Getcat@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
8033 /* ?_Getcat@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
8034 MSVCP_size_t __cdecl num_put_short__Getcat_old(const locale_facet **facet)
8036 return num_put_short__Getcat(facet, locale_classic());
8039 num_put* num_put_wchar_use_facet(const locale *loc)
8041 static num_put *obj = NULL;
8043 _Lockit lock;
8044 const locale_facet *fac;
8046 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
8047 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_put_wchar_id));
8048 if(fac) {
8049 _Lockit_dtor(&lock);
8050 return (num_put*)fac;
8053 if(obj) {
8054 _Lockit_dtor(&lock);
8055 return obj;
8058 num_put_wchar__Getcat(&fac, loc);
8059 obj = (num_put*)fac;
8060 call_locale_facet__Incref(&obj->facet);
8061 locale_facet_register(&obj->facet);
8062 _Lockit_dtor(&lock);
8064 return obj;
8067 num_put* num_put_short_use_facet(const locale *loc)
8069 static num_put *obj = NULL;
8071 _Lockit lock;
8072 const locale_facet *fac;
8074 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
8075 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_put_short_id));
8076 if(fac) {
8077 _Lockit_dtor(&lock);
8078 return (num_put*)fac;
8081 if(obj) {
8082 _Lockit_dtor(&lock);
8083 return obj;
8086 num_put_short__Getcat(&fac, loc);
8087 obj = (num_put*)fac;
8088 call_locale_facet__Incref(&obj->facet);
8089 locale_facet_register(&obj->facet);
8090 _Lockit_dtor(&lock);
8092 return obj;
8095 /* ?_Put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PB_WI@Z */
8096 /* ?_Put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEB_W_K@Z */
8097 /* ?_Put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@PBGI@Z */
8098 /* ?_Put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@PEBG_K@Z */
8099 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Put(const num_put *this, ostreambuf_iterator_wchar *ret,
8100 ostreambuf_iterator_wchar dest, const wchar_t *ptr, MSVCP_size_t count)
8102 TRACE("(%p %p %s %ld)\n", this, ret, debugstr_wn(ptr, count), count);
8104 for(; count>0; count--)
8105 ostreambuf_iterator_wchar_put(&dest, *ptr++);
8107 *ret = dest;
8108 return ret;
8111 #if _MSVCP_VER < 110
8112 /* ?_Putc@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PBDI@Z */
8113 /* ?_Putc@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEBD_K@Z */
8114 /* ?_Putc@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@PBDI@Z */
8115 /* ?_Putc@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@PEBD_K@Z */
8116 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Putc(const num_put *this, ostreambuf_iterator_wchar *ret,
8117 ostreambuf_iterator_wchar dest, const char *ptr, MSVCP_size_t count)
8119 int state = 0;
8120 wchar_t ch;
8122 TRACE("(%p %p %s %ld)\n", this, ret, debugstr_an(ptr, count), count);
8124 for(; count>0; count--) {
8125 if(_Mbrtowc(&ch, ptr++, 1, &state, &this->cvt) == 1)
8126 ostreambuf_iterator_wchar_put(&dest, ch);
8129 *ret = dest;
8130 return ret;
8132 #endif
8134 /* ?_Putgrouped@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PBDI_W@Z */
8135 /* ?_Putgrouped@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEBD_K_W@Z */
8136 /* ?_Putgrouped@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@PBDIG@Z */
8137 /* ?_Putgrouped@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@PEBD_KG@Z */
8138 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Putgrouped(const num_put *this, ostreambuf_iterator_wchar *ret,
8139 ostreambuf_iterator_wchar dest, const char *ptr, MSVCP_size_t count, wchar_t delim)
8141 FIXME("(%p %p %p %ld %d) stub\n", this, ret, ptr, count, delim);
8142 return NULL;
8145 /* ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_WI@Z */
8146 /* ?_Rep@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_W_K@Z */
8147 /* ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@GI@Z */
8148 /* ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@G_K@Z */
8149 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Rep(const num_put *this, ostreambuf_iterator_wchar *ret,
8150 ostreambuf_iterator_wchar dest, wchar_t c, MSVCP_size_t count)
8152 TRACE("(%p %p %d %ld)\n", this, ret, c, count);
8154 for(; count>0; count--)
8155 ostreambuf_iterator_wchar_put(&dest, c);
8157 *ret = dest;
8158 return ret;
8161 /* ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAPADPADDH@Z */
8162 /* ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAPEADPEADDH@Z */
8163 /* ?_Ffmt@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABAPADPADDH@Z */
8164 /* ?_Ffmt@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAPEADPEADDH@Z */
8165 char* __cdecl num_put_wchar__Ffmt(const num_put *this, char *fmt, char spec, int fmtfl)
8167 int type = fmtfl & FMTFLAG_floatfield;
8168 char *p = fmt;
8170 TRACE("(%p %p %d %d)\n", this, fmt, spec, fmtfl);
8172 *p++ = '%';
8173 if(fmtfl & FMTFLAG_showpos)
8174 *p++ = '+';
8175 if(fmtfl & FMTFLAG_showbase)
8176 *p++ = '#';
8177 *p++ = '.';
8178 *p++ = '*';
8179 if(spec)
8180 *p++ = spec;
8182 if(type == FMTFLAG_fixed)
8183 *p++ = 'f';
8184 else if(type == FMTFLAG_scientific)
8185 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'E' : 'e';
8186 else if(type == (FMTFLAG_fixed|FMTFLAG_scientific))
8187 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'A' : 'a';
8188 else
8189 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'G' : 'g';
8191 *p++ = '\0';
8192 return fmt;
8195 /* ?_Fput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPBDIIII@Z */
8196 /* ?_Fput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEBD_K444@Z */
8197 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Fput(const num_put *this, ostreambuf_iterator_wchar *ret,
8198 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const char *buf, MSVCP_size_t bef_point,
8199 MSVCP_size_t aft_point, MSVCP_size_t trailing, MSVCP_size_t count)
8201 FIXME("(%p %p %p %d %p %ld %ld %ld %ld) stub\n", this, ret, base,
8202 fill, buf, bef_point, aft_point, trailing, count);
8203 return NULL;
8206 /* ?_Fput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPBDIIII@Z */
8207 /* ?_Fput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEBD_K333@Z */
8208 ostreambuf_iterator_wchar* __cdecl num_put_short__Fput(const num_put *this, ostreambuf_iterator_wchar *ret,
8209 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const char *buf, MSVCP_size_t bef_point,
8210 MSVCP_size_t aft_point, MSVCP_size_t trailing, MSVCP_size_t count)
8212 FIXME("(%p %p %p %d %p %ld %ld %ld %ld) stub\n", this, ret, base,
8213 fill, buf, bef_point, aft_point, trailing, count);
8214 return NULL;
8217 #if _MSVCP_VER < 110
8218 static void num_put_wchar_wide_put(const num_put *this,
8219 ostreambuf_iterator_wchar *dest, ios_base *base,
8220 const char *buf, MSVCP_size_t count)
8222 num_put_wchar__Putc(this, dest, *dest, buf, count);
8224 #else
8225 static void num_put_wchar_wide_put(const num_put *this,
8226 ostreambuf_iterator_wchar *dest, ios_base *base,
8227 const char *buf, MSVCP_size_t count)
8229 ctype_wchar *ctype;
8230 MSVCP_size_t i;
8232 ctype = ctype_wchar_use_facet(IOS_LOCALE(base));
8233 for(i=0; i<count; i++)
8234 ostreambuf_iterator_wchar_put(dest, ctype_wchar_widen_ch(ctype, buf[i]));
8236 #endif
8238 /* TODO: This function should be removed when num_put_wchar__Fput is implemented */
8239 static ostreambuf_iterator_wchar* num_put__fput(const num_put *this, ostreambuf_iterator_wchar *ret,
8240 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf,
8241 MSVCP_size_t count, numpunct_wchar *numpunct)
8243 basic_string_char grouping_bstr;
8244 const char *grouping;
8245 char *p, dec_point = *localeconv()->decimal_point;
8246 wchar_t sep = 0;
8247 int cur_group = 0, group_size = 0;
8248 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
8249 MSVCP_size_t i, pad;
8251 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
8253 for(p=buf; p<buf+count; p++) {
8254 if(*p == dec_point)
8255 break;
8257 p--;
8259 /* Add separators to number */
8260 numpunct_wchar_grouping(numpunct, &grouping_bstr);
8261 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
8262 #if _MSVCP_VER >= 70
8263 if (grouping[0]) sep = numpunct_wchar_thousands_sep(numpunct);
8264 #endif
8266 for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
8267 group_size++;
8268 if(group_size == grouping[cur_group]) {
8269 group_size = 0;
8270 if(grouping[cur_group+1])
8271 cur_group++;
8273 memmove(p+1, p, buf+count-p);
8274 *p = '\0'; /* mark thousands separator positions */
8275 count++;
8278 MSVCP_basic_string_char_dtor(&grouping_bstr);
8280 /* Display number with padding */
8281 if(count >= base->wide)
8282 pad = 0;
8283 else
8284 pad = base->wide-count;
8285 base->wide = 0;
8287 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
8288 num_put_wchar_wide_put(this, &dest, base, buf, 1);
8289 buf++;
8291 if(adjustfield != FMTFLAG_left) {
8292 num_put_wchar__Rep(this, ret, dest, fill, pad);
8293 pad = 0;
8296 for(i=0; i<count; i++) {
8297 if(buf[i] == dec_point)
8298 num_put_wchar__Rep(this, &dest, dest, numpunct_wchar_decimal_point(numpunct), 1);
8299 else if(!buf[i])
8300 num_put_wchar__Rep(this, &dest, dest, sep, 1);
8301 else
8302 num_put_wchar_wide_put(this, &dest, base, buf+i, 1);
8305 return num_put_wchar__Rep(this, ret, dest, fill, pad);
8308 /* ?_Ifmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAPADPADPBDH@Z */
8309 /* ?_Ifmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAPEADPEADPEBDH@Z */
8310 /* ?_Ifmt@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABAPADPADPBDH@Z */
8311 /* ?_Ifmt@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAPEADPEADPEBDH@Z */
8312 char* __cdecl num_put_wchar__Ifmt(const num_put *this, char *fmt, const char *spec, int fmtfl)
8314 int base = fmtfl & FMTFLAG_basefield;
8315 char *p = fmt;
8317 TRACE("(%p %p %p %d)\n", this, fmt, spec, fmtfl);
8319 *p++ = '%';
8320 if(fmtfl & FMTFLAG_showpos)
8321 *p++ = '+';
8322 if(fmtfl & FMTFLAG_showbase)
8323 *p++ = '#';
8325 *p++ = *spec++;
8326 if(*spec == 'l')
8327 *p++ = *spec++;
8329 if(base == FMTFLAG_oct)
8330 *p++ = 'o';
8331 else if(base == FMTFLAG_hex)
8332 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'X' : 'x';
8333 else
8334 *p++ = *spec;
8336 *p++ = '\0';
8337 return fmt;
8340 static ostreambuf_iterator_wchar* num_put__Iput(const num_put *this, ostreambuf_iterator_wchar *ret,
8341 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf,
8342 MSVCP_size_t count, numpunct_wchar *numpunct)
8344 basic_string_char grouping_bstr;
8345 const char *grouping;
8346 char *p;
8347 wchar_t sep;
8348 int cur_group = 0, group_size = 0;
8349 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
8350 MSVCP_size_t i, pad;
8352 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
8354 /* Add separators to number */
8355 numpunct_wchar_grouping(numpunct, &grouping_bstr);
8356 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
8357 sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : '\0';
8359 for(p=buf+count-1; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
8360 group_size++;
8361 if(group_size == grouping[cur_group]) {
8362 group_size = 0;
8363 if(grouping[cur_group+1])
8364 cur_group++;
8366 memmove(p+1, p, buf+count-p);
8367 *p = '\0'; /* mark thousands separator positions */
8368 count++;
8371 MSVCP_basic_string_char_dtor(&grouping_bstr);
8373 /* Display number with padding */
8374 if(count >= base->wide)
8375 pad = 0;
8376 else
8377 pad = base->wide-count;
8378 base->wide = 0;
8380 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
8381 num_put_wchar_wide_put(this, &dest, base, buf, 1);
8382 buf++;
8383 }else if((adjustfield & FMTFLAG_internal) && (buf[1]=='x' || buf[1]=='X')) {
8384 num_put_wchar_wide_put(this, &dest, base, buf, 2);
8385 buf += 2;
8387 if(adjustfield != FMTFLAG_left) {
8388 num_put_wchar__Rep(this, ret, dest, fill, pad);
8389 pad = 0;
8392 for(i=0; i<count; i++) {
8393 if(!buf[i])
8394 num_put_wchar__Rep(this, &dest, dest, sep, 1);
8395 else
8396 num_put_wchar_wide_put(this, &dest, base, buf+i, 1);
8399 return num_put_wchar__Rep(this, ret, dest, fill, pad);
8402 /* ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPADI@Z */
8403 /* ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEAD_K@Z */
8404 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Iput(const num_put *this, ostreambuf_iterator_wchar *ret,
8405 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf, MSVCP_size_t count)
8407 return num_put__Iput(this, ret, dest, base, fill, buf, count, numpunct_wchar_use_facet(IOS_LOCALE(base)));
8410 /* ?_Iput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPADI@Z */
8411 /* ?_Iput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEAD_K@Z */
8412 ostreambuf_iterator_wchar* __cdecl num_put_short__Iput(const num_put *this, ostreambuf_iterator_wchar *ret,
8413 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf, MSVCP_size_t count)
8415 return num_put__Iput(this, ret, dest, base, fill, buf, count, numpunct_short_use_facet(IOS_LOCALE(base)));
8418 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WJ@Z */
8419 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WJ@Z */
8420 #if _MSVCP_VER <= 100
8421 #define call_num_put_wchar_do_put_long(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 28, ostreambuf_iterator_wchar*, \
8422 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, LONG), \
8423 (this, ret, dest, base, fill, v))
8424 #else
8425 #define call_num_put_wchar_do_put_long(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 36, ostreambuf_iterator_wchar*, \
8426 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, LONG), \
8427 (this, ret, dest, base, fill, v))
8428 #endif
8429 #if _MSVCP_VER != 80
8430 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_long, 28)
8431 #else
8432 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_long, 32)
8433 #endif
8434 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_long(const num_put *this, ostreambuf_iterator_wchar *ret,
8435 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, LONG v)
8437 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8438 char fmt[7]; /* strlen("%+#lld")+1 */
8440 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8442 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
8443 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "ld", base->fmtfl), v));
8446 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GJ@Z */
8447 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GJ@Z */
8448 #if _MSVCP_VER != 80
8449 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_long, 28)
8450 #else
8451 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_long, 32)
8452 #endif
8453 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_long(const num_put *this, ostreambuf_iterator_wchar *ret,
8454 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, LONG v)
8456 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8457 char fmt[7]; /* strlen("%+#lld")+1 */
8459 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8461 return num_put_short__Iput(this, ret, dest, base, fill, tmp,
8462 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "ld", base->fmtfl), v));
8465 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WJ@Z */
8466 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WJ@Z */
8467 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GJ@Z */
8468 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GJ@Z */
8469 #if _MSVCP_VER != 80
8470 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_long, 28)
8471 #else
8472 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_long, 32)
8473 #endif
8474 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_long(const num_put *this, ostreambuf_iterator_wchar *ret,
8475 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, LONG v)
8477 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8478 return call_num_put_wchar_do_put_long(this, ret, dest, base, fill, v);
8481 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WK@Z */
8482 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WK@Z */
8483 #if _MSVCP_VER <= 100
8484 #define call_num_put_wchar_do_put_ulong(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 24, ostreambuf_iterator_wchar*, \
8485 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, ULONG), \
8486 (this, ret, dest, base, fill, v))
8487 #else
8488 #define call_num_put_wchar_do_put_ulong(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 32, ostreambuf_iterator_wchar*, \
8489 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, ULONG), \
8490 (this, ret, dest, base, fill, v))
8491 #endif
8492 #if _MSVCP_VER != 80
8493 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_ulong, 28)
8494 #else
8495 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_ulong, 32)
8496 #endif
8497 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_ulong(const num_put *this, ostreambuf_iterator_wchar *ret,
8498 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, ULONG v)
8500 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8501 char fmt[7]; /* strlen("%+#lld")+1 */
8503 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8505 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
8506 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lu", base->fmtfl), v));
8509 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GK@Z */
8510 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GK@Z */
8511 #if _MSVCP_VER != 80
8512 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_ulong, 28)
8513 #else
8514 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_ulong, 32)
8515 #endif
8516 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_ulong(const num_put *this, ostreambuf_iterator_wchar *ret,
8517 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, ULONG v)
8519 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8520 char fmt[7]; /* strlen("%+#lld")+1 */
8522 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8524 return num_put_short__Iput(this, ret, dest, base, fill, tmp,
8525 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lu", base->fmtfl), v));
8528 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WK@Z */
8529 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WK@Z */
8530 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GK@Z */
8531 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GK@Z */
8532 #if _MSVCP_VER != 80
8533 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ulong, 28)
8534 #else
8535 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ulong, 32)
8536 #endif
8537 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ulong(const num_put *this, ostreambuf_iterator_wchar *ret,
8538 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, ULONG v)
8540 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8541 return call_num_put_wchar_do_put_ulong(this, ret, dest, base, fill, v);
8544 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WN@Z */
8545 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WN@Z */
8546 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WO@Z */
8547 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WO@Z */
8548 #if _MSVCP_VER <= 100
8549 #define call_num_put_wchar_do_put_double(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_wchar*, \
8550 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, double), \
8551 (this, ret, dest, base, fill, v))
8552 #define call_num_put_wchar_do_put_ldouble(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 8, ostreambuf_iterator_wchar*, \
8553 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, double), \
8554 (this, ret, dest, base, fill, v))
8555 #else
8556 #define call_num_put_wchar_do_put_double(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 20, ostreambuf_iterator_wchar*, \
8557 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, double), \
8558 (this, ret, dest, base, fill, v))
8559 #define call_num_put_wchar_do_put_ldouble(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 16, ostreambuf_iterator_wchar*, \
8560 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, double), \
8561 (this, ret, dest, base, fill, v))
8562 #endif
8563 #if _MSVCP_VER != 80
8564 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_double, 32)
8565 #else
8566 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_double, 36)
8567 #endif
8568 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_double(const num_put *this, ostreambuf_iterator_wchar *ret,
8569 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
8571 char *tmp;
8572 char fmt[8]; /* strlen("%+#.*lg")+1 */
8573 int size;
8574 unsigned prec;
8576 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
8578 num_put_wchar__Ffmt(this, fmt, '\0', base->fmtfl);
8579 prec = get_precision(base);
8580 size = _scprintf(fmt, prec, v);
8582 /* TODO: don't use dynamic allocation */
8583 tmp = MSVCRT_operator_new(size*2);
8584 if(!tmp) {
8585 ERR("Out of memory\n");
8586 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
8588 num_put__fput(this, ret, dest, base, fill, tmp, sprintf(tmp, fmt, prec, v),
8589 numpunct_wchar_use_facet(IOS_LOCALE(base)));
8590 MSVCRT_operator_delete(tmp);
8591 return ret;
8594 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GN@Z */
8595 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GN@Z */
8596 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GO@Z */
8597 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GO@Z */
8598 #if _MSVCP_VER != 80
8599 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_double, 32)
8600 #else
8601 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_double, 36)
8602 #endif
8603 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_double(const num_put *this, ostreambuf_iterator_wchar *ret,
8604 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
8606 char *tmp;
8607 char fmt[8]; /* strlen("%+#.*lg")+1 */
8608 int size;
8609 unsigned prec;
8611 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
8613 num_put_wchar__Ffmt(this, fmt, '\0', base->fmtfl);
8614 prec = get_precision(base);
8615 size = _scprintf(fmt, prec, v);
8617 /* TODO: don't use dynamic allocation */
8618 tmp = MSVCRT_operator_new(size*2);
8619 if(!tmp) {
8620 ERR("Out of memory\n");
8621 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
8623 num_put__fput(this, ret, dest, base, fill, tmp, sprintf(tmp, fmt, prec, v),
8624 numpunct_short_use_facet(IOS_LOCALE(base)));
8625 MSVCRT_operator_delete(tmp);
8626 return ret;
8629 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WN@Z */
8630 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WN@Z */
8631 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GN@Z */
8632 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GN@Z */
8633 #if _MSVCP_VER != 80
8634 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_double, 32)
8635 #else
8636 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_double, 36)
8637 #endif
8638 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_double(const num_put *this, ostreambuf_iterator_wchar *ret,
8639 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
8641 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
8642 return call_num_put_wchar_do_put_double(this, ret, dest, base, fill, v);
8645 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WO@Z */
8646 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WO@Z */
8647 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GO@Z */
8648 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GO@Z */
8649 #if _MSVCP_VER != 80
8650 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ldouble, 32)
8651 #else
8652 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ldouble, 36)
8653 #endif
8654 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ldouble(const num_put *this, ostreambuf_iterator_wchar *ret,
8655 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
8657 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
8658 return call_num_put_wchar_do_put_ldouble(this, ret, dest, base, fill, v);
8661 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPBX@Z */
8662 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEBX@Z */
8663 #if _MSVCP_VER <= 100
8664 #define call_num_put_wchar_do_put_ptr(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_wchar*, \
8665 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, const void*), \
8666 (this, ret, dest, base, fill, v))
8667 #else
8668 #define call_num_put_wchar_do_put_ptr(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_wchar*, \
8669 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, const void*), \
8670 (this, ret, dest, base, fill, v))
8671 #endif
8672 #if _MSVCP_VER != 80
8673 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_ptr, 28)
8674 #else
8675 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_ptr, 32)
8676 #endif
8677 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_ptr(const num_put *this, ostreambuf_iterator_wchar *ret,
8678 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const void *v)
8680 char tmp[17]; /* 8(16^8==2^64)*2(separators beetwen every digit) + 1 */
8682 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
8684 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp, sprintf(tmp, "%p", v));
8687 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPBX@Z */
8688 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEBX@Z */
8689 #if _MSVCP_VER != 80
8690 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_ptr, 28)
8691 #else
8692 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_ptr, 32)
8693 #endif
8694 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_ptr(const num_put *this, ostreambuf_iterator_wchar *ret,
8695 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const void *v)
8697 char tmp[17]; /* 8(16^8==2^64)*2(separators beetwen every digit) + 1 */
8699 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
8701 return num_put_short__Iput(this, ret, dest, base, fill, tmp, sprintf(tmp, "%p", v));
8704 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPBX@Z */
8705 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEBX@Z */
8706 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPBX@Z */
8707 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEBX@Z */
8708 #if _MSVCP_VER != 80
8709 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ptr, 28)
8710 #else
8711 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ptr, 32)
8712 #endif
8713 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ptr(const num_put *this, ostreambuf_iterator_wchar *ret,
8714 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const void *v)
8716 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
8717 return call_num_put_wchar_do_put_ptr(this, ret, dest, base, fill, v);
8720 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_W_J@Z */
8721 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_W_J@Z */
8722 #if _MSVCP_VER <= 100
8723 #define call_num_put_wchar_do_put_int64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 20, ostreambuf_iterator_wchar*, \
8724 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, __int64), \
8725 (this, ret, dest, base, fill, v))
8726 #else
8727 #define call_num_put_wchar_do_put_int64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 28, ostreambuf_iterator_wchar*, \
8728 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, __int64), \
8729 (this, ret, dest, base, fill, v))
8730 #endif
8731 #if _MSVCP_VER != 80
8732 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_int64, 32)
8733 #else
8734 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_int64, 36)
8735 #endif
8736 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_int64(const num_put *this, ostreambuf_iterator_wchar *ret,
8737 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, __int64 v)
8739 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8740 char fmt[7]; /* strlen("%+#lld")+1 */
8742 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
8744 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
8745 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lld", base->fmtfl), v));
8748 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@G_J@Z */
8749 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@G_J@Z */
8750 #if _MSVCP_VER != 80
8751 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_int64, 32)
8752 #else
8753 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_int64, 36)
8754 #endif
8755 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_int64(const num_put *this, ostreambuf_iterator_wchar *ret,
8756 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, __int64 v)
8758 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8759 char fmt[7]; /* strlen("%+#lld")+1 */
8761 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
8763 return num_put_short__Iput(this, ret, dest, base, fill, tmp,
8764 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lld", base->fmtfl), v));
8767 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_W_J@Z */
8768 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_W_J@Z */
8769 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@G_J@Z */
8770 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@G_J@Z */
8771 #if _MSVCP_VER != 80
8772 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_int64, 32)
8773 #else
8774 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_int64, 36)
8775 #endif
8776 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_int64(const num_put *this, ostreambuf_iterator_wchar *ret,
8777 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, __int64 v)
8779 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
8780 return call_num_put_wchar_do_put_int64(this, ret, dest, base, fill, v);
8783 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_W_K@Z */
8784 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_W_K@Z */
8785 #if _MSVCP_VER <= 100
8786 #define call_num_put_wchar_do_put_uint64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 16, ostreambuf_iterator_wchar*, \
8787 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, unsigned __int64), \
8788 (this, ret, dest, base, fill, v))
8789 #else
8790 #define call_num_put_wchar_do_put_uint64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 24, ostreambuf_iterator_wchar*, \
8791 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, unsigned __int64), \
8792 (this, ret, dest, base, fill, v))
8793 #endif
8794 #if _MSVCP_VER != 80
8795 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_uint64, 32)
8796 #else
8797 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_uint64, 36)
8798 #endif
8799 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_uint64(const num_put *this, ostreambuf_iterator_wchar *ret,
8800 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, unsigned __int64 v)
8802 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8803 char fmt[7]; /* strlen("%+#lld")+1 */
8805 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
8807 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
8808 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "llu", base->fmtfl), v));
8811 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@G_K@Z */
8812 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@G_K@Z */
8813 #if _MSVCP_VER != 80
8814 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_uint64, 32)
8815 #else
8816 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_uint64, 36)
8817 #endif
8818 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_uint64(const num_put *this, ostreambuf_iterator_wchar *ret,
8819 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, unsigned __int64 v)
8821 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
8822 char fmt[7]; /* strlen("%+#lld")+1 */
8824 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
8826 return num_put_short__Iput(this, ret, dest, base, fill, tmp,
8827 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "llu", base->fmtfl), v));
8830 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_W_K@Z */
8831 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_W_K@Z */
8832 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@G_K@Z */
8833 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@G_K@Z */
8834 #if _MSVCP_VER != 80
8835 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_uint64, 32)
8836 #else
8837 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_uint64, 36)
8838 #endif
8839 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_uint64(const num_put *this, ostreambuf_iterator_wchar *ret,
8840 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, unsigned __int64 v)
8842 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
8843 return call_num_put_wchar_do_put_uint64(this, ret, dest, base, fill, v);
8846 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_W_N@Z */
8847 /* ?do_put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_W_N@Z */
8848 #if _MSVCP_VER <= 100
8849 #define call_num_put_wchar_do_put_bool(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 32, ostreambuf_iterator_wchar*, \
8850 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, MSVCP_bool), \
8851 (this, ret, dest, base, fill, v))
8852 #else
8853 #define call_num_put_wchar_do_put_bool(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 40, ostreambuf_iterator_wchar*, \
8854 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, MSVCP_bool), \
8855 (this, ret, dest, base, fill, v))
8856 #endif
8857 #if _MSVCP_VER != 80
8858 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_bool, 28)
8859 #else
8860 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_bool, 32)
8861 #endif
8862 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_bool(const num_put *this, ostreambuf_iterator_wchar *ret,
8863 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, MSVCP_bool v)
8865 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8867 if(base->fmtfl & FMTFLAG_boolalpha) {
8868 numpunct_wchar *numpunct = numpunct_wchar_use_facet(IOS_LOCALE(base));
8869 basic_string_wchar str;
8870 MSVCP_size_t pad, len;
8872 if(v)
8873 numpunct_wchar_truename(numpunct, &str);
8874 else
8875 numpunct_wchar_falsename(numpunct, &str);
8877 len = MSVCP_basic_string_wchar_length(&str);
8878 pad = (len>base->wide ? 0 : base->wide-len);
8879 base->wide = 0;
8881 if((base->fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
8882 num_put_wchar__Rep(this, &dest, dest, fill, pad);
8883 pad = 0;
8885 num_put_wchar__Put(this, &dest, dest, MSVCP_basic_string_wchar_c_str(&str), len);
8886 MSVCP_basic_string_wchar_dtor(&str);
8887 return num_put_wchar__Rep(this, ret, dest, fill, pad);
8890 return num_put_wchar_put_long(this, ret, dest, base, fill, v);
8893 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@G_N@Z */
8894 /* ?do_put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@G_N@Z */
8895 #if _MSVCP_VER != 80
8896 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_bool, 28)
8897 #else
8898 DEFINE_THISCALL_WRAPPER(num_put_short_do_put_bool, 32)
8899 #endif
8900 ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_bool(const num_put *this, ostreambuf_iterator_wchar *ret,
8901 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, MSVCP_bool v)
8903 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8905 if(base->fmtfl & FMTFLAG_boolalpha) {
8906 numpunct_wchar *numpunct = numpunct_short_use_facet(IOS_LOCALE(base));
8907 basic_string_wchar str;
8908 MSVCP_size_t pad, len;
8910 if(v)
8911 numpunct_wchar_truename(numpunct, &str);
8912 else
8913 numpunct_wchar_falsename(numpunct, &str);
8915 len = MSVCP_basic_string_wchar_length(&str);
8916 pad = (len>base->wide ? 0 : base->wide-len);
8917 base->wide = 0;
8919 if((base->fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
8920 num_put_wchar__Rep(this, &dest, dest, fill, pad);
8921 pad = 0;
8923 num_put_wchar__Put(this, &dest, dest, MSVCP_basic_string_wchar_c_str(&str), len);
8924 MSVCP_basic_string_wchar_dtor(&str);
8925 return num_put_wchar__Rep(this, ret, dest, fill, pad);
8928 return num_put_wchar_put_long(this, ret, dest, base, fill, v);
8931 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_W_N@Z */
8932 /* ?put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_W_N@Z */
8933 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@G_N@Z */
8934 /* ?put@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@G_N@Z */
8935 #if _MSVCP_VER != 80
8936 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_bool, 28)
8937 #else
8938 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_bool, 32)
8939 #endif
8940 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_bool(const num_put *this, ostreambuf_iterator_wchar *ret,
8941 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, MSVCP_bool v)
8943 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
8944 return call_num_put_wchar_do_put_bool(this, ret, dest, base, fill, v);
8947 /* ?id@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A */
8948 locale_id time_put_char_id = {0};
8950 /* ??_7?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@6B@ */
8951 extern const vtable_ptr MSVCP_time_put_char_vtable;
8953 /* ?_Init@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
8954 /* ?_Init@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
8955 DEFINE_THISCALL_WRAPPER(time_put_char__Init, 8)
8956 void __thiscall time_put_char__Init(time_put *this, const _Locinfo *locinfo)
8958 TRACE("(%p %p)\n", this, locinfo);
8959 _Locinfo__Gettnames(locinfo, &this->time);
8960 _Locinfo__Getcvt(locinfo, &this->cvt);
8963 /* ??0?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
8964 /* ??0?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
8965 DEFINE_THISCALL_WRAPPER(time_put_char_ctor_locinfo, 12)
8966 time_put* __thiscall time_put_char_ctor_locinfo(time_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
8968 TRACE("(%p %p %lu)\n", this, locinfo, refs);
8969 locale_facet_ctor_refs(&this->facet, refs);
8970 this->facet.vtable = &MSVCP_time_put_char_vtable;
8971 time_put_char__Init(this, locinfo);
8972 return this;
8975 /* ??0?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */
8976 /* ??0?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */
8977 DEFINE_THISCALL_WRAPPER(time_put_char_ctor_refs, 8)
8978 time_put* __thiscall time_put_char_ctor_refs(time_put *this, MSVCP_size_t refs)
8980 _Locinfo locinfo;
8982 TRACE("(%p %lu)\n", this, refs);
8984 _Locinfo_ctor(&locinfo);
8985 time_put_char_ctor_locinfo(this, &locinfo, refs);
8986 _Locinfo_dtor(&locinfo);
8987 return this;
8990 /* ??_F?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */
8991 /* ??_F?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAAXXZ */
8992 DEFINE_THISCALL_WRAPPER(time_put_char_ctor, 4)
8993 time_put* __thiscall time_put_char_ctor(time_put *this)
8995 return time_put_char_ctor_refs(this, 0);
8998 /* ??1?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */
8999 /* ??1?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEAA@XZ */
9000 DEFINE_THISCALL_WRAPPER(time_put_char_dtor, 4)
9001 void __thiscall time_put_char_dtor(time_put *this)
9003 TRACE("(%p)\n", this);
9004 _Timevec_dtor(&this->time);
9007 DEFINE_THISCALL_WRAPPER(time_put_char_vector_dtor, 8)
9008 time_put* __thiscall time_put_char_vector_dtor(time_put *this, unsigned int flags)
9010 TRACE("(%p %x)\n", this, flags);
9011 if(flags & 2) {
9012 /* we have an array, with the number of elements stored before the first object */
9013 INT_PTR i, *ptr = (INT_PTR *)this-1;
9015 for(i=*ptr-1; i>=0; i--)
9016 time_put_char_dtor(this+i);
9017 MSVCRT_operator_delete(ptr);
9018 } else {
9019 time_put_char_dtor(this);
9020 if(flags & 1)
9021 MSVCRT_operator_delete(this);
9024 return this;
9027 /* ?_Getcat@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
9028 /* ?_Getcat@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
9029 MSVCP_size_t __cdecl time_put_char__Getcat(const locale_facet **facet, const locale *loc)
9031 TRACE("(%p %p)\n", facet, loc);
9033 if(facet && !*facet) {
9034 _Locinfo locinfo;
9036 *facet = MSVCRT_operator_new(sizeof(time_put));
9037 if(!*facet) {
9038 ERR("Out of memory\n");
9039 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
9040 return 0;
9043 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
9044 time_put_char_ctor_locinfo((time_put*)*facet, &locinfo, 0);
9045 _Locinfo_dtor(&locinfo);
9048 return LC_TIME;
9051 /* ?_Getcat@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
9052 /* ?_Getcat@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
9053 MSVCP_size_t __cdecl time_put_char__Getcat_old(const locale_facet **facet)
9055 return time_put_char__Getcat(facet, locale_classic());
9058 static time_put* time_put_char_use_facet(const locale *loc)
9060 static time_put *obj = NULL;
9062 _Lockit lock;
9063 const locale_facet *fac;
9065 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
9066 fac = locale__Getfacet(loc, locale_id_operator_size_t(&time_put_char_id));
9067 if(fac) {
9068 _Lockit_dtor(&lock);
9069 return (time_put*)fac;
9072 if(obj) {
9073 _Lockit_dtor(&lock);
9074 return obj;
9077 time_put_char__Getcat(&fac, loc);
9078 obj = (time_put*)fac;
9079 call_locale_facet__Incref(&obj->facet);
9080 locale_facet_register(&obj->facet);
9081 _Lockit_dtor(&lock);
9083 return obj;
9086 #if _MSVCP_VER >= 70
9088 /* ?do_put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPBUtm@@DD@Z */
9089 /* ?do_put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEBUtm@@DD@Z */
9090 #if _MSVCP_VER != 80
9091 DEFINE_THISCALL_WRAPPER(time_put_char_do_put, 36)
9092 #else
9093 DEFINE_THISCALL_WRAPPER(time_put_char_do_put, 40)
9094 #endif
9095 #if _MSVCP_VER <= 100
9096 #define call_time_put_char_do_put(this, ret, dest, base, fill, t, spec, mod) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_char*, \
9097 (const time_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, const struct tm*, char, char), \
9098 (this, ret, dest, base, fill, t, spec, mod))
9099 #else
9100 #define call_time_put_char_do_put(this, ret, dest, base, fill, t, spec, mod) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_char*, \
9101 (const time_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, const struct tm*, char, char), \
9102 (this, ret, dest, base, fill, t, spec, mod))
9103 #endif
9104 ostreambuf_iterator_char* __thiscall time_put_char_do_put(const time_put *this, ostreambuf_iterator_char *ret,
9105 ostreambuf_iterator_char dest, ios_base *base, char fill, const struct tm *t, char spec, char mod)
9107 char buf[64], fmt[4], *p = fmt;
9108 MSVCP_size_t i, len;
9110 TRACE("(%p %p %p %c %p %c %c)\n", this, ret, base, fill, t, spec, mod);
9112 *p++ = '%';
9113 if(mod)
9114 *p++ = mod;
9115 *p++ = spec;
9116 *p++ = 0;
9118 len = _Strftime(buf, sizeof(buf), fmt, t, this->time.timeptr);
9119 for(i=0; i<len; i++)
9120 ostreambuf_iterator_char_put(&dest, buf[i]);
9122 *ret = dest;
9123 return ret;
9126 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPBUtm@@DD@Z */
9127 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEBUtm@@DD@Z */
9128 #if _MSVCP_VER != 80
9129 DEFINE_THISCALL_WRAPPER(time_put_char_put, 36)
9130 #else
9131 DEFINE_THISCALL_WRAPPER(time_put_char_put, 40)
9132 #endif
9133 ostreambuf_iterator_char* __thiscall time_put_char_put(const time_put *this, ostreambuf_iterator_char *ret,
9134 ostreambuf_iterator_char dest, ios_base *base, char fill, const struct tm *t, char spec, char mod)
9136 TRACE("(%p %p %p %c %p %c %c)\n", this, ret, base, fill, t, spec, mod);
9137 return call_time_put_char_do_put(this, ret, dest, base, fill, t, spec, mod);
9140 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@DPBUtm@@PBD3@Z */
9141 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@DPEBUtm@@PEBD3@Z */
9142 #if _MSVCP_VER != 80
9143 DEFINE_THISCALL_WRAPPER(time_put_char_put_format, 36)
9144 #else
9145 DEFINE_THISCALL_WRAPPER(time_put_char_put_format, 40)
9146 #endif
9147 ostreambuf_iterator_char* __thiscall time_put_char_put_format(const time_put *this, ostreambuf_iterator_char *ret,
9148 ostreambuf_iterator_char dest, ios_base *base, char fill, const struct tm *t, const char *pat, const char *pat_end)
9150 TRACE("(%p %p %p %c %p %s)\n", this, ret, base, fill, t, debugstr_an(pat, pat_end-pat));
9152 while(pat < pat_end) {
9153 if(*pat != '%') {
9154 ostreambuf_iterator_char_put(&dest, *pat++);
9155 }else if(++pat == pat_end) {
9156 ostreambuf_iterator_char_put(&dest, '%');
9157 }else if(*pat=='#' && pat+1==pat_end) {
9158 ostreambuf_iterator_char_put(&dest, '%');
9159 ostreambuf_iterator_char_put(&dest, *pat++);
9160 }else {
9161 char mod;
9163 if(*pat == '#') {
9164 mod = '#';
9165 pat++;
9166 }else {
9167 mod = 0;
9170 time_put_char_put(this, &dest, dest, base, fill, t, *pat++, mod);
9174 *ret = dest;
9175 return ret;
9178 #else /* _MSVCP_VER < 70 doesn't have the 'fill' parameter */
9180 /* ?do_put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@PBUtm@@DD@Z */
9181 /* ?do_put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@PEBUtm@@DD@Z */
9182 DEFINE_THISCALL_WRAPPER(time_put_char_do_put, 32)
9183 #define call_time_put_char_do_put(this, ret, dest, base, t, spec, mod) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_char*, \
9184 (const time_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, const struct tm*, char, char), \
9185 (this, ret, dest, base, t, spec, mod))
9186 ostreambuf_iterator_char* __thiscall time_put_char_do_put(const time_put *this, ostreambuf_iterator_char *ret,
9187 ostreambuf_iterator_char dest, ios_base *base, const struct tm *t, char spec, char mod)
9189 char buf[64], fmt[4], *p = fmt;
9190 MSVCP_size_t i, len;
9192 TRACE("(%p %p %p %p %c %c)\n", this, ret, base, t, spec, mod);
9194 *p++ = '%';
9195 if(mod)
9196 *p++ = mod;
9197 *p++ = spec;
9198 *p++ = 0;
9200 len = _Strftime(buf, sizeof(buf), fmt, t, this->time.timeptr);
9201 for(i=0; i<len; i++)
9202 ostreambuf_iterator_char_put(&dest, buf[i]);
9204 *ret = dest;
9205 return ret;
9208 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@PBUtm@@DD@Z */
9209 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@PEBUtm@@DD@Z */
9210 DEFINE_THISCALL_WRAPPER(time_put_char_put, 32)
9211 ostreambuf_iterator_char* __thiscall time_put_char_put(const time_put *this, ostreambuf_iterator_char *ret,
9212 ostreambuf_iterator_char dest, ios_base *base, const struct tm *t, char spec, char mod)
9214 TRACE("(%p %p %p %p %c %c)\n", this, ret, base, t, spec, mod);
9215 return call_time_put_char_do_put(this, ret, dest, base, t, spec, mod);
9218 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AAVios_base@2@PBUtm@@PBD3@Z */
9219 /* ?put@?$time_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@AEAVios_base@2@PEBUtm@@PEBD3@Z */
9220 DEFINE_THISCALL_WRAPPER(time_put_char_put_format, 32)
9221 ostreambuf_iterator_char* __thiscall time_put_char_put_format(const time_put *this, ostreambuf_iterator_char *ret,
9222 ostreambuf_iterator_char dest, ios_base *base, const struct tm *t, const char *pat, const char *pat_end)
9224 TRACE("(%p %p %p %p %s)\n", this, ret, base, t, debugstr_an(pat, pat_end-pat));
9226 while(pat < pat_end) {
9227 if(*pat != '%') {
9228 ostreambuf_iterator_char_put(&dest, *pat++);
9229 }else if(++pat == pat_end) {
9230 ostreambuf_iterator_char_put(&dest, '%');
9231 }else if(*pat=='#' && pat+1==pat_end) {
9232 ostreambuf_iterator_char_put(&dest, '%');
9233 ostreambuf_iterator_char_put(&dest, *pat++);
9234 }else {
9235 char mod;
9237 if(*pat == '#') {
9238 mod = '#';
9239 pat++;
9240 }else {
9241 mod = 0;
9244 time_put_char_put(this, &dest, dest, base, t, *pat++, mod);
9248 *ret = dest;
9249 return ret;
9252 #endif /* MSVCP_VER >= 70 */
9254 /* ?id@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@2V0locale@2@A */
9255 locale_id time_put_wchar_id = {0};
9256 /* ?id@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@2V0locale@2@A */
9257 locale_id time_put_short_id = {0};
9259 /* ??_7?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@6B@ */
9260 extern const vtable_ptr MSVCP_time_put_wchar_vtable;
9261 /* ??_7?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@6B@ */
9262 extern const vtable_ptr MSVCP_time_put_short_vtable;
9264 /* ?_Init@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
9265 /* ?_Init@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
9266 /* ?_Init@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
9267 /* ?_Init@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
9268 DEFINE_THISCALL_WRAPPER(time_put_wchar__Init, 8)
9269 void __thiscall time_put_wchar__Init(time_put *this, const _Locinfo *locinfo)
9271 TRACE("(%p %p)\n", this, locinfo);
9272 _Locinfo__Gettnames(locinfo, &this->time);
9273 _Locinfo__Getcvt(locinfo, &this->cvt);
9276 /* ??0?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
9277 /* ??0?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
9278 DEFINE_THISCALL_WRAPPER(time_put_wchar_ctor_locinfo, 12)
9279 time_put* __thiscall time_put_wchar_ctor_locinfo(time_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
9281 TRACE("(%p %p %lu)\n", this, locinfo, refs);
9282 locale_facet_ctor_refs(&this->facet, refs);
9283 this->facet.vtable = &MSVCP_time_put_wchar_vtable;
9284 time_put_wchar__Init(this, locinfo);
9285 return this;
9288 /* ??0?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
9289 /* ??0?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
9290 DEFINE_THISCALL_WRAPPER(time_put_short_ctor_locinfo, 12)
9291 time_put* __thiscall time_put_short_ctor_locinfo(time_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
9293 time_put_wchar_ctor_locinfo(this, locinfo, refs);
9294 this->facet.vtable = &MSVCP_time_put_short_vtable;
9295 return this;
9298 /* ??0?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IAE@PBDI@Z */
9299 /* ??0?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IEAA@PEBD_K@Z */
9300 DEFINE_THISCALL_WRAPPER(time_put_wchar_ctor_name, 12)
9301 time_put* __thiscall time_put_wchar_ctor_name(time_put *this, const char *name, MSVCP_size_t refs)
9303 _Locinfo locinfo;
9305 TRACE("(%p %s %lu)\n", this, debugstr_a(name), refs);
9307 _Locinfo_ctor_cstr(&locinfo, name);
9308 time_put_wchar_ctor_locinfo(this, &locinfo, refs);
9309 _Locinfo_dtor(&locinfo);
9310 return this;
9313 /* ??0?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IAE@PBDI@Z */
9314 /* ??0?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IEAA@PEBD_K@Z */
9315 DEFINE_THISCALL_WRAPPER(time_put_short_ctor_name, 12)
9316 time_put* __thiscall time_put_short_ctor_name(time_put *this, const char *name, MSVCP_size_t refs)
9318 time_put_wchar_ctor_name(this, name, refs);
9319 this->facet.vtable = &MSVCP_time_put_short_vtable;
9320 return this;
9323 /* ??0?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@I@Z */
9324 /* ??0?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@_K@Z */
9325 DEFINE_THISCALL_WRAPPER(time_put_wchar_ctor_refs, 8)
9326 time_put* __thiscall time_put_wchar_ctor_refs(time_put *this, MSVCP_size_t refs)
9328 _Locinfo locinfo;
9330 TRACE("(%p %lu)\n", this, refs);
9332 _Locinfo_ctor(&locinfo);
9333 time_put_wchar_ctor_locinfo(this, &locinfo, refs);
9334 _Locinfo_dtor(&locinfo);
9335 return this;
9338 /* ??0?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@I@Z */
9339 /* ??0?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@_K@Z */
9340 DEFINE_THISCALL_WRAPPER(time_put_short_ctor_refs, 8)
9341 time_put* __thiscall time_put_short_ctor_refs(time_put *this, MSVCP_size_t refs)
9343 time_put_wchar_ctor_refs(this, refs);
9344 this->facet.vtable = &MSVCP_time_put_short_vtable;
9345 return this;
9348 /* ??_F?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
9349 /* ??_F?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
9350 DEFINE_THISCALL_WRAPPER(time_put_wchar_ctor, 4)
9351 time_put* __thiscall time_put_wchar_ctor(time_put *this)
9353 return time_put_wchar_ctor_refs(this, 0);
9356 /* ??_F?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAEXXZ */
9357 /* ??_F?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAAXXZ */
9358 DEFINE_THISCALL_WRAPPER(time_put_short_ctor, 4)
9359 time_put* __thiscall time_put_short_ctor(time_put *this)
9361 time_put_wchar_ctor(this);
9362 this->facet.vtable = &MSVCP_time_put_short_vtable;
9363 return this;
9366 /* ??1?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MAE@XZ */
9367 /* ??1?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEAA@XZ */
9368 /* ??1?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MAE@XZ */
9369 /* ??1?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEAA@XZ */
9370 DEFINE_THISCALL_WRAPPER(time_put_wchar_dtor, 4)
9371 void __thiscall time_put_wchar_dtor(time_put *this)
9373 TRACE("(%p)\n", this);
9374 _Timevec_dtor(&this->time);
9377 DEFINE_THISCALL_WRAPPER(time_put_wchar_vector_dtor, 8)
9378 time_put* __thiscall time_put_wchar_vector_dtor(time_put *this, unsigned int flags)
9380 TRACE("(%p %x)\n", this, flags);
9381 if(flags & 2) {
9382 /* we have an array, with the number of elements stored before the first object */
9383 INT_PTR i, *ptr = (INT_PTR *)this-1;
9385 for(i=*ptr-1; i>=0; i--)
9386 time_put_wchar_dtor(this+i);
9387 MSVCRT_operator_delete(ptr);
9388 } else {
9389 time_put_wchar_dtor(this);
9390 if(flags & 1)
9391 MSVCRT_operator_delete(this);
9394 return this;
9397 /* ?_Getcat@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
9398 /* ?_Getcat@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
9399 MSVCP_size_t __cdecl time_put_wchar__Getcat(const locale_facet **facet, const locale *loc)
9401 TRACE("(%p %p)\n", facet, loc);
9403 if(facet && !*facet) {
9404 *facet = MSVCRT_operator_new(sizeof(time_put));
9405 if(!*facet) {
9406 ERR("Out of memory\n");
9407 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
9408 return 0;
9410 time_put_wchar_ctor_name((time_put*)*facet,
9411 locale_string_char_c_str(&loc->ptr->name), 0);
9414 return LC_TIME;
9417 /* ?_Getcat@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
9418 /* ?_Getcat@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
9419 MSVCP_size_t __cdecl time_put_wchar__Getcat_old(const locale_facet **facet)
9421 return time_put_wchar__Getcat(facet, locale_classic());
9424 static time_put* time_put_wchar_use_facet(const locale *loc)
9426 static time_put *obj = NULL;
9428 _Lockit lock;
9429 const locale_facet *fac;
9431 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
9432 fac = locale__Getfacet(loc, locale_id_operator_size_t(&time_put_wchar_id));
9433 if(fac) {
9434 _Lockit_dtor(&lock);
9435 return (time_put*)fac;
9438 if(obj) {
9439 _Lockit_dtor(&lock);
9440 return obj;
9443 time_put_wchar__Getcat(&fac, loc);
9444 obj = (time_put*)fac;
9445 call_locale_facet__Incref(&obj->facet);
9446 locale_facet_register(&obj->facet);
9447 _Lockit_dtor(&lock);
9449 return obj;
9452 /* ?_Getcat@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
9453 /* ?_Getcat@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
9454 MSVCP_size_t __cdecl time_put_short__Getcat(const locale_facet **facet, const locale *loc)
9456 TRACE("(%p %p)\n", facet, loc);
9458 if(facet && !*facet) {
9459 *facet = MSVCRT_operator_new(sizeof(time_put));
9460 if(!*facet) {
9461 ERR("Out of memory\n");
9462 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
9463 return 0;
9465 time_put_short_ctor_name((time_put*)*facet,
9466 locale_string_char_c_str(&loc->ptr->name), 0);
9469 return LC_TIME;
9472 /* ?_Getcat@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@@Z */
9473 /* ?_Getcat@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@@Z */
9474 MSVCP_size_t __cdecl time_put_short__Getcat_old(const locale_facet **facet)
9476 return time_put_short__Getcat(facet, locale_classic());
9479 static time_put* time_put_short_use_facet(const locale *loc)
9481 static time_put *obj = NULL;
9483 _Lockit lock;
9484 const locale_facet *fac;
9486 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
9487 fac = locale__Getfacet(loc, locale_id_operator_size_t(&time_put_short_id));
9488 if(fac) {
9489 _Lockit_dtor(&lock);
9490 return (time_put*)fac;
9493 if(obj) {
9494 _Lockit_dtor(&lock);
9495 return obj;
9498 time_put_short__Getcat(&fac, loc);
9499 obj = (time_put*)fac;
9500 call_locale_facet__Incref(&obj->facet);
9501 locale_facet_register(&obj->facet);
9502 _Lockit_dtor(&lock);
9504 return obj;
9507 #if _MSVCP_VER >= 70
9509 /* ?do_put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPBUtm@@DD@Z */
9510 /* ?do_put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEBUtm@@DD@Z */
9511 /* ?do_put@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPBUtm@@DD@Z */
9512 /* ?do_put@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEBUtm@@DD@Z */
9513 #if _MSVCP_VER != 80
9514 DEFINE_THISCALL_WRAPPER(time_put_wchar_do_put, 36)
9515 #else
9516 DEFINE_THISCALL_WRAPPER(time_put_wchar_do_put, 40)
9517 #endif
9518 #if _MSVCP_VER <= 100
9519 #define call_time_put_wchar_do_put(this, ret, dest, base, fill, t, spec, mod) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_wchar*, \
9520 (const time_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, const struct tm*, char, char), \
9521 (this, ret, dest, base, fill, t, spec, mod))
9522 #else
9523 #define call_time_put_wchar_do_put(this, ret, dest, base, fill, t, spec, mod) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_wchar*, \
9524 (const time_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, const struct tm*, char, char), \
9525 (this, ret, dest, base, fill, t, spec, mod))
9526 #endif
9527 ostreambuf_iterator_wchar* __thiscall time_put_wchar_do_put(const time_put *this,
9528 ostreambuf_iterator_wchar *ret, ostreambuf_iterator_wchar dest, ios_base *base,
9529 wchar_t fill, const struct tm *t, char spec, char mod)
9531 char buf[64], fmt[4], *p = fmt;
9532 MSVCP_size_t i, len;
9533 wchar_t c;
9535 TRACE("(%p %p %p %c %p %c %c)\n", this, ret, base, fill, t, spec, mod);
9537 *p++ = '%';
9538 if(mod)
9539 *p++ = mod;
9540 *p++ = spec;
9541 *p++ = 0;
9543 len = _Strftime(buf, sizeof(buf), fmt, t, this->time.timeptr);
9544 for(i=0; i<len; i++) {
9545 c = mb_to_wc(buf[i], &this->cvt);
9546 ostreambuf_iterator_wchar_put(&dest, c);
9549 *ret = dest;
9550 return ret;
9553 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPBUtm@@DD@Z */
9554 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEBUtm@@DD@Z */
9555 /* ?put@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPBUtm@@DD@Z */
9556 /* ?put@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEBUtm@@DD@Z */
9557 #if _MSVCP_VER != 80
9558 DEFINE_THISCALL_WRAPPER(time_put_wchar_put, 36)
9559 #else
9560 DEFINE_THISCALL_WRAPPER(time_put_wchar_put, 40)
9561 #endif
9562 ostreambuf_iterator_wchar* __thiscall time_put_wchar_put(const time_put *this,
9563 ostreambuf_iterator_wchar *ret, ostreambuf_iterator_wchar dest, ios_base *base,
9564 wchar_t fill, const struct tm *t, char spec, char mod)
9566 TRACE("(%p %p %p %c %p %c %c)\n", this, ret, base, fill, t, spec, mod);
9567 return call_time_put_wchar_do_put(this, ret, dest, base, fill, t, spec, mod);
9570 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@GPBUtm@@PBG3@Z */
9571 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEBUtm@@PEBG3@Z */
9572 /* ?put@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPBUtm@@PB_W4@Z */
9573 /* ?put@?$time_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEBUtm@@PEB_W4@Z */
9574 #if _MSVCP_VER != 80
9575 DEFINE_THISCALL_WRAPPER(time_put_wchar_put_format, 36)
9576 #else
9577 DEFINE_THISCALL_WRAPPER(time_put_wchar_put_format, 40)
9578 #endif
9579 ostreambuf_iterator_wchar* __thiscall time_put_wchar_put_format(const time_put *this,
9580 ostreambuf_iterator_wchar *ret, ostreambuf_iterator_wchar dest, ios_base *base,
9581 wchar_t fill, const struct tm *t, const wchar_t *pat, const wchar_t *pat_end)
9583 wchar_t percent = mb_to_wc('%', &this->cvt);
9584 char c[MB_LEN_MAX];
9586 TRACE("(%p %p %p %c %p %s)\n", this, ret, base, fill, t, debugstr_wn(pat, pat_end-pat));
9588 while(pat < pat_end) {
9589 if(*pat != percent) {
9590 ostreambuf_iterator_wchar_put(&dest, *pat++);
9591 }else if(++pat == pat_end) {
9592 ostreambuf_iterator_wchar_put(&dest, percent);
9593 }else if(_Wcrtomb(c, *pat, NULL, &this->cvt)!=1 || (*c=='#' && pat+1==pat_end)) {
9594 ostreambuf_iterator_wchar_put(&dest, percent);
9595 ostreambuf_iterator_wchar_put(&dest, *pat++);
9596 }else {
9597 pat++;
9598 if(*c == '#') {
9599 if(_Wcrtomb(c, *pat++, NULL, &this->cvt) != 1) {
9600 ostreambuf_iterator_wchar_put(&dest, percent);
9601 ostreambuf_iterator_wchar_put(&dest, *(pat-2));
9602 ostreambuf_iterator_wchar_put(&dest, *(pat-1));
9603 }else {
9604 time_put_wchar_put(this, &dest, dest, base, fill, t, *c, '#');
9606 }else {
9607 time_put_wchar_put(this, &dest, dest, base, fill, t, *c, 0);
9612 *ret = dest;
9613 return ret;
9616 #else /* _MSVCP_VER < 70 doesn't have the 'fill' parameter */
9618 /* ?do_put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@PBUtm@@DD@Z */
9619 /* ?do_put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@PEBUtm@@DD@Z */
9620 DEFINE_THISCALL_WRAPPER(time_put_wchar_do_put, 32)
9621 #define call_time_put_wchar_do_put(this, ret, dest, base, t, spec, mod) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_wchar*, \
9622 (const time_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, const struct tm*, char, char), \
9623 (this, ret, dest, base, t, spec, mod))
9624 ostreambuf_iterator_wchar* __thiscall time_put_wchar_do_put(const time_put *this,
9625 ostreambuf_iterator_wchar *ret, ostreambuf_iterator_wchar dest, ios_base *base,
9626 const struct tm *t, char spec, char mod)
9628 char buf[64], fmt[4], *p = fmt;
9629 MSVCP_size_t i, len;
9630 wchar_t c;
9632 TRACE("(%p %p %p %p %c %c)\n", this, ret, base, t, spec, mod);
9634 *p++ = '%';
9635 if(mod)
9636 *p++ = mod;
9637 *p++ = spec;
9638 *p++ = 0;
9640 len = _Strftime(buf, sizeof(buf), fmt, t, this->time.timeptr);
9641 for(i=0; i<len; i++) {
9642 c = mb_to_wc(buf[i], &this->cvt);
9643 ostreambuf_iterator_wchar_put(&dest, c);
9646 *ret = dest;
9647 return ret;
9650 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@PBUtm@@DD@Z */
9651 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@PEBUtm@@DD@Z */
9652 DEFINE_THISCALL_WRAPPER(time_put_wchar_put, 32)
9653 ostreambuf_iterator_wchar* __thiscall time_put_wchar_put(const time_put *this,
9654 ostreambuf_iterator_wchar *ret, ostreambuf_iterator_wchar dest, ios_base *base,
9655 const struct tm *t, char spec, char mod)
9657 TRACE("(%p %p %p %p %c %c)\n", this, ret, base, t, spec, mod);
9658 return call_time_put_wchar_do_put(this, ret, dest, base, t, spec, mod);
9661 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QBE?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AAVios_base@2@PBUtm@@PBG3@Z */
9662 /* ?put@?$time_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@PEBUtm@@PEBG3@Z */
9663 DEFINE_THISCALL_WRAPPER(time_put_wchar_put_format, 32)
9664 ostreambuf_iterator_wchar* __thiscall time_put_wchar_put_format(const time_put *this,
9665 ostreambuf_iterator_wchar *ret, ostreambuf_iterator_wchar dest, ios_base *base,
9666 const struct tm *t, const wchar_t *pat, const wchar_t *pat_end)
9668 wchar_t percent = mb_to_wc('%', &this->cvt);
9669 char c[MB_LEN_MAX];
9671 TRACE("(%p %p %p %p %s)\n", this, ret, base, t, debugstr_wn(pat, pat_end-pat));
9673 while(pat < pat_end) {
9674 if(*pat != percent) {
9675 ostreambuf_iterator_wchar_put(&dest, *pat++);
9676 }else if(++pat == pat_end) {
9677 ostreambuf_iterator_wchar_put(&dest, percent);
9678 }else if(_Wcrtomb(c, *pat, NULL, &this->cvt)!=1 || (*c=='#' && pat+1==pat_end)) {
9679 ostreambuf_iterator_wchar_put(&dest, percent);
9680 ostreambuf_iterator_wchar_put(&dest, *pat++);
9681 }else {
9682 pat++;
9683 if(*c == '#') {
9684 if(_Wcrtomb(c, *pat++, NULL, &this->cvt) != 1) {
9685 ostreambuf_iterator_wchar_put(&dest, percent);
9686 ostreambuf_iterator_wchar_put(&dest, *(pat-2));
9687 ostreambuf_iterator_wchar_put(&dest, *(pat-1));
9688 }else {
9689 time_put_wchar_put(this, &dest, dest, base, t, *c, '#');
9691 }else {
9692 time_put_wchar_put(this, &dest, dest, base, t, *c, 0);
9697 *ret = dest;
9698 return ret;
9701 #endif /* _MSVCP_VER >= 70 */
9703 /* ?id@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A */
9704 locale_id time_get_char_id = {0};
9706 /* ??_7?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@6B@ */
9707 extern const vtable_ptr MSVCP_time_get_char_vtable;
9709 /* ?_Init@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
9710 /* ?_Init@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
9711 DEFINE_THISCALL_WRAPPER(time_get_char__Init, 8)
9712 void __thiscall time_get_char__Init(time_get_char *this, const _Locinfo *locinfo)
9714 const char *months;
9715 const char *days;
9716 int len;
9718 TRACE("(%p %p)\n", this, locinfo);
9720 days = _Locinfo__Getdays(locinfo);
9721 len = strlen(days)+1;
9722 this->days = MSVCRT_operator_new(len);
9723 if(!this->days)
9725 ERR("Out of memory\n");
9726 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
9728 memcpy((char*)this->days, days, len);
9730 months = _Locinfo__Getmonths(locinfo);
9731 len = strlen(months)+1;
9732 this->months = MSVCRT_operator_new(len);
9733 if(!this->months)
9735 MSVCRT_operator_delete((char*)this->days);
9737 ERR("Out of memory\n");
9738 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
9740 memcpy((char*)this->months, months, len);
9742 this->dateorder = _Locinfo__Getdateorder(locinfo);
9743 _Locinfo__Getcvt(locinfo, &this->cvt);
9746 /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
9747 /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
9748 DEFINE_THISCALL_WRAPPER(time_get_char_ctor_locinfo, 12)
9749 time_get_char* __thiscall time_get_char_ctor_locinfo(time_get_char *this,
9750 const _Locinfo *locinfo, MSVCP_size_t refs)
9752 TRACE("(%p %p %lu)\n", this, locinfo, refs);
9753 locale_facet_ctor_refs(&this->facet, refs);
9754 this->facet.vtable = &MSVCP_time_get_char_vtable;
9755 time_get_char__Init(this, locinfo);
9756 return this;
9759 /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAE@PBDI@Z */
9760 /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAA@PEBD_K@Z */
9761 DEFINE_THISCALL_WRAPPER(time_get_char_ctor_name, 12)
9762 time_get_char* __thiscall time_get_char_ctor_name(time_get_char *this, const char *name, MSVCP_size_t refs)
9764 _Locinfo locinfo;
9766 TRACE("(%p %s %lu)\n", this, name, refs);
9768 _Locinfo_ctor_cstr(&locinfo, name);
9769 time_get_char_ctor_locinfo(this, &locinfo, refs);
9770 _Locinfo_dtor(&locinfo);
9771 return this;
9774 /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */
9775 /* ??0?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */
9776 DEFINE_THISCALL_WRAPPER(time_get_char_ctor_refs, 8)
9777 time_get_char* __thiscall time_get_char_ctor_refs(time_get_char *this, MSVCP_size_t refs)
9779 _Locinfo locinfo;
9781 TRACE("(%p %lu)\n", this, refs);
9783 _Locinfo_ctor(&locinfo);
9784 time_get_char_ctor_locinfo(this, &locinfo, refs);
9785 _Locinfo_dtor(&locinfo);
9786 return this;
9789 /* ??_F?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */
9790 /* ??_F?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAAXXZ */
9791 DEFINE_THISCALL_WRAPPER(time_get_char_ctor, 4)
9792 time_get_char* __thiscall time_get_char_ctor(time_get_char *this)
9794 return time_get_char_ctor_refs(this, 0);
9797 /* ?_Tidy@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AAEXXZ */
9798 /* ?_Tidy@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEAAXXZ */
9799 DEFINE_THISCALL_WRAPPER(time_get_char__Tidy, 4)
9800 void __thiscall time_get_char__Tidy(time_get_char *this)
9802 TRACE("(%p)\n", this);
9804 MSVCRT_operator_delete((char*)this->days);
9805 MSVCRT_operator_delete((char*)this->months);
9808 /* ??1?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */
9809 /* ??1?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEAA@XZ */
9810 DEFINE_THISCALL_WRAPPER(time_get_char_dtor, 4) /* virtual */
9811 void __thiscall time_get_char_dtor(time_get_char *this)
9813 TRACE("(%p)\n", this);
9815 time_get_char__Tidy(this);
9818 DEFINE_THISCALL_WRAPPER(time_get_char_vector_dtor, 8)
9819 time_get_char* __thiscall time_get_char_vector_dtor(time_get_char *this, unsigned int flags)
9821 TRACE("(%p %x)\n", this, flags);
9822 if(flags & 2) {
9823 /* we have an array, with the number of elements stored before the first object */
9824 INT_PTR i, *ptr = (INT_PTR *)this-1;
9826 for(i=*ptr-1; i>=0; i--)
9827 time_get_char_dtor(this+i);
9828 MSVCRT_operator_delete(ptr);
9829 } else {
9830 time_get_char_dtor(this);
9831 if(flags & 1)
9832 MSVCRT_operator_delete(this);
9835 return this;
9838 /* ?_Getcat@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
9839 /* ?_Getcat@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
9840 unsigned int __cdecl time_get_char__Getcat(const locale_facet **facet, const locale *loc)
9842 TRACE("(%p %p)\n", facet, loc);
9844 if(facet && !*facet) {
9845 _Locinfo locinfo;
9847 *facet = MSVCRT_operator_new(sizeof(time_get_char));
9848 if(!*facet) {
9849 ERR("Out of memory\n");
9850 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
9851 return 0;
9854 _Locinfo_ctor_cstr(&locinfo, locale_string_char_c_str(&loc->ptr->name));
9855 time_get_char_ctor_locinfo((time_get_char*)*facet, &locinfo, 0);
9856 _Locinfo_dtor(&locinfo);
9859 return LC_TIME;
9862 static time_get_char* time_get_char_use_facet(const locale *loc)
9864 static time_get_char *obj = NULL;
9866 _Lockit lock;
9867 const locale_facet *fac;
9869 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
9870 fac = locale__Getfacet(loc, locale_id_operator_size_t(&time_get_char_id));
9871 if(fac) {
9872 _Lockit_dtor(&lock);
9873 return (time_get_char*)fac;
9876 if(obj) {
9877 _Lockit_dtor(&lock);
9878 return obj;
9881 time_get_char__Getcat(&fac, loc);
9882 obj = (time_get_char*)fac;
9883 call_locale_facet__Incref(&obj->facet);
9884 locale_facet_register(&obj->facet);
9885 _Lockit_dtor(&lock);
9887 return obj;
9890 /* ?_Getint@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAHAAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@0HHAAH@Z */
9891 /* ?_Getint@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHAEAV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@0HHAEAH@Z */
9892 int __cdecl time_get_char__Getint(const time_get_char *this,
9893 istreambuf_iterator_char *b, istreambuf_iterator_char *e,
9894 int unk1, int unk2, int *val)
9896 FIXME("(%p %p %p %d %d %p) stub\n", this, b, e, unk1, unk2, val);
9897 return 0;
9900 /* ?do_date_order@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AW4dateorder@time_base@2@XZ */
9901 /* ?do_date_order@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AW4dateorder@time_base@2@XZ */
9902 DEFINE_THISCALL_WRAPPER(time_get_char_do_date_order, 4) /* virtual */
9903 #if _MSVCP_VER <= 100
9904 #define call_time_get_char_do_date_order(this) CALL_VTBL_FUNC(this, 4, dateorder, (const time_get_char*), (this))
9905 #else
9906 #define call_time_get_char_do_date_order(this) CALL_VTBL_FUNC(this, 12, dateorder, (const time_get_char*), (this))
9907 #endif
9908 dateorder __thiscall time_get_char_do_date_order(const time_get_char *this)
9910 TRACE("(%p)\n", this);
9911 return this->dateorder;
9914 /* ?date_order@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AW4dateorder@time_base@2@XZ */
9915 /* ?date_order@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AW4dateorder@time_base@2@XZ */
9916 DEFINE_THISCALL_WRAPPER(time_get_char_date_order, 4)
9917 dateorder __thiscall time_get_char_date_order(const time_get_char *this)
9919 return call_time_get_char_do_date_order(this);
9922 /* ?do_get_date@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
9923 /* ?do_get_date@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
9924 DEFINE_THISCALL_WRAPPER(time_get_char_do_get_date, 36) /* virtual */
9925 #if _MSVCP_VER <= 100
9926 #define call_time_get_char_do_get_date(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_char*, \
9927 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
9928 (this, ret, s, e, base, err, t))
9929 #else
9930 #define call_time_get_char_do_get_date(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_char*, \
9931 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
9932 (this, ret, s, e, base, err, t))
9933 #endif
9934 istreambuf_iterator_char* __thiscall time_get_char_do_get_date(const time_get_char *this,
9935 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
9936 ios_base *base, int *err, struct tm *t)
9938 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, err, t);
9939 return NULL;
9942 /* ?get_date@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
9943 /* ?get_date@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
9944 DEFINE_THISCALL_WRAPPER(time_get_char_get_date, 36)
9945 istreambuf_iterator_char* __thiscall time_get_char_get_date(const time_get_char *this,
9946 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
9947 ios_base *base, int *err, struct tm *t)
9949 return call_time_get_char_do_get_date(this, ret, s, e, base, err, t);
9952 /* ?do_get_monthname@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
9953 /* ?do_get_monthname@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
9954 DEFINE_THISCALL_WRAPPER(time_get_char_do_get_monthname, 36) /* virtual */
9955 #if _MSVCP_VER <= 100
9956 #define call_time_get_char_do_get_monthname(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_char*, \
9957 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
9958 (this, ret, s, e, base, err, t))
9959 #else
9960 #define call_time_get_char_do_get_monthname(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_char*, \
9961 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
9962 (this, ret, s, e, base, err, t))
9963 #endif
9964 istreambuf_iterator_char* __thiscall time_get_char_do_get_monthname(const time_get_char *this,
9965 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
9966 ios_base *base, int *err, struct tm *t)
9968 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, err, t);
9969 return NULL;
9972 /* ?get_monthname@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
9973 /* ?get_monthname@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
9974 DEFINE_THISCALL_WRAPPER(time_get_char_get_monthname, 36)
9975 istreambuf_iterator_char* __thiscall time_get_char_get_monthname(const time_get_char *this,
9976 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
9977 ios_base *base, int *err, struct tm *t)
9979 return call_time_get_char_do_get_monthname(this, ret, s, e, base, err, t);
9982 /* ?do_get_time@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
9983 /* ?do_get_time@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
9984 DEFINE_THISCALL_WRAPPER(time_get_char_do_get_time, 36) /* virtual */
9985 #if _MSVCP_VER <= 100
9986 #define call_time_get_char_do_get_time(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 8, istreambuf_iterator_char*, \
9987 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
9988 (this, ret, s, e, base, err, t))
9989 #else
9990 #define call_time_get_char_do_get_time(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_char*, \
9991 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
9992 (this, ret, s, e, base, err, t))
9993 #endif
9994 istreambuf_iterator_char* __thiscall time_get_char_do_get_time(const time_get_char *this,
9995 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
9996 ios_base *base, int *err, struct tm *t)
9998 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, err, t);
9999 return NULL;
10002 /* ?get_time@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
10003 /* ?get_time@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
10004 DEFINE_THISCALL_WRAPPER(time_get_char_get_time, 36)
10005 istreambuf_iterator_char* __thiscall time_get_char_get_time(const time_get_char *this,
10006 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
10007 ios_base *base, int *err, struct tm *t)
10009 return call_time_get_char_do_get_time(this, ret, s, e, base, err, t);
10012 /* ?do_get_weekday@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
10013 /* ?do_get_weekday@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
10014 DEFINE_THISCALL_WRAPPER(time_get_char_do_get_weekday, 36) /* virtual */
10015 #if _MSVCP_VER <= 100
10016 #define call_time_get_char_do_get_weekday(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_char*, \
10017 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
10018 (this, ret, s, e, base, err, t))
10019 #else
10020 #define call_time_get_char_do_get_weekday(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_char*, \
10021 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
10022 (this, ret, s, e, base, err, t))
10023 #endif
10024 istreambuf_iterator_char* __thiscall time_get_char_do_get_weekday(const time_get_char *this,
10025 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
10026 ios_base *base, int *err, struct tm *t)
10028 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, err, t);
10029 return NULL;
10032 /* ?get_weekday@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
10033 /* ?get_weekday@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
10034 DEFINE_THISCALL_WRAPPER(time_get_char_get_weekday, 36)
10035 istreambuf_iterator_char* __thiscall time_get_char_get_weekday(const time_get_char *this,
10036 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
10037 ios_base *base, int *err, struct tm *t)
10039 return call_time_get_char_do_get_weekday(this, ret, s, e, base, err, t);
10042 /* ?do_get_year@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
10043 /* ?do_get_year@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
10044 DEFINE_THISCALL_WRAPPER(time_get_char_do_get_year, 36) /* virtual */
10045 #if _MSVCP_VER <= 100
10046 #define call_time_get_char_do_get_year(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_char*, \
10047 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
10048 (this, ret, s, e, base, err, t))
10049 #else
10050 #define call_time_get_char_do_get_year(this, ret, s, e, base, err, t) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_char*, \
10051 (const time_get_char*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, struct tm*), \
10052 (this, ret, s, e, base, err, t))
10053 #endif
10054 istreambuf_iterator_char* __thiscall time_get_char_do_get_year(const time_get_char *this,
10055 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
10056 ios_base *base, int *err, struct tm *t)
10058 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, err, t);
10059 return NULL;
10062 /* ?get_year@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QBE?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AAVios_base@2@AAHPAUtm@@@Z */
10063 /* ?get_year@?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEBA?AV?$istreambuf_iterator@DU?$char_traits@D@std@@@2@V32@0AEAVios_base@2@AEAHPEAUtm@@@Z */
10064 DEFINE_THISCALL_WRAPPER(time_get_char_get_year, 36)
10065 istreambuf_iterator_char* __thiscall time_get_char_get_year(const time_get_char *this,
10066 istreambuf_iterator_char *ret, istreambuf_iterator_char s, istreambuf_iterator_char e,
10067 ios_base *base, int *err, struct tm *t)
10069 return call_time_get_char_do_get_year(this, ret, s, e, base, err, t);
10072 /* ??_7_Locimp@locale@std@@6B@ */
10073 extern const vtable_ptr MSVCP_locale__Locimp_vtable;
10075 /* ??0_Locimp@locale@std@@AAE@_N@Z */
10076 /* ??0_Locimp@locale@std@@AEAA@_N@Z */
10077 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor_transparent, 8)
10078 locale__Locimp* __thiscall locale__Locimp_ctor_transparent(locale__Locimp *this, MSVCP_bool transparent)
10080 TRACE("(%p %d)\n", this, transparent);
10082 memset(this, 0, sizeof(locale__Locimp));
10083 locale_facet_ctor_refs(&this->facet, 1);
10084 this->facet.vtable = &MSVCP_locale__Locimp_vtable;
10085 this->transparent = transparent;
10086 locale_string_char_ctor_cstr(&this->name, "*");
10087 return this;
10090 /* ??_F_Locimp@locale@std@@QAEXXZ */
10091 /* ??_F_Locimp@locale@std@@QEAAXXZ */
10092 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor, 4)
10093 locale__Locimp* __thiscall locale__Locimp_ctor(locale__Locimp *this)
10095 return locale__Locimp_ctor_transparent(this, FALSE);
10098 /* ??0_Locimp@locale@std@@AAE@ABV012@@Z */
10099 /* ??0_Locimp@locale@std@@AEAA@AEBV012@@Z */
10100 DEFINE_THISCALL_WRAPPER(locale__Locimp_copy_ctor, 8)
10101 locale__Locimp* __thiscall locale__Locimp_copy_ctor(locale__Locimp *this, const locale__Locimp *copy)
10103 _Lockit lock;
10104 MSVCP_size_t i;
10106 TRACE("(%p %p)\n", this, copy);
10108 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
10109 memcpy(this, copy, sizeof(locale__Locimp));
10110 locale_facet_ctor_refs(&this->facet, 1);
10111 this->facet.vtable = &MSVCP_locale__Locimp_vtable;
10112 if(copy->facetvec) {
10113 this->facetvec = MSVCRT_operator_new(copy->facet_cnt*sizeof(locale_facet*));
10114 if(!this->facetvec) {
10115 _Lockit_dtor(&lock);
10116 ERR("Out of memory\n");
10117 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10118 return NULL;
10120 for(i=0; i<this->facet_cnt; i++)
10122 this->facetvec[i] = copy->facetvec[i];
10123 if(this->facetvec[i])
10124 call_locale_facet__Incref(this->facetvec[i]);
10127 locale_string_char_copy_ctor(&this->name, &copy->name);
10128 _Lockit_dtor(&lock);
10129 return this;
10132 /* ?_Locimp_ctor@_Locimp@locale@std@@CAXPAV123@ABV123@@Z */
10133 /* ?_Locimp_ctor@_Locimp@locale@std@@CAXPEAV123@AEBV123@@Z */
10134 locale__Locimp* __cdecl locale__Locimp__Locimp_ctor(locale__Locimp *this, const locale__Locimp *copy)
10136 return locale__Locimp_copy_ctor(this, copy);
10139 /* ??1_Locimp@locale@std@@MAE@XZ */
10140 /* ??1_Locimp@locale@std@@MEAA@XZ */
10141 DEFINE_THISCALL_WRAPPER(locale__Locimp_dtor, 4)
10142 void __thiscall locale__Locimp_dtor(locale__Locimp *this)
10144 MSVCP_size_t i;
10146 TRACE("(%p)\n", this);
10148 locale_facet_dtor(&this->facet);
10149 for(i=0; i<this->facet_cnt; i++)
10150 if(this->facetvec[i] && call_locale_facet__Decref(this->facetvec[i]))
10151 call_locale_facet_vector_dtor(this->facetvec[i], 1);
10153 MSVCRT_operator_delete(this->facetvec);
10154 locale_string_char_dtor(&this->name);
10157 /* ?_Locimp_dtor@_Locimp@locale@std@@CAXPAV123@@Z */
10158 /* ?_Locimp_dtor@_Locimp@locale@std@@CAXPEAV123@@Z */
10159 void __cdecl locale__Locimp__Locimp_dtor(locale__Locimp *this)
10161 locale__Locimp_dtor(this);
10164 DEFINE_THISCALL_WRAPPER(locale__Locimp_vector_dtor, 8)
10165 locale__Locimp* __thiscall locale__Locimp_vector_dtor(locale__Locimp *this, unsigned int flags)
10167 TRACE("(%p %x)\n", this, flags);
10168 if(flags & 2) {
10169 /* we have an array, with the number of elements stored before the first object */
10170 INT_PTR i, *ptr = (INT_PTR *)this-1;
10172 for(i=*ptr-1; i>=0; i--)
10173 locale__Locimp_dtor(this+i);
10174 MSVCRT_operator_delete(ptr);
10175 } else {
10176 locale__Locimp_dtor(this);
10177 if(flags & 1)
10178 MSVCRT_operator_delete(this);
10181 return this;
10184 /* ?_New_Locimp@_Locimp@locale@std@@CAPAV123@ABV123@@Z */
10185 /* ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@AEBV123@@Z */
10186 locale__Locimp* __cdecl locale__Locimp__New_Locimp(const locale__Locimp *copy)
10188 locale__Locimp *ret;
10190 TRACE("(%p)\n", copy);
10192 ret = MSVCRT_operator_new(sizeof(locale__Locimp));
10193 if(!ret) {
10194 ERR("Out of memory\n");
10195 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10196 return NULL;
10198 return locale__Locimp_copy_ctor(ret, copy);
10201 /* ?_New_Locimp@_Locimp@locale@std@@CAPAV123@_N@Z */
10202 /* ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@_N@Z */
10203 locale__Locimp* __cdecl locale__Locimp__New_Locimp_transparent(MSVCP_bool transparent)
10205 locale__Locimp *ret;
10207 TRACE("(%x)\n", transparent);
10209 ret = MSVCRT_operator_new(sizeof(locale__Locimp));
10210 if(!ret) {
10211 ERR("Out of memory\n");
10212 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10213 return NULL;
10215 return locale__Locimp_ctor_transparent(ret, transparent);
10218 /* ?_Locimp_Addfac@_Locimp@locale@std@@CAXPAV123@PAVfacet@23@I@Z */
10219 /* ?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z */
10220 void __cdecl locale__Locimp__Locimp_Addfac(locale__Locimp *locimp, locale_facet *facet, MSVCP_size_t id)
10222 _Lockit lock;
10224 TRACE("(%p %p %lu)\n", locimp, facet, id);
10226 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
10227 if(id >= locimp->facet_cnt) {
10228 MSVCP_size_t new_size = id+1;
10229 locale_facet **new_facetvec;
10231 if(new_size < 40)
10232 new_size = 40;
10234 new_facetvec = MSVCRT_operator_new(sizeof(locale_facet*)*new_size);
10235 if(!new_facetvec) {
10236 _Lockit_dtor(&lock);
10237 ERR("Out of memory\n");
10238 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10239 return;
10242 memset(new_facetvec, 0, sizeof(locale_facet*)*new_size);
10243 memcpy(new_facetvec, locimp->facetvec, sizeof(locale_facet*)*locimp->facet_cnt);
10244 MSVCRT_operator_delete(locimp->facetvec);
10245 locimp->facetvec = new_facetvec;
10246 locimp->facet_cnt = new_size;
10249 if(locimp->facetvec[id] && call_locale_facet__Decref(locimp->facetvec[id]))
10250 call_locale_facet_vector_dtor(locimp->facetvec[id], 1);
10252 locimp->facetvec[id] = facet;
10253 if(facet)
10254 call_locale_facet__Incref(facet);
10255 _Lockit_dtor(&lock);
10258 /* ?_Addfac@_Locimp@locale@std@@AAEXPAVfacet@23@I@Z */
10259 /* ?_Addfac@_Locimp@locale@std@@AEAAXPEAVfacet@23@_K@Z */
10260 DEFINE_THISCALL_WRAPPER(locale__Locimp__Addfac, 12)
10261 void __thiscall locale__Locimp__Addfac(locale__Locimp *this, locale_facet *facet, MSVCP_size_t id)
10263 locale__Locimp__Locimp_Addfac(this, facet, id);
10266 /* ?_Clocptr_func@_Locimp@locale@std@@CAAAPAV123@XZ */
10267 /* ?_Clocptr_func@_Locimp@locale@std@@CAAEAPEAV123@XZ */
10268 locale__Locimp** __cdecl locale__Locimp__Clocptr_func(void)
10270 FIXME("stub\n");
10271 return NULL;
10274 /* ?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
10275 /* ?_Makeushloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
10276 /* List of missing facets:
10277 * messages, money_get, money_put, moneypunct, moneypunct, time_get
10279 void __cdecl locale__Locimp__Makeushloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
10281 FIXME("(%p %d %p %p) semi-stub\n", locinfo, cat, locimp, loc);
10283 if(cat & (1<<(ctype_short__Getcat(NULL, NULL)-1))) {
10284 ctype_wchar *ctype;
10286 if(loc) {
10287 ctype = ctype_short_use_facet(loc);
10288 }else {
10289 ctype = MSVCRT_operator_new(sizeof(ctype_wchar));
10290 if(!ctype) {
10291 ERR("Out of memory\n");
10292 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10294 ctype_short_ctor_locinfo(ctype, locinfo, 0);
10296 locale__Locimp__Addfac(locimp, &ctype->base.facet, locale_id_operator_size_t(&ctype_short_id));
10299 if(cat & (1<<(num_get_short__Getcat(NULL, NULL)-1))) {
10300 num_get *numget;
10302 if(loc) {
10303 numget = num_get_short_use_facet(loc);
10304 }else {
10305 numget = MSVCRT_operator_new(sizeof(num_get));
10306 if(!numget) {
10307 ERR("Out of memory\n");
10308 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10310 num_get_short_ctor_locinfo(numget, locinfo, 0);
10312 locale__Locimp__Addfac(locimp, &numget->facet, locale_id_operator_size_t(&num_get_short_id));
10315 if(cat & (1<<(num_put_short__Getcat(NULL, NULL)-1))) {
10316 num_put *numput;
10318 if(loc) {
10319 numput = num_put_short_use_facet(loc);
10320 }else {
10321 numput = MSVCRT_operator_new(sizeof(num_put));
10322 if(!numput) {
10323 ERR("Out of memory\n");
10324 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10326 num_put_short_ctor_locinfo(numput, locinfo, 0);
10328 locale__Locimp__Addfac(locimp, &numput->facet, locale_id_operator_size_t(&num_put_short_id));
10331 if(cat & (1<<(numpunct_short__Getcat(NULL, NULL)-1))) {
10332 numpunct_wchar *numpunct;
10334 if(loc) {
10335 numpunct = numpunct_short_use_facet(loc);
10336 }else {
10337 numpunct = MSVCRT_operator_new(sizeof(numpunct_wchar));
10338 if(!numpunct) {
10339 ERR("Out of memory\n");
10340 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10342 numpunct_short_ctor_locinfo(numpunct, locinfo, 0, FALSE);
10344 locale__Locimp__Addfac(locimp, &numpunct->facet, locale_id_operator_size_t(&numpunct_short_id));
10347 if(cat & (1<<(collate_short__Getcat(NULL, NULL)-1))) {
10348 collate *c;
10350 if(loc) {
10351 c = collate_short_use_facet(loc);
10352 }else {
10353 c = MSVCRT_operator_new(sizeof(collate));
10354 if(!c) {
10355 ERR("Out of memory\n");
10356 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10358 collate_short_ctor_locinfo(c, locinfo, 0);
10360 locale__Locimp__Addfac(locimp, &c->facet, locale_id_operator_size_t(&collate_short_id));
10363 if(cat & (1<<(time_put_short__Getcat(NULL, NULL)-1))) {
10364 time_put *t;
10366 if(loc) {
10367 t = time_put_short_use_facet(loc);
10368 }else {
10369 t = MSVCRT_operator_new(sizeof(time_put));
10370 if(!t) {
10371 ERR("Out of memory\n");
10372 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10374 time_put_short_ctor_locinfo(t, locinfo, 0);
10376 locale__Locimp__Addfac(locimp, &t->facet, locale_id_operator_size_t(&time_put_short_id));
10379 if(cat & (1<<(codecvt_short__Getcat(NULL, NULL)-1))) {
10380 codecvt_wchar *codecvt;
10382 if(loc) {
10383 codecvt = codecvt_short_use_facet(loc);
10384 }else {
10385 codecvt = MSVCRT_operator_new(sizeof(codecvt_wchar));
10386 if(!codecvt) {
10387 ERR("Out of memory\n");
10388 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10390 codecvt_short_ctor_locinfo(codecvt, locinfo, 0);
10392 locale__Locimp__Addfac(locimp, &codecvt->base.facet, locale_id_operator_size_t(&codecvt_short_id));
10396 /* ?_Makewloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
10397 /* ?_Makewloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
10398 /* List of missing facets:
10399 * messages, money_get, money_put, moneypunct, moneypunct, time_get
10401 void __cdecl locale__Locimp__Makewloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
10403 FIXME("(%p %d %p %p) semi-stub\n", locinfo, cat, locimp, loc);
10405 if(cat & (1<<(ctype_wchar__Getcat(NULL, NULL)-1))) {
10406 ctype_wchar *ctype;
10408 if(loc) {
10409 ctype = ctype_wchar_use_facet(loc);
10410 }else {
10411 ctype = MSVCRT_operator_new(sizeof(ctype_wchar));
10412 if(!ctype) {
10413 ERR("Out of memory\n");
10414 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10416 ctype_wchar_ctor_locinfo(ctype, locinfo, 0);
10418 locale__Locimp__Addfac(locimp, &ctype->base.facet, locale_id_operator_size_t(&ctype_wchar_id));
10421 if(cat & (1<<(num_get_wchar__Getcat(NULL, NULL)-1))) {
10422 num_get *numget;
10424 if(loc) {
10425 numget = num_get_wchar_use_facet(loc);
10426 }else {
10427 numget = MSVCRT_operator_new(sizeof(num_get));
10428 if(!numget) {
10429 ERR("Out of memory\n");
10430 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10432 num_get_wchar_ctor_locinfo(numget, locinfo, 0);
10434 locale__Locimp__Addfac(locimp, &numget->facet, locale_id_operator_size_t(&num_get_wchar_id));
10437 if(cat & (1<<(num_put_wchar__Getcat(NULL, NULL)-1))) {
10438 num_put *numput;
10440 if(loc) {
10441 numput = num_put_wchar_use_facet(loc);
10442 }else {
10443 numput = MSVCRT_operator_new(sizeof(num_put));
10444 if(!numput) {
10445 ERR("Out of memory\n");
10446 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10448 num_put_wchar_ctor_locinfo(numput, locinfo, 0);
10450 locale__Locimp__Addfac(locimp, &numput->facet, locale_id_operator_size_t(&num_put_wchar_id));
10453 if(cat & (1<<(numpunct_wchar__Getcat(NULL, NULL)-1))) {
10454 numpunct_wchar *numpunct;
10456 if(loc) {
10457 numpunct = numpunct_wchar_use_facet(loc);
10458 }else {
10459 numpunct = MSVCRT_operator_new(sizeof(numpunct_wchar));
10460 if(!numpunct) {
10461 ERR("Out of memory\n");
10462 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10464 numpunct_wchar_ctor_locinfo(numpunct, locinfo, 0, FALSE);
10466 locale__Locimp__Addfac(locimp, &numpunct->facet, locale_id_operator_size_t(&numpunct_wchar_id));
10469 if(cat & (1<<(collate_wchar__Getcat(NULL, NULL)-1))) {
10470 collate *c;
10472 if(loc) {
10473 c = collate_wchar_use_facet(loc);
10474 }else {
10475 c = MSVCRT_operator_new(sizeof(collate));
10476 if(!c) {
10477 ERR("Out of memory\n");
10478 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10480 collate_wchar_ctor_locinfo(c, locinfo, 0);
10482 locale__Locimp__Addfac(locimp, &c->facet, locale_id_operator_size_t(&collate_wchar_id));
10485 if(cat & (1<<(time_put_wchar__Getcat(NULL, NULL)-1))) {
10486 time_put *t;
10488 if(loc) {
10489 t = time_put_wchar_use_facet(loc);
10490 }else {
10491 t = MSVCRT_operator_new(sizeof(time_put));
10492 if(!t) {
10493 ERR("Out of memory\n");
10494 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10496 time_put_wchar_ctor_locinfo(t, locinfo, 0);
10498 locale__Locimp__Addfac(locimp, &t->facet, locale_id_operator_size_t(&time_put_wchar_id));
10501 if(cat & (1<<(codecvt_wchar__Getcat(NULL, NULL)-1))) {
10502 codecvt_wchar *codecvt;
10504 if(loc) {
10505 codecvt = codecvt_wchar_use_facet(loc);
10506 }else {
10507 codecvt = MSVCRT_operator_new(sizeof(codecvt_wchar));
10508 if(!codecvt) {
10509 ERR("Out of memory\n");
10510 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10512 codecvt_wchar_ctor_locinfo(codecvt, locinfo, 0);
10514 locale__Locimp__Addfac(locimp, &codecvt->base.facet, locale_id_operator_size_t(&codecvt_wchar_id));
10518 /* ?_Makexloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
10519 /* ?_Makexloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
10520 /* List of missing facets:
10521 * messages, money_get, money_put, moneypunct, moneypunct, time_get
10523 void __cdecl locale__Locimp__Makexloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
10525 FIXME("(%p %d %p %p) semi-stub\n", locinfo, cat, locimp, loc);
10527 if(cat & (1<<(ctype_char__Getcat(NULL, NULL)-1))) {
10528 ctype_char *ctype;
10530 if(loc) {
10531 ctype = ctype_char_use_facet(loc);
10532 }else {
10533 ctype = MSVCRT_operator_new(sizeof(ctype_char));
10534 if(!ctype) {
10535 ERR("Out of memory\n");
10536 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10538 ctype_char_ctor_locinfo(ctype, locinfo, 0);
10540 locale__Locimp__Addfac(locimp, &ctype->base.facet, locale_id_operator_size_t(&ctype_char_id));
10543 if(cat & (1<<(num_get_char__Getcat(NULL, NULL)-1))) {
10544 num_get *numget;
10546 if(loc) {
10547 numget = num_get_char_use_facet(loc);
10548 }else {
10549 numget = MSVCRT_operator_new(sizeof(num_get));
10550 if(!numget) {
10551 ERR("Out of memory\n");
10552 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10554 num_get_char_ctor_locinfo(numget, locinfo, 0);
10556 locale__Locimp__Addfac(locimp, &numget->facet, locale_id_operator_size_t(&num_get_char_id));
10559 if(cat & (1<<(num_put_char__Getcat(NULL, NULL)-1))) {
10560 num_put *numput;
10562 if(loc) {
10563 numput = num_put_char_use_facet(loc);
10564 }else {
10565 numput = MSVCRT_operator_new(sizeof(num_put));
10566 if(!numput) {
10567 ERR("Out of memory\n");
10568 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10570 num_put_char_ctor_locinfo(numput, locinfo, 0);
10572 locale__Locimp__Addfac(locimp, &numput->facet, locale_id_operator_size_t(&num_put_char_id));
10575 if(cat & (1<<(numpunct_char__Getcat(NULL, NULL)-1))) {
10576 numpunct_char *numpunct;
10578 if(loc) {
10579 numpunct = numpunct_char_use_facet(loc);
10580 }else {
10581 numpunct = MSVCRT_operator_new(sizeof(numpunct_char));
10582 if(!numpunct) {
10583 ERR("Out of memory\n");
10584 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10586 numpunct_char_ctor_locinfo(numpunct, locinfo, 0, FALSE);
10588 locale__Locimp__Addfac(locimp, &numpunct->facet, locale_id_operator_size_t(&numpunct_char_id));
10591 if(cat & (1<<(collate_char__Getcat(NULL, NULL)-1))) {
10592 collate *c;
10594 if(loc) {
10595 c = collate_char_use_facet(loc);
10596 }else {
10597 c = MSVCRT_operator_new(sizeof(collate));
10598 if(!c) {
10599 ERR("Out of memory\n");
10600 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10602 collate_char_ctor_locinfo(c, locinfo, 0);
10604 locale__Locimp__Addfac(locimp, &c->facet, locale_id_operator_size_t(&collate_char_id));
10607 if(cat & (1<<(time_get_char__Getcat(NULL, NULL)-1))) {
10608 time_get_char *t;
10610 if(loc) {
10611 t = time_get_char_use_facet(loc);
10612 }else {
10613 t = MSVCRT_operator_new(sizeof(time_get_char));
10614 if(!t) {
10615 ERR("Out of memory\n");
10616 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10618 time_get_char_ctor_locinfo(t, locinfo, 0);
10620 locale__Locimp__Addfac(locimp, &t->facet, locale_id_operator_size_t(&time_get_char_id));
10623 if(cat & (1<<(time_put_char__Getcat(NULL, NULL)-1))) {
10624 time_put *t;
10626 if(loc) {
10627 t = time_put_char_use_facet(loc);
10628 }else {
10629 t = MSVCRT_operator_new(sizeof(time_put));
10630 if(!t) {
10631 ERR("Out of memory\n");
10632 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10634 time_put_char_ctor_locinfo(t, locinfo, 0);
10636 locale__Locimp__Addfac(locimp, &t->facet, locale_id_operator_size_t(&time_put_char_id));
10639 if(cat & (1<<(codecvt_char__Getcat(NULL, NULL)-1))) {
10640 codecvt_char *codecvt;
10642 if(loc) {
10643 codecvt = codecvt_char_use_facet(loc);
10644 }else {
10645 codecvt = MSVCRT_operator_new(sizeof(codecvt_char));
10646 if(!codecvt) {
10647 ERR("Out of memory\n");
10648 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10650 codecvt_char_ctor_locinfo(codecvt, locinfo, 0);
10652 locale__Locimp__Addfac(locimp, &codecvt->base.facet, locale_id_operator_size_t(&codecvt_char_id));
10656 /* ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z */
10657 /* ?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
10658 locale__Locimp* __cdecl locale__Locimp__Makeloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
10660 TRACE("(%p %d %p %p)\n", locinfo, cat, locimp, loc);
10662 locale__Locimp__Makexloc(locinfo, cat, locimp, loc);
10663 locale__Locimp__Makewloc(locinfo, cat, locimp, loc);
10664 locale__Locimp__Makeushloc(locinfo, cat, locimp, loc);
10666 locimp->catmask |= cat;
10667 locale_string_char_assign(&locimp->name, &locinfo->newlocname);
10668 return locimp;
10671 /* ??0locale@std@@AAE@PAV_Locimp@01@@Z */
10672 /* ??0locale@std@@AEAA@PEAV_Locimp@01@@Z */
10673 DEFINE_THISCALL_WRAPPER(locale_ctor_locimp, 8)
10674 locale* __thiscall locale_ctor_locimp(locale *this, locale__Locimp *locimp)
10676 TRACE("(%p %p)\n", this, locimp);
10677 /* Don't change locimp reference counter */
10678 this->ptr = locimp;
10679 return this;
10682 /* ?_Init@locale@std@@CAPAV_Locimp@12@XZ */
10683 /* ?_Init@locale@std@@CAPEAV_Locimp@12@XZ */
10684 locale__Locimp* __cdecl locale__Init(void)
10686 _Lockit lock;
10688 TRACE("\n");
10690 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
10691 if(global_locale) {
10692 _Lockit_dtor(&lock);
10693 return global_locale;
10696 global_locale = MSVCRT_operator_new(sizeof(locale__Locimp));
10697 if(!global_locale) {
10698 _Lockit_dtor(&lock);
10699 ERR("Out of memory\n");
10700 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10701 return NULL;
10704 locale__Locimp_ctor(global_locale);
10705 global_locale->catmask = (1<<(LC_MAX+1))-1;
10706 locale_string_char_dtor(&global_locale->name);
10707 locale_string_char_ctor_cstr(&global_locale->name, "C");
10709 locale__Locimp__Clocptr = global_locale;
10710 global_locale->facet.refs++;
10711 locale_ctor_locimp(&classic_locale, locale__Locimp__Clocptr);
10712 _Lockit_dtor(&lock);
10714 return global_locale;
10717 /* ?_Init@locale@std@@CAPAV_Locimp@12@_N@Z */
10718 /* ?_Init@locale@std@@CAPEAV_Locimp@12@_N@Z */
10719 locale__Locimp* __cdecl locale__Init_ref(MSVCP_bool inc_ref)
10721 locale__Locimp *ret;
10722 _Lockit lock;
10724 TRACE("(%x)\n", inc_ref);
10726 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
10727 if(inc_ref && global_locale) {
10728 call_locale_facet__Incref(&global_locale->facet);
10729 _Lockit_dtor(&lock);
10730 return global_locale;
10733 ret = locale__Init();
10734 _Lockit_dtor(&lock);
10735 return ret;
10738 /* ?_Iscloc@locale@std@@QBE_NXZ */
10739 /* ?_Iscloc@locale@std@@QEBA_NXZ */
10740 DEFINE_THISCALL_WRAPPER(locale__Iscloc, 4)
10741 MSVCP_bool __thiscall locale__Iscloc(const locale *this)
10743 TRACE("(%p)\n", this);
10744 return this->ptr == locale__Locimp__Clocptr;
10747 /* ??0locale@std@@QAE@ABV01@0H@Z */
10748 /* ??0locale@std@@QEAA@AEBV01@0H@Z */
10749 DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale, 16)
10750 locale* __thiscall locale_ctor_locale_locale(locale *this, const locale *loc, const locale *other, category cat)
10752 _Locinfo locinfo;
10754 TRACE("(%p %p %p %d)\n", this, loc, other, cat);
10756 this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
10757 if(!this->ptr) {
10758 ERR("Out of memory\n");
10759 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10761 locale__Locimp_copy_ctor(this->ptr, loc->ptr);
10763 _Locinfo_ctor_cat_cstr(&locinfo, loc->ptr->catmask, locale_string_char_c_str(&loc->ptr->name));
10764 _Locinfo__Addcats(&locinfo, cat & other->ptr->catmask, locale_string_char_c_str(&other->ptr->name));
10765 locale__Locimp__Makeloc(&locinfo, cat, this->ptr, other);
10766 _Locinfo_dtor(&locinfo);
10768 return this;
10771 /* ??0locale@std@@QAE@ABV01@@Z */
10772 /* ??0locale@std@@QEAA@AEBV01@@Z */
10773 DEFINE_THISCALL_WRAPPER(locale_copy_ctor, 8)
10774 locale* __thiscall locale_copy_ctor(locale *this, const locale *copy)
10776 TRACE("(%p %p)\n", this, copy);
10777 this->ptr = copy->ptr;
10778 call_locale_facet__Incref(&this->ptr->facet);
10779 return this;
10782 /* ??0locale@std@@QAE@ABV01@PBDH@Z */
10783 /* ??0locale@std@@QEAA@AEBV01@PEBDH@Z */
10784 DEFINE_THISCALL_WRAPPER(locale_ctor_locale_cstr, 16)
10785 locale* __thiscall locale_ctor_locale_cstr(locale *this, const locale *loc, const char *locname, category cat)
10787 _Locinfo locinfo;
10789 TRACE("(%p %p %s %d)\n", this, loc, locname, cat);
10791 _Locinfo_ctor_cat_cstr(&locinfo, cat, locname);
10792 if(!memcmp(locale_string_char_c_str(&locinfo.newlocname), "*", 2)) {
10793 _Locinfo_dtor(&locinfo);
10794 MSVCRT_operator_delete(this->ptr);
10795 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
10798 this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
10799 if(!this->ptr) {
10800 ERR("Out of memory\n");
10801 _Locinfo_dtor(&locinfo);
10802 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10804 locale__Locimp_copy_ctor(this->ptr, loc->ptr);
10806 locale__Locimp__Makeloc(&locinfo, cat, this->ptr, NULL);
10807 _Locinfo_dtor(&locinfo);
10808 return this;
10811 /* ??0locale@std@@QAE@PBDH@Z */
10812 /* ??0locale@std@@QEAA@PEBDH@Z */
10813 DEFINE_THISCALL_WRAPPER(locale_ctor_cstr, 12)
10814 locale* __thiscall locale_ctor_cstr(locale *this, const char *locname, category cat)
10816 _Locinfo locinfo;
10818 TRACE("(%p %s %d)\n", this, locname, cat);
10820 this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
10821 if(!this->ptr) {
10822 ERR("Out of memory\n");
10823 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10825 locale__Locimp_ctor(this->ptr);
10827 locale__Init();
10829 _Locinfo_ctor_cat_cstr(&locinfo, cat, locname);
10830 if(!memcmp(locale_string_char_c_str(&locinfo.newlocname), "*", 2)) {
10831 _Locinfo_dtor(&locinfo);
10832 MSVCRT_operator_delete(this->ptr);
10833 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
10836 locale__Locimp__Makeloc(&locinfo, cat, this->ptr, NULL);
10837 _Locinfo_dtor(&locinfo);
10839 return this;
10842 /* ??0locale@std@@QAE@W4_Uninitialized@1@@Z */
10843 /* ??0locale@std@@QEAA@W4_Uninitialized@1@@Z */
10844 DEFINE_THISCALL_WRAPPER(locale_ctor_uninitialized, 8)
10845 locale* __thiscall locale_ctor_uninitialized(locale *this, int uninitialized)
10847 TRACE("(%p)\n", this);
10848 this->ptr = NULL;
10849 return this;
10852 /* ??0locale@std@@QAE@XZ */
10853 /* ??0locale@std@@QEAA@XZ */
10854 DEFINE_THISCALL_WRAPPER(locale_ctor, 4)
10855 locale* __thiscall locale_ctor(locale *this)
10857 TRACE("(%p)\n", this);
10858 this->ptr = locale__Init();
10859 call_locale_facet__Incref(&this->ptr->facet);
10860 return this;
10863 /* ??1locale@std@@QAE@XZ */
10864 /* ??1locale@std@@QEAA@XZ */
10865 DEFINE_THISCALL_WRAPPER(locale_dtor, 4)
10866 void __thiscall locale_dtor(locale *this)
10868 TRACE("(%p)\n", this);
10869 if(this->ptr && call_locale_facet__Decref(&this->ptr->facet))
10871 locale__Locimp_dtor(this->ptr);
10872 MSVCRT_operator_delete(this->ptr);
10876 /* ??4locale@std@@QAEAAV01@ABV01@@Z */
10877 /* ??4locale@std@@QEAAAEAV01@AEBV01@@Z */
10878 DEFINE_THISCALL_WRAPPER(locale_operator_assign, 8)
10879 locale* __thiscall locale_operator_assign(locale *this, const locale *loc)
10881 FIXME("(%p %p) stub\n", this, loc);
10882 return NULL;
10885 /* ??8locale@std@@QBE_NABV01@@Z */
10886 /* ??8locale@std@@QEBA_NAEBV01@@Z */
10887 DEFINE_THISCALL_WRAPPER(locale_operator_equal, 8)
10888 MSVCP_bool __thiscall locale_operator_equal(const locale *this, const locale *loc)
10890 FIXME("(%p %p) stub\n", this, loc);
10891 return 0;
10894 /* ??9locale@std@@QBE_NABV01@@Z */
10895 /* ??9locale@std@@QEBA_NAEBV01@@Z */
10896 DEFINE_THISCALL_WRAPPER(locale_operator_not_equal, 8)
10897 MSVCP_bool __thiscall locale_operator_not_equal(const locale *this, locale const *loc)
10899 FIXME("(%p %p) stub\n", this, loc);
10900 return 0;
10903 /* ?_Addfac@locale@std@@QAEAAV12@PAVfacet@12@II@Z */
10904 /* ?_Addfac@locale@std@@QEAAAEAV12@PEAVfacet@12@_K1@Z */
10905 DEFINE_THISCALL_WRAPPER(locale__Addfac, 16)
10906 locale* __thiscall locale__Addfac(locale *this, locale_facet *facet, MSVCP_size_t id, MSVCP_size_t catmask)
10908 TRACE("(%p %p %lu %lu)\n", this, facet, id, catmask);
10910 if(this->ptr->facet.refs > 1) {
10911 locale__Locimp *new_ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
10912 if(!new_ptr) {
10913 ERR("Out of memory\n");
10914 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10915 return NULL;
10917 locale__Locimp_copy_ctor(new_ptr, this->ptr);
10918 call_locale_facet__Decref(&this->ptr->facet);
10919 this->ptr = new_ptr;
10922 locale__Locimp__Addfac(this->ptr, facet, id);
10924 if(catmask) {
10925 locale_string_char_dtor(&this->ptr->name);
10926 locale_string_char_ctor_cstr(&this->ptr->name, "*");
10928 return this;
10931 /* ?_Getfacet@locale@std@@QBEPBVfacet@12@I_N@Z */
10932 /* ?_Getfacet@locale@std@@QEBAPEBVfacet@12@_K_N@Z */
10933 DEFINE_THISCALL_WRAPPER(locale__Getfacet_bool, 12)
10934 const locale_facet* __thiscall locale__Getfacet_bool(const locale *this,
10935 MSVCP_size_t id, MSVCP_bool allow_transparent)
10937 locale_facet *fac;
10939 TRACE("(%p %lu)\n", this, id);
10941 fac = id < this->ptr->facet_cnt ? this->ptr->facetvec[id] : NULL;
10942 if(fac || !this->ptr->transparent || !allow_transparent)
10943 return fac;
10945 return id < global_locale->facet_cnt ? global_locale->facetvec[id] : NULL;
10948 /* ?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z */
10949 /* ?_Getfacet@locale@std@@QEBAPEBVfacet@12@_K@Z */
10950 DEFINE_THISCALL_WRAPPER(locale__Getfacet, 8)
10951 const locale_facet* __thiscall locale__Getfacet(const locale *this, MSVCP_size_t id)
10953 return locale__Getfacet_bool( this, id, TRUE );
10956 /* ?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ */
10957 /* ?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ */
10958 locale__Locimp* __cdecl locale__Getgloballocale(void)
10960 TRACE("\n");
10961 return global_locale;
10964 /* ?_Setgloballocale@locale@std@@CAXPAX@Z */
10965 /* ?_Setgloballocale@locale@std@@CAXPEAX@Z */
10966 void __cdecl locale__Setgloballocale(void *locimp)
10968 TRACE("(%p)\n", locimp);
10969 global_locale = locimp;
10972 /* ?classic@locale@std@@SAABV12@XZ */
10973 /* ?classic@locale@std@@SAAEBV12@XZ */
10974 const locale* __cdecl locale_classic(void)
10976 TRACE("\n");
10977 locale__Init();
10978 return &classic_locale;
10981 /* ?empty@locale@std@@SA?AV12@XZ */
10982 locale* __cdecl locale_empty(locale *ret)
10984 TRACE("\n");
10986 locale__Init();
10988 ret->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
10989 if(!ret->ptr) {
10990 ERR("Out of memory\n");
10991 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
10993 locale__Locimp_ctor_transparent(ret->ptr, TRUE);
10994 return ret;
10997 /* ?global@locale@std@@SA?AV12@ABV12@@Z */
10998 /* ?global@locale@std@@SA?AV12@AEBV12@@Z */
10999 locale* __cdecl locale_global(locale *ret, const locale *loc)
11001 _Lockit lock;
11002 int i;
11004 TRACE("(%p %p)\n", loc, ret);
11006 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
11007 locale_ctor(ret);
11009 if(loc->ptr != global_locale) {
11010 call_locale_facet__Decref(&global_locale->facet);
11011 global_locale = loc->ptr;
11012 call_locale_facet__Incref(&global_locale->facet);
11014 for(i=LC_ALL+1; i<=LC_MAX; i++) {
11015 if((global_locale->catmask & (1<<(i-1))) == 0)
11016 continue;
11017 setlocale(i, locale_string_char_c_str(&global_locale->name));
11020 _Lockit_dtor(&lock);
11021 return ret;
11024 #if _MSVCP_VER < 100
11026 /* ?_Getname@_Locinfo@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11027 /* ?_Getname@_Locinfo@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11028 DEFINE_THISCALL_WRAPPER(_Locinfo__Getname, 8)
11029 basic_string_char* __thiscall _Locinfo__Getname(const _Locinfo *this, basic_string_char *ret)
11031 TRACE("(%p)\n", this);
11033 MSVCP_basic_string_char_copy_ctor(ret, &this->newlocname);
11034 return ret;
11037 /* ?name@locale@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11038 /* ?name@locale@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
11039 DEFINE_THISCALL_WRAPPER(locale_name, 8)
11040 basic_string_char* __thiscall locale_name(const locale *this, basic_string_char *ret)
11042 TRACE( "(%p)\n", this);
11043 MSVCP_basic_string_char_copy_ctor(ret, &this->ptr->name);
11044 return ret;
11047 #else
11049 /* ?_Getname@_Locinfo@std@@QBEPBDXZ */
11050 /* ?_Getname@_Locinfo@std@@QEBAPEBDXZ */
11051 DEFINE_THISCALL_WRAPPER(_Locinfo__Getname, 4)
11052 const char * __thiscall _Locinfo__Getname( const _Locinfo *this )
11054 return locale_string_char_c_str( &this->newlocname );
11057 #endif /* _MSVCP_VER < 100 */
11059 /* wctrans */
11060 wctrans_t __cdecl wctrans(const char *property)
11062 static const char str_tolower[] = "tolower";
11063 static const char str_toupper[] = "toupper";
11065 if(!strcmp(property, str_tolower))
11066 return 2;
11067 if(!strcmp(property, str_toupper))
11068 return 1;
11069 return 0;
11072 /* towctrans */
11073 wint_t __cdecl towctrans(wint_t c, wctrans_t category)
11075 if(category == 1)
11076 return towupper(c);
11077 return towlower(c);
11080 /* btowc */
11081 wint_t __cdecl btowc(int c)
11083 wchar_t ret;
11084 int state = 0;
11085 char ch = c;
11087 if (c == EOF || _Mbrtowc( &ret, &ch, 1, &state, NULL ) != 1) return WEOF;
11088 return ret;
11091 /* mbrlen */
11092 size_t __cdecl mbrlen(const char *str, size_t n, mbstate_t *state)
11094 static int local_state;
11096 if (!state) state = &local_state;
11097 return _Mbrtowc( NULL, str, n, state, NULL );
11100 /* mbrtowc */
11101 size_t __cdecl mbrtowc(wchar_t *dst, const char *str, size_t n, mbstate_t *state)
11103 static int local_state;
11105 if (!state) state = &local_state;
11106 return _Mbrtowc( dst, str, n, state, NULL );
11109 /* mbsrtowcs */
11110 size_t __cdecl mbsrtowcs(wchar_t *dst, const char **pstr, size_t n, mbstate_t *state)
11112 static int local_state;
11113 size_t ret = 0;
11114 wchar_t wc;
11115 const char *src;
11117 src = *pstr;
11118 if (!state) state = &local_state;
11120 while (!dst || n > ret)
11122 int len = _Mbrtowc( &wc, src, 2, state, NULL );
11123 if (len < 0) return -1;
11124 if (!len) break;
11125 if (dst) dst[ret] = wc;
11126 ret++;
11127 if (!wc) break;
11128 src += len;
11130 return ret;
11133 /* wctob */
11134 int __cdecl wctob(wint_t wc)
11136 char ret[MB_LEN_MAX];
11138 if (wc == WEOF || _Wcrtomb( ret, wc, NULL, NULL ) != 1) return EOF;
11139 return ret[0];
11142 /* wcrtomb */
11143 size_t __cdecl wcrtomb(char *dst, wchar_t wc, mbstate_t *state)
11145 return _Wcrtomb( dst, wc, state, NULL );
11148 /* wcsrtombs */
11149 size_t __cdecl wcsrtombs(char *dst, const wchar_t **pstr, size_t n, mbstate_t *state)
11151 const wchar_t *src;
11152 char buffer[MB_LEN_MAX];
11153 size_t ret = 0;
11155 src = *pstr;
11157 while (!dst || n > ret)
11159 int len = _Wcrtomb( buffer, *src, state, NULL );
11160 if (len <= 0) return -1;
11161 if (n < ret + len) break;
11162 memcpy( dst + ret, buffer, len );
11163 ret += len;
11164 if (!buffer[0]) break;
11165 src++;
11167 return ret;
11171 DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@")
11172 DEFINE_RTTI_DATA1(locale__Locimp, 0, &locale_facet_rtti_base_descriptor, ".?AV_Locimp@locale@std@@")
11173 DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@")
11174 DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@")
11175 DEFINE_RTTI_DATA1(collate_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@G@std@@")
11176 DEFINE_RTTI_DATA1(ctype_base, 0, &locale_facet_rtti_base_descriptor, ".?AUctype_base@std@@")
11177 DEFINE_RTTI_DATA2(ctype_char, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@D@std@@")
11178 DEFINE_RTTI_DATA2(ctype_wchar, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@_W@std@@")
11179 DEFINE_RTTI_DATA2(ctype_short, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@G@std@@")
11180 DEFINE_RTTI_DATA1(codecvt_base, 0, &locale_facet_rtti_base_descriptor, ".?AVcodecvt_base@std@@")
11181 DEFINE_RTTI_DATA2(codecvt_char, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@DDH@std@@")
11182 DEFINE_RTTI_DATA2(codecvt_wchar, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@_WDH@std@@")
11183 DEFINE_RTTI_DATA2(codecvt_short, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@GDH@std@@")
11184 DEFINE_RTTI_DATA1(numpunct_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@D@std@@")
11185 DEFINE_RTTI_DATA1(numpunct_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@_W@std@@")
11186 DEFINE_RTTI_DATA1(numpunct_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@G@std@@")
11187 DEFINE_RTTI_DATA1(num_get_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@")
11188 DEFINE_RTTI_DATA1(num_get_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@")
11189 DEFINE_RTTI_DATA1(num_get_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@")
11190 DEFINE_RTTI_DATA1(num_put_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@")
11191 DEFINE_RTTI_DATA1(num_put_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@")
11192 DEFINE_RTTI_DATA1(num_put_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@")
11193 DEFINE_RTTI_DATA1(time_put_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@")
11194 DEFINE_RTTI_DATA1(time_put_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@")
11195 DEFINE_RTTI_DATA1(time_put_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@")
11196 DEFINE_RTTI_DATA1(time_base, 0, &locale_facet_rtti_base_descriptor, ".?AUtime_base@std@@")
11197 DEFINE_RTTI_DATA2(time_get_char, 0, &time_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$time_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@")
11199 #ifndef __GNUC__
11200 void __asm_dummy_vtables(void) {
11201 #endif
11202 __ASM_VTABLE(locale_facet,
11203 VTABLE_ADD_FUNC(locale_facet_vector_dtor)
11204 #if _MSVCP_VER >= 110
11205 VTABLE_ADD_FUNC(locale_facet__Incref)
11206 VTABLE_ADD_FUNC(locale_facet__Decref)
11207 #endif
11209 __ASM_VTABLE(locale__Locimp,
11210 VTABLE_ADD_FUNC(locale__Locimp_vector_dtor)
11211 #if _MSVCP_VER >= 110
11212 VTABLE_ADD_FUNC(locale_facet__Incref)
11213 VTABLE_ADD_FUNC(locale_facet__Decref)
11214 #endif
11216 __ASM_VTABLE(collate_char,
11217 VTABLE_ADD_FUNC(collate_char_vector_dtor)
11218 #if _MSVCP_VER >= 110
11219 VTABLE_ADD_FUNC(locale_facet__Incref)
11220 VTABLE_ADD_FUNC(locale_facet__Decref)
11221 #endif
11222 VTABLE_ADD_FUNC(collate_char_do_compare)
11223 VTABLE_ADD_FUNC(collate_char_do_transform)
11224 VTABLE_ADD_FUNC(collate_char_do_hash));
11225 __ASM_VTABLE(collate_wchar,
11226 VTABLE_ADD_FUNC(collate_wchar_vector_dtor)
11227 #if _MSVCP_VER >= 110
11228 VTABLE_ADD_FUNC(locale_facet__Incref)
11229 VTABLE_ADD_FUNC(locale_facet__Decref)
11230 #endif
11231 VTABLE_ADD_FUNC(collate_wchar_do_compare)
11232 VTABLE_ADD_FUNC(collate_wchar_do_transform)
11233 VTABLE_ADD_FUNC(collate_wchar_do_hash));
11234 __ASM_VTABLE(collate_short,
11235 VTABLE_ADD_FUNC(collate_wchar_vector_dtor)
11236 #if _MSVCP_VER >= 110
11237 VTABLE_ADD_FUNC(locale_facet__Incref)
11238 VTABLE_ADD_FUNC(locale_facet__Decref)
11239 #endif
11240 VTABLE_ADD_FUNC(collate_wchar_do_compare)
11241 VTABLE_ADD_FUNC(collate_wchar_do_transform)
11242 VTABLE_ADD_FUNC(collate_wchar_do_hash));
11243 __ASM_VTABLE(ctype_base,
11244 VTABLE_ADD_FUNC(ctype_base_vector_dtor)
11245 #if _MSVCP_VER >= 110
11246 VTABLE_ADD_FUNC(locale_facet__Incref)
11247 VTABLE_ADD_FUNC(locale_facet__Decref)
11248 #endif
11250 __ASM_VTABLE(ctype_char,
11251 VTABLE_ADD_FUNC(ctype_char_vector_dtor)
11252 #if _MSVCP_VER >= 110
11253 VTABLE_ADD_FUNC(locale_facet__Incref)
11254 VTABLE_ADD_FUNC(locale_facet__Decref)
11255 #endif
11256 VTABLE_ADD_FUNC(ctype_char_do_tolower)
11257 VTABLE_ADD_FUNC(ctype_char_do_tolower_ch)
11258 VTABLE_ADD_FUNC(ctype_char_do_toupper)
11259 VTABLE_ADD_FUNC(ctype_char_do_toupper_ch)
11260 VTABLE_ADD_FUNC(ctype_char_do_widen)
11261 VTABLE_ADD_FUNC(ctype_char_do_widen_ch)
11262 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
11263 VTABLE_ADD_FUNC(ctype_char__Do_widen_s)
11264 VTABLE_ADD_FUNC(ctype_char_do_narrow)
11265 VTABLE_ADD_FUNC(ctype_char_do_narrow_ch)
11266 VTABLE_ADD_FUNC(ctype_char__Do_narrow_s)
11267 #else
11268 VTABLE_ADD_FUNC(ctype_char_do_narrow)
11269 VTABLE_ADD_FUNC(ctype_char_do_narrow_ch)
11270 #endif
11272 __ASM_VTABLE(ctype_wchar,
11273 VTABLE_ADD_FUNC(ctype_wchar_vector_dtor)
11274 #if _MSVCP_VER >= 110
11275 VTABLE_ADD_FUNC(locale_facet__Incref)
11276 VTABLE_ADD_FUNC(locale_facet__Decref)
11277 #endif
11278 VTABLE_ADD_FUNC(ctype_wchar_do_is)
11279 VTABLE_ADD_FUNC(ctype_wchar_do_is_ch)
11280 VTABLE_ADD_FUNC(ctype_wchar_do_scan_is)
11281 VTABLE_ADD_FUNC(ctype_wchar_do_scan_not)
11282 VTABLE_ADD_FUNC(ctype_wchar_do_tolower)
11283 VTABLE_ADD_FUNC(ctype_wchar_do_tolower_ch)
11284 VTABLE_ADD_FUNC(ctype_wchar_do_toupper)
11285 VTABLE_ADD_FUNC(ctype_wchar_do_toupper_ch)
11286 VTABLE_ADD_FUNC(ctype_wchar_do_widen)
11287 VTABLE_ADD_FUNC(ctype_wchar_do_widen_ch)
11288 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
11289 VTABLE_ADD_FUNC(ctype_wchar__Do_widen_s)
11290 VTABLE_ADD_FUNC(ctype_wchar_do_narrow)
11291 VTABLE_ADD_FUNC(ctype_wchar_do_narrow_ch)
11292 VTABLE_ADD_FUNC(ctype_wchar__Do_narrow_s)
11293 #else
11294 VTABLE_ADD_FUNC(ctype_wchar_do_narrow)
11295 VTABLE_ADD_FUNC(ctype_wchar_do_narrow_ch)
11296 #endif
11298 __ASM_VTABLE(ctype_short,
11299 VTABLE_ADD_FUNC(ctype_wchar_vector_dtor)
11300 #if _MSVCP_VER >= 110
11301 VTABLE_ADD_FUNC(locale_facet__Incref)
11302 VTABLE_ADD_FUNC(locale_facet__Decref)
11303 #endif
11304 VTABLE_ADD_FUNC(ctype_wchar_do_is)
11305 VTABLE_ADD_FUNC(ctype_wchar_do_is_ch)
11306 VTABLE_ADD_FUNC(ctype_wchar_do_scan_is)
11307 VTABLE_ADD_FUNC(ctype_wchar_do_scan_not)
11308 VTABLE_ADD_FUNC(ctype_wchar_do_tolower)
11309 VTABLE_ADD_FUNC(ctype_wchar_do_tolower_ch)
11310 VTABLE_ADD_FUNC(ctype_wchar_do_toupper)
11311 VTABLE_ADD_FUNC(ctype_wchar_do_toupper_ch)
11312 VTABLE_ADD_FUNC(ctype_wchar_do_widen)
11313 VTABLE_ADD_FUNC(ctype_wchar_do_widen_ch)
11314 #if _MSVCP_VER >= 80 && _MSVCP_VER <= 90
11315 VTABLE_ADD_FUNC(ctype_wchar__Do_widen_s)
11316 VTABLE_ADD_FUNC(ctype_wchar_do_narrow)
11317 VTABLE_ADD_FUNC(ctype_wchar_do_narrow_ch)
11318 VTABLE_ADD_FUNC(ctype_wchar__Do_narrow_s)
11319 #else
11320 VTABLE_ADD_FUNC(ctype_wchar_do_narrow)
11321 VTABLE_ADD_FUNC(ctype_wchar_do_narrow_ch)
11322 #endif
11324 __ASM_VTABLE(codecvt_base,
11325 VTABLE_ADD_FUNC(codecvt_base_vector_dtor)
11326 #if _MSVCP_VER >= 110
11327 VTABLE_ADD_FUNC(locale_facet__Incref)
11328 VTABLE_ADD_FUNC(locale_facet__Decref)
11329 #endif
11330 VTABLE_ADD_FUNC(codecvt_base_do_always_noconv)
11331 VTABLE_ADD_FUNC(codecvt_base_do_max_length)
11332 VTABLE_ADD_FUNC(codecvt_base_do_encoding));
11333 __ASM_VTABLE(codecvt_char,
11334 VTABLE_ADD_FUNC(codecvt_char_vector_dtor)
11335 #if _MSVCP_VER >= 110
11336 VTABLE_ADD_FUNC(locale_facet__Incref)
11337 VTABLE_ADD_FUNC(locale_facet__Decref)
11338 #endif
11339 VTABLE_ADD_FUNC(codecvt_base_do_always_noconv)
11340 VTABLE_ADD_FUNC(codecvt_base_do_max_length)
11341 VTABLE_ADD_FUNC(codecvt_base_do_encoding)
11342 VTABLE_ADD_FUNC(codecvt_char_do_in)
11343 VTABLE_ADD_FUNC(codecvt_char_do_out)
11344 VTABLE_ADD_FUNC(codecvt_char_do_unshift)
11345 VTABLE_ADD_FUNC(codecvt_char_do_length));
11346 __ASM_VTABLE(codecvt_wchar,
11347 VTABLE_ADD_FUNC(codecvt_wchar_vector_dtor)
11348 #if _MSVCP_VER >= 110
11349 VTABLE_ADD_FUNC(locale_facet__Incref)
11350 VTABLE_ADD_FUNC(locale_facet__Decref)
11351 #endif
11352 VTABLE_ADD_FUNC(codecvt_wchar_do_always_noconv)
11353 VTABLE_ADD_FUNC(codecvt_wchar_do_max_length)
11354 #if _MSVCP_VER >= 90 && _MSVCP_VER <= 100
11355 VTABLE_ADD_FUNC(codecvt_base_do_encoding)
11356 #else
11357 VTABLE_ADD_FUNC(codecvt_wchar_do_encoding)
11358 #endif
11359 VTABLE_ADD_FUNC(codecvt_wchar_do_in)
11360 VTABLE_ADD_FUNC(codecvt_wchar_do_out)
11361 VTABLE_ADD_FUNC(codecvt_wchar_do_unshift)
11362 VTABLE_ADD_FUNC(codecvt_wchar_do_length));
11363 __ASM_VTABLE(codecvt_short,
11364 VTABLE_ADD_FUNC(codecvt_wchar_vector_dtor)
11365 #if _MSVCP_VER >= 110
11366 VTABLE_ADD_FUNC(locale_facet__Incref)
11367 VTABLE_ADD_FUNC(locale_facet__Decref)
11368 #endif
11369 VTABLE_ADD_FUNC(codecvt_wchar_do_always_noconv)
11370 VTABLE_ADD_FUNC(codecvt_wchar_do_max_length)
11371 #if _MSVCP_VER >= 90 && _MSVCP_VER <= 100
11372 VTABLE_ADD_FUNC(codecvt_base_do_encoding)
11373 #else
11374 VTABLE_ADD_FUNC(codecvt_wchar_do_encoding)
11375 #endif
11376 VTABLE_ADD_FUNC(codecvt_wchar_do_in)
11377 VTABLE_ADD_FUNC(codecvt_wchar_do_out)
11378 VTABLE_ADD_FUNC(codecvt_wchar_do_unshift)
11379 VTABLE_ADD_FUNC(codecvt_wchar_do_length));
11380 __ASM_VTABLE(numpunct_char,
11381 VTABLE_ADD_FUNC(numpunct_char_vector_dtor)
11382 #if _MSVCP_VER >= 110
11383 VTABLE_ADD_FUNC(locale_facet__Incref)
11384 VTABLE_ADD_FUNC(locale_facet__Decref)
11385 #endif
11386 VTABLE_ADD_FUNC(numpunct_char_do_decimal_point)
11387 VTABLE_ADD_FUNC(numpunct_char_do_thousands_sep)
11388 VTABLE_ADD_FUNC(numpunct_char_do_grouping)
11389 VTABLE_ADD_FUNC(numpunct_char_do_falsename)
11390 VTABLE_ADD_FUNC(numpunct_char_do_truename));
11391 __ASM_VTABLE(numpunct_wchar,
11392 VTABLE_ADD_FUNC(numpunct_wchar_vector_dtor)
11393 #if _MSVCP_VER >= 110
11394 VTABLE_ADD_FUNC(locale_facet__Incref)
11395 VTABLE_ADD_FUNC(locale_facet__Decref)
11396 #endif
11397 VTABLE_ADD_FUNC(numpunct_wchar_do_decimal_point)
11398 VTABLE_ADD_FUNC(numpunct_wchar_do_thousands_sep)
11399 VTABLE_ADD_FUNC(numpunct_wchar_do_grouping)
11400 VTABLE_ADD_FUNC(numpunct_wchar_do_falsename)
11401 VTABLE_ADD_FUNC(numpunct_wchar_do_truename));
11402 __ASM_VTABLE(numpunct_short,
11403 VTABLE_ADD_FUNC(numpunct_wchar_vector_dtor)
11404 #if _MSVCP_VER >= 110
11405 VTABLE_ADD_FUNC(locale_facet__Incref)
11406 VTABLE_ADD_FUNC(locale_facet__Decref)
11407 #endif
11408 VTABLE_ADD_FUNC(numpunct_wchar_do_decimal_point)
11409 VTABLE_ADD_FUNC(numpunct_wchar_do_thousands_sep)
11410 VTABLE_ADD_FUNC(numpunct_wchar_do_grouping)
11411 VTABLE_ADD_FUNC(numpunct_wchar_do_falsename)
11412 VTABLE_ADD_FUNC(numpunct_wchar_do_truename));
11413 __ASM_VTABLE(num_get_char,
11414 VTABLE_ADD_FUNC(num_get_char_vector_dtor)
11415 #if _MSVCP_VER >= 110
11416 VTABLE_ADD_FUNC(locale_facet__Incref)
11417 VTABLE_ADD_FUNC(locale_facet__Decref)
11418 #endif
11419 VTABLE_ADD_FUNC(num_get_char_do_get_void)
11420 VTABLE_ADD_FUNC(num_get_char_do_get_double)
11421 VTABLE_ADD_FUNC(num_get_char_do_get_double)
11422 VTABLE_ADD_FUNC(num_get_char_do_get_float)
11423 VTABLE_ADD_FUNC(num_get_char_do_get_uint64)
11424 VTABLE_ADD_FUNC(num_get_char_do_get_int64)
11425 VTABLE_ADD_FUNC(num_get_char_do_get_ulong)
11426 VTABLE_ADD_FUNC(num_get_char_do_get_long)
11427 VTABLE_ADD_FUNC(num_get_char_do_get_uint)
11428 VTABLE_ADD_FUNC(num_get_char_do_get_ushort)
11429 VTABLE_ADD_FUNC(num_get_char_do_get_bool));
11430 __ASM_VTABLE(num_get_short,
11431 VTABLE_ADD_FUNC(num_get_wchar_vector_dtor)
11432 #if _MSVCP_VER >= 110
11433 VTABLE_ADD_FUNC(locale_facet__Incref)
11434 VTABLE_ADD_FUNC(locale_facet__Decref)
11435 #endif
11436 VTABLE_ADD_FUNC(num_get_short_do_get_void)
11437 VTABLE_ADD_FUNC(num_get_short_do_get_double)
11438 VTABLE_ADD_FUNC(num_get_short_do_get_double)
11439 VTABLE_ADD_FUNC(num_get_short_do_get_float)
11440 VTABLE_ADD_FUNC(num_get_short_do_get_uint64)
11441 VTABLE_ADD_FUNC(num_get_short_do_get_int64)
11442 VTABLE_ADD_FUNC(num_get_short_do_get_ulong)
11443 VTABLE_ADD_FUNC(num_get_short_do_get_long)
11444 VTABLE_ADD_FUNC(num_get_short_do_get_uint)
11445 VTABLE_ADD_FUNC(num_get_short_do_get_ushort)
11446 VTABLE_ADD_FUNC(num_get_short_do_get_bool));
11447 __ASM_VTABLE(num_get_wchar,
11448 VTABLE_ADD_FUNC(num_get_wchar_vector_dtor)
11449 #if _MSVCP_VER >= 110
11450 VTABLE_ADD_FUNC(locale_facet__Incref)
11451 VTABLE_ADD_FUNC(locale_facet__Decref)
11452 #endif
11453 VTABLE_ADD_FUNC(num_get_wchar_do_get_void)
11454 VTABLE_ADD_FUNC(num_get_wchar_do_get_double)
11455 VTABLE_ADD_FUNC(num_get_wchar_do_get_double)
11456 VTABLE_ADD_FUNC(num_get_wchar_do_get_float)
11457 VTABLE_ADD_FUNC(num_get_wchar_do_get_uint64)
11458 VTABLE_ADD_FUNC(num_get_wchar_do_get_int64)
11459 VTABLE_ADD_FUNC(num_get_wchar_do_get_ulong)
11460 VTABLE_ADD_FUNC(num_get_wchar_do_get_long)
11461 VTABLE_ADD_FUNC(num_get_wchar_do_get_uint)
11462 VTABLE_ADD_FUNC(num_get_wchar_do_get_ushort)
11463 VTABLE_ADD_FUNC(num_get_wchar_do_get_bool));
11464 __ASM_VTABLE(num_put_char,
11465 VTABLE_ADD_FUNC(num_put_char_vector_dtor)
11466 #if _MSVCP_VER >= 110
11467 VTABLE_ADD_FUNC(locale_facet__Incref)
11468 VTABLE_ADD_FUNC(locale_facet__Decref)
11469 #endif
11470 VTABLE_ADD_FUNC(num_put_char_do_put_ptr)
11471 VTABLE_ADD_FUNC(num_put_char_do_put_double)
11472 VTABLE_ADD_FUNC(num_put_char_do_put_double)
11473 VTABLE_ADD_FUNC(num_put_char_do_put_uint64)
11474 VTABLE_ADD_FUNC(num_put_char_do_put_int64)
11475 VTABLE_ADD_FUNC(num_put_char_do_put_ulong)
11476 VTABLE_ADD_FUNC(num_put_char_do_put_long)
11477 VTABLE_ADD_FUNC(num_put_char_do_put_bool));
11478 __ASM_VTABLE(num_put_wchar,
11479 VTABLE_ADD_FUNC(num_put_wchar_vector_dtor)
11480 #if _MSVCP_VER >= 110
11481 VTABLE_ADD_FUNC(locale_facet__Incref)
11482 VTABLE_ADD_FUNC(locale_facet__Decref)
11483 #endif
11484 VTABLE_ADD_FUNC(num_put_wchar_do_put_ptr)
11485 VTABLE_ADD_FUNC(num_put_wchar_do_put_double)
11486 VTABLE_ADD_FUNC(num_put_wchar_do_put_double)
11487 VTABLE_ADD_FUNC(num_put_wchar_do_put_uint64)
11488 VTABLE_ADD_FUNC(num_put_wchar_do_put_int64)
11489 VTABLE_ADD_FUNC(num_put_wchar_do_put_ulong)
11490 VTABLE_ADD_FUNC(num_put_wchar_do_put_long)
11491 VTABLE_ADD_FUNC(num_put_wchar_do_put_bool));
11492 __ASM_VTABLE(num_put_short,
11493 VTABLE_ADD_FUNC(num_put_wchar_vector_dtor)
11494 #if _MSVCP_VER >= 110
11495 VTABLE_ADD_FUNC(locale_facet__Incref)
11496 VTABLE_ADD_FUNC(locale_facet__Decref)
11497 #endif
11498 VTABLE_ADD_FUNC(num_put_short_do_put_ptr)
11499 VTABLE_ADD_FUNC(num_put_short_do_put_double)
11500 VTABLE_ADD_FUNC(num_put_short_do_put_double)
11501 VTABLE_ADD_FUNC(num_put_short_do_put_uint64)
11502 VTABLE_ADD_FUNC(num_put_short_do_put_int64)
11503 VTABLE_ADD_FUNC(num_put_short_do_put_ulong)
11504 VTABLE_ADD_FUNC(num_put_short_do_put_long)
11505 VTABLE_ADD_FUNC(num_put_short_do_put_bool));
11506 __ASM_VTABLE(time_put_char,
11507 VTABLE_ADD_FUNC(time_put_char_vector_dtor)
11508 #if _MSVCP_VER >= 110
11509 VTABLE_ADD_FUNC(locale_facet__Incref)
11510 VTABLE_ADD_FUNC(locale_facet__Decref)
11511 #endif
11512 VTABLE_ADD_FUNC(time_put_char_do_put));
11513 __ASM_VTABLE(time_put_wchar,
11514 VTABLE_ADD_FUNC(time_put_wchar_vector_dtor)
11515 #if _MSVCP_VER >= 110
11516 VTABLE_ADD_FUNC(locale_facet__Incref)
11517 VTABLE_ADD_FUNC(locale_facet__Decref)
11518 #endif
11519 VTABLE_ADD_FUNC(time_put_wchar_do_put));
11520 __ASM_VTABLE(time_put_short,
11521 VTABLE_ADD_FUNC(time_put_wchar_vector_dtor)
11522 #if _MSVCP_VER >= 110
11523 VTABLE_ADD_FUNC(locale_facet__Incref)
11524 VTABLE_ADD_FUNC(locale_facet__Decref)
11525 #endif
11526 VTABLE_ADD_FUNC(time_put_wchar_do_put));
11527 __ASM_VTABLE(time_get_char,
11528 VTABLE_ADD_FUNC(time_get_char_vector_dtor)
11529 #if _MSVCP_VER >= 110
11530 VTABLE_ADD_FUNC(locale_facet__Incref)
11531 VTABLE_ADD_FUNC(locale_facet__Decref)
11532 #endif
11533 VTABLE_ADD_FUNC(time_get_char_do_date_order)
11534 VTABLE_ADD_FUNC(time_get_char_do_get_time)
11535 VTABLE_ADD_FUNC(time_get_char_do_get_date)
11536 VTABLE_ADD_FUNC(time_get_char_do_get_weekday)
11537 VTABLE_ADD_FUNC(time_get_char_do_get_monthname)
11538 VTABLE_ADD_FUNC(time_get_char_do_get_year));
11539 #ifndef __GNUC__
11541 #endif
11543 void init_locale(void *base)
11545 #ifdef __x86_64__
11546 init_locale_facet_rtti(base);
11547 init_locale__Locimp_rtti(base);
11548 init_collate_char_rtti(base);
11549 init_collate_wchar_rtti(base);
11550 init_collate_short_rtti(base);
11551 init_ctype_base_rtti(base);
11552 init_ctype_char_rtti(base);
11553 init_ctype_wchar_rtti(base);
11554 init_ctype_short_rtti(base);
11555 init_codecvt_base_rtti(base);
11556 init_codecvt_char_rtti(base);
11557 init_codecvt_wchar_rtti(base);
11558 init_codecvt_short_rtti(base);
11559 init_numpunct_char_rtti(base);
11560 init_numpunct_wchar_rtti(base);
11561 init_numpunct_short_rtti(base);
11562 init_num_get_char_rtti(base);
11563 init_num_get_wchar_rtti(base);
11564 init_num_get_short_rtti(base);
11565 init_num_put_char_rtti(base);
11566 init_num_put_wchar_rtti(base);
11567 init_num_put_short_rtti(base);
11568 init_time_put_char_rtti(base);
11569 init_time_put_wchar_rtti(base);
11570 init_time_put_short_rtti(base);
11571 init_time_base_rtti(base);
11572 init_time_get_char_rtti(base);
11573 #endif
11576 void free_locale(void)
11578 facets_elem *iter, *safe;
11580 if(global_locale) {
11581 locale_dtor(&classic_locale);
11582 locale__Locimp_dtor(global_locale);
11583 MSVCRT_operator_delete(global_locale);
11586 LIST_FOR_EACH_ENTRY_SAFE(iter, safe, &lazy_facets, facets_elem, entry) {
11587 list_remove(&iter->entry);
11588 if(call_locale_facet__Decref(iter->fac))
11589 call_locale_facet_vector_dtor(iter->fac, 1);
11590 MSVCRT_operator_delete(iter);