home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / NEXTARCH.TAR / NeXTArchie / include / pmachine.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  7.4 KB  |  321 lines

  1. /*
  2.  * Copyright (c) 1989, 1990, 1991 by the University of Washington
  3.  *
  4.  * For copying and distribution information, please see the file
  5.  * <uw-copyright.h>.
  6.  */
  7.  
  8. #include <uw-copyright.h>
  9.  
  10. /*
  11.  * pmachine.h - Processor/OS specific definitions
  12.  */
  13.  
  14. /*
  15.  * Machine types - Supported values
  16.  *
  17.  *   VAX, SUN, HP9000_S300, IBM_RTPC, ENCORE_NS32K,
  18.  *   ENCORE_S93, ENCORE_S91, APOLLO, 
  19.  * 
  20.  *   MIPS_BE - MIPS Chip (Big Endian Byte Order)
  21.  *   MIPS_LE - MIPS Chip (Little Endian Byte Order)
  22.  *
  23.  * Add others as needed.  
  24.  *
  25.  * Files that check these defintions:
  26.  *   include/pmachine.h
  27.  */
  28. #define P_MACHINE_TYPE         "VAX"
  29. #define VAX
  30.  
  31. /*
  32.  * Operating system - Supported values
  33.  * 
  34.  * ULTRIX, BSD43, SUNOS, SUNOS_V3, HPUX, SYSV, MACH, DOMAINOS
  35.  *
  36.  * Add others as needed.  
  37.  *
  38.  * Files that check these defintions:
  39.  *   include/pmachine.h, lib/pcompat/opendir.c, lib/pcompat/readdir.c
  40.  */
  41. #define P_OS_TYPE        "ULTRIX"
  42. #define ULTRIX
  43.  
  44. /*
  45.  * Shell types - Supported values
  46.  *
  47.  *   CSH, SH
  48.  *
  49.  * The vcd and vfsetup commands and the vfsetup.source script
  50.  * return commands to the shell that must be interpreted.  These 
  51.  * commands set variables and define aliases.  By default,
  52.  * Prospero is configured to return commands that can be
  53.  * interpreted by the C shell.  If you would prefer to use
  54.  * a different shell, define the shell type here.  You may have to 
  55.  * add commands in the appropriate syntax to lib/pfs/penviorn.c
  56.  * and to user/gen_vfsetup.c.  Note that whatever shell you use must
  57.  * support aliases.  Only some versions of the Bourne shell do.  
  58.  * Unfortunately, at present, only one shell type can be supported 
  59.  * at a time.  This may be fixed in future releases.
  60.  */
  61. #define P_SHELL_TYPE        "CSH"
  62. #define CSH
  63.  
  64.  
  65. /*
  66.  * Miscellaneous definitions
  67.  *
  68.  * Even within a particular hardware and OS type, not all systems
  69.  * are configured identically.  Some systems may need additinal
  70.  * definitions, some of which are included below.   Note that for
  71.  * some system types, these are automatically defined.
  72.  *
  73.  * define NEED_MODE_T if mode_t is not typedefed on your system
  74.  * define DD_SEEKLEN if your system doesn't support dd_bbase and dd_bsize
  75.  * define DIRECT if direct is the name of your dirent structure
  76.  * define USE_SYS_DIR_H if your system doesn't include dirent.h
  77.  * define CLOSEDIR_RET_TYPE_VOID if your closedir returns void
  78.  * Define GETDENTS if your system supports getdents instead of getdirentries
  79.  */
  80.  
  81. /*****************************************************************/
  82. /* If your machine and OS type are listed above, and if your     */
  83. /* configuration is relatively standard for your machine and     */
  84. /* OS, there should be no need for any changes below this point. */
  85. /*****************************************************************/
  86.  
  87. /*
  88.  * Machine or OS dependent parameters
  89.  *
  90.  *  The comment at the head of each section names the paramter
  91.  *  and the files that use the definition
  92.  */
  93.  
  94. /*
  95.  *  BYTE_ORDER: lib/psrv/plog.c, lib/psrv/check_acl.c
  96.  */
  97. #define BIG_ENDIAN        1
  98. #define LITTLE_ENDIAN        2
  99.  
  100. #if defined(SUN)        || defined(HP9000_S300) || defined(IBM_RTPC) || \
  101.     defined(ENCORE_S91) || defined(ENCORE_S93)  || defined(APOLLO)   || \
  102.     defined(MIPS_BE)
  103. #define BYTE_ORDER BIG_ENDIAN
  104. #else
  105. #define BYTE_ORDER LITTLE_ENDIAN
  106. #endif
  107.  
  108. /*
  109.  * PUTENV: lib/pfs/vfsetenv.c
  110.  *
  111.  * PUTENV must be defined if your C library supports the putenv
  112.  * call instead of setenv (e.g. Ultrix and SunOS).
  113.  */
  114. #if defined(ULTRIX) || defined(SUNOS) || defined(SUNOS_V3) || defined(HPUX)
  115. #define PUTENV
  116. #endif
  117.  
  118. /*
  119.  * NOREGEX: lib/pfs/wcmatch.c
  120.  *
  121.  * NOREGEX must be defined if your C library does not support the
  122.  * re_comp and re_exec regular expression routines.
  123.  */
  124. #if defined(HPUX)
  125. #define NOREGEX
  126. #endif
  127.  
  128. /*
  129.  * String and byte manipulating 
  130.  * procedures: lib/pfs/nlsindex.c, lib/pfs/nxtline.c,
  131.  *             lib/pfs/sindex.c, lib/pcompat/pfs_access.c
  132.  */
  133. #if defined(HPUX) || defined(SYSV)
  134. #define index        strchr
  135. #define rindex        strrchr
  136. #define bcopy(a,b,n)    memmove(b,a,n)
  137. #define bzero(a,n)    memset(a,0,n)
  138. #endif
  139.  
  140. /*
  141.  * getwd: server/pstart.c
  142.  */
  143. #if defined(HPUX) || defined(SYSV)
  144. #define getwd(d)    getcwd(d, MAXPATHLEN)
  145. #endif
  146.  
  147. /*
  148.  * SETSID:  server/dirsrv.c
  149.  *
  150.  * SETSID is to be defined if the system supports the POSIX
  151.  * setsid routine to create a new session and set the process 
  152.  * group ID.
  153.  */
  154. #if defined(HPUX)
  155. #define SETSID
  156. #endif
  157.  
  158. /*
  159.  * NFILES: user/vget/pclose.c
  160.  *
  161.  * NFILES is the size of the descriptor table.
  162.  */
  163. #if defined(HPUX)
  164. #define NFILES _NFILE
  165. #else
  166. #define NFILES getdtablesize()
  167. #endif
  168.  
  169. /*
  170.  * SIGNAL_RET_TYPE: user/vget/ftp.c, user/vget/pclose.c
  171.  *
  172.  * This is the type retruned by the procedure returned by
  173.  * signal.  In some systems it is void, in others int.
  174.  *
  175.  */
  176. #if defined (BSD43) || defined(SUNOS_V3)
  177. #define SIGNAL_RET_TYPE int
  178. #else
  179. #define SIGNAL_RET_TYPE void
  180. #endif
  181.  
  182. /*
  183.  * CLOSEDIR_RET_TYPE_VOID: lib/pcompat/closedir.c
  184.  *
  185.  * If set, closedir returns void.
  186.  */
  187. #if defined (NOTDEFINED) 
  188. #define CLOSEDIR_RET_TYPE_VOID
  189. #endif
  190.  
  191. /*
  192.  * DIRECT: lib/pcompat/*dir.c app/ls.c
  193.  *
  194.  *  Use direct as the name of the dirent struct
  195.  */
  196. #if defined (NOTDEFINED) || defined(DIRECT)
  197. #define dirent direct
  198. #endif
  199.  
  200. /*
  201.  * USE_SYS_DIR_H: lib/pcompat/*dir.c app/ls.c
  202.  *
  203.  *  Include the file <sys/dir.h> instead of <dirent.h>
  204.  */
  205. #if defined (NOTDEFINED)
  206. #define USE_SYS_DIR_H
  207. #endif
  208.  
  209. /*
  210.  * DIR structure definitions: lib/pcompat/telldir.c,opendir.c
  211.  */
  212. #if defined (SUNOS) || defined(SUNOS_V3)
  213. #define dd_bbase dd_off
  214. #endif
  215.  
  216. #if defined (DD_SEEKLEN)
  217. #define dd_bbase dd_seek
  218. #define dd_bsize dd_len
  219. #endif
  220.  
  221. /*
  222.  * GETDENTS: lib/pcompar/readdir.c
  223.  *
  224.  * Define GETDENTS if your system supports getdents instead of
  225.  * getdirentries.
  226.  */
  227. #if defined (GETDENTS)
  228. #define getdirentries(F,B,N,P) getdents(F,B,N)
  229. #endif
  230.  
  231. /*
  232.  * NEED MODE_T typedef: ls.c
  233.  *
  234.  * Define this if mode_t is not defined my your systems include
  235.  * files (sys/types.h or sys/stdtypes.h or sys/stat.h).
  236.  */
  237. #if defined (NEED_MODE_T)
  238. typedef unsigned short mode_t;
  239. #endif
  240.  
  241. /*
  242.  * Catch any definitions not in system include files
  243.  *
  244.  *  The comment at the head of each section names the paramter
  245.  *  and the files that use the definition
  246.  */
  247.  
  248. /*
  249.  * OPEN_MAX: Maximum number of files a process can have open
  250.  */
  251. #ifndef OPEN_MAX
  252. #define OPEN_MAX 64
  253. #endif
  254.  
  255. /*
  256.  * FD_SET: lib/pfs/dirsend.c, user/vget/ftp.c
  257.  */
  258. #ifndef FD_SET
  259. #define    NFDBITS        32
  260. #define    FD_SETSIZE    32
  261. #define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  262. #define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  263. #define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  264. #define FD_ZERO(p)    bzero((char *)(p), sizeof(*(p)))
  265. #endif
  266.  
  267. /*
  268.  * howmany: app/ls.c
  269.  */
  270. #ifndef    howmany
  271. #define    howmany(x, y)   ((((u_int)(x))+(((u_int)(y))-1))/((u_int)(y)))
  272. #endif
  273.  
  274. /*
  275.  * MAXHOSTNAMELEN: user/vget/ftp.c
  276.  */
  277. #ifndef MAXHOSTNAMELEN
  278. #define MAXHOSTNAMELEN 64
  279. #endif
  280.  
  281. /*
  282.  * O_ACCMODE: lib/pcompat/open.c
  283.  */
  284. #ifndef O_ACCMODE
  285. #define O_ACCMODE         (O_RDONLY|O_WRONLY|O_RDWR)
  286. #endif
  287.  
  288. /*
  289.  * Definitions from stat.h: app/ls.c lib/pfs/mkdirs.c
  290.  */
  291. #ifndef S_IFMT
  292. #define S_IFMT     070000
  293. #endif
  294. #ifndef S_IFDIR
  295. #define S_IFDIR     040000
  296. #endif
  297. #ifndef S_IFCHR
  298. #define S_IFCHR 020000
  299. #endif
  300. #ifndef S_IFBLK
  301. #define S_IFBLK 060000
  302. #endif
  303. #ifndef S_IXUSR
  304. #define S_IXUSR 0100
  305. #endif
  306. #ifndef S_IXGRP
  307. #define S_IXGRP 0010
  308. #endif
  309. #ifndef S_IXOTH
  310. #define S_IXOTH 0001
  311. #endif
  312. #ifndef S_ISDIR
  313. #define    S_ISDIR(mode)  (((mode) & S_IFMT) == S_IFDIR)
  314. #endif
  315. #ifndef S_ISCHR
  316. #define S_ISCHR(m)  ((S_IFLNK & m) == S_IFCHR)
  317. #endif  
  318. #ifndef S_ISBLK
  319. #define S_ISBLK(m)  ((S_IFLNK & m) == S_IFBLK)
  320. #endif
  321.