home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / sys / bkmac.h < prev    next >
Text File  |  1993-10-19  |  1KB  |  56 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1989 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.  * HISTORY
  9.  * $Log:    bkmac.h,v $
  10.  * Revision 2.3  89/03/09  22:02:19  rpd
  11.  *     More cleanup.
  12.  * 
  13.  * Revision 2.2  89/02/25  17:52:01  gm0w
  14.  *     Changes for cleanup.
  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.  *    @(#)bkmac.h    7.1 (Berkeley) 6/4/86
  23.  */
  24.  
  25. #ifndef    _SYS_BKMAC_H_
  26. #define _SYS_BKMAC_H_
  27.  
  28. #ifdef    KERNEL
  29. #import <kernserv/macro_help.h>
  30.  
  31. /*
  32.  * Macro definition of bk.c/netinput().
  33.  * This is used to replace a call to
  34.  *        (*linesw[tp->t_line].l_rint)(c,tp);
  35.  * with
  36.  *
  37.  *        if (tp->t_line == NETLDISC)
  38.  *            BKINPUT(c, tp);
  39.  *        else
  40.  *            (*linesw[tp->t_line].l_rint)(c,tp);
  41.  */
  42.  
  43. #define BKINPUT(c, tp)                        \
  44. MACRO_BEGIN                            \
  45.     if ((tp)->t_rec == 0) {                    \
  46.         *(tp)->t_cp++ = (c);                \
  47.         if (++(tp)->t_inbuf == 1024 || (c) == '\n') {    \
  48.             (tp)->t_rec = 1;            \
  49.             wakeup((caddr_t)&(tp)->t_rawq);        \
  50.         }                        \
  51.     }                            \
  52. MACRO_END
  53.  
  54. #endif    KERNEL
  55. #endif    _SYS_BKMAC_H_
  56.