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
28 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90
);
31 char* __cdecl
_Getdays(void);
35 typedef struct _locale_id
{
39 typedef struct _locale_facet
{
40 const vtable_ptr
*vtable
;
44 typedef struct _locale__Locimp
{
46 locale_facet
**facetvec
;
47 MSVCP_size_t facet_cnt
;
49 MSVCP_bool transparent
;
50 basic_string_char name
;
59 basic_string_char days
;
60 basic_string_char months
;
61 basic_string_char oldlocname
;
62 basic_string_char newlocname
;
82 /* ?_Id_cnt@id@locale@std@@0HA */
83 int locale_id__Id_cnt
= 0;
85 /* ?_Clocptr@_Locimp@locale@std@@0PAV123@A */
86 /* ?_Clocptr@_Locimp@locale@std@@0PEAV123@EA */
87 locale__Locimp
*locale__Locimp__Clocptr
= NULL
;
89 /* ??1facet@locale@std@@UAE@XZ */
90 /* ??1facet@locale@std@@UEAA@XZ */
91 DEFINE_THISCALL_WRAPPER(locale_facet_dtor
, 4)
92 void __thiscall
locale_facet_dtor(locale_facet
*this)
94 TRACE("(%p)\n", this);
97 DEFINE_THISCALL_WRAPPER(MSVCP_locale_facet_vector_dtor
, 8)
98 locale_facet
* __thiscall
MSVCP_locale_facet_vector_dtor(locale_facet
*this, unsigned int flags
)
100 TRACE("(%p %x)\n", this, flags
);
102 /* we have an array, with the number of elements stored before the first object */
103 int i
, *ptr
= (int *)this-1;
105 for(i
=*ptr
-1; i
>=0; i
--)
106 locale_facet_dtor(this+i
);
107 MSVCRT_operator_delete(ptr
);
109 locale_facet_dtor(this);
111 MSVCRT_operator_delete(this);
117 static const vtable_ptr MSVCP_locale_facet_vtable
[] = {
118 (vtable_ptr
)THISCALL_NAME(MSVCP_locale_facet_vector_dtor
)
121 static inline locale_facet
* call_locale_facet_vector_dtor(locale_facet
*this, unsigned int flags
)
126 __asm__
__volatile__ ("pushl %3\n\tcall *%2"
127 : "=a" (ret
), "=c" (dummy
)
128 : "r" (this->vtable
[0]), "r" (flags
), "1" (this)
133 static inline locale_facet
* call_locale_facet_vector_dtor(locale_facet
*this, unsigned int flags
)
135 locale_facet
* (__thiscall
*dtor
)(locale_facet
*, unsigned int) = (void *)this->vtable
[0];
136 return dtor(this, flags
);
140 /* ??0id@locale@std@@QAE@I@Z */
141 /* ??0id@locale@std@@QEAA@_K@Z */
142 DEFINE_THISCALL_WRAPPER(locale_id_ctor_id
, 8)
143 locale_id
* __thiscall
locale_id_ctor_id(locale_id
*this, MSVCP_size_t id
)
145 TRACE("(%p %lu)\n", this, id
);
151 /* ??_Fid@locale@std@@QAEXXZ */
152 /* ??_Fid@locale@std@@QEAAXXZ */
153 DEFINE_THISCALL_WRAPPER(locale_id_ctor
, 4)
154 locale_id
* __thiscall
locale_id_ctor(locale_id
*this)
156 TRACE("(%p)\n", this);
162 /* ??Bid@locale@std@@QAEIXZ */
163 /* ??Bid@locale@std@@QEAA_KXZ */
164 DEFINE_THISCALL_WRAPPER(locale_id_operator_size_t
, 4)
165 MSVCP_size_t __thiscall
locale_id_operator_size_t(locale_id
*this)
169 TRACE("(%p)\n", this);
172 _Lockit_ctor_locktype(&lock
, _LOCK_LOCALE
);
173 this->id
= ++locale_id__Id_cnt
;
180 /* ?_Id_cnt_func@id@locale@std@@CAAAHXZ */
181 /* ?_Id_cnt_func@id@locale@std@@CAAEAHXZ */
182 int* __cdecl
locale_id__Id_cnt_func(void)
185 return &locale_id__Id_cnt
;
188 /* ??_Ffacet@locale@std@@QAEXXZ */
189 /* ??_Ffacet@locale@std@@QEAAXXZ */
190 DEFINE_THISCALL_WRAPPER(locale_facet_ctor
, 4)
191 locale_facet
* __thiscall
locale_facet_ctor(locale_facet
*this)
193 TRACE("(%p)\n", this);
194 this->vtable
= MSVCP_locale_facet_vtable
;
199 /* ??0facet@locale@std@@IAE@I@Z */
200 /* ??0facet@locale@std@@IEAA@_K@Z */
201 DEFINE_THISCALL_WRAPPER(locale_facet_ctor_refs
, 8)
202 locale_facet
* __thiscall
locale_facet_ctor_refs(locale_facet
*this, MSVCP_size_t refs
)
204 TRACE("(%p %lu)\n", this, refs
);
205 this->vtable
= MSVCP_locale_facet_vtable
;
210 /* ?_Incref@facet@locale@std@@QAEXXZ */
211 /* ?_Incref@facet@locale@std@@QEAAXXZ */
212 DEFINE_THISCALL_WRAPPER(locale_facet__Incref
, 4)
213 void __thiscall
locale_facet__Incref(locale_facet
*this)
217 TRACE("(%p)\n", this);
219 _Lockit_ctor_locktype(&lock
, _LOCK_LOCALE
);
224 /* ?_Decref@facet@locale@std@@QAEPAV123@XZ */
225 /* ?_Decref@facet@locale@std@@QEAAPEAV123@XZ */
226 DEFINE_THISCALL_WRAPPER(locale_facet__Decref
, 4)
227 locale_facet
* __thiscall
locale_facet__Decref(locale_facet
*this)
232 TRACE("(%p)\n", this);
234 _Lockit_ctor_locktype(&lock
, _LOCK_LOCALE
);
238 ret
= this->refs
? NULL
: this;
244 /* ?_Getcat@facet@locale@std@@SAIPAPBV123@PBV23@@Z */
245 /* ?_Getcat@facet@locale@std@@SA_KPEAPEBV123@PEBV23@@Z */
246 MSVCP_size_t __cdecl
locale_facet__Getcat(const locale_facet
**facet
, const locale
*loc
)
248 TRACE("(%p %p)\n", facet
, loc
);
252 /* ??0_Locimp@locale@std@@AAE@_N@Z */
253 /* ??0_Locimp@locale@std@@AEAA@_N@Z */
254 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor_transparent
, 8)
255 locale__Locimp
* __thiscall
locale__Locimp_ctor_transparent(locale__Locimp
*this, MSVCP_bool transparent
)
257 TRACE("(%p %d)\n", this, transparent
);
259 memset(this, 0, sizeof(locale__Locimp
));
260 locale_facet_ctor_refs(&this->facet
, 1);
261 this->transparent
= transparent
;
262 MSVCP_basic_string_char_ctor_cstr(&this->name
, "*");
266 /* ??_F_Locimp@locale@std@@QAEXXZ */
267 /* ??_F_Locimp@locale@std@@QEAAXXZ */
268 DEFINE_THISCALL_WRAPPER(locale__Locimp_ctor
, 4)
269 locale__Locimp
* __thiscall
locale__Locimp_ctor(locale__Locimp
*this)
271 return locale__Locimp_ctor_transparent(this, FALSE
);
274 /* ??0_Locimp@locale@std@@AAE@ABV012@@Z */
275 /* ??0_Locimp@locale@std@@AEAA@AEBV012@@Z */
276 DEFINE_THISCALL_WRAPPER(locale__Locimp_copy_ctor
, 8)
277 locale__Locimp
* __thiscall
locale__Locimp_copy_ctor(locale__Locimp
*this, const locale__Locimp
*copy
)
282 TRACE("(%p %p)\n", this, copy
);
284 _Lockit_ctor_locktype(&lock
, _LOCK_LOCALE
);
285 memcpy(this, copy
, sizeof(locale__Locimp
));
286 locale_facet_ctor_refs(&this->facet
, 1);
288 this->facetvec
= MSVCRT_operator_new(copy
->facet_cnt
*sizeof(locale_facet
*));
289 if(!this->facetvec
) {
291 ERR("Out of memory\n");
292 throw_exception(EXCEPTION_BAD_ALLOC
, NULL
);
295 for(i
=0; i
<this->facet_cnt
; i
++)
296 if(this->facetvec
[i
])
297 locale_facet__Incref(this->facetvec
[i
]);
299 MSVCP_basic_string_char_copy_ctor(&this->name
, ©
->name
);
304 /* ?_Locimp_ctor@_Locimp@locale@std@@CAXPAV123@ABV123@@Z */
305 /* ?_Locimp_ctor@_Locimp@locale@std@@CAXPEAV123@AEBV123@@Z */
306 locale__Locimp
* __cdecl
locale__Locimp__Locimp_ctor(locale__Locimp
*this, const locale__Locimp
*copy
)
308 return locale__Locimp_copy_ctor(this, copy
);
311 /* ??1_Locimp@locale@std@@MAE@XZ */
312 /* ??1_Locimp@locale@std@@MEAA@XZ */
313 DEFINE_THISCALL_WRAPPER(locale__Locimp_dtor
, 4)
314 void __thiscall
locale__Locimp_dtor(locale__Locimp
*this)
316 TRACE("(%p)\n", this);
318 if(locale_facet__Decref(&this->facet
)) {
320 for(i
=0; i
<this->facet_cnt
; i
++)
321 if(this->facetvec
[i
] && locale_facet__Decref(this->facetvec
[i
]))
322 call_locale_facet_vector_dtor(this->facetvec
[i
], 0);
324 MSVCRT_operator_delete(this->facetvec
);
325 MSVCP_basic_string_char_dtor(&this->name
);
329 /* ?_Locimp_dtor@_Locimp@locale@std@@CAXPAV123@@Z */
330 /* ?_Locimp_dtor@_Locimp@locale@std@@CAXPEAV123@@Z */
331 void __cdecl
locale__Locimp__Locimp_dtor(locale__Locimp
*this)
333 locale__Locimp_dtor(this);
336 DEFINE_THISCALL_WRAPPER(MSVCP_locale__Locimp_vector_dtor
, 8)
337 locale__Locimp
* __thiscall
MSVCP_locale__Locimp_vector_dtor(locale__Locimp
*this, unsigned int flags
)
339 TRACE("(%p %x)\n", this, flags
);
341 /* we have an array, with the number of elements stored before the first object */
342 int i
, *ptr
= (int *)this-1;
344 for(i
=*ptr
-1; i
>=0; i
--)
345 locale__Locimp_dtor(this+i
);
346 MSVCRT_operator_delete(ptr
);
348 locale__Locimp_dtor(this);
350 MSVCRT_operator_delete(this);
356 /* ?_Locimp_Addfac@_Locimp@locale@std@@CAXPAV123@PAVfacet@23@I@Z */
357 /* ?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z */
358 void __cdecl
locale__Locimp__Locimp_Addfac(locale__Locimp
*locimp
, locale_facet
*facet
, MSVCP_size_t id
)
362 TRACE("(%p %p %lu)\n", locimp
, facet
, id
);
364 _Lockit_ctor_locktype(&lock
, _LOCK_LOCALE
);
365 if(id
>= locimp
->facet_cnt
) {
366 MSVCP_size_t new_size
= id
+1;
367 locale_facet
**new_facetvec
;
369 if(new_size
< locale_id__Id_cnt
+1)
370 new_size
= locale_id__Id_cnt
+1;
372 new_facetvec
= MSVCRT_operator_new(sizeof(locale_facet
*)*new_size
);
375 ERR("Out of memory\n");
376 throw_exception(EXCEPTION_BAD_ALLOC
, NULL
);
380 memset(new_facetvec
, 0, sizeof(locale_facet
*)*new_size
);
381 memcpy(new_facetvec
, locimp
->facetvec
, sizeof(locale_facet
*)*locimp
->facet_cnt
);
382 MSVCRT_operator_delete(locimp
->facetvec
);
383 locimp
->facetvec
= new_facetvec
;
384 locimp
->facet_cnt
= new_size
;
387 if(locimp
->facetvec
[id
] && locale_facet__Decref(locimp
->facetvec
[id
]))
388 call_locale_facet_vector_dtor(locimp
->facetvec
[id
], 0);
390 locimp
->facetvec
[id
] = facet
;
392 locale_facet__Incref(facet
);
396 /* ?_Addfac@_Locimp@locale@std@@AAEXPAVfacet@23@I@Z */
397 /* ?_Addfac@_Locimp@locale@std@@AEAAXPEAVfacet@23@_K@Z */
398 DEFINE_THISCALL_WRAPPER(locale__Locimp__Addfac
, 12)
399 void __thiscall
locale__Locimp__Addfac(locale__Locimp
*this, locale_facet
*facet
, MSVCP_size_t id
)
401 locale__Locimp__Locimp_Addfac(this, facet
, id
);
404 /* ?_Clocptr_func@_Locimp@locale@std@@CAAAPAV123@XZ */
405 /* ?_Clocptr_func@_Locimp@locale@std@@CAAEAPEAV123@XZ */
406 locale__Locimp
** __cdecl
locale__Locimp__Clocptr_func(void)
412 /* ?_Makeloc@_Locimp@locale@std@@CAPAV123@ABV_Locinfo@3@HPAV123@PBV23@@Z */
413 /* ?_Makeloc@_Locimp@locale@std@@CAPEAV123@AEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
414 locale__Locimp
* __cdecl
locale__Locimp__Makeloc(const _Locinfo
*locinfo
, category cat
, locale__Locimp
*locimp
, const locale
*loc
)
416 FIXME("(%p %d %p %p) stub\n", locinfo
, cat
, locimp
, loc
);
420 /* ?_Makeushloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
421 /* ?_Makeushloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
422 void __cdecl
locale__Locimp__Makeushloc(const _Locinfo
*locinfo
, category cat
, locale__Locimp
*locimp
, const locale
*loc
)
424 FIXME("(%p %d %p %p) stub\n", locinfo
, cat
, locimp
, loc
);
427 /* ?_Makewloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
428 /* ?_Makewloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
429 void __cdecl
locale__Locimp__Makewloc(const _Locinfo
*locinfo
, category cat
, locale__Locimp
*locimp
, const locale
*loc
)
431 FIXME("(%p %d %p %p) stub\n", locinfo
, cat
, locimp
, loc
);
434 /* ?_Makexloc@_Locimp@locale@std@@CAXABV_Locinfo@3@HPAV123@PBV23@@Z */
435 /* ?_Makexloc@_Locimp@locale@std@@CAXAEBV_Locinfo@3@HPEAV123@PEBV23@@Z */
436 void __cdecl
locale__Locimp__Makexloc(const _Locinfo
*locinfo
, category cat
, locale__Locimp
*locimp
, const locale
*loc
)
438 FIXME("(%p %d %p %p) stub\n", locinfo
, cat
, locimp
, loc
);
441 /* ??_7_Locimp@locale@std@@6B@ */
442 const vtable_ptr MSVCP_locale__Locimp_vtable
[] = {
443 (vtable_ptr
)THISCALL_NAME(MSVCP_locale__Locimp_vector_dtor
)
446 /* ??0locale@std@@AAE@PAV_Locimp@01@@Z */
447 /* ??0locale@std@@AEAA@PEAV_Locimp@01@@Z */
448 DEFINE_THISCALL_WRAPPER(locale_ctor_locimp
, 8)
449 locale
* __thiscall
locale_ctor_locimp(locale
*this, locale__Locimp
*locimp
)
451 TRACE("(%p %p)\n", this, locimp
);
452 /* Don't change locimp reference counter */
457 /* ??0locale@std@@QAE@ABV01@0H@Z */
458 /* ??0locale@std@@QEAA@AEBV01@0H@Z */
459 DEFINE_THISCALL_WRAPPER(locale_ctor_locale_locale
, 16)
460 locale
* __thiscall
locale_ctor_locale_locale(locale
*this, const locale
*loc
, const locale
*other
, category cat
)
462 FIXME("(%p %p %p %d) stub\n", this, loc
, other
, cat
);
466 /* ??0locale@std@@QAE@ABV01@@Z */
467 /* ??0locale@std@@QEAA@AEBV01@@Z */
468 DEFINE_THISCALL_WRAPPER(locale_copy_ctor
, 8)
469 locale
* __thiscall
locale_copy_ctor(locale
*this, const locale
*copy
)
471 TRACE("(%p %p)\n", this, copy
);
472 this->ptr
= copy
->ptr
;
473 locale_facet__Incref(&this->ptr
->facet
);
477 /* ??0locale@std@@QAE@ABV01@PBDH@Z */
478 /* ??0locale@std@@QEAA@AEBV01@PEBDH@Z */
479 DEFINE_THISCALL_WRAPPER(locale_ctor_locale_cstr
, 16)
480 locale
* __thiscall
locale_ctor_locale_cstr(locale
*this, const locale
*loc
, const char *locname
, category cat
)
482 FIXME("(%p %p %s %d) stub\n", this, loc
, locname
, cat
);
486 /* ??0locale@std@@QAE@PBDH@Z */
487 /* ??0locale@std@@QEAA@PEBDH@Z */
488 DEFINE_THISCALL_WRAPPER(locale_ctor_cstr
, 12)
489 locale
* __thiscall
locale_ctor_cstr(locale
*this, const char *locname
, category cat
)
491 FIXME("(%p %s %d) stub\n", this, locname
, cat
);
495 /* ??0locale@std@@QAE@W4_Uninitialized@1@@Z */
496 /* ??0locale@std@@QEAA@W4_Uninitialized@1@@Z */
497 DEFINE_THISCALL_WRAPPER(locale_ctor_uninitialized
, 8)
498 locale
* __thiscall
locale_ctor_uninitialized(locale
*this, int uninitialized
)
500 TRACE("(%p)\n", this);
505 /* ??0locale@std@@QAE@XZ */
506 /* ??0locale@std@@QEAA@XZ */
507 DEFINE_THISCALL_WRAPPER(locale_ctor
, 4)
508 locale
* __thiscall
locale_ctor(locale
*this)
510 TRACE("(%p)\n", this);
511 this->ptr
= MSVCRT_operator_new(sizeof(locale__Locimp
));
513 ERR("Out of memory\n");
514 throw_exception(EXCEPTION_BAD_ALLOC
, NULL
);
518 locale__Locimp_ctor(this->ptr
);
522 /* ??1locale@std@@QAE@XZ */
523 /* ??1locale@std@@QEAA@XZ */
524 DEFINE_THISCALL_WRAPPER(locale_dtor
, 4)
525 void __thiscall
locale_dtor(locale
*this)
527 TRACE("(%p)\n", this);
529 locale__Locimp_dtor(this->ptr
);
532 DEFINE_THISCALL_WRAPPER(MSVCP_locale_vector_dtor
, 8)
533 locale
* __thiscall
MSVCP_locale_vector_dtor(locale
*this, unsigned int flags
)
535 TRACE("(%p %x)\n", this, flags
);
537 /* we have an array, with the number of elements stored before the first object */
538 int i
, *ptr
= (int *)this-1;
540 for(i
=*ptr
-1; i
>=0; i
--)
542 MSVCRT_operator_delete(ptr
);
546 MSVCRT_operator_delete(this);
552 /* ??4locale@std@@QAEAAV01@ABV01@@Z */
553 /* ??4locale@std@@QEAAAEAV01@AEBV01@@Z */
554 DEFINE_THISCALL_WRAPPER(locale_operator_assign
, 8)
555 locale
* __thiscall
locale_operator_assign(locale
*this, const locale
*loc
)
557 FIXME("(%p %p) stub\n", this, loc
);
561 /* ??8locale@std@@QBE_NABV01@@Z */
562 /* ??8locale@std@@QEBA_NAEBV01@@Z */
563 DEFINE_THISCALL_WRAPPER(locale_operator_equal
, 8)
564 MSVCP_bool __thiscall
locale_operator_equal(const locale
*this, const locale
*loc
)
566 FIXME("(%p %p) stub\n", this, loc
);
570 /* ??9locale@std@@QBE_NABV01@@Z */
571 /* ??9locale@std@@QEBA_NAEBV01@@Z */
572 DEFINE_THISCALL_WRAPPER(locale_operator_not_equal
, 8)
573 MSVCP_bool __thiscall
locale_operator_not_equal(const locale
*this, locale
const *loc
)
575 FIXME("(%p %p) stub\n", this, loc
);
579 /* ?_Addfac@locale@std@@QAEAAV12@PAVfacet@12@II@Z */
580 /* ?_Addfac@locale@std@@QEAAAEAV12@PEAVfacet@12@_K1@Z */
581 DEFINE_THISCALL_WRAPPER(locale__Addfac
, 16)
582 locale
* __thiscall
locale__Addfac(locale
*this, locale_facet
*facet
, MSVCP_size_t id
, MSVCP_size_t catmask
)
584 TRACE("(%p %p %lu %lu)\n", this, facet
, id
, catmask
);
586 if(this->ptr
->facet
.refs
> 1) {
587 locale__Locimp
*new_ptr
= MSVCRT_operator_new(sizeof(locale__Locimp
));
589 ERR("Out of memory\n");
590 throw_exception(EXCEPTION_BAD_ALLOC
, NULL
);
593 locale__Locimp_copy_ctor(new_ptr
, this->ptr
);
594 locale_facet__Decref(&this->ptr
->facet
);
598 locale__Locimp__Addfac(this->ptr
, facet
, id
);
601 MSVCP_basic_string_char_dtor(&this->ptr
->name
);
602 MSVCP_basic_string_char_ctor_cstr(&this->ptr
->name
, "*");
607 /* ?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z */
608 /* ?_Getfacet@locale@std@@QEBAPEBVfacet@12@_K@Z */
609 DEFINE_THISCALL_WRAPPER(locale__Getfacet
, 8)
610 const locale_facet
* __thiscall
locale__Getfacet(const locale
*this, MSVCP_size_t id
)
612 FIXME("(%p %lu) stub\n", this, id
);
616 /* ?_Init@locale@std@@CAPAV_Locimp@12@XZ */
617 /* ?_Init@locale@std@@CAPEAV_Locimp@12@XZ */
618 locale__Locimp
* __cdecl
locale__Init(void)
624 /* ?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ */
625 /* ?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ */
626 locale__Locimp
* __cdecl
locale__Getgloballocale(void)
632 /* ?_Setgloballocale@locale@std@@CAXPAX@Z */
633 /* ?_Setgloballocale@locale@std@@CAXPEAX@Z */
634 void __cdecl
locale__Setgloballocale(void *locimp
)
636 FIXME("(%p) stub\n", locimp
);
639 /* ?classic@locale@std@@SAABV12@XZ */
640 /* ?classic@locale@std@@SAAEBV12@XZ */
641 const locale
* __cdecl
locale_classic(void)
647 /* ?name@locale@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
648 /* ?name@locale@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
649 DEFINE_THISCALL_WRAPPER_RETPTR(locale_name
, 4)
650 basic_string_char __thiscall
locale_name(const locale
*this)
652 TRACE( "(%p)\n", this);
653 return this->ptr
->name
;
656 /* ??0_Timevec@std@@QAE@ABV01@@Z */
657 /* ??0_Timevec@std@@QEAA@AEBV01@@Z */
658 /* This copy constructor modifies copied object */
659 DEFINE_THISCALL_WRAPPER(_Timevec_copy_ctor
, 8)
660 _Timevec
* __thiscall
_Timevec_copy_ctor(_Timevec
*this, _Timevec
*copy
)
662 TRACE("(%p %p)\n", this, copy
);
663 this->timeptr
= copy
->timeptr
;
664 copy
->timeptr
= NULL
;
668 /* ??0_Timevec@std@@QAE@PAX@Z */
669 /* ??0_Timevec@std@@QEAA@PEAX@Z */
670 DEFINE_THISCALL_WRAPPER(_Timevec_ctor_timeptr
, 8)
671 _Timevec
* __thiscall
_Timevec_ctor_timeptr(_Timevec
*this, void *timeptr
)
673 TRACE("(%p %p)\n", this, timeptr
);
674 this->timeptr
= timeptr
;
678 /* ??_F_Timevec@std@@QAEXXZ */
679 /* ??_F_Timevec@std@@QEAAXXZ */
680 DEFINE_THISCALL_WRAPPER(_Timevec_ctor
, 4)
681 _Timevec
* __thiscall
_Timevec_ctor(_Timevec
*this)
683 TRACE("(%p)\n", this);
684 this->timeptr
= NULL
;
688 /* ??1_Timevec@std@@QAE@XZ */
689 /* ??1_Timevec@std@@QEAA@XZ */
690 DEFINE_THISCALL_WRAPPER(_Timevec_dtor
, 4)
691 void __thiscall
_Timevec_dtor(_Timevec
*this)
693 TRACE("(%p)\n", this);
694 MSVCRT_operator_delete(this->timeptr
);
697 /* ??4_Timevec@std@@QAEAAV01@ABV01@@Z */
698 /* ??4_Timevec@std@@QEAAAEAV01@AEBV01@@Z */
699 DEFINE_THISCALL_WRAPPER(_Timevec_op_assign
, 8)
700 _Timevec
* __thiscall
_Timevec_op_assign(_Timevec
*this, _Timevec
*right
)
702 TRACE("(%p %p)\n", this, right
);
703 this->timeptr
= right
->timeptr
;
704 right
->timeptr
= NULL
;
708 /* ?_Getptr@_Timevec@std@@QBEPAXXZ */
709 /* ?_Getptr@_Timevec@std@@QEBAPEAXXZ */
710 DEFINE_THISCALL_WRAPPER(_Timevec__Getptr
, 4)
711 void* __thiscall
_Timevec__Getptr(_Timevec
*this)
713 TRACE("(%p)\n", this);
714 return this->timeptr
;
717 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@HPBD@Z */
718 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@HPEBD@Z */
719 _Locinfo
* __cdecl
_Locinfo__Locinfo_ctor_cat_cstr(_Locinfo
*locinfo
, int category
, const char *locstr
)
721 const char *locale
= NULL
;
723 /* This function is probably modifying more global objects */
724 FIXME("(%p %d %s) semi-stub\n", locinfo
, category
, locstr
);
727 throw_exception(EXCEPTION_RUNTIME_ERROR
, "bad locale name");
729 _Lockit_ctor_locktype(&locinfo
->lock
, _LOCK_LOCALE
);
730 MSVCP_basic_string_char_ctor_cstr(&locinfo
->days
, "");
731 MSVCP_basic_string_char_ctor_cstr(&locinfo
->months
, "");
732 MSVCP_basic_string_char_ctor_cstr(&locinfo
->oldlocname
, setlocale(LC_ALL
, NULL
));
735 locale
= setlocale(LC_ALL
, locstr
);
737 locale
= setlocale(LC_ALL
, NULL
);
740 MSVCP_basic_string_char_ctor_cstr(&locinfo
->newlocname
, locale
);
742 MSVCP_basic_string_char_ctor_cstr(&locinfo
->newlocname
, "*");
743 _Lockit_dtor(&locinfo
->lock
);
748 /* ??0_Locinfo@std@@QAE@HPBD@Z */
749 /* ??0_Locinfo@std@@QEAA@HPEBD@Z */
750 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_cat_cstr
, 12)
751 _Locinfo
* __thiscall
_Locinfo_ctor_cat_cstr(_Locinfo
*this, int category
, const char *locstr
)
753 return _Locinfo__Locinfo_ctor_cat_cstr(this, category
, locstr
);
756 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
757 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z */
758 _Locinfo
* __cdecl
_Locinfo__Locinfo_ctor_bstr(_Locinfo
*locinfo
, const basic_string_char
*locstr
)
760 return _Locinfo__Locinfo_ctor_cat_cstr(locinfo
, 1/*FIXME*/, MSVCP_basic_string_char_c_str(locstr
));
763 /* ??0_Locinfo@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z */
764 /* ??0_Locinfo@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z */
765 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_bstr
, 8)
766 _Locinfo
* __thiscall
_Locinfo_ctor_bstr(_Locinfo
*this, const basic_string_char
*locstr
)
768 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, MSVCP_basic_string_char_c_str(locstr
));
771 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z */
772 /* ?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z */
773 _Locinfo
* __cdecl
_Locinfo__Locinfo_ctor_cstr(_Locinfo
*locinfo
, const char *locstr
)
775 return _Locinfo__Locinfo_ctor_cat_cstr(locinfo
, 1/*FIXME*/, locstr
);
778 /* ??0_Locinfo@std@@QAE@PBD@Z */
779 /* ??0_Locinfo@std@@QEAA@PEBD@Z */
780 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor_cstr
, 8)
781 _Locinfo
* __thiscall
_Locinfo_ctor_cstr(_Locinfo
*this, const char *locstr
)
783 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, locstr
);
786 /* ?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z */
787 /* ?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z */
788 void __cdecl
_Locinfo__Locinfo_dtor(_Locinfo
*locinfo
)
790 TRACE("(%p)\n", locinfo
);
792 setlocale(LC_ALL
, MSVCP_basic_string_char_c_str(&locinfo
->oldlocname
));
793 MSVCP_basic_string_char_dtor(&locinfo
->days
);
794 MSVCP_basic_string_char_dtor(&locinfo
->months
);
795 MSVCP_basic_string_char_dtor(&locinfo
->oldlocname
);
796 MSVCP_basic_string_char_dtor(&locinfo
->newlocname
);
799 /* ??_F_Locinfo@std@@QAEXXZ */
800 /* ??_F_Locinfo@std@@QEAAXXZ */
801 DEFINE_THISCALL_WRAPPER(_Locinfo_ctor
, 4)
802 _Locinfo
* __thiscall
_Locinfo_ctor(_Locinfo
*this)
804 return _Locinfo__Locinfo_ctor_cat_cstr(this, 1/*FIXME*/, "C");
807 /* ??1_Locinfo@std@@QAE@XZ */
808 /* ??1_Locinfo@std@@QEAA@XZ */
809 DEFINE_THISCALL_WRAPPER(_Locinfo_dtor
, 4)
810 void __thiscall
_Locinfo_dtor(_Locinfo
*this)
812 _Locinfo__Locinfo_dtor(this);
815 /* ?_Locinfo_Addcats@_Locinfo@std@@SAAAV12@PAV12@HPBD@Z */
816 /* ?_Locinfo_Addcats@_Locinfo@std@@SAAEAV12@PEAV12@HPEBD@Z */
817 _Locinfo
* __cdecl
_Locinfo__Locinfo_Addcats(_Locinfo
*locinfo
, int category
, const char *locstr
)
819 const char *locale
= NULL
;
821 /* This function is probably modifying more global objects */
822 FIXME("(%p %d %s) semi-stub\n", locinfo
, category
, locstr
);
824 throw_exception(EXCEPTION_RUNTIME_ERROR
, "bad locale name");
826 _Lockit_ctor_locktype(&locinfo
->lock
, _LOCK_LOCALE
);
827 MSVCP_basic_string_char_dtor(&locinfo
->newlocname
);
830 locale
= setlocale(LC_ALL
, locstr
);
832 locale
= setlocale(LC_ALL
, NULL
);
835 MSVCP_basic_string_char_ctor_cstr(&locinfo
->newlocname
, locale
);
837 MSVCP_basic_string_char_ctor_cstr(&locinfo
->newlocname
, "*");
838 _Lockit_dtor(&locinfo
->lock
);
843 /* ?_Addcats@_Locinfo@std@@QAEAAV12@HPBD@Z */
844 /* ?_Addcats@_Locinfo@std@@QEAAAEAV12@HPEBD@Z */
845 DEFINE_THISCALL_WRAPPER(_Locinfo__Addcats
, 12)
846 _Locinfo
* __thiscall
_Locinfo__Addcats(_Locinfo
*this, int category
, const char *locstr
)
848 return _Locinfo__Locinfo_Addcats(this, category
, locstr
);
852 _Collvec __cdecl
_Getcoll(void)
855 _locale_t locale
= _get_current_locale();
859 ret
.page
= locale
->locinfo
->lc_collate_cp
;
860 ret
.handle
= locale
->locinfo
->lc_handle
[LC_COLLATE
];
861 _free_locale(locale
);
865 /* ?_Getcoll@_Locinfo@std@@QBE?AU_Collvec@@XZ */
866 /* ?_Getcoll@_Locinfo@std@@QEBA?AU_Collvec@@XZ */
867 DEFINE_THISCALL_WRAPPER(_Locinfo__Getcoll
, 4)
868 _Collvec __thiscall
_Locinfo__Getcoll(const _Locinfo
*this)
874 _Ctypevec __cdecl
_Getctype(void)
877 _locale_t locale
= _get_current_locale();
881 ret
.page
= locale
->locinfo
->lc_codepage
;
882 ret
.handle
= locale
->locinfo
->lc_handle
[LC_COLLATE
];
884 ret
.table
= malloc(sizeof(short[256]));
886 _free_locale(locale
);
887 throw_exception(EXCEPTION_BAD_ALLOC
, NULL
);
889 memcpy(ret
.table
, locale
->locinfo
->pctype
, sizeof(short[256]));
890 _free_locale(locale
);
894 /* ?_Getctype@_Locinfo@std@@QBE?AU_Ctypevec@@XZ */
895 /* ?_Getctype@_Locinfo@std@@QEBA?AU_Ctypevec@@XZ */
896 DEFINE_THISCALL_WRAPPER_RETPTR(_Locinfo__Getctype
, 4)
897 _Ctypevec __thiscall
_Locinfo__Getctype(const _Locinfo
*this)
903 _Cvtvec __cdecl
_Getcvt(void)
906 _locale_t locale
= _get_current_locale();
910 ret
.page
= locale
->locinfo
->lc_codepage
;
911 ret
.handle
= locale
->locinfo
->lc_handle
[LC_CTYPE
];
912 _free_locale(locale
);
916 /* ?_Getcvt@_Locinfo@std@@QBE?AU_Cvtvec@@XZ */
917 /* ?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@XZ */
918 DEFINE_THISCALL_WRAPPER(_Locinfo__Getcvt
, 4)
919 _Cvtvec __thiscall
_Locinfo__Getcvt(const _Locinfo
*this)
924 /* ?_Getdateorder@_Locinfo@std@@QBEHXZ */
925 /* ?_Getdateorder@_Locinfo@std@@QEBAHXZ */
926 DEFINE_THISCALL_WRAPPER(_Locinfo__Getdateorder
, 4)
927 int __thiscall
_Locinfo__Getdateorder(const _Locinfo
*this)
929 FIXME("(%p) stub\n", this);
933 /* ?_Getdays@_Locinfo@std@@QBEPBDXZ */
934 /* ?_Getdays@_Locinfo@std@@QEBAPEBDXZ */
935 DEFINE_THISCALL_WRAPPER(_Locinfo__Getdays
, 4)
936 const char* __thiscall
_Locinfo__Getdays(_Locinfo
*this)
938 char *days
= _Getdays();
940 TRACE("(%p)\n", this);
943 MSVCP_basic_string_char_dtor(&this->days
);
944 MSVCP_basic_string_char_ctor_cstr(&this->days
, days
);
948 return this->days
.size
? MSVCP_basic_string_char_c_str(&this->days
) :
949 ":Sun:Sunday:Mon:Monday:Tue:Tuesday:Wed:Wednesday:Thu:Thursday:Fri:Friday:Sat:Saturday";
952 /* ?_Getmonths@_Locinfo@std@@QBEPBDXZ */
953 /* ?_Getmonths@_Locinfo@std@@QEBAPEBDXZ */
954 DEFINE_THISCALL_WRAPPER(_Locinfo__Getmonths
, 4)
955 const char* __thiscall
_Locinfo__Getmonths(const _Locinfo
*this)
957 FIXME("(%p) stub\n", this);
961 /* ?_Getfalse@_Locinfo@std@@QBEPBDXZ */
962 /* ?_Getfalse@_Locinfo@std@@QEBAPEBDXZ */
963 DEFINE_THISCALL_WRAPPER(_Locinfo__Getfalse
, 4)
964 const char* __thiscall
_Locinfo__Getfalse(const _Locinfo
*this)
966 TRACE("(%p)\n", this);
970 /* ?_Gettrue@_Locinfo@std@@QBEPBDXZ */
971 /* ?_Gettrue@_Locinfo@std@@QEBAPEBDXZ */
972 DEFINE_THISCALL_WRAPPER(_Locinfo__Gettrue
, 4)
973 const char* __thiscall
_Locinfo__Gettrue(const _Locinfo
*this)
975 TRACE("(%p)\n", this);
979 /* ?_Getlconv@_Locinfo@std@@QBEPBUlconv@@XZ */
980 /* ?_Getlconv@_Locinfo@std@@QEBAPEBUlconv@@XZ */
981 DEFINE_THISCALL_WRAPPER(_Locinfo__Getlconv
, 4)
982 const struct lconv
* __thiscall
_Locinfo__Getlconv(const _Locinfo
*this)
984 TRACE("(%p)\n", this);
988 /* ?_Getname@_Locinfo@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
989 /* ?_Getname@_Locinfo@std@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ */
990 DEFINE_THISCALL_WRAPPER_RETPTR(_Locinfo__Getname
, 4)
991 basic_string_char __thiscall
_Locinfo__Getname(const _Locinfo
*this)
993 basic_string_char ret
;
995 TRACE("(%p)\n", this);
997 MSVCP_basic_string_char_copy_ctor(&ret
, &this->newlocname
);
1001 /* ?_Gettnames@_Locinfo@std@@QBE?AV_Timevec@2@XZ */
1002 /* ?_Gettnames@_Locinfo@std@@QEBA?AV_Timevec@2@XZ */
1003 DEFINE_THISCALL_WRAPPER(_Locinfo__Gettnames
, 4)
1004 _Timevec __thiscall
_Locinfo__Gettnames(const _Locinfo
*this)
1006 _Timevec ret
= { 0 }; /* FIXME */
1007 FIXME("(%p) stub\n", this);