31dfde05f23835b04edbc510f0d0be814ef8bc41
[p5sagit/p5-mst-13.2.git] / win32 / win32.h
1 /* WIN32.H
2  *
3  * (c) 1995 Microsoft Corporation. All rights reserved. 
4  *              Developed by hip communications inc., http://info.hip.com/info/
5  *
6  *    You may distribute under the terms of either the GNU General Public
7  *    License or the Artistic License, as specified in the README file.
8  */
9 #ifndef  _INC_WIN32_PERL5
10 #define  _INC_WIN32_PERL5
11
12 #define  WIN32_LEAN_AND_MEAN
13 #include <windows.h>
14
15 #ifdef   WIN32_LEAN_AND_MEAN            /* C file is NOT a Perl5 original. */
16 #define  CONTEXT        PERL_CONTEXT    /* Avoid conflict of CONTEXT defs. */
17 #define  index          strchr          /* Why 'index'? */
18 #endif /*WIN32_LEAN_AND_MEAN */
19
20 #include <dirent.h>
21 #include <io.h>
22 #include <process.h>
23 #include <stdio.h>
24 #include <direct.h>
25
26 /* For UNIX compatibility. */
27
28 typedef long            uid_t;
29 typedef long            gid_t;
30
31 extern  char    *staticlinkmodules[];
32
33 extern  uid_t   getuid(void);
34 extern  gid_t   getgid(void);
35 extern  uid_t   geteuid(void);
36 extern  gid_t   getegid(void);
37
38 extern  int     setuid(uid_t uid);
39 extern  int     setgid(gid_t gid);
40 extern  int     kill(int pid, int sig);
41
42 #define USE_SOCKETS_AS_HANDLES
43 #ifndef USE_SOCKETS_AS_HANDLES
44 extern FILE *myfdopen(int, char *);
45
46 #undef fdopen
47 #define fdopen myfdopen
48 #endif  /* USE_SOCKETS_AS_HANDLES */
49
50 #define  STANDARD_C     1               /* Perl5 likes standard C. */
51 #define  DOSISH         1               /* Take advantage of DOSish code in Perl5. */
52
53 #define  OP_BINARY      _O_BINARY       /* Mistake in in pp_sys.c. */
54
55 #undef   pipe
56 #define  pipe(fd)       win32_pipe((fd), 512, _O_BINARY) /* the pipe call is a bit different */
57
58 #undef   pause
59 #define  pause()        sleep((32767L << 16) + 32767)
60
61
62 #undef   times
63 #define  times  mytimes
64
65 #undef   alarm
66 #define  alarm  myalarm
67
68 struct tms {
69         long    tms_utime;
70         long    tms_stime;
71         long    tms_cutime;
72         long    tms_cstime;
73 };
74         
75 unsigned int sleep(unsigned int);
76 char *win32PerlLibPath();
77 int mytimes(struct tms *timebuf);
78 unsigned int myalarm(unsigned int sec);
79 int do_aspawn(void* really, void** mark, void** arglast);
80 int do_spawn(char *cmd);
81
82 typedef  char *         caddr_t;        /* In malloc.c (core address). */
83
84 /*
85  * Extension Library, only good for VC
86  */
87
88 #define DllExport       __declspec(dllexport)
89
90 /*
91  * handle socket stuff, assuming socket is always available
92  */
93
94 #include <sys/socket.h>
95 #include <netdb.h>
96
97 #pragma  warning(disable: 4018 4035 4101 4102 4244 4245 4761)
98
99 int IsWin95(void);
100 int IsWinNT(void);
101
102 #ifndef VER_PLATFORM_WIN32_WINDOWS      /* VC-2.0 headers dont have this */
103 #define VER_PLATFORM_WIN32_WINDOWS      1
104 #endif
105
106 #endif /* _INC_WIN32_PERL5 */