home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / devices / timer.h < prev    next >
C/C++ Source or Header  |  1994-02-13  |  1KB  |  65 lines

  1. #ifndef DEVICES_TIMER_H
  2. #define DEVICES_TIMER_H 1
  3. /*
  4. **    $VER: timer.h 36.16 (25.1.91)
  5. **    Includes Release 40.15
  6. **
  7. **    Timer device name and useful definitions.
  8. **
  9. **    (C) Copyright 1985-1993 Commodore-Amiga Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #include <exec/types.h>
  14. #include <exec/io.h>
  15.  
  16. /* This is somewhat misleading.  It's really not a GNU C dependency,
  17.    it is a dependency on using ixemul.library and the associated libc.a
  18.    and include files.  But there is currently no easy way to differentiate
  19.    the use of GNU C from the intent to use ixemul.library.   -fnf */
  20.  
  21. #ifdef __GNUC__
  22. #include <sys/time.h>
  23. #endif
  24.  
  25. /* unit defintions */
  26. #define UNIT_MICROHZ    0
  27. #define UNIT_VBLANK    1
  28. #define UNIT_ECLOCK    2
  29. #define UNIT_WAITUNTIL    3
  30. #define    UNIT_WAITECLOCK    4
  31.  
  32. #define TIMERNAME    "timer.device"
  33.  
  34. #ifndef __GNUC__
  35.  
  36. struct timeval {
  37.     ULONG tv_secs;
  38.     ULONG tv_micro;
  39. };
  40.  
  41. #else
  42.  
  43. /* Use the definition in sys/time.h */
  44. #define tv_secs  tv_sec
  45. #define tv_micro tv_usec
  46.  
  47. #endif
  48.  
  49. struct EClockVal {
  50.     ULONG ev_hi;
  51.     ULONG ev_lo;
  52. };
  53.  
  54. struct timerequest {
  55.     struct IORequest tr_node;
  56.     struct timeval tr_time;
  57. };
  58.  
  59. /* IO_COMMAND to use for adding a timer */
  60. #define TR_ADDREQUEST    CMD_NONSTD
  61. #define TR_GETSYSTIME    (CMD_NONSTD+1)
  62. #define TR_SETSYSTIME    (CMD_NONSTD+2)
  63.  
  64. #endif /* DEVICES_TIMER_H */
  65.