/contrib/tcsh/sh.types.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 397 lines · 220 code · 51 blank · 126 comment · 9 complexity · bcb8f56537ff15cdb96a2cec16a502e1 MD5 · raw file

  1. /* $Header: /p/tcsh/cvsroot/tcsh/sh.types.h,v 3.43 2006/01/12 19:55:38 christos Exp $ */
  2. /* sh.types.h: Do the necessary typedefs for each system.
  3. * Up till now I avoided making this into a separate file
  4. * But I just wanted to eliminate the whole mess from sh.h
  5. * In reality this should not be here! It is OS and MACHINE
  6. * dependent, even between different revisions of OS's...
  7. * Ideally there should be a way in c, to find out if something
  8. * was typedef'ed, but unfortunately we rely in cpp kludges.
  9. * Someday, this file will be removed...
  10. *
  11. * christos
  12. */
  13. /*-
  14. * Copyright (c) 1980, 1991 The Regents of the University of California.
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without
  18. * modification, are permitted provided that the following conditions
  19. * are met:
  20. * 1. Redistributions of source code must retain the above copyright
  21. * notice, this list of conditions and the following disclaimer.
  22. * 2. Redistributions in binary form must reproduce the above copyright
  23. * notice, this list of conditions and the following disclaimer in the
  24. * documentation and/or other materials provided with the distribution.
  25. * 3. Neither the name of the University nor the names of its contributors
  26. * may be used to endorse or promote products derived from this software
  27. * without specific prior written permission.
  28. *
  29. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  30. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  33. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  34. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  35. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  36. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  37. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  38. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  39. * SUCH DAMAGE.
  40. */
  41. #ifndef _h_sh_types
  42. #define _h_sh_types
  43. /***
  44. *** LynxOS 2.1
  45. ***/
  46. #ifdef Lynx
  47. # ifndef _PID_T
  48. # define _PID_T
  49. # endif /* _PID_T */
  50. #endif
  51. /***
  52. *** MachTen
  53. ***/
  54. #ifdef __MACHTEN__
  55. # ifndef _PID_T
  56. # define _PID_T
  57. # endif
  58. #endif
  59. /***
  60. *** Suns running sunos3.x - sunos4.1.x
  61. ***/
  62. #if (defined(sun) || defined(__sun__)) && SYSVREL == 0
  63. # ifndef _PTR_T
  64. # define _PTR_T
  65. # ifdef __GNUC__
  66. typedef void * ptr_t;
  67. # else
  68. typedef char * ptr_t;
  69. # endif /* __GNUC__ */
  70. # endif /* _PTR_T */
  71. # ifndef __sys_stdtypes_h
  72. # define __sys_stdtypes_h
  73. # ifndef __lucid
  74. typedef int pid_t;
  75. typedef unsigned int speed_t;
  76. # endif
  77. # endif /* __sys_stdtypes.h */
  78. # ifndef _PID_T
  79. # define _PID_T
  80. # endif /* _PID_T */
  81. # ifndef _SPEED_T
  82. # define _SPEED_T
  83. # endif /* _SPEED_T */
  84. #endif /* (sun || __sun__) && SYSVREL == 0 */
  85. /***
  86. *** Hp's running hpux 7.0 or 8.0
  87. ***/
  88. #ifdef __hpux
  89. # ifndef _PTR_T
  90. # define _PTR_T
  91. typedef void * ptr_t;
  92. # endif /* _PTR_T */
  93. # ifndef _PID_T
  94. # define _PID_T
  95. typedef long pid_t;
  96. # endif /* _PID_T */
  97. # ifndef _SPEED_T
  98. /* I thought POSIX was supposed to protect all typedefs! */
  99. # define _SPEED_T
  100. # endif /* _SPEED_T */
  101. # if HPUXVERSION < 1100 /* XXX: Not true for 11.0 */
  102. extern uid_t getuid(), geteuid();
  103. extern gid_t getgid(), getegid();
  104. extern pid_t getpid();
  105. extern pid_t fork();
  106. extern void perror();
  107. extern void _exit();
  108. extern void abort();
  109. extern void qsort();
  110. extern void free();
  111. extern unsigned int alarm();
  112. extern unsigned int sleep();
  113. # endif /* HPUXVERSION < 1100 */
  114. # if HPUXVERSION < 800 /* XXX: Not true for 8.0 */
  115. extern char *sbrk();
  116. # endif /* HPUXVERSION < 800 */
  117. #endif /* __hpux */
  118. #if (defined(_MINIX) && !defined(_MINIX_VMD)) || defined(__EMX__)
  119. typedef char * caddr_t;
  120. #endif /* (_MINIX && !_MINIX_VMD) || __EMX__ */
  121. /***
  122. *** hp9000s500 running hpux-5.2
  123. ***/
  124. #ifdef hp9000s500
  125. # ifndef _PTR_T
  126. # define _PTR_T
  127. typedef char * ptr_t;
  128. # endif /* _PTR_T */
  129. #endif /* hp9000s500 */
  130. /***
  131. *** Data General AViiON 88000 or Pentium, running dgux 5.4R3 or R4.11
  132. ***/
  133. #ifdef DGUX
  134. # ifndef _PID_T
  135. # define _PID_T
  136. # endif /* _PID_T */
  137. #endif /* DGUX */
  138. /***
  139. *** BSD RENO advertises itself as POSIX, but
  140. *** it is missing speed_t
  141. ***/
  142. #ifdef RENO
  143. # ifndef _SPEED_T
  144. # define _SPEED_T
  145. typedef unsigned int speed_t;
  146. # endif /* _SPEED_T */
  147. #endif /* RENO */
  148. /***
  149. *** NeXT OS 3.x
  150. ***/
  151. #ifdef NeXT
  152. # ifndef _SPEED_T
  153. # define _SPEED_T
  154. typedef unsigned int speed_t;
  155. # endif /* _SPEED_T */
  156. #endif /* NeXT */
  157. /***
  158. *** Utah's HPBSD
  159. *** some posix & 4.4 BSD changes (pid_t is a short)
  160. ***/
  161. #ifdef HPBSD
  162. # ifndef _PID_T
  163. # define _PID_T
  164. # endif /* _PID_T */
  165. #endif /* HPBSD */
  166. /***
  167. *** Pyramid, BSD universe
  168. *** In addition to the size_t
  169. ***/
  170. #ifdef pyr
  171. # ifndef _PID_T
  172. # define _PID_T
  173. typedef short pid_t;
  174. # endif /* _PID_T */
  175. #endif /* pyr */
  176. /***
  177. *** rs6000, ibm370, ps2, rt: running flavors of aix.
  178. ***/
  179. #ifdef IBMAIX
  180. # ifndef aiws
  181. # ifndef _PID_T
  182. # define _PID_T
  183. # endif /* _PID_T */
  184. # endif /* !aiws */
  185. # ifdef _IBMR2
  186. # ifndef _SPEED_T
  187. # define _SPEED_T
  188. # endif /* _SPEED_T */
  189. # endif /* _IBMR2 */
  190. #endif /* IBMAIX */
  191. /***
  192. *** Ultrix...
  193. ***/
  194. #if defined(ultrix) || defined(__ultrix)
  195. # ifndef _PID_T
  196. # define _PID_T
  197. # endif /* _PID_T */
  198. # ifndef _PTR_T
  199. # define _PTR_T
  200. typedef void * ptr_t;
  201. # endif /* _PTR_T */
  202. #endif /* ultrix || __ultrix */
  203. /***
  204. *** Silicon graphics IRIS4D running IRIX3_3
  205. ***/
  206. #if defined(IRIS4D) && defined(IRIX3_3)
  207. # ifndef _PID_T
  208. # define _PID_T
  209. # endif /* _PID_T */
  210. #endif /* IRIS4D && IRIX3_3 */
  211. /***
  212. *** Apple AUX.
  213. ***/
  214. #ifdef OREO
  215. # ifndef _PID_T
  216. # define _PID_T
  217. # endif /* _PID_T */
  218. #endif /* OREO */
  219. /***
  220. *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0.
  221. **** [RTU 6.0 from mike connor]
  222. *** Added, DAS DEC-90.
  223. ***/
  224. #ifdef masscomp
  225. # ifdef RTU6
  226. # ifndef _PID_T
  227. # define _PID_T
  228. # endif /* _PID_T */
  229. # ifndef _SPEED_T
  230. # define _SPEED_T
  231. # endif /* _SPEED_T */
  232. #endif /* RTU6 */
  233. #endif /* masscomp */
  234. /*
  235. * Motorola MPC running R32V2 (sysV88)
  236. */
  237. #ifdef sysV88
  238. # ifndef _PID_T
  239. # define _PID_T
  240. # endif /* _PID_T */
  241. #endif /* sysV88 */
  242. /*
  243. * Amdahl running UTS (Sys V3)
  244. */
  245. #ifdef uts
  246. # ifndef _PID_T
  247. # define _PID_T
  248. # endif /* _PID_T */
  249. #endif /* uts */
  250. /*
  251. * Tektronix XD88/10 running UTekV (Sys V3)
  252. */
  253. #ifdef UTekV
  254. # ifndef _PID_T
  255. # define _PID_T
  256. # endif /* _PID_T */
  257. #endif /* UTekV*/
  258. /*
  259. * BBN Butterfly gp1000
  260. */
  261. #ifdef butterfly
  262. # ifndef _PID_T
  263. # define _PID_T
  264. # endif /* _PID_T */
  265. #endif /* butterfly */
  266. /*
  267. * Alliant FX-2800/FX-80
  268. */
  269. #ifdef alliant
  270. # ifndef _PID_T
  271. # define _PID_T
  272. # endif /* _PID_T */
  273. # ifdef mc68000
  274. typedef int pid_t; /* FX-80 */
  275. # else
  276. typedef short pid_t; /* FX-2800 */
  277. # endif
  278. #endif /* alliant */
  279. /*
  280. * DNIX
  281. */
  282. #ifdef DNIX
  283. # ifndef _PID_T
  284. # define _PID_T
  285. # endif /* _PID_T */
  286. #endif /* DNIX */
  287. /*
  288. * Apollo running Domain/OS SR10.3 or greater
  289. */
  290. #ifdef apollo
  291. # ifndef _PID_T
  292. # define _PID_T
  293. typedef int pid_t; /* Older versions might not like that */
  294. # endif /* _PID_T */
  295. #endif /* apollo */
  296. /***
  297. *** a pdp/11, running 2BSD
  298. ***/
  299. #ifdef pdp11
  300. # ifndef _PID_T
  301. # define _PID_T
  302. # endif /* _PID_T */
  303. #endif /* pdp11 */
  304. /***
  305. *** a Harris, running CX/UX
  306. ***/
  307. #ifdef _CX_UX
  308. # ifndef _PID_T
  309. # define _PID_T
  310. # endif /* _PID_T */
  311. #endif /* _CX_UX */
  312. /***
  313. *** Catch all for non POSIX and/or non ANSI systems.
  314. *** Systems up to spec *should* define these automatically
  315. *** I am open to suggestions on how to do this correctly!
  316. ***/
  317. #ifndef POSIX
  318. # ifndef _PID_T
  319. # define _PID_T
  320. typedef int pid_t;
  321. # endif /* _PID_T */
  322. # ifndef _SPEED_T
  323. # define _SPEED_T
  324. typedef unsigned int speed_t;
  325. # endif /* _SPEED_T */
  326. # ifndef _PTR_T
  327. # define _PTR_T
  328. typedef char * ptr_t;
  329. #endif /* _PTR_T */
  330. # ifndef _IOCTL_T
  331. # define _IOCTL_T
  332. typedef char * ioctl_t; /* Third arg of ioctl */
  333. # endif /* _IOCTL_T */
  334. #endif /* ! POSIX */
  335. /***
  336. *** This is our own junk types.
  337. ***/
  338. #ifndef _PTR_T
  339. # define _PTR_T
  340. typedef void * ptr_t;
  341. #endif /* _PTR_T */
  342. #ifndef _IOCTL_T
  343. # define _IOCTL_T
  344. typedef void * ioctl_t; /* Third arg of ioctl */
  345. #endif /* _IOCTL_T */
  346. #endif /* _h_sh_types */