This is p-types.h in view mode; [Download] [Up]
/*+++* * RCS $Id: p-types.h,v 1.4 1993/02/02 21:00:42 gerben Exp $ * title: p-types.h * abstract: portable Posix-compliant <sys/types.h>. * author: T.R.Hageman, Groningen, The Netherlands * created: September 1992 * modified: (see RCS Log at end) * copyleft: * * Copyright (C) 1992 Tom R. Hageman. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * description: * * This is a Posix-compatible version of <sys/types.h> for both Posix * and non-Posix systems. * * Notes: * * o All UNIX systems seem to define `dev_t', `ino_t', `time_t' * and `off_t' in <sys/types.h>; most of them nowadays define * `uid_t' and `gid_t'. * * o VMS (VAX C 3.2 or older) defines only `time_t' in <types.h> but * defines `off_t', `ino_t' and `dev_t' in <stat.h>. Also note that * the definition of `ino_t' is broken: the `st_ino' field in * `struct stat' is declared as ``ino_t st_ino[3];'' so it is * virtually useless. * * o If you need `time_t', #include "time.h" instead, since ANSI C * mandates it is declared in <time.h>. * * o If _P_TYPEDEF is defined, typedefs are used instead of #defines. * This may be useful to port this file to a new system (by watching * the types clash with stuff typedef-ed in <sys/types.h>) * * BUGS: * * o This is meant as a catch-all for `_t' types that may or may not * have been defined in <sys/types.h>. This means that this header * should NOT be included BEFORE "p-stat.h" -- either explicitly or * implicitly through another "p-<header>". As this header evolves, * i.e., more knowledge is built in about particular systems, * this problem hopefully alleviates itself. *---*/ #ifndef _P_TYPES_H_ #define _P_TYPES_H_ 0x103 #ifndef _PORTDEFS_H_ # include "portdefs.h" #endif #if __STRICT_ANSI__ #error "You shouldn't use this header in strict ANSI C code" #endif #ifndef _SYS_TYPES_H_ # if _I_SYS_TYPES - -1 # include <sys/types.h> # else # if _I_TYPES # include <types.h> # endif # endif # define _SYS_TYPES_H_ #endif #if !__POSIX__ #ifndef dev_t /* `dev_t' is a traditional UNIX type. */ # ifndef _DEV_T_ # if !(__UNIX__ || __VMS__ || __TOS__ || __MSDOS__&&__MSC__) # ifdef _P_TYPEDEF typedef int dev_t; # else # define dev_t int # endif # endif # endif #endif #ifndef gid_t /* `gid_t' is used in `struct stat' by recent unices. */ # ifndef _GID_T_ # ifdef GIDTYPE /* from Larry Wall's Metaconfig. */ # define gid_t GIDTYPE # else # if (__MSDOS__ || __VMS__ || __UNIX__ && \ (pdp11 /* assume UNIX 7th Ed. compiler */ || \ sun && mc68020 /* assume SunOS 3.5 compiler */ || \ 0)) # ifdef _P_TYPEDEF typedef int gid_t; # else # define gid_t int # endif # endif # endif # endif #endif #ifndef ino_t /* `ino_t' is a traditional UNIX type. */ # ifndef _INO_T_ # if (__TURBOC__ && __MSDOS__) # ifdef _P_TYPEDEF typedef short ino_t; # else # define ino_t short # endif # endif # endif #endif #ifndef mode_t /* `mode_t' is a Posix invention. */ # ifndef _MODE_T_ # ifdef _P_TYPEDEF typedef int mode_t; # else # define mode_t int # endif # endif #endif #ifndef nlink_t /* `nlink_t' is a Posix invention. */ # ifndef _NLINK_T_ # ifdef _P_TYPEDEF typedef int nlink_t; # else # define nlink_t int # endif # endif #endif #ifndef off_t /* `off_t' is a traditional UNIX type. */ # ifndef _OFF_T_ # if !(__UNIX__ || __VMS__ || __TOS__) # ifdef _P_TYPEDEF typedef long off_t; # else # define off_t long # endif # endif # endif #endif #ifndef pid_t /* `pid_t' is a Posix invention. */ # ifndef _PID_T_ # ifdef _P_TYPEDEF typedef int pid_t; # else # define pid_t int # endif # endif #endif /* `size_t' and `ssize_t' are already handled in "portdefs.h". */ /* `time_t' (and `clock_t') are handled in "time.h". */ #ifndef uid_t /* `uid_t' is used in `struct stat' by recent unices. */ # ifndef _UID_T_ # ifdef UIDTYPE /* Metaconfig. */ # define uid_t UIDTYPE # else # if (__MSDOS__ || __VMS__ || __UNIX__ && \ (pdp11 /* assume UNIX 7th Ed. compiler */ || \ sun && mc68020 /* assume SunOS 3.5 compiler */ || \ 0)) # ifdef _P_TYPEDEF typedef int uid_t; # else # define uid_t int # endif # endif # endif # endif #endif #endif /* !__POSIX__ */ #endif /* _P_TYPES_H_ */ /*======================================================================* * $Log: p-types.h,v $ * Revision 1.4 1993/02/02 21:00:42 gerben * *** empty log message *** * * Revision 1.3 1992/10/23 04:11:15 tom * add _P_TYPEDEF conditional; describe BUGS. * add __STRICT_ANSI__ check. * * Revision 1.2 1992/10/21 19:40:23 tom * fix parenthize bug. * * Revision 1.1 1992/10/14 13:38:20 tom * rename to "p-<header>". * * Revision 1.0 1992/10/08 23:57:57 tom * Initial revision * *======================================================================*/
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.