Re: embedded perl and top_env problem
[p5sagit/p5-mst-13.2.git] / win32 / win32.h
CommitLineData
68dc0745 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 */
0a753a76 9#ifndef _INC_WIN32_PERL5
10#define _INC_WIN32_PERL5
11
12#define WIN32_LEAN_AND_MEAN
13#include <windows.h>
14
68dc0745 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 */
0a753a76 19
20#include <dirent.h>
21#include <io.h>
22#include <process.h>
23#include <stdio.h>
24#include <direct.h>
25
68dc0745 26/* For UNIX compatibility. */
0a753a76 27
28typedef long uid_t;
29typedef long gid_t;
30
31extern char *staticlinkmodules[];
32
33extern uid_t getuid(void);
34extern gid_t getgid(void);
35extern uid_t geteuid(void);
36extern gid_t getegid(void);
37
38extern int setuid(uid_t uid);
39extern int setgid(gid_t gid);
40extern int kill(int pid, int sig);
41
42#define USE_SOCKETS_AS_HANDLES
43#ifndef USE_SOCKETS_AS_HANDLES
44extern FILE *myfdopen(int, char *);
45
46#undef fdopen
47#define fdopen myfdopen
68dc0745 48#endif /* USE_SOCKETS_AS_HANDLES */
0a753a76 49
68dc0745 50#define STANDARD_C 1 /* Perl5 likes standard C. */
51#define DOSISH 1 /* Take advantage of DOSish code in Perl5. */
0a753a76 52
68dc0745 53#define OP_BINARY _O_BINARY /* Mistake in in pp_sys.c. */
0a753a76 54
55#undef mkdir
68dc0745 56#define mkdir(nm, md) _mkdir(nm) /* For UNIX compatibility. */
0a753a76 57
58#undef chdir
59#define chdir(nm) _chdir(nm)
60
61#undef rmdir
62#define rmdir(nm) _rmdir(nm)
63
64#undef pipe
68dc0745 65#define pipe(fd) win32_pipe((fd), 512, _O_BINARY) /* the pipe call is a bit different */
0a753a76 66
67#undef pause
68#define pause() sleep((32767L << 16) + 32767)
69
70
71#undef times
72#define times mytimes
73
74#undef alarm
75#define alarm myalarm
76
77struct tms {
78 long tms_utime;
79 long tms_stime;
80 long tms_cutime;
81 long tms_cstime;
68dc0745 82};
0a753a76 83
84unsigned int sleep(unsigned int);
85char *win32PerlLibPath();
86int mytimes(struct tms *timebuf);
87unsigned int myalarm(unsigned int sec);
88int do_aspawn(void* really, void** mark, void** arglast);
89int do_spawn(char *cmd);
90
68dc0745 91typedef char * caddr_t; /* In malloc.c (core address). */
0a753a76 92
68dc0745 93/*
94 * Extension Library, only good for VC
95 */
0a753a76 96
97#define DllExport __declspec(dllexport)
98
68dc0745 99/*
100 * handle socket stuff, assuming socket is always available
101 */
0a753a76 102
103#include <sys/socket.h>
104#include <netdb.h>
105
106#pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
107
3fe9a6f1 108int IsWin95(void);
109int IsWinNT(void);
110
111#ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
112#define VER_PLATFORM_WIN32_WINDOWS 1
113#endif
114
68dc0745 115#endif /* _INC_WIN32_PERL5 */