This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Finish fixing here-docs in re-evals
[perl5.git] / mpeix / mpeixish.h
1 /*
2  * The following symbols are defined if your operating system supports
3  * functions by that name.  All Unixes I know of support them, thus they
4  * are not checked by the configuration script, but are directly defined
5  * here.
6  */
7
8 /* HAS_IOCTL:
9  *      This symbol, if defined, indicates that the ioctl() routine is
10  *      available to set I/O characteristics
11  */
12 #define HAS_IOCTL               /**/
13  
14 /* HAS_UTIME:
15  *      This symbol, if defined, indicates that the routine utime() is
16  *      available to update the access and modification times of files.
17  */
18 #define HAS_UTIME               /**/
19
20 /* HAS_GROUP
21  *      This symbol, if defined, indicates that the getgrnam() and
22  *      getgrgid() routines are available to get group entries.
23  */
24 #define HAS_GROUP               /**/
25
26 /* HAS_PASSWD
27  *      This symbol, if defined, indicates that the getpwnam() and
28  *      getpwuid() routines are available to get password entries.
29  */
30 #define HAS_PASSWD              /**/
31
32 #define HAS_KILL
33 #define HAS_WAIT
34   
35 /* USEMYBINMODE
36  *      This symbol, if defined, indicates that the program should
37  *      use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
38  *      that a file is in "binary" mode -- that is, that no translation
39  *      of bytes occurs on read or write operations.
40  */
41 #undef USEMYBINMODE
42
43 /* Stat_t:
44  *      This symbol holds the type used to declare buffers for information
45  *      returned by stat().  It's usually just struct stat.  It may be necessary
46  *      to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
47  *      information.
48  */
49 #define Stat_t struct stat
50
51 /* USE_STAT_RDEV:
52  *      This symbol is defined if this system has a stat structure declaring
53  *      st_rdev
54  */
55 #define USE_STAT_RDEV   /**/
56
57 /* ACME_MESS:
58  *      This symbol, if defined, indicates that error messages should be 
59  *      should be generated in a format that allows the use of the Acme
60  *      GUI/editor's autofind feature.
61  */
62 #undef ACME_MESS        /**/
63
64 /* UNLINK_ALL_VERSIONS:
65  *      This symbol, if defined, indicates that the program should arrange
66  *      to remove all versions of a file if unlink() is called.  This is
67  *      probably only relevant for VMS.
68  */
69 /* #define UNLINK_ALL_VERSIONS          / **/
70
71 /* VMS:
72  *      This symbol, if defined, indicates that the program is running under
73  *      VMS.  It is currently automatically set by cpps running under VMS,
74  *      and is included here for completeness only.
75  */
76 /* #define VMS          / **/
77
78 /* ALTERNATE_SHEBANG:
79  *      This symbol, if defined, contains a "magic" string which may be used
80  *      as the first line of a Perl program designed to be executed directly
81  *      by name, instead of the standard Unix #!.  If ALTERNATE_SHEBANG
82  *      begins with a character other then #, then Perl will only treat
83  *      it as a command line if if finds the string "perl" in the first
84  *      word; otherwise it's treated as the first line of code in the script.
85  *      (IOW, Perl won't hand off to another interpreter via an alternate
86  *      shebang sequence that might be legal Perl code.)
87  */
88 /* #define ALTERNATE_SHEBANG "#!" / **/
89
90 #include <signal.h>
91
92 #ifndef SIGABRT
93 #    define SIGABRT SIGILL
94 #endif
95 #ifndef SIGILL
96 #    define SIGILL 6         /* blech */
97 #endif
98 #define ABORT() kill(PerlProc_getpid(),SIGABRT);
99
100 /*
101  * fwrite1() should be a routine with the same calling sequence as fwrite(),
102  * but which outputs all of the bytes requested as a single stream (unlike
103  * fwrite() itself, which on some systems outputs several distinct records
104  * if the number_of_items parameter is >1).
105  */
106 #define fwrite1 fwrite
107
108 #define Stat(fname,bufptr) stat((fname),(bufptr))
109 #define Fstat(fd,bufptr)   fstat((fd),(bufptr))
110 #define Fflush(fp)         fflush(fp)
111 #define Mkdir(path,mode)   mkdir((path),(mode))
112
113 #ifndef PERL_SYS_INIT_BODY
114 #  define PERL_SYS_INIT_BODY(c,v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
115 #endif
116
117 #ifndef PERL_SYS_TERM_BODY
118 #define PERL_SYS_TERM_BODY()            PERLIO_TERM; MALLOC_TERM
119 #endif
120
121 #define BIT_BUCKET "/dev/null"
122
123 #define dXSUB_SYS
124
125 /* pw_passwd, pw_gecos, pw_age, pw_comment exist in the struct passwd
126  * but they contain uninitialized (as in "accessing them will crash perl")
127  * pointers.  Stay away from them. */
128
129 #undef PWGECOS
130 #undef PRPASSWD
131 #undef PWAGE
132 #undef PWCOMMENT
133
134 /* various missing external function declarations */
135
136 #include <sys/ipc.h>
137 extern key_t ftok (char *pathname, char id);
138 extern char *gcvt (double value, int ndigit, char *buf);
139 extern int isnan (double value);
140 extern void srand48(long int seedval);
141 extern double drand48(void);
142 extern double erand48(unsigned short xsubi[3]);
143 extern long jrand48(unsigned short xsubi[3]);
144 extern void lcong48(unsigned short param[7]);
145 extern long lrand48(void);
146 extern long mrand48(void);
147 extern long nrand48(unsigned short xsubi[3]);
148 extern unsigned short *seed48(unsigned short seed16v[3]);
149
150 /* various missing constants -- define 'em */
151
152 #define PF_UNSPEC 0
153
154 /* declarations for wrappers in mpeix.c */
155
156 #include <time.h>
157 #include <sys/wait.h>
158 #include <sys/socket.h>
159 #include <netinet/in.h>
160
161
162 extern int ftruncate(int fd, long wantsize);
163 extern int gettimeofday( struct timeval *tp, struct timezone *tpz );
164 extern int truncate(const char *pathname, off_t length);
165
166 extern int mpe_read(int filedes, void *buffer, size_t len);
167 extern int mpe_write(int filedes, const void *buffer, size_t len);
168 extern int mpe_send(int socket, const void *buffer, size_t len, int flags);
169 extern int mpe_sendto(int socket, const void *buffer, size_t len,
170        int flags, const struct sockaddr *dest_addr,
171        size_t dest_len);
172 extern int mpe_recv(int socket, void *buffer, size_t length, int flags);
173 extern int mpe_recvfrom(int socket, void *buffer, size_t length,
174            int flags, struct sockaddr *address,
175            size_t *address_len) ;
176 extern int mpe_bind(int socket, const struct sockaddr *address,
177    size_t address_len);
178 extern int mpe_getsockname(int socket, struct sockaddr *address,
179   size_t *address_len);
180 extern int mpe_getpeername(int socket, struct sockaddr *address, 
181   size_t *address_len);
182
183 /* Replacements to fix various socket problems -- see mpeix.c */
184 #define fcntl mpe_fcntl
185 #define read mpe_read
186 #define write mpe_write
187 #define send mpe_send
188 #define sendto mpe_sendto
189 #define recv mpe_recv
190 #define recvfrom mpe_recvfrom
191 #define bind mpe_bind
192 #define getsockname mpe_getsockname
193 #define getpeername mpe_getpeername