home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / tcsh / Source / sh.types.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  11.4 KB  |  552 lines

  1. /* $Header: /u/christos/src/tcsh-6.03/RCS/sh.types.h,v 3.26 1992/10/14 20:19:19 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 sunos3.x - sunos4.1.x
  51.  ***/
  52. #if (defined(sun) || defined(__sun__)) && SYSVREL == 0
  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 MACH
  82. #   ifndef _UID_T
  83. #    define _UID_T
  84.       typedef int uid_t;
  85. #   endif /* _UID_T */
  86. #   ifndef _GID_T
  87. #    define _GID_T
  88.       typedef int gid_t;
  89. #   endif /* _GID_T */
  90. #  endif /* !MACH */
  91. # endif /* !SUNOS4 */
  92. #endif /* (sun || __sun__) && SYSVREL == 0 */
  93.  
  94.  
  95. /***
  96.  *** Hp's running hpux 7.0
  97.  ***/
  98. #ifdef __hpux
  99. # ifndef _SIZE_T
  100. #  define _SIZE_T
  101.     typedef unsigned int size_t;
  102. # endif /* _SIZE_T */
  103.  
  104. # ifndef _PTR_T
  105. #  define _PTR_T 
  106.     typedef void * ptr_t;
  107. # endif /* _PTR_T */
  108.  
  109. # ifndef _PID_T
  110. #  define _PID_T
  111.     typedef long pid_t;
  112. # endif /* _PID_T */
  113.  
  114. # ifndef _SIGMASK_T
  115. #  define _SIGMASK_T
  116.     typedef long sigmask_t;
  117. # endif /* _SIGMASK_T */
  118.   
  119. # ifndef _SPEED_T
  120.    /* I thought POSIX was supposed to protect all typedefs! */
  121. #  define _SPEED_T
  122. # endif /* _SPEED_T */
  123.  
  124. extern uid_t getuid(), geteuid();
  125. extern gid_t getgid(), getegid();
  126. extern sigmask_t sigblock();
  127. extern sigmask_t sigsetmask();
  128. #ifdef notdef    /* XXX: Not true for 8.0 */
  129. extern void sigpause();
  130. extern sigmask_t sigspace();
  131. #endif
  132. extern pid_t getpid();
  133. extern pid_t fork();
  134. extern void perror();
  135. extern void _exit();
  136. extern void abort();
  137. extern void qsort();
  138. extern void free();
  139. extern unsigned int alarm();
  140. extern unsigned int sleep();
  141. #ifdef notdef    /* XXX: Not true for 8.0 */
  142. extern int lstat();
  143. extern int readlink();
  144. extern int sigvector();
  145. extern int gethostname();
  146. extern int ioctl();
  147. extern int nice();
  148. extern char *sbrk();
  149. #endif
  150. #endif /* __hpux */
  151.  
  152. #if defined(_MINIX) || defined(__EMX__) || defined(COHERENT)
  153. typedef char * caddr_t;
  154. #endif /* _MINIX || __EMX__ || COHERENT */
  155.  
  156. /***
  157.  *** hp9000s500 running hpux-5.2
  158.  ***/
  159. #ifdef hp9000s500
  160. # ifndef _PTR_T
  161. #  define _PTR_T
  162.     typedef char * ptr_t;
  163. # endif /* _PTR_T */
  164. #endif /* hp9000s500 */
  165.  
  166. /***
  167.  *** Data General 88000, running dgux ???
  168.  *** ISN'T_THIS_REALLY_UGLY_OR_IS_IT_JUST_ME?
  169.  ***/
  170. #ifdef DGUX
  171. /*
  172.  * DGUX types
  173.  */
  174. # ifdef ___int_size_t_h
  175. #  if defined(_TARGETTING_M88KBCS_OR_DGUX) || defined(_TARGETTING_M88KBCS_OR_M88KOCS_OR_DGUX)
  176. #   if defined(_USING_ANSI_C_OR_POSIX_OR_SYSV3_OR_BSD_OR_DGUX) || defined(_USING_ANSI_C_OR_POSIX_OR_XPG3_OR_SYSV3_OR_BSD_OR_DGUX)
  177. #    ifndef _SIZE_T
  178. #     define _SIZE_T
  179. #    endif /* _SIZE_T */
  180. #   endif  /* _USING_ANSI_C_OR_POSIX_OR_SYSV3_OR_BSD_OR_DGUX || _USING_ANSI_C_OR_POSIX_OR_XPG3_OR_SYSV3_OR_BSD_OR_DGUX */
  181. #  endif  /* _TARGETTING_M88KBCS_OR_DGUX || _TARGETTING_M88KBCS_OR_M88KOCS_OR_DGUX */
  182. # endif  /* ___int_size_t_h */
  183.  
  184. # ifdef _USING_POSIX_OR_SYSV3_OR_BSD_OR_DGUX
  185. #  ifndef _PID_T
  186. #   define _PID_T
  187. #  endif /* _PID_T */
  188. # endif  /* _USING_POSIX_OR_SYSV3_OR_BSD_OR_DGUX */
  189.  
  190. #endif
  191.  
  192.  
  193. /***
  194.  *** Intel 386, ISC 386/ix v2.0.2
  195.  ***/
  196. #ifdef ISC202
  197. # ifndef _SIZE_T
  198. #  define _SIZE_T
  199. # endif /* _SIZE_T */
  200. #endif /* ISC202 */
  201.  
  202. /***
  203.  *** a PFU/Fujitsu A-xx computer SX/A Edition 60 or later
  204.  ***/
  205. #ifdef SXA
  206. # ifndef _SIZE_T
  207. #  define _SIZE_T
  208. # endif /* _SIZE_T */
  209. #endif /* SXA */
  210.  
  211. /***
  212.  *** a stellar 2600, running stellix 2.3
  213.  ***/
  214. #ifdef stellar
  215. # ifndef _SIZE_T
  216. #  define _SIZE_T
  217. # endif /* _SIZE_T */
  218. #endif /* stellar */
  219.  
  220. /***
  221.  *** BSD systems, pre and post 4.3
  222.  ***/
  223. #ifdef BSD
  224. # ifndef _SIZE_T
  225. #  define _SIZE_T
  226. # endif /* _SIZE_T */
  227. #endif /* BSD */
  228.  
  229.  
  230. /***
  231.  *** BSD RENO advertises itself as POSIX, but
  232.  *** it is missing speed_t 
  233.  ***/
  234. #ifdef RENO
  235. # ifndef _SPEED_T
  236. #  define _SPEED_T
  237.    typedef unsigned int speed_t; 
  238. # endif /* _SPEED_T */
  239. #endif /* RENO */
  240.  
  241.  
  242. /***
  243.  *** Pyramid, BSD universe
  244.  *** In addition to the size_t
  245.  ***/
  246. #ifdef pyr
  247. # ifndef _PID_T
  248. #  define _PID_T
  249. # endif /* _PID_T */
  250. #endif /* pyr */
  251.  
  252.  
  253. /***
  254.  *** rs6000, ibm370, ps2, rt: running flavors of aix.
  255.  ***/
  256. #ifdef IBMAIX
  257. # ifndef _SIZE_T
  258. #  define _SIZE_T
  259. # endif /* _SIZE_T */
  260. # ifndef aiws
  261. #  ifndef _PID_T
  262. #   define _PID_T
  263. #  endif /* _PID_T */
  264. # endif /* !aiws */
  265. # ifdef _IBMR2
  266. #  ifndef _SPEED_T 
  267. #   define _SPEED_T
  268. #  endif /* _SPEED_T */
  269. # endif /* _IBMR2 */
  270. #endif /* IBMAIX */
  271.  
  272.  
  273. /***
  274.  *** Ultrix...
  275.  ***/
  276. #if defined(ultrix) || defined(__ultrix)
  277. # ifndef _SIZE_T
  278. #  define _SIZE_T
  279. # endif /* _SIZE_T */
  280. # ifndef _PID_T
  281. #  define _PID_T
  282. # endif /* _PID_T */
  283. #endif /* ultrix || __ultrix */
  284.  
  285.  
  286. /***
  287.  *** Silicon graphics IRIS4D running IRIX3_3
  288.  ***/
  289. #if defined(IRIS4D) && defined(IRIX3_3)
  290. # ifndef _PID_T
  291. #  define _PID_T
  292. # endif /* _PID_T */
  293. #endif /* IRIS4D && IRIX3_3 */
  294.  
  295.  
  296. /***
  297.  *** Sequent
  298.  ***/
  299. #ifdef sequent
  300. # ifndef _SIZE_T
  301. #  define _SIZE_T
  302. # endif /* _SIZE_T */
  303. #endif /* sequent */
  304.  
  305. /***
  306.  *** Apple AUX.
  307.  ***/
  308. #ifdef OREO
  309. # ifndef _SIZE_T
  310. #  define _SIZE_T
  311. # endif /* _SIZE_T */
  312. # ifndef _PID_T
  313. #  define _PID_T
  314. # endif /* _PID_T */
  315. #endif /* OREO */
  316.  
  317. /***
  318.  *** Intel 386, Hypercube
  319.  ***/
  320. #ifdef INTEL
  321. # ifndef _SIZE_T
  322. #  define _SIZE_T
  323. # endif /* _SIZE_T */
  324. #endif /* INTEL */
  325.  
  326. /***
  327.  *** Concurrent (Masscomp) running RTU 4.1A & RTU 5.0. 
  328.  **** [RTU 6.0 from mike connor]
  329.  *** Added, DAS DEC-90.
  330.  ***/
  331. #ifdef    masscomp
  332. # ifndef _SIZE_T
  333. #  define _SIZE_T
  334. # endif /* _SIZE_T */
  335. # ifdef RTU6
  336. #  ifndef _PID_T
  337. #   define _PID_T
  338. #  endif /* _PID_T */
  339. #  ifndef _SPEED_T
  340. #   define _SPEED_T
  341. #  endif /* _SPEED_T */
  342. #endif /* RTU6 */
  343. #endif    /* masscomp */
  344.  
  345. /***
  346.  *** Encore multimax running umax 4.2
  347.  ***/
  348. #ifdef    ns32000
  349. # ifdef __TYPES_DOT_H__
  350. #  ifndef _SIZE_T
  351. #   define _SIZE_T
  352. #  endif /* _SIZE_T */
  353. # endif /* __TYPES_DOT_H__ */
  354. #endif    /* ns32000 */
  355.  
  356. /***
  357.  *** Silicon Graphics IRIS 3000
  358.  ***
  359.  ***/
  360. #ifdef IRIS3D
  361. # ifndef _SIZE_T
  362. #  define _SIZE_T
  363. # endif /* _SIZE_T */
  364. #endif /* IRIS3D */
  365.  
  366. /* 
  367.  * Motorola MPC running R32V2 (sysV88)
  368.  */
  369. #ifdef sysV88
  370. # ifndef _SIZE_T
  371. #  define _SIZE_T
  372. # endif /* _SIZE_T */
  373. # ifndef _PID_T
  374. #  define _PID_T
  375. # endif /* _PID_T */
  376. #endif /* sysV88 */
  377.  
  378. /* 
  379.  * Amdahl running UTS (Sys V3)
  380.  */
  381. #ifdef uts
  382. # ifndef _SIZE_T
  383. #  define _SIZE_T
  384. # endif /* _SIZE_T */
  385. # ifndef _PID_T
  386. #  define _PID_T
  387. # endif /* _PID_T */
  388. #endif /* uts */
  389.  
  390. /* 
  391.  * Tektronix 4300 running UTek 4.0 (BSD 4.2)
  392.  */
  393. #ifdef UTek
  394. # ifndef _SIZE_T
  395. #  define _SIZE_T
  396. # endif /* _SIZE_T */
  397. #endif /* UTek */
  398.  
  399. /* 
  400.  * Tektronix XD88/10 running UTekV (Sys V3)
  401.  */
  402. #ifdef UTekV
  403. # ifndef _SIZE_T
  404. #  define _SIZE_T
  405. # endif /* _SIZE_T */
  406. # ifndef _PID_T
  407. #  define _PID_T
  408. # endif /* _PID_T */
  409. #endif /* UTekV*/
  410.  
  411. /*
  412.  * UnixPC aka u3b1
  413.  */
  414. #ifdef UNIXPC
  415. # ifdef types_h
  416. #  ifndef _SIZE_T
  417. #   define _SIZE_T
  418. #  endif /* _SIZE_T */
  419. # endif /* types_h */
  420. #endif /* UNIXPC */
  421.  
  422. /*
  423.  * NS32000 OPUS
  424.  */
  425. #ifdef OPUS
  426. # ifndef _SIZE_T
  427. #  define _SIZE_T
  428. # endif /* _SIZE_T */
  429. #endif /* OPUS */
  430.  
  431. /*
  432.  * BBN Butterfly gp1000
  433.  */
  434. #ifdef butterfly
  435. # ifndef _PID_T
  436. #  define _PID_T
  437. # endif /* _PID_T */
  438. #endif /* butterfly */
  439.  
  440. /*
  441.  * Convex
  442.  */
  443. #ifdef convex
  444. # if defined(__SIZE_T) && !defined(_SIZE_T)
  445. #  define _SIZE_T
  446. # endif /* __SIZE_T && !_SIZE_T */
  447. #endif /* convex */
  448.  
  449. /*
  450.  * Alliant FX-2800/FX-80
  451.  */
  452. #ifdef alliant
  453. # ifndef _PID_T
  454. #  define _PID_T
  455. # endif /* _PID_T */
  456. # ifdef mc68000
  457.    typedef int   pid_t; /* FX-80 */
  458. # else
  459.    typedef short pid_t;    /* FX-2800 */
  460. # endif 
  461. #endif /* alliant */
  462.  
  463. /*
  464.  * DNIX
  465.  */
  466. #ifdef DNIX
  467. # ifndef _PID_T
  468. #  define _PID_T
  469. # endif /* _PID_T */
  470. #endif /* DNIX */
  471.  
  472. /*
  473.  *  Apollo running Domain/OS SR10.3 or greater
  474.  */
  475. #ifdef apollo
  476. # ifndef _PID_T
  477. #  define _PID_T
  478. # endif /* _PID_T */
  479. #endif /* apollo */
  480.  
  481. /*
  482.  *  Vax running VMS_POSIX
  483.  */
  484. #ifdef _VMS_POSIX
  485. # ifndef _SIZE_T
  486. #  define _SIZE_T
  487. # endif /* _SIZE_T */
  488. #endif /* _VMS_POSIX */
  489.  
  490. /***
  491.  *** Catch all for non POSIX and/or non ANSI systems.
  492.  *** Systems up to spec *should* define these automatically
  493.  *** I am open to suggestions on how to do this correctly!
  494.  ***/
  495.  
  496. #ifndef __STDC__
  497.  
  498. # ifndef _SIZE_T
  499. #  define _SIZE_T
  500.    typedef int size_t;        /* As sun comments ??? : meaning I take it */
  501. # endif /* _SIZE_T */        /* Until we make the world ANSI... */
  502.  
  503. #endif  /* ! __STDC__ */
  504.  
  505. #ifndef POSIX
  506.  
  507. # ifndef _PID_T
  508. #  define _PID_T
  509.     typedef int pid_t;
  510. # endif /* _PID_T */
  511.  
  512. #  define _SPEED_T
  513.  
  514. # ifndef _SPEED_T
  515. #  define _SPEED_T
  516.     typedef unsigned int speed_t;
  517. # endif /* _SPEED_T */
  518.  
  519. # ifndef _PTR_T
  520. #  define _PTR_T 
  521.     typedef char * ptr_t;
  522. #endif /* _PTR_T */
  523.  
  524. # ifndef _IOCTL_T
  525. #  define _IOCTL_T
  526.     typedef char * ioctl_t;    /* Third arg of ioctl */
  527. # endif /* _IOCTL_T */
  528.  
  529. #endif /* ! POSIX */
  530.  
  531.  
  532.  
  533. /***
  534.  *** This is our own junk types.
  535.  ***/
  536. #ifndef _PTR_T
  537. # define _PTR_T 
  538.     typedef void * ptr_t;
  539. #endif /* _PTR_T */
  540.  
  541. #ifndef _SIGMASK_T
  542. # define _SIGMASK_T
  543.     typedef int sigmask_t;
  544. #endif /* _SIGMASK_T */
  545.  
  546. #ifndef _IOCTL_T
  547. # define _IOCTL_T
  548.     typedef void * ioctl_t;    /* Third arg of ioctl */
  549. #endif /* _IOCTL_T */
  550.  
  551. #endif /* _h_sh_types */
  552.