|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #ifndef pr_sunos4_h___ |
|
6 #define pr_sunos4_h___ |
|
7 |
|
8 #ifndef SVR4 |
|
9 |
|
10 /* |
|
11 ** Hodge podge of random missing prototypes for the Sunos4 system |
|
12 */ |
|
13 #include <stdio.h> |
|
14 #include <stdarg.h> |
|
15 #include <time.h> |
|
16 #include <limits.h> |
|
17 #include <sys/types.h> |
|
18 |
|
19 #define PATH_MAX _POSIX_PATH_MAX |
|
20 |
|
21 struct timeval; |
|
22 struct timezone; |
|
23 struct itimerval; |
|
24 struct sockaddr; |
|
25 struct stat; |
|
26 struct tm; |
|
27 |
|
28 /* ctype.h */ |
|
29 extern int tolower(int); |
|
30 extern int toupper(int); |
|
31 |
|
32 /* errno.h */ |
|
33 extern char *sys_errlist[]; |
|
34 extern int sys_nerr; |
|
35 |
|
36 #define strerror(e) sys_errlist[((unsigned)(e) < sys_nerr) ? e : 0] |
|
37 |
|
38 extern void perror(const char *); |
|
39 |
|
40 /* getopt */ |
|
41 extern char *optarg; |
|
42 extern int optind; |
|
43 extern int getopt(int argc, char **argv, char *spec); |
|
44 |
|
45 /* math.h */ |
|
46 extern int srandom(long val); |
|
47 extern long random(void); |
|
48 |
|
49 /* memory.h */ |
|
50 #define memmove(to,from,len) bcopy((char*)(from),(char*)(to),len) |
|
51 |
|
52 extern void bcopy(const char *, char *, int); |
|
53 |
|
54 /* signal.h */ |
|
55 /* |
|
56 ** SunOS4 sigaction hides interrupts by default, so we can safely define |
|
57 ** SA_RESTART to 0 (HP-UX is a counter-example -- its sigaction does not |
|
58 ** hide interrupts but lacks an SA_RESTART option; you must use sigvector |
|
59 ** and tweak the sigcontext from within each signal handler!). |
|
60 */ |
|
61 #define SA_RESTART 0 |
|
62 #define SA_SIGINFO 0 |
|
63 |
|
64 /* stdio.h */ |
|
65 extern int printf(const char *, ...); |
|
66 extern int fprintf(FILE *, const char *, ...); |
|
67 extern int vprintf(const char *, va_list); |
|
68 extern int vfprintf(FILE *, const char *, va_list); |
|
69 extern char *vsprintf(char *, const char *, va_list); |
|
70 extern int scanf(const char *, ...); |
|
71 extern int sscanf(const char *, const char *, ...); |
|
72 extern int fscanf(FILE *, const char *, ...); |
|
73 extern int fgetc(FILE *); |
|
74 extern int fputc(int, FILE *); |
|
75 extern int fputs(const char *, FILE *); |
|
76 extern int puts(const char *); |
|
77 extern int fread(void *, size_t, size_t, FILE *); |
|
78 extern int fwrite(const char *, int, int, FILE *); |
|
79 extern int fseek(FILE *, long, int); |
|
80 extern long ftell(FILE *); |
|
81 extern int rewind(FILE *); |
|
82 extern int fflush(FILE *); |
|
83 extern int _flsbuf(unsigned char, FILE *); |
|
84 extern int fclose(FILE *); |
|
85 extern int remove(const char *); |
|
86 extern int setvbuf(FILE *, char *, int, size_t); |
|
87 extern int system(const char *); |
|
88 extern FILE *popen(const char *, const char *); |
|
89 extern int pclose(FILE *); |
|
90 |
|
91 /* stdlib.h */ |
|
92 #define strtoul strtol |
|
93 |
|
94 extern int isatty(int fildes); |
|
95 extern long strtol(const char *, char **, int); |
|
96 extern int putenv(const char *); |
|
97 extern void srand48(long); |
|
98 extern long lrand48(void); |
|
99 extern double drand48(void); |
|
100 |
|
101 /* string.h */ |
|
102 extern int strcasecmp(const char *, const char *); |
|
103 extern int strncasecmp(const char *, const char *, size_t); |
|
104 extern int strcoll(const char *, const char *); |
|
105 |
|
106 /* time.h */ |
|
107 extern time_t mktime(struct tm *); |
|
108 extern size_t strftime(char *, size_t, const char *, const struct tm *); |
|
109 extern int gettimeofday(struct timeval *, struct timezone *); |
|
110 extern int setitimer(int, struct itimerval *, struct itimerval *); |
|
111 extern time_t time(time_t *); |
|
112 extern time_t timegm(struct tm *); |
|
113 extern struct tm *localtime(const time_t *); |
|
114 extern struct tm *gmtime(const time_t *); |
|
115 |
|
116 /* unistd.h */ |
|
117 extern int rename(const char *, const char *); |
|
118 extern int ioctl(int, int, int *arg); |
|
119 extern int connect(int, struct sockaddr *, int); |
|
120 extern int readlink(const char *, char *, int); |
|
121 extern int symlink(const char *, const char *); |
|
122 extern int ftruncate(int, off_t); |
|
123 extern int fchmod(int, mode_t); |
|
124 extern int fchown(int, uid_t, gid_t); |
|
125 extern int lstat(const char *, struct stat *); |
|
126 extern int fstat(int, struct stat *); |
|
127 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); |
|
128 extern int gethostname(char *, int); |
|
129 extern char *getwd(char *); |
|
130 extern int getpagesize(void); |
|
131 |
|
132 #endif /* SVR4 */ |
|
133 |
|
134 #endif /* pr_sunos4_h___ */ |