msvcp90: Added basic_streambuf<char>::{Lock, Unlock} implementation.
[wine] / dlls / msvcp90 / ios.c
1 /*
2  * Copyright 2011 Piotr Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22 #include <stdio.h>
23
24 #include "msvcp90.h"
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
29
30 typedef enum {
31     IOSTATE_goodbit   = 0x00,
32     IOSTATE_eofbit    = 0x01,
33     IOSTATE_failbit   = 0x02,
34     IOSTATE_badbit    = 0x04,
35     IOSTATE__Hardfail = 0x10
36 } IOSB_iostate;
37
38 typedef enum {
39     FMTFLAG_skipws      = 0x0001,
40     FMTFLAG_unitbuf     = 0x0002,
41     FMTFLAG_uppercase   = 0x0004,
42     FMTFLAG_showbase    = 0x0008,
43     FMTFLAG_showpoint   = 0x0010,
44     FMTFLAG_showpos     = 0x0020,
45     FMTFLAG_left        = 0x0040,
46     FMTFLAG_right       = 0x0080,
47     FMTFLAG_internal    = 0x0100,
48     FMTFLAG_dec         = 0x0200,
49     FMTFLAG_oct         = 0x0400,
50     FMTFLAG_hex         = 0x0800,
51     FMTFLAG_scientific  = 0x1000,
52     FMTFLAG_fixed       = 0x2000,
53     FMTFLAG_hexfloat    = 0x3000,
54     FMTFLAG_boolalpha   = 0x4000,
55     FMTFLAG_stdio       = 0x8000,
56     FMTFLAG_adjustfield = FMTFLAG_left|FMTFLAG_right|FMTFLAG_internal,
57     FMTFLAG_basefield   = FMTFLAG_dec|FMTFLAG_oct|FMTFLAG_hex,
58     FMTFLAG_floadfield  = FMTFLAG_scientific|FMTFLAG_fixed
59 } IOSB_fmtflags;
60
61 typedef struct _iosarray {
62     struct _iosarray *next;
63     int index;
64     int long_val;
65     void *ptr_val;
66 } IOS_BASE_iosarray;
67
68 typedef enum {
69     EVENT_erase_event,
70     EVENT_imbue_event,
71     EVENT_copyfmt_event
72 } IOS_BASE_event;
73
74 struct _ios_base;
75 typedef void (CDECL *IOS_BASE_event_callback)(IOS_BASE_event, struct _ios_base*, int);
76 typedef struct _fnarray {
77     struct _fnarray *next;
78     int index;
79     IOS_BASE_event_callback event_handler;
80 } IOS_BASE_fnarray;
81
82 /* ?_Index@ios_base@std@@0HA */
83 int ios_base_Index = 0;
84 /* ?_Sync@ios_base@std@@0_NA */
85 MSVCP_bool ios_base_Sync = FALSE;
86
87 typedef struct _ios_base {
88     const vtable_ptr *vtable;
89     MSVCP_size_t stdstr;
90     IOSB_iostate state;
91     IOSB_iostate except;
92     IOSB_fmtflags fmtfl;
93     MSVCP_size_t prec;
94     MSVCP_size_t wide;
95     IOS_BASE_iosarray *arr;
96     IOS_BASE_fnarray *calls;
97     locale *loc;
98 } ios_base;
99
100 typedef struct {
101     streamoff off;
102     __int64 DECLSPEC_ALIGN(8) pos;
103     int state;
104 } fpos_int;
105
106 static inline const char* debugstr_fpos_int(fpos_int *fpos)
107 {
108     return wine_dbg_sprintf("fpos(%lu %s %d)", fpos->off, wine_dbgstr_longlong(fpos->pos), fpos->state);
109 }
110
111 typedef struct {
112     const vtable_ptr *vtable;
113     mutex lock;
114     char *rbuf;
115     char *wbuf;
116     char **prbuf;
117     char **pwbuf;
118     char *rpos;
119     char *wpos;
120     char **prpos;
121     char **pwpos;
122     int rsize;
123     int wsize;
124     int *prsize;
125     int *pwsize;
126     locale *loc;
127 } basic_streambuf_char;
128
129 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char*);
130 void __thiscall basic_streambuf_char_setp(basic_streambuf_char*, char*, char*);
131 void __thiscall basic_streambuf_char_setg(basic_streambuf_char*, char*, char*, char*);
132
133 typedef struct {
134     ios_base child;
135     basic_streambuf_char *strbuf;
136     struct basic_ostream_char *stream;
137     char fillch;
138 } basic_ios_char;
139
140 typedef struct {
141     const vtable_ptr *vtable;
142     basic_ios_char child;
143 } basic_ostream_char;
144
145 /* ??_7ios_base@std@@6B@ */
146 extern const vtable_ptr MSVCP_ios_base_vtable;
147
148 /* ??_7?$basic_ios@DU?$char_traits@D@std@@@std@@6B@ */
149 extern const vtable_ptr MSVCP_basic_ios_char_vtable;
150
151 /* ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@ */
152 extern const vtable_ptr MSVCP_basic_streambuf_char_vtable;
153
154 /* ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@ */
155 extern const vtable_ptr MSVCP_basic_ostream_char_vtable;
156
157 static const type_info ios_base_type_info = {
158     &MSVCP_ios_base_vtable,
159     NULL,
160     ".?AVios_base@std@@"
161 };
162
163 static const rtti_base_descriptor ios_base_rtti_base_descriptor = {
164     &ios_base_type_info,
165     1,
166     { 0, -1, 0 },
167     64
168 };
169
170 static const type_info iosb_type_info = {
171     &MSVCP_ios_base_vtable,
172     NULL,
173     ".?AV?$_Iosb@H@std@@"
174 };
175
176 static const rtti_base_descriptor iosb_rtti_base_descriptor = {
177     &iosb_type_info,
178     0,
179     { 4, -1, 0 },
180     64
181 };
182
183 static const rtti_base_array ios_base_rtti_base_array = {
184     {
185         &ios_base_rtti_base_descriptor,
186         &iosb_rtti_base_descriptor,
187         NULL
188     }
189 };
190
191 static const rtti_object_hierarchy ios_base_type_hierarchy = {
192     0,
193     0,
194     2,
195     &ios_base_rtti_base_array
196 };
197
198 const rtti_object_locator ios_base_rtti = {
199     0,
200     0,
201     0,
202     &ios_base_type_info,
203     &ios_base_type_hierarchy
204 };
205
206 static const type_info basic_ios_char_type_info = {
207     &MSVCP_basic_ios_char_vtable,
208     NULL,
209     ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@"
210 };
211
212 static const rtti_base_descriptor basic_ios_char_rtti_base_descriptor = {
213     &basic_ios_char_type_info,
214     2,
215     { 0, -1, 0 },
216     64
217 };
218
219 static const rtti_base_array basic_ios_char_rtti_base_array = {
220     {
221         &basic_ios_char_rtti_base_descriptor,
222         &ios_base_rtti_base_descriptor,
223         &iosb_rtti_base_descriptor
224     }
225 };
226
227 static const rtti_object_hierarchy basic_ios_char_hierarchy = {
228     0,
229     0,
230     3,
231     &basic_ios_char_rtti_base_array
232 };
233
234 const rtti_object_locator basic_ios_char_rtti = {
235     0,
236     0,
237     0,
238     &basic_ios_char_type_info,
239     &basic_ios_char_hierarchy
240 };
241
242 static const type_info basic_streambuf_char_type_info = {
243     &MSVCP_basic_streambuf_char_vtable,
244     NULL,
245     ".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@"
246 };
247
248 static const rtti_base_descriptor basic_streambuf_char_rtti_base_descriptor = {
249     &basic_streambuf_char_type_info,
250     0,
251     { 0, -1, 0},
252     64
253 };
254
255 static const rtti_base_array basic_streambuf_char_rtti_base_array = {
256     {
257         &basic_streambuf_char_rtti_base_descriptor,
258         NULL,
259         NULL
260     }
261 };
262
263 static const rtti_object_hierarchy basic_streambuf_char_hierarchy = {
264     0,
265     0,
266     1,
267     &basic_streambuf_char_rtti_base_array
268 };
269
270 const rtti_object_locator basic_streambuf_char_rtti = {
271     0,
272     0,
273     0,
274     &basic_streambuf_char_type_info,
275     &basic_streambuf_char_hierarchy
276 };
277
278 static const type_info basic_ostream_char_type_info = {
279     &MSVCP_basic_ostream_char_vtable,
280     NULL,
281     ".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@"
282 };
283
284 static const rtti_base_descriptor basic_ostream_char_rtti_base_descriptor = {
285     &basic_ostream_char_type_info,
286     3,
287     { 0, -1, 0},
288     64
289 };
290
291 static const rtti_base_array basic_ostream_char_rtti_base_array = {
292     {
293         &basic_ostream_char_rtti_base_descriptor,
294         &basic_ios_char_rtti_base_descriptor,
295         &ios_base_rtti_base_descriptor,
296         &iosb_rtti_base_descriptor
297     }
298 };
299
300 static const rtti_object_hierarchy basic_ostream_char_hierarchy = {
301         0,
302         0,
303         4,
304         &basic_ostream_char_rtti_base_array
305 };
306
307 const rtti_object_locator basic_ostream_char_rtti = {
308     0,
309     4,
310     0,
311     &basic_ostream_char_type_info,
312     &basic_ostream_char_hierarchy
313 };
314
315 #ifndef __GNUC__
316 void __asm_dummy_vtables(void) {
317 #endif
318     __ASM_VTABLE(ios_base, "");
319     __ASM_VTABLE(basic_ios_char, "");
320     __ASM_VTABLE(basic_streambuf_char,
321             "\t.long " THISCALL_NAME(basic_streambuf_char_overflow) "\n"
322             "\t.long " THISCALL_NAME(basic_streambuf_char_pbackfail) "\n"
323             "\t.long " THISCALL_NAME(basic_streambuf_char_showmanyc) "\n"
324             "\t.long " THISCALL_NAME(basic_streambuf_char_underflow) "\n"
325             "\t.long " THISCALL_NAME(basic_streambuf_char_uflow) "\n"
326             "\t.long " THISCALL_NAME(basic_streambuf_char_xsgetn) "\n"
327             "\t.long " THISCALL_NAME(basic_streambuf_char__Xsgetn_s) "\n"
328             "\t.long " THISCALL_NAME(basic_streambuf_char_xsputn) "\n"
329             "\t.long " THISCALL_NAME(basic_streambuf_char_seekoff) "\n"
330             "\t.long " THISCALL_NAME(basic_streambuf_char_seekpos) "\n"
331             "\t.long " THISCALL_NAME(basic_streambuf_char_setbuf) "\n"
332             "\t.long " THISCALL_NAME(basic_streambuf_char_sync) "\n"
333             "\t.long " THISCALL_NAME(basic_streambuf_char_imbue) "\n");
334     __ASM_VTABLE(basic_ostream_char, "");
335 #ifndef __GNUC__
336 }
337 #endif
338
339 /* ??0ios_base@std@@IAE@XZ */
340 /* ??0ios_base@std@@IEAA@XZ */
341 DEFINE_THISCALL_WRAPPER(ios_base_ctor, 4)
342 ios_base* __thiscall ios_base_ctor(ios_base *this)
343 {
344     FIXME("(%p) stub\n", this);
345
346     this->vtable = &MSVCP_ios_base_vtable;
347     return NULL;
348 }
349
350 /* ??0ios_base@std@@QAE@ABV01@@Z */
351 /* ??0ios_base@std@@QEAA@AEBV01@@Z */
352 DEFINE_THISCALL_WRAPPER(ios_base_copy_ctor, 8)
353 ios_base* __thiscall ios_base_copy_ctor(ios_base *this, const ios_base *copy)
354 {
355     FIXME("(%p %p) stub\n", this, copy);
356     return NULL;
357 }
358
359 /* ??1ios_base@std@@UAE@XZ */
360 /* ??1ios_base@std@@UEAA@XZ */
361 DEFINE_THISCALL_WRAPPER(ios_base_dtor, 4)
362 void __thiscall ios_base_dtor(ios_base *this)
363 {
364     FIXME("(%p) stub\n", this);
365 }
366
367 DEFINE_THISCALL_WRAPPER(MSVCP_ios_base_vector_dtor, 8)
368 ios_base* __thiscall MSVCP_ios_base_vector_dtor(ios_base *this, unsigned int flags)
369 {
370     TRACE("(%p %x) stub\n", this, flags);
371     if(flags & 2) {
372         /* we have an array, with the number of elements stored before the first object */
373         int i, *ptr = (int *)this-1;
374
375         for(i=*ptr-1; i>=0; i--)
376             ios_base_dtor(this+i);
377         MSVCRT_operator_delete(ptr);
378     } else {
379         ios_base_dtor(this);
380         if(flags & 1)
381             MSVCRT_operator_delete(this);
382     }
383
384     return this;
385 }
386
387 /* ??4ios_base@std@@QAEAAV01@ABV01@@Z */
388 /* ??4ios_base@std@@QEAAAEAV01@AEBV01@@Z */
389 DEFINE_THISCALL_WRAPPER(ios_base_assign, 8)
390 ios_base* __thiscall ios_base_assign(ios_base *this, const ios_base *right)
391 {
392     FIXME("(%p %p) stub\n", this, right);
393     return NULL;
394 }
395
396 /* ??7ios_base@std@@QBE_NXZ */
397 /* ??7ios_base@std@@QEBA_NXZ */
398 DEFINE_THISCALL_WRAPPER(ios_base_op_succ, 4)
399 MSVCP_bool __thiscall ios_base_op_succ(const ios_base *this)
400 {
401     FIXME("(%p) stub\n", this);
402     return FALSE;
403 }
404
405 /* ??Bios_base@std@@QBEPAXXZ */
406 /* ??Bios_base@std@@QEBAPEAXXZ */
407 DEFINE_THISCALL_WRAPPER(ios_base_op_fail, 4)
408 void* __thiscall ios_base_op_fail(const ios_base *this)
409 {
410     FIXME("(%p) stub\n", this);
411     return NULL;
412 }
413
414 /* ?_Addstd@ios_base@std@@SAXPAV12@@Z */
415 /* ?_Addstd@ios_base@std@@SAXPEAV12@@Z */
416 void CDECL ios_base_Addstd(ios_base *add)
417 {
418     FIXME("(%p) stub\n", add);
419 }
420
421 /* ?_Callfns@ios_base@std@@AAEXW4event@12@@Z */
422 /* ?_Callfns@ios_base@std@@AEAAXW4event@12@@Z */
423 DEFINE_THISCALL_WRAPPER(ios_base_Callfns, 8)
424 void __thiscall ios_base_Callfns(ios_base *this, IOS_BASE_event event)
425 {
426     FIXME("(%p %x) stub\n", this, event);
427 }
428
429 /* ?_Findarr@ios_base@std@@AAEAAU_Iosarray@12@H@Z */
430 /* ?_Findarr@ios_base@std@@AEAAAEAU_Iosarray@12@H@Z */
431 DEFINE_THISCALL_WRAPPER(ios_base_Findarr, 8)
432 IOS_BASE_iosarray* __thiscall ios_base_Findarr(ios_base *this, int index)
433 {
434     FIXME("(%p %d) stub\n", this, index);
435     return NULL;
436 }
437
438 /* ?_Index_func@ios_base@std@@CAAAHXZ */
439 /* ?_Index_func@ios_base@std@@CAAEAHXZ */
440 int* CDECL ios_base_Index_func(void)
441 {
442     TRACE("\n");
443     return &ios_base_Index;
444 }
445
446 /* ?_Init@ios_base@std@@IAEXXZ */
447 /* ?_Init@ios_base@std@@IEAAXXZ */
448 DEFINE_THISCALL_WRAPPER(ios_base_Init, 4)
449 void __thiscall ios_base_Init(ios_base *this)
450 {
451     FIXME("(%p) stub\n", this);
452 }
453
454 /* ?_Ios_base_dtor@ios_base@std@@CAXPAV12@@Z */
455 /* ?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z */
456 void CDECL ios_base_Ios_base_dtor(ios_base *obj)
457 {
458     FIXME("(%p) stub\n", obj);
459 }
460
461 /* ?_Sync_func@ios_base@std@@CAAA_NXZ */
462 /* ?_Sync_func@ios_base@std@@CAAEA_NXZ */
463 MSVCP_bool* CDECL ios_base_Sync_func(void)
464 {
465     TRACE("\n");
466     return &ios_base_Sync;
467 }
468
469 /* ?_Tidy@ios_base@std@@AAAXXZ */
470 /* ?_Tidy@ios_base@std@@AEAAXXZ */
471 void CDECL ios_base_Tidy(ios_base *this)
472 {
473     FIXME("(%p) stub\n", this);
474 }
475
476 /* ?bad@ios_base@std@@QBE_NXZ */
477 /* ?bad@ios_base@std@@QEBA_NXZ */
478 DEFINE_THISCALL_WRAPPER(ios_base_bad, 4)
479 MSVCP_bool __thiscall ios_base_bad(const ios_base *this)
480 {
481     FIXME("(%p) stub\n", this);
482     return FALSE;
483 }
484
485 /* ?clear@ios_base@std@@QAEXH_N@Z */
486 /* ?clear@ios_base@std@@QEAAXH_N@Z */
487 DEFINE_THISCALL_WRAPPER(ios_base_clear_reraise, 12)
488 void __thiscall ios_base_clear_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
489 {
490     FIXME("(%p %x %x) stub\n", this, state, reraise);
491 }
492
493 /* ?clear@ios_base@std@@QAEXH@Z */
494 /* ?clear@ios_base@std@@QEAAXH@Z */
495 DEFINE_THISCALL_WRAPPER(ios_base_clear, 8)
496 void __thiscall ios_base_clear(ios_base *this, IOSB_iostate state)
497 {
498     ios_base_clear_reraise(this, state, FALSE);
499 }
500
501 /* ?clear@ios_base@std@@QAEXI@Z */
502 /* ?clear@ios_base@std@@QEAAXI@Z */
503 DEFINE_THISCALL_WRAPPER(ios_base_clear_unsigned, 8)
504 void __thiscall ios_base_clear_unsigned(ios_base *this, unsigned int state)
505 {
506     ios_base_clear_reraise(this, (IOSB_iostate)state, FALSE);
507 }
508
509 /* ?copyfmt@ios_base@std@@QAEAAV12@ABV12@@Z */
510 /* ?copyfmt@ios_base@std@@QEAAAEAV12@AEBV12@@Z */
511 DEFINE_THISCALL_WRAPPER(ios_base_copyfmt, 8)
512 ios_base* __thiscall ios_base_copyfmt(ios_base *this, const ios_base *obj)
513 {
514     FIXME("(%p %p) stub\n", this, obj);
515     return NULL;
516 }
517
518 /* ?eof@ios_base@std@@QBE_NXZ */
519 /* ?eof@ios_base@std@@QEBA_NXZ */
520 DEFINE_THISCALL_WRAPPER(ios_base_eof, 4)
521 MSVCP_bool __thiscall ios_base_eof(const ios_base *this)
522 {
523     FIXME("(%p) stub\n", this);
524     return FALSE;
525 }
526
527 /* ?exceptions@ios_base@std@@QAEXH@Z */
528 /* ?exceptions@ios_base@std@@QEAAXH@Z */
529 DEFINE_THISCALL_WRAPPER(ios_base_exception_set, 8)
530 void __thiscall ios_base_exception_set(ios_base *this, IOSB_iostate state)
531 {
532     FIXME("(%p %x) stub\n", this, state);
533 }
534
535 /* ?exceptions@ios_base@std@@QAEXI@Z */
536 /* ?exceptions@ios_base@std@@QEAAXI@Z */
537 DEFINE_THISCALL_WRAPPER(ios_base_exception_set_unsigned, 8)
538 void __thiscall ios_base_exception_set_unsigned(ios_base *this, unsigned int state)
539 {
540     FIXME("(%p %x) stub\n", this, state);
541 }
542
543 /* ?exceptions@ios_base@std@@QBEHXZ */
544 /* ?exceptions@ios_base@std@@QEBAHXZ */
545 DEFINE_THISCALL_WRAPPER(ios_base_exception_get, 4)
546 IOSB_iostate __thiscall ios_base_exception_get(ios_base *this)
547 {
548     FIXME("(%p) stub\n", this);
549     return 0;
550 }
551
552 /* ?fail@ios_base@std@@QBE_NXZ */
553 /* ?fail@ios_base@std@@QEBA_NXZ */
554 DEFINE_THISCALL_WRAPPER(ios_base_fail, 4)
555 MSVCP_bool __thiscall ios_base_fail(ios_base *this)
556 {
557     FIXME("(%p) stub\n", this);
558     return 0;
559 }
560
561 /* ?flags@ios_base@std@@QAEHH@Z */
562 /* ?flags@ios_base@std@@QEAAHH@Z */
563 DEFINE_THISCALL_WRAPPER(ios_base_flags_set, 8)
564 IOSB_fmtflags __thiscall ios_base_flags_set(ios_base *this, IOSB_fmtflags flags)
565 {
566     FIXME("(%p %x) stub\n", this, flags);
567     return 0;
568 }
569
570 /* ?flags@ios_base@std@@QBEHXZ */
571 /* ?flags@ios_base@std@@QEBAHXZ */
572 DEFINE_THISCALL_WRAPPER(ios_base_flags_get, 4)
573 IOSB_fmtflags __thiscall ios_base_flags_get(const ios_base *this)
574 {
575     FIXME("(%p) stub\n", this);
576     return 0;
577 }
578
579 /* ?getloc@ios_base@std@@QBE?AVlocale@2@XZ */
580 /* ?getloc@ios_base@std@@QEBA?AVlocale@2@XZ */
581 DEFINE_THISCALL_WRAPPER(ios_base_getloc, 4)
582 locale __thiscall ios_base_getloc(const ios_base *this)
583 {
584     locale ret = { NULL };
585     FIXME("(%p) stub\n", this);
586     return ret;
587 }
588
589 /* ?good@ios_base@std@@QBE_NXZ */
590 /* ?good@ios_base@std@@QEBA_NXZ */
591 DEFINE_THISCALL_WRAPPER(ios_base_good, 4)
592 MSVCP_bool __thiscall ios_base_good(const ios_base *this)
593 {
594     FIXME("(%p) stub\n", this);
595     return FALSE;
596 }
597
598 /* ?imbue@ios_base@std@@QAE?AVlocale@2@ABV32@@Z */
599 /* ?imbue@ios_base@std@@QEAA?AVlocale@2@AEBV32@@Z */
600 DEFINE_THISCALL_WRAPPER(ios_base_imbue, 8)
601 locale __thiscall ios_base_imbue(ios_base *this, const locale *loc)
602 {
603     locale ret = { NULL };
604     FIXME("(%p %p) stub\n", this, loc);
605     return ret;
606 }
607
608 /* ?iword@ios_base@std@@QAEAAJH@Z */
609 /* ?iword@ios_base@std@@QEAAAEAJH@Z */
610 DEFINE_THISCALL_WRAPPER(ios_base_iword, 8)
611 LONG* __thiscall ios_base_iword(ios_base *this, int index)
612 {
613     FIXME("(%p %d) stub\n", this, index);
614     return NULL;
615 }
616
617 /* ?precision@ios_base@std@@QAEHH@Z */
618 /* ?precision@ios_base@std@@QEAA_J_J@Z */
619 DEFINE_THISCALL_WRAPPER(ios_base_precision_set, 8)
620 MSVCP_size_t __thiscall ios_base_precision_set(ios_base *this, MSVCP_size_t precision)
621 {
622     FIXME("(%p %lu) stub\n", this, precision);
623     return 0;
624 }
625
626 /* ?precision@ios_base@std@@QBEHXZ */
627 /* ?precision@ios_base@std@@QEBA_JXZ */
628 DEFINE_THISCALL_WRAPPER(ios_base_precision_get, 4)
629 MSVCP_size_t __thiscall ios_base_precision_get(const ios_base *this)
630 {
631     FIXME("(%p) stub\n", this);
632     return 0;
633 }
634
635 /* ?pword@ios_base@std@@QAEAAPAXH@Z */
636 /* ?pword@ios_base@std@@QEAAAEAPEAXH@Z */
637 DEFINE_THISCALL_WRAPPER(ios_base_pword, 8)
638 void** __thiscall ios_base_pword(ios_base *this, int index)
639 {
640     FIXME("(%p %d) stub\n", this, index);
641     return NULL;
642 }
643
644 /* ?rdstate@ios_base@std@@QBEHXZ */
645 /* ?rdstate@ios_base@std@@QEBAHXZ */
646 DEFINE_THISCALL_WRAPPER(ios_base_rdstate, 4)
647 IOSB_iostate __thiscall ios_base_rdstate(const ios_base *this)
648 {
649     FIXME("(%p) stub\n", this);
650     return 0;
651 }
652
653 /* ?register_callback@ios_base@std@@QAEXP6AXW4event@12@AAV12@H@ZH@Z */
654 /* ?register_callback@ios_base@std@@QEAAXP6AXW4event@12@AEAV12@H@ZH@Z */
655 DEFINE_THISCALL_WRAPPER(ios_base_register_callback, 12)
656 void __thiscall ios_base_register_callback(ios_base *this, IOS_BASE_event_callback callback, int index)
657 {
658     FIXME("(%p %p %d) stub\n", this, callback, index);
659 }
660
661 /* ?setf@ios_base@std@@QAEHHH@Z */
662 /* ?setf@ios_base@std@@QEAAHHH@Z */
663 DEFINE_THISCALL_WRAPPER(ios_base_setf_mask, 12)
664 IOSB_fmtflags __thiscall ios_base_setf_mask(ios_base *this, IOSB_fmtflags flags, IOSB_fmtflags mask)
665 {
666     FIXME("(%p %x %x) stub\n", this, flags, mask);
667     return 0;
668 }
669
670 /* ?setf@ios_base@std@@QAEHH@Z */
671 /* ?setf@ios_base@std@@QEAAHH@Z */
672 DEFINE_THISCALL_WRAPPER(ios_base_setf, 8)
673 IOSB_fmtflags __thiscall ios_base_setf(ios_base *this, IOSB_fmtflags flags)
674 {
675     return ios_base_setf_mask(this, flags, ~0);
676 }
677
678 /* ?setstate@ios_base@std@@QAEXH_N@Z */
679 /* ?setstate@ios_base@std@@QEAAXH_N@Z */
680 DEFINE_THISCALL_WRAPPER(ios_base_setstate_reraise, 12)
681 void __thiscall ios_base_setstate_reraise(ios_base *this, IOSB_iostate state, MSVCP_bool reraise)
682 {
683     FIXME("(%p %x %x) stub\n", this, state, reraise);
684 }
685
686 /* ?setstate@ios_base@std@@QAEXH@Z */
687 /* ?setstate@ios_base@std@@QEAAXH@Z */
688 DEFINE_THISCALL_WRAPPER(ios_base_setstate, 8)
689 void __thiscall ios_base_setstate(ios_base *this, IOSB_iostate state)
690 {
691     ios_base_setstate_reraise(this, state, FALSE);
692 }
693
694 /* ?setstate@ios_base@std@@QAEXI@Z */
695 /* ?setstate@ios_base@std@@QEAAXI@Z */
696 DEFINE_THISCALL_WRAPPER(ios_base_setstate_unsigned, 8)
697 void __thiscall ios_base_setstate_unsigned(ios_base *this, unsigned int state)
698 {
699     ios_base_setstate_reraise(this, (IOSB_iostate)state, FALSE);
700 }
701
702 /* ?sync_with_stdio@ios_base@std@@SA_N_N@Z */
703 MSVCP_bool CDECL ios_base_sync_with_stdio(MSVCP_bool sync)
704 {
705     FIXME("(%x) stub\n", sync);
706     return FALSE;
707 }
708
709 /* ?unsetf@ios_base@std@@QAEXH@Z */
710 /* ?unsetf@ios_base@std@@QEAAXH@Z */
711 DEFINE_THISCALL_WRAPPER(ios_base_unsetf, 8)
712 void __thiscall ios_base_unsetf(ios_base *this, IOSB_fmtflags flags)
713 {
714     FIXME("(%p %x) stub\n", this, flags);
715 }
716
717 /* ?width@ios_base@std@@QAEHH@Z */
718 /* ?width@ios_base@std@@QEAA_J_J@Z */
719 DEFINE_THISCALL_WRAPPER(ios_base_width_set, 8)
720 MSVCP_size_t __thiscall ios_base_width_set(ios_base *this, MSVCP_size_t width)
721 {
722     FIXME("(%p %lu) stub\n", this, width);
723     return 0;
724 }
725
726 /* ?width@ios_base@std@@QBEHXZ */
727 /* ?width@ios_base@std@@QEBA_JXZ */
728 DEFINE_THISCALL_WRAPPER(ios_base_width_get, 4)
729 MSVCP_size_t __thiscall ios_base_width_get(ios_base *this)
730 {
731     FIXME("(%p) stub\n", this);
732     return 0;
733 }
734
735 /* ?xalloc@ios_base@std@@SAHXZ */
736 int CDECL ios_base_xalloc(void)
737 {
738     FIXME("stub\n");
739     return 0;
740 }
741
742 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ */
743 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ */
744 DEFINE_THISCALL_WRAPPER(basic_ios_char_ctor, 4)
745 basic_ios_char* __thiscall basic_ios_char_ctor(basic_ios_char *this)
746 {
747     FIXME("(%p) stub\n", this);
748     return NULL;
749 }
750
751 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
752 /* ??0?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
753 DEFINE_THISCALL_WRAPPER(basic_ios_char_copy_ctor, 8)
754 basic_ios_char* __thiscall basic_ios_char_copy_ctor(basic_ios_char *this, const basic_ios_char *copy)
755 {
756     FIXME("(%p %p) stub\n", this, copy);
757     return NULL;
758 }
759
760 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ */
761 /* ??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ */
762 DEFINE_THISCALL_WRAPPER(basic_ios_char_dtor, 4)
763 void __thiscall basic_ios_char_dtor(basic_ios_char *this)
764 {
765     FIXME("(%p) stub\n", this);
766 }
767
768 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ios_char_vector_dtor, 8)
769 basic_ios_char* __thiscall MSVCP_basic_ios_char_vector_dtor(basic_ios_char *this, unsigned int flags)
770 {
771     TRACE("(%p %x) stub\n", this, flags);
772     if(flags & 2) {
773         /* we have an array, with the number of elements stored before the first object */
774         int i, *ptr = (int *)this-1;
775
776         for(i=*ptr-1; i>=0; i--)
777             basic_ios_char_dtor(this+i);
778         MSVCRT_operator_delete(ptr);
779     } else {
780         basic_ios_char_dtor(this);
781         if(flags & 1)
782             MSVCRT_operator_delete(this);
783     }
784
785     return this;
786 }
787
788 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
789 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
790 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear_reraise, 12)
791 void __thiscall basic_ios_char_clear_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
792 {
793     FIXME("(%p %x %x) stub\n", this, state, reraise);
794 }
795
796 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
797 /* ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
798 DEFINE_THISCALL_WRAPPER(basic_ios_char_clear, 8)
799 void __thiscall basic_ios_char_clear(basic_ios_char *this, unsigned int state)
800 {
801     basic_ios_char_clear_reraise(this, (IOSB_iostate)state, FALSE);
802 }
803
804 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEAAV12@ABV12@@Z */
805 /* ?copyfmt@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAAEAV12@AEBV12@@Z */
806 DEFINE_THISCALL_WRAPPER(basic_ios_char_copyfmt, 8)
807 basic_ios_char* __thiscall basic_ios_char_copyfmt(basic_ios_char *this, basic_ios_char *copy)
808 {
809     FIXME("(%p %p) stub\n", this, copy);
810     return NULL;
811 }
812
813 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEDD@Z */
814 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAADD@Z */
815 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_set, 8)
816 char __thiscall basic_ios_char_fill_set(basic_ios_char *this, char fill)
817 {
818     FIXME("(%p %c) stub\n", this, fill);
819     return 0;
820 }
821
822 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ */
823 /* ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADXZ */
824 DEFINE_THISCALL_WRAPPER(basic_ios_char_fill_get, 4)
825 char __thiscall basic_ios_char_fill_get(basic_ios_char *this)
826 {
827     FIXME("(%p) stub\n", this);
828     return 0;
829 }
830
831 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
832 /* ?imbue@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
833 DEFINE_THISCALL_WRAPPER(basic_ios_char_imbue, 4)
834 locale __thiscall basic_ios_char_imbue(basic_ios_char *this)
835 {
836     locale ret = { NULL };
837     FIXME("(%p) stub\n", this);
838     return ret;
839 }
840
841 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IAEXPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
842 /* ?init@?$basic_ios@DU?$char_traits@D@std@@@std@@IEAAXPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@_N@Z */
843 DEFINE_THISCALL_WRAPPER(basic_ios_char_init, 12)
844 void __thiscall basic_ios_char_init(basic_ios_char *this, basic_streambuf_char *streambuf, MSVCP_bool isstd)
845 {
846     FIXME("(%p %p %x) stub\n", this, streambuf, isstd);
847 }
848
849 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDDD@Z */
850 /* ?narrow@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADDD@Z */
851 DEFINE_THISCALL_WRAPPER(basic_ios_char_narrow, 12)
852 char __thiscall basic_ios_char_narrow(basic_ios_char *this, char ch, char def)
853 {
854     FIXME("(%p %c %c) stub\n", this, ch, def);
855     return def;
856 }
857
858 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PAV32@@Z */
859 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@PEAV32@@Z */
860 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_set, 8)
861 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_set(basic_ios_char *this, basic_streambuf_char *streambuf)
862 {
863     FIXME("(%p %p) stub\n", this, streambuf);
864     return NULL;
865 }
866
867 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
868 /* ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ */
869 DEFINE_THISCALL_WRAPPER(basic_ios_char_rdbuf_get, 4)
870 basic_streambuf_char* __thiscall basic_ios_char_rdbuf_get(const basic_ios_char *this)
871 {
872     FIXME("(%p) stub\n", this);
873     return NULL;
874 }
875
876 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z */
877 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@Z */
878 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate_reraise, 12)
879 void __thiscall basic_ios_char_setstate_reraise(basic_ios_char *this, IOSB_iostate state, MSVCP_bool reraise)
880 {
881     FIXME("(%p %x %x) stub\n", this, state, reraise);
882 }
883
884 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXI@Z */
885 /* ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXI@Z */
886 DEFINE_THISCALL_WRAPPER(basic_ios_char_setstate, 8)
887 void __thiscall basic_ios_char_setstate(basic_ios_char *this, unsigned int state)
888 {
889     basic_ios_char_setstate_reraise(this, (IOSB_iostate)state, FALSE);
890 }
891
892 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@PAV32@@Z */
893 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@PEAV32@@Z */
894 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_set, 8)
895 basic_ostream_char* __thiscall basic_ios_char_tie_set(basic_ios_char *this, basic_ostream_char *ostream)
896 {
897     FIXME("(%p %p) stub\n", this, ostream);
898     return NULL;
899 }
900
901 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
902 /* ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ */
903 DEFINE_THISCALL_WRAPPER(basic_ios_char_tie_get, 4)
904 basic_ostream_char* __thiscall basic_ios_char_tie_get(const basic_ios_char *this)
905 {
906     FIXME("(%p)\n", this);
907     return NULL;
908 }
909
910 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z */
911 /* ?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBADD@Z */
912 DEFINE_THISCALL_WRAPPER(basic_ios_char_widen, 8)
913 char __thiscall basic_ios_char_widen(basic_ios_char *this, char ch)
914 {
915     FIXME("(%p %c)\n", this, ch);
916     return 0;
917 }
918
919 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@W4_Uninitialized@1@@Z */
920 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@W4_Uninitialized@1@@Z */
921 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor_uninitialized, 8)
922 basic_streambuf_char* __thiscall basic_streambuf_char_ctor_uninitialized(basic_streambuf_char *this, int uninitialized)
923 {
924     TRACE("(%p %d)\n", this, uninitialized);
925     this->vtable = &MSVCP_basic_streambuf_char_vtable;
926     mutex_ctor(&this->lock);
927     return this;
928 }
929
930 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ */
931 /* ??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ */
932 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_ctor, 4)
933 basic_streambuf_char* __thiscall basic_streambuf_char_ctor(basic_streambuf_char *this)
934 {
935     TRACE("(%p)\n", this);
936
937     this->vtable = &MSVCP_basic_streambuf_char_vtable;
938     mutex_ctor(&this->lock);
939     this->loc = MSVCRT_operator_new(sizeof(locale));
940     locale_ctor(this->loc);
941     basic_streambuf_char__Init_empty(this);
942
943     return this;
944 }
945
946 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ */
947 /* ??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ */
948 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_dtor, 4)
949 void __thiscall basic_streambuf_char_dtor(basic_streambuf_char *this)
950 {
951     TRACE("(%p)\n", this);
952
953     mutex_dtor(&this->lock);
954     locale_dtor(this->loc);
955     MSVCRT_operator_delete(this->loc);
956 }
957
958 DEFINE_THISCALL_WRAPPER(MSVCP_basic_streambuf_char_vector_dtor, 8)
959 basic_streambuf_char* __thiscall MSVCP_basic_streambuf_char_vector_dtor(basic_streambuf_char *this, unsigned int flags)
960 {
961     TRACE("(%p %x)\n", this, flags);
962     if(flags & 2) {
963         /* we have an array, with the number of elements stored before the first object */
964         int i, *ptr = (int *)this-1;
965
966         for(i=*ptr-1; i>=0; i--)
967             basic_streambuf_char_dtor(this+i);
968         MSVCRT_operator_delete(ptr);
969     } else {
970         basic_streambuf_char_dtor(this);
971         if(flags & 1)
972             MSVCRT_operator_delete(this);
973     }
974
975     return this;
976 }
977
978 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
979 /* ?_Gnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
980 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnavail, 4)
981 streamsize __thiscall basic_streambuf_char__Gnavail(const basic_streambuf_char *this)
982 {
983     TRACE("(%p)\n", this);
984     return *this->prpos ? *this->prsize : 0;
985 }
986
987 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
988 /* ?_Gndec@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
989 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gndec, 4)
990 char* __thiscall basic_streambuf_char__Gndec(basic_streambuf_char *this)
991 {
992     TRACE("(%p)\n", this);
993     (*this->prsize)++;
994     (*this->prpos)--;
995     return *this->prpos;
996 }
997
998 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
999 /* ?_Gninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1000 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gninc, 4)
1001 char* __thiscall basic_streambuf_char__Gninc(basic_streambuf_char *this)
1002 {
1003     TRACE("(%p)\n", this);
1004     (*this->prsize)--;
1005     return (*this->prpos)++;
1006 }
1007
1008 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1009 /* ?_Gnpreinc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1010 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Gnpreinc, 4)
1011 char* __thiscall basic_streambuf_char__Gnpreinc(basic_streambuf_char *this)
1012 {
1013     TRACE("(%p)\n", this);
1014     (*this->prsize)--;
1015     (*this->prpos)++;
1016     return *this->prpos;
1017 }
1018
1019 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAPAD0PAH001@Z */
1020 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAPEAD0PEAH001@Z */
1021 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init, 28)
1022 void __thiscall basic_streambuf_char__Init(basic_streambuf_char *this, char **gf, char **gn, int *gc, char **pf, char **pn, int *pc)
1023 {
1024     TRACE("(%p %p %p %p %p %p %p)\n", this, gf, gn, gc, pf, pn, pc);
1025
1026     this->prbuf = gf;
1027     this->pwbuf = pf;
1028     this->prpos = gn;
1029     this->pwpos = pn;
1030     this->prsize = gc;
1031     this->pwsize = pc;
1032 }
1033
1034 /* ?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ */
1035 /* ?_Init@?$basic_streambuf@GU?$char_traits@G@std@@@std@@IEAAXXZ */
1036 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Init_empty, 4)
1037 void __thiscall basic_streambuf_char__Init_empty(basic_streambuf_char *this)
1038 {
1039     TRACE("(%p)\n", this);
1040
1041     this->prbuf = &this->rbuf;
1042     this->pwbuf = &this->wbuf;
1043     this->prpos = &this->rpos;
1044     this->pwpos = &this->wpos;
1045     this->prsize = &this->rsize;
1046     this->pwsize = &this->wsize;
1047
1048     basic_streambuf_char_setp(this, NULL, NULL);
1049     basic_streambuf_char_setg(this, NULL, NULL, NULL);
1050 }
1051
1052 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1053 /* ?_Lock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1054 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Lock, 4)
1055 void __thiscall basic_streambuf_char__Lock(basic_streambuf_char *this)
1056 {
1057     TRACE("(%p)\n", this);
1058     mutex_lock(&this->lock);
1059 }
1060
1061 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEHXZ */
1062 /* ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBA_JXZ */
1063 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pnavail, 4)
1064 streamsize __thiscall basic_streambuf_char__Pnavail(const basic_streambuf_char *this)
1065 {
1066     TRACE("(%p)\n", this);
1067     return *this->pwpos ? *this->pwsize : 0;
1068 }
1069
1070 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ */
1071 /* ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAPEADXZ */
1072 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Pninc, 4)
1073 char* __thiscall basic_streambuf_char__Pninc(basic_streambuf_char *this)
1074 {
1075     TRACE("(%p)\n", this);
1076     (*this->pwsize)--;
1077     return (*this->pwpos)++;
1078 }
1079
1080 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADIH@Z */
1081 /* ?_Sgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_K_J@Z */
1082 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Sgetn_s, 16)
1083 streamsize __thiscall basic_streambuf_char__Sgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1084 {
1085     FIXME("(%p %p %lu %lu) stub\n", this, ptr, size, count);
1086     return 0;
1087 }
1088
1089 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1090 /* ?_Unlock@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1091 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Unlock, 4)
1092 void __thiscall basic_streambuf_char__Unlock(basic_streambuf_char *this)
1093 {
1094     TRACE("(%p)\n", this);
1095     mutex_unlock(&this->lock);
1096 }
1097
1098 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADIH@Z */
1099 /* ?_Xsgetn_s@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_K_J@Z */
1100 DEFINE_THISCALL_WRAPPER(basic_streambuf_char__Xsgetn_s, 16)
1101 streamsize __thiscall basic_streambuf_char__Xsgetn_s(basic_streambuf_char *this, char *ptr, MSVCP_size_t size, streamsize count)
1102 {
1103     FIXME("(%p %p %lu %lu) stub\n", this, ptr, size, count);
1104     return 0;
1105 }
1106
1107 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1108 /* ?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1109 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_eback, 4)
1110 char* __thiscall basic_streambuf_char_eback(const basic_streambuf_char *this)
1111 {
1112     FIXME("(%p) stub\n", this);
1113     return NULL;
1114 }
1115
1116 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1117 /* ?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1118 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_egptr, 4)
1119 char* __thiscall basic_streambuf_char_egptr(const basic_streambuf_char *this)
1120 {
1121     FIXME("(%p) stub\n", this);
1122     return NULL;
1123 }
1124
1125 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1126 /* ?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1127 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_epptr, 4)
1128 char* __thiscall basic_streambuf_char_epptr(const basic_streambuf_char *this)
1129 {
1130     FIXME("(%p) stub\n", this);
1131     return NULL;
1132 }
1133
1134 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1135 /* ?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1136 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gbump, 8)
1137 void __thiscall basic_streambuf_char_gbump(basic_streambuf_char *this, int off)
1138 {
1139     FIXME("(%p %d) stub\n", this, off);
1140 }
1141
1142 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QBE?AVlocale@2@XZ */
1143 /* ?getloc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEBA?AVlocale@2@XZ */
1144 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_getloc, 4)
1145 locale __thiscall basic_streambuf_char_getloc(const basic_streambuf_char *this)
1146 {
1147     locale ret = { 0 }; /* FIXME */
1148     FIXME("(%p) stub\n", this);
1149     return ret;
1150 }
1151
1152 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1153 /* ?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1154 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_gptr, 4)
1155 char* __thiscall basic_streambuf_char_gptr(const basic_streambuf_char *this)
1156 {
1157     FIXME("(%p) stub\n", this);
1158     return NULL;
1159 }
1160
1161 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEXABVlocale@2@@Z */
1162 /* ?imbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAXAEBVlocale@2@@Z */
1163 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_imbue, 8)
1164 void __thiscall basic_streambuf_char_imbue(basic_streambuf_char *this, const locale *loc)
1165 {
1166     FIXME("(%p %p) stub\n", this, loc);
1167 }
1168
1169 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1170 /* ?in_avail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JXZ */
1171 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_in_avail, 4)
1172 streamsize __thiscall basic_streambuf_char_in_avail(basic_streambuf_char *this)
1173 {
1174     FIXME("(%p) stub\n", this);
1175     return 0;
1176 }
1177
1178 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1179 /* ?overflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1180 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_overflow, 8)
1181 int __thiscall basic_streambuf_char_overflow(basic_streambuf_char *this, int ch)
1182 {
1183     FIXME("(%p %d) stub\n", this, ch);
1184     return 0;
1185 }
1186
1187 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHH@Z */
1188 /* ?pbackfail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHH@Z */
1189 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbackfail, 8)
1190 int __thiscall basic_streambuf_char_pbackfail(basic_streambuf_char *this, int ch)
1191 {
1192     FIXME("(%p %d) stub\n", this, ch);
1193     return 0;
1194 }
1195
1196 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1197 /* ?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1198 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbase, 4)
1199 char* __thiscall basic_streambuf_char_pbase(const basic_streambuf_char *this)
1200 {
1201     FIXME("(%p) stub\n", this);
1202     return NULL;
1203 }
1204
1205 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXH@Z */
1206 /* ?pbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z */
1207 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pbump, 8)
1208 void __thiscall basic_streambuf_char_pbump(basic_streambuf_char *this, int off)
1209 {
1210     FIXME("(%p %d) stub\n", this, off);
1211 }
1212
1213 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBEPADXZ */
1214 /* ?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEBAPEADXZ */
1215 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pptr, 4)
1216 char* __thiscall basic_streambuf_char_pptr(const basic_streambuf_char *this)
1217 {
1218     FIXME("(%p) stub\n", this);
1219     return NULL;
1220 }
1221
1222 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AVlocale@2@ABV32@@Z */
1223 /* ?pubimbue@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AVlocale@2@AEBV32@@Z */
1224 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubimbue, 8)
1225 locale __thiscall basic_streambuf_char_pubimbue(basic_streambuf_char *this, const locale *loc)
1226 {
1227     locale ret = { 0 }; /* FIXME */
1228     FIXME("(%p %p) stub\n", this, loc);
1229     return ret;
1230 }
1231
1232 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JHH@Z */
1233 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JHH@Z */
1234 DEFINE_THISCALL_WRAPPER_RETPTR(basic_streambuf_char_pubseekoff, 16)
1235 fpos_int __thiscall basic_streambuf_char_pubseekoff(basic_streambuf_char *this, streamoff off, int way, int mode)
1236 {
1237     fpos_int ret = { 0 }; /* FIXME */
1238     FIXME("(%p %lu %d %d) stub\n", this, off, way, mode);
1239     return ret;
1240 }
1241
1242 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@JII@Z */
1243 /* ?pubseekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@_JII@Z */
1244 DEFINE_THISCALL_WRAPPER_RETPTR(basic_streambuf_char_pubseekoff_old, 16)
1245 fpos_int __thiscall basic_streambuf_char_pubseekoff_old(basic_streambuf_char *this, streamoff off, unsigned int way, unsigned int mode)
1246 {
1247     fpos_int ret = { 0 }; /* FIXME */
1248     FIXME("(%p %lu %d %d) stub\n", this, off, way, mode);
1249     return ret;
1250 }
1251
1252 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@H@Z */
1253 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@H@Z */
1254 DEFINE_THISCALL_WRAPPER_RETPTR(basic_streambuf_char_pubseekpos, 32)
1255 fpos_int __thiscall basic_streambuf_char_pubseekpos(basic_streambuf_char *this, fpos_int pos, int mode)
1256 {
1257     fpos_int ret = { 0 }; /* FIXME */
1258     FIXME("(%p %s %d) stub\n", this, debugstr_fpos_int(&pos), mode);
1259     return ret;
1260 }
1261
1262 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@V32@I@Z */
1263 /* ?pubseekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@V32@I@Z */
1264 DEFINE_THISCALL_WRAPPER_RETPTR(basic_streambuf_char_pubseekpos_old, 32)
1265 fpos_int __thiscall basic_streambuf_char_pubseekpos_old(basic_streambuf_char *this, fpos_int pos, unsigned int mode)
1266 {
1267     fpos_int ret = { 0 }; /* FIXME */
1268     FIXME("(%p %s %d) stub\n", this, debugstr_fpos_int(&pos), mode);
1269     return ret;
1270 }
1271
1272 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEPAV12@PADH@Z */
1273 /* ?pubsetbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAPEAV12@PEAD_J@Z */
1274 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsetbuf, 12)
1275 basic_streambuf_char* __thiscall basic_streambuf_char_pubsetbuf(basic_streambuf_char *this, char *buf, streamsize count)
1276 {
1277     FIXME("(%p %p %lu) stub\n", this, buf, count);
1278     return NULL;
1279 }
1280
1281 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1282 /* ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1283 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_pubsync, 4)
1284 int __thiscall basic_streambuf_char_pubsync(basic_streambuf_char *this)
1285 {
1286     FIXME("(%p) stub\n", this);
1287     return 0;
1288 }
1289
1290 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1291 /* ?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1292 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sbumpc, 4)
1293 int __thiscall basic_streambuf_char_sbumpc(basic_streambuf_char *this)
1294 {
1295     FIXME("(%p) stub\n", this);
1296     return 0;
1297 }
1298
1299 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@JHH@Z */
1300 /* ?seekoff@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@_JHH@Z */
1301 DEFINE_THISCALL_WRAPPER_RETPTR(basic_streambuf_char_seekoff, 16)
1302 fpos_int __thiscall basic_streambuf_char_seekoff(basic_streambuf_char *this, streamoff off, int way, int mode)
1303 {
1304     fpos_int ret = { 0 }; /* FIXME */
1305     FIXME("(%p %lu %d %d) stub\n", this, off, way, mode);
1306     return ret;
1307 }
1308
1309 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAE?AV?$fpos@H@2@V32@H@Z */
1310 /* ?seekpos@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA?AV?$fpos@H@2@V32@H@Z */
1311 DEFINE_THISCALL_WRAPPER_RETPTR(basic_streambuf_char_seekpos, 32)
1312 fpos_int __thiscall basic_streambuf_char_seekpos(basic_streambuf_char *this, fpos_int pos, int mode)
1313 {
1314     fpos_int ret = { 0 }; /* FIXME */
1315     FIXME("(%p %s %d) stub\n", this, debugstr_fpos_int(&pos), mode);
1316     return ret;
1317 }
1318
1319 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEPAV12@PADH@Z */
1320 /* ?setbuf@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAPEAV12@PEAD_J@Z */
1321 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setbuf, 12)
1322 basic_streambuf_char* __thiscall basic_streambuf_char_setbuf(basic_streambuf_char *this, char *buf, streamsize count)
1323 {
1324     FIXME("(%p %p %lu) stub\n", this, buf, count);
1325     return NULL;
1326 }
1327
1328 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1329 /* ?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1330 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setg, 16)
1331 void __thiscall basic_streambuf_char_setg(basic_streambuf_char *this, char *first, char *next, char *last)
1332 {
1333     TRACE("(%p %p %p %p)\n", this, first, next, last);
1334
1335     this->rbuf = first;
1336     this->rpos = next;
1337     this->rsize = last-next;
1338 }
1339
1340 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD00@Z */
1341 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z */
1342 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp_next, 16)
1343 void __thiscall basic_streambuf_char_setp_next(basic_streambuf_char *this, char *first, char *next, char *last)
1344 {
1345     TRACE("(%p %p %p %p)\n", this, first, next, last);
1346
1347     this->wbuf = first;
1348     this->wpos = next;
1349     this->wsize = last-next;
1350 }
1351
1352 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXPAD0@Z */
1353 /* ?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z */
1354 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_setp, 12)
1355 void __thiscall basic_streambuf_char_setp(basic_streambuf_char *this, char *first, char *last)
1356 {
1357     basic_streambuf_char_setp_next(this, first, first, last);
1358 }
1359
1360 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1361 /* ?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1362 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetc, 4)
1363 int __thiscall basic_streambuf_char_sgetc(basic_streambuf_char *this)
1364 {
1365     FIXME("(%p) stub\n", this);
1366     return 0;
1367 }
1368
1369 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPADH@Z */
1370 /* ?sgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEAD_J@Z */
1371 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sgetn, 12)
1372 streamsize __thiscall basic_streambuf_char_sgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1373 {
1374     FIXME("(%p %p %lu) stub\n", this, ptr, count);
1375     return 0;
1376 }
1377
1378 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1379 /* ?showmanyc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JXZ */
1380 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_showmanyc, 4)
1381 streamsize __thiscall basic_streambuf_char_showmanyc(basic_streambuf_char *this)
1382 {
1383     FIXME("(%p) stub\n", this);
1384     return 0;
1385 }
1386
1387 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1388 /* ?snextc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1389 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_snextc, 4)
1390 int __thiscall basic_streambuf_char_snextc(basic_streambuf_char *this)
1391 {
1392     FIXME("(%p) stub\n", this);
1393     return 0;
1394 }
1395
1396 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1397 /* ?sputbackc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1398 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputbackc, 8)
1399 int __thiscall basic_streambuf_char_sputbackc(basic_streambuf_char *this, char ch)
1400 {
1401     FIXME("(%p %d) stub\n", this, ch);
1402     return 0;
1403 }
1404
1405 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z */
1406 /* ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z */
1407 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputc, 8)
1408 int __thiscall basic_streambuf_char_sputc(basic_streambuf_char *this, char ch)
1409 {
1410     FIXME("(%p %d) stub\n", this, ch);
1411     return 0;
1412 }
1413
1414 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z */
1415 /* ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z */
1416 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sputn, 12)
1417 streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1418 {
1419     FIXME("(%p %p %lu) stub\n", this, ptr, count);
1420     return 0;
1421 }
1422
1423 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEXXZ */
1424 /* ?stossc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1425 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_stossc, 4)
1426 void __thiscall basic_streambuf_char_stossc(basic_streambuf_char *this)
1427 {
1428     FIXME("(%p) stub\n", this);
1429 }
1430
1431 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ */
1432 /* ?sungetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHXZ */
1433 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sungetc, 4)
1434 int __thiscall basic_streambuf_char_sungetc(basic_streambuf_char *this)
1435 {
1436     FIXME("(%p) stub\n", this);
1437     return 0;
1438 }
1439
1440 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1441 /* ?sync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1442 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_sync, 4)
1443 int __thiscall basic_streambuf_char_sync(basic_streambuf_char *this)
1444 {
1445     FIXME("(%p) stub\n", this);
1446     return 0;
1447 }
1448
1449 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1450 /* ?uflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1451 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_uflow, 4)
1452 int __thiscall basic_streambuf_char_uflow(basic_streambuf_char *this)
1453 {
1454     FIXME("(%p) stub\n", this);
1455     return 0;
1456 }
1457
1458 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHXZ */
1459 /* ?underflow@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAAHXZ */
1460 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_underflow, 4)
1461 int __thiscall basic_streambuf_char_underflow(basic_streambuf_char *this)
1462 {
1463     FIXME("(%p) stub\n", this);
1464     return 0;
1465 }
1466
1467 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPADH@Z */
1468 /* ?xsgetn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEAD_J@Z */
1469 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsgetn, 12)
1470 streamsize __thiscall basic_streambuf_char_xsgetn(basic_streambuf_char *this, char *ptr, streamsize count)
1471 {
1472     FIXME("(%p %p %lu) stub\n", this, ptr, count);
1473     return 0;
1474 }
1475
1476 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MAEHPBDH@Z */
1477 /* ?xsputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@MEAA_JPEBD_J@Z */
1478 DEFINE_THISCALL_WRAPPER(basic_streambuf_char_xsputn, 12)
1479 streamsize __thiscall basic_streambuf_char_xsputn(basic_streambuf_char *this, const char *ptr, streamsize count)
1480 {
1481     FIXME("(%p %p %lu) stub\n", this, ptr, count);
1482     return 0;
1483 }
1484
1485 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
1486 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@_N@Z */
1487 DEFINE_THISCALL_WRAPPER(basic_ostream_char_ctor, 12)
1488 basic_ostream_char* __thiscall basic_ostream_char_ctor(basic_ostream_char *this, basic_streambuf_char *strbuf, MSVCP_bool isstd)
1489 {
1490     FIXME("(%p %p %d) stub\n", this, strbuf, isstd);
1491
1492     this->vtable = &MSVCP_basic_ostream_char_vtable+1;
1493     this->child.child.vtable = &MSVCP_basic_ostream_char_vtable;
1494     return NULL;
1495 }
1496
1497 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@W4_Uninitialized@1@_N@Z */
1498 /* ??0?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA@W4_Uninitialized@1@_N@Z */
1499 DEFINE_THISCALL_WRAPPER(basic_ostream_char_uninitialized, 12)
1500 basic_ostream_char* __thiscall basic_ostream_char_uninitialized(basic_ostream_char *this, int uninitialized, MSVCP_bool addstd)
1501 {
1502     FIXME("(%p %d %x) stub\n", this, uninitialized, addstd);
1503     return NULL;
1504 }
1505
1506 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UAE@XZ */
1507 /* ??1?$basic_ostream@DU?$char_traits@D@std@@@std@@UEAA@XZ */
1508 DEFINE_THISCALL_WRAPPER(basic_ostream_char_dtor, 4)
1509 void __thiscall basic_ostream_char_dtor(basic_ostream_char *this)
1510 {
1511     FIXME("(%p) stub\n", this);
1512 }
1513
1514 DEFINE_THISCALL_WRAPPER(MSVCP_basic_ostream_char_vector_dtor, 8)
1515 basic_ostream_char* __thiscall MSVCP_basic_ostream_char_vector_dtor(basic_ostream_char *this, unsigned int flags)
1516 {
1517     TRACE("(%p %x) stub\n", this, flags);
1518     if(flags & 2) {
1519         /* we have an array, with the number of elements stored before the first object */
1520         int i, *ptr = (int *)this-1;
1521
1522         for(i=*ptr-1; i>=0; i--)
1523             basic_ostream_char_dtor(this+i);
1524         MSVCRT_operator_delete(ptr);
1525     } else {
1526         basic_ostream_char_dtor(this);
1527         if(flags & 1)
1528             MSVCRT_operator_delete(this);
1529     }
1530
1531     return this;
1532 }
1533
1534 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@F@Z */
1535 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@F@Z */
1536 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_short, 8)
1537 basic_ostream_char* __thiscall basic_ostream_char_print_short(basic_ostream_char *this, short val)
1538 {
1539     FIXME("(%p %d) stub\n", this, val);
1540     return NULL;
1541 }
1542
1543 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@G@Z */
1544 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@G@Z */
1545 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ushort, 8)
1546 basic_ostream_char* __thiscall basic_ostream_char_print_ushort(basic_ostream_char *this, unsigned short val)
1547 {
1548     FIXME("(%p %d) stub\n", this, val);
1549     return NULL;
1550 }
1551
1552 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z */
1553 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z */
1554 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int, 8)
1555 basic_ostream_char* __thiscall basic_ostream_char_print_int(basic_ostream_char *this, int val)
1556 {
1557     FIXME("(%p %d) stub\n", this, val);
1558     return NULL;
1559 }
1560
1561 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@I@Z */
1562 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@I@Z */
1563 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint, 8)
1564 basic_ostream_char* __thiscall basic_ostream_char_print_uint(basic_ostream_char *this, unsigned int val)
1565 {
1566     FIXME("(%p %d) stub\n", this, val);
1567     return NULL;
1568 }
1569
1570 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@J@Z */
1571 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@J@Z */
1572 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_long, 8)
1573 basic_ostream_char* __thiscall basic_ostream_char_print_long(basic_ostream_char *this, LONG val)
1574 {
1575     FIXME("(%p %d) stub\n", this, val);
1576     return NULL;
1577 }
1578
1579 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@K@Z */
1580 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@K@Z */
1581 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ulong, 8)
1582 basic_ostream_char* __thiscall basic_ostream_char_print_ulong(basic_ostream_char *this, ULONG val)
1583 {
1584     FIXME("(%p %d) stub\n", this, val);
1585     return NULL;
1586 }
1587
1588 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@M@Z */
1589 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z */
1590 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_float, 8)
1591 basic_ostream_char* __thiscall basic_ostream_char_print_float(basic_ostream_char *this, float val)
1592 {
1593     FIXME("(%p %f) stub\n", this, val);
1594     return NULL;
1595 }
1596
1597 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@N@Z */
1598 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z */
1599 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_double, 12)
1600 basic_ostream_char* __thiscall basic_ostream_char_print_double(basic_ostream_char *this, double val)
1601 {
1602     FIXME("(%p %lf) stub\n", this, val);
1603     return NULL;
1604 }
1605
1606 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
1607 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@Z */
1608 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_streambuf, 8)
1609 basic_ostream_char* __thiscall basic_ostream_char_print_streambuf(basic_ostream_char *this, basic_streambuf_char *val)
1610 {
1611     FIXME("(%p %p) stub\n", this, val);
1612     return NULL;
1613 }
1614
1615 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@PBX@Z */
1616 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z */
1617 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_ptr, 8)
1618 basic_ostream_char* __thiscall basic_ostream_char_print_ptr(basic_ostream_char *this, const void *val)
1619 {
1620     FIXME("(%p %p) stub\n", this, val);
1621     return NULL;
1622 }
1623
1624 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_J@Z */
1625 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_J@Z */
1626 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_int64, 12)
1627 basic_ostream_char* __thiscall basic_ostream_char_print_int64(basic_ostream_char *this, __int64 val)
1628 {
1629     FIXME("(%p) stub\n", this);
1630     return NULL;
1631 }
1632
1633 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_K@Z */
1634 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_K@Z */
1635 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_uint64, 12)
1636 basic_ostream_char* __thiscall basic_ostream_char_print_uint64(basic_ostream_char *this, unsigned __int64 val)
1637 {
1638     FIXME("(%p) stub\n", this);
1639     return NULL;
1640 }
1641
1642 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@_N@Z */
1643 /* ??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@_N@Z */
1644 DEFINE_THISCALL_WRAPPER(basic_ostream_char_print_bool, 8)
1645 basic_ostream_char* __thiscall basic_ostream_char_print_bool(basic_ostream_char *this, MSVCP_bool val)
1646 {
1647     FIXME("(%p %x) stub\n", this, val);
1648     return NULL;
1649 }
1650
1651 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
1652 /* ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1653 DEFINE_THISCALL_WRAPPER(basic_ostream_char__Osfx, 4)
1654 void __thiscall basic_ostream_char__Osfx(basic_ostream_char *this)
1655 {
1656     FIXME("(%p) stub\n", this);
1657 }
1658
1659 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ */
1660 /* ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ */
1661 DEFINE_THISCALL_WRAPPER(basic_ostream_char_flush, 4)
1662 basic_ostream_char* __thiscall basic_ostream_char_flush(basic_ostream_char *this)
1663 {
1664     FIXME("(%p) stub\n", this);
1665     return NULL;
1666 }
1667
1668 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE_NXZ */
1669 /* ?opfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA_NXZ */
1670 DEFINE_THISCALL_WRAPPER(basic_ostream_char_opfx, 4)
1671 MSVCP_bool __thiscall basic_ostream_char_opfx(basic_ostream_char *this)
1672 {
1673     FIXME("(%p) stub\n", this);
1674     return 0;
1675 }
1676
1677 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ */
1678 /* ?osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAXXZ */
1679 DEFINE_THISCALL_WRAPPER(basic_ostream_char_osfx, 4)
1680 void __thiscall basic_ostream_char_osfx(basic_ostream_char *this)
1681 {
1682     FIXME("(%p) stub\n", this);
1683 }
1684
1685 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z */
1686 /* ?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@D@Z */
1687 DEFINE_THISCALL_WRAPPER(basic_ostream_char_put, 8)
1688 basic_ostream_char* __thiscall basic_ostream_char_put(basic_ostream_char *this, char ch)
1689 {
1690     FIXME("(%p %c) stub\n", this, ch);
1691     return NULL;
1692 }
1693
1694 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@JH@Z */
1695 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@_JH@Z */
1696 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp, 12)
1697 basic_ostream_char* __thiscall basic_ostream_char_seekp(basic_ostream_char *this, streamoff off, int way)
1698 {
1699     FIXME("(%p %lu %d) stub\n", this, off, way);
1700     return NULL;
1701 }
1702
1703 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@V?$fpos@H@2@@Z */
1704 /* ?seekp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@V?$fpos@H@2@@Z */
1705 DEFINE_THISCALL_WRAPPER(basic_ostream_char_seekp_fpos, 28)
1706 basic_ostream_char* __thiscall basic_ostream_char_seekp_fpos(basic_ostream_char *this, fpos_int pos)
1707 {
1708     FIXME("(%p %s) stub\n", this, debugstr_fpos_int(&pos));
1709     return NULL;
1710 }
1711
1712 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE?AV?$fpos@H@2@XZ */
1713 /* ?tellp@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAA?AV?$fpos@H@2@XZ */
1714 DEFINE_THISCALL_WRAPPER_RETPTR(basic_ostream_char_tellp, 4)
1715 fpos_int __thiscall basic_ostream_char_tellp(basic_ostream_char *this)
1716 {
1717     fpos_int ret = { 0 }; /* FIXME */
1718     FIXME("(%p) stub\n", this);
1719     return ret;
1720 }
1721
1722 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@PBDH@Z */
1723 /* ?write@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEBD_J@Z */
1724 DEFINE_THISCALL_WRAPPER(basic_ostream_char_write, 12)
1725 basic_ostream_char* __thiscall basic_ostream_char_write(basic_ostream_char *this, const char *str, streamsize count)
1726 {
1727     FIXME("(%p %s %lu) stub\n", this, debugstr_a(str), count);
1728     return NULL;
1729 }