home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source2.lha / Source / AmigaUtil / TimerUtil.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  1.5 KB  |  53 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: TimerUtil.mod $
  4.   Description: Support for clients of timer.device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 00:30:04 $
  10.  
  11.   Copyright © 1994, Frank Copeland.
  12.   This file is part of the Oberon-A Library.
  13.   See Oberon-A.doc for conditions of use and distribution.
  14.  
  15. ***************************************************************************)
  16.  
  17. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  18. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  19. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  20.  
  21. MODULE TimerUtil;
  22.  
  23. IMPORT e := Exec, es := ExecSupport, t := Timer;
  24.  
  25. (*------------------------------------*)
  26. (*
  27.  * An AmigaDOS 1.3 implementation of the AmigaDOS 2.0+ function.  Based on
  28.  * an example in the 2nd edition RKM:Libraries and Devices.
  29.  *)
  30. PROCEDURE GetSysTime * ( req : t.TimeRequestPtr; VAR dest : t.TimeVal );
  31.  
  32.   VAR port : e.MsgPortPtr; result : SHORTINT;
  33.  
  34. BEGIN (* GetSysTime *)
  35.   dest.secs := 0; dest.micro := 0; port := NIL;
  36.   IF req.node.message.replyPort = NIL THEN
  37.     port := es.CreatePort ("", 0);
  38.     IF port # NIL THEN req.node.message.replyPort := port
  39.     ELSE RETURN
  40.     END
  41.   END;
  42.   req.node.message.node.type := e.message;
  43.   req.node.message.node.pri := 0;
  44.   req.node.message.node.name := NIL;
  45.   req.node.command := t.getSysTime;
  46.   result := e.DoIO (req);
  47.   dest := req.time;
  48.   IF port # NIL THEN es.DeletePort (port) END
  49. END GetSysTime;
  50.  
  51. END TimerUtil.
  52.  
  53.