home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume30 / rc / part06 / proto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-30  |  2.5 KB  |  82 lines

  1. /* proto.h
  2.     This file provides a definition for size_t and align_t that
  3.     should work for your system. If it does not, it is up to you to
  4.     make it the right thing. The problem is that I cannot rely upon
  5.     <sys/params.h> to do the right thing on machines which don't
  6.     yet have ansi header files. Note that on many RISC machines,
  7.     align_t must be at least 32 bits wide, and sparc doubles are
  8.     aligned on 64 bit boundaries, but of course rc does not use
  9.     doubles in its code, so the "typedef long ALIGN_T" is good
  10.     enough in the sparc's case. Also for performance reasons on a
  11.     VAX one would probably want align_t to be 32 bits wide.
  12.  
  13.     You can override these definitions with compile-line definitions
  14.     of the same macros.
  15. */
  16.  
  17. #ifndef ALIGN_T
  18. typedef long ALIGN_T;
  19. #endif
  20. #ifndef SIZE_T
  21. typedef unsigned int SIZE_T;
  22. #endif
  23. #ifndef MODE_T
  24. typedef short int MODE_T;
  25. #endif
  26. #ifndef PID_T
  27. typedef int PID_T;
  28. #endif
  29. #ifndef SIG_ATOMIC_T
  30. typedef int SIG_ATOMIC_T;
  31. #endif
  32.  
  33. /* fake stdlib.h */
  34.  
  35. extern void exit(int);
  36. extern void qsort(void *, SIZE_T, SIZE_T, int (*)(const void *, const void *));
  37.  
  38. /* fake string.h */
  39.  
  40. extern int strncmp(const char *, const char *, SIZE_T);
  41. extern int strcmp(const char *, const char *);
  42. extern SIZE_T strlen(const char *);
  43. extern char *strchr(const char *, int);
  44. extern char *strrchr(const char *, int);
  45. extern char *strcpy(char *, const char *);
  46. extern char *strncpy(char *, const char *, SIZE_T);
  47. extern char *strcat(char *, const char *);
  48. extern char *strncat(char *, const char *, SIZE_T);
  49. extern void *memcpy(void *, const void *, SIZE_T);
  50.  
  51. /* fake unistd.h */
  52.  
  53. extern PID_T fork(void);
  54. extern PID_T getpid(void);
  55. extern char *getenv(const char *);
  56. extern int chdir(const char *);
  57. extern int close(int);
  58. extern int dup(int);
  59. extern int dup2(int, int);
  60. extern int execve(const char *, const char **, const char **);
  61. extern int execl(const char *,...);
  62. extern int getegid(void);
  63. extern int geteuid(void);
  64. extern int getgroups(int, int *);
  65. /*extern int ioctl(int, long,...);*/ /* too much trouble leaving this uncommented */
  66. extern int isatty(int);
  67. #ifndef SYSVR4 /* declares AND defines this in sys/stat.h!! */
  68. extern int mknod(const char *, int, int);
  69. #endif
  70. extern int pipe(int *);
  71. extern int read(int, void *, unsigned int);
  72. extern int setpgrp(int, PID_T);
  73. extern int unlink(const char *);
  74. extern int wait(int *);
  75. extern int write(int, const void *, unsigned int);
  76.  
  77. /* fake errno.h for mips (which doesn't declare errno in errno.h!?!?) */
  78.  
  79. #ifdef host_mips
  80. extern int errno;
  81. #endif
  82.