Unicodify the cookie handling code.
[wine] / dlls / msvcrt / msvcrt.h
1 /*
2  * Copyright 2001 Jon Griffiths
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_MSVCRT_H
20 #define __WINE_MSVCRT_H
21
22 #include <stdarg.h>
23 #include <ctype.h>
24 #include <string.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winerror.h"
29 #include "winnls.h"
30
31 #include "msvcrt/string.h"
32 #include "msvcrt/eh.h"
33
34 /* TLS data */
35 extern DWORD MSVCRT_tls_index;
36
37 typedef struct __MSVCRT_thread_data
38 {
39     int                      thread_errno;
40     unsigned long            thread_doserrno;
41     char                    *mbstok_next;        /* next ptr for mbstok() */
42     char                    *efcvt_buffer;       /* buffer for ecvt/fcvt */
43     int                      fpecode;
44     terminate_function       terminate_handler;
45     unexpected_function      unexpected_handler;
46     _se_translator_function  se_translator;
47     EXCEPTION_RECORD        *exc_record;
48 } MSVCRT_thread_data;
49
50 extern MSVCRT_thread_data *msvcrt_get_thread_data(void);
51
52 extern int MSVCRT_current_lc_all_cp;
53
54 void _purecall(void);
55 void   MSVCRT__set_errno(int);
56 char*  msvcrt_strndup(const char*,unsigned int);
57 MSVCRT_wchar_t *msvcrt_wstrndup(const MSVCRT_wchar_t*, unsigned int);
58
59 void MSVCRT__amsg_exit(int errnum);
60
61 extern char **MSVCRT__environ;
62 extern MSVCRT_wchar_t **MSVCRT__wenviron;
63
64 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
65 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **);
66
67 /* FIXME: This should be declared in new.h but it's not an extern "C" so
68  * it would not be much use anyway. Even for Winelib applications.
69  */
70 int    MSVCRT__set_new_mode(int mode);
71
72 void* MSVCRT_operator_new(unsigned long size);
73 void MSVCRT_operator_delete(void*);
74
75 typedef void* (*MSVCRT_malloc_func)(MSVCRT_size_t);
76 typedef void (*MSVCRT_free_func)(void*);
77
78 extern char* MSVCRT___unDName(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,unsigned short int);
79 extern char* MSVCRT___unDNameEx(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,void *,unsigned short int);
80
81 /* Setup and teardown multi threaded locks */
82 extern void msvcrt_init_mt_locks(void);
83 extern void msvcrt_free_mt_locks(void);
84
85 extern void msvcrt_init_io(void);
86 extern void msvcrt_free_io(void);
87 extern void msvcrt_init_console(void);
88 extern void msvcrt_free_console(void);
89 extern void msvcrt_init_args(void);
90 extern void msvcrt_free_args(void);
91
92 /* run-time error codes */
93 #define _RT_STACK       0
94 #define _RT_NULLPTR     1
95 #define _RT_FLOAT       2
96 #define _RT_INTDIV      3
97 #define _RT_EXECMEM     5
98 #define _RT_EXECFORM    6
99 #define _RT_EXECENV     7
100 #define _RT_SPACEARG    8
101 #define _RT_SPACEENV    9
102 #define _RT_ABORT       10
103 #define _RT_NPTR        12
104 #define _RT_FPTR        13
105 #define _RT_BREAK       14
106 #define _RT_INT         15
107 #define _RT_THREAD      16
108 #define _RT_LOCK        17
109 #define _RT_HEAP        18
110 #define _RT_OPENCON     19
111 #define _RT_QWIN        20
112 #define _RT_NOMAIN      21
113 #define _RT_NONCONT     22
114 #define _RT_INVALDISP   23
115 #define _RT_ONEXIT      24
116 #define _RT_PUREVIRT    25
117 #define _RT_STDIOINIT   26
118 #define _RT_LOWIOINIT   27
119 #define _RT_HEAPINIT    28
120 #define _RT_DOMAIN      120
121 #define _RT_SING        121
122 #define _RT_TLOSS       122
123 #define _RT_CRNL        252
124 #define _RT_BANNER      255
125
126 #endif /* __WINE_MSVCRT_H */