ReactOS  0.4.13-dev-249-gcba1a2f
msvcrt.h
Go to the documentation of this file.
1 /*
2  * Copyright 2001 Jon Griffiths
3  * Copyright 2004 Dimitrie O. Paun
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  *
19  * NOTES
20  * Naming conventions
21  * - Symbols are prefixed with MSVCRT_ if they conflict
22  * with libc symbols
23  * - Internal symbols are usually prefixed by msvcrt_.
24  * - Exported symbols that are not present in the public
25  * headers are usually kept the same as the original.
26  * Other conventions
27  * - To avoid conflicts with the standard C library,
28  * no msvcrt headers are included in the implementation.
29  * - Instead, symbols are duplicated here, prefixed with
30  * MSVCRT_, as explained above.
31  * - To avoid inconsistencies, a test for each symbol is
32  * added into tests/headers.c. Please always add a
33  * corresponding test when you add a new symbol!
34  */
35 
36 #ifndef __WINE_MSVCRT_H
37 #define __WINE_MSVCRT_H
38 
39 #include <stdarg.h>
40 #include <signal.h>
41 #include "windef.h"
42 #include "winbase.h"
43 
44 extern unsigned int __lc_codepage;
45 extern int __lc_collate_cp;
46 extern int __mb_cur_max;
47 extern const unsigned short _ctype [257];
48 
49 void __cdecl _purecall(void);
50 __declspec(noreturn) void __cdecl _amsg_exit(int errnum);
51 
52 extern char **_environ;
53 extern wchar_t **_wenviron;
54 extern char ** SnapshotOfEnvironmentA(char **);
55 extern wchar_t ** SnapshotOfEnvironmentW(wchar_t **);
56 
57 /* Application type flags */
58 #define _UNKNOWN_APP 0
59 #define _CONSOLE_APP 1
60 #define _GUI_APP 2
61 
62 /* I/O Streamming flags missing from stdio.h */
63 #define _IOYOURBUF 0x0100
64 #define _IOAPPEND 0x0200
65 #define _IOSETVBUF 0x0400
66 #define _IOFEOF 0x0800
67 #define _IOFLRTN 0x1000
68 #define _IOCTRLZ 0x2000
69 #define _IOCOMMIT 0x4000
70 #define _IOFREE 0x10000
71 
72 //wchar_t *wstrdupa(const char *);
73 //
75 // * it would not be much use anyway. Even for Winelib applications.
76 // */
77 //int __cdecl _set_new_mode(int mode);
78 //
79 void* __cdecl MSVCRT_operator_new(size_t);
81 typedef void* (__cdecl *malloc_func_t)(size_t);
82 typedef void (__cdecl *free_func_t)(void*);
83 
84 /* Setup and teardown multi threaded locks */
85 extern void msvcrt_init_mt_locks(void);
86 extern void msvcrt_free_mt_locks(void);
87 
88 extern BOOL msvcrt_init_locale(void);
89 extern void msvcrt_init_math(void);
90 extern void msvcrt_init_io(void);
91 extern void msvcrt_free_io(void);
92 extern void msvcrt_init_console(void);
93 extern void msvcrt_free_console(void);
94 extern void msvcrt_init_args(void);
95 extern void msvcrt_free_args(void);
96 extern void msvcrt_init_signals(void);
97 extern void msvcrt_free_signals(void);
98 extern void msvcrt_free_popen_data(void);
99 
100 extern unsigned create_io_inherit_block(WORD*, BYTE**);
101 
102 /* _set_abort_behavior codes */
103 #define MSVCRT__WRITE_ABORT_MSG 1
104 #define MSVCRT__CALL_REPORTFAULT 2
105 
106 #define MSVCRT_LC_ALL LC_ALL
107 #define MSVCRT_LC_COLLATE LC_COLLATE
108 #define MSVCRT_LC_CTYPE LC_CTYPE
109 #define MSVCRT_LC_MONETARY LC_MONETARY
110 #define MSVCRT_LC_NUMERIC LC_NUMERIC
111 #define MSVCRT_LC_TIME LC_TIME
112 #define MSVCRT_LC_MIN LC_MIN
113 #define MSVCRT_LC_MAX LC_MAX
114 
115 #define MSVCRT__OUT_TO_DEFAULT 0
116 #define MSVCRT__OUT_TO_STDERR 1
117 #define MSVCRT__OUT_TO_MSGBOX 2
118 #define MSVCRT__REPORT_ERRMODE 3
119 
120 extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
121 
122 /* __unDName/__unDNameEx flags */
123 #define UNDNAME_COMPLETE (0x0000)
124 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */
125 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */
126 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */
127 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
128 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
129 #define UNDNAME_NO_MS_THISTYPE (0x0020)
130 #define UNDNAME_NO_CV_THISTYPE (0x0040)
131 #define UNDNAME_NO_THISTYPE (0x0060)
132 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */
133 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
134 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */
135 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
136 #define UNDNAME_32_BIT_DECODE (0x0800)
137 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */
138 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */
139 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
140 #define UNDNAME_NO_COMPLEX_TYPE (0x8000)
141 
142 typedef void (*float_handler)(int, int);
143 void _default_handler(int signal);
144 typedef struct _sig_element
145 {
146  int signal;
147  char *signame;
149 }sig_element;
150 
151 #define MSVCRT_malloc malloc
152 #define MSVCRT_free free
153 char* _setlocale(int,const char*);
155 
156 /* ioinfo structure size is different in msvcrXX.dll's */
157 typedef struct {
158  HANDLE handle;
159  unsigned char wxflag;
160  char lookahead[3];
161  int exflag;
162  CRITICAL_SECTION crit;
163 } ioinfo;
164 
165 #endif /* __WINE_MSVCRT_H */
signed char * PCHAR
Definition: retypes.h:7
void msvcrt_init_math(void)
unsigned int __lc_codepage
Definition: locale.c:34
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
void __cdecl MSVCRT_operator_delete(void *)
Definition: heap.c:91
char ** SnapshotOfEnvironmentA(char **)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
void msvcrt_free_io(void)
Definition: file.c:1100
#define __cdecl
Definition: accygwin.h:79
Definition: file.c:40
char *__cdecl __unDName(char *, const char *, int, malloc_func_t, free_func_t, unsigned short int)
Definition: undname.c:1645
void(* float_handler)(int, int)
Definition: msvcrt.h:142
wchar_t ** SnapshotOfEnvironmentW(wchar_t **)
void msvcrt_init_io(void)
Definition: file.c:457
#define NTSYSAPI
Definition: ntoskrnl.h:14
BOOL msvcrt_init_locale(void)
int signal
Definition: msvcrt.h:146
void __cdecl _amsg_exit(int errnum)
Definition: amsg.c:47
void msvcrt_free_popen_data(void)
Definition: popen.c:29
void *__cdecl MSVCRT_operator_new(MSVCRT_size_t)
void msvcrt_free_args(void)
void msvcrt_free_signals(void)
void __cdecl _purecall(void)
Definition: adapter.cpp:429
char * signame
Definition: msvcrt.h:147
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
void msvcrt_init_console(void)
char ** _environ
Definition: environ.c:22
void msvcrt_free_mt_locks(void)
Definition: lock.c:77
void(__cdecl * free_func_t)(void *)
Definition: msvcrt.h:228
void msvcrt_free_console(void)
int __lc_collate_cp
void msvcrt_init_args(void)
void msvcrt_init_signals(void)
void *(__cdecl * malloc_func_t)(MSVCRT_size_t)
Definition: msvcrt.h:227
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned create_io_inherit_block(WORD *, BYTE **)
Definition: file.c:411
struct _sig_element sig_element
CHAR Message[80]
Definition: alive.c:5
int signal
Definition: xcptfil.c:12
unsigned char BYTE
Definition: mem.h:68
const unsigned short _ctype[257]
Definition: ctype.c:36
wchar_t ** _wenviron
Definition: environ.c:23
char * _setlocale(int, const char *)
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1194
int __mb_cur_max
Definition: locale.c:37
NTSYSAPI VOID NTAPI RtlAssert(PVOID FailedAssertion, PVOID FileName, ULONG LineNumber, PCHAR Message)
__p_sig_fn_t handler
Definition: msvcrt.h:148
__declspec(noreturn) void __cdecl _amsg_exit(int errnum)
Definition: thread.c:28
unsigned int ULONG
Definition: retypes.h:1
void _default_handler(int signal)
Definition: signal.c:120
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
void msvcrt_init_mt_locks(void)
Definition: lock.c:54
void(* __p_sig_fn_t)(int)
Definition: signal.h:45