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

  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.  *    @(#)callout.h    7.1 (Berkeley) 6/4/86
  7.  *
  8.  * HISTORY
  9.  * 17-Feb-90  Gregg Kellogg (gk) at NeXT
  10.  *    Added callout_lock.
  11.  *
  12.  * 22-Dec-87  Gregg Kellogg (gk) at NeXT
  13.  *    Added c_timeval entry for maintaining microsecond accurate
  14.  *    timeouts.
  15.  */
  16.  
  17. #ifndef    __CALLOUT__
  18. #define __CALLOUT__
  19.  
  20. typedef int (*func)(void *);
  21.  
  22. #if    NeXT
  23.  
  24. #define CALLOUT_PRI_SOFTINT0    0
  25. #define CALLOUT_PRI_SOFTINT1    1
  26. #define CALLOUT_PRI_RETRACE    2
  27. #define CALLOUT_PRI_DSP        3
  28. #define CALLOUT_PRI_THREAD    4    /* run in a thread */
  29. #define CALLOUT_PRI_NOW        5    /* must be last */
  30. #define N_CALLOUT_PRI        6
  31.  
  32. #else    NeXT
  33.  
  34. /*
  35.  * The callout structure is for
  36.  * a routine arranging
  37.  * to be called by the clock interrupt
  38.  * (clock.c) with a specified argument,
  39.  * in a specified amount of time.
  40.  * Used, for example, to time tab
  41.  * delays on typewriters.
  42.  */
  43.  
  44. struct callout {
  45.     int    c_time;        /* incremental time */
  46.     void    *c_arg;        /* argument to routine */
  47.     func    c_func;        /* routine */
  48.     struct    callout *c_next;
  49. };
  50.  
  51. #import <kern/lock.h>
  52.  
  53. extern struct callout *callfree, *callout, calltodo;
  54. extern int ncallout;
  55. decl_simple_lock_data(extern,callout_lock)
  56. #endif    NeXT
  57.  
  58. #endif __CALLOUT__
  59.