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