kernel32: Cast-qual warnings fix.
[wine] / dlls / msvcrt / msvcrt.h
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
41 #include "windef.h"
42 #include "winbase.h"
43
44 typedef unsigned short MSVCRT_wchar_t;
45 typedef unsigned short MSVCRT_wint_t;
46 typedef unsigned short MSVCRT_wctype_t;
47 typedef unsigned short MSVCRT__ino_t;
48 typedef unsigned long  MSVCRT__fsize_t;
49 #ifdef _WIN64
50 typedef unsigned __int64 MSVCRT_size_t;
51 typedef __int64 MSVCRT_intptr_t;
52 typedef unsigned __int64 MSVCRT_uintptr_t;
53 #else
54 typedef unsigned int MSVCRT_size_t;
55 typedef int MSVCRT_intptr_t;
56 typedef unsigned int MSVCRT_uintptr_t;
57 #endif
58 typedef unsigned int   MSVCRT__dev_t;
59 typedef int  MSVCRT__off_t;
60 typedef long MSVCRT_clock_t;
61 typedef long MSVCRT_time_t;
62 typedef __int64 MSVCRT_fpos_t;
63
64 typedef void (*MSVCRT_terminate_handler)(void);
65 typedef void (*MSVCRT_terminate_function)(void);
66 typedef void (*MSVCRT_unexpected_handler)(void);
67 typedef void (*MSVCRT_unexpected_function)(void);
68 typedef void (*MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
69 typedef void (*MSVCRT__beginthread_start_routine_t)(void *);
70 typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
71 typedef int (*MSVCRT__onexit_t)(void);
72
73 struct MSVCRT_tm {
74     int tm_sec;
75     int tm_min;
76     int tm_hour;
77     int tm_mday;
78     int tm_mon;
79     int tm_year;
80     int tm_wday;
81     int tm_yday;
82     int tm_isdst;
83 };
84
85
86 /* TLS data */
87 extern DWORD msvcrt_tls_index;
88
89 struct __thread_data {
90     int                             thread_errno;
91     unsigned long                   thread_doserrno;
92     unsigned int                    random_seed;        /* seed for rand() */
93     char                           *strtok_next;        /* next ptr for strtok() */
94     unsigned char                  *mbstok_next;        /* next ptr for mbstok() */
95     MSVCRT_wchar_t                 *wcstok_next;        /* next ptr for wcstok() */
96     char                           *efcvt_buffer;       /* buffer for ecvt/fcvt */
97     char                           *asctime_buffer;     /* buffer for asctime */
98     MSVCRT_wchar_t                 *wasctime_buffer;    /* buffer for wasctime */
99     struct MSVCRT_tm                time_buffer;        /* buffer for localtime/gmtime */
100     char                           *strerror_buffer;    /* buffer for strerror */
101     int                             fpecode;
102     MSVCRT_terminate_function       terminate_handler;
103     MSVCRT_unexpected_function      unexpected_handler;
104     MSVCRT__se_translator_function  se_translator;
105     EXCEPTION_RECORD               *exc_record;
106 };
107
108 typedef struct __thread_data thread_data_t;
109
110 extern thread_data_t *msvcrt_get_thread_data(void);
111
112 extern int msvcrt_current_lc_all_cp;
113
114 void   msvcrt_set_errno(int);
115 char*  msvcrt_strndup(const char*,unsigned int);
116 MSVCRT_wchar_t *msvcrt_wstrndup(const MSVCRT_wchar_t*, unsigned int);
117
118 void   _purecall(void);
119 void   _amsg_exit(int errnum);
120
121 extern char **_environ;
122 extern MSVCRT_wchar_t **_wenviron;
123
124 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
125 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **);
126
127 /* FIXME: This should be declared in new.h but it's not an extern "C" so
128  * it would not be much use anyway. Even for Winelib applications.
129  */
130 int    MSVCRT__set_new_mode(int mode);
131
132 void* MSVCRT_operator_new(unsigned long size);
133 void  MSVCRT_operator_delete(void*);
134
135 typedef void* (*malloc_func_t)(MSVCRT_size_t);
136 typedef void  (*free_func_t)(void*);
137
138 extern char* __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
139 extern char* __unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int);
140
141 /* Setup and teardown multi threaded locks */
142 extern void msvcrt_init_mt_locks(void);
143 extern void msvcrt_free_mt_locks(void);
144
145 extern void msvcrt_init_io(void);
146 extern void msvcrt_free_io(void);
147 extern void msvcrt_init_console(void);
148 extern void msvcrt_free_console(void);
149 extern void msvcrt_init_args(void);
150 extern void msvcrt_free_args(void);
151 extern void msvcrt_init_signals(void);
152 extern void msvcrt_free_signals(void);
153
154 extern unsigned msvcrt_create_io_inherit_block(STARTUPINFOA*);
155
156 /* run-time error codes */
157 #define _RT_STACK       0
158 #define _RT_NULLPTR     1
159 #define _RT_FLOAT       2
160 #define _RT_INTDIV      3
161 #define _RT_EXECMEM     5
162 #define _RT_EXECFORM    6
163 #define _RT_EXECENV     7
164 #define _RT_SPACEARG    8
165 #define _RT_SPACEENV    9
166 #define _RT_ABORT       10
167 #define _RT_NPTR        12
168 #define _RT_FPTR        13
169 #define _RT_BREAK       14
170 #define _RT_INT         15
171 #define _RT_THREAD      16
172 #define _RT_LOCK        17
173 #define _RT_HEAP        18
174 #define _RT_OPENCON     19
175 #define _RT_QWIN        20
176 #define _RT_NOMAIN      21
177 #define _RT_NONCONT     22
178 #define _RT_INVALDISP   23
179 #define _RT_ONEXIT      24
180 #define _RT_PUREVIRT    25
181 #define _RT_STDIOINIT   26
182 #define _RT_LOWIOINIT   27
183 #define _RT_HEAPINIT    28
184 #define _RT_DOMAIN      120
185 #define _RT_SING        121
186 #define _RT_TLOSS       122
187 #define _RT_CRNL        252
188 #define _RT_BANNER      255
189
190 struct MSVCRT__timeb {
191     MSVCRT_time_t  time;
192     unsigned short millitm;
193     short          timezone;
194     short          dstflag;
195 };
196
197 struct MSVCRT__iobuf {
198   char* _ptr;
199   int   _cnt;
200   char* _base;
201   int   _flag;
202   int   _file;
203   int   _charbuf;
204   int   _bufsiz;
205   char* _tmpfname;
206 };
207
208 typedef struct MSVCRT__iobuf MSVCRT_FILE;
209
210 struct MSVCRT_lconv {
211     char* decimal_point;
212     char* thousands_sep;
213     char* grouping;
214     char* int_curr_symbol;
215     char* currency_symbol;
216     char* mon_decimal_point;
217     char* mon_thousands_sep;
218     char* mon_grouping;
219     char* positive_sign;
220     char* negative_sign;
221     char int_frac_digits;
222     char frac_digits;
223     char p_cs_precedes;
224     char p_sep_by_space;
225     char n_cs_precedes;
226     char n_sep_by_space;
227     char p_sign_posn;
228     char n_sign_posn;
229 };
230
231 struct MSVCRT__exception {
232   int     type;
233   char*   name;
234   double  arg1;
235   double  arg2;
236   double  retval;
237 };
238
239 struct MSVCRT__complex {
240   double x;      /* Real part */
241   double y;      /* Imaginary part */
242 };
243
244 typedef struct MSVCRT__div_t {
245     int quot;  /* quotient */
246     int rem;   /* remainder */
247 } MSVCRT_div_t;
248
249 typedef struct MSVCRT__ldiv_t {
250     long quot;  /* quotient */
251     long rem;   /* remainder */
252 } MSVCRT_ldiv_t;
253
254 struct MSVCRT__heapinfo {
255   int*           _pentry;
256   MSVCRT_size_t  _size;
257   int            _useflag;
258 };
259
260 #ifdef __i386__
261 struct MSVCRT___JUMP_BUFFER {
262     unsigned long Ebp;
263     unsigned long Ebx;
264     unsigned long Edi;
265     unsigned long Esi;
266     unsigned long Esp;
267     unsigned long Eip;
268     unsigned long Registration;
269     unsigned long TryLevel;
270     /* Start of new struct members */
271     unsigned long Cookie;
272     unsigned long UnwindFunc;
273     unsigned long UnwindData[6];
274 };
275 #endif /* __i386__ */
276
277 struct MSVCRT__diskfree_t {
278   unsigned int total_clusters;
279   unsigned int avail_clusters;
280   unsigned int sectors_per_cluster;
281   unsigned int bytes_per_sector;
282 };
283
284 struct MSVCRT__finddata_t {
285   unsigned attrib;
286   MSVCRT_time_t   time_create;
287   MSVCRT_time_t   time_access;
288   MSVCRT_time_t   time_write;
289   MSVCRT__fsize_t size;
290   char            name[260];
291 };
292
293 struct MSVCRT__finddatai64_t {
294   unsigned attrib;
295   MSVCRT_time_t  time_create;
296   MSVCRT_time_t  time_access;
297   MSVCRT_time_t  time_write;
298   __int64        size;
299   char           name[260];
300 };
301
302 struct MSVCRT__wfinddata_t {
303   unsigned attrib;
304   MSVCRT_time_t   time_create;
305   MSVCRT_time_t   time_access;
306   MSVCRT_time_t   time_write;
307   MSVCRT__fsize_t size;
308   MSVCRT_wchar_t  name[260];
309 };
310
311 struct MSVCRT__wfinddatai64_t {
312   unsigned attrib;
313   MSVCRT_time_t   time_create;
314   MSVCRT_time_t   time_access;
315   MSVCRT_time_t   time_write;
316   __int64         size;
317   MSVCRT_wchar_t  name[260];
318 };
319
320 struct MSVCRT__utimbuf
321 {
322     MSVCRT_time_t actime;
323     MSVCRT_time_t modtime;
324 };
325
326 /* for FreeBSD */
327 #undef st_atime
328 #undef st_ctime
329 #undef st_mtime
330
331 struct MSVCRT__stat {
332   MSVCRT__dev_t  st_dev;
333   MSVCRT__ino_t  st_ino;
334   unsigned short st_mode;
335   short          st_nlink;
336   short          st_uid;
337   short          st_gid;
338   MSVCRT__dev_t  st_rdev;
339   MSVCRT__off_t  st_size;
340   MSVCRT_time_t  st_atime;
341   MSVCRT_time_t  st_mtime;
342   MSVCRT_time_t  st_ctime;
343 };
344
345 struct MSVCRT_stat {
346   MSVCRT__dev_t  st_dev;
347   MSVCRT__ino_t  st_ino;
348   unsigned short st_mode;
349   short          st_nlink;
350   short          st_uid;
351   short          st_gid;
352   MSVCRT__dev_t  st_rdev;
353   MSVCRT__off_t  st_size;
354   MSVCRT_time_t  st_atime;
355   MSVCRT_time_t  st_mtime;
356   MSVCRT_time_t  st_ctime;
357 };
358
359 struct MSVCRT__stati64 {
360   MSVCRT__dev_t  st_dev;
361   MSVCRT__ino_t  st_ino;
362   unsigned short st_mode;
363   short          st_nlink;
364   short          st_uid;
365   short          st_gid;
366   MSVCRT__dev_t  st_rdev;
367   __int64        st_size;
368   MSVCRT_time_t  st_atime;
369   MSVCRT_time_t  st_mtime;
370   MSVCRT_time_t  st_ctime;
371 };
372
373 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
374 #define MSVCRT_EOF       (-1)
375 #define MSVCRT_TMP_MAX   0x7fff
376 #define MSVCRT_RAND_MAX  0x7fff
377 #define MSVCRT_BUFSIZ    512
378
379 #define MSVCRT_STDIN_FILENO  0
380 #define MSVCRT_STDOUT_FILENO 1
381 #define MSVCRT_STDERR_FILENO 2
382
383 /* more file._flag flags, but these conflict with Unix */
384 #define MSVCRT__IOFBF    0x0000
385 #define MSVCRT__IONBF    0x0004
386 #define MSVCRT__IOLBF    0x0040
387
388 #define MSVCRT_FILENAME_MAX 260
389 #define MSVCRT_stdin       (MSVCRT__iob+MSVCRT_STDIN_FILENO)
390 #define MSVCRT_stdout      (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
391 #define MSVCRT_stderr      (MSVCRT__iob+MSVCRT_STDERR_FILENO)
392
393 #define MSVCRT__P_WAIT    0
394 #define MSVCRT__P_NOWAIT  1
395 #define MSVCRT__P_OVERLAY 2
396 #define MSVCRT__P_NOWAITO 3
397 #define MSVCRT__P_DETACH  4
398
399 #define MSVCRT_EPERM   1
400 #define MSVCRT_ENOENT  2
401 #define MSVCRT_ESRCH   3
402 #define MSVCRT_EINTR   4
403 #define MSVCRT_EIO     5
404 #define MSVCRT_ENXIO   6
405 #define MSVCRT_E2BIG   7
406 #define MSVCRT_ENOEXEC 8
407 #define MSVCRT_EBADF   9
408 #define MSVCRT_ECHILD  10
409 #define MSVCRT_EAGAIN  11
410 #define MSVCRT_ENOMEM  12
411 #define MSVCRT_EACCES  13
412 #define MSVCRT_EFAULT  14
413 #define MSVCRT_EBUSY   16
414 #define MSVCRT_EEXIST  17
415 #define MSVCRT_EXDEV   18
416 #define MSVCRT_ENODEV  19
417 #define MSVCRT_ENOTDIR 20
418 #define MSVCRT_EISDIR  21
419 #define MSVCRT_EINVAL  22
420 #define MSVCRT_ENFILE  23
421 #define MSVCRT_EMFILE  24
422 #define MSVCRT_ENOTTY  25
423 #define MSVCRT_EFBIG   27
424 #define MSVCRT_ENOSPC  28
425 #define MSVCRT_ESPIPE  29
426 #define MSVCRT_EROFS   30
427 #define MSVCRT_EMLINK  31
428 #define MSVCRT_EPIPE   32
429 #define MSVCRT_EDOM    33
430 #define MSVCRT_ERANGE  34
431 #define MSVCRT_EDEADLK 36
432 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
433 #define MSVCRT_ENAMETOOLONG 38
434 #define MSVCRT_ENOLCK  39
435 #define MSVCRT_ENOSYS  40
436 #define MSVCRT_ENOTEMPTY 41
437 #define MSVCRT_EILSEQ    42
438
439 #define MSVCRT_LC_ALL          0
440 #define MSVCRT_LC_COLLATE      1
441 #define MSVCRT_LC_CTYPE        2
442 #define MSVCRT_LC_MONETARY     3
443 #define MSVCRT_LC_NUMERIC      4
444 #define MSVCRT_LC_TIME         5
445 #define MSVCRT_LC_MIN          MSVCRT_LC_ALL
446 #define MSVCRT_LC_MAX          MSVCRT_LC_TIME
447
448 #define MSVCRT__HEAPEMPTY      -1
449 #define MSVCRT__HEAPOK         -2
450 #define MSVCRT__HEAPBADBEGIN   -3
451 #define MSVCRT__HEAPBADNODE    -4
452 #define MSVCRT__HEAPEND        -5
453 #define MSVCRT__HEAPBADPTR     -6
454
455 #define MSVCRT__FREEENTRY      0
456 #define MSVCRT__USEDENTRY      1
457
458 #define MSVCRT__OUT_TO_DEFAULT 0
459 #define MSVCRT__REPORT_ERRMODE 3
460
461 /* ASCII char classification table - binary compatible */
462 #define MSVCRT__UPPER    0x0001  /* C1_UPPER */
463 #define MSVCRT__LOWER    0x0002  /* C1_LOWER */
464 #define MSVCRT__DIGIT    0x0004  /* C1_DIGIT */
465 #define MSVCRT__SPACE    0x0008  /* C1_SPACE */
466 #define MSVCRT__PUNCT    0x0010  /* C1_PUNCT */
467 #define MSVCRT__CONTROL  0x0020  /* C1_CNTRL */
468 #define MSVCRT__BLANK    0x0040  /* C1_BLANK */
469 #define MSVCRT__HEX      0x0080  /* C1_XDIGIT */
470 #define MSVCRT__LEADBYTE 0x8000
471 #define MSVCRT__ALPHA   (0x0100|MSVCRT__UPPER|MSVCRT__LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
472
473 #define MSVCRT__IOREAD   0x0001
474 #define MSVCRT__IOWRT    0x0002
475 #define MSVCRT__IOMYBUF  0x0008
476 #define MSVCRT__IOEOF    0x0010
477 #define MSVCRT__IOERR    0x0020
478 #define MSVCRT__IOSTRG   0x0040
479 #define MSVCRT__IORW     0x0080
480
481 #define MSVCRT__S_IEXEC  0x0040
482 #define MSVCRT__S_IWRITE 0x0080
483 #define MSVCRT__S_IREAD  0x0100
484 #define MSVCRT__S_IFIFO  0x1000
485 #define MSVCRT__S_IFCHR  0x2000
486 #define MSVCRT__S_IFDIR  0x4000
487 #define MSVCRT__S_IFREG  0x8000
488 #define MSVCRT__S_IFMT   0xF000
489
490 #define MSVCRT__LK_UNLCK  0
491 #define MSVCRT__LK_LOCK   1
492 #define MSVCRT__LK_NBLCK  2
493 #define MSVCRT__LK_RLCK   3
494 #define MSVCRT__LK_NBRLCK 4
495
496 #define MSVCRT__SH_COMPAT       0x00    /* Compatibility */
497 #define MSVCRT__SH_DENYRW       0x10    /* Deny read/write */
498 #define MSVCRT__SH_DENYWR       0x20    /* Deny write */
499 #define MSVCRT__SH_DENYRD       0x30    /* Deny read */
500 #define MSVCRT__SH_DENYNO       0x40    /* Deny nothing */
501
502 #define MSVCRT__O_RDONLY        0
503 #define MSVCRT__O_WRONLY        1
504 #define MSVCRT__O_RDWR          2
505 #define MSVCRT__O_ACCMODE       (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
506 #define MSVCRT__O_APPEND        0x0008
507 #define MSVCRT__O_RANDOM        0x0010
508 #define MSVCRT__O_SEQUENTIAL    0x0020
509 #define MSVCRT__O_TEMPORARY     0x0040
510 #define MSVCRT__O_NOINHERIT     0x0080
511 #define MSVCRT__O_CREAT         0x0100
512 #define MSVCRT__O_TRUNC         0x0200
513 #define MSVCRT__O_EXCL          0x0400
514 #define MSVCRT__O_SHORT_LIVED   0x1000
515 #define MSVCRT__O_TEXT          0x4000
516 #define MSVCRT__O_BINARY        0x8000
517 #define MSVCRT__O_RAW           MSVCRT__O_BINARY
518
519 /* _statusfp bit flags */
520 #define MSVCRT__SW_INEXACT      0x00000001 /* inexact (precision) */
521 #define MSVCRT__SW_UNDERFLOW    0x00000002 /* underflow */
522 #define MSVCRT__SW_OVERFLOW     0x00000004 /* overflow */
523 #define MSVCRT__SW_ZERODIVIDE   0x00000008 /* zero divide */
524 #define MSVCRT__SW_INVALID      0x00000010 /* invalid */
525
526 #define MSVCRT__SW_UNEMULATED     0x00000040  /* unemulated instruction */
527 #define MSVCRT__SW_SQRTNEG        0x00000080  /* square root of a neg number */
528 #define MSVCRT__SW_STACKOVERFLOW  0x00000200  /* FP stack overflow */
529 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400  /* FP stack underflow */
530
531 #define MSVCRT__SW_DENORMAL     0x00080000 /* denormal status bit */
532
533 /* fpclass constants */
534 #define MSVCRT__FPCLASS_SNAN 0x0001  /* Signaling "Not a Number" */
535 #define MSVCRT__FPCLASS_QNAN 0x0002  /* Quiet "Not a Number" */
536 #define MSVCRT__FPCLASS_NINF 0x0004  /* Negative Infinity */
537 #define MSVCRT__FPCLASS_NN   0x0008  /* Negative Normal */
538 #define MSVCRT__FPCLASS_ND   0x0010  /* Negative Denormal */
539 #define MSVCRT__FPCLASS_NZ   0x0020  /* Negative Zero */
540 #define MSVCRT__FPCLASS_PZ   0x0040  /* Positive Zero */
541 #define MSVCRT__FPCLASS_PD   0x0080  /* Positive Denormal */
542 #define MSVCRT__FPCLASS_PN   0x0100  /* Positive Normal */
543 #define MSVCRT__FPCLASS_PINF 0x0200  /* Positive Infinity */
544
545 #define MSVCRT__EM_INVALID    0x00000010
546 #define MSVCRT__EM_DENORMAL   0x00080000
547 #define MSVCRT__EM_ZERODIVIDE 0x00000008
548 #define MSVCRT__EM_OVERFLOW   0x00000004
549 #define MSVCRT__EM_UNDERFLOW  0x00000002
550 #define MSVCRT__EM_INEXACT    0x00000001
551 #define MSVCRT__IC_AFFINE     0x00040000
552 #define MSVCRT__IC_PROJECTIVE 0x00000000
553 #define MSVCRT__RC_CHOP       0x00000300
554 #define MSVCRT__RC_UP         0x00000200
555 #define MSVCRT__RC_DOWN       0x00000100
556 #define MSVCRT__RC_NEAR       0x00000000
557 #define MSVCRT__PC_24         0x00020000
558 #define MSVCRT__PC_53         0x00010000
559 #define MSVCRT__PC_64         0x00000000
560
561 #define MSVCRT_CLOCKS_PER_SEC 1000
562
563 /* signals */
564 #define MSVCRT_SIGINT   2
565 #define MSVCRT_SIGILL   4
566 #define MSVCRT_SIGFPE   8
567 #define MSVCRT_SIGSEGV  11
568 #define MSVCRT_SIGTERM  15
569 #define MSVCRT_SIGBREAK 21
570 #define MSVCRT_SIGABRT  22
571 #define MSVCRT_NSIG     (MSVCRT_SIGABRT + 1)
572
573 typedef void (*MSVCRT___sighandler_t)(int);
574
575 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
576 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
577 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
578
579 void           MSVCRT_free(void*);
580 void*          MSVCRT_malloc(MSVCRT_size_t);
581 void*          MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
582 void*          MSVCRT_realloc(void*,MSVCRT_size_t);
583
584 int            MSVCRT_iswalpha(MSVCRT_wint_t);
585 int            MSVCRT_iswspace(MSVCRT_wint_t);
586 int            MSVCRT_iswdigit(MSVCRT_wint_t);
587 int            MSVCRT_isleadbyte(int);
588
589 int            MSVCRT_fgetc(MSVCRT_FILE*);
590 int            MSVCRT_ungetc(int,MSVCRT_FILE*);
591 MSVCRT_wint_t  MSVCRT_fgetwc(MSVCRT_FILE*);
592 MSVCRT_wint_t  MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
593 void           MSVCRT__exit(int);
594 void           MSVCRT_abort(void);
595 unsigned long* MSVCRT___doserrno(void);
596 int*           MSVCRT__errno(void);
597 char*          MSVCRT_getenv(const char*);
598 char*          MSVCRT_setlocale(int,const char*);
599 int            MSVCRT_fclose(MSVCRT_FILE*);
600 void           MSVCRT_terminate(void);
601 MSVCRT_FILE*   MSVCRT__p__iob(void);
602 MSVCRT_time_t  MSVCRT_mktime(struct MSVCRT_tm *t);
603 struct MSVCRT_tm* MSVCRT_localtime(const MSVCRT_time_t* secs);
604 struct MSVCRT_tm* MSVCRT_gmtime(const MSVCRT_time_t* secs);
605 MSVCRT_clock_t MSVCRT_clock(void);
606 double         MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2);
607 MSVCRT_time_t  MSVCRT_time(MSVCRT_time_t*);
608 MSVCRT_FILE*   MSVCRT__fdopen(int, const char *);
609 int            MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, va_list valist);
610 int            MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,
611                                  const MSVCRT_wchar_t *format, va_list valist );
612
613 #ifndef __WINE_MSVCRT_TEST
614 int            _write(int,const void*,unsigned int);
615 int            _getch(void);
616 int            _ismbstrail(const unsigned char* start, const unsigned char* str);
617 MSVCRT_intptr_t _spawnve(int,const char*,const char* const *,const char* const *);
618 void           _searchenv(const char*,const char*,char*);
619 int            _getdrive(void);
620 char*          _strdup(const char*);
621 char*          _strnset(char*,int,MSVCRT_size_t);
622 char*          _strset(char*,int);
623 int            _ungetch(int);
624 int            _cputs(const char*);
625 int            _cprintf(const char*,...);
626 char***        __p__environ(void);
627 int*           __p___mb_cur_max(void);
628 unsigned int*  __p__fmode(void);
629 MSVCRT_wchar_t*   _wcsdup(const MSVCRT_wchar_t*);
630 MSVCRT_wchar_t*** __p__wenviron(void);
631 char*         _strdate(char* date);
632 char*         _strtime(char* date);
633 void          _ftime(struct MSVCRT__timeb *buf);
634 int           _close(int);
635 int           _dup(int);
636 int           _dup2(int, int);
637 int           _pipe(int *, unsigned int, int);
638 #endif
639
640 #endif /* __WINE_MSVCRT_H */