home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume25 / tcsh-6.01 / part05 / sh.types.h < prev    next >
C/C++ Source or Header  |  1991-12-19  |  10KB  |  454 lines

  1. /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.01/RCS/sh.types.h,v 3.16 1991/12/14 20:45:46 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. All advertising materials mentioning features or use of this software
  26.  *    must display the following acknowledgement:
  27.  *    This product includes software developed by the University of
  28.  *    California, Berkeley and its contributors.
  29.  * 4. Neither the name of the University nor the names of its contributors
  30.  *    may be used to endorse or promote products derived from this software
  31.  *    without specific prior written permission.
  32.  *
  33.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  34.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  35.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  36.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  37.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  38.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  39.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  40.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  41.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  42.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  43.  * SUCH DAMAGE.
  44.  */
  45. #ifndef _h_sh_types
  46. #define _h_sh_types
  47.  
  48.  
  49. /***
  50.  *** Suns running sunos4.1
  51.  ***/
  52. #ifdef sun
  53. /* This used to be long, but lint dissagrees... */
  54. # ifndef _SIGMASK_T
  55. #  define _SIGMASK_T
  56.     typedef int sigmask_t;
  57. # endif /* _SIGMASK_T */
  58. # ifndef _PTR_T
  59. #  define _PTR_T 
  60. #   ifdef __GNUC__
  61.     typedef void * ptr_t;
  62. #   else
  63.     typedef char * ptr_t;
  64. #   endif /* __GNUC__ */
  65. # endif /* _PTR_T */
  66. # ifndef _SIZE_T
  67. #  define _SIZE_T
  68. # endif /* _SIZE_T */
  69. # ifndef __sys_stdtypes_h
  70. #  define __sys_stdtypes_h
  71.     typedef int pid_t;
  72.     typedef unsigned int speed_t;
  73. # endif /* __sys_stdtypes.h */
  74. # ifndef _PID_T
  75. #  define _PID_T
  76. # endif /* _PID_T */
  77. # ifndef _SPEED_T
  78. #  define _SPEED_T
  79. # endif /* _SPEED_T */
  80. # ifndef SUNOS4
  81. #  ifndef _UID_T
  82. #   define _UID_T
  83.      typedef int uid_t;
  84. #  endif /* _UID_T */
  85. #  ifndef _GID_T
  86. #   define _GID_T
  87.      typedef int gid_t;
  88. #  endif /* _GID_T */
  89. # endif /* !SUNOS4 */
  90. #endif /* sun */
  91.  
  92.  
  93. /***
  94.  *** Hp's running hpux 7.0
  95.  ***/
  96. #ifdef __hpux
  97. # ifndef _SIZE_T
  98. #  define _SIZE_T
  99.     typedef unsigned int size_t;
  100. # endif /* _SIZE_T */
  101.  
  102. # ifndef _PTR_T
  103. #  define _PTR_T 
  104.     typedef void * ptr_t;
  105. # endif /* _PTR_T */
  106.  
  107. # ifndef _PID_T
  108. #  define _PID_T
  109.     typedef long pid_t;
  110. # endif /* _PID_T */
  111.  
  112. # ifndef _SIGMASK_T
  113. #  define _SIGMASK_T
  114.     typedef long sigmask_t;
  115. # endif /* _SIGMASK_T */
  116.   
  117. # ifndef _SPEED_T
  118.    /* I thought POSIX was supposed to protect all typedefs! */
  119. #  define _SPEED_T
  120. # endif /* _SPEED_T */
  121.  
  122. extern uid_t getuid(), geteuid();
  123. extern gid_t getgid(), getegid();
  124. extern sigmask_t sigblock();
  125. extern sigmask_t sigsetmask();
  126. #ifdef notdef    /* XXX: Not true for 8.0 */
  127. extern void sigpause();
  128. extern sigmask_t sigspace();
  129. #endif
  130. extern pid_t getpid();
  131. extern pid_t fork();
  132. extern void perror();
  133. extern void _exit();
  134. extern void abort();
  135. extern void qsort();
  136. extern void free();
  137. extern unsigned int alarm();
  138. extern unsigned int sleep();
  139. #ifdef notdef    /* XXX: Not true for 8.0 */
  140. extern int lstat();
  141. extern int readlink();
  142. extern int sigvector();
  143. extern int gethostname();
  144. extern int ioctl();
  145. extern int nice();
  146. extern char *sbrk();
  147. #endif
  148. #endif /* __hpux */
  149.  
  150. #ifdef _MINIX
  151. typedef char * caddr_t;
  152. #endif /* _MINIX */
  153.  
  154. /***
  155.  *** hp9000s500 running hpux-5.2
  156.  ***/
  157. #ifdef hp9000s500
  158. # ifndef _PTR_T
  159. #  define _PTR_T
  160.     typedef char * ptr_t;
  161. # endif /* _PTR_T */
  162. #endif /* hp9000s500 */
  163.  
  164.  
  165. /***
  166.  *** Data General 88000, running dgux ???
  167.  ***/
  168. #ifdef DGUX
  169. /*
  170.  * DGUX types
  171.  */
  172. # ifdef ___int_size_t_h
  173. #  ifdef _TARGETTING_M88KBCS_OR_DGUX
  174. #   ifdef _USING_ANSI_C_OR_POSIX_OR_SYSV3_OR_BSD_OR_DGUX
  175. #    ifndef _SIZE_T
  176. #     define _SIZE_T
  177. #    endif /* _SIZE_T */
  178. #   endif  /* #ifdef _USING_ANSI_C_OR_POSIX_OR_SYSV3_OR_BSD_OR_DGUX */
  179. #  endif  /* #ifdef _TARGETTING_M88KBCS_OR_DGUX */
  180. # endif  /* #ifndef ___int_size_t_h */
  181.  
  182. # ifdef _USING_POSIX_OR_SYSV3_OR_BSD_OR_DGUX
  183. #  ifndef _PID_T
  184. #   define _PID_T
  185. #  endif /* _PID_T */
  186. # endif  /* #ifdef _USING_POSIX_OR_SYSV3_OR_BSD_OR_DGUX */
  187.  
  188. #endif
  189.  
  190.  
  191. /***
  192.  *** Intel 386, ISC 386/ix v2.0.2
  193.  ***/
  194. #ifdef ISC202
  195. # ifndef _SIZE_T
  196. #  define _SIZE_T
  197. # endif /* _SIZE_T */
  198. #endif /* ISC202 */
  199.  
  200. /***
  201.  *** a PFU/Fujitsu A-xx computer SX/A Edition 60 or later
  202.  ***/
  203. #ifdef SXA
  204. # ifndef _SIZE_T
  205. #  define _SIZE_T
  206. # endif /* _SIZE_T */
  207. #endif /* SXA */
  208.  
  209. /***
  210.  *** a stellar 2600, running stellix 2.3
  211.  ***/
  212. #ifdef stellar
  213. # ifndef _SIZE_T
  214. #  define _SIZE_T
  215. # endif /* _SIZE_T */
  216. #endif /* stellar */
  217.  
  218. /***
  219.  *** BSD systems, pre and post 4.3
  220.  ***/
  221. #ifdef BSD
  222. # ifndef _SIZE_T
  223. #  define _SIZE_T
  224. # endif /* _SIZE_T */
  225. #endif /* BSD */
  226. /***
  227.  *** BSD RENO advertises itself as POSIX, but
  228.  *** it is missing speed_t 
  229.  ***/
  230. #ifdef RENO
  231. # ifndef _SPEED_T
  232. #  define _SPEED_T
  233.    typedef unsigned int speed_t; 
  234. # endif /* _SPEED_T */
  235. #endif /* RENO */
  236.  
  237.  
  238. /***
  239.  *** Pyramid, BSD universe
  240.  *** In addition to the size_t
  241.  ***/
  242. #ifdef pyr
  243. # ifndef _PID_T
  244. #  define _PID_T
  245. # endif /* _PID_T */
  246. #endif /* pyr */
  247.  
  248.  
  249. /***
  250.  *** rs6000, ibm370, ps2, rt: running flavors of aix.
  251.  ***/
  252. #ifdef IBMAIX
  253. # ifndef _SIZE_T
  254. #  define _SIZE_T
  255. # endif /* _SIZE_T */
  256. # ifndef aiws
  257. #  ifndef _PID_T
  258. #   define _PID_T
  259. #  endif /* _PID_T */
  260. # endif /* !aiws */
  261. # ifdef _IBMR2
  262. #  ifndef _SPEED_T 
  263. #   define _SPEED_T
  264. #  endif /* _SPEED_T */
  265. # endif /* _IBMR2 */
  266. #endif /* IBMAIX */
  267.  
  268.  
  269. /***
  270.  *** Ultrix...
  271.  ***/
  272. #if defined(ultrix) || defined(__ultrix)
  273. # ifndef _SIZE_T
  274. #  define _SIZE_T
  275. # endif /* _SIZE_T */
  276. # ifndef _PID_T
  277. #  define _PID_T
  278. # endif /* _PID_T */
  279. #endif /* ultrix */
  280.  
  281.  
  282. /***
  283.  *** Silicon graphics IRIS4D running IRIX3_3
  284.  ***/
  285. #if defined(IRIS4D) && defined(IRIX3_3)
  286. # ifndef _PID_T
  287. #  define _PID_T
  288. # endif /* _PID_T */
  289. #endif /* IRIS4D && IRIX3_3 */
  290.  
  291.  
  292. /***
  293.  *** Sequent
  294.  ***/
  295. #ifdef sequent
  296. # ifndef _SIZE_T
  297. #  define _SIZE_T
  298. # endif /* _SIZE_T */
  299. #endif /* sequent */
  300.  
  301. /***
  302.  *** Apple AUX.
  303.  ***/
  304. #ifdef OREO
  305. # ifndef _SIZE_T
  306. #  define _SIZE_T
  307. # endif /* _SIZE_T */
  308. # ifndef _PID_T
  309. #  define _PID_T
  310. # endif /* _PID_T */
  311. #endif /* OREO */
  312.  
  313. /***
  314.  *** Intel 386, Hypercube
  315.  ***/
  316. #ifdef INTEL
  317. # ifndef _SIZE_T
  318. #  define _SIZE_T
  319. # endif /* _SIZE_T */
  320. #endif /* INTEL */
  321.  
  322. /***
  323.  *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0.
  324.  *** Added, DAS DEC-90.
  325.  ***/
  326. #ifdef    masscomp
  327. # ifndef _SIZE_T
  328. #  define _SIZE_T
  329. # endif /* _SIZE_T */
  330. #endif    /* masscomp */
  331.  
  332. /***
  333.  *** Encore multimax running umax 4.2
  334.  ***/
  335. #ifdef    ns32000
  336. # ifdef __TYPES_DOT_H__
  337. #  ifndef _SIZE_T
  338. #   define _SIZE_T
  339. #  endif /* _SIZE_T */
  340. # endif /* __TYPES_DOT_H__ */
  341. #endif    /* ns32000 */
  342.  
  343. /***
  344.  *** Silicon Graphics IRIS 3000
  345.  ***
  346.  ***/
  347. #ifdef IRIS3D
  348. # ifndef _SIZE_T
  349. #  define _SIZE_T
  350. # endif /* _SIZE_T */
  351. #endif /* IRIS3D */
  352.  
  353. /* 
  354.  * Amdahl running UTS (Sys V3)
  355.  */
  356. #ifdef uts
  357. # ifndef _SIZE_T
  358. #  define _SIZE_T
  359. # endif /* _SIZE_T */
  360. # ifndef _PID_T
  361. #  define _PID_T
  362. # endif /* _PID_T */
  363. #endif /* uts */
  364.  
  365. /*
  366.  * UnixPC aka u3b1
  367.  */
  368. #ifdef UNIXPC
  369. # ifdef types_h
  370. #  ifndef _SIZE_T
  371. #   define _SIZE_T
  372. #  endif /* _SIZE_T */
  373. # endif /* types_h */
  374. #endif /* UNIXPC */
  375.  
  376. /*
  377.  * NS32000 OPUS
  378.  */
  379. #ifdef OPUS
  380. # ifndef _SIZE_T
  381. #  define _SIZE_T
  382. # endif /* _SIZE_T */
  383. #endif /* OPUS */
  384.  
  385. /*
  386.  * Convex
  387.  */
  388. #if defined(convex) || defined(__convex__)
  389. # if defined(__SIZE_T) && !defined(_SIZE_T)
  390. #  define _SIZE_T
  391. # endif /* __SIZE_T && !_SIZE_T */
  392. #endif /* convex || __convex__ */
  393.  
  394. /***
  395.  *** Catch all for non POSIX and/or non ANSI systems.
  396.  *** Systems up to spec *should* define these automatically
  397.  *** I am open to suggestions on how to do this correctly!
  398.  ***/
  399.  
  400. #ifndef __STDC__
  401.  
  402. # ifndef _SIZE_T
  403. #  define _SIZE_T
  404.    typedef int size_t;        /* As sun comments ??? : meaning I take it */
  405. # endif /* _SIZE_T */        /* Until we make the world ANSI... */
  406.  
  407. #endif  /* ! __STDC__ */
  408.  
  409. #ifndef POSIX
  410.  
  411. # ifndef _PID_T
  412. #  define _PID_T
  413.     typedef int pid_t;
  414. # endif /* _PID_T */
  415.  
  416. # ifndef _SPEED_T
  417. #  define _SPEED_T
  418.     typedef unsigned int speed_t;
  419. # endif /* _SPEED_T */
  420.  
  421. # ifndef _PTR_T
  422. #  define _PTR_T 
  423.     typedef char * ptr_t;
  424. #endif /* _PTR_T */
  425.  
  426. # ifndef _IOCTL_T
  427. #  define _IOCTL_T
  428.     typedef char * ioctl_t;    /* Third arg of ioctl */
  429. # endif /* _IOCTL_T */
  430.  
  431. #endif /* ! POSIX */
  432.  
  433.  
  434.  
  435. /***
  436.  *** This is our own junk types.
  437.  ***/
  438. #ifndef _PTR_T
  439. # define _PTR_T 
  440.     typedef void * ptr_t;
  441. #endif /* _PTR_T */
  442.  
  443. #ifndef _SIGMASK_T
  444. # define _SIGMASK_T
  445.     typedef int sigmask_t;
  446. #endif /* _SIGMASK_T */
  447.  
  448. #ifndef _IOCTL_T
  449. # define _IOCTL_T
  450.     typedef void * ioctl_t;    /* Third arg of ioctl */
  451. #endif /* _IOCTL_T */
  452.  
  453. #endif /* _h_sh_types */
  454.