1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)types.h	7.1 (Berkeley) 6/4/86
   7:  */
   8: 
   9: #ifndef _TYPES_
  10: #define _TYPES_
  11: /*
  12:  * Basic system types and major/minor device constructing/busting macros.
  13:  */
  14: 
  15: /* major part of a device */
  16: #define major(x)    ((int)(((unsigned)(x)>>8)&0377))
  17: 
  18: /* minor part of a device */
  19: #define minor(x)    ((int)((x)&0377))
  20: 
  21: /* make a device number */
  22: #define makedev(x,y)    ((dev_t)(((x)<<8) | (y)))
  23: 
  24: typedef unsigned char   u_char;
  25: typedef unsigned short  u_short;
  26: typedef unsigned int    u_int;
  27: typedef unsigned long   u_long;
  28: typedef unsigned short  ushort;     /* sys III compat */
  29: 
  30: #ifdef vax
  31: typedef struct  _physadr { int r[1]; } *physadr;
  32: typedef struct  label_t {
  33:     int val[14];
  34: } label_t;
  35: #endif
  36: typedef struct  _quad { long val[2]; } quad;
  37: typedef long    daddr_t;
  38: typedef char *  caddr_t;
  39: typedef u_long  ino_t;
  40: typedef long    swblk_t;
  41: typedef long    size_t;
  42: typedef long    time_t;
  43: typedef short   dev_t;
  44: typedef long    off_t;
  45: typedef u_short uid_t;
  46: typedef u_short gid_t;
  47: 
  48: #define NBBY    8       /* number of bits in a byte */
  49: /*
  50:  * Select uses bit masks of file descriptors in longs.
  51:  * These macros manipulate such bit fields (the filesystem macros use chars).
  52:  * FD_SETSIZE may be defined by the user, but the default here
  53:  * should be >= NOFILE (param.h).
  54:  */
  55: #ifndef FD_SETSIZE
  56: #define FD_SETSIZE  256
  57: #endif
  58: 
  59: typedef long    fd_mask;
  60: #define NFDBITS (sizeof(fd_mask) * NBBY)    /* bits per mask */
  61: #ifndef howmany
  62: #define howmany(x, y)   (((x)+((y)-1))/(y))
  63: #endif
  64: 
  65: typedef struct fd_set {
  66:     fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  67: } fd_set;
  68: 
  69: #define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  70: #define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  71: #define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  72: #define FD_ZERO(p)  bzero((char *)(p), sizeof(*(p)))
  73: 
  74: #endif

Defined struct's

_physadr defined in line 31; never used
_quad defined in line 36; never used
fd_set defined in line 65; never used
label_t defined in line 32; never used

Defined typedef's

caddr_t defined in line 38; used 1318 times
daddr_t defined in line 37; used 175 times
dev_t defined in line 43; used 316 times
fd_mask defined in line 59; used 5 times
fd_set defined in line 67; used 3 times
gid_t defined in line 46; used 11 times
label_t defined in line 34; used 4 times
physadr defined in line 31; used 2 times
quad defined in line 36; never used
u_char defined in line 24; used 182 times
u_int defined in line 26; used 88 times
u_short defined in line 25; used 378 times
ushort defined in line 28; used 2 times

Defined macros

FD_CLR defined in line 70; never used
FD_ISSET defined in line 71; never used
FD_SET defined in line 69; used 1 times
FD_SETSIZE defined in line 56; used 2 times
FD_ZERO defined in line 72; never used
NBBY defined in line 48; used 23 times
NFDBITS defined in line 60; used 10 times
_TYPES_ defined in line 10; used 1 times
  • in line 9
minor defined in line 19; used 173 times

Usage of this include

Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1203
Valid CSS Valid XHTML 1.0 Strict