home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / TIMEXSRC.ZIP / BA_TIMEX.H < prev    next >
Text File  |  1990-03-26  |  2KB  |  61 lines

  1. /* ba_timex.h -- Definitions for timexba, the background agent.
  2.  
  3.     1990    M. Mallett, Personal Workstation Magazine
  4.  
  5. */
  6.  
  7.  
  8. #ifndef H_BA_TIMEX                      /* Let multiple inclusions work */
  9. #define H_BA_TIMEX
  10.  
  11.  
  12. /* Version information */
  13. #define BAVERMAJ        1               /* Major version */
  14. #define BAVERMIN        0               /* Minor version */
  15.  
  16.  
  17. /* Configuration and control constants */
  18.  
  19. #define EVSTACKSIZE     8192            /* Size of event thread stack */
  20. #define HZ              60              /* Resolution of times() clock */
  21. #define SLEEPINCR       ((LONG)60*1000) /* Maximum sleep interval (ms) */
  22.  
  23.     /* Semaphore names */
  24. #define EVSEMNAME       "\\SEM\\TXBAEVNT"
  25.  
  26.  
  27. /* Error codes */
  28.  
  29. #define EC_UNKACTION    (EC_OTHER+1)    /* Unknown action */
  30. #define EC_SEMAPHORE    (EC_OTHER+2)    /* Semaphore problem */
  31. /*
  32.  
  33. *//*    structures */
  34.  
  35.  
  36. typedef                    /* pending event structure */
  37.   struct pevent {
  38.     struct pevent *pe_nextP;        /* Ptr to next one */
  39.     struct pevent *pe_prevP;        /* Ptr to previous one */
  40.     time_t       pe_ntime;        /* Next fire time */
  41.     EVENT         *pe_eventP;           /* Standard event stuff */
  42.   }    PEVENT;
  43.  
  44.  
  45.  
  46. /* Prototypes for common functions used in TIMEXBA */
  47.  
  48. void get_sem( char *facP, char *itemP, HSEM sem );
  49. void log( char *fmtP, ... );
  50. void process_request( void );
  51. void rel_sem( char *facP, char *itemP, HSEM sem );
  52. void schedule( PEVENT *eventP );
  53. void schedule_events( void );
  54. void set_priority( TID tid, int class, int value );
  55. int stscheck1( int status, char *funcnameP, char *argP );
  56. void unschedule( PEVENT *eventP );
  57.  
  58.  
  59. #endif  /* H_BA_TIMEX */
  60.  
  61.