home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / OS2API / OS2-TIME.ADS < prev    next >
Text File  |  1996-07-18  |  3KB  |  67 lines

  1.  
  2. -- ╔═══════════════════════════════════════════════════════════════════╗
  3. -- ║       D E S I G N   E N G I N E R I N G              ║D║S║        ║
  4. -- ║            S O F T W A R E                           ╚═╩═╝        ║
  5. -- ║                                                                   ║
  6. -- ║        Package     OS2.TIME                                       ║
  7. -- ║                                                                   ║
  8. -- ║        Author :  Leonid Dulman     1995 , 1996                    ║
  9. -- ║                                                                   ║
  10. -- ║             GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS            ║
  11. -- ║                                                                   ║
  12. -- ║             Date/time  part of os/2 api functions                 ║
  13. -- ║                                                                   ║
  14. -- ╚═══════════════════════════════════════════════════════════════════╝
  15.  
  16.  
  17. with Interfaces.C;         use Interfaces.C;
  18. with Interfaces.C.Strings; use Interfaces.C.Strings;
  19.  
  20. package Os2.Time is
  21. pragma Preelaborate (Time);
  22.  
  23.  
  24.    --** Time support --
  25. subtype HSEM is PVOID; -- typedef void *hsem
  26. type  DATETIME is record       -- date --
  27.   hours         :UCHAR   ;
  28.   minutes       :UCHAR   ;
  29.   seconds       :UCHAR   ;
  30.   hundredths    :UCHAR   ;
  31.   day           :UCHAR   ;
  32.   month         :UCHAR   ;
  33.   year          :USHORT  ;
  34.   timezone      :SHORT   ;
  35.   weekday       :UCHAR   ;
  36. end record;  -- DATETIME;
  37. type PDATETIME is access all DATETIME;
  38.  
  39. function    DosGetDateTime(pdt:PDATETIME ) return apiret;
  40. pragma Import(c,DosGetDateTime, Link_name=>"_DosGetDateTime");
  41.  
  42. function    DosSetDateTime(pdt:PDATETIME ) return apiret;
  43. pragma Import(c,DosSetDateTime, Link_name=>"_DosSetDateTime");
  44.  
  45. --   ╔═════════════════════════════════════════╗
  46. --   ║ #define DosTimerAsync   DosAsyncTimer   ║
  47. --   ║ #define DosTimerStart   DosStartTimer   ║
  48. --   ║ #define DosTimerStop    DosStopTimer    ║
  49. --   ╚═════════════════════════════════════════╝
  50. subtype HTIMER  is LHANDLE;
  51. type PHTIMER  is access all HTIMER;
  52.  
  53. function  DosAsyncTimer(msec   :ULONG   ;
  54.                         hsm    :HSEM    ;
  55.                         phtim  :PHTIMER ) return apiret;
  56. pragma Import(c,DosAsyncTimer, Link_name=>"_DosAsyncTimer");
  57.  
  58. function  DosStartTimer(msec   :ULONG   ;
  59.                         hsm    :HSEM    ;
  60.                         phtim  :PHTIMER ) return apiret;
  61. pragma Import(c,DosStartTimer, Link_name=>"_DosStartTimer");
  62.  
  63. function  DosStopTimer(htim:HTIMER ) return apiret;
  64. pragma Import(c,DosStopTimer, Link_name=>"_DosStopTimer");
  65.  
  66. end Os2.Time;
  67.