home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / sys / conf.h < prev    next >
C/C++ Source or Header  |  1993-10-19  |  2KB  |  122 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  *
  9.  * HISTORY
  10.  * 13-Feb-88  John Seamons (jks) at NeXT
  11.  *    NeXT: added d_getc and d_putc entries in cdevsw for console support.
  12.  *
  13.  * 18-Nov-87  Avadis Tevanian (avie) at Carnegie-Mellon University
  14.  *    Removed conditionals, history.
  15.  */
  16.  
  17. /*
  18.  * Copyright (c) 1982, 1986 Regents of the University of California.
  19.  * All rights reserved.  The Berkeley software License Agreement
  20.  * specifies the terms and conditions for redistribution.
  21.  *
  22.  *    @(#)conf.h    7.1 (Berkeley) 6/4/86
  23.  */
  24.  
  25. #ifndef _SYS_CONF_H_
  26. #define _SYS_CONF_H_ 1
  27. extern int nulldev();
  28. extern int nodev();
  29.  
  30. /*
  31.  * Declaration of block device
  32.  * switch. Each entry (row) is
  33.  * the only link between the
  34.  * main unix code and the driver.
  35.  * The initialization of the
  36.  * device switches is in the
  37.  * file conf.c.
  38.  */
  39. struct bdevsw
  40. {
  41.     int    (*d_open)();
  42.     int    (*d_close)();
  43.     int    (*d_strategy)();
  44.     int    (*d_dump)();
  45.     int    (*d_psize)();
  46.     int    d_flags;
  47. };
  48. #ifdef KERNEL
  49. extern struct    bdevsw bdevsw[];
  50. extern int nblkdev;
  51.  
  52. /*
  53.  * Contents of empty bdevsw slot.
  54.  */
  55. #define     NO_BDEVICE                        \
  56.     { nodev,    nodev,        nodev,        nodev,    \
  57.       0,        0 }
  58.  
  59. #endif
  60.  
  61. /*
  62.  * Character device switch.
  63.  */
  64. struct cdevsw
  65. {
  66.     int    (*d_open)();
  67.     int    (*d_close)();
  68.     int    (*d_read)();
  69.     int    (*d_write)();
  70.     int    (*d_ioctl)();
  71.     int    (*d_stop)();
  72.     int    (*d_reset)();
  73.     int    (*d_select)();
  74.     int    (*d_mmap)();
  75. #if    NeXT
  76.     int    (*d_getc)();
  77.     int    (*d_putc)();
  78. #endif    NeXT
  79. };
  80. #ifdef KERNEL
  81. extern struct    cdevsw cdevsw[];
  82. extern int nchrdev;
  83.  
  84. /*
  85.  * Contents of empty cdevsw slot.
  86.  */
  87. #define     NO_CDEVICE                            \
  88.     {                                    \
  89.     nodev,        nodev,        nodev,        nodev,        \
  90.     nodev,        nodev,        nodev,        seltrue,    \
  91.     nodev,        nodev,        nodev,                \
  92.     }
  93.  
  94. #endif
  95.  
  96. /*
  97.  * tty line control switch.
  98.  */
  99. struct linesw
  100. {
  101.     int    (*l_open)();
  102.     int    (*l_close)();
  103.     int    (*l_read)();
  104.     int    (*l_write)();
  105.     int    (*l_ioctl)();
  106.     int    (*l_rint)();
  107.     int    (*l_rend)();
  108.     int    (*l_meta)();
  109.     int    (*l_start)();
  110.     int    (*l_modem)();
  111. #if    romp || NeXT
  112.     int    (*l_select)();
  113. #endif    romp || NeXT
  114. #if    NeXT
  115.     int    l_kind;        /* if 0, follows normal clist usage */
  116. #endif    NeXT
  117. };
  118. #ifdef KERNEL
  119. struct    linesw linesw[];
  120. #endif
  121. #endif _SYS_CONF_H_
  122.