sunos4.h 5.2 KB

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