This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Really delete deleted files.
[perl5.git] / win32 / win32.h
CommitLineData
68dc0745
PP
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
PP
9#ifndef _INC_WIN32_PERL5
10#define _INC_WIN32_PERL5
11
12#define WIN32_LEAN_AND_MEAN
13#include <windows.h>
14
68dc0745
PP
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
PP
19
20#include <dirent.h>
21#include <io.h>
22#include <process.h>
23#include <stdio.h>
24#include <direct.h>
390b85e7
GS
25#include <stdlib.h>
26#ifndef EXT
27#include "EXTERN.h"
28#endif
29
30#ifndef START_EXTERN_C
31#ifdef __cplusplus
32# define START_EXTERN_C extern "C" {
33# define END_EXTERN_C }
34# define EXTERN_C extern "C"
35#else
36# define START_EXTERN_C
37# define END_EXTERN_C
38# define EXTERN_C
39#endif
40#endif
41
42#define STANDARD_C 1
43#define DOSISH 1 /* no escaping our roots */
44#define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */
45#define USE_SOCKETS_AS_HANDLES /* we wanna pretend sockets are FDs */
46/*#define USE_WIN32_RTL_ENV */ /* see note below */
0a753a76 47
68dc0745 48/* For UNIX compatibility. */
0a753a76 49
3e3baf6d
TB
50#ifdef __BORLANDC__
51
52#define _access access
53#define _chdir chdir
54#include <sys/types.h>
55
84902520
TB
56#ifndef DllMain
57#define DllMain DllEntryPoint
58#endif
59
3e3baf6d
TB
60#pragma warn -ccc
61#pragma warn -rch
62#pragma warn -sig
63#pragma warn -pia
64#pragma warn -par
65#pragma warn -aus
66#pragma warn -use
67#pragma warn -csu
68#pragma warn -pro
69
70#else
71
0a753a76
PP
72typedef long uid_t;
73typedef long gid_t;
74
3e3baf6d 75#endif
0a753a76 76
390b85e7 77START_EXTERN_C
0a753a76
PP
78extern uid_t getuid(void);
79extern gid_t getgid(void);
80extern uid_t geteuid(void);
81extern gid_t getegid(void);
0a753a76
PP
82extern int setuid(uid_t uid);
83extern int setgid(gid_t gid);
84extern int kill(int pid, int sig);
390b85e7 85END_EXTERN_C
d55594ae 86
3e3baf6d
TB
87extern char *staticlinkmodules[];
88
390b85e7
GS
89START_EXTERN_C
90
3e3baf6d
TB
91/* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
92 * to read the environment, bypassing the runtime's (usually broken)
93 * facilities for accessing the same. See note in util.c/my_setenv().
94 */
0551aaa8
GS
95
96#ifndef USE_WIN32_RTL_ENV
390b85e7 97EXT char *win32_getenv(const char *name);
0551aaa8
GS
98#undef getenv
99#define getenv win32_getenv
d55594ae
GS
100#endif
101
84902520
TB
102EXT void Perl_win32_init(int *argcp, char ***argvp);
103
0a753a76 104#ifndef USE_SOCKETS_AS_HANDLES
390b85e7 105extern FILE *my_fdopen(int, char *);
0a753a76 106#undef fdopen
390b85e7 107#define fdopen my_fdopen
68dc0745 108#endif /* USE_SOCKETS_AS_HANDLES */
0a753a76 109
390b85e7
GS
110#undef fclose
111#define fclose my_fclose
0a753a76 112
390b85e7
GS
113#undef pipe /* win32_pipe() itself calls _pipe() */
114#define pipe(fd) win32_pipe((fd), 512, O_BINARY)
0a753a76
PP
115
116#undef pause
117#define pause() sleep((32767L << 16) + 32767)
118
0a753a76 119#undef times
390b85e7 120#define times my_times
0a753a76
PP
121
122#undef alarm
390b85e7 123#define alarm my_alarm
0a753a76
PP
124
125struct tms {
126 long tms_utime;
127 long tms_stime;
128 long tms_cutime;
129 long tms_cstime;
68dc0745 130};
c90c0ff4 131
390b85e7
GS
132extern unsigned int sleep(unsigned int);
133extern char *win32PerlLibPath(void);
134extern char *win32SiteLibPath(void);
135extern int my_times(struct tms *timebuf);
136extern unsigned int my_alarm(unsigned int sec);
137extern int my_flock(int fd, int oper);
138extern int do_aspawn(void* really, void ** mark, void ** arglast);
139extern int do_spawn(char *cmd);
140extern char do_exec(char *cmd);
141extern void init_os_extras(void);
142extern int my_fclose(FILE *);
143extern int IsWin95(void);
144extern int IsWinNT(void);
145
146END_EXTERN_C
d55594ae 147
68dc0745 148typedef char * caddr_t; /* In malloc.c (core address). */
0a753a76 149
68dc0745
PP
150/*
151 * Extension Library, only good for VC
152 */
0a753a76
PP
153
154#define DllExport __declspec(dllexport)
3e3baf6d 155#define DllImport __declspec(dllimport)
0a753a76 156
68dc0745
PP
157/*
158 * handle socket stuff, assuming socket is always available
159 */
0a753a76
PP
160
161#include <sys/socket.h>
162#include <netdb.h>
163
3e3baf6d 164#ifdef _MSC_VER
0a753a76 165#pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
3e3baf6d 166#endif
0a753a76 167
3fe9a6f1
PP
168#ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
169#define VER_PLATFORM_WIN32_WINDOWS 1
170#endif
171
68dc0745 172#endif /* _INC_WIN32_PERL5 */