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