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