msvcp90: Remove the msvcp90 debug channel where unused.
[wine] / dlls / msvcp90 / msvcp90.h
1 /*
2  * Copyright 2010 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 "stdlib.h"
20 #include "windef.h"
21
22 typedef unsigned char MSVCP_BOOL;
23
24 void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*,
25         const wchar_t*, unsigned int, uintptr_t);
26
27 extern void* (__cdecl *MSVCRT_operator_new)(size_t);
28 extern void (__cdecl *MSVCRT_operator_delete)(void*);
29
30 /* Copied from dlls/msvcrt/cpp.c */
31 #ifdef __i386__  /* thiscall functions are i386-specific */
32
33 #define THISCALL(func) __thiscall_ ## func
34 #define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func)
35 #define DEFINE_THISCALL_WRAPPER(func,args) \
36     extern void THISCALL(func)(void); \
37     __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
38                       "popl %eax\n\t" \
39                       "pushl %ecx\n\t" \
40                       "pushl %eax\n\t" \
41                       "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
42 #else /* __i386__ */
43
44 #define THISCALL(func) func
45 #define THISCALL_NAME(func) __ASM_NAME(#func)
46 #define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
47
48 #endif /* __i386__ */
49
50 /* exception object */
51 typedef void (*vtable_ptr)(void);
52 typedef struct __exception
53 {
54     const vtable_ptr *vtable;
55     char             *name;    /* Name of this exception, always a new copy for each object */
56     int               do_free; /* Whether to free 'name' in our dtor */
57 } exception;
58
59 /* Internal: throws selected exception */
60 typedef enum __exception_type {
61     EXCEPTION,
62     EXCEPTION_BAD_ALLOC,
63     EXCEPTION_LOGIC_ERROR,
64     EXCEPTION_LENGTH_ERROR,
65     EXCEPTION_OUT_OF_RANGE,
66     EXCEPTION_INVALID_ARGUMENT
67 } exception_type;
68 void throw_exception(exception_type, const char *);
69 void set_exception_vtable(void);
70
71 /* rtti */
72 typedef struct __type_info
73 {
74     const vtable_ptr *vtable;
75     char              *name;        /* Unmangled name, allocated lazily */
76     char               mangled[32]; /* Variable length, but we declare it large enough for static RTTI */
77 } type_info;
78
79 /* offsets for computing the this pointer */
80 typedef struct
81 {
82     int         this_offset;   /* offset of base class this pointer from start of object */
83     int         vbase_descr;   /* offset of virtual base class descriptor */
84     int         vbase_offset;  /* offset of this pointer offset in virtual base class descriptor */
85 } this_ptr_offsets;
86
87 typedef struct _rtti_base_descriptor
88 {
89     const type_info *type_descriptor;
90     int num_base_classes;
91     this_ptr_offsets offsets;    /* offsets for computing the this pointer */
92     unsigned int attributes;
93 } rtti_base_descriptor;
94
95 typedef struct _rtti_base_array
96 {
97     const rtti_base_descriptor *bases[3]; /* First element is the class itself */
98 } rtti_base_array;
99
100 typedef struct _rtti_object_hierarchy
101 {
102     unsigned int signature;
103     unsigned int attributes;
104     int array_len; /* Size of the array pointed to by 'base_classes' */
105     const rtti_base_array *base_classes;
106 } rtti_object_hierarchy;
107
108 typedef struct _rtti_object_locator
109 {
110     unsigned int signature;
111     int base_class_offset;
112     unsigned int flags;
113     const type_info *type_descriptor;
114     const rtti_object_hierarchy *type_hierarchy;
115 } rtti_object_locator;
116
117 /* basic_string<char, char_traits<char>, allocator<char>> */
118 #define BUF_SIZE_CHAR 16
119 typedef struct _basic_string_char
120 {
121     void *allocator;
122     union _data {
123         char buf[BUF_SIZE_CHAR];
124         char *ptr;
125     } data;
126     size_t size;
127     size_t res;
128 } basic_string_char;
129
130 basic_string_char* __stdcall MSVCP_basic_string_char_ctor_cstr(basic_string_char*, const char*);
131 basic_string_char* __stdcall MSVCP_basic_string_char_copy_ctor(basic_string_char*, const basic_string_char*);
132 void __stdcall MSVCP_basic_string_char_dtor(basic_string_char*);
133 const char* __stdcall MSVCP_basic_string_char_c_str(basic_string_char*);
134
135 char* __stdcall MSVCP_allocator_char_allocate(void*, size_t);
136 void __stdcall MSVCP_allocator_char_deallocate(void*, char*, size_t);