ReactOS 0.4.15-dev-7788-g1ad9096
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
44extern unsigned int __lc_codepage;
45extern int __lc_collate_cp;
46extern int __mb_cur_max;
47extern const unsigned short _ctype [257];
48
49void __cdecl _purecall(void);
50__declspec(noreturn) void __cdecl _amsg_exit(int errnum);
51
52extern char **_environ;
53extern wchar_t **_wenviron;
54extern char ** SnapshotOfEnvironmentA(char **);
55extern 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//
81typedef void* (__cdecl *malloc_func_t)(size_t);
82typedef void (__cdecl *free_func_t)(void*);
83
84/* Setup and teardown multi threaded locks */
85extern void msvcrt_init_mt_locks(void);
86extern void msvcrt_free_mt_locks(void);
87
89extern void msvcrt_init_math(void);
90extern void msvcrt_init_io(void);
91extern void msvcrt_free_io(void);
92extern void msvcrt_init_console(void);
93extern void msvcrt_free_console(void);
94extern void msvcrt_init_args(void);
95extern void msvcrt_free_args(void);
96extern void msvcrt_init_signals(void);
97extern void msvcrt_free_signals(void);
98extern void msvcrt_free_popen_data(void);
99
100extern 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
120extern 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
143void _default_handler(int signal);
144typedef struct _sig_element
145{
147 char *signame;
150
151#define MSVCRT_malloc malloc
152#define MSVCRT_free free
153char* _setlocale(int,const char*);
155
156/* ioinfo structure size is different in msvcrXX.dll's */
157typedef struct {
159 unsigned char wxflag;
160 char lookahead[3];
161 int exflag;
162 CRITICAL_SECTION crit;
163} ioinfo;
164
165#endif /* __WINE_MSVCRT_H */
#define __cdecl
Definition: accygwin.h:79
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:1220
#define NTSYSAPI
Definition: ntoskrnl.h:12
void(* __p_sig_fn_t)(int)
Definition: signal.h:45
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
static const WCHAR Message[]
Definition: register.c:74
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
void __cdecl _purecall(void)
Definition: adapter.cpp:429
void msvcrt_init_io(void)
Definition: file.c:456
void msvcrt_init_mt_locks(void)
Definition: lock.c:54
void msvcrt_init_math(void)
void msvcrt_free_args(void)
void __cdecl MSVCRT_operator_delete(void *)
Definition: heap.c:196
void *(__cdecl * malloc_func_t)(MSVCRT_size_t)
Definition: msvcrt.h:227
void msvcrt_free_mt_locks(void)
Definition: lock.c:77
void msvcrt_free_io(void)
Definition: file.c:1100
void msvcrt_free_signals(void)
Definition: except.c:183
BOOL msvcrt_init_locale(void)
void __cdecl _amsg_exit(int errnum)
Definition: amsg.c:44
void msvcrt_init_console(void)
void(__cdecl * free_func_t)(void *)
Definition: msvcrt.h:228
void msvcrt_init_args(void)
void msvcrt_init_signals(void)
Definition: except.c:178
void *__cdecl MSVCRT_operator_new(MSVCRT_size_t)
Definition: heap.c:152
void msvcrt_free_console(void)
char *__cdecl __unDName(char *, const char *, int, malloc_func_t, free_func_t, unsigned short int)
Definition: undname.c:1647
struct _sig_element sig_element
void(* float_handler)(int, int)
Definition: msvcrt.h:142
char * _setlocale(int, const char *)
const unsigned short _ctype[257]
Definition: ctype.c:36
int __mb_cur_max
Definition: locale.c:37
wchar_t ** SnapshotOfEnvironmentW(wchar_t **)
wchar_t ** _wenviron
Definition: environ.c:23
int __lc_collate_cp
NTSYSAPI VOID NTAPI RtlAssert(PVOID FailedAssertion, PVOID FileName, ULONG LineNumber, PCHAR Message)
char ** SnapshotOfEnvironmentA(char **)
void msvcrt_free_popen_data(void)
Definition: popen.c:29
unsigned int __lc_codepage
Definition: locale.c:34
char ** _environ
Definition: environ.c:22
void _default_handler(int signal)
Definition: signal.c:120
unsigned create_io_inherit_block(WORD *, BYTE **)
Definition: file.c:411
__declspec(noreturn) void __cdecl _amsg_exit(int errnum)
Definition: noreturn.cpp:19
int signal
Definition: except.c:82
__p_sig_fn_t handler
Definition: msvcrt.h:148
char * signame
Definition: msvcrt.h:147
int signal
Definition: msvcrt.h:146
Definition: file.c:40
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
unsigned char BYTE
Definition: xxhash.c:193