sunos4.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * The contents of this file are subject to the Mozilla Public
4 * License Version 1.1 (the "License"); you may not use this file
5 * except in compliance with the License. You may obtain a copy of
6 * the License at http://www.mozilla.org/MPL/
7 *
8 * Software distributed under the License is distributed on an "AS
9 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10 * implied. See the License for the specific language governing
11 * rights and limitations under the License.
12 *
13 * The Original Code is the Netscape Portable Runtime (NSPR).
14 *
15 * The Initial Developer of the Original Code is Netscape
16 * Communications Corporation.  Portions created by Netscape are
17 * Copyright (C) 1998-2000 Netscape Communications Corporation.  All
18 * Rights Reserved.
19 *
20 * Contributor(s):
21 *
22 * Alternatively, the contents of this file may be used under the
23 * terms of the GNU General Public License Version 2 or later (the
24 * "GPL"), in which case the provisions of the GPL are applicable
25 * instead of those above.  If you wish to allow use of your
26 * version of this file only under the terms of the GPL and not to
27 * allow others to use your version of this file under the MPL,
28 * indicate your decision by deleting the provisions above and
29 * replace them with the notice and other provisions required by
30 * the GPL.  If you do not delete the provisions above, a recipient
31 * may use your version of this file under either the MPL or the
32 * GPL.
33 */
34
35#ifndef pr_sunos4_h___
36#define pr_sunos4_h___
37
38#ifndef SVR4
39
40/*
41** Hodge podge of random missing prototypes for the Sunos4 system
42*/
43#include <stdio.h>
44#include <stdarg.h>
45#include <time.h>
46#include <limits.h>
47#include <sys/types.h>
48
49#define PATH_MAX _POSIX_PATH_MAX
50
51struct timeval;
52struct timezone;
53struct itimerval;
54struct sockaddr;
55struct stat;
56struct tm;
57
58/* ctype.h */
59extern int tolower(int);
60extern int toupper(int);
61
62/* errno.h */
63extern char *sys_errlist[];
64extern int sys_nerr;
65
66#define strerror(e) sys_errlist[((unsigned)(e) < sys_nerr) ? e : 0]
67
68extern void perror(const char *);
69
70/* getopt */
71extern char *optarg;
72extern int optind;
73extern int getopt(int argc, char **argv, char *spec);
74
75/* math.h */
76extern int srandom(long val);
77extern long random(void);
78
79/* memory.h */
80#define memmove(to,from,len) bcopy((char*)(from),(char*)(to),len)
81
82extern void bcopy(const char *, char *, int);
83
84/* signal.h */
85/*
86** SunOS4 sigaction hides interrupts by default, so we can safely define
87** SA_RESTART to 0.
88*/
89#define SA_RESTART 0
90
91/* stdio.h */
92extern int printf(const char *, ...);
93extern int fprintf(FILE *, const char *, ...);
94extern int vprintf(const char *, va_list);
95extern int vfprintf(FILE *, const char *, va_list);
96extern char *vsprintf(char *, const char *, va_list);
97extern int scanf(const char *, ...);
98extern int sscanf(const char *, const char *, ...);
99extern int fscanf(FILE *, const char *, ...);
100extern int fgetc(FILE *);
101extern int fputc(int, FILE *);
102extern int fputs(const char *, FILE *);
103extern int puts(const char *);
104extern int fread(void *, size_t, size_t, FILE *);
105extern int fwrite(const char *, int, int, FILE *);
106extern int fseek(FILE *, long, int);
107extern long ftell(FILE *);
108extern int rewind(FILE *);
109extern int fflush(FILE *);
110extern int _flsbuf(unsigned char, FILE *);
111extern int fclose(FILE *);
112extern int remove(const char *);
113extern int setvbuf(FILE *, char *, int, size_t);
114extern int system(const char *);
115extern FILE *popen(const char *, const char *);
116extern int pclose(FILE *);
117
118/* stdlib.h */
119#define strtoul strtol
120
121extern int isatty(int fildes);
122extern long strtol(const char *, char **, int);
123extern int putenv(const char *);
124extern void srand48(long);
125extern long lrand48(void);
126extern double drand48(void);
127
128/* string.h */
129extern int strcasecmp(const char *, const char *);
130extern int strncasecmp(const char *, const char *, size_t);
131extern int strcoll(const char *, const char *);
132
133/* time.h */
134extern time_t mktime(struct tm *);
135extern size_t strftime(char *, size_t, const char *, const struct tm *);
136extern int gettimeofday(struct timeval *, struct timezone *);
137extern int setitimer(int, struct itimerval *, struct itimerval *);
138extern time_t time(time_t *);
139extern time_t timegm(struct tm *);
140extern struct tm *localtime(const time_t *);
141extern struct tm *gmtime(const time_t *);
142
143/* unistd.h */
144extern int rename(const char *, const char *);
145extern int ioctl(int, int, int *arg);
146extern int connect(int, struct sockaddr *, int);
147extern int readlink(const char *, char *, int);
148extern int symlink(const char *, const char *);
149extern int ftruncate(int, off_t);
150extern int fchmod(int, mode_t);
151extern int fchown(int, uid_t, gid_t);
152extern int lstat(const char *, struct stat *);
153extern int fstat(int, struct stat *);
154extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
155extern int gethostname(char *, int);
156extern char *getwd(char *);
157extern int getpagesize(void);
158
159#endif /* SVR4 */
160
161#endif /* pr_sunos4_h___ */
162