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
30 #include "wine/list.h"
35 #include "wine/unicode.h"
36 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
39 char* __cdecl _Getdays(void);
40 char* __cdecl _Getmonths(void);
41 void* __cdecl _Gettnames(void);
42 unsigned int __cdecl ___lc_codepage_func(void);
43 LCID* __cdecl ___lc_handle_func(void);
44 const locale_facet* __thiscall locale__Getfacet(const locale*, MSVCP_size_t);
52 typedef struct _locale__Locimp {
54 locale_facet **facetvec;
55 MSVCP_size_t facet_cnt;
57 MSVCP_bool transparent;
58 basic_string_char name;
67 basic_string_char days;
68 basic_string_char months;
69 basic_string_char oldlocname;
70 basic_string_char newlocname;
88 const char *false_name;
89 const char *true_name;
97 const wchar_t *false_name;
98 const wchar_t *true_name;
101 /* ?_Id_cnt@id@locale@std@@0HA */
102 int locale_id__Id_cnt = 0;
104 static locale__Locimp *global_locale;
105 static locale classic_locale;
107 /* ?_Clocptr@_Locimp@locale@std@@0PAV123@A */
108 /* ?_Clocptr@_Locimp@locale@std@@0PEAV123@EA */
109 locale__Locimp *locale__Locimp__Clocptr = NULL;
111 static char istreambuf_iterator_char_val(istreambuf_iterator_char *this)
113 if(this->strbuf && !this->got) {
114 int c = basic_streambuf_char_sgetc(this->strbuf);
125 static wchar_t istreambuf_iterator_wchar_val(istreambuf_iterator_wchar *this)
127 if(this->strbuf && !this->got) {
128 unsigned short c = basic_streambuf_wchar_sgetc(this->strbuf);
139 static void istreambuf_iterator_char_inc(istreambuf_iterator_char *this)
141 if(!this->strbuf || basic_streambuf_char_sbumpc(this->strbuf)==EOF) {
146 istreambuf_iterator_char_val(this);
150 static void istreambuf_iterator_wchar_inc(istreambuf_iterator_wchar *this)
152 if(!this->strbuf || basic_streambuf_wchar_sbumpc(this->strbuf)==WEOF) {
157 istreambuf_iterator_wchar_val(this);
161 static void ostreambuf_iterator_char_put(ostreambuf_iterator_char *this, char ch)
163 if(this->failed || basic_streambuf_char_sputc(this->strbuf, ch)==EOF)
167 static void ostreambuf_iterator_wchar_put(ostreambuf_iterator_wchar *this, wchar_t ch)
169 if(this->failed || basic_streambuf_wchar_sputc(this->strbuf, ch)==WEOF)
173 /* ??1facet@locale@std@@UAE@XZ */
174 /* ??1facet@locale@std@@UEAA@XZ */
175 DEFINE_THISCALL_WRAPPER(locale_facet_dtor, 4)
176 void __thiscall locale_facet_dtor(locale_facet *this)
178 TRACE("(%p)\n", this);
181 DEFINE_THISCALL_WRAPPER(MSVCP_locale_facet_vector_dtor, 8)
182 #define call_locale_facet_vector_dtor(this, flags) CALL_VTBL_FUNC(this, 0, \
183 locale_facet*, (locale_facet*, unsigned int), (this, flags))
184 locale_facet* __thiscall MSVCP_locale_facet_vector_dtor(locale_facet *this, unsigned int flags)
186 TRACE("(%p %x)\n", this, flags);
188 /* we have an array, with the number of elements stored before the first object */
189 int i, *ptr = (int *)this-1;
191 for(i=*ptr-1; i>=0; i--)
192 locale_facet_dtor(this+i);
193 MSVCRT_operator_delete(ptr);
195 locale_facet_dtor(this);
197 MSVCRT_operator_delete(this);
208 static struct list lazy_facets = LIST_INIT(lazy_facets);
210 /* Not exported from msvcp90 */
211 /* ?facet_Register@facet@locale@std@@CAXPAV123@@Z */
212 /* ?facet_Register@facet@locale@std@@CAXPEAV123@@Z */
213 void __cdecl locale_facet_register(locale_facet *add)
215 facets_elem *head = MSVCRT_operator_new(sizeof(*head));
217 ERR("Out of memory\n");
218 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
222 list_add_head(&lazy_facets, &head->entry);
225 /* Not exported from msvcp90 */
226 /* ?_Register@facet@locale@std@@QAEXXZ */
227 /* ?_Register@facet@locale@std@@QEAAXXZ */
228 DEFINE_THISCALL_WRAPPER(locale_facet__Register, 4)
229 void __thiscall locale_facet__Register(locale_facet *this)
231 TRACE("(%p)\n", this);
232 locale_facet_register(this);
235 /* Not exported from msvcp90 */
236 /* ??_7facet@locale@std@@6B@ */
237 extern const vtable_ptr MSVCP_locale_facet_vtable;
239 /* ??0id@locale@std@@QAE@I@Z */
240 /* ??0id@locale@std@@QEAA@_K@Z */
241 DEFINE_THISCALL_WRAPPER(locale_id_ctor_id, 8)
242 locale_id* __thiscall locale_id_ctor_id(locale_id *this, MSVCP_size_t id)
244 TRACE("(%p %lu)\n", this, id);
250 /* ??_Fid@locale@std@@QAEXXZ */
251 /* ??_Fid@locale@std@@QEAAXXZ */
252 DEFINE_THISCALL_WRAPPER(locale_id_ctor, 4)
253 locale_id* __thiscall locale_id_ctor(locale_id *this)
255 TRACE("(%p)\n", this);
261 /* ??Bid@locale@std@@QAEIXZ */
262 /* ??Bid@locale@std@@QEAA_KXZ */
263 DEFINE_THISCALL_WRAPPER(locale_id_operator_size_t, 4)
264 MSVCP_size_t __thiscall locale_id_operator_size_t(locale_id *this)
268 TRACE("(%p)\n", this);
271 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
272 this->id = ++locale_id__Id_cnt;
279 /* ?_Id_cnt_func@id@locale@std@@CAAAHXZ */
280 /* ?_Id_cnt_func@id@locale@std@@CAAEAHXZ */
281 int* __cdecl locale_id__Id_cnt_func(void)
284 return &locale_id__Id_cnt;
287 /* ??_Ffacet@locale@std@@QAEXXZ */
288 /* ??_Ffacet@locale@std@@QEAAXXZ */
289 DEFINE_THISCALL_WRAPPER(locale_facet_ctor, 4)
290 locale_facet* __thiscall locale_facet_ctor(locale_facet *this)
292 TRACE("(%p)\n", this);
293 this->vtable = &MSVCP_locale_facet_vtable;
298 /* ??0facet@locale@std@@IAE@I@Z */
299 /* ??0facet@locale@std@@IEAA@_K@Z */
300 DEFINE_THISCALL_WRAPPER(locale_facet_ctor_refs, 8)
301 locale_facet* __thiscall locale_facet_ctor_refs(locale_facet *this, MSVCP_size_t refs)
303 TRACE("(%p %lu)\n", this, refs);
304 this->vtable = &MSVCP_locale_facet_vtable;
309 /* ?_Incref@facet@locale@std@@QAEXXZ */
310 /* ?_Incref@facet@locale@std@@QEAAXXZ */
311 DEFINE_THISCALL_WRAPPER(locale_facet__Incref, 4)
312 void __thiscall locale_facet__Incref(locale_facet *this)
316 TRACE("(%p)\n", this);
318 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
323 /* ?_Decref@facet@locale@std@@QAEPAV123@XZ */
324 /* ?_Decref@facet@locale@std@@QEAAPEAV123@XZ */
325 DEFINE_THISCALL_WRAPPER(locale_facet__Decref, 4)
326 locale_facet* __thiscall locale_facet__Decref(locale_facet *this)
331 TRACE("(%p)\n", this);
333 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
337 ret = this->refs ? NULL : this;
343 /* ?_Getcat@facet@locale@std@@SAIPAPBV123@PBV23@@Z */
344 /* ?_Getcat@facet@locale@std@@SA_KPEAPEBV123@PEBV23@@Z */
345 MSVCP_size_t __cdecl locale_facet__Getcat(const locale_facet **facet, const locale *loc)
347 TRACE("(%p %p)\n", facet, loc);
351 /* ??0_Timevec@std@@QAE@ABV01@@Z */
352 /* ??0_Timevec@std@@QEAA@AEBV01@@Z */
353 /* This copy constructor modifies copied object */
354 DEFINE_THISCALL_WRAPPER(_Timevec_copy_ctor, 8)
355 _Timevec* __thiscall _Timevec_copy_ctor(_Timevec *this, _Timevec *copy)
357 TRACE("(%p %p)\n", this, copy);
358 this->timeptr = copy->timeptr;
359 copy->timeptr = NULL;
363 /* ??0_Timevec@std@@QAE@PAX@Z */
364 /* ??0_Timevec@std@@QEAA@PEAX@Z */
365 DEFINE_THISCALL_WRAPPER(_Timevec_ctor_timeptr, 8)
366 _Timevec* __thiscall _Timevec_ctor_timeptr(_Timevec *this, void *timeptr)
368 TRACE("(%p %p)\n", this, timeptr);
369 this->timeptr = timeptr;
373 /* ??_F_Timevec@std@@QAEXXZ */
374 /* ??_F_Timevec@std@@QEAAXXZ */
375 DEFINE_THISCALL_WRAPPER(_Timevec_ctor, 4)
376 _Timevec* __thiscall _Timevec_ctor(_Timevec *this)
378 TRACE("(%p)\n", this);
379 this->timeptr = NULL;
383 /* ??1_Timevec@std@@QAE@XZ */
384 /* ??1_Timevec@std@@QEAA@XZ */
385 DEFINE_THISCALL_WRAPPER(_Timevec_dtor, 4)
386 void __thiscall _Timevec_dtor(_Timevec *this)
388 TRACE("(%p)\n", this);
392 /* ??4_Timevec@std@@QAEAAV01@ABV01@@Z */
393 /* ??4_Timevec@std@@QEAAAEAV01@AEBV01@@Z */
394 DEFINE_THISCALL_WRAPPER(_Timevec_op_assign, 8)
395 _Timevec* __thiscall _Timevec_op_assign(_Timevec *this, _Timevec *right)
397 TRACE("(%p %p)\n", this, right);
398 this->timeptr = right->timeptr;
399 right->timeptr = NULL;
403 /* ?_Getptr@_Timevec@std@@QBEPAXXZ */
404 /* ?_Getptr@_Timevec@std@@QEBAPEAXXZ */
405 DEFINE_THISCALL_WRAPPER(_Timevec__Getptr, 4)
406 void* __thiscall _Timevec__Getptr(_Timevec *this)
408 TRACE("(%p)\n", this);
409 return this->timeptr;
412 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@HPBD@Z */
413 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@HPEBD@Z */
414 _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cat_cstr(_Locinfo *locinfo, int category, const char *locstr)
416 const char *locale = NULL;
418 /* This function is probably modifying more global objects */
419 FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr);
422 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
424 _Lockit_ctor_locktype(&locinfo->lock, _LOCK_LOCALE);
425 MSVCP_basic_string_char_ctor_cstr(&locinfo->days, "");
426 MSVCP_basic_string_char_ctor_cstr(&locinfo->months, "");
427 MSVCP_basic_string_char_ctor_cstr(&locinfo->oldlocname, setlocale(LC_ALL, NULL));
430 locale = setlocale(LC_ALL, locstr);
432 locale = setlocale(LC_ALL, NULL);
435 MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, locale);
437 MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, "*");
442 /* ??0_Locinfo@std@@QAE@HPBD@Z */
443 /* ??0_Locinfo@std@@QEAA@HPEBD@Z */
444 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_cat_cstr, 12)
445 _Locinfo* __thiscall _Locinfo_ctor_cat_cstr(_Locinfo *this, int category, const char *locstr)
447 return _Locinfo__Locinfo_ctor_cat_cstr(this, category, locstr);
450 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
451 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
452 _Locinfo* __cdecl _Locinfo__Locinfo_ctor_bstr(_Locinfo *locinfo, const basic_string_char *locstr)
454 return _Locinfo__Locinfo_ctor_cat_cstr(locinfo, 1/*FIXME*/, MSVCP_basic_string_char_c_str(locstr));
457 /* ??0_Locinfo@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z */
458 /* ??0_Locinfo@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z */
459 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_bstr, 8)
460 _Locinfo* __thiscall _Locinfo_ctor_bstr(_Locinfo *this, const basic_string_char *locstr)
462 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, MSVCP_basic_string_char_c_str(locstr));
465 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z */
466 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z */
467 _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cstr(_Locinfo *locinfo, const char *locstr)
469 return _Locinfo__Locinfo_ctor_cat_cstr(locinfo, 1/*FIXME*/, locstr);
472 /* ??0_Locinfo@std@@QAE@PBD@Z */
473 /* ??0_Locinfo@std@@QEAA@PEBD@Z */
474 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_cstr, 8)
475 _Locinfo* __thiscall _Locinfo_ctor_cstr(_Locinfo *this, const char *locstr)
477 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, locstr);
480 /* ?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z */
481 /* ?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z */
482 void __cdecl _Locinfo__Locinfo_dtor(_Locinfo *locinfo)
484 TRACE("(%p)\n", locinfo);
486 setlocale(LC_ALL, MSVCP_basic_string_char_c_str(&locinfo->oldlocname));
487 MSVCP_basic_string_char_dtor(&locinfo->days);
488 MSVCP_basic_string_char_dtor(&locinfo->months);
489 MSVCP_basic_string_char_dtor(&locinfo->oldlocname);
490 MSVCP_basic_string_char_dtor(&locinfo->newlocname);
491 _Lockit_dtor(&locinfo->lock);
494 /* ??_F_Locinfo@std@@QAEXXZ */
495 /* ??_F_Locinfo@std@@QEAAXXZ */
496 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor, 4)
497 _Locinfo* __thiscall _Locinfo_ctor(_Locinfo *this)
499 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, "C");
502 /* ??1_Locinfo@std@@QAE@XZ */
503 /* ??1_Locinfo@std@@QEAA@XZ */
504 DEFINE_THISCALL_WRAPPER(_Locinfo_dtor, 4)
505 void __thiscall _Locinfo_dtor(_Locinfo *this)
507 _Locinfo__Locinfo_dtor(this);
510 /* ?_Locinfo_Addcats@_Locinfo@std@@SAAAV12@PAV12@HPBD@Z */
511 /* ?_Locinfo_Addcats@_Locinfo@std@@SAAEAV12@PEAV12@HPEBD@Z */
512 _Locinfo* __cdecl _Locinfo__Locinfo_Addcats(_Locinfo *locinfo, int category, const char *locstr)
514 const char *locale = NULL;
516 /* This function is probably modifying more global objects */
517 FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr);
519 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
521 MSVCP_basic_string_char_dtor(&locinfo->newlocname);
524 locale = setlocale(LC_ALL, locstr);
526 locale = setlocale(LC_ALL, NULL);
529 MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, locale);
531 MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, "*");
536 /* ?_Addcats@_Locinfo@std@@QAEAAV12@HPBD@Z */
537 /* ?_Addcats@_Locinfo@std@@QEAAAEAV12@HPEBD@Z */
538 DEFINE_THISCALL_WRAPPER(_Locinfo__Addcats, 12)
539 _Locinfo* __thiscall _Locinfo__Addcats(_Locinfo *this, int category, const char *locstr)
541 return _Locinfo__Locinfo_Addcats(this, category, locstr);
545 _Collvec __cdecl _Getcoll(void)
548 _locale_t locale = _get_current_locale();
552 ret.page = locale->locinfo->lc_collate_cp;
553 ret.handle = locale->locinfo->lc_handle[LC_COLLATE];
554 _free_locale(locale);
558 /* ?_Getcoll@_Locinfo@std@@QBE?AU_Collvec@@XZ */
559 /* ?_Getcoll@_Locinfo@std@@QEBA?AU_Collvec@@XZ */
560 DEFINE_THISCALL_WRAPPER(_Locinfo__Getcoll, 8)
561 _Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret)
568 _Ctypevec __cdecl _Getctype(void)
571 _locale_t locale = _get_current_locale();
576 ret.page = locale->locinfo->lc_codepage;
577 ret.handle = locale->locinfo->lc_handle[LC_COLLATE];
579 table = malloc(sizeof(short[256]));
581 _free_locale(locale);
582 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
584 memcpy(table, locale->locinfo->pctype, sizeof(short[256]));
586 _free_locale(locale);
590 /* ?_Getctype@_Locinfo@std@@QBE?AU_Ctypevec@@XZ */
591 /* ?_Getctype@_Locinfo@std@@QEBA?AU_Ctypevec@@XZ */
592 DEFINE_THISCALL_WRAPPER(_Locinfo__Getctype, 8)
593 _Ctypevec* __thiscall _Locinfo__Getctype(const _Locinfo *this, _Ctypevec *ret)
600 _Cvtvec __cdecl _Getcvt(void)
603 _locale_t locale = _get_current_locale();
607 ret.page = locale->locinfo->lc_codepage;
608 ret.handle = locale->locinfo->lc_handle[LC_CTYPE];
609 _free_locale(locale);
613 /* ?_Getcvt@_Locinfo@std@@QBE?AU_Cvtvec@@XZ */
614 /* ?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@XZ */
615 DEFINE_THISCALL_WRAPPER(_Locinfo__Getcvt, 8)
616 _Cvtvec* __thiscall _Locinfo__Getcvt(const _Locinfo *this, _Cvtvec *ret)
622 /* ?_Getdateorder@_Locinfo@std@@QBEHXZ */
623 /* ?_Getdateorder@_Locinfo@std@@QEBAHXZ */
624 DEFINE_THISCALL_WRAPPER(_Locinfo__Getdateorder, 4)
625 int __thiscall _Locinfo__Getdateorder(const _Locinfo *this)
627 FIXME("(%p) stub\n", this);
631 /* ?_Getdays@_Locinfo@std@@QBEPBDXZ */
632 /* ?_Getdays@_Locinfo@std@@QEBAPEBDXZ */
633 DEFINE_THISCALL_WRAPPER(_Locinfo__Getdays, 4)
634 const char* __thiscall _Locinfo__Getdays(_Locinfo *this)
636 char *days = _Getdays();
638 TRACE("(%p)\n", this);
641 MSVCP_basic_string_char_dtor(&this->days);
642 MSVCP_basic_string_char_ctor_cstr(&this->days, days);
646 return this->days.size ? MSVCP_basic_string_char_c_str(&this->days) :
647 ":Sun:Sunday:Mon:Monday:Tue:Tuesday:Wed:Wednesday:Thu:Thursday:Fri:Friday:Sat:Saturday";
650 /* ?_Getmonths@_Locinfo@std@@QBEPBDXZ */
651 /* ?_Getmonths@_Locinfo@std@@QEBAPEBDXZ */
652 DEFINE_THISCALL_WRAPPER(_Locinfo__Getmonths, 4)
653 const char* __thiscall _Locinfo__Getmonths(_Locinfo *this)
655 char *months = _Getmonths();
657 TRACE("(%p)\n", this);
660 MSVCP_basic_string_char_dtor(&this->months);
661 MSVCP_basic_string_char_ctor_cstr(&this->months, months);
665 return this->months.size ? MSVCP_basic_string_char_c_str(&this->months) :
666 ":Jan:January:Feb:February:Mar:March:Apr:April:May:May:Jun:June:Jul:July"
667 ":Aug:August:Sep:September:Oct:October:Nov:November:Dec:December";
670 /* ?_Getfalse@_Locinfo@std@@QBEPBDXZ */
671 /* ?_Getfalse@_Locinfo@std@@QEBAPEBDXZ */
672 DEFINE_THISCALL_WRAPPER(_Locinfo__Getfalse, 4)
673 const char* __thiscall _Locinfo__Getfalse(const _Locinfo *this)
675 TRACE("(%p)\n", this);
679 /* ?_Gettrue@_Locinfo@std@@QBEPBDXZ */
680 /* ?_Gettrue@_Locinfo@std@@QEBAPEBDXZ */
681 DEFINE_THISCALL_WRAPPER(_Locinfo__Gettrue, 4)
682 const char* __thiscall _Locinfo__Gettrue(const _Locinfo *this)
684 TRACE("(%p)\n", this);
688 /* ?_Getlconv@_Locinfo@std@@QBEPBUlconv@@XZ */
689 /* ?_Getlconv@_Locinfo@std@@QEBAPEBUlconv@@XZ */
690 DEFINE_THISCALL_WRAPPER(_Locinfo__Getlconv, 4)
691 const struct lconv* __thiscall _Locinfo__Getlconv(const _Locinfo *this)
693 TRACE("(%p)\n", this);
697 /* ?_Getname@_Locinfo@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
698 /* ?_Getname@_Locinfo@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
699 DEFINE_THISCALL_WRAPPER(_Locinfo__Getname, 8)
700 basic_string_char* __thiscall _Locinfo__Getname(const _Locinfo *this, basic_string_char *ret)
702 TRACE("(%p)\n", this);
704 MSVCP_basic_string_char_copy_ctor(ret, &this->newlocname);
708 /* ?_Gettnames@_Locinfo@std@@QBE?AV_Timevec@2@XZ */
709 /* ?_Gettnames@_Locinfo@std@@QEBA?AV_Timevec@2@XZ */
710 DEFINE_THISCALL_WRAPPER(_Locinfo__Gettnames, 8)
711 _Timevec*__thiscall _Locinfo__Gettnames(const _Locinfo *this, _Timevec *ret)
713 TRACE("(%p)\n", this);
715 _Timevec_ctor_timeptr(ret, _Gettnames());
719 /* ?id@?$collate@D@std@@2V0locale@2@A */
720 locale_id collate_char_id = {0};
722 /* ??_7?$collate@D@std@@6B@ */
723 extern const vtable_ptr MSVCP_collate_char_vtable;
725 /* ?_Init@?$collate@D@std@@IAEXABV_Locinfo@2@@Z */
726 /* ?_Init@?$collate@D@std@@IEAAXAEBV_Locinfo@2@@Z */
727 DEFINE_THISCALL_WRAPPER(collate_char__Init, 8)
728 void __thiscall collate_char__Init(collate *this, const _Locinfo *locinfo)
730 TRACE("(%p %p)\n", this, locinfo);
731 _Locinfo__Getcoll(locinfo, &this->coll);
734 /* ??0?$collate@D@std@@IAE@PBDI@Z */
735 /* ??0?$collate@D@std@@IEAA@PEBD_K@Z */
736 DEFINE_THISCALL_WRAPPER(collate_char_ctor_name, 12)
737 collate* __thiscall collate_char_ctor_name(collate *this, const char *name, MSVCP_size_t refs)
741 TRACE("(%p %s %lu)\n", this, name, refs);
743 locale_facet_ctor_refs(&this->facet, refs);
744 this->facet.vtable = &MSVCP_collate_char_vtable;
746 _Locinfo_ctor_cstr(&locinfo, name);
747 collate_char__Init(this, &locinfo);
748 _Locinfo_dtor(&locinfo);
752 /* ??0?$collate@D@std@@QAE@ABV_Locinfo@1@I@Z */
753 /* ??0?$collate@D@std@@QEAA@AEBV_Locinfo@1@_K@Z */
754 DEFINE_THISCALL_WRAPPER(collate_char_ctor_locinfo, 12)
755 collate* __thiscall collate_char_ctor_locinfo(collate *this, _Locinfo *locinfo, MSVCP_size_t refs)
757 TRACE("(%p %p %lu)\n", this, locinfo, refs);
759 locale_facet_ctor_refs(&this->facet, refs);
760 this->facet.vtable = &MSVCP_collate_char_vtable;
761 collate_char__Init(this, locinfo);
765 /* ??0?$collate@D@std@@QAE@I@Z */
766 /* ??0?$collate@D@std@@QEAA@_K@Z */
767 DEFINE_THISCALL_WRAPPER(collate_char_ctor_refs, 8)
768 collate* __thiscall collate_char_ctor_refs(collate *this, MSVCP_size_t refs)
770 return collate_char_ctor_name(this, "C", refs);
773 /* ??1?$collate@D@std@@MAE@XZ */
774 /* ??1?$collate@D@std@@MEAA@XZ */
775 DEFINE_THISCALL_WRAPPER(collate_char_dtor, 4)
776 void __thiscall collate_char_dtor(collate *this)
778 TRACE("(%p)\n", this);
781 DEFINE_THISCALL_WRAPPER(MSVCP_collate_char_vector_dtor, 8)
782 collate* __thiscall MSVCP_collate_char_vector_dtor(collate *this, unsigned int flags)
784 TRACE("(%p %x)\n", this, flags);
786 /* we have an array, with the number of elements stored before the first object */
787 int i, *ptr = (int *)this-1;
789 for(i=*ptr-1; i>=0; i--)
790 collate_char_dtor(this+i);
791 MSVCRT_operator_delete(ptr);
793 collate_char_dtor(this);
795 MSVCRT_operator_delete(this);
801 /* ??_F?$collate@D@std@@QAEXXZ */
802 /* ??_F?$collate@D@std@@QEAAXXZ */
803 DEFINE_THISCALL_WRAPPER(collate_char_ctor, 4)
804 collate* __thiscall collate_char_ctor(collate *this)
806 return collate_char_ctor_name(this, "C", 0);
809 /* ?_Getcat@?$collate@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
810 /* ?_Getcat@?$collate@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
811 MSVCP_size_t __cdecl collate_char__Getcat(const locale_facet **facet, const locale *loc)
813 TRACE("(%p %p)\n", facet, loc);
815 if(facet && !*facet) {
816 *facet = MSVCRT_operator_new(sizeof(collate));
818 ERR("Out of memory\n");
819 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
822 collate_char_ctor_name((collate*)*facet,
823 MSVCP_basic_string_char_c_str(&loc->ptr->name), 0);
830 int __cdecl _Strcoll(const char *first1, const char *last1, const char *first2,
831 const char *last2, const _Collvec *coll)
835 TRACE("(%s %s)\n", debugstr_an(first1, last1-first1), debugstr_an(first2, last2-first2));
840 lcid = ___lc_handle_func()[LC_COLLATE];
841 return CompareStringA(lcid, 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL;
844 /* ?do_compare@?$collate@D@std@@MBEHPBD000@Z */
845 /* ?do_compare@?$collate@D@std@@MEBAHPEBD000@Z */
846 DEFINE_THISCALL_WRAPPER(collate_char_do_compare, 20)
847 #define call_collate_char_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 4, int, \
848 (const collate*, const char*, const char*, const char*, const char*), \
849 (this, first1, last1, first2, last2))
850 int __thiscall collate_char_do_compare(const collate *this, const char *first1,
851 const char *last1, const char *first2, const char *last2)
853 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
854 return _Strcoll(first1, last1, first2, last2, &this->coll);
857 /* ?compare@?$collate@D@std@@QBEHPBD000@Z */
858 /* ?compare@?$collate@D@std@@QEBAHPEBD000@Z */
859 DEFINE_THISCALL_WRAPPER(collate_char_compare, 20)
860 int __thiscall collate_char_compare(const collate *this, const char *first1,
861 const char *last1, const char *first2, const char *last2)
863 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
864 return call_collate_char_do_compare(this, first1, last1, first2, last2);
867 /* ?do_hash@?$collate@D@std@@MBEJPBD0@Z */
868 /* ?do_hash@?$collate@D@std@@MEBAJPEBD0@Z */
869 DEFINE_THISCALL_WRAPPER(collate_char_do_hash, 12)
870 #define call_collate_char_do_hash(this, first, last) CALL_VTBL_FUNC(this, 12, LONG, \
871 (const collate*, const char*, const char*), (this, first, last))
872 LONG __thiscall collate_char_do_hash(const collate *this,
873 const char *first, const char *last)
877 TRACE("(%p %p %p)\n", this, first, last);
879 for(; first<last; first++)
880 ret = (ret<<8 | ret>>24) + *first;
884 /* ?hash@?$collate@D@std@@QBEJPBD0@Z */
885 /* ?hash@?$collate@D@std@@QEBAJPEBD0@Z */
886 DEFINE_THISCALL_WRAPPER(collate_char_hash, 12)
887 LONG __thiscall collate_char_hash(const collate *this,
888 const char *first, const char *last)
890 TRACE("(%p %p %p)\n", this, first, last);
891 return call_collate_char_do_hash(this, first, last);
894 /* ?do_transform@?$collate@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PBD0@Z */
895 /* ?do_transform@?$collate@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PEBD0@Z */
896 DEFINE_THISCALL_WRAPPER(collate_char_do_transform, 16)
897 basic_string_char* __thiscall collate_char_do_transform(const collate *this,
898 basic_string_char *ret, const char *first, const char *last)
900 FIXME("(%p %p %p) stub\n", this, first, last);
904 /* ?transform@?$collate@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PBD0@Z */
905 /* ?transform@?$collate@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@PEBD0@Z */
906 DEFINE_THISCALL_WRAPPER(collate_char_transform, 16)
907 basic_string_char* __thiscall collate_char_transform(const collate *this,
908 basic_string_char *ret, const char *first, const char *last)
910 FIXME("(%p %p %p) stub\n", this, first, last);
914 /* ?id@?$collate@_W@std@@2V0locale@2@A */
915 locale_id collate_wchar_id = {0};
916 /* ?id@?$collate@G@std@@2V0locale@2@A */
917 locale_id collate_short_id = {0};
919 /* ??_7?$collate@_W@std@@6B@ */
920 extern const vtable_ptr MSVCP_collate_wchar_vtable;
921 /* ??_7?$collate@G@std@@6B@ */
922 extern const vtable_ptr MSVCP_collate_short_vtable;
924 /* ?_Init@?$collate@_W@std@@IAEXABV_Locinfo@2@@Z */
925 /* ?_Init@?$collate@_W@std@@IEAAXAEBV_Locinfo@2@@Z */
926 /* ?_Init@?$collate@G@std@@IAEXABV_Locinfo@2@@Z */
927 /* ?_Init@?$collate@G@std@@IEAAXAEBV_Locinfo@2@@Z */
928 DEFINE_THISCALL_WRAPPER(collate_wchar__Init, 8)
929 void __thiscall collate_wchar__Init(collate *this, const _Locinfo *locinfo)
931 TRACE("(%p %p)\n", this, locinfo);
932 _Locinfo__Getcoll(locinfo, &this->coll);
935 /* ??0?$collate@_W@std@@IAE@PBDI@Z */
936 /* ??0?$collate@_W@std@@IEAA@PEBD_K@Z */
937 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_name, 12)
938 collate* __thiscall collate_wchar_ctor_name(collate *this, const char *name, MSVCP_size_t refs)
942 TRACE("(%p %s %lu)\n", this, name, refs);
944 locale_facet_ctor_refs(&this->facet, refs);
945 this->facet.vtable = &MSVCP_collate_wchar_vtable;
947 _Locinfo_ctor_cstr(&locinfo, name);
948 collate_wchar__Init(this, &locinfo);
949 _Locinfo_dtor(&locinfo);
953 /* ??0?$collate@G@std@@IAE@PBDI@Z */
954 /* ??0?$collate@G@std@@IEAA@PEBD_K@Z */
955 DEFINE_THISCALL_WRAPPER(collate_short_ctor_name, 12)
956 collate* __thiscall collate_short_ctor_name(collate *this, const char *name, MSVCP_size_t refs)
958 collate *ret = collate_wchar_ctor_name(this, name, refs);
959 ret->facet.vtable = &MSVCP_collate_short_vtable;
963 /* ??0?$collate@_W@std@@QAE@ABV_Locinfo@1@I@Z */
964 /* ??0?$collate@_W@std@@QEAA@AEBV_Locinfo@1@_K@Z */
965 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_locinfo, 12)
966 collate* __thiscall collate_wchar_ctor_locinfo(collate *this, _Locinfo *locinfo, MSVCP_size_t refs)
968 TRACE("(%p %p %lu)\n", this, locinfo, refs);
970 locale_facet_ctor_refs(&this->facet, refs);
971 this->facet.vtable = &MSVCP_collate_wchar_vtable;
972 collate_wchar__Init(this, locinfo);
976 /* ??0?$collate@G@std@@QAE@ABV_Locinfo@1@I@Z */
977 /* ??0?$collate@G@std@@QEAA@AEBV_Locinfo@1@_K@Z */
978 DEFINE_THISCALL_WRAPPER(collate_short_ctor_locinfo, 12)
979 collate* __thiscall collate_short_ctor_locinfo(collate *this, _Locinfo *locinfo, MSVCP_size_t refs)
981 collate *ret = collate_wchar_ctor_locinfo(this, locinfo, refs);
982 ret->facet.vtable = &MSVCP_collate_short_vtable;
986 /* ??0?$collate@_W@std@@QAE@I@Z */
987 /* ??0?$collate@_W@std@@QEAA@_K@Z */
988 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_refs, 8)
989 collate* __thiscall collate_wchar_ctor_refs(collate *this, MSVCP_size_t refs)
991 return collate_wchar_ctor_name(this, "C", refs);
994 /* ??0?$collate@G@std@@QAE@I@Z */
995 /* ??0?$collate@G@std@@QEAA@_K@Z */
996 DEFINE_THISCALL_WRAPPER(collate_short_ctor_refs, 8)
997 collate* __thiscall collate_short_ctor_refs(collate *this, MSVCP_size_t refs)
999 collate *ret = collate_wchar_ctor_refs(this, refs);
1000 ret->facet.vtable = &MSVCP_collate_short_vtable;
1004 /* ??1?$collate@_W@std@@MAE@XZ */
1005 /* ??1?$collate@_W@std@@MEAA@XZ */
1006 /* ??1?$collate@G@std@@MAE@XZ */
1007 /* ??1?$collate@G@std@@MEAA@XZ */
1008 DEFINE_THISCALL_WRAPPER(collate_wchar_dtor, 4)
1009 void __thiscall collate_wchar_dtor(collate *this)
1011 TRACE("(%p)\n", this);
1014 DEFINE_THISCALL_WRAPPER(MSVCP_collate_wchar_vector_dtor, 8)
1015 collate* __thiscall MSVCP_collate_wchar_vector_dtor(collate *this, unsigned int flags)
1017 TRACE("(%p %x)\n", this, flags);
1019 /* we have an array, with the number of elements stored before the first object */
1020 int i, *ptr = (int *)this-1;
1022 for(i=*ptr-1; i>=0; i--)
1023 collate_wchar_dtor(this+i);
1024 MSVCRT_operator_delete(ptr);
1026 collate_wchar_dtor(this);
1028 MSVCRT_operator_delete(this);
1034 DEFINE_THISCALL_WRAPPER(MSVCP_collate_short_vector_dtor, 8)
1035 collate* __thiscall MSVCP_collate_short_vector_dtor(collate *this, unsigned int flags)
1037 return MSVCP_collate_wchar_vector_dtor(this, flags);
1040 /* ??_F?$collate@_W@std@@QAEXXZ */
1041 /* ??_F?$collate@_W@std@@QEAAXXZ */
1042 DEFINE_THISCALL_WRAPPER(collate_wchar_ctor, 4)
1043 collate* __thiscall collate_wchar_ctor(collate *this)
1045 return collate_wchar_ctor_name(this, "C", 0);
1048 /* ??_F?$collate@G@std@@QAEXXZ */
1049 /* ??_F?$collate@G@std@@QEAAXXZ */
1050 DEFINE_THISCALL_WRAPPER(collate_short_ctor, 4)
1051 collate* __thiscall collate_short_ctor(collate *this)
1053 collate *ret = collate_wchar_ctor(this);
1054 ret->facet.vtable = &MSVCP_collate_short_vtable;
1058 /* ?_Getcat@?$collate@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1059 /* ?_Getcat@?$collate@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1060 MSVCP_size_t __cdecl collate_wchar__Getcat(const locale_facet **facet, const locale *loc)
1062 TRACE("(%p %p)\n", facet, loc);
1064 if(facet && !*facet) {
1065 *facet = MSVCRT_operator_new(sizeof(collate));
1067 ERR("Out of memory\n");
1068 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
1071 collate_wchar_ctor_name((collate*)*facet,
1072 MSVCP_basic_string_char_c_str(&loc->ptr->name), 0);
1078 /* ?_Getcat@?$collate@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1079 /* ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1080 MSVCP_size_t __cdecl collate_short__Getcat(const locale_facet **facet, const locale *loc)
1082 if(facet && !*facet) {
1083 collate_wchar__Getcat(facet, loc);
1084 (*(locale_facet**)facet)->vtable = &MSVCP_collate_short_vtable;
1091 int __cdecl _Wcscoll(const wchar_t *first1, const wchar_t *last1, const wchar_t *first2,
1092 const wchar_t *last2, const _Collvec *coll)
1096 TRACE("(%s %s)\n", debugstr_wn(first1, last1-first1), debugstr_wn(first2, last2-first2));
1099 lcid = coll->handle;
1101 lcid = ___lc_handle_func()[LC_COLLATE];
1102 return CompareStringW(lcid, 0, first1, last1-first1, first2, last2-first2)-CSTR_EQUAL;
1105 /* ?do_compare@?$collate@_W@std@@MBEHPB_W000@Z */
1106 /* ?do_compare@?$collate@_W@std@@MEBAHPEB_W000@Z */
1107 /* ?do_compare@?$collate@G@std@@MBEHPBG000@Z */
1108 /* ?do_compare@?$collate@G@std@@MEBAHPEBG000@Z */
1109 DEFINE_THISCALL_WRAPPER(collate_wchar_do_compare, 20)
1110 #define call_collate_wchar_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 4, int, \
1111 (const collate*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*), \
1112 (this, first1, last1, first2, last2))
1113 int __thiscall collate_wchar_do_compare(const collate *this, const wchar_t *first1,
1114 const wchar_t *last1, const wchar_t *first2, const wchar_t *last2)
1116 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
1117 return _Wcscoll(first1, last1, first2, last2, &this->coll);
1120 /* ?compare@?$collate@_W@std@@QBEHPB_W000@Z */
1121 /* ?compare@?$collate@_W@std@@QEBAHPEB_W000@Z */
1122 /* ?compare@?$collate@G@std@@QBEHPBG000@Z */
1123 /* ?compare@?$collate@G@std@@QEBAHPEBG000@Z */
1124 DEFINE_THISCALL_WRAPPER(collate_wchar_compare, 20)
1125 int __thiscall collate_wchar_compare(const collate *this, const wchar_t *first1,
1126 const wchar_t *last1, const wchar_t *first2, const wchar_t *last2)
1128 TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2);
1129 return call_collate_wchar_do_compare(this, first1, last1, first2, last2);
1132 /* ?do_hash@?$collate@_W@std@@MBEJPB_W0@Z */
1133 /* ?do_hash@?$collate@_W@std@@MEBAJPEB_W0@Z */
1134 /* ?do_hash@?$collate@G@std@@MBEJPBG0@Z */
1135 /* ?do_hash@?$collate@G@std@@MEBAJPEBG0@Z */
1136 DEFINE_THISCALL_WRAPPER(collate_wchar_do_hash, 12)
1137 #define call_collate_wchar_do_hash(this, first, last) CALL_VTBL_FUNC(this, 12, LONG, \
1138 (const collate*, const wchar_t*, const wchar_t*), (this, first, last))
1139 LONG __thiscall collate_wchar_do_hash(const collate *this,
1140 const wchar_t *first, const wchar_t *last)
1144 TRACE("(%p %p %p)\n", this, first, last);
1146 for(; first<last; first++)
1147 ret = (ret<<8 | ret>>24) + *first;
1151 /* ?hash@?$collate@_W@std@@QBEJPB_W0@Z */
1152 /* ?hash@?$collate@_W@std@@QEBAJPEB_W0@Z */
1153 /* ?hash@?$collate@G@std@@QBEJPBG0@Z */
1154 /* ?hash@?$collate@G@std@@QEBAJPEBG0@Z */
1155 DEFINE_THISCALL_WRAPPER(collate_wchar_hash, 12)
1156 LONG __thiscall collate_wchar_hash(const collate *this,
1157 const wchar_t *first, const wchar_t *last)
1159 TRACE("(%p %p %p)\n", this, first, last);
1160 return call_collate_wchar_do_hash(this, first, last);
1163 /* ?do_transform@?$collate@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PB_W0@Z */
1164 /* ?do_transform@?$collate@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z */
1165 /* ?do_transform@?$collate@G@std@@MBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PBG0@Z */
1166 /* ?do_transform@?$collate@G@std@@MEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PEBG0@Z */
1167 DEFINE_THISCALL_WRAPPER(collate_wchar_do_transform, 16)
1168 basic_string_wchar* __thiscall collate_wchar_do_transform(const collate *this,
1169 basic_string_wchar *ret, const wchar_t *first, const wchar_t *last)
1171 FIXME("(%p %p %p) stub\n", this, first, last);
1175 /* ?transform@?$collate@_W@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PB_W0@Z */
1176 /* ?transform@?$collate@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PEB_W0@Z */
1177 /* ?transform@?$collate@G@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PBG0@Z */
1178 /* ?transform@?$collate@G@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@PEBG0@Z */
1179 DEFINE_THISCALL_WRAPPER(collate_wchar_transform, 16)
1180 basic_string_wchar* __thiscall collate_wchar_transform(const collate *this,
1181 basic_string_wchar *ret, const wchar_t *first, const wchar_t *last)
1183 FIXME("(%p %p %p) stub\n", this, first, last);
1187 /* ??_7ctype_base@std@@6B@ */
1188 extern const vtable_ptr MSVCP_ctype_base_vtable;
1190 /* ??0ctype_base@std@@QAE@I@Z */
1191 /* ??0ctype_base@std@@QEAA@_K@Z */
1192 DEFINE_THISCALL_WRAPPER(ctype_base_ctor_refs, 8)
1193 ctype_base* __thiscall ctype_base_ctor_refs(ctype_base *this, MSVCP_size_t refs)
1195 TRACE("(%p %lu)\n", this, refs);
1196 locale_facet_ctor_refs(&this->facet, refs);
1197 this->facet.vtable = &MSVCP_ctype_base_vtable;
1201 /* ??_Fctype_base@std@@QAEXXZ */
1202 /* ??_Fctype_base@std@@QEAAXXZ */
1203 DEFINE_THISCALL_WRAPPER(ctype_base_ctor, 4)
1204 ctype_base* __thiscall ctype_base_ctor(ctype_base *this)
1206 TRACE("(%p)\n", this);
1207 locale_facet_ctor_refs(&this->facet, 0);
1208 this->facet.vtable = &MSVCP_ctype_base_vtable;
1212 /* ??1ctype_base@std@@UAE@XZ */
1213 /* ??1ctype_base@std@@UEAA@XZ */
1214 DEFINE_THISCALL_WRAPPER(ctype_base_dtor, 4)
1215 void __thiscall ctype_base_dtor(ctype_base *this)
1217 TRACE("(%p)\n", this);
1220 DEFINE_THISCALL_WRAPPER(MSVCP_ctype_base_vector_dtor, 8)
1221 ctype_base* __thiscall MSVCP_ctype_base_vector_dtor(ctype_base *this, unsigned int flags)
1223 TRACE("(%p %x)\n", this, flags);
1225 /* we have an array, with the number of elements stored before the first object */
1226 int i, *ptr = (int *)this-1;
1228 for(i=*ptr-1; i>=0; i--)
1229 ctype_base_dtor(this+i);
1230 MSVCRT_operator_delete(ptr);
1232 ctype_base_dtor(this);
1234 MSVCRT_operator_delete(this);
1240 /* ?_Xran@ctype_base@std@@KAXXZ */
1241 void __cdecl ctype_base__Xran(void)
1243 throw_exception(EXCEPTION_OUT_OF_RANGE, "out of range in ctype<T>");
1246 /* ?id@?$ctype@D@std@@2V0locale@2@A */
1247 locale_id ctype_char_id = {0};
1248 /* ?table_size@?$ctype@D@std@@2IB */
1249 /* ?table_size@?$ctype@D@std@@2_KB */
1250 MSVCP_size_t ctype_char_table_size = 256;
1252 /* ??_7?$ctype@D@std@@6B@ */
1253 extern const vtable_ptr MSVCP_ctype_char_vtable;
1255 /* ?_Id_func@?$ctype@D@std@@SAAAVid@locale@2@XZ */
1256 /* ?_Id_func@?$ctype@D@std@@SAAEAVid@locale@2@XZ */
1257 locale_id* __cdecl ctype_char__Id_func(void)
1260 return &ctype_char_id;
1263 /* ?_Init@?$ctype@D@std@@IAEXABV_Locinfo@2@@Z */
1264 /* ?_Init@?$ctype@D@std@@IEAAXAEBV_Locinfo@2@@Z */
1265 DEFINE_THISCALL_WRAPPER(ctype_char__Init, 8)
1266 void __thiscall ctype_char__Init(ctype_char *this, const _Locinfo *locinfo)
1268 TRACE("(%p %p)\n", this, locinfo);
1269 _Locinfo__Getctype(locinfo, &this->ctype);
1272 /* ?_Tidy@?$ctype@D@std@@IAEXXZ */
1273 /* ?_Tidy@?$ctype@D@std@@IEAAXXZ */
1274 DEFINE_THISCALL_WRAPPER(ctype_char__Tidy, 4)
1275 void __thiscall ctype_char__Tidy(ctype_char *this)
1277 TRACE("(%p)\n", this);
1279 if(this->ctype.delfl)
1280 free((short*)this->ctype.table);
1283 /* ?classic_table@?$ctype@D@std@@KAPBFXZ */
1284 /* ?classic_table@?$ctype@D@std@@KAPEBFXZ */
1285 const short* __cdecl ctype_char_classic_table(void)
1288 return &((short*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_ctype"))[1];
1291 /* ??0?$ctype@D@std@@QAE@ABV_Locinfo@1@I@Z */
1292 /* ??0?$ctype@D@std@@QEAA@AEBV_Locinfo@1@_K@Z */
1293 DEFINE_THISCALL_WRAPPER(ctype_char_ctor_locinfo, 12)
1294 ctype_char* __thiscall ctype_char_ctor_locinfo(ctype_char *this,
1295 const _Locinfo *locinfo, MSVCP_size_t refs)
1297 TRACE("(%p %p %lu)\n", this, locinfo, refs);
1298 ctype_base_ctor_refs(&this->base, refs);
1299 this->base.facet.vtable = &MSVCP_ctype_char_vtable;
1300 ctype_char__Init(this, locinfo);
1304 /* ??0?$ctype@D@std@@QAE@PBF_NI@Z */
1305 /* ??0?$ctype@D@std@@QEAA@PEBF_N_K@Z */
1306 DEFINE_THISCALL_WRAPPER(ctype_char_ctor_table, 16)
1307 ctype_char* __thiscall ctype_char_ctor_table(ctype_char *this,
1308 const short *table, MSVCP_bool delete, MSVCP_size_t refs)
1312 TRACE("(%p %p %d %lu)\n", this, table, delete, refs);
1314 ctype_base_ctor_refs(&this->base, refs);
1315 this->base.facet.vtable = &MSVCP_ctype_char_vtable;
1317 _Locinfo_ctor(&locinfo);
1318 ctype_char__Init(this, &locinfo);
1319 _Locinfo_dtor(&locinfo);
1322 ctype_char__Tidy(this);
1323 this->ctype.table = table;
1324 this->ctype.delfl = delete;
1329 /* ??_F?$ctype@D@std@@QAEXXZ */
1330 /* ??_F?$ctype@D@std@@QEAAXXZ */
1331 DEFINE_THISCALL_WRAPPER(ctype_char_ctor, 4)
1332 ctype_char* __thiscall ctype_char_ctor(ctype_char *this)
1334 return ctype_char_ctor_table(this, NULL, FALSE, 0);
1337 /* ??1?$ctype@D@std@@MAE@XZ */
1338 /* ??1?$ctype@D@std@@MEAA@XZ */
1339 DEFINE_THISCALL_WRAPPER(ctype_char_dtor, 4)
1340 void __thiscall ctype_char_dtor(ctype_char *this)
1342 TRACE("(%p)\n", this);
1343 ctype_char__Tidy(this);
1346 DEFINE_THISCALL_WRAPPER(MSVCP_ctype_char_vector_dtor, 8)
1347 ctype_char* __thiscall MSVCP_ctype_char_vector_dtor(ctype_char *this, unsigned int flags)
1349 TRACE("(%p %x)\n", this, flags);
1351 /* we have an array, with the number of elements stored before the first object */
1352 int i, *ptr = (int *)this-1;
1354 for(i=*ptr-1; i>=0; i--)
1355 ctype_char_dtor(this+i);
1356 MSVCRT_operator_delete(ptr);
1358 ctype_char_dtor(this);
1360 MSVCRT_operator_delete(this);
1366 /* ?do_narrow@?$ctype@D@std@@MBEDDD@Z */
1367 /* ?do_narrow@?$ctype@D@std@@MEBADDD@Z */
1368 DEFINE_THISCALL_WRAPPER(ctype_char_do_narrow_ch, 12)
1369 #define call_ctype_char_do_narrow_ch(this, ch, unused) CALL_VTBL_FUNC(this, 36, \
1370 char, (const ctype_char*, char, char), (this, ch, unused))
1371 char __thiscall ctype_char_do_narrow_ch(const ctype_char *this, char ch, char unused)
1373 TRACE("(%p %c %c)\n", this, ch, unused);
1377 /* ?do_narrow@?$ctype@D@std@@MBEPBDPBD0DPAD@Z */
1378 /* ?do_narrow@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD@Z */
1379 DEFINE_THISCALL_WRAPPER(ctype_char_do_narrow, 20)
1380 #define call_ctype_char_do_narrow(this, first, last, unused, dest) CALL_VTBL_FUNC(this, 32, \
1381 const char*, (const ctype_char*, const char*, const char*, char, char*), \
1382 (this, first, last, unused, dest))
1383 const char* __thiscall ctype_char_do_narrow(const ctype_char *this,
1384 const char *first, const char *last, char unused, char *dest)
1386 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1387 memcpy(dest, first, last-first);
1391 /* ?_Do_narrow_s@?$ctype@D@std@@MBEPBDPBD0DPADI@Z */
1392 /* ?_Do_narrow_s@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD_K@Z */
1393 DEFINE_THISCALL_WRAPPER(ctype_char__Do_narrow_s, 24)
1394 #define call_ctype_char__Do_narrow_s(this, first, last, unused, dest, size) CALL_VTBL_FUNC(this, 40, \
1395 const char*, (const ctype_char*, const char*, const char*, char, char*, MSVCP_size_t), \
1396 (this, first, last, unused, dest, size))
1397 const char* __thiscall ctype_char__Do_narrow_s(const ctype_char *this, const char *first,
1398 const char *last, char unused, char *dest, MSVCP_size_t size)
1400 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1401 memcpy_s(dest, size, first, last-first);
1405 /* ?narrow@?$ctype@D@std@@QBEDDD@Z */
1406 /* ?narrow@?$ctype@D@std@@QEBADDD@Z */
1407 DEFINE_THISCALL_WRAPPER(ctype_char_narrow_ch, 12)
1408 char __thiscall ctype_char_narrow_ch(const ctype_char *this, char ch, char dflt)
1410 TRACE("(%p %c %c)\n", this, ch, dflt);
1411 return call_ctype_char_do_narrow_ch(this, ch, dflt);
1414 /* ?narrow@?$ctype@D@std@@QBEPBDPBD0DPAD@Z */
1415 /* ?narrow@?$ctype@D@std@@QEBAPEBDPEBD0DPEAD@Z */
1416 DEFINE_THISCALL_WRAPPER(ctype_char_narrow, 20)
1417 const char* __thiscall ctype_char_narrow(const ctype_char *this,
1418 const char *first, const char *last, char dflt, char *dest)
1420 TRACE("(%p %p %p %c %p)\n", this, first, last, dflt, dest);
1421 return call_ctype_char_do_narrow(this, first, last, dflt, dest);
1424 /* ?_Narrow_s@?$ctype@D@std@@QBEPBDPBD0DPADI@Z */
1425 /* ?_Narrow_s@?$ctype@D@std@@QEBAPEBDPEBD0DPEAD_K@Z */
1426 DEFINE_THISCALL_WRAPPER(ctype_char__Narrow_s, 24)
1427 const char* __thiscall ctype_char__Narrow_s(const ctype_char *this, const char *first,
1428 const char *last, char dflt, char *dest, MSVCP_size_t size)
1430 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1431 return call_ctype_char__Do_narrow_s(this, first, last, dflt, dest, size);
1434 /* ?do_widen@?$ctype@D@std@@MBEDD@Z */
1435 /* ?do_widen@?$ctype@D@std@@MEBADD@Z */
1436 DEFINE_THISCALL_WRAPPER(ctype_char_do_widen_ch, 8)
1437 #define call_ctype_char_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 24, \
1438 char, (const ctype_char*, char), (this, ch))
1439 char __thiscall ctype_char_do_widen_ch(const ctype_char *this, char ch)
1441 TRACE("(%p %c)\n", this, ch);
1445 /* ?do_widen@?$ctype@D@std@@MBEPBDPBD0PAD@Z */
1446 /* ?do_widen@?$ctype@D@std@@MEBAPEBDPEBD0PEAD@Z */
1447 DEFINE_THISCALL_WRAPPER(ctype_char_do_widen, 16)
1448 #define call_ctype_char_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 20, \
1449 const char*, (const ctype_char*, const char*, const char*, char*), \
1450 (this, first, last, dest))
1451 const char* __thiscall ctype_char_do_widen(const ctype_char *this,
1452 const char *first, const char *last, char *dest)
1454 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1455 memcpy(dest, first, last-first);
1459 /* ?_Do_widen_s@?$ctype@D@std@@MBEPBDPBD0PADI@Z */
1460 /* ?_Do_widen_s@?$ctype@D@std@@MEBAPEBDPEBD0PEAD_K@Z */
1461 DEFINE_THISCALL_WRAPPER(ctype_char__Do_widen_s, 20)
1462 #define call_ctype_char__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 28, \
1463 const char*, (const ctype_char*, const char*, const char*, char*, MSVCP_size_t), \
1464 (this, first, last, dest, size))
1465 const char* __thiscall ctype_char__Do_widen_s(const ctype_char *this,
1466 const char *first, const char *last, char *dest, MSVCP_size_t size)
1468 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1469 memcpy_s(dest, size, first, last-first);
1473 /* ?widen@?$ctype@D@std@@QBEDD@Z */
1474 /* ?widen@?$ctype@D@std@@QEBADD@Z */
1475 DEFINE_THISCALL_WRAPPER(ctype_char_widen_ch, 8)
1476 char __thiscall ctype_char_widen_ch(const ctype_char *this, char ch)
1478 TRACE("(%p %c)\n", this, ch);
1479 return call_ctype_char_do_widen_ch(this, ch);
1482 /* ?widen@?$ctype@D@std@@QBEPBDPBD0PAD@Z */
1483 /* ?widen@?$ctype@D@std@@QEBAPEBDPEBD0PEAD@Z */
1484 DEFINE_THISCALL_WRAPPER(ctype_char_widen, 16)
1485 const char* __thiscall ctype_char_widen(const ctype_char *this,
1486 const char *first, const char *last, char *dest)
1488 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1489 return call_ctype_char_do_widen(this, first, last, dest);
1492 /* ?_Widen_s@?$ctype@D@std@@QBEPBDPBD0PADI@Z */
1493 /* ?_Widen_s@?$ctype@D@std@@QEBAPEBDPEBD0PEAD_K@Z */
1494 DEFINE_THISCALL_WRAPPER(ctype_char__Widen_s, 20)
1495 const char* __thiscall ctype_char__Widen_s(const ctype_char *this,
1496 const char *first, const char *last, char *dest, MSVCP_size_t size)
1498 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
1499 return call_ctype_char__Do_widen_s(this, first, last, dest, size);
1502 /* ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1503 /* ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
1504 MSVCP_size_t __cdecl ctype_char__Getcat(const locale_facet **facet, const locale *loc)
1506 TRACE("(%p %p)\n", facet, loc);
1508 if(facet && !*facet) {
1511 *facet = MSVCRT_operator_new(sizeof(ctype_char));
1513 ERR("Out of memory\n");
1514 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
1518 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
1519 ctype_char_ctor_locinfo((ctype_char*)*facet, &locinfo, 0);
1520 _Locinfo_dtor(&locinfo);
1526 ctype_char* ctype_char_use_facet(const locale *loc)
1528 static ctype_char *obj = NULL;
1531 const locale_facet *fac;
1533 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
1534 fac = locale__Getfacet(loc, locale_id_operator_size_t(&ctype_char_id));
1536 _Lockit_dtor(&lock);
1537 return (ctype_char*)fac;
1541 _Lockit_dtor(&lock);
1545 ctype_char__Getcat(&fac, loc);
1546 obj = (ctype_char*)fac;
1547 locale_facet__Incref(&obj->base.facet);
1548 locale_facet_register(&obj->base.facet);
1549 _Lockit_dtor(&lock);
1555 int __cdecl _Tolower(int ch, const _Ctypevec *ctype)
1559 TRACE("%d %p\n", ch, ctype);
1564 cp = ___lc_codepage_func();
1566 /* Don't convert to unicode in case of C locale */
1568 if(ch>='A' && ch<='Z')
1577 str[0] = (ch>>8) & 255;
1585 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, str, size, &wide, 1))
1588 lower = tolowerW(wide);
1592 WideCharToMultiByte(cp, 0, &lower, 1, str, 2, NULL, NULL);
1594 return str[0] + (str[1]<<8);
1598 /* ?do_tolower@?$ctype@D@std@@MBEDD@Z */
1599 /* ?do_tolower@?$ctype@D@std@@MEBADD@Z */
1600 #define call_ctype_char_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 8, \
1601 char, (const ctype_char*, char), (this, ch))
1602 DEFINE_THISCALL_WRAPPER(ctype_char_do_tolower_ch, 8)
1603 char __thiscall ctype_char_do_tolower_ch(const ctype_char *this, char ch)
1605 TRACE("(%p %c)\n", this, ch);
1606 return _Tolower(ch, &this->ctype);
1609 /* ?do_tolower@?$ctype@D@std@@MBEPBDPADPBD@Z */
1610 /* ?do_tolower@?$ctype@D@std@@MEBAPEBDPEADPEBD@Z */
1611 #define call_ctype_char_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 4, \
1612 const char*, (const ctype_char*, char*, const char*), (this, first, last))
1613 DEFINE_THISCALL_WRAPPER(ctype_char_do_tolower, 12)
1614 const char* __thiscall ctype_char_do_tolower(const ctype_char *this, char *first, const char *last)
1616 TRACE("(%p %p %p)\n", this, first, last);
1617 for(; first<last; first++)
1618 *first = _Tolower(*first, &this->ctype);
1622 /* ?tolower@?$ctype@D@std@@QBEDD@Z */
1623 /* ?tolower@?$ctype@D@std@@QEBADD@Z */
1624 DEFINE_THISCALL_WRAPPER(ctype_char_tolower_ch, 8)
1625 char __thiscall ctype_char_tolower_ch(const ctype_char *this, char ch)
1627 TRACE("(%p %c)\n", this, ch);
1628 return call_ctype_char_do_tolower_ch(this, ch);
1631 /* ?tolower@?$ctype@D@std@@QBEPBDPADPBD@Z */
1632 /* ?tolower@?$ctype@D@std@@QEBAPEBDPEADPEBD@Z */
1633 DEFINE_THISCALL_WRAPPER(ctype_char_tolower, 12)
1634 const char* __thiscall ctype_char_tolower(const ctype_char *this, char *first, const char *last)
1636 TRACE("(%p %p %p)\n", this, first, last);
1637 return call_ctype_char_do_tolower(this, first, last);
1641 int __cdecl _Toupper(int ch, const _Ctypevec *ctype)
1645 TRACE("%d %p\n", ch, ctype);
1650 cp = ___lc_codepage_func();
1652 /* Don't convert to unicode in case of C locale */
1654 if(ch>='a' && ch<='z')
1663 str[0] = (ch>>8) & 255;
1671 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, str, size, &wide, 1))
1674 upper = toupperW(wide);
1678 WideCharToMultiByte(cp, 0, &upper, 1, str, 2, NULL, NULL);
1680 return str[0] + (str[1]<<8);
1684 /* ?do_toupper@?$ctype@D@std@@MBEDD@Z */
1685 /* ?do_toupper@?$ctype@D@std@@MEBADD@Z */
1686 #define call_ctype_char_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 16, \
1687 char, (const ctype_char*, char), (this, ch))
1688 DEFINE_THISCALL_WRAPPER(ctype_char_do_toupper_ch, 8)
1689 char __thiscall ctype_char_do_toupper_ch(const ctype_char *this, char ch)
1691 TRACE("(%p %c)\n", this, ch);
1692 return _Toupper(ch, &this->ctype);
1695 /* ?do_toupper@?$ctype@D@std@@MBEPBDPADPBD@Z */
1696 /* ?do_toupper@?$ctype@D@std@@MEBAPEBDPEADPEBD@Z */
1697 #define call_ctype_char_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 12, \
1698 const char*, (const ctype_char*, char*, const char*), (this, first, last))
1699 DEFINE_THISCALL_WRAPPER(ctype_char_do_toupper, 12)
1700 const char* __thiscall ctype_char_do_toupper(const ctype_char *this,
1701 char *first, const char *last)
1703 TRACE("(%p %p %p)\n", this, first, last);
1704 for(; first<last; first++)
1705 *first = _Toupper(*first, &this->ctype);
1709 /* ?toupper@?$ctype@D@std@@QBEDD@Z */
1710 /* ?toupper@?$ctype@D@std@@QEBADD@Z */
1711 DEFINE_THISCALL_WRAPPER(ctype_char_toupper_ch, 8)
1712 char __thiscall ctype_char_toupper_ch(const ctype_char *this, char ch)
1714 TRACE("(%p %c)\n", this, ch);
1715 return call_ctype_char_do_toupper_ch(this, ch);
1718 /* ?toupper@?$ctype@D@std@@QBEPBDPADPBD@Z */
1719 /* ?toupper@?$ctype@D@std@@QEBAPEBDPEADPEBD@Z */
1720 DEFINE_THISCALL_WRAPPER(ctype_char_toupper, 12)
1721 const char* __thiscall ctype_char_toupper(const ctype_char *this, char *first, const char *last)
1723 TRACE("(%p %p %p)\n", this, first, last);
1724 return call_ctype_char_do_toupper(this, first, last);
1727 /* ?is@?$ctype@D@std@@QBE_NFD@Z */
1728 /* ?is@?$ctype@D@std@@QEBA_NFD@Z */
1729 DEFINE_THISCALL_WRAPPER(ctype_char_is_ch, 12)
1730 MSVCP_bool __thiscall ctype_char_is_ch(const ctype_char *this, short mask, char ch)
1732 TRACE("(%p %x %c)\n", this, mask, ch);
1733 return (this->ctype.table[(unsigned char)ch] & mask) != 0;
1736 /* ?is@?$ctype@D@std@@QBEPBDPBD0PAF@Z */
1737 /* ?is@?$ctype@D@std@@QEBAPEBDPEBD0PEAF@Z */
1738 DEFINE_THISCALL_WRAPPER(ctype_char_is, 16)
1739 const char* __thiscall ctype_char_is(const ctype_char *this, const char *first, const char *last, short *dest)
1741 TRACE("(%p %p %p %p)\n", this, first, last, dest);
1742 for(; first<last; first++)
1743 *dest++ = this->ctype.table[(unsigned char)*first];
1747 /* ?scan_is@?$ctype@D@std@@QBEPBDFPBD0@Z */
1748 /* ?scan_is@?$ctype@D@std@@QEBAPEBDFPEBD0@Z */
1749 DEFINE_THISCALL_WRAPPER(ctype_char_scan_is, 16)
1750 const char* __thiscall ctype_char_scan_is(const ctype_char *this, short mask, const char *first, const char *last)
1752 TRACE("(%p %x %p %p)\n", this, mask, first, last);
1753 for(; first<last; first++)
1754 if(!ctype_char_is_ch(this, mask, *first))
1759 /* ?scan_not@?$ctype@D@std@@QBEPBDFPBD0@Z */
1760 /* ?scan_not@?$ctype@D@std@@QEBAPEBDFPEBD0@Z */
1761 DEFINE_THISCALL_WRAPPER(ctype_char_scan_not, 16)
1762 const char* __thiscall ctype_char_scan_not(const ctype_char *this, short mask, const char *first, const char *last)
1764 TRACE("(%p %x %p %p)\n", this, mask, first, last);
1765 for(; first<last; first++)
1766 if(ctype_char_is_ch(this, mask, *first))
1771 /* ?table@?$ctype@D@std@@IBEPBFXZ */
1772 /* ?table@?$ctype@D@std@@IEBAPEBFXZ */
1773 DEFINE_THISCALL_WRAPPER(ctype_char_table, 4)
1774 const short* __thiscall ctype_char_table(const ctype_char *this)
1776 TRACE("(%p)\n", this);
1777 return this->ctype.table;
1780 /* ?id@?$ctype@_W@std@@2V0locale@2@A */
1781 locale_id ctype_wchar_id = {0};
1782 /* ?id@?$ctype@G@std@@2V0locale@2@A */
1783 locale_id ctype_short_id = {0};
1785 /* ??_7?$ctype@_W@std@@6B@ */
1786 extern const vtable_ptr MSVCP_ctype_wchar_vtable;
1787 /* ??_7?$ctype@G@std@@6B@ */
1788 extern const vtable_ptr MSVCP_ctype_short_vtable;
1790 /* ?_Id_func@?$ctype@_W@std@@SAAAVid@locale@2@XZ */
1791 /* ?_Id_func@?$ctype@_W@std@@SAAEAVid@locale@2@XZ */
1792 locale_id* __cdecl ctype_wchar__Id_func(void)
1795 return &ctype_wchar_id;
1798 /* ?_Id_func@?$ctype@G@std@@SAAAVid@locale@2@XZ */
1799 /* ?_Id_func@?$ctype@G@std@@SAAEAVid@locale@2@XZ */
1800 locale_id* __cdecl ctype_short__Id_func(void)
1803 return &ctype_short_id;
1806 /* ?_Init@?$ctype@_W@std@@IAEXABV_Locinfo@2@@Z */
1807 /* ?_Init@?$ctype@_W@std@@IEAAXAEBV_Locinfo@2@@Z */
1808 /* ?_Init@?$ctype@G@std@@IAEXABV_Locinfo@2@@Z */
1809 /* ?_Init@?$ctype@G@std@@IEAAXAEBV_Locinfo@2@@Z */
1810 DEFINE_THISCALL_WRAPPER(ctype_wchar__Init, 8)
1811 void __thiscall ctype_wchar__Init(ctype_wchar *this, const _Locinfo *locinfo)
1813 TRACE("(%p %p)\n", this, locinfo);
1814 _Locinfo__Getctype(locinfo, &this->ctype);
1815 _Locinfo__Getcvt(locinfo, &this->cvt);
1818 /* ??0?$ctype@_W@std@@QAE@ABV_Locinfo@1@I@Z */
1819 /* ??0?$ctype@_W@std@@QEAA@AEBV_Locinfo@1@_K@Z */
1820 DEFINE_THISCALL_WRAPPER(ctype_wchar_ctor_locinfo, 12)
1821 ctype_wchar* __thiscall ctype_wchar_ctor_locinfo(ctype_wchar *this,
1822 const _Locinfo *locinfo, MSVCP_size_t refs)
1824 TRACE("(%p %p %lu)\n", this, locinfo, refs);
1825 ctype_base_ctor_refs(&this->base, refs);
1826 this->base.facet.vtable = &MSVCP_ctype_wchar_vtable;
1827 ctype_wchar__Init(this, locinfo);
1831 /* ??0?$ctype@G@std@@QAE@ABV_Locinfo@1@I@Z */
1832 /* ??0?$ctype@G@std@@QEAA@AEBV_Locinfo@1@_K@Z */
1833 DEFINE_THISCALL_WRAPPER(ctype_short_ctor_locinfo, 12)
1834 ctype_wchar* __thiscall ctype_short_ctor_locinfo(ctype_wchar *this,
1835 const _Locinfo *locinfo, MSVCP_size_t refs)
1837 ctype_wchar *ret = ctype_wchar_ctor_locinfo(this, locinfo, refs);
1838 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
1842 /* ??0?$ctype@_W@std@@QAE@I@Z */
1843 /* ??0?$ctype@_W@std@@QEAA@_K@Z */
1844 DEFINE_THISCALL_WRAPPER(ctype_wchar_ctor_refs, 8)
1845 ctype_wchar* __thiscall ctype_wchar_ctor_refs(ctype_wchar *this, MSVCP_size_t refs)
1849 TRACE("(%p %lu)\n", this, refs);
1851 ctype_base_ctor_refs(&this->base, refs);
1852 this->base.facet.vtable = &MSVCP_ctype_wchar_vtable;
1854 _Locinfo_ctor(&locinfo);
1855 ctype_wchar__Init(this, &locinfo);
1856 _Locinfo_dtor(&locinfo);
1860 /* ??0?$ctype@G@std@@QAE@I@Z */
1861 /* ??0?$ctype@G@std@@QEAA@_K@Z */
1862 DEFINE_THISCALL_WRAPPER(ctype_short_ctor_refs, 8)
1863 ctype_wchar* __thiscall ctype_short_ctor_refs(ctype_wchar *this, MSVCP_size_t refs)
1865 ctype_wchar *ret = ctype_wchar_ctor_refs(this, refs);
1866 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
1870 /* ??0?$ctype@G@std@@IAE@PBDI@Z */
1871 /* ??0?$ctype@G@std@@IEAA@PEBD_K@Z */
1872 DEFINE_THISCALL_WRAPPER(ctype_short_ctor_name, 12)
1873 ctype_wchar* __thiscall ctype_short_ctor_name(ctype_wchar *this,
1874 const char *name, MSVCP_size_t refs)
1878 TRACE("(%p %s %lu)\n", this, debugstr_a(name), refs);
1880 ctype_base_ctor_refs(&this->base, refs);
1881 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
1883 _Locinfo_ctor_cstr(&locinfo, name);
1884 ctype_wchar__Init(this, &locinfo);
1885 _Locinfo_dtor(&locinfo);
1889 /* ??_F?$ctype@_W@std@@QAEXXZ */
1890 /* ??_F?$ctype@_W@std@@QEAAXXZ */
1891 DEFINE_THISCALL_WRAPPER(ctype_wchar_ctor, 4)
1892 ctype_wchar* __thiscall ctype_wchar_ctor(ctype_wchar *this)
1894 TRACE("(%p)\n", this);
1895 return ctype_short_ctor_refs(this, 0);
1898 /* ??_F?$ctype@G@std@@QAEXXZ */
1899 /* ??_F?$ctype@G@std@@QEAAXXZ */
1900 DEFINE_THISCALL_WRAPPER(ctype_short_ctor, 4)
1901 ctype_wchar* __thiscall ctype_short_ctor(ctype_wchar *this)
1903 ctype_wchar *ret = ctype_wchar_ctor(this);
1904 this->base.facet.vtable = &MSVCP_ctype_short_vtable;
1908 /* ??1?$ctype@_W@std@@MAE@XZ */
1909 /* ??1?$ctype@_W@std@@MEAA@XZ */
1910 /* ??1?$ctype@G@std@@MAE@XZ */
1911 /* ??1?$ctype@G@std@@MEAA@XZ */
1912 DEFINE_THISCALL_WRAPPER(ctype_wchar_dtor, 4)
1913 void __thiscall ctype_wchar_dtor(ctype_wchar *this)
1915 TRACE("(%p)\n", this);
1916 if(this->ctype.delfl)
1917 free((void*)this->ctype.table);
1920 DEFINE_THISCALL_WRAPPER(MSVCP_ctype_wchar_vector_dtor, 8)
1921 ctype_wchar* __thiscall MSVCP_ctype_wchar_vector_dtor(ctype_wchar *this, unsigned int flags)
1923 TRACE("(%p %x)\n", this, flags);
1925 /* we have an array, with the number of elements stored before the first object */
1926 int i, *ptr = (int *)this-1;
1928 for(i=*ptr-1; i>=0; i--)
1929 ctype_wchar_dtor(this+i);
1930 MSVCRT_operator_delete(ptr);
1932 ctype_wchar_dtor(this);
1934 MSVCRT_operator_delete(this);
1940 DEFINE_THISCALL_WRAPPER(MSVCP_ctype_short_vector_dtor, 8)
1941 ctype_wchar* __thiscall MSVCP_ctype_short_vector_dtor(ctype_wchar *this, unsigned int flags)
1943 return MSVCP_ctype_wchar_vector_dtor(this, flags);
1947 int __cdecl _Wcrtomb(char *s, wchar_t wch, int *state, const _Cvtvec *cvt)
1952 TRACE("%p %d %p %p\n", s, wch, state, cvt);
1957 cp = ___lc_codepage_func();
1969 size = WideCharToMultiByte(cp, 0, &wch, 1, s, MB_LEN_MAX, NULL, &def);
1978 /* ?_Donarrow@?$ctype@_W@std@@IBED_WD@Z */
1979 /* ?_Donarrow@?$ctype@_W@std@@IEBAD_WD@Z */
1980 /* ?_Donarrow@?$ctype@G@std@@IBEDGD@Z */
1981 /* ?_Donarrow@?$ctype@G@std@@IEBADGD@Z */
1982 DEFINE_THISCALL_WRAPPER(ctype_wchar__Donarrow, 12)
1983 char __thiscall ctype_wchar__Donarrow(const ctype_wchar *this, wchar_t ch, char dflt)
1985 char buf[MB_LEN_MAX];
1987 TRACE("(%p %d %d)\n", this, ch, dflt);
1989 return _Wcrtomb(buf, ch, NULL, &this->cvt)==1 ? buf[0] : dflt;
1992 /* ?do_narrow@?$ctype@_W@std@@MBED_WD@Z */
1993 /* ?do_narrow@?$ctype@_W@std@@MEBAD_WD@Z */
1994 /* ?do_narrow@?$ctype@G@std@@MBEDGD@Z */
1995 /* ?do_narrow@?$ctype@G@std@@MEBADGD@Z */
1996 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_narrow_ch, 12)
1997 #define call_ctype_wchar_do_narrow_ch(this, ch, dflt) CALL_VTBL_FUNC(this, 52, \
1998 char, (const ctype_wchar*, wchar_t, char), (this, ch, dflt))
1999 char __thiscall ctype_wchar_do_narrow_ch(const ctype_wchar *this, wchar_t ch, char dflt)
2001 return ctype_wchar__Donarrow(this, ch, dflt);
2004 /* ?do_narrow@?$ctype@_W@std@@MBEPB_WPB_W0DPAD@Z */
2005 /* ?do_narrow@?$ctype@_W@std@@MEBAPEB_WPEB_W0DPEAD@Z */
2006 /* ?do_narrow@?$ctype@G@std@@MBEPBGPBG0DPAD@Z */
2007 /* ?do_narrow@?$ctype@G@std@@MEBAPEBGPEBG0DPEAD@Z */
2008 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_narrow, 20)
2009 #define call_ctype_wchar_do_narrow(this, first, last, dflt, dest) CALL_VTBL_FUNC(this, 48, \
2010 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*), \
2011 (this, first, last, dflt, dest))
2012 const wchar_t* __thiscall ctype_wchar_do_narrow(const ctype_wchar *this,
2013 const wchar_t *first, const wchar_t *last, char dflt, char *dest)
2015 TRACE("(%p %p %p %d %p)\n", this, first, last, dflt, dest);
2016 for(; first<last; first++)
2017 *dest++ = ctype_wchar__Donarrow(this, *first, dflt);
2021 /* ?_Do_narrow_s@?$ctype@_W@std@@MBEPB_WPB_W0DPADI@Z */
2022 /* ?_Do_narrow_s@?$ctype@_W@std@@MEBAPEB_WPEB_W0DPEAD_K@Z */
2023 /* ?_Do_narrow_s@?$ctype@G@std@@MBEPBGPBG0DPADI@Z */
2024 /* ?_Do_narrow_s@?$ctype@G@std@@MEBAPEBGPEBG0DPEAD_K@Z */
2025 DEFINE_THISCALL_WRAPPER(ctype_wchar__Do_narrow_s, 24)
2026 #define call_ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size) CALL_VTBL_FUNC(this, 56, \
2027 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, char, char*, MSVCP_size_t), \
2028 (this, first, last, dflt, dest, size))
2029 const wchar_t* __thiscall ctype_wchar__Do_narrow_s(const ctype_wchar *this,
2030 const wchar_t *first, const wchar_t *last, char dflt, char *dest, MSVCP_size_t size)
2032 TRACE("(%p %p %p %d %p %lu)\n", this, first, last, dflt, dest, size);
2033 /* This function converts all multi-byte characters to dflt,
2034 * thanks to it result size is known before converting */
2035 if(last-first > size)
2037 return ctype_wchar_do_narrow(this, first, last, dflt, dest);
2040 /* ?narrow@?$ctype@_W@std@@QBED_WD@Z */
2041 /* ?narrow@?$ctype@_W@std@@QEBAD_WD@Z */
2042 /* ?narrow@?$ctype@G@std@@QBEDGD@Z */
2043 /* ?narrow@?$ctype@G@std@@QEBADGD@Z */
2044 DEFINE_THISCALL_WRAPPER(ctype_wchar_narrow_ch, 12)
2045 char __thiscall ctype_wchar_narrow_ch(const ctype_wchar *this, wchar_t ch, char dflt)
2047 TRACE("(%p %d %d)\n", this, ch, dflt);
2048 return call_ctype_wchar_do_narrow_ch(this, ch, dflt);
2051 /* ?narrow@?$ctype@_W@std@@QBEPB_WPB_W0DPAD@Z */
2052 /* ?narrow@?$ctype@_W@std@@QEBAPEB_WPEB_W0DPEAD@Z */
2053 /* ?narrow@?$ctype@G@std@@QBEPBGPBG0DPAD@Z */
2054 /* ?narrow@?$ctype@G@std@@QEBAPEBGPEBG0DPEAD@Z */
2055 DEFINE_THISCALL_WRAPPER(ctype_wchar_narrow, 20)
2056 const wchar_t* __thiscall ctype_wchar_narrow(const ctype_wchar *this,
2057 const wchar_t *first, const wchar_t *last, char dflt, char *dest)
2059 TRACE("(%p %p %p %d %p)\n", this, first, last, dflt, dest);
2060 return call_ctype_wchar_do_narrow(this, first, last, dflt, dest);
2063 /* ?_Narrow_s@?$ctype@_W@std@@QBEPB_WPB_W0DPADI@Z */
2064 /* ?_Narrow_s@?$ctype@_W@std@@QEBAPEB_WPEB_W0DPEAD_K@Z */
2065 /* ?_Narrow_s@?$ctype@G@std@@QBEPBGPBG0DPADI@Z */
2066 /* ?_Narrow_s@?$ctype@G@std@@QEBAPEBGPEBG0DPEAD_K@Z */
2067 DEFINE_THISCALL_WRAPPER(ctype_wchar__Narrow_s, 24)
2068 const wchar_t* __thiscall ctype_wchar__Narrow_s(const ctype_wchar *this, const wchar_t *first,
2069 const wchar_t *last, char dflt, char *dest, MSVCP_size_t size)
2071 TRACE("(%p %p %p %d %p %lu)\n", this, first, last, dflt, dest, size);
2072 return call_ctype_wchar__Do_narrow_s(this, first, last, dflt, dest, size);
2076 int __cdecl _Mbrtowc(wchar_t *out, const char *in, MSVCP_size_t len, int *state, const _Cvtvec *cvt)
2082 TRACE("(%p %p %lu %p %p)\n", out, in, len, state, cvt);
2090 cp = ___lc_codepage_func();
2094 *out = (unsigned char)*in;
2101 ((char*)state)[1] = *in;
2103 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, (char*)state, 2, out, out ? 1 : 0)) {
2113 GetCPInfo(cp, &cp_info);
2115 for(i=0; i<MAX_LEADBYTES; i+=2) {
2116 if(!cp_info.LeadByte[i+1])
2118 if((unsigned char)*in>=cp_info.LeadByte[i] && (unsigned char)*in<=cp_info.LeadByte[i+1]) {
2126 *state = (unsigned char)*in;
2130 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, in, 2, out, out ? 1 : 0)) {
2137 if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, in, 1, out, out ? 1 : 0)) {
2144 /* ?_Dowiden@?$ctype@_W@std@@IBE_WD@Z */
2145 /* ?_Dowiden@?$ctype@_W@std@@IEBA_WD@Z */
2146 /* ?_Dowiden@?$ctype@G@std@@IBEGD@Z */
2147 /* ?_Dowiden@?$ctype@G@std@@IEBAGD@Z */
2148 DEFINE_THISCALL_WRAPPER(ctype_wchar__Dowiden, 8)
2149 wchar_t __thiscall ctype_wchar__Dowiden(const ctype_wchar *this, char ch)
2153 TRACE("(%p %d)\n", this, ch);
2154 return _Mbrtowc(&ret, &ch, 1, &state, &this->cvt)<0 ? WEOF : ret;
2157 /* ?do_widen@?$ctype@_W@std@@MBE_WD@Z */
2158 /* ?do_widen@?$ctype@_W@std@@MEBA_WD@Z */
2159 /* ?do_widen@?$ctype@G@std@@MBEGD@Z */
2160 /* ?do_widen@?$ctype@G@std@@MEBAGD@Z */
2161 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_widen_ch, 8)
2162 #define call_ctype_wchar_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 40, \
2163 wchar_t, (const ctype_wchar*, char), (this, ch))
2164 wchar_t __thiscall ctype_wchar_do_widen_ch(const ctype_wchar *this, char ch)
2166 return ctype_wchar__Dowiden(this, ch);
2169 /* ?do_widen@?$ctype@_W@std@@MBEPBDPBD0PA_W@Z */
2170 /* ?do_widen@?$ctype@_W@std@@MEBAPEBDPEBD0PEA_W@Z */
2171 /* ?do_widen@?$ctype@G@std@@MBEPBDPBD0PAG@Z */
2172 /* ?do_widen@?$ctype@G@std@@MEBAPEBDPEBD0PEAG@Z */
2173 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_widen, 16)
2174 #define call_ctype_wchar_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 36, \
2175 const char*, (const ctype_wchar*, const char*, const char*, wchar_t*), \
2176 (this, first, last, dest))
2177 const char* __thiscall ctype_wchar_do_widen(const ctype_wchar *this,
2178 const char *first, const char *last, wchar_t *dest)
2180 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2181 for(; first<last; first++)
2182 *dest++ = ctype_wchar__Dowiden(this, *first);
2186 /* ?_Do_widen_s@?$ctype@_W@std@@MBEPBDPBD0PA_WI@Z */
2187 /* ?_Do_widen_s@?$ctype@_W@std@@MEBAPEBDPEBD0PEA_W_K@Z */
2188 /* ?_Do_widen_s@?$ctype@G@std@@MBEPBDPBD0PAGI@Z */
2189 /* ?_Do_widen_s@?$ctype@G@std@@MEBAPEBDPEBD0PEAG_K@Z */
2190 DEFINE_THISCALL_WRAPPER(ctype_wchar__Do_widen_s, 20)
2191 #define call_ctype_wchar__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 44, \
2192 const char*, (const ctype_wchar*, const char*, const char*, wchar_t*, MSVCP_size_t), \
2193 (this, first, last, dest, size))
2194 const char* __thiscall ctype_wchar__Do_widen_s(const ctype_wchar *this,
2195 const char *first, const char *last, wchar_t *dest, MSVCP_size_t size)
2197 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
2198 /* This function converts all multi-byte characters to WEOF,
2199 * thanks to it result size is known before converting */
2200 if(size < last-first)
2202 return ctype_wchar_do_widen(this, first, last, dest);
2205 /* ?widen@?$ctype@_W@std@@QBE_WD@Z */
2206 /* ?widen@?$ctype@_W@std@@QEBA_WD@Z */
2207 /* ?widen@?$ctype@G@std@@QBEGD@Z */
2208 /* ?widen@?$ctype@G@std@@QEBAGD@Z */
2209 DEFINE_THISCALL_WRAPPER(ctype_wchar_widen_ch, 8)
2210 wchar_t __thiscall ctype_wchar_widen_ch(const ctype_wchar *this, char ch)
2212 TRACE("(%p %d)\n", this, ch);
2213 return call_ctype_wchar_do_widen_ch(this, ch);
2216 /* ?widen@?$ctype@_W@std@@QBEPBDPBD0PA_W@Z */
2217 /* ?widen@?$ctype@_W@std@@QEBAPEBDPEBD0PEA_W@Z */
2218 /* ?widen@?$ctype@G@std@@QBEPBDPBD0PAG@Z */
2219 /* ?widen@?$ctype@G@std@@QEBAPEBDPEBD0PEAG@Z */
2220 DEFINE_THISCALL_WRAPPER(ctype_wchar_widen, 16)
2221 const char* __thiscall ctype_wchar_widen(const ctype_wchar *this,
2222 const char *first, const char *last, wchar_t *dest)
2224 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2225 return call_ctype_wchar_do_widen(this, first, last, dest);
2228 /* ?_Widen_s@?$ctype@_W@std@@QBEPBDPBD0PA_WI@Z */
2229 /* ?_Widen_s@?$ctype@_W@std@@QEBAPEBDPEBD0PEA_W_K@Z */
2230 /* ?_Widen_s@?$ctype@G@std@@QBEPBDPBD0PAGI@Z */
2231 /* ?_Widen_s@?$ctype@G@std@@QEBAPEBDPEBD0PEAG_K@Z */
2232 DEFINE_THISCALL_WRAPPER(ctype_wchar__Widen_s, 20)
2233 const char* __thiscall ctype_wchar__Widen_s(const ctype_wchar *this,
2234 const char *first, const char *last, wchar_t *dest, MSVCP_size_t size)
2236 TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size);
2237 return call_ctype_wchar__Do_widen_s(this, first, last, dest, size);
2240 /* ?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
2241 /* ?_Getcat@?$ctype@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
2242 MSVCP_size_t __cdecl ctype_wchar__Getcat(const locale_facet **facet, const locale *loc)
2244 TRACE("(%p %p)\n", facet, loc);
2246 if(facet && !*facet) {
2249 *facet = MSVCRT_operator_new(sizeof(ctype_wchar));
2251 ERR("Out of memory\n");
2252 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
2256 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
2257 ctype_wchar_ctor_locinfo((ctype_wchar*)*facet, &locinfo, 0);
2258 _Locinfo_dtor(&locinfo);
2264 /* ?_Getcat@?$ctype@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
2265 /* ?_Getcat@?$ctype@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
2266 MSVCP_size_t __cdecl ctype_short__Getcat(const locale_facet **facet, const locale *loc)
2268 if(facet && !*facet) {
2269 ctype_wchar__Getcat(facet, loc);
2270 (*(locale_facet**)facet)->vtable = &MSVCP_ctype_short_vtable;
2277 wchar_t __cdecl _Towlower(wchar_t ch, const _Ctypevec *ctype)
2279 TRACE("(%d %p)\n", ch, ctype);
2280 return tolowerW(ch);
2283 ctype_wchar* ctype_wchar_use_facet(const locale *loc)
2285 static ctype_wchar *obj = NULL;
2288 const locale_facet *fac;
2290 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
2291 fac = locale__Getfacet(loc, locale_id_operator_size_t(&ctype_wchar_id));
2293 _Lockit_dtor(&lock);
2294 return (ctype_wchar*)fac;
2298 _Lockit_dtor(&lock);
2302 ctype_wchar__Getcat(&fac, loc);
2303 obj = (ctype_wchar*)fac;
2304 locale_facet__Incref(&obj->base.facet);
2305 locale_facet_register(&obj->base.facet);
2306 _Lockit_dtor(&lock);
2311 static ctype_wchar* ctype_short_use_facet(const locale *loc)
2313 static ctype_wchar *obj = NULL;
2316 const locale_facet *fac;
2318 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
2319 fac = locale__Getfacet(loc, locale_id_operator_size_t(&ctype_short_id));
2321 _Lockit_dtor(&lock);
2322 return (ctype_wchar*)fac;
2326 _Lockit_dtor(&lock);
2330 ctype_short__Getcat(&fac, loc);
2331 obj = (ctype_wchar*)fac;
2332 locale_facet__Incref(&obj->base.facet);
2333 locale_facet_register(&obj->base.facet);
2334 _Lockit_dtor(&lock);
2339 /* ?do_tolower@?$ctype@_W@std@@MBE_W_W@Z */
2340 /* ?do_tolower@?$ctype@_W@std@@MEBA_W_W@Z */
2341 /* ?do_tolower@?$ctype@G@std@@MBEGG@Z */
2342 /* ?do_tolower@?$ctype@G@std@@MEBAGG@Z */
2343 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_tolower_ch, 8)
2344 #define call_ctype_wchar_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 24, \
2345 wchar_t, (const ctype_wchar*, wchar_t), (this, ch))
2346 wchar_t __thiscall ctype_wchar_do_tolower_ch(const ctype_wchar *this, wchar_t ch)
2348 return _Towlower(ch, &this->ctype);
2351 /* ?do_tolower@?$ctype@_W@std@@MBEPB_WPA_WPB_W@Z */
2352 /* ?do_tolower@?$ctype@_W@std@@MEBAPEB_WPEA_WPEB_W@Z */
2353 /* ?do_tolower@?$ctype@G@std@@MBEPBGPAGPBG@Z */
2354 /* ?do_tolower@?$ctype@G@std@@MEBAPEBGPEAGPEBG@Z */
2355 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_tolower, 12)
2356 #define call_ctype_wchar_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 20, \
2357 const wchar_t*, (const ctype_wchar*, wchar_t*, const wchar_t*), \
2358 (this, first, last))
2359 const wchar_t* __thiscall ctype_wchar_do_tolower(const ctype_wchar *this,
2360 wchar_t *first, const wchar_t *last)
2362 TRACE("(%p %p %p)\n", this, first, last);
2363 for(; first<last; first++)
2364 *first = _Towlower(*first, &this->ctype);
2368 /* ?tolower@?$ctype@_W@std@@QBE_W_W@Z */
2369 /* ?tolower@?$ctype@_W@std@@QEBA_W_W@Z */
2370 /* ?tolower@?$ctype@G@std@@QBEGG@Z */
2371 /* ?tolower@?$ctype@G@std@@QEBAGG@Z */
2372 DEFINE_THISCALL_WRAPPER(ctype_wchar_tolower_ch, 8)
2373 wchar_t __thiscall ctype_wchar_tolower_ch(const ctype_wchar *this, wchar_t ch)
2375 TRACE("(%p %d)\n", this, ch);
2376 return call_ctype_wchar_do_tolower_ch(this, ch);
2379 /* ?tolower@?$ctype@_W@std@@QBEPB_WPA_WPB_W@Z */
2380 /* ?tolower@?$ctype@_W@std@@QEBAPEB_WPEA_WPEB_W@Z */
2381 /* ?tolower@?$ctype@G@std@@QBEPBGPAGPBG@Z */
2382 /* ?tolower@?$ctype@G@std@@QEBAPEBGPEAGPEBG@Z */
2383 DEFINE_THISCALL_WRAPPER(ctype_wchar_tolower, 12)
2384 const wchar_t* __thiscall ctype_wchar_tolower(const ctype_wchar *this,
2385 wchar_t *first, const wchar_t *last)
2387 TRACE("(%p %p %p)\n", this, first, last);
2388 return call_ctype_wchar_do_tolower(this, first, last);
2392 wchar_t __cdecl _Towupper(wchar_t ch, const _Ctypevec *ctype)
2394 TRACE("(%d %p)\n", ch, ctype);
2395 return toupperW(ch);
2398 /* ?do_toupper@?$ctype@_W@std@@MBE_W_W@Z */
2399 /* ?do_toupper@?$ctype@_W@std@@MEBA_W_W@Z */
2400 /* ?do_toupper@?$ctype@G@std@@MBEGG@Z */
2401 /* ?do_toupper@?$ctype@G@std@@MEBAGG@Z */
2402 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_toupper_ch, 8)
2403 #define call_ctype_wchar_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 32, \
2404 wchar_t, (const ctype_wchar*, wchar_t), (this, ch))
2405 wchar_t __thiscall ctype_wchar_do_toupper_ch(const ctype_wchar *this, wchar_t ch)
2407 return _Towupper(ch, &this->ctype);
2410 /* ?do_toupper@?$ctype@_W@std@@MBEPB_WPA_WPB_W@Z */
2411 /* ?do_toupper@?$ctype@_W@std@@MEBAPEB_WPEA_WPEB_W@Z */
2412 /* ?do_toupper@?$ctype@G@std@@MBEPBGPAGPBG@Z */
2413 /* ?do_toupper@?$ctype@G@std@@MEBAPEBGPEAGPEBG@Z */
2414 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_toupper, 12)
2415 #define call_ctype_wchar_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 28, \
2416 const wchar_t*, (const ctype_wchar*, wchar_t*, const wchar_t*), \
2417 (this, first, last))
2418 const wchar_t* __thiscall ctype_wchar_do_toupper(const ctype_wchar *this,
2419 wchar_t *first, const wchar_t *last)
2421 TRACE("(%p %p %p)\n", this, first, last);
2422 for(; first<last; first++)
2423 *first = _Towupper(*first, &this->ctype);
2427 /* ?toupper@?$ctype@_W@std@@QBE_W_W@Z */
2428 /* ?toupper@?$ctype@_W@std@@QEBA_W_W@Z */
2429 /* ?toupper@?$ctype@G@std@@QBEGG@Z */
2430 /* ?toupper@?$ctype@G@std@@QEBAGG@Z */
2431 DEFINE_THISCALL_WRAPPER(ctype_wchar_toupper_ch, 8)
2432 wchar_t __thiscall ctype_wchar_toupper_ch(const ctype_wchar *this, wchar_t ch)
2434 TRACE("(%p %d)\n", this, ch);
2435 return call_ctype_wchar_do_toupper_ch(this, ch);
2438 /* ?toupper@?$ctype@_W@std@@QBEPB_WPA_WPB_W@Z */
2439 /* ?toupper@?$ctype@_W@std@@QEBAPEB_WPEA_WPEB_W@Z */
2440 /* ?toupper@?$ctype@G@std@@QBEPBGPAGPBG@Z */
2441 /* ?toupper@?$ctype@G@std@@QEBAPEBGPEAGPEBG@Z */
2442 DEFINE_THISCALL_WRAPPER(ctype_wchar_toupper, 12)
2443 const wchar_t* __thiscall ctype_wchar_toupper(const ctype_wchar *this,
2444 wchar_t *first, const wchar_t *last)
2446 TRACE("(%p %p %p)\n", this, first, last);
2447 return call_ctype_wchar_do_toupper(this, first, last);
2451 const wchar_t* __cdecl _Getwctypes(const wchar_t *first, const wchar_t *last,
2452 short *mask, const _Ctypevec *ctype)
2454 TRACE("(%p %p %p %p)\n", first, last, mask, ctype);
2455 GetStringTypeW(CT_CTYPE1, first, last-first, (WORD*)mask);
2460 short __cdecl _Getwctype(wchar_t ch, const _Ctypevec *ctype)
2463 _Getwctypes(&ch, &ch+1, &mask, ctype);
2467 /* ?do_is@?$ctype@_W@std@@MBE_NF_W@Z */
2468 /* ?do_is@?$ctype@_W@std@@MEBA_NF_W@Z */
2469 /* ?do_is@?$ctype@G@std@@MBE_NFG@Z */
2470 /* ?do_is@?$ctype@G@std@@MEBA_NFG@Z */
2471 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_is_ch, 12)
2472 #define call_ctype_wchar_do_is_ch(this, mask, ch) CALL_VTBL_FUNC(this, 8, \
2473 MSVCP_bool, (const ctype_wchar*, short, wchar_t), (this, mask, ch))
2474 MSVCP_bool __thiscall ctype_wchar_do_is_ch(const ctype_wchar *this, short mask, wchar_t ch)
2476 TRACE("(%p %x %d)\n", this, mask, ch);
2477 return (_Getwctype(ch, &this->ctype) & mask) != 0;
2480 /* ?do_is@?$ctype@_W@std@@MBEPB_WPB_W0PAF@Z */
2481 /* ?do_is@?$ctype@_W@std@@MEBAPEB_WPEB_W0PEAF@Z */
2482 /* ?do_is@?$ctype@G@std@@MBEPBGPBG0PAF@Z */
2483 /* ?do_is@?$ctype@G@std@@MEBAPEBGPEBG0PEAF@Z */
2484 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_is, 16)
2485 #define call_ctype_wchar_do_is(this, first, last, dest) CALL_VTBL_FUNC(this, 4, \
2486 const wchar_t*, (const ctype_wchar*, const wchar_t*, const wchar_t*, short*), \
2487 (this, first, last, dest))
2488 const wchar_t* __thiscall ctype_wchar_do_is(const ctype_wchar *this,
2489 const wchar_t *first, const wchar_t *last, short *dest)
2491 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2492 return _Getwctypes(first, last, dest, &this->ctype);
2495 /* ?is@?$ctype@_W@std@@QBE_NF_W@Z */
2496 /* ?is@?$ctype@_W@std@@QEBA_NF_W@Z */
2497 /* ?is@?$ctype@G@std@@QBE_NFG@Z */
2498 /* ?is@?$ctype@G@std@@QEBA_NFG@Z */
2499 DEFINE_THISCALL_WRAPPER(ctype_wchar_is_ch, 12)
2500 MSVCP_bool __thiscall ctype_wchar_is_ch(const ctype_wchar *this, short mask, wchar_t ch)
2502 TRACE("(%p %x %d)\n", this, mask, ch);
2503 return call_ctype_wchar_do_is_ch(this, mask, ch);
2506 /* ?is@?$ctype@_W@std@@QBEPB_WPB_W0PAF@Z */
2507 /* ?is@?$ctype@_W@std@@QEBAPEB_WPEB_W0PEAF@Z */
2508 /* ?is@?$ctype@G@std@@QBEPBGPBG0PAF@Z */
2509 /* ?is@?$ctype@G@std@@QEBAPEBGPEBG0PEAF@Z */
2510 DEFINE_THISCALL_WRAPPER(ctype_wchar_is, 16)
2511 const wchar_t* __thiscall ctype_wchar_is(const ctype_wchar *this,
2512 const wchar_t *first, const wchar_t *last, short *dest)
2514 TRACE("(%p %p %p %p)\n", this, first, last, dest);
2515 return call_ctype_wchar_do_is(this, first, last, dest);
2518 /* ?do_scan_is@?$ctype@_W@std@@MBEPB_WFPB_W0@Z */
2519 /* ?do_scan_is@?$ctype@_W@std@@MEBAPEB_WFPEB_W0@Z */
2520 /* ?do_scan_is@?$ctype@G@std@@MBEPBGFPBG0@Z */
2521 /* ?do_scan_is@?$ctype@G@std@@MEBAPEBGFPEBG0@Z */
2522 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_scan_is, 16)
2523 #define call_ctype_wchar_do_scan_is(this, mask, first, last) CALL_VTBL_FUNC(this, 12, \
2524 const wchar_t*, (const ctype_wchar*, short, const wchar_t*, const wchar_t*), \
2525 (this, mask, first, last))
2526 const wchar_t* __thiscall ctype_wchar_do_scan_is(const ctype_wchar *this,
2527 short mask, const wchar_t *first, const wchar_t *last)
2529 TRACE("(%p %d %p %p)\n", this, mask, first, last);
2530 for(; first<last; first++)
2531 if(!ctype_wchar_is_ch(this, mask, *first))
2536 /* ?scan_is@?$ctype@_W@std@@QBEPB_WFPB_W0@Z */
2537 /* ?scan_is@?$ctype@_W@std@@QEBAPEB_WFPEB_W0@Z */
2538 /* ?scan_is@?$ctype@G@std@@QBEPBGFPBG0@Z */
2539 /* ?scan_is@?$ctype@G@std@@QEBAPEBGFPEBG0@Z */
2540 DEFINE_THISCALL_WRAPPER(ctype_wchar_scan_is, 16)
2541 const wchar_t* __thiscall ctype_wchar_scan_is(const ctype_wchar *this,
2542 short mask, const wchar_t *first, const wchar_t *last)
2544 TRACE("(%p %x %p %p)\n", this, mask, first, last);
2545 return call_ctype_wchar_do_scan_is(this, mask, first, last);
2548 /* ?do_scan_not@?$ctype@_W@std@@MBEPB_WFPB_W0@Z */
2549 /* ?do_scan_not@?$ctype@_W@std@@MEBAPEB_WFPEB_W0@Z */
2550 /* ?do_scan_not@?$ctype@G@std@@MBEPBGFPBG0@Z */
2551 /* ?do_scan_not@?$ctype@G@std@@MEBAPEBGFPEBG0@Z */
2552 DEFINE_THISCALL_WRAPPER(ctype_wchar_do_scan_not, 16)
2553 #define call_ctype_wchar_do_scan_not(this, mask, first, last) CALL_VTBL_FUNC(this, 16, \
2554 const wchar_t*, (const ctype_wchar*, short, const wchar_t*, const wchar_t*), \
2555 (this, mask, first, last))
2556 const wchar_t* __thiscall ctype_wchar_do_scan_not(const ctype_wchar *this,
2557 short mask, const wchar_t *first, const wchar_t *last)
2559 TRACE("(%p %x %p %p)\n", this, mask, first, last);
2560 for(; first<last; first++)
2561 if(ctype_wchar_is_ch(this, mask, *first))
2566 /* ?scan_not@?$ctype@_W@std@@QBEPB_WFPB_W0@Z */
2567 /* ?scan_not@?$ctype@_W@std@@QEBAPEB_WFPEB_W0@Z */
2568 /* ?scan_not@?$ctype@G@std@@QBEPBGFPBG0@Z */
2569 /* ?scan_not@?$ctype@G@std@@QEBAPEBGFPEBG0@Z */
2570 DEFINE_THISCALL_WRAPPER(ctype_wchar_scan_not, 16)
2571 const wchar_t* __thiscall ctype_wchar_scan_not(const ctype_wchar *this,
2572 short mask, const wchar_t *first, const wchar_t *last)
2574 TRACE("(%p %x %p %p)\n", this, mask, first, last);
2575 return call_ctype_wchar_do_scan_not(this, mask, first, last);
2578 /* ??_7codecvt_base@std@@6B@ */
2579 extern const vtable_ptr MSVCP_codecvt_base_vtable;
2581 /* ??0codecvt_base@std@@QAE@I@Z */
2582 /* ??0codecvt_base@std@@QEAA@_K@Z */
2583 DEFINE_THISCALL_WRAPPER(codecvt_base_ctor_refs, 8)
2584 codecvt_base* __thiscall codecvt_base_ctor_refs(codecvt_base *this, MSVCP_size_t refs)
2586 TRACE("(%p %lu)\n", this, refs);
2587 locale_facet_ctor_refs(&this->facet, refs);
2588 this->facet.vtable = &MSVCP_codecvt_base_vtable;
2592 /* ??_Fcodecvt_base@std@@QAEXXZ */
2593 /* ??_Fcodecvt_base@std@@QEAAXXZ */
2594 DEFINE_THISCALL_WRAPPER(codecvt_base_ctor, 4)
2595 codecvt_base* __thiscall codecvt_base_ctor(codecvt_base *this)
2597 return codecvt_base_ctor_refs(this, 0);
2600 /* ??1codecvt_base@std@@UAE@XZ */
2601 /* ??1codecvt_base@std@@UEAA@XZ */
2602 DEFINE_THISCALL_WRAPPER(codecvt_base_dtor, 4)
2603 void __thiscall codecvt_base_dtor(codecvt_base *this)
2605 TRACE("(%p)\n", this);
2606 locale_facet_dtor(&this->facet);
2609 DEFINE_THISCALL_WRAPPER(MSVCP_codecvt_base_vector_dtor, 8)
2610 codecvt_base* __thiscall MSVCP_codecvt_base_vector_dtor(codecvt_base *this, unsigned int flags)
2612 TRACE("(%p %x)\n", this, flags);
2614 /* we have an array, with the number of elements stored before the first object */
2615 int i, *ptr = (int *)this-1;
2617 for(i=*ptr-1; i>=0; i--)
2618 codecvt_base_dtor(this+i);
2619 MSVCRT_operator_delete(ptr);
2621 codecvt_base_dtor(this);
2623 MSVCRT_operator_delete(this);
2629 /* ?do_always_noconv@codecvt_base@std@@MBE_NXZ */
2630 /* ?do_always_noconv@codecvt_base@std@@MEBA_NXZ */
2631 #define call_codecvt_base_do_always_noconv(this) CALL_VTBL_FUNC(this, 4, \
2632 MSVCP_bool, (const codecvt_base*), (this))
2633 DEFINE_THISCALL_WRAPPER(codecvt_base_do_always_noconv, 4)
2634 MSVCP_bool __thiscall codecvt_base_do_always_noconv(const codecvt_base *this)
2636 TRACE("(%p)\n", this);
2640 /* ?always_noconv@codecvt_base@std@@QBE_NXZ */
2641 /* ?always_noconv@codecvt_base@std@@QEBA_NXZ */
2642 DEFINE_THISCALL_WRAPPER(codecvt_base_always_noconv, 4)
2643 MSVCP_bool __thiscall codecvt_base_always_noconv(const codecvt_base *this)
2645 TRACE("(%p)\n", this);
2646 return call_codecvt_base_do_always_noconv(this);
2649 /* ?do_max_length@codecvt_base@std@@MBEHXZ */
2650 /* ?do_max_length@codecvt_base@std@@MEBAHXZ */
2651 #define call_codecvt_base_do_max_length(this) CALL_VTBL_FUNC(this, 8, \
2652 int, (const codecvt_base*), (this))
2653 DEFINE_THISCALL_WRAPPER(codecvt_base_do_max_length, 4)
2654 int __thiscall codecvt_base_do_max_length(const codecvt_base *this)
2656 TRACE("(%p)\n", this);
2660 /* ?max_length@codecvt_base@std@@QBEHXZ */
2661 /* ?max_length@codecvt_base@std@@QEBAHXZ */
2662 DEFINE_THISCALL_WRAPPER(codecvt_base_max_length, 4)
2663 int __thiscall codecvt_base_max_length(const codecvt_base *this)
2665 TRACE("(%p)\n", this);
2666 return call_codecvt_base_do_max_length(this);
2669 /* ?do_encoding@codecvt_base@std@@MBEHXZ */
2670 /* ?do_encoding@codecvt_base@std@@MEBAHXZ */
2671 #define call_codecvt_base_do_encoding(this) CALL_VTBL_FUNC(this, 12, \
2672 int, (const codecvt_base*), (this))
2673 DEFINE_THISCALL_WRAPPER(codecvt_base_do_encoding, 4)
2674 int __thiscall codecvt_base_do_encoding(const codecvt_base *this)
2676 TRACE("(%p)\n", this);
2680 /* ?encoding@codecvt_base@std@@QBEHXZ */
2681 /* ?encoding@codecvt_base@std@@QEBAHXZ */
2682 DEFINE_THISCALL_WRAPPER(codecvt_base_encoding, 4)
2683 int __thiscall codecvt_base_encoding(const codecvt_base *this)
2685 TRACE("(%p)\n", this);
2686 return call_codecvt_base_do_encoding(this);
2689 /* ?id@?$codecvt@DDH@std@@2V0locale@2@A */
2690 locale_id codecvt_char_id = {0};
2692 /* ??_7?$codecvt@DDH@std@@6B@ */
2693 extern const vtable_ptr MSVCP_codecvt_char_vtable;
2695 /* ?_Init@?$codecvt@DDH@std@@IAEXABV_Locinfo@2@@Z */
2696 /* ?_Init@?$codecvt@DDH@std@@IEAAXAEBV_Locinfo@2@@Z */
2697 DEFINE_THISCALL_WRAPPER(codecvt_char__Init, 8)
2698 void __thiscall codecvt_char__Init(codecvt_char *this, const _Locinfo *locinfo)
2700 TRACE("(%p %p)\n", this, locinfo);
2703 /* ??0?$codecvt@DDH@std@@QAE@ABV_Locinfo@1@I@Z */
2704 /* ??0?$codecvt@DDH@std@@QEAA@AEBV_Locinfo@1@_K@Z */
2705 DEFINE_THISCALL_WRAPPER(codecvt_char_ctor_locinfo, 12)
2706 codecvt_char* __thiscall codecvt_char_ctor_locinfo(codecvt_char *this, const _Locinfo *locinfo, MSVCP_size_t refs)
2708 TRACE("(%p %p %lu)\n", this, locinfo, refs);
2709 codecvt_base_ctor_refs(&this->base, refs);
2710 this->base.facet.vtable = &MSVCP_codecvt_char_vtable;
2714 /* ??0?$codecvt@DDH@std@@QAE@I@Z */
2715 /* ??0?$codecvt@DDH@std@@QEAA@_K@Z */
2716 DEFINE_THISCALL_WRAPPER(codecvt_char_ctor_refs, 8)
2717 codecvt_char* __thiscall codecvt_char_ctor_refs(codecvt_char *this, MSVCP_size_t refs)
2719 return codecvt_char_ctor_locinfo(this, NULL, refs);
2722 /* ??_F?$codecvt@DDH@std@@QAEXXZ */
2723 /* ??_F?$codecvt@DDH@std@@QEAAXXZ */
2724 DEFINE_THISCALL_WRAPPER(codecvt_char_ctor, 4)
2725 codecvt_char* __thiscall codecvt_char_ctor(codecvt_char *this)
2727 return codecvt_char_ctor_locinfo(this, NULL, 0);
2730 /* ??1?$codecvt@DDH@std@@MAE@XZ */
2731 /* ??1?$codecvt@DDH@std@@MEAA@XZ */
2732 DEFINE_THISCALL_WRAPPER(codecvt_char_dtor, 4)
2733 void __thiscall codecvt_char_dtor(codecvt_char *this)
2735 TRACE("(%p)\n", this);
2736 codecvt_base_dtor(&this->base);
2739 DEFINE_THISCALL_WRAPPER(MSVCP_codecvt_char_vector_dtor, 8)
2740 codecvt_char* __thiscall MSVCP_codecvt_char_vector_dtor(codecvt_char *this, unsigned int flags)
2742 TRACE("(%p %x)\n", this, flags);
2744 /* we have an array, with the number of elements stored before the first object */
2745 int i, *ptr = (int *)this-1;
2747 for(i=*ptr-1; i>=0; i--)
2748 codecvt_char_dtor(this+i);
2749 MSVCRT_operator_delete(ptr);
2751 codecvt_char_dtor(this);
2753 MSVCRT_operator_delete(this);
2759 /* ?_Getcat@?$codecvt@DDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
2760 /* ?_Getcat@?$codecvt@DDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
2761 MSVCP_size_t __cdecl codecvt_char__Getcat(const locale_facet **facet, const locale *loc)
2763 TRACE("(%p %p)\n", facet, loc);
2765 if(facet && !*facet) {
2766 *facet = MSVCRT_operator_new(sizeof(codecvt_char));
2768 ERR("Out of memory\n");
2769 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
2772 codecvt_char_ctor((codecvt_char*)*facet);
2778 codecvt_char* codecvt_char_use_facet(const locale *loc)
2780 static codecvt_char *obj = NULL;
2783 const locale_facet *fac;
2785 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
2786 fac = locale__Getfacet(loc, locale_id_operator_size_t(&codecvt_char_id));
2788 _Lockit_dtor(&lock);
2789 return (codecvt_char*)fac;
2793 _Lockit_dtor(&lock);
2797 codecvt_char__Getcat(&fac, loc);
2798 obj = (codecvt_char*)fac;
2799 locale_facet__Incref(&obj->base.facet);
2800 locale_facet_register(&obj->base.facet);
2801 _Lockit_dtor(&lock);
2806 /* ?do_in@?$codecvt@DDH@std@@MBEHAAHPBD1AAPBDPAD3AAPAD@Z */
2807 /* ?do_in@?$codecvt@DDH@std@@MEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
2808 #define call_codecvt_char_do_in(this, state, from, from_end, from_next, to, to_end, to_next) \
2809 CALL_VTBL_FUNC(this, 16, int, \
2810 (const codecvt_char*, int*, const char*, const char*, const char**, char*, char*, char**), \
2811 (this, state, from, from_end, from_next, to, to_end, to_next))
2812 DEFINE_THISCALL_WRAPPER(codecvt_char_do_in, 32)
2813 int __thiscall codecvt_char_do_in(const codecvt_char *this, int *state,
2814 const char *from, const char *from_end, const char **from_next,
2815 char *to, char *to_end, char **to_next)
2817 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from, from_end,
2818 from_next, to, to_end, to_next);
2821 return CODECVT_noconv;
2824 /* ?in@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z */
2825 /* ?in@?$codecvt@DDH@std@@QEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
2826 DEFINE_THISCALL_WRAPPER(codecvt_char_in, 32)
2827 int __thiscall codecvt_char_in(const codecvt_char *this, int *state,
2828 const char *from, const char *from_end, const char **from_next,
2829 char *to, char *to_end, char **to_next)
2831 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from, from_end,
2832 from_next, to, to_end, to_next);
2833 return call_codecvt_char_do_in(this, state, from, from_end, from_next,
2834 to, to_end, to_next);
2837 /* ?do_out@?$codecvt@DDH@std@@MBEHAAHPBD1AAPBDPAD3AAPAD@Z */
2838 /* ?do_out@?$codecvt@DDH@std@@MEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
2839 #define call_codecvt_char_do_out(this, state, from, from_end, from_next, to, to_end, to_next) \
2840 CALL_VTBL_FUNC(this, 20, int, \
2841 (const codecvt_char*, int*, const char*, const char*, const char**, char*, char*, char**), \
2842 (this, state, from, from_end, from_next, to, to_end, to_next))
2843 DEFINE_THISCALL_WRAPPER(codecvt_char_do_out, 32)
2844 int __thiscall codecvt_char_do_out(const codecvt_char *this, int *state,
2845 const char *from, const char *from_end, const char **from_next,
2846 char *to, char *to_end, char **to_next)
2848 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
2849 from_end, from_next, to, to_end, to_next);
2852 return CODECVT_noconv;
2855 /* ?out@?$codecvt@DDH@std@@QBEHAAHPBD1AAPBDPAD3AAPAD@Z */
2856 /* ?out@?$codecvt@DDH@std@@QEBAHAEAHPEBD1AEAPEBDPEAD3AEAPEAD@Z */
2857 DEFINE_THISCALL_WRAPPER(codecvt_char_out, 32)
2858 int __thiscall codecvt_char_out(const codecvt_char *this, int *state,
2859 const char *from, const char *from_end, const char **from_next,
2860 char *to, char *to_end, char **to_next)
2862 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from, from_end,
2863 from_next, to, to_end, to_next);
2864 return call_codecvt_char_do_out(this, state, from, from_end, from_next,
2865 to, to_end, to_next);
2868 /* ?do_unshift@?$codecvt@DDH@std@@MBEHAAHPAD1AAPAD@Z */
2869 /* ?do_unshift@?$codecvt@DDH@std@@MEBAHAEAHPEAD1AEAPEAD@Z */
2870 #define call_codecvt_char_do_unshift(this, state, to, to_end, to_next) CALL_VTBL_FUNC(this, 24, \
2871 int, (const codecvt_char*, int*, char*, char*, char**), (this, state, to, to_end, to_next))
2872 DEFINE_THISCALL_WRAPPER(codecvt_char_do_unshift, 20)
2873 int __thiscall codecvt_char_do_unshift(const codecvt_char *this,
2874 int *state, char *to, char *to_end, char **to_next)
2876 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
2878 return CODECVT_noconv;
2881 /* ?unshift@?$codecvt@DDH@std@@QBEHAAHPAD1AAPAD@Z */
2882 /* ?unshift@?$codecvt@DDH@std@@QEBAHAEAHPEAD1AEAPEAD@Z */
2883 DEFINE_THISCALL_WRAPPER(codecvt_char_unshift, 20)
2884 int __thiscall codecvt_char_unshift(const codecvt_char *this,
2885 int *state, char *to, char *to_end, char **to_next)
2887 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
2888 return call_codecvt_char_do_unshift(this, state, to, to_end, to_next);
2891 /* ?do_length@?$codecvt@DDH@std@@MBEHABHPBD1I@Z */
2892 /* ?do_length@?$codecvt@DDH@std@@MEBAHAEBHPEBD1_K@Z */
2893 #define call_codecvt_char_do_length(this, state, from, from_end, max) CALL_VTBL_FUNC(this, 28, \
2894 int, (const codecvt_char*, const int*, const char*, const char*, MSVCP_size_t), \
2895 (this, state, from, from_end, max))
2896 DEFINE_THISCALL_WRAPPER(codecvt_char_do_length, 20)
2897 int __thiscall codecvt_char_do_length(const codecvt_char *this, const int *state,
2898 const char *from, const char *from_end, MSVCP_size_t max)
2900 TRACE("(%p %p %p %p %lu)\n", this, state, from, from_end, max);
2901 return (from_end-from > max ? max : from_end-from);
2904 /* ?length@?$codecvt@DDH@std@@QBEHABHPBD1I@Z */
2905 /* ?length@?$codecvt@DDH@std@@QEBAHAEBHPEBD1_K@Z */
2906 DEFINE_THISCALL_WRAPPER(codecvt_char_length, 20)
2907 int __thiscall codecvt_char_length(const codecvt_char *this, const int *state,
2908 const char *from, const char *from_end, MSVCP_size_t max)
2910 TRACE("(%p %p %p %p %lu)\n", this, state, from, from_end, max);
2911 return call_codecvt_char_do_length(this, state, from, from_end, max);
2914 /* ?id@?$codecvt@_WDH@std@@2V0locale@2@A */
2915 locale_id codecvt_wchar_id = {0};
2916 /* ?id@?$codecvt@GDH@std@@2V0locale@2@A */
2917 locale_id codecvt_short_id = {0};
2919 /* ??_7?$codecvt@_WDH@std@@6B@ */
2920 extern const vtable_ptr MSVCP_codecvt_wchar_vtable;
2921 /* ??_7?$codecvt@GDH@std@@6B@ */
2922 extern const vtable_ptr MSVCP_codecvt_short_vtable;
2924 /* ?_Init@?$codecvt@GDH@std@@IAEXABV_Locinfo@2@@Z */
2925 /* ?_Init@?$codecvt@GDH@std@@IEAAXAEBV_Locinfo@2@@Z */
2926 /* ?_Init@?$codecvt@_WDH@std@@IAEXABV_Locinfo@2@@Z */
2927 /* ?_Init@?$codecvt@_WDH@std@@IEAAXAEBV_Locinfo@2@@Z */
2928 DEFINE_THISCALL_WRAPPER(codecvt_wchar__Init, 8)
2929 void __thiscall codecvt_wchar__Init(codecvt_wchar *this, const _Locinfo *locinfo)
2931 TRACE("(%p %p)\n", this, locinfo);
2932 _Locinfo__Getcvt(locinfo, &this->cvt);
2935 /* ??0?$codecvt@_WDH@std@@QAE@ABV_Locinfo@1@I@Z */
2936 /* ??0?$codecvt@_WDH@std@@QEAA@AEBV_Locinfo@1@_K@Z */
2937 DEFINE_THISCALL_WRAPPER(codecvt_wchar_ctor_locinfo, 12)
2938 codecvt_wchar* __thiscall codecvt_wchar_ctor_locinfo(codecvt_wchar *this, const _Locinfo *locinfo, MSVCP_size_t refs)
2940 TRACE("(%p %p %ld)\n", this, locinfo, refs);
2942 codecvt_base_ctor_refs(&this->base, refs);
2943 this->base.facet.vtable = &MSVCP_codecvt_wchar_vtable;
2945 codecvt_wchar__Init(this, locinfo);
2949 /* ??0?$codecvt@GDH@std@@QAE@ABV_Locinfo@1@I@Z */
2950 /* ??0?$codecvt@GDH@std@@QEAA@AEBV_Locinfo@1@_K@Z */
2951 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor_locinfo, 12)
2952 codecvt_wchar* __thiscall codecvt_short_ctor_locinfo(codecvt_wchar *this, const _Locinfo *locinfo, MSVCP_size_t refs)
2954 TRACE("(%p %p %ld)\n", this, locinfo, refs);
2956 codecvt_wchar_ctor_locinfo(this, locinfo, refs);
2957 this->base.facet.vtable = &MSVCP_codecvt_short_vtable;
2961 /* ??0?$codecvt@_WDH@std@@QAE@I@Z */
2962 /* ??0?$codecvt@_WDH@std@@QEAA@_K@Z */
2963 DEFINE_THISCALL_WRAPPER(codecvt_wchar_ctor_refs, 8)
2964 codecvt_wchar* __thiscall codecvt_wchar_ctor_refs(codecvt_wchar *this, MSVCP_size_t refs)
2968 TRACE("(%p %ld)\n", this, refs);
2970 _Locinfo_ctor(&locinfo);
2971 codecvt_wchar_ctor_locinfo(this, &locinfo, refs);
2972 _Locinfo_dtor(&locinfo);
2976 /* ??0?$codecvt@GDH@std@@QAE@I@Z */
2977 /* ??0?$codecvt@GDH@std@@QEAA@_K@Z */
2978 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor_refs, 8)
2979 codecvt_wchar* __thiscall codecvt_short_ctor_refs(codecvt_wchar *this, MSVCP_size_t refs)
2983 TRACE("(%p %ld)\n", this, refs);
2985 _Locinfo_ctor(&locinfo);
2986 codecvt_short_ctor_locinfo(this, &locinfo, refs);
2987 _Locinfo_dtor(&locinfo);
2991 /* ??0?$codecvt@GDH@std@@IAE@PBDI@Z */
2992 /* ??0?$codecvt@GDH@std@@IEAA@PEBD_K@Z */
2993 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor_name, 12)
2994 codecvt_wchar* __thiscall codecvt_short_ctor_name(codecvt_wchar *this, const char *name, MSVCP_size_t refs)
2998 TRACE("(%p %s %ld)\n", this, name, refs);
3000 _Locinfo_ctor_cstr(&locinfo, name);
3001 codecvt_short_ctor_locinfo(this, &locinfo, refs);
3002 _Locinfo_dtor(&locinfo);
3006 /* ??_F?$codecvt@_WDH@std@@QAEXXZ */
3007 /* ??_F?$codecvt@_WDH@std@@QEAAXXZ */
3008 DEFINE_THISCALL_WRAPPER(codecvt_wchar_ctor, 4)
3009 codecvt_wchar* __thiscall codecvt_wchar_ctor(codecvt_wchar *this)
3011 return codecvt_wchar_ctor_refs(this, 0);
3014 /* ??_F?$codecvt@GDH@std@@QAEXXZ */
3015 /* ??_F?$codecvt@GDH@std@@QEAAXXZ */
3016 DEFINE_THISCALL_WRAPPER(codecvt_short_ctor, 4)
3017 codecvt_wchar* __thiscall codecvt_short_ctor(codecvt_wchar *this)
3019 return codecvt_short_ctor_refs(this, 0);
3022 /* ??1?$codecvt@GDH@std@@MAE@XZ */
3023 /* ??1?$codecvt@GDH@std@@MEAA@XZ */
3024 /* ??1?$codecvt@_WDH@std@@MAE@XZ */
3025 /* ??1?$codecvt@_WDH@std@@MEAA@XZ */
3026 DEFINE_THISCALL_WRAPPER(codecvt_wchar_dtor, 4)
3027 void __thiscall codecvt_wchar_dtor(codecvt_wchar *this)
3029 TRACE("(%p)\n", this);
3030 codecvt_base_dtor(&this->base);
3033 DEFINE_THISCALL_WRAPPER(MSVCP_codecvt_wchar_vector_dtor, 8)
3034 codecvt_wchar* __thiscall MSVCP_codecvt_wchar_vector_dtor(codecvt_wchar *this, unsigned int flags)
3036 TRACE("(%p %x)\n", this, flags);
3038 /* we have an array, with the number of elements stored before the first object */
3039 int i, *ptr = (int *)this-1;
3041 for(i=*ptr-1; i>=0; i--)
3042 codecvt_wchar_dtor(this+i);
3043 MSVCRT_operator_delete(ptr);
3045 codecvt_wchar_dtor(this);
3047 MSVCRT_operator_delete(this);
3053 DEFINE_THISCALL_WRAPPER(MSVCP_codecvt_short_vector_dtor, 8)
3054 codecvt_wchar* __thiscall MSVCP_codecvt_short_vector_dtor(codecvt_wchar *this, unsigned int flags)
3056 return MSVCP_codecvt_wchar_vector_dtor(this, flags);
3059 /* ?_Getcat@?$codecvt@_WDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3060 /* ?_Getcat@?$codecvt@_WDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3061 unsigned int __cdecl codecvt_wchar__Getcat(const locale_facet **facet, const locale *loc)
3063 TRACE("(%p %p)\n", facet, loc);
3065 if(facet && !*facet) {
3068 *facet = MSVCRT_operator_new(sizeof(codecvt_wchar));
3070 ERR("Out of memory\n");
3071 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3075 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
3076 codecvt_wchar_ctor_locinfo((codecvt_wchar*)*facet, &locinfo, 0);
3077 _Locinfo_dtor(&locinfo);
3083 static codecvt_wchar* codecvt_wchar_use_facet(const locale *loc)
3085 static codecvt_wchar *obj = NULL;
3088 const locale_facet *fac;
3090 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3091 fac = locale__Getfacet(loc, locale_id_operator_size_t(&codecvt_wchar_id));
3093 _Lockit_dtor(&lock);
3094 return (codecvt_wchar*)fac;
3098 _Lockit_dtor(&lock);
3102 codecvt_wchar__Getcat(&fac, loc);
3103 obj = (codecvt_wchar*)fac;
3104 locale_facet__Incref(&obj->base.facet);
3105 locale_facet_register(&obj->base.facet);
3106 _Lockit_dtor(&lock);
3111 /* ?_Getcat@?$codecvt@GDH@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3112 /* ?_Getcat@?$codecvt@GDH@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3113 unsigned int __cdecl codecvt_short__Getcat(const locale_facet **facet, const locale *loc)
3115 TRACE("(%p %p)\n", facet, loc);
3117 if(facet && !*facet) {
3120 *facet = MSVCRT_operator_new(sizeof(codecvt_wchar));
3122 ERR("Out of memory\n");
3123 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3127 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
3128 codecvt_short_ctor((codecvt_wchar*)*facet);
3129 _Locinfo_dtor(&locinfo);
3135 static codecvt_wchar* codecvt_short_use_facet(const locale *loc)
3137 static codecvt_wchar *obj = NULL;
3140 const locale_facet *fac;
3142 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3143 fac = locale__Getfacet(loc, locale_id_operator_size_t(&codecvt_short_id));
3145 _Lockit_dtor(&lock);
3146 return (codecvt_wchar*)fac;
3150 _Lockit_dtor(&lock);
3154 codecvt_short__Getcat(&fac, loc);
3155 obj = (codecvt_wchar*)fac;
3156 locale_facet__Incref(&obj->base.facet);
3157 locale_facet_register(&obj->base.facet);
3158 _Lockit_dtor(&lock);
3163 /* ?_Id_func@?$codecvt@_WDH@std@@SAAAVid@locale@2@XZ */
3164 /* ?_Id_func@?$codecvt@_WDH@std@@SAAEAVid@locale@2@XZ */
3165 locale_id* __cdecl codecvt_wchar__Id_func(void)
3168 return &codecvt_wchar_id;
3171 /* ?_Id_func@?$codecvt@GDH@std@@SAAAVid@locale@2@XZ */
3172 /* ?_Id_func@?$codecvt@GDH@std@@SAAEAVid@locale@2@XZ */
3173 locale_id* __cdecl codecvt_short__Id_func(void)
3176 return &codecvt_short_id;
3179 /* ?do_always_noconv@?$codecvt@GDH@std@@MBE_NXZ */
3180 /* ?do_always_noconv@?$codecvt@GDH@std@@MEBA_NXZ */
3181 /* ?do_always_noconv@?$codecvt@_WDH@std@@MBE_NXZ */
3182 /* ?do_always_noconv@?$codecvt@_WDH@std@@MEBA_NXZ */
3183 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_always_noconv, 4)
3184 MSVCP_bool __thiscall codecvt_wchar_do_always_noconv(const codecvt_wchar *this)
3186 TRACE("(%p)\n", this);
3190 /* ?do_max_length@?$codecvt@GDH@std@@MBEHXZ */
3191 /* ?do_max_length@?$codecvt@GDH@std@@MEBAHXZ */
3192 /* ?do_max_length@?$codecvt@_WDH@std@@MBEHXZ */
3193 /* ?do_max_length@?$codecvt@_WDH@std@@MEBAHXZ */
3194 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_max_length, 4)
3195 int __thiscall codecvt_wchar_do_max_length(const codecvt_wchar *this)
3197 TRACE("(%p)\n", this);
3201 /* ?do_in@?$codecvt@GDH@std@@MBEHAAHPBD1AAPBDPAG3AAPAG@Z */
3202 /* ?do_in@?$codecvt@GDH@std@@MEBAHAEAHPEBD1AEAPEBDPEAG3AEAPEAG@Z */
3203 /* ?do_in@?$codecvt@_WDH@std@@MBEHAAHPBD1AAPBDPA_W3AAPA_W@Z */
3204 /* ?do_in@?$codecvt@_WDH@std@@MEBAHAEAHPEBD1AEAPEBDPEA_W3AEAPEA_W@Z */
3205 #define call_codecvt_wchar_do_in(this, state, from, from_end, from_next, to, to_end, to_next) \
3206 CALL_VTBL_FUNC(this, 16, int, \
3207 (const codecvt_wchar*, int*, const char*, const char*, const char**, wchar_t*, wchar_t*, wchar_t**), \
3208 (this, state, from, from_end, from_next, to, to_end, to_next))
3209 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_in, 32)
3210 int __thiscall codecvt_wchar_do_in(const codecvt_wchar *this, int *state,
3211 const char *from, const char *from_end, const char **from_next,
3212 wchar_t *to, wchar_t *to_end, wchar_t **to_next)
3214 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3215 from_end, from_next, to, to_end, to_next);
3220 while(*from_next!=from_end && *to_next!=to_end) {
3221 switch(_Mbrtowc(*to_next, *from_next, from_end-*from_next, state, &this->cvt)) {
3223 *from_next = from_end;
3224 return CODECVT_partial;
3226 return CODECVT_error;
3240 /* ?in@?$codecvt@GDH@std@@QBEHAAHPBD1AAPBDPAG3AAPAG@Z */
3241 /* ?in@?$codecvt@GDH@std@@QEBAHAEAHPEBD1AEAPEBDPEAG3AEAPEAG@Z */
3242 /* ?in@?$codecvt@_WDH@std@@QBEHAAHPBD1AAPBDPA_W3AAPA_W@Z */
3243 /* ?in@?$codecvt@_WDH@std@@QEBAHAEAHPEBD1AEAPEBDPEA_W3AEAPEA_W@Z */
3244 DEFINE_THISCALL_WRAPPER(codecvt_wchar_in, 32)
3245 int __thiscall codecvt_wchar_in(const codecvt_wchar *this, int *state,
3246 const char *from, const char *from_end, const char **from_next,
3247 wchar_t *to, wchar_t *to_end, wchar_t **to_next)
3249 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3250 from_end, from_next, to, to_end, to_next);
3251 return call_codecvt_wchar_do_in(this, state, from,
3252 from_end, from_next, to, to_end, to_next);
3255 /* ?do_out@?$codecvt@GDH@std@@MBEHAAHPBG1AAPBGPAD3AAPAD@Z */
3256 /* ?do_out@?$codecvt@GDH@std@@MEBAHAEAHPEBG1AEAPEBGPEAD3AEAPEAD@Z */
3257 /* ?do_out@?$codecvt@_WDH@std@@MBEHAAHPB_W1AAPB_WPAD3AAPAD@Z */
3258 /* ?do_out@?$codecvt@_WDH@std@@MEBAHAEAHPEB_W1AEAPEB_WPEAD3AEAPEAD@Z */
3259 #define call_codecvt_wchar_do_out(this, state, from, from_end, from_next, to, to_end, to_next) \
3260 CALL_VTBL_FUNC(this, 20, int, \
3261 (const codecvt_wchar*, int*, const wchar_t*, const wchar_t*, const wchar_t**, char*, char*, char**), \
3262 (this, state, from, from_end, from_next, to, to_end, to_next))
3263 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_out, 32)
3264 int __thiscall codecvt_wchar_do_out(const codecvt_wchar *this, int *state,
3265 const wchar_t *from, const wchar_t *from_end, const wchar_t **from_next,
3266 char *to, char *to_end, char **to_next)
3268 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3269 from_end, from_next, to, to_end, to_next);
3274 while(*from_next!=from_end && *to_next!=to_end) {
3275 int old_state = *state, size;
3276 char buf[MB_LEN_MAX];
3278 switch((size = _Wcrtomb(buf, **from_next, state, &this->cvt))) {
3280 return CODECVT_error;
3282 if(size > from_end-*from_next) {
3284 return CODECVT_partial;
3295 /* ?out@?$codecvt@GDH@std@@QBEHAAHPBG1AAPBGPAD3AAPAD@Z */
3296 /* ?out@?$codecvt@GDH@std@@QEBAHAEAHPEBG1AEAPEBGPEAD3AEAPEAD@Z */
3297 /* ?out@?$codecvt@_WDH@std@@QBEHAAHPB_W1AAPB_WPAD3AAPAD@Z */
3298 /* ?out@?$codecvt@_WDH@std@@QEBAHAEAHPEB_W1AEAPEB_WPEAD3AEAPEAD@Z */
3299 DEFINE_THISCALL_WRAPPER(codecvt_wchar_out, 32)
3300 int __thiscall codecvt_wchar_out(const codecvt_wchar *this, int *state,
3301 const wchar_t *from, const wchar_t *from_end, const wchar_t **from_next,
3302 char *to, char *to_end, char **to_next)
3304 TRACE("(%p %p %p %p %p %p %p %p)\n", this, state, from,
3305 from_end, from_next, to, to_end, to_next);
3306 return call_codecvt_wchar_do_out(this, state, from,
3307 from_end, from_next, to, to_end, to_next);
3310 /* ?do_unshift@?$codecvt@GDH@std@@MBEHAAHPAD1AAPAD@Z */
3311 /* ?do_unshift@?$codecvt@GDH@std@@MEBAHAEAHPEAD1AEAPEAD@Z */
3312 /* ?do_unshift@?$codecvt@_WDH@std@@MBEHAAHPAD1AAPAD@Z */
3313 /* ?do_unshift@?$codecvt@_WDH@std@@MEBAHAEAHPEAD1AEAPEAD@Z */
3314 #define call_codecvt_wchar_do_unshift(this, state, to, to_end, to_next) CALL_VTBL_FUNC(this, 24, \
3315 int, (const codecvt_wchar*, int*, char*, char*, char**), (this, state, to, to_end, to_next))
3316 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_unshift, 20)
3317 int __thiscall codecvt_wchar_do_unshift(const codecvt_wchar *this,
3318 int *state, char *to, char *to_end, char **to_next)
3320 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
3322 WARN("unexpected state: %x\n", *state);
3328 /* ?unshift@?$codecvt@GDH@std@@QBEHAAHPAD1AAPAD@Z */
3329 /* ?unshift@?$codecvt@GDH@std@@QEBAHAEAHPEAD1AEAPEAD@Z */
3330 /* ?unshift@?$codecvt@_WDH@std@@QBEHAAHPAD1AAPAD@Z */
3331 /* ?unshift@?$codecvt@_WDH@std@@QEBAHAEAHPEAD1AEAPEAD@Z */
3332 DEFINE_THISCALL_WRAPPER(codecvt_wchar_unshift, 20)
3333 int __thiscall codecvt_wchar_unshift(const codecvt_wchar *this,
3334 int *state, char *to, char *to_end, char **to_next)
3336 TRACE("(%p %p %p %p %p)\n", this, state, to, to_end, to_next);
3337 return call_codecvt_wchar_do_unshift(this, state, to, to_end, to_next);
3340 /* ?do_length@?$codecvt@GDH@std@@MBEHABHPBD1I@Z */
3341 /* ?do_length@?$codecvt@GDH@std@@MEBAHAEBHPEBD1_K@Z */
3342 /* ?do_length@?$codecvt@_WDH@std@@MBEHABHPBD1I@Z */
3343 /* ?do_length@?$codecvt@_WDH@std@@MEBAHAEBHPEBD1_K@Z */
3344 #define call_codecvt_wchar_do_length(this, state, from, from_end, max) CALL_VTBL_FUNC(this, 28, \
3345 int, (const codecvt_wchar*, const int*, const char*, const char*, MSVCP_size_t), \
3346 (this, state, from, from_end, max))
3347 DEFINE_THISCALL_WRAPPER(codecvt_wchar_do_length, 20)
3348 int __thiscall codecvt_wchar_do_length(const codecvt_wchar *this, const int *state,
3349 const char *from, const char *from_end, MSVCP_size_t max)
3351 int tmp_state = *state, ret=0;
3353 TRACE("(%p %p %p %p %ld)\n", this, state, from, from_end, max);
3355 while(ret<max && from!=from_end) {
3356 switch(_Mbrtowc(NULL, from, from_end-from, &tmp_state, &this->cvt)) {
3373 /* ?length@?$codecvt@GDH@std@@QBEHABHPBD1I@Z */
3374 /* ?length@?$codecvt@GDH@std@@QEBAHAEBHPEBD1_K@Z */
3375 /* ?length@?$codecvt@_WDH@std@@QBEHABHPBD1I@Z */
3376 /* ?length@?$codecvt@_WDH@std@@QEBAHAEBHPEBD1_K@Z */
3377 DEFINE_THISCALL_WRAPPER(codecvt_wchar_length, 20)
3378 int __thiscall codecvt_wchar_length(const codecvt_wchar *this, const int *state,
3379 const char *from, const char *from_end, MSVCP_size_t max)
3381 TRACE("(%p %p %p %p %ld)\n", this, state, from, from_end, max);
3382 return call_codecvt_wchar_do_length(this, state, from, from_end, max);
3385 /* ?id@?$numpunct@D@std@@2V0locale@2@A */
3386 locale_id numpunct_char_id = {0};
3388 /* ??_7?$numpunct@D@std@@6B@ */
3389 extern const vtable_ptr MSVCP_numpunct_char_vtable;
3391 /* ?_Init@?$numpunct@D@std@@IAEXABV_Locinfo@2@_N@Z */
3392 /* ?_Init@?$numpunct@D@std@@IEAAXAEBV_Locinfo@2@_N@Z */
3393 DEFINE_THISCALL_WRAPPER(numpunct_char__Init, 12)
3394 void __thiscall numpunct_char__Init(numpunct_char *this, const _Locinfo *locinfo, MSVCP_bool isdef)
3398 TRACE("(%p %p %d)\n", this, locinfo, isdef);
3400 len = strlen(_Locinfo__Getfalse(locinfo))+1;
3401 this->false_name = MSVCRT_operator_new(len);
3402 if(this->false_name)
3403 memcpy((char*)this->false_name, _Locinfo__Getfalse(locinfo), len);
3405 len = strlen(_Locinfo__Gettrue(locinfo))+1;
3406 this->true_name = MSVCRT_operator_new(len);
3408 memcpy((char*)this->true_name, _Locinfo__Gettrue(locinfo), len);
3411 this->grouping = MSVCRT_operator_new(1);
3413 *(char*)this->grouping = 0;
3418 const struct lconv *lc = _Locinfo__Getlconv(locinfo);
3420 len = strlen(lc->grouping)+1;
3421 this->grouping = MSVCRT_operator_new(len);
3423 memcpy((char*)this->grouping, lc->grouping, len);
3425 this->dp = lc->decimal_point[0];
3426 this->sep = lc->thousands_sep[0];
3429 if(!this->false_name || !this->true_name || !this->grouping) {
3430 MSVCRT_operator_delete((char*)this->grouping);
3431 MSVCRT_operator_delete((char*)this->false_name);
3432 MSVCRT_operator_delete((char*)this->true_name);
3434 ERR("Out of memory\n");
3435 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3439 /* ?_Tidy@?$numpunct@D@std@@AAEXXZ */
3440 /* ?_Tidy@?$numpunct@D@std@@AEAAXXZ */
3441 DEFINE_THISCALL_WRAPPER(numpunct_char__Tidy, 4)
3442 void __thiscall numpunct_char__Tidy(numpunct_char *this)
3444 TRACE("(%p)\n", this);
3446 MSVCRT_operator_delete((char*)this->grouping);
3447 MSVCRT_operator_delete((char*)this->false_name);
3448 MSVCRT_operator_delete((char*)this->true_name);
3451 /* ??0?$numpunct@D@std@@QAE@ABV_Locinfo@1@I_N@Z */
3452 /* ??0?$numpunct@D@std@@QEAA@AEBV_Locinfo@1@_K_N@Z */
3453 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor_locinfo, 16)
3454 numpunct_char* __thiscall numpunct_char_ctor_locinfo(numpunct_char *this,
3455 const _Locinfo *locinfo, MSVCP_size_t refs, MSVCP_bool usedef)
3457 TRACE("(%p %p %lu %d)\n", this, locinfo, refs, usedef);
3458 locale_facet_ctor_refs(&this->facet, refs);
3459 this->facet.vtable = &MSVCP_numpunct_char_vtable;
3460 numpunct_char__Init(this, locinfo, usedef);
3464 /* ??0?$numpunct@D@std@@IAE@PBDI_N@Z */
3465 /* ??0?$numpunct@D@std@@IEAA@PEBD_K_N@Z */
3466 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor_name, 16)
3467 numpunct_char* __thiscall numpunct_char_ctor_name(numpunct_char *this,
3468 const char *name, MSVCP_size_t refs, MSVCP_bool usedef)
3472 TRACE("(%p %s %lu %d)\n", this, debugstr_a(name), refs, usedef);
3473 locale_facet_ctor_refs(&this->facet, refs);
3474 this->facet.vtable = &MSVCP_numpunct_char_vtable;
3476 _Locinfo_ctor_cstr(&locinfo, name);
3477 numpunct_char__Init(this, &locinfo, usedef);
3478 _Locinfo_dtor(&locinfo);
3482 /* ??0?$numpunct@D@std@@QAE@I@Z */
3483 /* ??0?$numpunct@D@std@@QEAA@_K@Z */
3484 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor_refs, 8)
3485 numpunct_char* __thiscall numpunct_char_ctor_refs(numpunct_char *this, MSVCP_size_t refs)
3487 TRACE("(%p %lu)\n", this, refs);
3488 return numpunct_char_ctor_name(this, "C", refs, FALSE);
3491 /* ??_F?$numpunct@D@std@@QAEXXZ */
3492 /* ??_F?$numpunct@D@std@@QEAAXXZ */
3493 DEFINE_THISCALL_WRAPPER(numpunct_char_ctor, 4)
3494 numpunct_char* __thiscall numpunct_char_ctor(numpunct_char *this)
3496 return numpunct_char_ctor_refs(this, 0);
3499 /* ??1?$numpunct@D@std@@MAE@XZ */
3500 /* ??1?$numpunct@D@std@@MEAA@XZ */
3501 DEFINE_THISCALL_WRAPPER(numpunct_char_dtor, 4)
3502 void __thiscall numpunct_char_dtor(numpunct_char *this)
3504 TRACE("(%p)\n", this);
3505 numpunct_char__Tidy(this);
3508 DEFINE_THISCALL_WRAPPER(MSVCP_numpunct_char_vector_dtor, 8)
3509 numpunct_char* __thiscall MSVCP_numpunct_char_vector_dtor(numpunct_char *this, unsigned int flags)
3511 TRACE("(%p %x)\n", this, flags);
3513 /* we have an array, with the number of elements stored before the first object */
3514 int i, *ptr = (int *)this-1;
3516 for(i=*ptr-1; i>=0; i--)
3517 numpunct_char_dtor(this+i);
3518 MSVCRT_operator_delete(ptr);
3520 numpunct_char_dtor(this);
3522 MSVCRT_operator_delete(this);
3528 /* ?_Getcat@?$numpunct@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3529 /* ?_Getcat@?$numpunct@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3530 MSVCP_size_t __cdecl numpunct_char__Getcat(const locale_facet **facet, const locale *loc)
3532 TRACE("(%p %p)\n", facet, loc);
3534 if(facet && !*facet) {
3535 *facet = MSVCRT_operator_new(sizeof(numpunct_char));
3537 ERR("Out of memory\n");
3538 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3541 numpunct_char_ctor_name((numpunct_char*)*facet,
3542 MSVCP_basic_string_char_c_str(&loc->ptr->name), 0, TRUE);
3548 static numpunct_char* numpunct_char_use_facet(const locale *loc)
3550 static numpunct_char *obj = NULL;
3553 const locale_facet *fac;
3555 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3556 fac = locale__Getfacet(loc, locale_id_operator_size_t(&numpunct_char_id));
3558 _Lockit_dtor(&lock);
3559 return (numpunct_char*)fac;
3563 _Lockit_dtor(&lock);
3567 numpunct_char__Getcat(&fac, loc);
3568 obj = (numpunct_char*)fac;
3569 locale_facet__Incref(&obj->facet);
3570 locale_facet_register(&obj->facet);
3571 _Lockit_dtor(&lock);
3576 /* ?do_decimal_point@?$numpunct@D@std@@MBEDXZ */
3577 /* ?do_decimal_point@?$numpunct@D@std@@MEBADXZ */
3578 DEFINE_THISCALL_WRAPPER(numpunct_char_do_decimal_point, 4)
3579 #define call_numpunct_char_do_decimal_point(this) CALL_VTBL_FUNC(this, 4, \
3580 char, (const numpunct_char *this), (this))
3581 char __thiscall numpunct_char_do_decimal_point(const numpunct_char *this)
3583 TRACE("(%p)\n", this);
3587 /* ?decimal_point@?$numpunct@D@std@@QBEDXZ */
3588 /* ?decimal_point@?$numpunct@D@std@@QEBADXZ */
3589 DEFINE_THISCALL_WRAPPER(numpunct_char_decimal_point, 4)
3590 char __thiscall numpunct_char_decimal_point(const numpunct_char *this)
3592 TRACE("(%p)\n", this);
3593 return call_numpunct_char_do_decimal_point(this);
3596 /* ?do_thousands_sep@?$numpunct@D@std@@MBEDXZ */
3597 /* ?do_thousands_sep@?$numpunct@D@std@@MEBADXZ */
3598 DEFINE_THISCALL_WRAPPER(numpunct_char_do_thousands_sep, 4)
3599 #define call_numpunct_char_do_thousands_sep(this) CALL_VTBL_FUNC(this, 8, \
3600 char, (const numpunct_char*), (this))
3601 char __thiscall numpunct_char_do_thousands_sep(const numpunct_char *this)
3603 TRACE("(%p)\n", this);
3607 /* ?thousands_sep@?$numpunct@D@std@@QBEDXZ */
3608 /* ?thousands_sep@?$numpunct@D@std@@QEBADXZ */
3609 DEFINE_THISCALL_WRAPPER(numpunct_char_thousands_sep, 4)
3610 char __thiscall numpunct_char_thousands_sep(const numpunct_char *this)
3612 TRACE("(%p)\n", this);
3613 return call_numpunct_char_do_thousands_sep(this);
3616 /* ?do_grouping@?$numpunct@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3617 /* ?do_grouping@?$numpunct@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3618 DEFINE_THISCALL_WRAPPER(numpunct_char_do_grouping, 8)
3619 #define call_numpunct_char_do_grouping(this, ret) CALL_VTBL_FUNC(this, 12, \
3620 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
3621 basic_string_char* __thiscall numpunct_char_do_grouping(
3622 const numpunct_char *this, basic_string_char *ret)
3624 TRACE("(%p)\n", this);
3625 return MSVCP_basic_string_char_ctor_cstr(ret, this->grouping);
3628 /* ?grouping@?$numpunct@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3629 /* ?grouping@?$numpunct@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3630 DEFINE_THISCALL_WRAPPER(numpunct_char_grouping, 8)
3631 basic_string_char* __thiscall numpunct_char_grouping(const numpunct_char *this, basic_string_char *ret)
3633 TRACE("(%p)\n", this);
3634 return call_numpunct_char_do_grouping(this, ret);
3637 /* ?do_falsename@?$numpunct@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3638 /* ?do_falsename@?$numpunct@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3639 DEFINE_THISCALL_WRAPPER(numpunct_char_do_falsename, 8)
3640 #define call_numpunct_char_do_falsename(this, ret) CALL_VTBL_FUNC(this, 16, \
3641 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
3642 basic_string_char* __thiscall numpunct_char_do_falsename(
3643 const numpunct_char *this, basic_string_char *ret)
3645 TRACE("(%p)\n", this);
3646 return MSVCP_basic_string_char_ctor_cstr(ret, this->false_name);
3649 /* ?falsename@?$numpunct@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3650 /* ?falsename@?$numpunct@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3651 DEFINE_THISCALL_WRAPPER(numpunct_char_falsename, 8)
3652 basic_string_char* __thiscall numpunct_char_falsename(const numpunct_char *this, basic_string_char *ret)
3654 TRACE("(%p)\n", this);
3655 return call_numpunct_char_do_falsename(this, ret);
3658 /* ?do_truename@?$numpunct@D@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3659 /* ?do_truename@?$numpunct@D@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3660 DEFINE_THISCALL_WRAPPER(numpunct_char_do_truename, 8)
3661 #define call_numpunct_char_do_truename(this, ret) CALL_VTBL_FUNC(this, 20, \
3662 basic_string_char*, (const numpunct_char*, basic_string_char*), (this, ret))
3663 basic_string_char* __thiscall numpunct_char_do_truename(
3664 const numpunct_char *this, basic_string_char *ret)
3666 TRACE("(%p)\n", this);
3667 return MSVCP_basic_string_char_ctor_cstr(ret, this->true_name);
3670 /* ?truename@?$numpunct@D@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3671 /* ?truename@?$numpunct@D@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
3672 DEFINE_THISCALL_WRAPPER(numpunct_char_truename, 8)
3673 basic_string_char* __thiscall numpunct_char_truename(const numpunct_char *this, basic_string_char *ret)
3675 TRACE("(%p)\n", this);
3676 return call_numpunct_char_do_truename(this, ret);
3679 /* ?id@?$numpunct@_W@std@@2V0locale@2@A */
3680 locale_id numpunct_wchar_id = {0};
3681 /* ?id@?$numpunct@G@std@@2V0locale@2@A */
3682 locale_id numpunct_short_id = {0};
3684 /* ??_7?$numpunct@_W@std@@6B@ */
3685 extern const vtable_ptr MSVCP_numpunct_wchar_vtable;
3686 /* ??_7?$numpunct@G@std@@6B@ */
3687 extern const vtable_ptr MSVCP_numpunct_short_vtable;
3689 /* ?_Init@?$numpunct@_W@std@@IAEXABV_Locinfo@2@_N@Z */
3690 /* ?_Init@?$numpunct@_W@std@@IEAAXAEBV_Locinfo@2@_N@Z */
3691 /* ?_Init@?$numpunct@G@std@@IAEXABV_Locinfo@2@_N@Z */
3692 /* ?_Init@?$numpunct@G@std@@IEAAXAEBV_Locinfo@2@_N@Z */
3693 DEFINE_THISCALL_WRAPPER(numpunct_wchar__Init, 12)
3694 void __thiscall numpunct_wchar__Init(numpunct_wchar *this,
3695 const _Locinfo *locinfo, MSVCP_bool isdef)
3697 const char *to_convert;
3701 TRACE("(%p %p %d)\n", this, locinfo, isdef);
3703 _Locinfo__Getcvt(locinfo, &cvt);
3705 to_convert = _Locinfo__Getfalse(locinfo);
3706 len = MultiByteToWideChar(cvt.page, 0, to_convert, -1, NULL, 0);
3707 this->false_name = MSVCRT_operator_new(len*sizeof(WCHAR));
3708 if(this->false_name)
3709 MultiByteToWideChar(cvt.page, 0, to_convert, -1,
3710 (wchar_t*)this->false_name, len);
3712 to_convert = _Locinfo__Gettrue(locinfo);
3713 len = MultiByteToWideChar(cvt.page, 0, to_convert, -1, NULL, 0);
3714 this->true_name = MSVCRT_operator_new(len*sizeof(WCHAR));
3716 MultiByteToWideChar(cvt.page, 0, to_convert, -1,
3717 (wchar_t*)this->true_name, len);
3720 this->grouping = MSVCRT_operator_new(1);
3722 *(char*)this->grouping = 0;
3727 const struct lconv *lc = _Locinfo__Getlconv(locinfo);
3729 len = strlen(lc->grouping)+1;
3730 this->grouping = MSVCRT_operator_new(len);
3732 memcpy((char*)this->grouping, lc->grouping, len);
3734 this->dp = lc->decimal_point[0];
3735 this->sep = lc->thousands_sep[0];
3738 if(!this->false_name || !this->true_name || !this->grouping) {
3739 MSVCRT_operator_delete((char*)this->grouping);
3740 MSVCRT_operator_delete((wchar_t*)this->false_name);
3741 MSVCRT_operator_delete((wchar_t*)this->true_name);
3743 ERR("Out of memory\n");
3744 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3748 /* ?_Tidy@?$numpunct@_W@std@@AAEXXZ */
3749 /* ?_Tidy@?$numpunct@_W@std@@AEAAXXZ */
3750 /* ?_Tidy@?$numpunct@G@std@@AAEXXZ */
3751 /* ?_Tidy@?$numpunct@G@std@@AEAAXXZ */
3752 DEFINE_THISCALL_WRAPPER(numpunct_wchar__Tidy, 4)
3753 void __thiscall numpunct_wchar__Tidy(numpunct_wchar *this)
3755 TRACE("(%p)\n", this);
3757 MSVCRT_operator_delete((char*)this->grouping);
3758 MSVCRT_operator_delete((wchar_t*)this->false_name);
3759 MSVCRT_operator_delete((wchar_t*)this->true_name);
3762 /* ??0?$numpunct@_W@std@@QAE@ABV_Locinfo@1@I_N@Z */
3763 /* ??0?$numpunct@_W@std@@QEAA@AEBV_Locinfo@1@_K_N@Z */
3764 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor_locinfo, 16)
3765 numpunct_wchar* __thiscall numpunct_wchar_ctor_locinfo(numpunct_wchar *this,
3766 const _Locinfo *locinfo, MSVCP_size_t refs, MSVCP_bool usedef)
3768 TRACE("(%p %p %lu %d)\n", this, locinfo, refs, usedef);
3769 locale_facet_ctor_refs(&this->facet, refs);
3770 this->facet.vtable = &MSVCP_numpunct_wchar_vtable;
3771 numpunct_wchar__Init(this, locinfo, usedef);
3775 /* ??0?$numpunct@G@std@@QAE@ABV_Locinfo@1@I_N@Z */
3776 /* ??0?$numpunct@G@std@@QEAA@AEBV_Locinfo@1@_K_N@Z */
3777 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor_locinfo, 16)
3778 numpunct_wchar* __thiscall numpunct_short_ctor_locinfo(numpunct_wchar *this,
3779 const _Locinfo *locinfo, MSVCP_size_t refs, MSVCP_bool usedef)
3781 numpunct_wchar_ctor_locinfo(this, locinfo, refs, usedef);
3782 this->facet.vtable = &MSVCP_numpunct_short_vtable;
3786 /* ??0?$numpunct@_W@std@@IAE@PBDI_N@Z */
3787 /* ??0?$numpunct@_W@std@@IEAA@PEBD_K_N@Z */
3788 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor_name, 16)
3789 numpunct_wchar* __thiscall numpunct_wchar_ctor_name(numpunct_wchar *this,
3790 const char *name, MSVCP_size_t refs, MSVCP_bool usedef)
3794 TRACE("(%p %s %lu %d)\n", this, debugstr_a(name), refs, usedef);
3795 locale_facet_ctor_refs(&this->facet, refs);
3796 this->facet.vtable = &MSVCP_numpunct_wchar_vtable;
3798 _Locinfo_ctor_cstr(&locinfo, name);
3799 numpunct_wchar__Init(this, &locinfo, usedef);
3800 _Locinfo_dtor(&locinfo);
3804 /* ??0?$numpunct@G@std@@IAE@PBDI_N@Z */
3805 /* ??0?$numpunct@G@std@@IEAA@PEBD_K_N@Z */
3806 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor_name, 16)
3807 numpunct_wchar* __thiscall numpunct_short_ctor_name(numpunct_wchar *this,
3808 const char *name, MSVCP_size_t refs, MSVCP_bool usedef)
3810 numpunct_wchar_ctor_name(this, name, refs, usedef);
3811 this->facet.vtable = &MSVCP_numpunct_short_vtable;
3815 /* ??0?$numpunct@_W@std@@QAE@I@Z */
3816 /* ??0?$numpunct@_W@std@@QEAA@_K@Z */
3817 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor_refs, 8)
3818 numpunct_wchar* __thiscall numpunct_wchar_ctor_refs(numpunct_wchar *this, MSVCP_size_t refs)
3820 TRACE("(%p %lu)\n", this, refs);
3821 return numpunct_wchar_ctor_name(this, "C", refs, FALSE);
3824 /* ??0?$numpunct@G@std@@QAE@I@Z */
3825 /* ??0?$numpunct@G@std@@QEAA@_K@Z */
3826 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor_refs, 8)
3827 numpunct_wchar* __thiscall numpunct_short_ctor_refs(numpunct_wchar *this, MSVCP_size_t refs)
3829 numpunct_wchar_ctor_refs(this, refs);
3830 this->facet.vtable = &MSVCP_numpunct_short_vtable;
3834 /* ??_F?$numpunct@_W@std@@QAEXXZ */
3835 /* ??_F?$numpunct@_W@std@@QEAAXXZ */
3836 DEFINE_THISCALL_WRAPPER(numpunct_wchar_ctor, 4)
3837 numpunct_wchar* __thiscall numpunct_wchar_ctor(numpunct_wchar *this)
3839 return numpunct_wchar_ctor_refs(this, 0);
3842 /* ??_F?$numpunct@G@std@@QAEXXZ */
3843 /* ??_F?$numpunct@G@std@@QEAAXXZ */
3844 DEFINE_THISCALL_WRAPPER(numpunct_short_ctor, 4)
3845 numpunct_wchar* __thiscall numpunct_short_ctor(numpunct_wchar *this)
3847 return numpunct_short_ctor_refs(this, 0);
3850 /* ??1?$numpunct@_W@std@@MAE@XZ */
3851 /* ??1?$numpunct@_W@std@@MEAA@XZ */
3852 /* ??1?$numpunct@G@std@@MAE@XZ */
3853 /* ??1?$numpunct@G@std@@MEAA@XZ */
3854 DEFINE_THISCALL_WRAPPER(numpunct_wchar_dtor, 4)
3855 void __thiscall numpunct_wchar_dtor(numpunct_wchar *this)
3857 TRACE("(%p)\n", this);
3858 numpunct_wchar__Tidy(this);
3861 DEFINE_THISCALL_WRAPPER(MSVCP_numpunct_wchar_vector_dtor, 8)
3862 numpunct_wchar* __thiscall MSVCP_numpunct_wchar_vector_dtor(numpunct_wchar *this, unsigned int flags)
3864 TRACE("(%p %x)\n", this, flags);
3866 /* we have an array, with the number of elements stored before the first object */
3867 int i, *ptr = (int *)this-1;
3869 for(i=*ptr-1; i>=0; i--)
3870 numpunct_wchar_dtor(this+i);
3871 MSVCRT_operator_delete(ptr);
3873 numpunct_wchar_dtor(this);
3875 MSVCRT_operator_delete(this);
3881 DEFINE_THISCALL_WRAPPER(MSVCP_numpunct_short_vector_dtor, 8)
3882 numpunct_wchar* __thiscall MSVCP_numpunct_short_vector_dtor(numpunct_wchar *this, unsigned int flags)
3884 return MSVCP_numpunct_wchar_vector_dtor(this, flags);
3887 /* ?_Getcat@?$numpunct@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3888 /* ?_Getcat@?$numpunct@_W@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3889 MSVCP_size_t __cdecl numpunct_wchar__Getcat(const locale_facet **facet, const locale *loc)
3891 TRACE("(%p %p)\n", facet, loc);
3893 if(facet && !*facet) {
3894 *facet = MSVCRT_operator_new(sizeof(numpunct_wchar));
3896 ERR("Out of memory\n");
3897 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3900 numpunct_wchar_ctor_name((numpunct_wchar*)*facet,
3901 MSVCP_basic_string_char_c_str(&loc->ptr->name), 0, TRUE);
3907 static numpunct_wchar* numpunct_wchar_use_facet(const locale *loc)
3909 static numpunct_wchar *obj = NULL;
3912 const locale_facet *fac;
3914 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3915 fac = locale__Getfacet(loc, locale_id_operator_size_t(&numpunct_wchar_id));
3917 _Lockit_dtor(&lock);
3918 return (numpunct_wchar*)fac;
3922 _Lockit_dtor(&lock);
3926 numpunct_wchar__Getcat(&fac, loc);
3927 obj = (numpunct_wchar*)fac;
3928 locale_facet__Incref(&obj->facet);
3929 locale_facet_register(&obj->facet);
3930 _Lockit_dtor(&lock);
3935 /* ?_Getcat@?$numpunct@G@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
3936 /* ?_Getcat@?$numpunct@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
3937 MSVCP_size_t __cdecl numpunct_short__Getcat(const locale_facet **facet, const locale *loc)
3939 TRACE("(%p %p)\n", facet, loc);
3941 if(facet && !*facet) {
3942 *facet = MSVCRT_operator_new(sizeof(numpunct_wchar));
3944 ERR("Out of memory\n");
3945 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
3948 numpunct_short_ctor_name((numpunct_wchar*)*facet,
3949 MSVCP_basic_string_char_c_str(&loc->ptr->name), 0, TRUE);
3955 static numpunct_wchar* numpunct_short_use_facet(const locale *loc)
3957 static numpunct_wchar *obj = NULL;
3960 const locale_facet *fac;
3962 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
3963 fac = locale__Getfacet(loc, locale_id_operator_size_t(&numpunct_short_id));
3965 _Lockit_dtor(&lock);
3966 return (numpunct_wchar*)fac;
3970 _Lockit_dtor(&lock);
3974 numpunct_short__Getcat(&fac, loc);
3975 obj = (numpunct_wchar*)fac;
3976 locale_facet__Incref(&obj->facet);
3977 locale_facet_register(&obj->facet);
3978 _Lockit_dtor(&lock);
3983 /* ?do_decimal_point@?$numpunct@_W@std@@MBE_WXZ */
3984 /* ?do_decimal_point@?$numpunct@_W@std@@MEBA_WXZ */
3985 /* ?do_decimal_point@?$numpunct@G@std@@MBEGXZ */
3986 /* ?do_decimal_point@?$numpunct@G@std@@MEBAGXZ */
3987 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_decimal_point, 4)
3988 #define call_numpunct_wchar_do_decimal_point(this) CALL_VTBL_FUNC(this, 4, \
3989 wchar_t, (const numpunct_wchar *this), (this))
3990 wchar_t __thiscall numpunct_wchar_do_decimal_point(const numpunct_wchar *this)
3992 TRACE("(%p)\n", this);
3996 /* ?decimal_point@?$numpunct@_W@std@@QBE_WXZ */
3997 /* ?decimal_point@?$numpunct@_W@std@@QEBA_WXZ */
3998 /* ?decimal_point@?$numpunct@G@std@@QBEGXZ */
3999 /* ?decimal_point@?$numpunct@G@std@@QEBAGXZ */
4000 DEFINE_THISCALL_WRAPPER(numpunct_wchar_decimal_point, 4)
4001 wchar_t __thiscall numpunct_wchar_decimal_point(const numpunct_wchar *this)
4003 TRACE("(%p)\n", this);
4004 return call_numpunct_wchar_do_decimal_point(this);
4007 /* ?do_thousands_sep@?$numpunct@_W@std@@MBE_WXZ */
4008 /* ?do_thousands_sep@?$numpunct@_W@std@@MEBA_WXZ */
4009 /* ?do_thousands_sep@?$numpunct@G@std@@MBEGXZ */
4010 /* ?do_thousands_sep@?$numpunct@G@std@@MEBAGXZ */
4011 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_thousands_sep, 4)
4012 #define call_numpunct_wchar_do_thousands_sep(this) CALL_VTBL_FUNC(this, 8, \
4013 wchar_t, (const numpunct_wchar *this), (this))
4014 wchar_t __thiscall numpunct_wchar_do_thousands_sep(const numpunct_wchar *this)
4016 TRACE("(%p)\n", this);
4020 /* ?thousands_sep@?$numpunct@_W@std@@QBE_WXZ */
4021 /* ?thousands_sep@?$numpunct@_W@std@@QEBA_WXZ */
4022 /* ?thousands_sep@?$numpunct@G@std@@QBEGXZ */
4023 /* ?thousands_sep@?$numpunct@G@std@@QEBAGXZ */
4024 DEFINE_THISCALL_WRAPPER(numpunct_wchar_thousands_sep, 4)
4025 wchar_t __thiscall numpunct_wchar_thousands_sep(const numpunct_wchar *this)
4027 TRACE("(%p)\n", this);
4028 return call_numpunct_wchar_do_thousands_sep(this);
4031 /* ?do_grouping@?$numpunct@_W@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4032 /* ?do_grouping@?$numpunct@_W@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4033 /* ?do_grouping@?$numpunct@G@std@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4034 /* ?do_grouping@?$numpunct@G@std@@MEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4035 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_grouping, 8)
4036 #define call_numpunct_wchar_do_grouping(this, ret) CALL_VTBL_FUNC(this, 12, \
4037 basic_string_char*, (const numpunct_wchar*, basic_string_char*), (this, ret))
4038 basic_string_char* __thiscall numpunct_wchar_do_grouping(const numpunct_wchar *this, basic_string_char *ret)
4040 TRACE("(%p)\n", this);
4041 return MSVCP_basic_string_char_ctor_cstr(ret, this->grouping);
4044 /* ?grouping@?$numpunct@_W@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4045 /* ?grouping@?$numpunct@_W@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4046 /* ?grouping@?$numpunct@G@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4047 /* ?grouping@?$numpunct@G@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
4048 DEFINE_THISCALL_WRAPPER(numpunct_wchar_grouping, 8)
4049 basic_string_char* __thiscall numpunct_wchar_grouping(const numpunct_wchar *this, basic_string_char *ret)
4051 TRACE("(%p)\n", this);
4052 return call_numpunct_wchar_do_grouping(this, ret);
4055 /* ?do_falsename@?$numpunct@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4056 /* ?do_falsename@?$numpunct@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4057 /* ?do_falsename@?$numpunct@G@std@@MBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4058 /* ?do_falsename@?$numpunct@G@std@@MEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4059 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_falsename, 8)
4060 #define call_numpunct_wchar_do_falsename(this, ret) CALL_VTBL_FUNC(this, 16, \
4061 basic_string_wchar*, (const numpunct_wchar*, basic_string_wchar*), (this, ret))
4062 basic_string_wchar* __thiscall numpunct_wchar_do_falsename(const numpunct_wchar *this, basic_string_wchar *ret)
4064 TRACE("(%p)\n", this);
4065 return MSVCP_basic_string_wchar_ctor_cstr(ret, this->false_name);
4068 /* ?falsename@?$numpunct@_W@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4069 /* ?falsename@?$numpunct@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4070 /* ?falsename@?$numpunct@G@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4071 /* ?falsename@?$numpunct@G@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4072 DEFINE_THISCALL_WRAPPER(numpunct_wchar_falsename, 8)
4073 basic_string_wchar* __thiscall numpunct_wchar_falsename(const numpunct_wchar *this, basic_string_wchar *ret)
4075 TRACE("(%p)\n", this);
4076 return call_numpunct_wchar_do_falsename(this, ret);
4079 /* ?do_truename@?$numpunct@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4080 /* ?do_truename@?$numpunct@_W@std@@MEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4081 /* ?do_truename@?$numpunct@G@std@@MBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4082 /* ?do_truename@?$numpunct@G@std@@MEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4083 DEFINE_THISCALL_WRAPPER(numpunct_wchar_do_truename, 8)
4084 #define call_numpunct_wchar_do_truename(this, ret) CALL_VTBL_FUNC(this, 20, \
4085 basic_string_wchar*, (const numpunct_wchar*, basic_string_wchar*), (this, ret))
4086 basic_string_wchar* __thiscall numpunct_wchar_do_truename(const numpunct_wchar *this, basic_string_wchar *ret)
4088 TRACE("(%p)\n", this);
4089 return MSVCP_basic_string_wchar_ctor_cstr(ret, this->true_name);
4092 /* ?truename@?$numpunct@_W@std@@QBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4093 /* ?truename@?$numpunct@_W@std@@QEBA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@XZ */
4094 /* ?truename@?$numpunct@G@std@@QBE?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4095 /* ?truename@?$numpunct@G@std@@QEBA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@2@XZ */
4096 DEFINE_THISCALL_WRAPPER(numpunct_wchar_truename, 8)
4097 basic_string_wchar* __thiscall numpunct_wchar_truename(const numpunct_wchar *this, basic_string_wchar *ret)
4099 TRACE("(%p)\n", this);
4100 return call_numpunct_wchar_do_truename(this, ret);
4103 double __cdecl _Stod(const char *buf, char **buf_end, LONG exp)
4105 double ret = strtod(buf, buf_end);
4108 ret *= pow(10, exp);
4112 double __cdecl _Stodx(const char *buf, char **buf_end, LONG exp, int *err)
4118 ret = _Stod(buf, buf_end, exp);
4128 float __cdecl _Stof(const char *buf, char **buf_end, LONG exp)
4130 return _Stod(buf, buf_end, exp);
4133 float __cdecl _Stofx(const char *buf, char **buf_end, LONG exp, int *err)
4135 return _Stodx(buf, buf_end, exp, err);
4138 __int64 __cdecl _Stoll(const char *buf, char **buf_end, int base)
4140 return _strtoi64(buf, buf_end, base);
4143 __int64 __cdecl _Stollx(const char *buf, char **buf_end, int base, int *err)
4149 ret = _strtoi64(buf, buf_end, base);
4159 LONG __cdecl _Stolx(const char *buf, char **buf_end, int base, int *err)
4161 __int64 i = _Stollx(buf, buf_end, base, err);
4162 if(!*err && i!=(__int64)((LONG)i))
4167 unsigned __int64 __cdecl _Stoull(const char *buf, char **buf_end, int base)
4169 return _strtoui64(buf, buf_end, base);
4172 unsigned __int64 __cdecl _Stoullx(const char *buf, char **buf_end, int base, int *err)
4174 unsigned __int64 ret;
4178 ret = _strtoui64(buf, buf_end, base);
4188 ULONG __cdecl _Stoul(const char *buf, char **buf_end, int base)
4191 unsigned __int64 i = _Stoullx(buf[0]=='-' ? buf+1 : buf, buf_end, base, &err);
4192 if(!err && i!=(unsigned __int64)((ULONG)i))
4194 return buf[0]=='-' ? -i : i;
4197 ULONG __cdecl _Stoulx(const char *buf, char **buf_end, int base, int *err)
4199 unsigned __int64 i = _Stoullx(buf[0]=='-' ? buf+1 : buf, buf_end, base, err);
4200 if(!*err && i!=(unsigned __int64)((ULONG)i))
4202 return buf[0]=='-' ? -i : i;
4205 /* ?id@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@2V0locale@2@A */
4206 locale_id num_get_wchar_id = {0};
4207 /* ?id@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@2V0locale@2@A */
4208 locale_id num_get_short_id = {0};
4210 /* ??_7?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@6B@ */
4211 extern const vtable_ptr MSVCP_num_get_wchar_vtable;
4212 /* ??_7?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@6B@ */
4213 extern const vtable_ptr MSVCP_num_get_short_vtable;
4215 /* ?_Init@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
4216 /* ?_Init@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
4217 /* ?_Init@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
4218 /* ?_Init@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
4219 DEFINE_THISCALL_WRAPPER(num_get_wchar__Init, 8)
4220 void __thiscall num_get_wchar__Init(num_get *this, const _Locinfo *locinfo)
4222 TRACE("(%p %p)\n", this, locinfo);
4223 _Locinfo__Getcvt(locinfo, &this->cvt);
4226 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
4227 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
4228 DEFINE_THISCALL_WRAPPER(num_get_wchar_ctor_locinfo, 12)
4229 num_get* __thiscall num_get_wchar_ctor_locinfo(num_get *this,
4230 const _Locinfo *locinfo, MSVCP_size_t refs)
4232 TRACE("(%p %p %lu)\n", this, locinfo, refs);
4234 locale_facet_ctor_refs(&this->facet, refs);
4235 this->facet.vtable = &MSVCP_num_get_wchar_vtable;
4237 num_get_wchar__Init(this, locinfo);
4241 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
4242 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
4243 DEFINE_THISCALL_WRAPPER(num_get_short_ctor_locinfo, 12)
4244 num_get* __thiscall num_get_short_ctor_locinfo(num_get *this,
4245 const _Locinfo *locinfo, MSVCP_size_t refs)
4247 num_get_wchar_ctor_locinfo(this, locinfo, refs);
4248 this->facet.vtable = &MSVCP_num_get_short_vtable;
4252 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@I@Z */
4253 /* ??0?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@_K@Z */
4254 DEFINE_THISCALL_WRAPPER(num_get_wchar_ctor_refs, 8)
4255 num_get* __thiscall num_get_wchar_ctor_refs(num_get *this, MSVCP_size_t refs)
4259 TRACE("(%p %lu)\n", this, refs);
4261 _Locinfo_ctor(&locinfo);
4262 num_get_wchar_ctor_locinfo(this, &locinfo, refs);
4263 _Locinfo_dtor(&locinfo);
4267 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QAE@I@Z */
4268 /* ??0?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@QEAA@_K@Z */
4269 DEFINE_THISCALL_WRAPPER(num_get_short_ctor_refs, 8)
4270 num_get* __thiscall num_get_short_ctor_refs(num_get *this, MSVCP_size_t refs)
4272 num_get_wchar_ctor_refs(this, refs);
4273 this->facet.vtable = &MSVCP_num_get_short_vtable;
4277 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
4278 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
4279 DEFINE_THISCALL_WRAPPER(num_get_wchar_ctor, 4)
4280 num_get* __thiscall num_get_wchar_ctor(num_get *this)
4282 return num_get_wchar_ctor_refs(this, 0);
4285 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
4286 /* ??_F?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
4287 DEFINE_THISCALL_WRAPPER(num_get_short_ctor, 4)
4288 num_get* __thiscall num_get_short_ctor(num_get *this)
4290 return num_get_short_ctor_refs(this, 0);
4293 /* ??1?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MAE@XZ */
4294 /* ??1?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEAA@XZ */
4295 /* ??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MAE@XZ */
4296 /* ??1?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@MEAA@XZ */
4297 DEFINE_THISCALL_WRAPPER(num_get_wchar_dtor, 4)
4298 void __thiscall num_get_wchar_dtor(num_get *this)
4300 TRACE("(%p)\n", this);
4301 locale_facet_dtor(&this->facet);
4304 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_wchar_vector_dtor, 8)
4305 num_get* __thiscall MSVCP_num_get_wchar_vector_dtor(num_get *this, unsigned int flags)
4307 TRACE("(%p %x)\n", this, flags);
4309 /* we have an array, with the number of elements stored before the first object */
4310 int i, *ptr = (int *)this-1;
4312 for(i=*ptr-1; i>=0; i--)
4313 num_get_wchar_dtor(this+i);
4314 MSVCRT_operator_delete(ptr);
4316 num_get_wchar_dtor(this);
4318 MSVCRT_operator_delete(this);
4324 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_short_vector_dtor, 8)
4325 num_get* __thiscall MSVCP_num_get_short_vector_dtor(num_get *this, unsigned int flags)
4327 return MSVCP_num_get_wchar_vector_dtor(this, flags);
4330 /* ?_Getcat@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
4331 /* ?_Getcat@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
4332 MSVCP_size_t __cdecl num_get_wchar__Getcat(const locale_facet **facet, const locale *loc)
4334 TRACE("(%p %p)\n", facet, loc);
4336 if(facet && !*facet) {
4339 *facet = MSVCRT_operator_new(sizeof(num_get));
4341 ERR("Out of memory\n");
4342 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
4346 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
4347 num_get_wchar_ctor_locinfo((num_get*)*facet, &locinfo, 0);
4348 _Locinfo_dtor(&locinfo);
4354 num_get* num_get_wchar_use_facet(const locale *loc)
4356 static num_get *obj = NULL;
4359 const locale_facet *fac;
4361 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
4362 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_get_wchar_id));
4364 _Lockit_dtor(&lock);
4365 return (num_get*)fac;
4369 _Lockit_dtor(&lock);
4373 num_get_wchar__Getcat(&fac, loc);
4374 obj = (num_get*)fac;
4375 locale_facet__Incref(&obj->facet);
4376 locale_facet_register(&obj->facet);
4377 _Lockit_dtor(&lock);
4382 /* ?_Getcat@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
4383 /* ?_Getcat@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
4384 MSVCP_size_t __cdecl num_get_short__Getcat(const locale_facet **facet, const locale *loc)
4386 if(facet && !*facet) {
4387 num_get_wchar__Getcat(facet, loc);
4388 (*(locale_facet**)facet)->vtable = &MSVCP_num_get_short_vtable;
4394 static num_get* num_get_short_use_facet(const locale *loc)
4396 static num_get *obj = NULL;
4399 const locale_facet *fac;
4401 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
4402 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_get_short_id));
4404 _Lockit_dtor(&lock);
4405 return (num_get*)fac;
4409 _Lockit_dtor(&lock);
4413 num_get_short__Getcat(&fac, loc);
4414 obj = (num_get*)fac;
4415 locale_facet__Incref(&obj->facet);
4416 locale_facet_register(&obj->facet);
4417 _Lockit_dtor(&lock);
4422 static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
4427 return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
4430 static int num_get__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
4431 istreambuf_iterator_wchar *last, const locale *loc, numpunct_wchar *numpunct)
4433 basic_string_char grouping_bstr;
4434 int i, groups_no = 0, cur_group = 0, exp = 0;
4435 char *dest_beg = dest, *num_end = dest+25, *exp_end = dest+31, *groups = NULL;
4436 wchar_t sep, digits[11], *digits_pos;
4437 const char *grouping;
4438 BOOL error = TRUE, dest_empty = TRUE;
4440 TRACE("(%p %p %p %p)\n", dest, first, last, loc);
4443 digits[i] = mb_to_wc('0'+i, &this->cvt);
4446 numpunct_wchar_grouping(numpunct, &grouping_bstr);
4447 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
4448 sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : (wchar_t)0;
4450 istreambuf_iterator_wchar_val(first);
4451 if(first->strbuf && first->val==mb_to_wc('-', &this->cvt)) {
4453 istreambuf_iterator_wchar_inc(first);
4454 }else if(first->strbuf && first->val==mb_to_wc('+', &this->cvt)) {
4456 istreambuf_iterator_wchar_inc(first);
4460 groups_no = strlen(grouping)+2;
4461 groups = calloc(groups_no, sizeof(char));
4464 for(; first->strbuf; istreambuf_iterator_wchar_inc(first)) {
4465 if(!(digits_pos = wcschr(digits, first->val))) {
4466 if(sep && first->val==sep) {
4467 if(cur_group == groups_no+1) {
4468 if(groups[1] != groups[2]) {
4472 memmove(groups+1, groups+2, groups_no);
4473 groups[cur_group] = 0;
4483 if(dest_empty && first->val == digits[0])
4487 *dest++ = '0'+digits_pos-digits;
4490 if(sep && groups[cur_group]<CHAR_MAX)
4491 groups[cur_group]++;
4495 if(cur_group && !groups[cur_group])
4500 for(; cur_group>=0 && !error; cur_group--) {
4501 if(*grouping == CHAR_MAX) {
4505 }else if((cur_group && *grouping!=groups[cur_group])
4506 || (!cur_group && *grouping<groups[cur_group])) {
4509 }else if(grouping[1]) {
4513 MSVCP_basic_string_char_dtor(&grouping_bstr);
4519 }else if(dest_empty) {
4523 if(first->strbuf && first->val==numpunct_wchar_decimal_point(numpunct)) {
4525 *dest++ = *localeconv()->decimal_point;
4526 istreambuf_iterator_wchar_inc(first);
4529 for(; first->strbuf && first->val==digits[0]; istreambuf_iterator_wchar_inc(first))
4532 if(!first->strbuf || !wcschr(digits, first->val))
4537 for(; first->strbuf; istreambuf_iterator_wchar_inc(first)) {
4538 if(!(digits_pos = wcschr(digits, first->val)))
4540 else if(dest<num_end)
4541 *dest++ = '0'+digits_pos-digits;
4544 if(first->strbuf && (first->val==mb_to_wc('e', &this->cvt) || first->val==mb_to_wc('E', &this->cvt))) {
4546 istreambuf_iterator_wchar_inc(first);
4548 if(first->strbuf && first->val==mb_to_wc('-', &this->cvt)) {
4550 istreambuf_iterator_wchar_inc(first);
4551 }else if(first->strbuf && first->val==mb_to_wc('+', &this->cvt)) {
4553 istreambuf_iterator_wchar_inc(first);
4556 error = dest_empty = TRUE;
4557 for(; first->strbuf && first->val==digits[0]; istreambuf_iterator_wchar_inc(first))
4560 for(; first->strbuf && (digits_pos = wcschr(digits, first->val)); istreambuf_iterator_wchar_inc(first)) {
4561 error = dest_empty = FALSE;
4563 *dest++ = '0'+digits_pos-digits;
4569 }else if(dest_empty) {
4578 /* ?_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 */
4579 /* ?_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 */
4580 int __cdecl num_get_wchar__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
4581 istreambuf_iterator_wchar *last, const locale *loc)
4583 return num_get__Getffld(this, dest, first, last, loc, numpunct_wchar_use_facet(loc));
4586 /* ?_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 */
4587 /* ?_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 */
4588 int __cdecl num_get_short__Getffld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
4589 istreambuf_iterator_wchar *last, const locale *loc)
4591 return num_get__Getffld(this, dest, first, last, loc, numpunct_short_use_facet(loc));
4594 /* ?_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 */
4595 /* ?_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 */
4596 /* ?_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 */
4597 /* ?_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 */
4598 int __cdecl num_get_wchar__Getffldx(num_get *this, char *dest, istreambuf_iterator_wchar *first,
4599 istreambuf_iterator_wchar *last, ios_base *ios, int *phexexp)
4601 FIXME("(%p %p %p %p %p) stub\n", dest, first, last, ios, phexexp);
4605 static int num_get__Getifld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
4606 istreambuf_iterator_wchar *last, int fmtflags, const locale *loc, numpunct_wchar *numpunct)
4608 wchar_t digits[23], *digits_pos, sep;
4609 basic_string_char grouping_bstr;
4610 int i, basefield, base, groups_no = 0, cur_group = 0;
4611 char *dest_beg = dest, *dest_end = dest+24, *groups = NULL;
4612 const char *grouping;
4613 BOOL error = TRUE, dest_empty = TRUE;
4615 TRACE("(%p %p %p %04x %p)\n", dest, first, last, fmtflags, loc);
4618 digits[i] = mb_to_wc('0'+i, &this->cvt);
4619 for(i=0; i<6; i++) {
4620 digits[10+i] = mb_to_wc('a'+i, &this->cvt);
4621 digits[16+i] = mb_to_wc('A'+i, &this->cvt);
4624 numpunct_wchar_grouping(numpunct, &grouping_bstr);
4625 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
4626 sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : '\0';
4628 basefield = fmtflags & FMTFLAG_basefield;
4629 if(basefield == FMTFLAG_oct)
4631 else if(basefield == FMTFLAG_hex)
4632 base = 22; /* equal to the size of digits buffer */
4638 istreambuf_iterator_wchar_val(first);
4639 if(first->strbuf && first->val==mb_to_wc('-', &this->cvt)) {
4641 istreambuf_iterator_wchar_inc(first);
4642 }else if(first->strbuf && first->val==mb_to_wc('+', &this->cvt)) {
4644 istreambuf_iterator_wchar_inc(first);
4647 if(!base && first->strbuf && first->val==digits[0]) {
4648 istreambuf_iterator_wchar_inc(first);
4649 if(first->strbuf && (first->val==mb_to_wc('x', &this->cvt) || first->val==mb_to_wc('x', &this->cvt))) {
4650 istreambuf_iterator_wchar_inc(first);
4662 groups_no = strlen(grouping)+2;
4663 groups = calloc(groups_no, sizeof(char));
4666 for(; first->strbuf; istreambuf_iterator_wchar_inc(first)) {
4667 if(!(digits_pos = wcschr(digits, first->val))) {
4668 if(sep && first->val==sep) {
4669 if(cur_group == groups_no+1) {
4670 if(groups[1] != groups[2]) {
4674 memmove(groups+1, groups+2, groups_no);
4675 groups[cur_group] = 0;
4685 if(dest_empty && first->val == digits[0])
4688 /* skip digits that can't be copied to dest buffer, other
4689 * functions are responsible for detecting overflows */
4691 *dest++ = (digits_pos-digits<10 ? '0'+digits_pos-digits :
4692 (digits_pos-digits<16 ? 'a'+digits_pos-digits-10 :
4693 'A'+digits_pos-digits-16));
4694 if(sep && groups[cur_group]<CHAR_MAX)
4695 groups[cur_group]++;
4699 if(cur_group && !groups[cur_group])
4704 for(; cur_group>=0 && !error; cur_group--) {
4705 if(*grouping == CHAR_MAX) {
4709 }else if((cur_group && *grouping!=groups[cur_group])
4710 || (!cur_group && *grouping<groups[cur_group])) {
4713 }else if(grouping[1]) {
4717 MSVCP_basic_string_char_dtor(&grouping_bstr);
4726 return (base==22 ? 16 : base);
4729 /* ?_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 */
4730 /* ?_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 */
4731 int __cdecl num_get_wchar__Getifld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
4732 istreambuf_iterator_wchar *last, int fmtflags, const locale *loc)
4734 return num_get__Getifld(this, dest, first, last,
4735 fmtflags, loc, numpunct_wchar_use_facet(loc));
4738 /* ?_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 */
4739 /* ?_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 */
4740 int __cdecl num_get_short__Getifld(const num_get *this, char *dest, istreambuf_iterator_wchar *first,
4741 istreambuf_iterator_wchar *last, int fmtflags, const locale *loc)
4743 return num_get__Getifld(this, dest, first, last,
4744 fmtflags, loc, numpunct_short_use_facet(loc));
4747 /* ?_Hexdig@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABEH_W000@Z */
4748 /* ?_Hexdig@?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAH_W000@Z */
4749 /* ?_Hexdig@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABEHGGGG@Z */
4750 /* ?_Hexdig@?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBAHGGGG@Z */
4751 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_wchar__Hexdig, 20)
4752 int __thiscall MSVCP_num_get_wchar__Hexdig(num_get *this, wchar_t dig, wchar_t e0, wchar_t al, wchar_t au)
4754 FIXME("(%p %c %c %c %c) stub\n", this, dig, e0, al, au);
4758 static istreambuf_iterator_wchar* num_get_do_get_void(const num_get *this,
4759 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
4760 istreambuf_iterator_wchar last, ios_base *base, int *state,
4761 void **pval, numpunct_wchar *numpunct)
4767 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4769 v = _Stoullx(tmp, &end, num_get__Getifld(this, tmp, &first,
4770 &last, FMTFLAG_hex, base->loc, numpunct), &err);
4771 if(v!=(unsigned __int64)((INT_PTR)v))
4772 *state |= IOSTATE_failbit;
4773 else if(end!=tmp && !err)
4774 *pval = (void*)((INT_PTR)v);
4776 *state |= IOSTATE_failbit;
4779 *state |= IOSTATE_eofbit;
4785 /* ?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 */
4786 /* ?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 */
4787 #define call_num_get_wchar_do_get_void(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 4, istreambuf_iterator_wchar*, \
4788 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, void**), \
4789 (this, ret, first, last, base, state, pval))
4790 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_void,36)
4791 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_void(const num_get *this, istreambuf_iterator_wchar *ret,
4792 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, void **pval)
4794 return num_get_do_get_void(this, ret, first, last, base,
4795 state, pval, numpunct_wchar_use_facet(base->loc));
4798 /* ?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 */
4799 /* ?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 */
4800 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_void,36)
4801 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_void(const num_get *this, istreambuf_iterator_wchar *ret,
4802 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, void **pval)
4804 return num_get_do_get_void(this, ret, first, last, base,
4805 state, pval, numpunct_short_use_facet(base->loc));
4808 /* ?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 */
4809 /* ?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 */
4810 /* ?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 */
4811 /* ?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 */
4812 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_void,36)
4813 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_void(const num_get *this, istreambuf_iterator_wchar *ret,
4814 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, void **pval)
4816 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4817 return call_num_get_wchar_do_get_void(this, ret, first, last, base, state, pval);
4820 static istreambuf_iterator_wchar* num_get_do_get_double(const num_get *this,
4821 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
4822 istreambuf_iterator_wchar last, ios_base *base, int *state,
4823 double *pval, numpunct_wchar *numpunct)
4829 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4831 v = _Stodx(tmp, &end, num_get__Getffld(this, tmp, &first, &last, base->loc, numpunct), &err);
4832 if(end!=tmp && !err)
4835 *state |= IOSTATE_failbit;
4838 *state |= IOSTATE_eofbit;
4844 /* ?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 */
4845 /* ?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 */
4846 /* ?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 */
4847 /* ?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 */
4848 #define call_num_get_wchar_do_get_ldouble(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 8, istreambuf_iterator_wchar*, \
4849 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, double*), \
4850 (this, ret, first, last, base, state, pval))
4851 #define call_num_get_wchar_do_get_double(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_wchar*, \
4852 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, double*), \
4853 (this, ret, first, last, base, state, pval))
4854 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_double,36)
4855 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_double(const num_get *this, istreambuf_iterator_wchar *ret,
4856 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
4858 return num_get_do_get_double(this, ret, first, last, base,
4859 state, pval, numpunct_wchar_use_facet(base->loc));
4862 /* ?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 */
4863 /* ?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 */
4864 /* ?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 */
4865 /* ?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 */
4866 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_double,36)
4867 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_double(const num_get *this, istreambuf_iterator_wchar *ret,
4868 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
4870 return num_get_do_get_double(this, ret, first, last, base,
4871 state, pval, numpunct_short_use_facet(base->loc));
4874 /* ?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 */
4875 /* ?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 */
4876 /* ?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 */
4877 /* ?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 */
4878 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_ldouble,36)
4879 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_ldouble(const num_get *this, istreambuf_iterator_wchar *ret,
4880 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
4882 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4883 return call_num_get_wchar_do_get_ldouble(this, ret, first, last, base, state, pval);
4886 /* ?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 */
4887 /* ?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 */
4888 /* ?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 */
4889 /* ?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 */
4890 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_double,36)
4891 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_double(const num_get *this, istreambuf_iterator_wchar *ret,
4892 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, double *pval)
4894 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4895 return call_num_get_wchar_do_get_double(this, ret, first, last, base, state, pval);
4898 static istreambuf_iterator_wchar* num_get_do_get_float(const num_get *this,
4899 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
4900 istreambuf_iterator_wchar last, ios_base *base, int *state,
4901 float *pval, numpunct_wchar *numpunct)
4907 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4909 v = _Stofx(tmp, &end, num_get__Getffld(this, tmp, &first,
4910 &last, base->loc, numpunct), &err);
4911 if(end!=tmp && !err)
4914 *state |= IOSTATE_failbit;
4917 *state |= IOSTATE_eofbit;
4923 /* ?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 */
4924 /* ?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 */
4925 #define call_num_get_wchar_do_get_float(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_wchar*, \
4926 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, float*), \
4927 (this, ret, first, last, base, state, pval))
4928 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_float,36)
4929 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_float(const num_get *this, istreambuf_iterator_wchar *ret,
4930 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, float *pval)
4932 return num_get_do_get_float(this, ret, first, last, base,
4933 state, pval, numpunct_wchar_use_facet(base->loc));
4936 /* ?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 */
4937 /* ?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 */
4938 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_float,36)
4939 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_float(const num_get *this, istreambuf_iterator_wchar *ret,
4940 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, float *pval)
4942 return num_get_do_get_float(this, ret, first, last, base,
4943 state, pval, numpunct_short_use_facet(base->loc));
4946 /* ?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 */
4947 /* ?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 */
4948 /* ?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 */
4949 /* ?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 */
4950 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_float,36)
4951 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_float(const num_get *this, istreambuf_iterator_wchar *ret,
4952 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, float *pval)
4954 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4955 return call_num_get_wchar_do_get_float(this, ret, first, last, base, state, pval);
4958 static istreambuf_iterator_wchar* num_get_do_get_uint64(const num_get *this,
4959 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
4960 istreambuf_iterator_wchar last, ios_base *base, int *state,
4961 ULONGLONG *pval, numpunct_wchar *numpunct)
4967 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
4969 v = _Stoullx(tmp, &end, num_get__Getifld(this, tmp, &first,
4970 &last, base->fmtfl, base->loc, numpunct), &err);
4971 if(end!=tmp && !err)
4974 *state |= IOSTATE_failbit;
4977 *state |= IOSTATE_eofbit;
4983 /* ?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 */
4984 /* ?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 */
4985 #define call_num_get_wchar_do_get_uint64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_wchar*, \
4986 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, ULONGLONG*), \
4987 (this, ret, first, last, base, state, pval))
4988 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_uint64,36)
4989 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_uint64(const num_get *this, istreambuf_iterator_wchar *ret,
4990 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONGLONG *pval)
4992 return num_get_do_get_uint64(this, ret, first, last, base,
4993 state, pval, numpunct_wchar_use_facet(base->loc));
4996 /* ?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 */
4997 /* ?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 */
4998 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_uint64,36)
4999 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_uint64(const num_get *this, istreambuf_iterator_wchar *ret,
5000 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONGLONG *pval)
5002 return num_get_do_get_uint64(this, ret, first, last, base,
5003 state, pval, numpunct_short_use_facet(base->loc));
5006 /* ?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 */
5007 /* ?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 */
5008 /* ?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 */
5009 /* ?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 */
5010 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_uint64,36)
5011 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_uint64(const num_get *this, istreambuf_iterator_wchar *ret,
5012 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONGLONG *pval)
5014 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5015 return call_num_get_wchar_do_get_uint64(this, ret, first, last, base, state, pval);
5018 static istreambuf_iterator_wchar* num_get_do_get_int64(const num_get *this,
5019 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5020 istreambuf_iterator_wchar last, ios_base *base, int *state,
5021 LONGLONG *pval, numpunct_wchar *numpunct)
5027 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5029 v = _Stollx(tmp, &end, num_get__Getifld(this, tmp, &first,
5030 &last, base->fmtfl, base->loc, numpunct), &err);
5031 if(end!=tmp && !err)
5034 *state |= IOSTATE_failbit;
5037 *state |= IOSTATE_eofbit;
5043 /* ?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 */
5044 /* ?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 */
5045 #define call_num_get_wchar_do_get_int64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_wchar*, \
5046 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, LONGLONG*), \
5047 (this, ret, first, last, base, state, pval))
5048 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_int64,36)
5049 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_int64(const num_get *this, istreambuf_iterator_wchar *ret,
5050 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONGLONG *pval)
5052 return num_get_do_get_int64(this, ret, first, last, base,
5053 state, pval, numpunct_wchar_use_facet(base->loc));
5056 /* ?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 */
5057 /* ?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 */
5058 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_int64,36)
5059 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_int64(const num_get *this, istreambuf_iterator_wchar *ret,
5060 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONGLONG *pval)
5062 return num_get_do_get_int64(this, ret, first, last, base,
5063 state, pval, numpunct_short_use_facet(base->loc));
5066 /* ?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 */
5067 /* ?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 */
5068 /* ?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 */
5069 /* ?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 */
5070 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_int64,36)
5071 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_int64(const num_get *this, istreambuf_iterator_wchar *ret,
5072 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONGLONG *pval)
5074 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5075 return call_num_get_wchar_do_get_int64(this, ret, first, last, base, state, pval);
5078 static istreambuf_iterator_wchar* num_get_do_get_ulong(const num_get *this,
5079 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5080 istreambuf_iterator_wchar last, ios_base *base, int *state,
5081 ULONG *pval, numpunct_wchar *numpunct)
5087 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5089 v = _Stoulx(tmp, &end, num_get__Getifld(this, tmp, &first,
5090 &last, base->fmtfl, base->loc, numpunct), &err);
5091 if(end!=tmp && !err)
5094 *state |= IOSTATE_failbit;
5097 *state |= IOSTATE_eofbit;
5103 /* ?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 */
5104 /* ?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 */
5105 #define call_num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_wchar*, \
5106 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, ULONG*), \
5107 (this, ret, first, last, base, state, pval))
5108 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_ulong,36)
5109 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_ulong(const num_get *this, istreambuf_iterator_wchar *ret,
5110 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONG *pval)
5112 return num_get_do_get_ulong(this, ret, first, last, base,
5113 state, pval, numpunct_wchar_use_facet(base->loc));
5116 /* ?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 */
5117 /* ?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 */
5118 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_ulong,36)
5119 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_ulong(const num_get *this, istreambuf_iterator_wchar *ret,
5120 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONG *pval)
5122 return num_get_do_get_ulong(this, ret, first, last, base,
5123 state, pval, numpunct_short_use_facet(base->loc));
5126 /* ?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 */
5127 /* ?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 */
5128 /* ?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 */
5129 /* ?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 */
5130 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_ulong,36)
5131 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_ulong(const num_get *this, istreambuf_iterator_wchar *ret,
5132 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, ULONG *pval)
5134 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5135 return call_num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval);
5138 static istreambuf_iterator_wchar* num_get_do_get_long(const num_get *this,
5139 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5140 istreambuf_iterator_wchar last, ios_base *base, int *state,
5141 LONG *pval, numpunct_wchar *numpunct)
5147 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5149 v = _Stolx(tmp, &end, num_get__Getifld(this, tmp, &first,
5150 &last, base->fmtfl, base->loc, numpunct), &err);
5151 if(end!=tmp && !err)
5154 *state |= IOSTATE_failbit;
5157 *state |= IOSTATE_eofbit;
5163 /* ?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 */
5164 /* ?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 */
5165 #define call_num_get_wchar_do_get_long(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_wchar*, \
5166 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, LONG*), \
5167 (this, ret, first, last, base, state, pval))
5168 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_long,36)
5169 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_long(const num_get *this, istreambuf_iterator_wchar *ret,
5170 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONG *pval)
5172 return num_get_do_get_long(this, ret, first, last, base,
5173 state, pval, numpunct_wchar_use_facet(base->loc));
5176 /* ?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 */
5177 /* ?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 */
5178 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_long,36)
5179 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_long(const num_get *this, istreambuf_iterator_wchar *ret,
5180 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONG *pval)
5182 return num_get_do_get_long(this, ret, first, last, base,
5183 state, pval, numpunct_short_use_facet(base->loc));
5186 /* ?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 */
5187 /* ?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 */
5188 /* ?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 */
5189 /* ?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 */
5190 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_long,36)
5191 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_long(const num_get *this, istreambuf_iterator_wchar *ret,
5192 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, LONG *pval)
5194 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5195 return call_num_get_wchar_do_get_long(this, ret, first, last, base, state, pval);
5198 /* ?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 */
5199 /* ?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 */
5200 #define call_num_get_wchar_do_get_uint(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 36, istreambuf_iterator_wchar*, \
5201 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, unsigned int*), \
5202 (this, ret, first, last, base, state, pval))
5203 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_uint,36)
5204 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_uint(const num_get *this, istreambuf_iterator_wchar *ret,
5205 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned int *pval)
5207 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5208 return num_get_wchar_do_get_ulong(this, ret, first, last, base, state, pval);
5211 /* ?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 */
5212 /* ?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 */
5213 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_uint,36)
5214 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_uint(const num_get *this, istreambuf_iterator_wchar *ret,
5215 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned int *pval)
5217 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5218 return num_get_short_do_get_ulong(this, ret, first, last, base, state, pval);
5221 /* ?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 */
5222 /* ?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 */
5223 /* ?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 */
5224 /* ?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 */
5225 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_uint,36)
5226 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_uint(const num_get *this, istreambuf_iterator_wchar *ret,
5227 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned int *pval)
5229 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5230 return call_num_get_wchar_do_get_uint(this, ret, first, last, base, state, pval);
5233 /* ?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 */
5234 /* ?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 */
5235 #define call_num_get_wchar_do_get_ushort(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 40, istreambuf_iterator_wchar*, \
5236 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, unsigned short*), \
5237 (this, ret, first, last, base, state, pval))
5238 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_ushort,36)
5239 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_ushort(const num_get *this, istreambuf_iterator_wchar *ret,
5240 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned short *pval)
5243 char tmp[25], *beg, *end;
5246 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5248 b = num_get_wchar__Getifld(this, tmp,
5249 &first, &last, base->fmtfl, base->loc);
5250 beg = tmp + (tmp[0]=='-' ? 1 : 0);
5251 v = _Stoulx(beg, &end, b, &err);
5253 if(v != (ULONG)((unsigned short)v))
5254 *state |= IOSTATE_failbit;
5255 else if(end!=beg && !err)
5256 *pval = (tmp[0]=='-' ? -((unsigned short)v) : v);
5258 *state |= IOSTATE_failbit;
5261 *state |= IOSTATE_eofbit;
5267 /* ?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 */
5268 /* ?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 */
5269 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_ushort,36)
5270 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_ushort(const num_get *this, istreambuf_iterator_wchar *ret,
5271 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned short *pval)
5273 FIXME("(%p %p %p %p %p) stub\n", this, ret, base, state, pval);
5277 /* ?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 */
5278 /* ?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 */
5279 /* ?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@ */
5280 /* ?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 */
5281 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_ushort,36)
5282 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_ushort(const num_get *this, istreambuf_iterator_wchar *ret,
5283 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, unsigned short *pval)
5285 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5286 return call_num_get_wchar_do_get_ushort(this, ret, first, last, base, state, pval);
5289 static istreambuf_iterator_wchar* num_get_do_get_bool(const num_get *this,
5290 istreambuf_iterator_wchar *ret, istreambuf_iterator_wchar first,
5291 istreambuf_iterator_wchar last, ios_base *base, int *state,
5292 MSVCP_bool *pval, numpunct_wchar *numpunct)
5294 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5296 if(base->fmtfl & FMTFLAG_boolalpha) {
5297 basic_string_wchar false_bstr, true_bstr;
5298 const wchar_t *pfalse, *ptrue;
5300 numpunct_wchar_falsename(numpunct, &false_bstr);
5301 numpunct_wchar_truename(numpunct, &true_bstr);
5302 pfalse = MSVCP_basic_string_wchar_c_str(&false_bstr);
5303 ptrue = MSVCP_basic_string_wchar_c_str(&true_bstr);
5305 for(istreambuf_iterator_wchar_val(&first); first.strbuf;
5306 istreambuf_iterator_wchar_inc(&first)) {
5307 if(pfalse && *pfalse && first.val!=*pfalse)
5309 if(ptrue && *ptrue && first.val!=*ptrue)
5312 if(pfalse && *pfalse && ptrue && !*ptrue)
5314 if(ptrue && *ptrue && pfalse && !*pfalse)
5322 if((!pfalse || !*pfalse) && (!ptrue || !*ptrue))
5331 *state |= IOSTATE_failbit;
5333 MSVCP_basic_string_wchar_dtor(&false_bstr);
5334 MSVCP_basic_string_wchar_dtor(&true_bstr);
5338 LONG v = _Stolx(tmp, &end, num_get__Getifld(this, tmp, &first,
5339 &last, base->fmtfl, base->loc, numpunct), &err);
5341 if(end!=tmp && err==0 && (v==0 || v==1))
5344 *state |= IOSTATE_failbit;
5348 *state |= IOSTATE_eofbit;
5349 memcpy(ret, &first, sizeof(first));
5353 /* ?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 */
5354 /* ?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 */
5355 #define call_num_get_wchar_do_get_bool(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 44, istreambuf_iterator_wchar*, \
5356 (const num_get*, istreambuf_iterator_wchar*, istreambuf_iterator_wchar, istreambuf_iterator_wchar, ios_base*, int*, MSVCP_bool*), \
5357 (this, ret, first, last, base, state, pval))
5358 DEFINE_THISCALL_WRAPPER(num_get_wchar_do_get_bool,36)
5359 istreambuf_iterator_wchar *__thiscall num_get_wchar_do_get_bool(const num_get *this, istreambuf_iterator_wchar *ret,
5360 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, MSVCP_bool *pval)
5362 return num_get_do_get_bool(this, ret, first, last, base,
5363 state, pval, numpunct_wchar_use_facet(base->loc));
5366 /* ?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 */
5367 /* ?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 */
5368 DEFINE_THISCALL_WRAPPER(num_get_short_do_get_bool,36)
5369 istreambuf_iterator_wchar *__thiscall num_get_short_do_get_bool(const num_get *this, istreambuf_iterator_wchar *ret,
5370 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, MSVCP_bool *pval)
5372 return num_get_do_get_bool(this, ret, first, last, base,
5373 state, pval, numpunct_short_use_facet(base->loc));
5376 /* ?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 */
5377 /* ?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 */
5378 /* ?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 */
5379 /* ?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 */
5380 DEFINE_THISCALL_WRAPPER(num_get_wchar_get_bool,36)
5381 istreambuf_iterator_wchar *__thiscall num_get_wchar_get_bool(const num_get *this, istreambuf_iterator_wchar *ret,
5382 istreambuf_iterator_wchar first, istreambuf_iterator_wchar last, ios_base *base, int *state, MSVCP_bool *pval)
5384 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5385 return call_num_get_wchar_do_get_bool(this, ret, first, last, base, state, pval);
5388 /* ?id@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A */
5389 locale_id num_get_char_id = {0};
5391 /* ??_7?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@6B@ */
5392 extern const vtable_ptr MSVCP_num_get_char_vtable;
5394 /* ?_Init@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
5395 /* ?_Init@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
5396 DEFINE_THISCALL_WRAPPER(num_get_char__Init, 8)
5397 void __thiscall num_get_char__Init(num_get *this, const _Locinfo *locinfo)
5399 TRACE("(%p %p)\n", this, locinfo);
5400 _Locinfo__Getcvt(locinfo, &this->cvt);
5403 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
5404 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
5405 DEFINE_THISCALL_WRAPPER(num_get_char_ctor_locinfo, 12)
5406 num_get* __thiscall num_get_char_ctor_locinfo(num_get *this,
5407 const _Locinfo *locinfo, MSVCP_size_t refs)
5409 TRACE("(%p %p %lu)\n", this, locinfo, refs);
5411 locale_facet_ctor_refs(&this->facet, refs);
5412 this->facet.vtable = &MSVCP_num_get_char_vtable;
5414 num_get_char__Init(this, locinfo);
5418 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */
5419 /* ??0?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */
5420 DEFINE_THISCALL_WRAPPER(num_get_char_ctor_refs, 8)
5421 num_get* __thiscall num_get_char_ctor_refs(num_get *this, MSVCP_size_t refs)
5425 TRACE("(%p %lu)\n", this, refs);
5427 _Locinfo_ctor(&locinfo);
5428 num_get_char_ctor_locinfo(this, &locinfo, refs);
5429 _Locinfo_dtor(&locinfo);
5433 /* ??_F?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */
5434 /* ??_F?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAAXXZ */
5435 DEFINE_THISCALL_WRAPPER(num_get_char_ctor, 4)
5436 num_get* __thiscall num_get_char_ctor(num_get *this)
5438 return num_get_char_ctor_refs(this, 0);
5441 /* ??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */
5442 /* ??1?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEAA@XZ */
5443 DEFINE_THISCALL_WRAPPER(num_get_char_dtor, 4)
5444 void __thiscall num_get_char_dtor(num_get *this)
5446 TRACE("(%p)\n", this);
5447 locale_facet_dtor(&this->facet);
5450 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_char_vector_dtor, 8)
5451 num_get* __thiscall MSVCP_num_get_char_vector_dtor(num_get *this, unsigned int flags)
5453 TRACE("(%p %x)\n", this, flags);
5455 /* we have an array, with the number of elements stored before the first object */
5456 int i, *ptr = (int *)this-1;
5458 for(i=*ptr-1; i>=0; i--)
5459 num_get_char_dtor(this+i);
5460 MSVCRT_operator_delete(ptr);
5462 num_get_char_dtor(this);
5464 MSVCRT_operator_delete(this);
5470 /* ?_Getcat@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
5471 /* ?_Getcat@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
5472 MSVCP_size_t __cdecl num_get_char__Getcat(const locale_facet **facet, const locale *loc)
5474 TRACE("(%p %p)\n", facet, loc);
5476 if(facet && !*facet) {
5479 *facet = MSVCRT_operator_new(sizeof(num_get));
5481 ERR("Out of memory\n");
5482 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
5486 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
5487 num_get_char_ctor_locinfo((num_get*)*facet, &locinfo, 0);
5488 _Locinfo_dtor(&locinfo);
5494 num_get* num_get_char_use_facet(const locale *loc)
5496 static num_get *obj = NULL;
5499 const locale_facet *fac;
5501 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
5502 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_get_char_id));
5504 _Lockit_dtor(&lock);
5505 return (num_get*)fac;
5509 _Lockit_dtor(&lock);
5513 num_get_char__Getcat(&fac, loc);
5514 obj = (num_get*)fac;
5515 locale_facet__Incref(&obj->facet);
5516 locale_facet_register(&obj->facet);
5517 _Lockit_dtor(&lock);
5522 /* ?_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 */
5523 /* ?_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 */
5524 /* Copies number to dest buffer, validates grouping and skips separators.
5525 * Updates first so it points past the number, all digits are skipped.
5526 * Returns how exponent needs to changed.
5527 * Size of dest buffer is not specified, assuming it's not smaller then 32:
5528 * strlen(+0.e+) + 22(digits) + 4(expontent) + 1(nullbyte)
5530 int __cdecl num_get_char__Getffld(const num_get *this, char *dest, istreambuf_iterator_char *first,
5531 istreambuf_iterator_char *last, const locale *loc)
5533 numpunct_char *numpunct = numpunct_char_use_facet(loc);
5534 basic_string_char grouping_bstr;
5535 int groups_no = 0, cur_group = 0, exp = 0;
5536 char *dest_beg = dest, *num_end = dest+25, *exp_end = dest+31, *groups = NULL, sep;
5537 const char *grouping;
5538 BOOL error = TRUE, dest_empty = TRUE;
5540 TRACE("(%p %p %p %p)\n", dest, first, last, loc);
5542 numpunct_char_grouping(numpunct, &grouping_bstr);
5543 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
5544 sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
5546 istreambuf_iterator_char_val(first);
5547 if(first->strbuf && (first->val=='-' || first->val=='+')) {
5548 *dest++ = first->val;
5549 istreambuf_iterator_char_inc(first);
5553 groups_no = strlen(grouping)+2;
5554 groups = calloc(groups_no, sizeof(char));
5557 for(; first->strbuf; istreambuf_iterator_char_inc(first)) {
5558 if(first->val<'0' || first->val>'9') {
5559 if(sep && first->val==sep) {
5560 if(cur_group == groups_no+1) {
5561 if(groups[1] != groups[2]) {
5565 memmove(groups+1, groups+2, groups_no);
5566 groups[cur_group] = 0;
5576 if(dest_empty && first->val == '0')
5580 *dest++ = first->val;
5583 if(sep && groups[cur_group]<CHAR_MAX)
5584 groups[cur_group]++;
5588 if(cur_group && !groups[cur_group])
5593 for(; cur_group>=0 && !error; cur_group--) {
5594 if(*grouping == CHAR_MAX) {
5598 }else if((cur_group && *grouping!=groups[cur_group])
5599 || (!cur_group && *grouping<groups[cur_group])) {
5602 }else if(grouping[1]) {
5606 MSVCP_basic_string_char_dtor(&grouping_bstr);
5612 }else if(dest_empty) {
5616 if(first->strbuf && first->val==numpunct_char_decimal_point(numpunct)) {
5618 *dest++ = *localeconv()->decimal_point;
5619 istreambuf_iterator_char_inc(first);
5622 for(; first->strbuf && first->val=='0'; istreambuf_iterator_char_inc(first))
5625 if(!first->strbuf || first->val<'1' || first->val>'9')
5630 for(; first->strbuf; istreambuf_iterator_char_inc(first)) {
5631 if(first->val<'0' || first->val>'9')
5633 else if(dest<num_end)
5634 *dest++ = first->val;
5637 if(first->strbuf && (first->val=='e' || first->val=='E')) {
5638 *dest++ = first->val;
5639 istreambuf_iterator_char_inc(first);
5641 if(first->strbuf && (first->val=='-' || first->val=='+')) {
5642 *dest++ = first->val;
5643 istreambuf_iterator_char_inc(first);
5646 error = dest_empty = TRUE;
5647 for(; first->strbuf && first->val=='0'; istreambuf_iterator_char_inc(first))
5650 for(; first->strbuf && first->val>='0' && first->val<='9'; istreambuf_iterator_char_inc(first)) {
5651 error = dest_empty = FALSE;
5653 *dest++ = first->val;
5659 }else if(dest_empty) {
5668 /* ?_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 */
5669 /* ?_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 */
5670 int __cdecl num_get_char__Getffldx(const num_get *this, char *dest, istreambuf_iterator_char *first,
5671 istreambuf_iterator_char *last, ios_base *ios, int *phexexp)
5673 FIXME("(%p %p %p %p %p) stub\n", dest, first, last, ios, phexexp);
5677 /* ?_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 */
5678 /* ?_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 */
5679 /* Copies number to dest buffer, validates grouping and skips separators.
5680 * Updates first so it points past the number, all digits are skipped.
5681 * Returns number base (8, 10 or 16).
5682 * Size of dest buffer is not specified, assuming it's not smaller then 25:
5683 * 22(8^22>2^64)+1(detect overflows)+1(sign)+1(nullbyte) = 25
5685 int __cdecl num_get_char__Getifld(const num_get *this, char *dest, istreambuf_iterator_char *first,
5686 istreambuf_iterator_char *last, int fmtflags, const locale *loc)
5688 static const char digits[] = "0123456789abcdefABCDEF";
5690 numpunct_char *numpunct = numpunct_char_use_facet(loc);
5691 basic_string_char grouping_bstr;
5692 int basefield, base, groups_no = 0, cur_group = 0;
5693 char *dest_beg = dest, *dest_end = dest+24, *groups = NULL, sep;
5694 const char *grouping;
5695 BOOL error = TRUE, dest_empty = TRUE;
5697 TRACE("(%p %p %p %04x %p)\n", dest, first, last, fmtflags, loc);
5699 numpunct_char_grouping(numpunct, &grouping_bstr);
5700 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
5701 sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
5703 basefield = fmtflags & FMTFLAG_basefield;
5704 if(basefield == FMTFLAG_oct)
5706 else if(basefield == FMTFLAG_hex)
5707 base = 22; /* equal to the size of digits buffer */
5713 istreambuf_iterator_char_val(first);
5714 if(first->strbuf && (first->val=='-' || first->val=='+')) {
5715 *dest++ = first->val;
5716 istreambuf_iterator_char_inc(first);
5719 if(!base && first->strbuf && first->val=='0') {
5720 istreambuf_iterator_char_inc(first);
5721 if(first->strbuf && (first->val=='x' || first->val=='X')) {
5722 istreambuf_iterator_char_inc(first);
5733 groups_no = strlen(grouping)+2;
5734 groups = calloc(groups_no, sizeof(char));
5737 for(; first->strbuf; istreambuf_iterator_char_inc(first)) {
5738 if(!memchr(digits, first->val, base)) {
5739 if(sep && first->val==sep) {
5740 if(cur_group == groups_no+1) {
5741 if(groups[1] != groups[2]) {
5745 memmove(groups+1, groups+2, groups_no);
5746 groups[cur_group] = 0;
5756 if(dest_empty && first->val == '0')
5759 /* skip digits that can't be copied to dest buffer, other
5760 * functions are responsible for detecting overflows */
5762 *dest++ = first->val;
5763 if(sep && groups[cur_group]<CHAR_MAX)
5764 groups[cur_group]++;
5768 if(cur_group && !groups[cur_group])
5773 for(; cur_group>=0 && !error; cur_group--) {
5774 if(*grouping == CHAR_MAX) {
5778 }else if((cur_group && *grouping!=groups[cur_group])
5779 || (!cur_group && *grouping<groups[cur_group])) {
5782 }else if(grouping[1]) {
5786 MSVCP_basic_string_char_dtor(&grouping_bstr);
5795 return (base==22 ? 16 : base);
5798 /* ?_Hexdig@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABEHD000@Z */
5799 /* ?_Hexdig@?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAHD000@Z */
5800 DEFINE_THISCALL_WRAPPER(MSVCP_num_get_char__Hexdig, 20)
5801 int __thiscall MSVCP_num_get_char__Hexdig(num_get *this, char dig, char e0, char al, char au)
5803 FIXME("(%p %c %c %c %c) stub\n", this, dig, e0, al, au);
5807 /* ?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 */
5808 /* ?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 */
5809 #define call_num_get_char_do_get_void(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 4, istreambuf_iterator_char*, \
5810 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, void**), \
5811 (this, ret, first, last, base, state, pval))
5812 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_void,36)
5813 istreambuf_iterator_char *__thiscall num_get_char_do_get_void(const num_get *this, istreambuf_iterator_char *ret,
5814 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, void **pval)
5820 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5822 v = _Stoullx(tmp, &end, num_get_char__Getifld(this, tmp,
5823 &first, &last, FMTFLAG_hex, base->loc), &err);
5824 if(v!=(unsigned __int64)((INT_PTR)v))
5825 *state |= IOSTATE_failbit;
5826 else if(end!=tmp && !err)
5827 *pval = (void*)((INT_PTR)v);
5829 *state |= IOSTATE_failbit;
5832 *state |= IOSTATE_eofbit;
5838 /* ?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 */
5839 /* ?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 */
5840 DEFINE_THISCALL_WRAPPER(num_get_char_get_void,36)
5841 istreambuf_iterator_char *__thiscall num_get_char_get_void(const num_get *this, istreambuf_iterator_char *ret,
5842 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, void **pval)
5844 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5845 return call_num_get_char_do_get_void(this, ret, first, last, base, state, pval);
5848 /* ?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 */
5849 /* ?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 */
5850 /* ?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 */
5851 /* ?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 */
5852 #define call_num_get_char_do_get_ldouble(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 8, istreambuf_iterator_char*, \
5853 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, double*), \
5854 (this, ret, first, last, base, state, pval))
5855 #define call_num_get_char_do_get_double(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 12, istreambuf_iterator_char*, \
5856 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, double*), \
5857 (this, ret, first, last, base, state, pval))
5858 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_double,36)
5859 istreambuf_iterator_char *__thiscall num_get_char_do_get_double(const num_get *this, istreambuf_iterator_char *ret,
5860 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, double *pval)
5866 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5868 v = _Stodx(tmp, &end, num_get_char__Getffld(this, tmp, &first, &last, base->loc), &err);
5869 if(end!=tmp && !err)
5872 *state |= IOSTATE_failbit;
5875 *state |= IOSTATE_eofbit;
5881 /* ?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 */
5882 /* ?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 */
5883 DEFINE_THISCALL_WRAPPER(num_get_char_get_ldouble,36)
5884 istreambuf_iterator_char *__thiscall num_get_char_get_ldouble(const num_get *this, istreambuf_iterator_char *ret,
5885 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, double *pval)
5887 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5888 return call_num_get_char_do_get_ldouble(this, ret, first, last, base, state, pval);
5891 /* ?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 */
5892 /* ?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 */
5893 DEFINE_THISCALL_WRAPPER(num_get_char_get_double,36)
5894 istreambuf_iterator_char *__thiscall num_get_char_get_double(const num_get *this, istreambuf_iterator_char *ret,
5895 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, double *pval)
5897 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5898 return call_num_get_char_do_get_double(this, ret, first, last, base, state, pval);
5901 /* ?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 */
5902 /* ?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 */
5903 #define call_num_get_char_do_get_float(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 16, istreambuf_iterator_char*, \
5904 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, float*), \
5905 (this, ret, first, last, base, state, pval))
5906 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_float,36)
5907 istreambuf_iterator_char *__thiscall num_get_char_do_get_float(const num_get *this, istreambuf_iterator_char *ret,
5908 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, float *pval)
5914 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5916 v = _Stofx(tmp, &end, num_get_char__Getffld(this, tmp, &first, &last, base->loc), &err);
5917 if(end!=tmp && !err)
5920 *state |= IOSTATE_failbit;
5923 *state |= IOSTATE_eofbit;
5929 /* ?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 */
5930 /* ?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 */
5931 DEFINE_THISCALL_WRAPPER(num_get_char_get_float,36)
5932 istreambuf_iterator_char *__thiscall num_get_char_get_float(const num_get *this, istreambuf_iterator_char *ret,
5933 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, float *pval)
5935 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5936 return call_num_get_char_do_get_float(this, ret, first, last, base, state, pval);
5939 /* ?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 */
5940 /* ?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 */
5941 #define call_num_get_char_do_get_uint64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 20, istreambuf_iterator_char*, \
5942 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, ULONGLONG*), \
5943 (this, ret, first, last, base, state, pval))
5944 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_uint64,36)
5945 istreambuf_iterator_char *__thiscall num_get_char_do_get_uint64(const num_get *this, istreambuf_iterator_char *ret,
5946 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONGLONG *pval)
5952 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5954 v = _Stoullx(tmp, &end, num_get_char__Getifld(this, tmp,
5955 &first, &last, base->fmtfl, base->loc), &err);
5956 if(end!=tmp && !err)
5959 *state |= IOSTATE_failbit;
5962 *state |= IOSTATE_eofbit;
5968 /* ?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 */
5969 /* ?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 */
5970 DEFINE_THISCALL_WRAPPER(num_get_char_get_uint64,36)
5971 istreambuf_iterator_char *__thiscall num_get_char_get_uint64(const num_get *this, istreambuf_iterator_char *ret,
5972 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONGLONG *pval)
5974 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5975 return call_num_get_char_do_get_uint64(this, ret, first, last, base, state, pval);
5978 /* ?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 */
5979 /* ?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 */
5980 #define call_num_get_char_do_get_int64(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 24, istreambuf_iterator_char*, \
5981 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, LONGLONG*), \
5982 (this, ret, first, last, base, state, pval))
5983 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_int64,36)
5984 istreambuf_iterator_char *__thiscall num_get_char_do_get_int64(const num_get *this, istreambuf_iterator_char *ret,
5985 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONGLONG *pval)
5991 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
5993 v = _Stollx(tmp, &end, num_get_char__Getifld(this, tmp,
5994 &first, &last, base->fmtfl, base->loc), &err);
5995 if(end!=tmp && !err)
5998 *state |= IOSTATE_failbit;
6001 *state |= IOSTATE_eofbit;
6007 /* ?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 */
6008 /* ?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 */
6009 DEFINE_THISCALL_WRAPPER(num_get_char_get_int64,36)
6010 istreambuf_iterator_char *__thiscall num_get_char_get_int64(const num_get *this, istreambuf_iterator_char *ret,
6011 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONGLONG *pval)
6013 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6014 return call_num_get_char_do_get_int64(this, ret, first, last, base, state, pval);
6017 /* ?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 */
6018 /* ?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 */
6019 #define call_num_get_char_do_get_ulong(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 28, istreambuf_iterator_char*, \
6020 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, ULONG*), \
6021 (this, ret, first, last, base, state, pval))
6022 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_ulong,36)
6023 istreambuf_iterator_char *__thiscall num_get_char_do_get_ulong(const num_get *this, istreambuf_iterator_char *ret,
6024 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONG *pval)
6030 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6032 v = _Stoulx(tmp, &end, num_get_char__Getifld(this, tmp,
6033 &first, &last, base->fmtfl, base->loc), &err);
6034 if(end!=tmp && !err)
6037 *state |= IOSTATE_failbit;
6040 *state |= IOSTATE_eofbit;
6046 /* ?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 */
6047 /* ?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 */
6048 DEFINE_THISCALL_WRAPPER(num_get_char_get_ulong,36)
6049 istreambuf_iterator_char *__thiscall num_get_char_get_ulong(const num_get *this, istreambuf_iterator_char *ret,
6050 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, ULONG *pval)
6052 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6053 return call_num_get_char_do_get_ulong(this, ret, first, last, base, state, pval);
6056 /* ?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 */
6057 /* ?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 */
6058 #define call_num_get_char_do_get_long(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 32, istreambuf_iterator_char*, \
6059 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, LONG*), \
6060 (this, ret, first, last, base, state, pval))
6061 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_long,36)
6062 istreambuf_iterator_char *__thiscall num_get_char_do_get_long(const num_get *this, istreambuf_iterator_char *ret,
6063 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONG *pval)
6069 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6071 v = _Stolx(tmp, &end, num_get_char__Getifld(this, tmp,
6072 &first, &last, base->fmtfl, base->loc), &err);
6073 if(end!=tmp && !err)
6076 *state |= IOSTATE_failbit;
6079 *state |= IOSTATE_eofbit;
6085 /* ?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 */
6086 /* ?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 */
6087 DEFINE_THISCALL_WRAPPER(num_get_char_get_long,36)
6088 istreambuf_iterator_char *__thiscall num_get_char_get_long(const num_get *this, istreambuf_iterator_char *ret,
6089 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, LONG *pval)
6091 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6092 return call_num_get_char_do_get_long(this, ret, first, last, base, state, pval);
6095 /* ?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 */
6096 /* ?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 */
6097 #define call_num_get_char_do_get_uint(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 36, istreambuf_iterator_char*, \
6098 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, unsigned int*), \
6099 (this, ret, first, last, base, state, pval))
6100 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_uint,36)
6101 istreambuf_iterator_char *__thiscall num_get_char_do_get_uint(const num_get *this, istreambuf_iterator_char *ret,
6102 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned int *pval)
6104 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6105 return num_get_char_do_get_ulong(this, ret, first, last, base, state, pval);
6108 /* ?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 */
6109 /* ?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 */
6110 DEFINE_THISCALL_WRAPPER(num_get_char_get_uint,36)
6111 istreambuf_iterator_char *__thiscall num_get_char_get_uint(const num_get *this, istreambuf_iterator_char *ret,
6112 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned int *pval)
6114 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6115 return call_num_get_char_do_get_uint(this, ret, first, last, base, state, pval);
6118 /* ?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 */
6119 /* ?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 */
6120 #define call_num_get_char_do_get_ushort(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 40, istreambuf_iterator_char*, \
6121 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, unsigned short*), \
6122 (this, ret, first, last, base, state, pval))
6123 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_ushort,36)
6124 istreambuf_iterator_char *__thiscall num_get_char_do_get_ushort(const num_get *this, istreambuf_iterator_char *ret,
6125 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned short *pval)
6128 char tmp[25], *beg, *end;
6131 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6133 b = num_get_char__Getifld(this, tmp,
6134 &first, &last, base->fmtfl, base->loc);
6135 beg = tmp + (tmp[0]=='-' ? 1 : 0);
6136 v = _Stoulx(beg, &end, b, &err);
6138 if(v != (ULONG)((unsigned short)v))
6139 *state |= IOSTATE_failbit;
6140 else if(end!=beg && !err)
6141 *pval = (tmp[0]=='-' ? -((unsigned short)v) : v);
6143 *state |= IOSTATE_failbit;
6146 *state |= IOSTATE_eofbit;
6152 /* ?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 */
6153 /* ?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 */
6154 DEFINE_THISCALL_WRAPPER(num_get_char_get_ushort,36)
6155 istreambuf_iterator_char *__thiscall num_get_char_get_ushort(const num_get *this, istreambuf_iterator_char *ret,
6156 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, unsigned short *pval)
6158 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6159 return call_num_get_char_do_get_ushort(this, ret, first, last, base, state, pval);
6162 /* ?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 */
6163 /* ?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 */
6164 #define call_num_get_char_do_get_bool(this, ret, first, last, base, state, pval) CALL_VTBL_FUNC(this, 44, istreambuf_iterator_char*, \
6165 (const num_get*, istreambuf_iterator_char*, istreambuf_iterator_char, istreambuf_iterator_char, ios_base*, int*, MSVCP_bool*), \
6166 (this, ret, first, last, base, state, pval))
6167 DEFINE_THISCALL_WRAPPER(num_get_char_do_get_bool,36)
6168 istreambuf_iterator_char *__thiscall num_get_char_do_get_bool(const num_get *this, istreambuf_iterator_char *ret,
6169 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, MSVCP_bool *pval)
6171 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6173 if(base->fmtfl & FMTFLAG_boolalpha) {
6174 numpunct_char *numpunct = numpunct_char_use_facet(base->loc);
6175 basic_string_char false_bstr, true_bstr;
6176 const char *pfalse, *ptrue;
6178 numpunct_char_falsename(numpunct, &false_bstr);
6179 numpunct_char_truename(numpunct, &true_bstr);
6180 pfalse = MSVCP_basic_string_char_c_str(&false_bstr);
6181 ptrue = MSVCP_basic_string_char_c_str(&true_bstr);
6183 for(istreambuf_iterator_char_val(&first); first.strbuf;
6184 istreambuf_iterator_char_inc(&first)) {
6185 if(pfalse && *pfalse && first.val!=*pfalse)
6187 if(ptrue && *ptrue && first.val!=*ptrue)
6190 if(pfalse && *pfalse && ptrue && !*ptrue)
6192 if(ptrue && *ptrue && pfalse && !*pfalse)
6200 if((!pfalse || !*pfalse) && (!ptrue || !*ptrue))
6209 *state |= IOSTATE_failbit;
6211 MSVCP_basic_string_char_dtor(&false_bstr);
6212 MSVCP_basic_string_char_dtor(&true_bstr);
6216 LONG v = _Stolx(tmp, &end, num_get_char__Getifld(this, tmp,
6217 &first, &last, base->fmtfl, base->loc), &err);
6219 if(end!=tmp && err==0 && (v==0 || v==1))
6222 *state |= IOSTATE_failbit;
6226 *state |= IOSTATE_eofbit;
6227 memcpy(ret, &first, sizeof(first));
6231 /* ?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 */
6232 /* ?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 */
6233 DEFINE_THISCALL_WRAPPER(num_get_char_get_bool,36)
6234 istreambuf_iterator_char *__thiscall num_get_char_get_bool(const num_get *this, istreambuf_iterator_char *ret,
6235 istreambuf_iterator_char first, istreambuf_iterator_char last, ios_base *base, int *state, MSVCP_bool *pval)
6237 TRACE("(%p %p %p %p %p)\n", this, ret, base, state, pval);
6238 return call_num_get_char_do_get_bool(this, ret, first, last, base, state, pval);
6241 /* ?id@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A */
6242 locale_id num_put_char_id = {0};
6244 /* num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@6B@ */
6245 extern const vtable_ptr MSVCP_num_put_char_vtable;
6247 /* ?_Init@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
6248 /* ?_Init@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
6249 DEFINE_THISCALL_WRAPPER(num_put_char__Init, 8)
6250 void __thiscall num_put_char__Init(num_put *this, const _Locinfo *locinfo)
6252 TRACE("(%p %p)\n", this, locinfo);
6253 _Locinfo__Getcvt(locinfo, &this->cvt);
6256 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
6257 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
6258 DEFINE_THISCALL_WRAPPER(num_put_char_ctor_locinfo, 12)
6259 num_put* __thiscall num_put_char_ctor_locinfo(num_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
6261 TRACE("(%p %p %ld)\n", this, locinfo, refs);
6263 locale_facet_ctor_refs(&this->facet, refs);
6264 this->facet.vtable = &MSVCP_num_put_char_vtable;
6266 num_put_char__Init(this, locinfo);
6270 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAE@I@Z */
6271 /* ??0?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAA@_K@Z */
6272 DEFINE_THISCALL_WRAPPER(num_put_char_ctor_refs, 8)
6273 num_put* __thiscall num_put_char_ctor_refs(num_put *this, MSVCP_size_t refs)
6277 TRACE("(%p %lu)\n", this, refs);
6279 _Locinfo_ctor(&locinfo);
6280 num_put_char_ctor_locinfo(this, &locinfo, refs);
6281 _Locinfo_dtor(&locinfo);
6285 /* ??_F?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QAEXXZ */
6286 /* ??_F?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@QEAAXXZ */
6287 DEFINE_THISCALL_WRAPPER(num_put_char_ctor, 4)
6288 num_put* __thiscall num_put_char_ctor(num_put *this)
6290 return num_put_char_ctor_refs(this, 0);
6293 /* ??1?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MAE@XZ */
6294 /* ??1?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@MEAA@XZ */
6295 DEFINE_THISCALL_WRAPPER(num_put_char_dtor, 4)
6296 void __thiscall num_put_char_dtor(num_put *this)
6298 TRACE("(%p)\n", this);
6299 locale_facet_dtor(&this->facet);
6302 DEFINE_THISCALL_WRAPPER(MSVCP_num_put_char_vector_dtor, 8)
6303 num_put* __thiscall MSVCP_num_put_char_vector_dtor(num_put *this, unsigned int flags)
6305 TRACE("(%p %x)\n", this, flags);
6307 /* we have an array, with the number of elements stored before the first object */
6308 int i, *ptr = (int *)this-1;
6310 for(i=*ptr-1; i>=0; i--)
6311 num_put_char_dtor(this+i);
6312 MSVCRT_operator_delete(ptr);
6314 num_put_char_dtor(this);
6316 MSVCRT_operator_delete(this);
6322 /* ?_Getcat@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
6323 /* ?_Getcat@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
6324 unsigned int __cdecl num_put_char__Getcat(const locale_facet **facet, const locale *loc)
6326 TRACE("(%p %p)\n", facet, loc);
6328 if(facet && !*facet) {
6331 *facet = MSVCRT_operator_new(sizeof(num_put));
6333 ERR("Out of memory\n");
6334 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
6338 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
6339 num_put_char_ctor_locinfo((num_put*)*facet, &locinfo, 0);
6340 _Locinfo_dtor(&locinfo);
6346 num_put* num_put_char_use_facet(const locale *loc)
6348 static num_put *obj = NULL;
6351 const locale_facet *fac;
6353 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
6354 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_put_char_id));
6356 _Lockit_dtor(&lock);
6357 return (num_put*)fac;
6361 _Lockit_dtor(&lock);
6365 num_put_char__Getcat(&fac, loc);
6366 obj = (num_put*)fac;
6367 locale_facet__Incref(&obj->facet);
6368 locale_facet_register(&obj->facet);
6369 _Lockit_dtor(&lock);
6374 /* ?_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 */
6375 /* ?_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 */
6376 ostreambuf_iterator_char* __cdecl num_put_char__Put(const num_put *this, ostreambuf_iterator_char *ret,
6377 ostreambuf_iterator_char dest, const char *ptr, MSVCP_size_t count)
6379 TRACE("(%p %p %p %ld)\n", this, ret, ptr, count);
6381 for(; count>0; count--)
6382 ostreambuf_iterator_char_put(&dest, *ptr++);
6388 /* ?_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 */
6389 /* ?_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 */
6390 ostreambuf_iterator_char* __cdecl num_put_char__Putc(const num_put *this, ostreambuf_iterator_char *ret,
6391 ostreambuf_iterator_char dest, const char *ptr, MSVCP_size_t count)
6393 TRACE("(%p %p %p %ld)\n", this, ret, ptr, count);
6395 for(; count>0; count--)
6396 ostreambuf_iterator_char_put(&dest, *ptr++);
6402 /* ?_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 */
6403 /* ?_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 */
6404 ostreambuf_iterator_char* __cdecl num_put_char__Putgrouped(const num_put *this, ostreambuf_iterator_char *ret,
6405 ostreambuf_iterator_char dest, const char *ptr, MSVCP_size_t count, char delim)
6407 FIXME("(%p %p %p %ld %d) stub\n", this, ret, ptr, count, delim);
6411 /* ?_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 */
6412 /* ?_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 */
6413 ostreambuf_iterator_char* __cdecl num_put_char__Rep(const num_put *this, ostreambuf_iterator_char *ret,
6414 ostreambuf_iterator_char dest, char c, MSVCP_size_t count)
6416 TRACE("(%p %p %d %ld)\n", this, ret, c, count);
6418 for(; count>0; count--)
6419 ostreambuf_iterator_char_put(&dest, c);
6425 /* ?_Ffmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAPADPADDH@Z */
6426 /* ?_Ffmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAPEADPEADDH@Z */
6427 char* __cdecl num_put_char__Ffmt(const num_put *this, char *fmt, char spec, int fmtfl)
6429 int type = fmtfl & FMTFLAG_floatfield;
6432 TRACE("(%p %p %d %d)\n", this, fmt, spec, fmtfl);
6435 if(fmtfl & FMTFLAG_showpos)
6437 if(fmtfl & FMTFLAG_showbase)
6444 if(type == FMTFLAG_fixed)
6446 else if(type == FMTFLAG_scientific)
6447 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'E' : 'e';
6448 else if(type == (FMTFLAG_fixed|FMTFLAG_scientific))
6449 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'A' : 'a';
6451 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'G' : 'g';
6457 /* ?_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 */
6458 /* ?_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 */
6459 ostreambuf_iterator_char* __cdecl num_put_char__Fput(const num_put *this, ostreambuf_iterator_char *ret,
6460 ostreambuf_iterator_char dest, ios_base *base, char fill, const char *buf, MSVCP_size_t bef_point,
6461 MSVCP_size_t aft_point, MSVCP_size_t trailing, MSVCP_size_t count)
6463 FIXME("(%p %p %p %d %p %ld %ld %ld %ld) stub\n", this, ret, base,
6464 fill, buf, bef_point, aft_point, trailing, count);
6468 /* TODO: This function should be removed when num_put_char__Fput is implemented */
6469 static ostreambuf_iterator_char* num_put_char_fput(const num_put *this, ostreambuf_iterator_char *ret,
6470 ostreambuf_iterator_char dest, ios_base *base, char fill, char *buf, MSVCP_size_t count)
6472 numpunct_char *numpunct = numpunct_char_use_facet(base->loc);
6473 basic_string_char grouping_bstr;
6474 const char *grouping;
6475 char *p, sep = *localeconv()->decimal_point;
6476 int cur_group = 0, group_size = 0;
6477 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
6480 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
6482 /* Change decimal point */
6483 for(p=buf; p<buf+count; p++) {
6485 *p = numpunct_char_decimal_point(numpunct);
6491 /* Add separators to number */
6492 numpunct_char_grouping(numpunct, &grouping_bstr);
6493 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
6494 sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
6496 for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
6498 if(group_size == grouping[cur_group]) {
6500 if(grouping[cur_group+1])
6503 memmove(p+1, p, buf+count-p);
6508 MSVCP_basic_string_char_dtor(&grouping_bstr);
6510 /* Display number with padding */
6511 if(count >= base->wide)
6514 pad = base->wide-count;
6517 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
6518 num_put_char__Putc(this, &dest, dest, buf, 1);
6521 if(adjustfield != FMTFLAG_left) {
6522 num_put_char__Rep(this, ret, dest, fill, pad);
6525 num_put_char__Putc(this, &dest, dest, buf, count);
6526 return num_put_char__Rep(this, ret, dest, fill, pad);
6529 /* ?_Ifmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABAPADPADPBDH@Z */
6530 /* ?_Ifmt@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBAPEADPEADPEBDH@Z */
6531 char* __cdecl num_put_char__Ifmt(const num_put *this, char *fmt, const char *spec, int fmtfl)
6533 int base = fmtfl & FMTFLAG_basefield;
6536 TRACE("(%p %p %p %d)\n", this, fmt, spec, fmtfl);
6539 if(fmtfl & FMTFLAG_showpos)
6541 if(fmtfl & FMTFLAG_showbase)
6548 if(base == FMTFLAG_oct)
6550 else if(base == FMTFLAG_hex)
6551 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'X' : 'x';
6559 /* ?_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 */
6560 /* ?_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 */
6561 ostreambuf_iterator_char* __cdecl num_put_char__Iput(const num_put *this, ostreambuf_iterator_char *ret,
6562 ostreambuf_iterator_char dest, ios_base *base, char fill, char *buf, MSVCP_size_t count)
6564 numpunct_char *numpunct = numpunct_char_use_facet(base->loc);
6565 basic_string_char grouping_bstr;
6566 const char *grouping;
6568 int cur_group = 0, group_size = 0;
6569 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
6572 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
6574 /* Add separators to number */
6575 numpunct_char_grouping(numpunct, &grouping_bstr);
6576 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
6577 sep = grouping[0] ? numpunct_char_thousands_sep(numpunct) : '\0';
6579 for(p=buf+count-1; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
6581 if(group_size == grouping[cur_group]) {
6583 if(grouping[cur_group+1])
6586 memmove(p+1, p, buf+count-p);
6591 MSVCP_basic_string_char_dtor(&grouping_bstr);
6593 /* Display number with padding */
6594 if(count >= base->wide)
6597 pad = base->wide-count;
6600 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
6601 num_put_char__Putc(this, &dest, dest, buf, 1);
6603 }else if((adjustfield & FMTFLAG_internal) && (buf[1]=='x' || buf[1]=='X')) {
6604 num_put_char__Putc(this, &dest, dest, buf, 2);
6607 if(adjustfield != FMTFLAG_left) {
6608 num_put_char__Rep(this, ret, dest, fill, pad);
6611 num_put_char__Putc(this, &dest, dest, buf, count);
6612 return num_put_char__Rep(this, ret, dest, fill, pad);
6615 /* ?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 */
6616 /* ?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 */
6617 #define call_num_put_char_do_put_long(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 28, ostreambuf_iterator_char*, \
6618 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, LONG), \
6619 (this, ret, dest, base, fill, v))
6620 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_long, 28)
6621 ostreambuf_iterator_char* __thiscall num_put_char_do_put_long(const num_put *this, ostreambuf_iterator_char *ret,
6622 ostreambuf_iterator_char dest, ios_base *base, char fill, LONG v)
6624 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
6625 char fmt[7]; /* strlen("%+#lld")+1 */
6627 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
6629 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
6630 sprintf(tmp, num_put_char__Ifmt(this, fmt, "ld", base->fmtfl), v));
6633 /* ?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 */
6634 /* ?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 */
6635 DEFINE_THISCALL_WRAPPER(num_put_char_put_long, 28)
6636 ostreambuf_iterator_char* __thiscall num_put_char_put_long(const num_put *this, ostreambuf_iterator_char *ret,
6637 ostreambuf_iterator_char dest, ios_base *base, char fill, LONG v)
6639 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
6640 return call_num_put_char_do_put_long(this, ret, dest, base, fill, v);
6643 /* ?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 */
6644 /* ?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 */
6645 #define call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 24, ostreambuf_iterator_char*, \
6646 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, ULONG), \
6647 (this, ret, dest, base, fill, v))
6648 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_ulong, 28)
6649 ostreambuf_iterator_char* __thiscall num_put_char_do_put_ulong(const num_put *this, ostreambuf_iterator_char *ret,
6650 ostreambuf_iterator_char dest, ios_base *base, char fill, ULONG v)
6652 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
6653 char fmt[7]; /* strlen("%+#lld")+1 */
6655 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
6657 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
6658 sprintf(tmp, num_put_char__Ifmt(this, fmt, "lu", base->fmtfl), v));
6661 /* ?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 */
6662 /* ?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 */
6663 DEFINE_THISCALL_WRAPPER(num_put_char_put_ulong, 28)
6664 ostreambuf_iterator_char* __thiscall num_put_char_put_ulong(const num_put *this, ostreambuf_iterator_char *ret,
6665 ostreambuf_iterator_char dest, ios_base *base, char fill, ULONG v)
6667 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
6668 return call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v);
6671 /* ?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 */
6672 /* ?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 */
6673 /* ?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 */
6674 /* ?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 */
6675 #define call_num_put_char_do_put_double(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_char*, \
6676 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, double), \
6677 (this, ret, dest, base, fill, v))
6678 #define call_num_put_char_do_put_ldouble(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 8, ostreambuf_iterator_char*, \
6679 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, double), \
6680 (this, ret, dest, base, fill, v))
6681 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_double, 32)
6682 ostreambuf_iterator_char* __thiscall num_put_char_do_put_double(const num_put *this, ostreambuf_iterator_char *ret,
6683 ostreambuf_iterator_char dest, ios_base *base, char fill, double v)
6686 char fmt[8]; /* strlen("%+#.*lg")+1 */
6689 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
6691 num_put_char__Ffmt(this, fmt, '\0', base->fmtfl);
6692 size = _scprintf(fmt, base->prec, v);
6694 /* TODO: don't use dynamic allocation */
6695 tmp = MSVCRT_operator_new(size*2);
6697 ERR("Out of memory\n");
6698 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
6700 num_put_char_fput(this, ret, dest, base, fill, tmp, sprintf(tmp, fmt, base->prec, v));
6701 MSVCRT_operator_delete(tmp);
6705 /* ?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 */
6706 /* ?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 */
6707 DEFINE_THISCALL_WRAPPER(num_put_char_put_double, 32)
6708 ostreambuf_iterator_char* __thiscall num_put_char_put_double(const num_put *this, ostreambuf_iterator_char *ret,
6709 ostreambuf_iterator_char dest, ios_base *base, char fill, double v)
6711 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
6712 return call_num_put_char_do_put_double(this, ret, dest, base, fill, v);
6715 /* ?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 */
6716 /* ?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 */
6717 DEFINE_THISCALL_WRAPPER(num_put_char_put_ldouble, 32)
6718 ostreambuf_iterator_char* __thiscall num_put_char_put_ldouble(const num_put *this, ostreambuf_iterator_char *ret,
6719 ostreambuf_iterator_char dest, ios_base *base, char fill, double v)
6721 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
6722 return call_num_put_char_do_put_ldouble(this, ret, dest, base, fill, v);
6725 /* ?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 */
6726 /* ?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 */
6727 #define call_num_put_char_do_put_ptr(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_char*, \
6728 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, const void*), \
6729 (this, ret, dest, base, fill, v))
6730 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_ptr, 28)
6731 ostreambuf_iterator_char* __thiscall num_put_char_do_put_ptr(const num_put *this, ostreambuf_iterator_char *ret,
6732 ostreambuf_iterator_char dest, ios_base *base, char fill, const void *v)
6734 char tmp[17]; /* 8(16^8==2^64)*2(separators beetwen every digit) + 1 */
6736 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
6738 return num_put_char__Iput(this, ret, dest, base, fill, tmp, sprintf(tmp, "%p", v));
6741 /* ?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 */
6742 /* ?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 */
6743 DEFINE_THISCALL_WRAPPER(num_put_char_put_ptr, 28)
6744 ostreambuf_iterator_char* __thiscall num_put_char_put_ptr(const num_put *this, ostreambuf_iterator_char *ret,
6745 ostreambuf_iterator_char dest, ios_base *base, char fill, const void *v)
6747 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
6748 return call_num_put_char_do_put_ptr(this, ret, dest, base, fill, v);
6751 /* ?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 */
6752 /* ?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 */
6753 #define call_num_put_char_do_put_int64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 20, ostreambuf_iterator_char*, \
6754 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, __int64), \
6755 (this, ret, dest, base, fill, v))
6756 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_int64, 32)
6757 ostreambuf_iterator_char* __thiscall num_put_char_do_put_int64(const num_put *this, ostreambuf_iterator_char *ret,
6758 ostreambuf_iterator_char dest, ios_base *base, char fill, __int64 v)
6760 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
6761 char fmt[7]; /* strlen("%+#lld")+1 */
6763 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
6765 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
6766 sprintf(tmp, num_put_char__Ifmt(this, fmt, "lld", base->fmtfl), v));
6769 /* ?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 */
6770 /* ?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 */
6771 DEFINE_THISCALL_WRAPPER(num_put_char_put_int64, 32)
6772 ostreambuf_iterator_char* __thiscall num_put_char_put_int64(const num_put *this, ostreambuf_iterator_char *ret,
6773 ostreambuf_iterator_char dest, ios_base *base, char fill, __int64 v)
6775 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
6776 return call_num_put_char_do_put_int64(this, ret, dest, base, fill, v);
6779 /* ?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 */
6780 /* ?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 */
6781 #define call_num_put_char_do_put_uint64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 16, ostreambuf_iterator_char*, \
6782 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, unsigned __int64), \
6783 (this, ret, dest, base, fill, v))
6784 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_uint64, 32)
6785 ostreambuf_iterator_char* __thiscall num_put_char_do_put_uint64(const num_put *this, ostreambuf_iterator_char *ret,
6786 ostreambuf_iterator_char dest, ios_base *base, char fill, unsigned __int64 v)
6788 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
6789 char fmt[7]; /* strlen("%+#lld")+1 */
6791 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
6793 return num_put_char__Iput(this, ret, dest, base, fill, tmp,
6794 sprintf(tmp, num_put_char__Ifmt(this, fmt, "llu", base->fmtfl), v));
6797 /* ?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 */
6798 /* ?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 */
6799 DEFINE_THISCALL_WRAPPER(num_put_char_put_uint64, 32)
6800 ostreambuf_iterator_char* __thiscall num_put_char_put_uint64(const num_put *this, ostreambuf_iterator_char *ret,
6801 ostreambuf_iterator_char dest, ios_base *base, char fill, unsigned __int64 v)
6803 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
6804 return call_num_put_char_do_put_uint64(this, ret, dest, base, fill, v);
6807 /* ?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 */
6808 /* ?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 */
6809 #define call_num_put_char_do_put_bool(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 32, ostreambuf_iterator_char*, \
6810 (const num_put*, ostreambuf_iterator_char*, ostreambuf_iterator_char, ios_base*, char, MSVCP_bool), \
6811 (this, ret, dest, base, fill, v))
6812 DEFINE_THISCALL_WRAPPER(num_put_char_do_put_bool, 28)
6813 ostreambuf_iterator_char* __thiscall num_put_char_do_put_bool(const num_put *this, ostreambuf_iterator_char *ret,
6814 ostreambuf_iterator_char dest, ios_base *base, char fill, MSVCP_bool v)
6816 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
6818 if(base->fmtfl & FMTFLAG_boolalpha) {
6819 numpunct_char *numpunct = numpunct_char_use_facet(base->loc);
6820 basic_string_char str;
6821 MSVCP_size_t pad, len;
6824 numpunct_char_truename(numpunct, &str);
6826 numpunct_char_falsename(numpunct, &str);
6828 len = MSVCP_basic_string_char_length(&str);
6829 pad = (len>base->wide ? 0 : base->wide-len);
6832 if((base->fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
6833 num_put_char__Rep(this, &dest, dest, fill, pad);
6836 num_put_char__Putc(this, &dest, dest, MSVCP_basic_string_char_c_str(&str), len);
6837 MSVCP_basic_string_char_dtor(&str);
6838 return num_put_char__Rep(this, ret, dest, fill, pad);
6841 return num_put_char_put_long(this, ret, dest, base, fill, v);
6844 /* ?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 */
6845 /* ?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 */
6846 DEFINE_THISCALL_WRAPPER(num_put_char_put_bool, 28)
6847 ostreambuf_iterator_char* __thiscall num_put_char_put_bool(const num_put *this, ostreambuf_iterator_char *ret,
6848 ostreambuf_iterator_char dest, ios_base *base, char fill, MSVCP_bool v)
6850 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
6851 return call_num_put_char_do_put_bool(this, ret, dest, base, fill, v);
6854 /* ?id@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@2V0locale@2@A */
6855 locale_id num_put_wchar_id = {0};
6857 /* num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@6B@ */
6858 extern const vtable_ptr MSVCP_num_put_wchar_vtable;
6860 /* ?_Init@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IAEXABV_Locinfo@2@@Z */
6861 /* ?_Init@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@IEAAXAEBV_Locinfo@2@@Z */
6862 DEFINE_THISCALL_WRAPPER(num_put_wchar__Init, 8)
6863 void __thiscall num_put_wchar__Init(num_put *this, const _Locinfo *locinfo)
6865 TRACE("(%p %p)\n", this, locinfo);
6866 _Locinfo__Getcvt(locinfo, &this->cvt);
6869 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@ABV_Locinfo@1@I@Z */
6870 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@AEBV_Locinfo@1@_K@Z */
6871 DEFINE_THISCALL_WRAPPER(num_put_wchar_ctor_locinfo, 12)
6872 num_put* __thiscall num_put_wchar_ctor_locinfo(num_put *this, const _Locinfo *locinfo, MSVCP_size_t refs)
6874 TRACE("(%p %p %ld)\n", this, locinfo, refs);
6876 locale_facet_ctor_refs(&this->facet, refs);
6877 this->facet.vtable = &MSVCP_num_put_wchar_vtable;
6879 num_put_wchar__Init(this, locinfo);
6883 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAE@I@Z */
6884 /* ??0?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAA@_K@Z */
6885 DEFINE_THISCALL_WRAPPER(num_put_wchar_ctor_refs, 8)
6886 num_put* __thiscall num_put_wchar_ctor_refs(num_put *this, MSVCP_size_t refs)
6890 TRACE("(%p %lu)\n", this, refs);
6892 _Locinfo_ctor(&locinfo);
6893 num_put_wchar_ctor_locinfo(this, &locinfo, refs);
6894 _Locinfo_dtor(&locinfo);
6898 /* ??_F?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QAEXXZ */
6899 /* ??_F?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@QEAAXXZ */
6900 DEFINE_THISCALL_WRAPPER(num_put_wchar_ctor, 4)
6901 num_put* __thiscall num_put_wchar_ctor(num_put *this)
6903 return num_put_wchar_ctor_refs(this, 0);
6906 /* ??1?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MAE@XZ */
6907 /* ??1?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@MEAA@XZ */
6908 DEFINE_THISCALL_WRAPPER(num_put_wchar_dtor, 4)
6909 void __thiscall num_put_wchar_dtor(num_put *this)
6911 TRACE("(%p)\n", this);
6912 locale_facet_dtor(&this->facet);
6915 DEFINE_THISCALL_WRAPPER(MSVCP_num_put_wchar_vector_dtor, 8)
6916 num_put* __thiscall MSVCP_num_put_wchar_vector_dtor(num_put *this, unsigned int flags)
6918 TRACE("(%p %x)\n", this, flags);
6920 /* we have an array, with the number of elements stored before the first object */
6921 int i, *ptr = (int *)this-1;
6923 for(i=*ptr-1; i>=0; i--)
6924 num_put_wchar_dtor(this+i);
6925 MSVCRT_operator_delete(ptr);
6927 num_put_wchar_dtor(this);
6929 MSVCRT_operator_delete(this);
6935 /* ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
6936 /* ?_Getcat@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */
6937 unsigned int __cdecl num_put_wchar__Getcat(const locale_facet **facet, const locale *loc)
6939 TRACE("(%p %p)\n", facet, loc);
6941 if(facet && !*facet) {
6944 *facet = MSVCRT_operator_new(sizeof(num_put));
6946 ERR("Out of memory\n");
6947 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
6951 _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name));
6952 num_put_wchar_ctor_locinfo((num_put*)*facet, &locinfo, 0);
6953 _Locinfo_dtor(&locinfo);
6959 num_put* num_put_wchar_use_facet(const locale *loc)
6961 static num_put *obj = NULL;
6964 const locale_facet *fac;
6966 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
6967 fac = locale__Getfacet(loc, locale_id_operator_size_t(&num_put_wchar_id));
6969 _Lockit_dtor(&lock);
6970 return (num_put*)fac;
6974 _Lockit_dtor(&lock);
6978 num_put_wchar__Getcat(&fac, loc);
6979 obj = (num_put*)fac;
6980 locale_facet__Incref(&obj->facet);
6981 locale_facet_register(&obj->facet);
6982 _Lockit_dtor(&lock);
6987 /* ?_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 */
6988 /* ?_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 */
6989 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Put(const num_put *this, ostreambuf_iterator_wchar *ret,
6990 ostreambuf_iterator_wchar dest, const wchar_t *ptr, MSVCP_size_t count)
6992 TRACE("(%p %p %s %ld)\n", this, ret, debugstr_wn(ptr, count), count);
6994 for(; count>0; count--)
6995 ostreambuf_iterator_wchar_put(&dest, *ptr++);
7001 /* ?_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 */
7002 /* ?_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 */
7003 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Putc(const num_put *this, ostreambuf_iterator_wchar *ret,
7004 ostreambuf_iterator_wchar dest, const char *ptr, MSVCP_size_t count)
7009 TRACE("(%p %p %s %ld)\n", this, ret, debugstr_an(ptr, count), count);
7011 for(; count>0; count--) {
7012 if(_Mbrtowc(&ch, ptr++, 1, &state, &this->cvt) == 1)
7013 ostreambuf_iterator_wchar_put(&dest, ch);
7020 /* ?_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 */
7021 /* ?_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 */
7022 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Putgrouped(const num_put *this, ostreambuf_iterator_wchar *ret,
7023 ostreambuf_iterator_wchar dest, const char *ptr, MSVCP_size_t count, wchar_t delim)
7025 FIXME("(%p %p %p %ld %d) stub\n", this, ret, ptr, count, delim);
7029 /* ?_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 */
7030 /* ?_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 */
7031 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Rep(const num_put *this, ostreambuf_iterator_wchar *ret,
7032 ostreambuf_iterator_wchar dest, wchar_t c, MSVCP_size_t count)
7034 TRACE("(%p %p %d %ld)\n", this, ret, c, count);
7036 for(; count>0; count--)
7037 ostreambuf_iterator_wchar_put(&dest, c);
7043 /* ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAPADPADDH@Z */
7044 /* ?_Ffmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAPEADPEADDH@Z */
7045 char* __cdecl num_put_wchar__Ffmt(const num_put *this, char *fmt, char spec, int fmtfl)
7047 int type = fmtfl & FMTFLAG_floatfield;
7050 TRACE("(%p %p %d %d)\n", this, fmt, spec, fmtfl);
7053 if(fmtfl & FMTFLAG_showpos)
7055 if(fmtfl & FMTFLAG_showbase)
7062 if(type == FMTFLAG_fixed)
7064 else if(type == FMTFLAG_scientific)
7065 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'E' : 'e';
7066 else if(type == (FMTFLAG_fixed|FMTFLAG_scientific))
7067 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'A' : 'a';
7069 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'G' : 'g';
7075 /* ?_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 */
7076 /* ?_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 */
7077 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Fput(const num_put *this, ostreambuf_iterator_wchar *ret,
7078 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const char *buf, MSVCP_size_t bef_point,
7079 MSVCP_size_t aft_point, MSVCP_size_t trailing, MSVCP_size_t count)
7081 FIXME("(%p %p %p %d %p %ld %ld %ld %ld) stub\n", this, ret, base,
7082 fill, buf, bef_point, aft_point, trailing, count);
7086 /* TODO: This function should be removed when num_put_wchar__Fput is implemented */
7087 static ostreambuf_iterator_wchar* num_put_wchar_fput(const num_put *this, ostreambuf_iterator_wchar *ret,
7088 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf, MSVCP_size_t count)
7090 numpunct_wchar *numpunct = numpunct_wchar_use_facet(base->loc);
7091 basic_string_char grouping_bstr;
7092 const char *grouping;
7093 char *p, dec_point = *localeconv()->decimal_point;
7095 int cur_group = 0, group_size = 0;
7096 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
7097 MSVCP_size_t i, pad;
7099 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
7101 for(p=buf; p<buf+count; p++) {
7107 /* Add separators to number */
7108 numpunct_wchar_grouping(numpunct, &grouping_bstr);
7109 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
7110 sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : '\0';
7112 for(; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
7114 if(group_size == grouping[cur_group]) {
7116 if(grouping[cur_group+1])
7119 memmove(p+1, p, buf+count-p);
7120 *p = '\0'; /* mark thousands separator positions */
7124 MSVCP_basic_string_char_dtor(&grouping_bstr);
7126 /* Display number with padding */
7127 if(count >= base->wide)
7130 pad = base->wide-count;
7133 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
7134 num_put_wchar__Putc(this, &dest, dest, buf, 1);
7137 if(adjustfield != FMTFLAG_left) {
7138 num_put_wchar__Rep(this, ret, dest, fill, pad);
7142 for(i=0; i<count; i++) {
7143 if(buf[i] == dec_point)
7144 num_put_wchar__Rep(this, &dest, dest, numpunct_wchar_decimal_point(numpunct), 1);
7146 num_put_wchar__Rep(this, &dest, dest, sep, 1);
7148 num_put_wchar__Putc(this, &dest, dest, buf+i, 1);
7151 return num_put_wchar__Rep(this, ret, dest, fill, pad);
7154 /* ?_Ifmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABAPADPADPBDH@Z */
7155 /* ?_Ifmt@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBAPEADPEADPEBDH@Z */
7156 char* __cdecl num_put_wchar__Ifmt(const num_put *this, char *fmt, const char *spec, int fmtfl)
7158 int base = fmtfl & FMTFLAG_basefield;
7161 TRACE("(%p %p %p %d)\n", this, fmt, spec, fmtfl);
7164 if(fmtfl & FMTFLAG_showpos)
7166 if(fmtfl & FMTFLAG_showbase)
7173 if(base == FMTFLAG_oct)
7175 else if(base == FMTFLAG_hex)
7176 *p++ = (fmtfl & FMTFLAG_uppercase) ? 'X' : 'x';
7184 /* ?_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 */
7185 /* ?_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 */
7186 ostreambuf_iterator_wchar* __cdecl num_put_wchar__Iput(const num_put *this, ostreambuf_iterator_wchar *ret,
7187 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, char *buf, MSVCP_size_t count)
7189 numpunct_wchar *numpunct = numpunct_wchar_use_facet(base->loc);
7190 basic_string_char grouping_bstr;
7191 const char *grouping;
7194 int cur_group = 0, group_size = 0;
7195 int adjustfield = base->fmtfl & FMTFLAG_adjustfield;
7196 MSVCP_size_t i, pad;
7198 TRACE("(%p %p %p %d %s %ld)\n", this, ret, base, fill, buf, count);
7200 /* Add separators to number */
7201 numpunct_wchar_grouping(numpunct, &grouping_bstr);
7202 grouping = MSVCP_basic_string_char_c_str(&grouping_bstr);
7203 sep = grouping[0] ? numpunct_wchar_thousands_sep(numpunct) : '\0';
7205 for(p=buf+count-1; p>buf && sep && grouping[cur_group]!=CHAR_MAX; p--) {
7207 if(group_size == grouping[cur_group]) {
7209 if(grouping[cur_group+1])
7212 memmove(p+1, p, buf+count-p);
7213 *p = '\0'; /* mark thousands separator positions */
7217 MSVCP_basic_string_char_dtor(&grouping_bstr);
7219 /* Display number with padding */
7220 if(count >= base->wide)
7223 pad = base->wide-count;
7226 if((adjustfield & FMTFLAG_internal) && (buf[0]=='-' || buf[0]=='+')) {
7227 num_put_wchar__Putc(this, &dest, dest, buf, 1);
7229 }else if((adjustfield & FMTFLAG_internal) && (buf[1]=='x' || buf[1]=='X')) {
7230 num_put_wchar__Putc(this, &dest, dest, buf, 2);
7233 if(adjustfield != FMTFLAG_left) {
7234 num_put_wchar__Rep(this, ret, dest, fill, pad);
7238 for(i=0; i<count; i++) {
7240 num_put_wchar__Rep(this, &dest, dest, sep, 1);
7242 num_put_wchar__Putc(this, &dest, dest, buf+i, 1);
7245 return num_put_wchar__Rep(this, ret, dest, fill, pad);
7248 /* ?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 */
7249 /* ?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 */
7250 #define call_num_put_wchar_do_put_long(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 28, ostreambuf_iterator_wchar*, \
7251 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, LONG), \
7252 (this, ret, dest, base, fill, v))
7253 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_long, 28)
7254 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_long(const num_put *this, ostreambuf_iterator_wchar *ret,
7255 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, LONG v)
7257 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7258 char fmt[7]; /* strlen("%+#lld")+1 */
7260 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7262 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
7263 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "ld", base->fmtfl), v));
7266 /* ?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 */
7267 /* ?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 */
7268 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_long, 28)
7269 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_long(const num_put *this, ostreambuf_iterator_wchar *ret,
7270 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, LONG v)
7272 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7273 return call_num_put_wchar_do_put_long(this, ret, dest, base, fill, v);
7276 /* ?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 */
7277 /* ?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 */
7278 #define call_num_put_wchar_do_put_ulong(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 24, ostreambuf_iterator_wchar*, \
7279 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, ULONG), \
7280 (this, ret, dest, base, fill, v))
7281 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_ulong, 28)
7282 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_ulong(const num_put *this, ostreambuf_iterator_wchar *ret,
7283 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, ULONG v)
7285 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7286 char fmt[7]; /* strlen("%+#lld")+1 */
7288 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7290 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
7291 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lu", base->fmtfl), v));
7294 /* ?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 */
7295 /* ?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 */
7296 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ulong, 28)
7297 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ulong(const num_put *this, ostreambuf_iterator_wchar *ret,
7298 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, ULONG v)
7300 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7301 return call_num_put_wchar_do_put_ulong(this, ret, dest, base, fill, v);
7304 /* ?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 */
7305 /* ?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 */
7306 /* ?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 */
7307 /* ?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 */
7308 #define call_num_put_wchar_do_put_double(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 12, ostreambuf_iterator_wchar*, \
7309 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, double), \
7310 (this, ret, dest, base, fill, v))
7311 #define call_num_put_wchar_do_put_ldouble(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 8, ostreambuf_iterator_wchar*, \
7312 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, double), \
7313 (this, ret, dest, base, fill, v))
7314 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_double, 32)
7315 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_double(const num_put *this, ostreambuf_iterator_wchar *ret,
7316 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
7319 char fmt[8]; /* strlen("%+#.*lg")+1 */
7322 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
7324 num_put_wchar__Ffmt(this, fmt, '\0', base->fmtfl);
7325 size = _scprintf(fmt, base->prec, v);
7327 /* TODO: don't use dynamic allocation */
7328 tmp = MSVCRT_operator_new(size*2);
7330 ERR("Out of memory\n");
7331 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7333 num_put_wchar_fput(this, ret, dest, base, fill, tmp, sprintf(tmp, fmt, base->prec, v));
7334 MSVCRT_operator_delete(tmp);
7338 /* ?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 */
7339 /* ?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 */
7340 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_double, 32)
7341 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_double(const num_put *this, ostreambuf_iterator_wchar *ret,
7342 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
7344 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
7345 return call_num_put_wchar_do_put_double(this, ret, dest, base, fill, v);
7348 /* ?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 */
7349 /* ?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 */
7350 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ldouble, 32)
7351 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ldouble(const num_put *this, ostreambuf_iterator_wchar *ret,
7352 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, double v)
7354 TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
7355 return call_num_put_wchar_do_put_ldouble(this, ret, dest, base, fill, v);
7358 /* ?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 */
7359 /* ?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 */
7360 #define call_num_put_wchar_do_put_ptr(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 4, ostreambuf_iterator_wchar*, \
7361 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, const void*), \
7362 (this, ret, dest, base, fill, v))
7363 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_ptr, 28)
7364 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_ptr(const num_put *this, ostreambuf_iterator_wchar *ret,
7365 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const void *v)
7367 char tmp[17]; /* 8(16^8==2^64)*2(separators beetwen every digit) + 1 */
7369 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
7371 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp, sprintf(tmp, "%p", v));
7374 /* ?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 */
7375 /* ?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 */
7376 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_ptr, 28)
7377 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_ptr(const num_put *this, ostreambuf_iterator_wchar *ret,
7378 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, const void *v)
7380 TRACE("(%p %p %p %d %p)\n", this, ret, base, fill, v);
7381 return call_num_put_wchar_do_put_ptr(this, ret, dest, base, fill, v);
7384 /* ?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 */
7385 /* ?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 */
7386 #define call_num_put_wchar_do_put_int64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 20, ostreambuf_iterator_wchar*, \
7387 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, __int64), \
7388 (this, ret, dest, base, fill, v))
7389 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_int64, 32)
7390 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_int64(const num_put *this, ostreambuf_iterator_wchar *ret,
7391 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, __int64 v)
7393 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7394 char fmt[7]; /* strlen("%+#lld")+1 */
7396 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7398 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
7399 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "lld", base->fmtfl), v));
7402 /* ?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 */
7403 /* ?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 */
7404 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_int64, 32)
7405 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_int64(const num_put *this, ostreambuf_iterator_wchar *ret,
7406 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, __int64 v)
7408 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7409 return call_num_put_wchar_do_put_int64(this, ret, dest, base, fill, v);
7412 /* ?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 */
7413 /* ?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 */
7414 #define call_num_put_wchar_do_put_uint64(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 16, ostreambuf_iterator_wchar*, \
7415 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, unsigned __int64), \
7416 (this, ret, dest, base, fill, v))
7417 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_uint64, 32)
7418 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_uint64(const num_put *this, ostreambuf_iterator_wchar *ret,
7419 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, unsigned __int64 v)
7421 char tmp[48]; /* 22(8^22>2^64)*2(separators beetwen every digit) + 3(strlen("+0x"))+1 */
7422 char fmt[7]; /* strlen("%+#lld")+1 */
7424 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7426 return num_put_wchar__Iput(this, ret, dest, base, fill, tmp,
7427 sprintf(tmp, num_put_wchar__Ifmt(this, fmt, "llu", base->fmtfl), v));
7430 /* ?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 */
7431 /* ?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 */
7432 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_uint64, 32)
7433 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_uint64(const num_put *this, ostreambuf_iterator_wchar *ret,
7434 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, unsigned __int64 v)
7436 TRACE("(%p %p %p %d)\n", this, ret, base, fill);
7437 return call_num_put_wchar_do_put_uint64(this, ret, dest, base, fill, v);
7440 /* ?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 */
7441 /* ?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 */
7442 #define call_num_put_wchar_do_put_bool(this, ret, dest, base, fill, v) CALL_VTBL_FUNC(this, 32, ostreambuf_iterator_wchar*, \
7443 (const num_put*, ostreambuf_iterator_wchar*, ostreambuf_iterator_wchar, ios_base*, wchar_t, MSVCP_bool), \
7444 (this, ret, dest, base, fill, v))
7445 DEFINE_THISCALL_WRAPPER(num_put_wchar_do_put_bool, 28)
7446 ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_bool(const num_put *this, ostreambuf_iterator_wchar *ret,
7447 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, MSVCP_bool v)
7449 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7451 if(base->fmtfl & FMTFLAG_boolalpha) {
7452 numpunct_wchar *numpunct = numpunct_wchar_use_facet(base->loc);
7453 basic_string_wchar str;
7454 MSVCP_size_t pad, len;
7457 numpunct_wchar_truename(numpunct, &str);
7459 numpunct_wchar_falsename(numpunct, &str);
7461 len = MSVCP_basic_string_wchar_length(&str);
7462 pad = (len>base->wide ? 0 : base->wide-len);
7465 if((base->fmtfl & FMTFLAG_adjustfield) != FMTFLAG_left) {
7466 num_put_wchar__Rep(this, &dest, dest, fill, pad);
7469 num_put_wchar__Put(this, &dest, dest, MSVCP_basic_string_wchar_c_str(&str), len);
7470 MSVCP_basic_string_wchar_dtor(&str);
7471 return num_put_wchar__Rep(this, ret, dest, fill, pad);
7474 return num_put_wchar_put_long(this, ret, dest, base, fill, v);
7477 /* ?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 */
7478 /* ?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 */
7479 DEFINE_THISCALL_WRAPPER(num_put_wchar_put_bool, 28)
7480 ostreambuf_iterator_wchar* __thiscall num_put_wchar_put_bool(const num_put *this, ostreambuf_iterator_wchar *ret,
7481 ostreambuf_iterator_wchar dest, ios_base *base, wchar_t fill, MSVCP_bool v)
7483 TRACE("(%p %p %p %d %d)\n", this, ret, base, fill, v);
7484 return call_num_put_wchar_do_put_bool(this, ret, dest, base, fill, v);
7487 /* ??0_Locimp@locale@std@@AAE@_N@Z */
7488 /* ??0_Locimp@locale@std@@AEAA@_N@Z */
7489 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor_transparent, 8)
7490 locale__Locimp* __thiscall locale__Locimp_ctor_transparent(locale__Locimp *this, MSVCP_bool transparent)
7492 TRACE("(%p %d)\n", this, transparent);
7494 memset(this, 0, sizeof(locale__Locimp));
7495 locale_facet_ctor_refs(&this->facet, 1);
7496 this->transparent = transparent;
7497 MSVCP_basic_string_char_ctor_cstr(&this->name, "*");
7501 /* ??_F_Locimp@locale@std@@QAEXXZ */
7502 /* ??_F_Locimp@locale@std@@QEAAXXZ */
7503 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor, 4)
7504 locale__Locimp* __thiscall locale__Locimp_ctor(locale__Locimp *this)
7506 return locale__Locimp_ctor_transparent(this, FALSE);
7509 /* ??0_Locimp@locale@std@@AAE@ABV012@@Z */
7510 /* ??0_Locimp@locale@std@@AEAA@AEBV012@@Z */
7511 DEFINE_THISCALL_WRAPPER(locale__Locimp_copy_ctor, 8)
7512 locale__Locimp* __thiscall locale__Locimp_copy_ctor(locale__Locimp *this, const locale__Locimp *copy)
7517 TRACE("(%p %p)\n", this, copy);
7519 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
7520 memcpy(this, copy, sizeof(locale__Locimp));
7521 locale_facet_ctor_refs(&this->facet, 1);
7522 if(copy->facetvec) {
7523 this->facetvec = MSVCRT_operator_new(copy->facet_cnt*sizeof(locale_facet*));
7524 if(!this->facetvec) {
7525 _Lockit_dtor(&lock);
7526 ERR("Out of memory\n");
7527 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7530 for(i=0; i<this->facet_cnt; i++)
7531 if(this->facetvec[i])
7532 locale_facet__Incref(this->facetvec[i]);
7534 MSVCP_basic_string_char_copy_ctor(&this->name, ©->name);
7535 _Lockit_dtor(&lock);
7539 /* ?_Locimp_ctor@_Locimp@locale@std@@CAXPAV123@ABV123@@Z */
7540 /* ?_Locimp_ctor@_Locimp@locale@std@@CAXPEAV123@AEBV123@@Z */
7541 locale__Locimp* __cdecl locale__Locimp__Locimp_ctor(locale__Locimp *this, const locale__Locimp *copy)
7543 return locale__Locimp_copy_ctor(this, copy);
7546 /* ??1_Locimp@locale@std@@MAE@XZ */
7547 /* ??1_Locimp@locale@std@@MEAA@XZ */
7548 DEFINE_THISCALL_WRAPPER(locale__Locimp_dtor, 4)
7549 void __thiscall locale__Locimp_dtor(locale__Locimp *this)
7551 TRACE("(%p)\n", this);
7553 if(locale_facet__Decref(&this->facet)) {
7555 for(i=0; i<this->facet_cnt; i++)
7556 if(this->facetvec[i] && locale_facet__Decref(this->facetvec[i]))
7557 call_locale_facet_vector_dtor(this->facetvec[i], 0);
7559 MSVCRT_operator_delete(this->facetvec);
7560 MSVCP_basic_string_char_dtor(&this->name);
7564 /* ?_Locimp_dtor@_Locimp@locale@std@@CAXPAV123@@Z */
7565 /* ?_Locimp_dtor@_Locimp@locale@std@@CAXPEAV123@@Z */
7566 void __cdecl locale__Locimp__Locimp_dtor(locale__Locimp *this)
7568 locale__Locimp_dtor(this);
7571 DEFINE_THISCALL_WRAPPER(MSVCP_locale__Locimp_vector_dtor, 8)
7572 locale__Locimp* __thiscall MSVCP_locale__Locimp_vector_dtor(locale__Locimp *this, unsigned int flags)
7574 TRACE("(%p %x)\n", this, flags);
7576 /* we have an array, with the number of elements stored before the first object */
7577 int i, *ptr = (int *)this-1;
7579 for(i=*ptr-1; i>=0; i--)
7580 locale__Locimp_dtor(this+i);
7581 MSVCRT_operator_delete(ptr);
7583 locale__Locimp_dtor(this);
7585 MSVCRT_operator_delete(this);
7591 /* ?_Locimp_Addfac@_Locimp@locale@std@@CAXPAV123@PAVfacet@23@I@Z */
7592 /* ?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z */
7593 void __cdecl locale__Locimp__Locimp_Addfac(locale__Locimp *locimp, locale_facet *facet, MSVCP_size_t id)
7597 TRACE("(%p %p %lu)\n", locimp, facet, id);
7599 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
7600 if(id >= locimp->facet_cnt) {
7601 MSVCP_size_t new_size = id+1;
7602 locale_facet **new_facetvec;
7604 if(new_size < locale_id__Id_cnt+1)
7605 new_size = locale_id__Id_cnt+1;
7607 new_facetvec = MSVCRT_operator_new(sizeof(locale_facet*)*new_size);
7609 _Lockit_dtor(&lock);
7610 ERR("Out of memory\n");
7611 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7615 memset(new_facetvec, 0, sizeof(locale_facet*)*new_size);
7616 memcpy(new_facetvec, locimp->facetvec, sizeof(locale_facet*)*locimp->facet_cnt);
7617 MSVCRT_operator_delete(locimp->facetvec);
7618 locimp->facetvec = new_facetvec;
7619 locimp->facet_cnt = new_size;
7622 if(locimp->facetvec[id] && locale_facet__Decref(locimp->facetvec[id]))
7623 call_locale_facet_vector_dtor(locimp->facetvec[id], 0);
7625 locimp->facetvec[id] = facet;
7627 locale_facet__Incref(facet);
7628 _Lockit_dtor(&lock);
7631 /* ?_Addfac@_Locimp@locale@std@@AAEXPAVfacet@23@I@Z */
7632 /* ?_Addfac@_Locimp@locale@std@@AEAAXPEAVfacet@23@_K@Z */
7633 DEFINE_THISCALL_WRAPPER(locale__Locimp__Addfac, 12)
7634 void __thiscall locale__Locimp__Addfac(locale__Locimp *this, locale_facet *facet, MSVCP_size_t id)
7636 locale__Locimp__Locimp_Addfac(this, facet, id);
7639 /* ?_Clocptr_func@_Locimp@locale@std@@CAAAPAV123@XZ */
7640 /* ?_Clocptr_func@_Locimp@locale@std@@CAAEAPEAV123@XZ */
7641 locale__Locimp** __cdecl locale__Locimp__Clocptr_func(void)
7647 /* ?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
7648 /* ?_Makeushloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
7649 /* List of missing facets:
7650 * num_put, collate, messages, money_get, money_put, moneypunct, moneypunct, time_get, time_put
7652 void __cdecl locale__Locimp__Makeushloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
7654 FIXME("(%p %d %p %p) semi-stub\n", locinfo, cat, locimp, loc);
7656 if(cat & (1<<(ctype_short__Getcat(NULL, NULL)-1))) {
7660 ctype = ctype_short_use_facet(loc);
7662 ctype = MSVCRT_operator_new(sizeof(ctype_wchar));
7664 ERR("Out of memory\n");
7665 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7667 ctype_short_ctor_locinfo(ctype, locinfo, 0);
7669 locale__Locimp__Addfac(locimp, &ctype->base.facet, locale_id_operator_size_t(&ctype_short_id));
7672 if(cat & (1<<(num_get_short__Getcat(NULL, NULL)-1))) {
7676 numget = num_get_short_use_facet(loc);
7678 numget = MSVCRT_operator_new(sizeof(num_get));
7680 ERR("Out of memory\n");
7681 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7683 num_get_short_ctor_locinfo(numget, locinfo, 0);
7685 locale__Locimp__Addfac(locimp, &numget->facet, locale_id_operator_size_t(&num_get_short_id));
7688 if(cat & (1<<(numpunct_short__Getcat(NULL, NULL)-1))) {
7689 numpunct_wchar *numpunct;
7692 numpunct = numpunct_short_use_facet(loc);
7694 numpunct = MSVCRT_operator_new(sizeof(numpunct_wchar));
7696 ERR("Out of memory\n");
7697 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7699 numpunct_short_ctor_locinfo(numpunct, locinfo, 0, FALSE);
7701 locale__Locimp__Addfac(locimp, &numpunct->facet, locale_id_operator_size_t(&numpunct_short_id));
7704 if(cat & (1<<(codecvt_short__Getcat(NULL, NULL)-1))) {
7705 codecvt_wchar *codecvt;
7708 codecvt = codecvt_short_use_facet(loc);
7710 codecvt = MSVCRT_operator_new(sizeof(codecvt_wchar));
7712 ERR("Out of memory\n");
7713 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7715 codecvt_short_ctor_locinfo(codecvt, locinfo, 0);
7717 locale__Locimp__Addfac(locimp, &codecvt->base.facet, locale_id_operator_size_t(&codecvt_short_id));
7721 /* ?_Makewloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
7722 /* ?_Makewloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
7723 /* List of missing facets:
7724 * collate, messages, money_get, money_put, moneypunct, moneypunct, time_get, time_put
7726 void __cdecl locale__Locimp__Makewloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
7728 FIXME("(%p %d %p %p) semi-stub\n", locinfo, cat, locimp, loc);
7730 if(cat & (1<<(ctype_wchar__Getcat(NULL, NULL)-1))) {
7734 ctype = ctype_wchar_use_facet(loc);
7736 ctype = MSVCRT_operator_new(sizeof(ctype_wchar));
7738 ERR("Out of memory\n");
7739 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7741 ctype_wchar_ctor_locinfo(ctype, locinfo, 0);
7743 locale__Locimp__Addfac(locimp, &ctype->base.facet, locale_id_operator_size_t(&ctype_wchar_id));
7746 if(cat & (1<<(num_get_wchar__Getcat(NULL, NULL)-1))) {
7750 numget = num_get_wchar_use_facet(loc);
7752 numget = MSVCRT_operator_new(sizeof(num_get));
7754 ERR("Out of memory\n");
7755 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7757 num_get_wchar_ctor_locinfo(numget, locinfo, 0);
7759 locale__Locimp__Addfac(locimp, &numget->facet, locale_id_operator_size_t(&num_get_wchar_id));
7762 if(cat & (1<<(num_put_wchar__Getcat(NULL, NULL)-1))) {
7766 numput = num_put_wchar_use_facet(loc);
7768 numput = MSVCRT_operator_new(sizeof(num_put));
7770 ERR("Out of memory\n");
7771 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7773 num_put_wchar_ctor_locinfo(numput, locinfo, 0);
7775 locale__Locimp__Addfac(locimp, &numput->facet, locale_id_operator_size_t(&num_put_wchar_id));
7778 if(cat & (1<<(numpunct_wchar__Getcat(NULL, NULL)-1))) {
7779 numpunct_wchar *numpunct;
7782 numpunct = numpunct_wchar_use_facet(loc);
7784 numpunct = MSVCRT_operator_new(sizeof(numpunct_wchar));
7786 ERR("Out of memory\n");
7787 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7789 numpunct_wchar_ctor_locinfo(numpunct, locinfo, 0, FALSE);
7791 locale__Locimp__Addfac(locimp, &numpunct->facet, locale_id_operator_size_t(&numpunct_wchar_id));
7794 if(cat & (1<<(codecvt_wchar__Getcat(NULL, NULL)-1))) {
7795 codecvt_wchar *codecvt;
7798 codecvt = codecvt_wchar_use_facet(loc);
7800 codecvt = MSVCRT_operator_new(sizeof(codecvt_wchar));
7802 ERR("Out of memory\n");
7803 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7805 codecvt_wchar_ctor_locinfo(codecvt, locinfo, 0);
7807 locale__Locimp__Addfac(locimp, &codecvt->base.facet, locale_id_operator_size_t(&codecvt_wchar_id));
7811 /* ?_Makexloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
7812 /* ?_Makexloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
7813 /* List of missing facets:
7814 * collate, messages, money_get, money_put, moneypunct, moneypunct, time_get, time_put
7816 void __cdecl locale__Locimp__Makexloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
7818 FIXME("(%p %d %p %p) semi-stub\n", locinfo, cat, locimp, loc);
7820 if(cat & (1<<(ctype_char__Getcat(NULL, NULL)-1))) {
7824 ctype = ctype_char_use_facet(loc);
7826 ctype = MSVCRT_operator_new(sizeof(ctype_char));
7828 ERR("Out of memory\n");
7829 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7831 ctype_char_ctor_locinfo(ctype, locinfo, 0);
7833 locale__Locimp__Addfac(locimp, &ctype->base.facet, locale_id_operator_size_t(&ctype_char_id));
7836 if(cat & (1<<(num_get_char__Getcat(NULL, NULL)-1))) {
7840 numget = num_get_char_use_facet(loc);
7842 numget = MSVCRT_operator_new(sizeof(num_get));
7844 ERR("Out of memory\n");
7845 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7847 num_get_char_ctor_locinfo(numget, locinfo, 0);
7849 locale__Locimp__Addfac(locimp, &numget->facet, locale_id_operator_size_t(&num_get_char_id));
7852 if(cat & (1<<(num_put_char__Getcat(NULL, NULL)-1))) {
7856 numput = num_put_char_use_facet(loc);
7858 numput = MSVCRT_operator_new(sizeof(num_put));
7860 ERR("Out of memory\n");
7861 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7863 num_put_char_ctor_locinfo(numput, locinfo, 0);
7865 locale__Locimp__Addfac(locimp, &numput->facet, locale_id_operator_size_t(&num_put_char_id));
7868 if(cat & (1<<(numpunct_char__Getcat(NULL, NULL)-1))) {
7869 numpunct_char *numpunct;
7872 numpunct = numpunct_char_use_facet(loc);
7874 numpunct = MSVCRT_operator_new(sizeof(numpunct_char));
7876 ERR("Out of memory\n");
7877 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7879 numpunct_char_ctor_locinfo(numpunct, locinfo, 0, FALSE);
7881 locale__Locimp__Addfac(locimp, &numpunct->facet, locale_id_operator_size_t(&numpunct_char_id));
7884 if(cat & (1<<(codecvt_char__Getcat(NULL, NULL)-1))) {
7885 codecvt_char *codecvt;
7888 codecvt = codecvt_char_use_facet(loc);
7890 codecvt = MSVCRT_operator_new(sizeof(codecvt_char));
7892 ERR("Out of memory\n");
7893 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7895 codecvt_char_ctor_locinfo(codecvt, locinfo, 0);
7897 locale__Locimp__Addfac(locimp, &codecvt->base.facet, locale_id_operator_size_t(&codecvt_char_id));
7901 /* ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z */
7902 /* ?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
7903 locale__Locimp* __cdecl locale__Locimp__Makeloc(const _Locinfo *locinfo, category cat, locale__Locimp *locimp, const locale *loc)
7905 TRACE("(%p %d %p %p)\n", locinfo, cat, locimp, loc);
7907 locale__Locimp__Makexloc(locinfo, cat, locimp, loc);
7908 locale__Locimp__Makewloc(locinfo, cat, locimp, loc);
7909 locale__Locimp__Makeushloc(locinfo, cat, locimp, loc);
7911 locimp->catmask |= cat;
7912 MSVCP_basic_string_char_copy_ctor(&locimp->name, &locinfo->newlocname);
7916 /* ??_7_Locimp@locale@std@@6B@ */
7917 const vtable_ptr MSVCP_locale__Locimp_vtable[] = {
7918 (vtable_ptr)THISCALL_NAME(MSVCP_locale__Locimp_vector_dtor)
7921 /* ??0locale@std@@AAE@PAV_Locimp@01@@Z */
7922 /* ??0locale@std@@AEAA@PEAV_Locimp@01@@Z */
7923 DEFINE_THISCALL_WRAPPER(locale_ctor_locimp, 8)
7924 locale* __thiscall locale_ctor_locimp(locale *this, locale__Locimp *locimp)
7926 TRACE("(%p %p)\n", this, locimp);
7927 /* Don't change locimp reference counter */
7932 /* ?_Init@locale@std@@CAPAV_Locimp@12@XZ */
7933 /* ?_Init@locale@std@@CAPEAV_Locimp@12@XZ */
7934 locale__Locimp* __cdecl locale__Init(void)
7940 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
7942 _Lockit_dtor(&lock);
7943 return global_locale;
7946 global_locale = MSVCRT_operator_new(sizeof(locale__Locimp));
7947 if(!global_locale) {
7948 _Lockit_dtor(&lock);
7949 ERR("Out of memory\n");
7950 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
7954 locale__Locimp_ctor(global_locale);
7955 global_locale->catmask = (1<<(LC_MAX+1))-1;
7956 MSVCP_basic_string_char_dtor(&global_locale->name);
7957 MSVCP_basic_string_char_ctor_cstr(&global_locale->name, "C");
7959 locale__Locimp__Clocptr = global_locale;
7960 global_locale->facet.refs++;
7961 locale_ctor_locimp(&classic_locale, locale__Locimp__Clocptr);
7962 _Lockit_dtor(&lock);
7964 return global_locale;
7967 /* ??0locale@std@@QAE@ABV01@0H@Z */
7968 /* ??0locale@std@@QEAA@AEBV01@0H@Z */
7969 DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale, 16)
7970 locale* __thiscall locale_ctor_locale_locale(locale *this, const locale *loc, const locale *other, category cat)
7972 FIXME("(%p %p %p %d) stub\n", this, loc, other, cat);
7976 /* ??0locale@std@@QAE@ABV01@@Z */
7977 /* ??0locale@std@@QEAA@AEBV01@@Z */
7978 DEFINE_THISCALL_WRAPPER(locale_copy_ctor, 8)
7979 locale* __thiscall locale_copy_ctor(locale *this, const locale *copy)
7981 TRACE("(%p %p)\n", this, copy);
7982 this->ptr = copy->ptr;
7983 locale_facet__Incref(&this->ptr->facet);
7987 /* ??0locale@std@@QAE@ABV01@PBDH@Z */
7988 /* ??0locale@std@@QEAA@AEBV01@PEBDH@Z */
7989 DEFINE_THISCALL_WRAPPER(locale_ctor_locale_cstr, 16)
7990 locale* __thiscall locale_ctor_locale_cstr(locale *this, const locale *loc, const char *locname, category cat)
7992 FIXME("(%p %p %s %d) stub\n", this, loc, locname, cat);
7996 /* ??0locale@std@@QAE@PBDH@Z */
7997 /* ??0locale@std@@QEAA@PEBDH@Z */
7998 DEFINE_THISCALL_WRAPPER(locale_ctor_cstr, 12)
7999 locale* __thiscall locale_ctor_cstr(locale *this, const char *locname, category cat)
8003 TRACE("(%p %s %d)\n", this, locname, cat);
8005 this->ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
8007 ERR("Out of memory\n");
8008 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
8010 this->ptr = locale__Init();
8012 _Locinfo_ctor_cat_cstr(&locinfo, cat, locname);
8013 if(!memcmp(MSVCP_basic_string_char_c_str(&locinfo.newlocname), "*", 2)) {
8014 _Locinfo_dtor(&locinfo);
8015 MSVCRT_operator_delete(this->ptr);
8016 throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
8019 locale__Locimp__Makeloc(&locinfo, cat, this->ptr, NULL);
8020 _Locinfo_dtor(&locinfo);
8025 /* ??0locale@std@@QAE@W4_Uninitialized@1@@Z */
8026 /* ??0locale@std@@QEAA@W4_Uninitialized@1@@Z */
8027 DEFINE_THISCALL_WRAPPER(locale_ctor_uninitialized, 8)
8028 locale* __thiscall locale_ctor_uninitialized(locale *this, int uninitialized)
8030 TRACE("(%p)\n", this);
8035 /* ??0locale@std@@QAE@XZ */
8036 /* ??0locale@std@@QEAA@XZ */
8037 DEFINE_THISCALL_WRAPPER(locale_ctor, 4)
8038 locale* __thiscall locale_ctor(locale *this)
8040 TRACE("(%p)\n", this);
8041 this->ptr = locale__Init();
8042 locale_facet__Incref(&this->ptr->facet);
8046 /* ??1locale@std@@QAE@XZ */
8047 /* ??1locale@std@@QEAA@XZ */
8048 DEFINE_THISCALL_WRAPPER(locale_dtor, 4)
8049 void __thiscall locale_dtor(locale *this)
8051 TRACE("(%p)\n", this);
8053 locale__Locimp_dtor(this->ptr);
8056 DEFINE_THISCALL_WRAPPER(MSVCP_locale_vector_dtor, 8)
8057 locale* __thiscall MSVCP_locale_vector_dtor(locale *this, unsigned int flags)
8059 TRACE("(%p %x)\n", this, flags);
8061 /* we have an array, with the number of elements stored before the first object */
8062 int i, *ptr = (int *)this-1;
8064 for(i=*ptr-1; i>=0; i--)
8065 locale_dtor(this+i);
8066 MSVCRT_operator_delete(ptr);
8070 MSVCRT_operator_delete(this);
8076 /* ??4locale@std@@QAEAAV01@ABV01@@Z */
8077 /* ??4locale@std@@QEAAAEAV01@AEBV01@@Z */
8078 DEFINE_THISCALL_WRAPPER(locale_operator_assign, 8)
8079 locale* __thiscall locale_operator_assign(locale *this, const locale *loc)
8081 FIXME("(%p %p) stub\n", this, loc);
8085 /* ??8locale@std@@QBE_NABV01@@Z */
8086 /* ??8locale@std@@QEBA_NAEBV01@@Z */
8087 DEFINE_THISCALL_WRAPPER(locale_operator_equal, 8)
8088 MSVCP_bool __thiscall locale_operator_equal(const locale *this, const locale *loc)
8090 FIXME("(%p %p) stub\n", this, loc);
8094 /* ??9locale@std@@QBE_NABV01@@Z */
8095 /* ??9locale@std@@QEBA_NAEBV01@@Z */
8096 DEFINE_THISCALL_WRAPPER(locale_operator_not_equal, 8)
8097 MSVCP_bool __thiscall locale_operator_not_equal(const locale *this, locale const *loc)
8099 FIXME("(%p %p) stub\n", this, loc);
8103 /* ?_Addfac@locale@std@@QAEAAV12@PAVfacet@12@II@Z */
8104 /* ?_Addfac@locale@std@@QEAAAEAV12@PEAVfacet@12@_K1@Z */
8105 DEFINE_THISCALL_WRAPPER(locale__Addfac, 16)
8106 locale* __thiscall locale__Addfac(locale *this, locale_facet *facet, MSVCP_size_t id, MSVCP_size_t catmask)
8108 TRACE("(%p %p %lu %lu)\n", this, facet, id, catmask);
8110 if(this->ptr->facet.refs > 1) {
8111 locale__Locimp *new_ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
8113 ERR("Out of memory\n");
8114 throw_exception(EXCEPTION_BAD_ALLOC, NULL);
8117 locale__Locimp_copy_ctor(new_ptr, this->ptr);
8118 locale_facet__Decref(&this->ptr->facet);
8119 this->ptr = new_ptr;
8122 locale__Locimp__Addfac(this->ptr, facet, id);
8125 MSVCP_basic_string_char_dtor(&this->ptr->name);
8126 MSVCP_basic_string_char_ctor_cstr(&this->ptr->name, "*");
8131 /* ?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z */
8132 /* ?_Getfacet@locale@std@@QEBAPEBVfacet@12@_K@Z */
8133 DEFINE_THISCALL_WRAPPER(locale__Getfacet, 8)
8134 const locale_facet* __thiscall locale__Getfacet(const locale *this, MSVCP_size_t id)
8138 TRACE("(%p %lu)\n", this, id);
8140 fac = id < this->ptr->facet_cnt ? this->ptr->facetvec[id] : NULL;
8141 if(fac || !this->ptr->transparent)
8144 return id < global_locale->facet_cnt ? global_locale->facetvec[id] : NULL;
8147 /* ?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ */
8148 /* ?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ */
8149 locale__Locimp* __cdecl locale__Getgloballocale(void)
8152 return global_locale;
8155 /* ?_Setgloballocale@locale@std@@CAXPAX@Z */
8156 /* ?_Setgloballocale@locale@std@@CAXPEAX@Z */
8157 void __cdecl locale__Setgloballocale(void *locimp)
8159 TRACE("(%p)\n", locimp);
8160 global_locale = locimp;
8163 /* ?classic@locale@std@@SAABV12@XZ */
8164 /* ?classic@locale@std@@SAAEBV12@XZ */
8165 const locale* __cdecl locale_classic(void)
8169 return &classic_locale;
8172 /* ?name@locale@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
8173 /* ?name@locale@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
8174 DEFINE_THISCALL_WRAPPER(locale_name, 8)
8175 basic_string_char* __thiscall locale_name(const locale *this, basic_string_char *ret)
8177 TRACE( "(%p)\n", this);
8178 MSVCP_basic_string_char_copy_ctor(ret, &this->ptr->name);
8182 /* ?global@locale@std@@SA?AV12@ABV12@@Z */
8183 /* ?global@locale@std@@SA?AV12@AEBV12@@Z */
8184 locale* __cdecl locale_global(locale *ret, const locale *loc)
8189 TRACE("(%p %p)\n", loc, ret);
8191 _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
8194 if(loc->ptr != global_locale) {
8195 locale_facet__Decref(&global_locale->facet);
8196 global_locale = loc->ptr;
8197 locale_facet__Incref(&global_locale->facet);
8199 for(i=LC_ALL+1; i<=LC_MAX; i++) {
8200 if((global_locale->catmask & (1<<(i-1))) == 0)
8202 setlocale(i, MSVCP_basic_string_char_c_str(&global_locale->name));
8205 _Lockit_dtor(&lock);
8209 DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@");
8210 DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@");
8211 DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@");
8212 DEFINE_RTTI_DATA1(collate_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@G@std@@");
8213 DEFINE_RTTI_DATA1(ctype_base, 0, &locale_facet_rtti_base_descriptor, ".?AUctype_base@std@@");
8214 DEFINE_RTTI_DATA2(ctype_char, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@D@std@@");
8215 DEFINE_RTTI_DATA2(ctype_wchar, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@_W@std@@");
8216 DEFINE_RTTI_DATA2(ctype_short, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@G@std@@");
8217 DEFINE_RTTI_DATA1(codecvt_base, 0, &locale_facet_rtti_base_descriptor, ".?AVcodecvt_base@std@@");
8218 DEFINE_RTTI_DATA2(codecvt_char, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@DDH@std@@");
8219 DEFINE_RTTI_DATA2(codecvt_wchar, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@_WDH@std@@");
8220 DEFINE_RTTI_DATA2(codecvt_short, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@GDH@std@@");
8221 DEFINE_RTTI_DATA1(numpunct_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@D@std@@");
8222 DEFINE_RTTI_DATA1(numpunct_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@_W@std@@");
8223 DEFINE_RTTI_DATA1(numpunct_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@G@std@@");
8224 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@@");
8225 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@@");
8226 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@@");
8227 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@@");
8228 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@@");
8231 void __asm_dummy_vtables(void) {
8233 __ASM_VTABLE(locale_facet, "");
8234 __ASM_VTABLE(collate_char,
8235 VTABLE_ADD_FUNC(collate_char_do_compare)
8236 VTABLE_ADD_FUNC(collate_char_do_transform)
8237 VTABLE_ADD_FUNC(collate_char_do_hash));
8238 __ASM_VTABLE(collate_wchar,
8239 VTABLE_ADD_FUNC(collate_wchar_do_compare)
8240 VTABLE_ADD_FUNC(collate_wchar_do_transform)
8241 VTABLE_ADD_FUNC(collate_wchar_do_hash));
8242 __ASM_VTABLE(collate_short,
8243 VTABLE_ADD_FUNC(collate_wchar_do_compare)
8244 VTABLE_ADD_FUNC(collate_wchar_do_transform)
8245 VTABLE_ADD_FUNC(collate_wchar_do_hash));
8246 __ASM_VTABLE(ctype_base, "");
8247 __ASM_VTABLE(ctype_char,
8248 VTABLE_ADD_FUNC(ctype_char_do_tolower)
8249 VTABLE_ADD_FUNC(ctype_char_do_tolower_ch)
8250 VTABLE_ADD_FUNC(ctype_char_do_toupper)
8251 VTABLE_ADD_FUNC(ctype_char_do_toupper_ch)
8252 VTABLE_ADD_FUNC(ctype_char_do_widen)
8253 VTABLE_ADD_FUNC(ctype_char_do_widen_ch)
8254 VTABLE_ADD_FUNC(ctype_char__Do_widen_s)
8255 VTABLE_ADD_FUNC(ctype_char_do_narrow)
8256 VTABLE_ADD_FUNC(ctype_char_do_narrow_ch)
8257 VTABLE_ADD_FUNC(ctype_char__Do_narrow_s));
8258 __ASM_VTABLE(ctype_wchar,
8259 VTABLE_ADD_FUNC(ctype_wchar_do_is)
8260 VTABLE_ADD_FUNC(ctype_wchar_do_is_ch)
8261 VTABLE_ADD_FUNC(ctype_wchar_do_scan_is)
8262 VTABLE_ADD_FUNC(ctype_wchar_do_scan_not)
8263 VTABLE_ADD_FUNC(ctype_wchar_do_tolower)
8264 VTABLE_ADD_FUNC(ctype_wchar_do_tolower_ch)
8265 VTABLE_ADD_FUNC(ctype_wchar_do_toupper)
8266 VTABLE_ADD_FUNC(ctype_wchar_do_toupper_ch)
8267 VTABLE_ADD_FUNC(ctype_wchar_do_widen)
8268 VTABLE_ADD_FUNC(ctype_wchar_do_widen_ch)
8269 VTABLE_ADD_FUNC(ctype_wchar__Do_widen_s)
8270 VTABLE_ADD_FUNC(ctype_wchar_do_narrow)
8271 VTABLE_ADD_FUNC(ctype_wchar_do_narrow_ch)
8272 VTABLE_ADD_FUNC(ctype_wchar__Do_narrow_s));
8273 __ASM_VTABLE(ctype_short,
8274 VTABLE_ADD_FUNC(ctype_wchar_do_is)
8275 VTABLE_ADD_FUNC(ctype_wchar_do_is_ch)
8276 VTABLE_ADD_FUNC(ctype_wchar_do_scan_is)
8277 VTABLE_ADD_FUNC(ctype_wchar_do_scan_not)
8278 VTABLE_ADD_FUNC(ctype_wchar_do_tolower)
8279 VTABLE_ADD_FUNC(ctype_wchar_do_tolower_ch)
8280 VTABLE_ADD_FUNC(ctype_wchar_do_toupper)
8281 VTABLE_ADD_FUNC(ctype_wchar_do_toupper_ch)
8282 VTABLE_ADD_FUNC(ctype_wchar_do_widen)
8283 VTABLE_ADD_FUNC(ctype_wchar_do_widen_ch)
8284 VTABLE_ADD_FUNC(ctype_wchar__Do_widen_s)
8285 VTABLE_ADD_FUNC(ctype_wchar_do_narrow)
8286 VTABLE_ADD_FUNC(ctype_wchar_do_narrow_ch)
8287 VTABLE_ADD_FUNC(ctype_wchar__Do_narrow_s));
8288 __ASM_VTABLE(codecvt_base,
8289 VTABLE_ADD_FUNC(codecvt_base_do_always_noconv)
8290 VTABLE_ADD_FUNC(codecvt_base_do_max_length)
8291 VTABLE_ADD_FUNC(codecvt_base_do_encoding));
8292 __ASM_VTABLE(codecvt_char,
8293 VTABLE_ADD_FUNC(codecvt_base_do_always_noconv)
8294 VTABLE_ADD_FUNC(codecvt_base_do_max_length)
8295 VTABLE_ADD_FUNC(codecvt_base_do_encoding)
8296 VTABLE_ADD_FUNC(codecvt_char_do_in)
8297 VTABLE_ADD_FUNC(codecvt_char_do_out)
8298 VTABLE_ADD_FUNC(codecvt_char_do_unshift)
8299 VTABLE_ADD_FUNC(codecvt_char_do_length));
8300 __ASM_VTABLE(codecvt_wchar,
8301 VTABLE_ADD_FUNC(codecvt_wchar_do_always_noconv)
8302 VTABLE_ADD_FUNC(codecvt_wchar_do_max_length)
8303 VTABLE_ADD_FUNC(codecvt_base_do_encoding)
8304 VTABLE_ADD_FUNC(codecvt_wchar_do_in)
8305 VTABLE_ADD_FUNC(codecvt_wchar_do_out)
8306 VTABLE_ADD_FUNC(codecvt_wchar_do_unshift)
8307 VTABLE_ADD_FUNC(codecvt_wchar_do_length));
8308 __ASM_VTABLE(codecvt_short,
8309 VTABLE_ADD_FUNC(codecvt_wchar_do_always_noconv)
8310 VTABLE_ADD_FUNC(codecvt_wchar_do_max_length)
8311 VTABLE_ADD_FUNC(codecvt_base_do_encoding)
8312 VTABLE_ADD_FUNC(codecvt_wchar_do_in)
8313 VTABLE_ADD_FUNC(codecvt_wchar_do_out)
8314 VTABLE_ADD_FUNC(codecvt_wchar_do_unshift)
8315 VTABLE_ADD_FUNC(codecvt_wchar_do_length));
8316 __ASM_VTABLE(numpunct_char,
8317 VTABLE_ADD_FUNC(numpunct_char_do_decimal_point)
8318 VTABLE_ADD_FUNC(numpunct_char_do_thousands_sep)
8319 VTABLE_ADD_FUNC(numpunct_char_do_grouping)
8320 VTABLE_ADD_FUNC(numpunct_char_do_falsename)
8321 VTABLE_ADD_FUNC(numpunct_char_do_truename));
8322 __ASM_VTABLE(numpunct_wchar,
8323 VTABLE_ADD_FUNC(numpunct_wchar_do_decimal_point)
8324 VTABLE_ADD_FUNC(numpunct_wchar_do_thousands_sep)
8325 VTABLE_ADD_FUNC(numpunct_wchar_do_grouping)
8326 VTABLE_ADD_FUNC(numpunct_wchar_do_falsename)
8327 VTABLE_ADD_FUNC(numpunct_wchar_do_truename));
8328 __ASM_VTABLE(numpunct_short,
8329 VTABLE_ADD_FUNC(numpunct_wchar_do_decimal_point)
8330 VTABLE_ADD_FUNC(numpunct_wchar_do_thousands_sep)
8331 VTABLE_ADD_FUNC(numpunct_wchar_do_grouping)
8332 VTABLE_ADD_FUNC(numpunct_wchar_do_falsename)
8333 VTABLE_ADD_FUNC(numpunct_wchar_do_truename));
8334 __ASM_VTABLE(num_get_char,
8335 VTABLE_ADD_FUNC(num_get_char_do_get_void)
8336 VTABLE_ADD_FUNC(num_get_char_do_get_double)
8337 VTABLE_ADD_FUNC(num_get_char_do_get_double)
8338 VTABLE_ADD_FUNC(num_get_char_do_get_float)
8339 VTABLE_ADD_FUNC(num_get_char_do_get_uint64)
8340 VTABLE_ADD_FUNC(num_get_char_do_get_int64)
8341 VTABLE_ADD_FUNC(num_get_char_do_get_ulong)
8342 VTABLE_ADD_FUNC(num_get_char_do_get_long)
8343 VTABLE_ADD_FUNC(num_get_char_do_get_uint)
8344 VTABLE_ADD_FUNC(num_get_char_do_get_ushort)
8345 VTABLE_ADD_FUNC(num_get_char_do_get_bool));
8346 __ASM_VTABLE(num_get_short,
8347 VTABLE_ADD_FUNC(num_get_wchar_do_get_void)
8348 VTABLE_ADD_FUNC(num_get_wchar_do_get_double)
8349 VTABLE_ADD_FUNC(num_get_wchar_do_get_double)
8350 VTABLE_ADD_FUNC(num_get_wchar_do_get_float)
8351 VTABLE_ADD_FUNC(num_get_wchar_do_get_uint64)
8352 VTABLE_ADD_FUNC(num_get_wchar_do_get_int64)
8353 VTABLE_ADD_FUNC(num_get_wchar_do_get_ulong)
8354 VTABLE_ADD_FUNC(num_get_wchar_do_get_long)
8355 VTABLE_ADD_FUNC(num_get_wchar_do_get_uint)
8356 VTABLE_ADD_FUNC(num_get_wchar_do_get_ushort)
8357 VTABLE_ADD_FUNC(num_get_wchar_do_get_bool));
8358 __ASM_VTABLE(num_get_wchar,
8359 VTABLE_ADD_FUNC(num_get_wchar_do_get_void)
8360 VTABLE_ADD_FUNC(num_get_wchar_do_get_double)
8361 VTABLE_ADD_FUNC(num_get_wchar_do_get_double)
8362 VTABLE_ADD_FUNC(num_get_wchar_do_get_float)
8363 VTABLE_ADD_FUNC(num_get_wchar_do_get_uint64)
8364 VTABLE_ADD_FUNC(num_get_wchar_do_get_int64)
8365 VTABLE_ADD_FUNC(num_get_wchar_do_get_ulong)
8366 VTABLE_ADD_FUNC(num_get_wchar_do_get_long)
8367 VTABLE_ADD_FUNC(num_get_wchar_do_get_uint)
8368 VTABLE_ADD_FUNC(num_get_wchar_do_get_ushort)
8369 VTABLE_ADD_FUNC(num_get_wchar_do_get_bool));
8370 __ASM_VTABLE(num_put_char,
8371 VTABLE_ADD_FUNC(num_put_char_do_put_ptr)
8372 VTABLE_ADD_FUNC(num_put_char_do_put_double)
8373 VTABLE_ADD_FUNC(num_put_char_do_put_double)
8374 VTABLE_ADD_FUNC(num_put_char_do_put_uint64)
8375 VTABLE_ADD_FUNC(num_put_char_do_put_int64)
8376 VTABLE_ADD_FUNC(num_put_char_do_put_ulong)
8377 VTABLE_ADD_FUNC(num_put_char_do_put_long)
8378 VTABLE_ADD_FUNC(num_put_char_do_put_bool));
8379 __ASM_VTABLE(num_put_wchar,
8380 VTABLE_ADD_FUNC(num_put_wchar_do_put_ptr)
8381 VTABLE_ADD_FUNC(num_put_wchar_do_put_double)
8382 VTABLE_ADD_FUNC(num_put_wchar_do_put_double)
8383 VTABLE_ADD_FUNC(num_put_wchar_do_put_uint64)
8384 VTABLE_ADD_FUNC(num_put_wchar_do_put_int64)
8385 VTABLE_ADD_FUNC(num_put_wchar_do_put_ulong)
8386 VTABLE_ADD_FUNC(num_put_wchar_do_put_long)
8387 VTABLE_ADD_FUNC(num_put_wchar_do_put_bool));
8392 void free_locale(void)
8394 facets_elem *iter, *safe;
8397 locale__Locimp_dtor(global_locale);
8398 locale_dtor(&classic_locale);
8401 LIST_FOR_EACH_ENTRY_SAFE(iter, safe, &lazy_facets, facets_elem, entry) {
8402 list_remove(&iter->entry);
8403 if(locale_facet__Decref(iter->fac))
8404 call_locale_facet_vector_dtor(iter->fac, 1);
8405 MSVCRT_operator_delete(iter);