home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / GPMsym / coroutines.def < prev    next >
Text File  |  1996-08-29  |  1KB  |  30 lines

  1. (****************************************************************)
  2. (*                                                              *)
  3. (*         Gardens Point Modula-2 Library Definition            *)
  4. (*                                                              *)
  5. (*                                                              *)
  6. (*     (c) Copyright 1996 Faculty of Information Technology     *)
  7. (*              Queensland University of Technology             *)
  8. (*                                                              *)
  9. (*     Permission is granted to use, copy and change this       *)
  10. (*     program as long as the copyright message is left intact  *)
  11. (*                                                              *)
  12. (****************************************************************)
  13.  
  14. FOREIGN DEFINITION MODULE Coroutines;   (* coroutines as in PIM *)
  15.  
  16.   IMPORT IMPLEMENTATION FROM "coroutines.o";
  17.   FROM SYSTEM IMPORT ADDRESS;
  18.  
  19.   TYPE Coroutine = ADDRESS;  (* use of this type avoids SYSTEM import *)
  20.  
  21.   PROCEDURE NEWPROCESS (code  : PROC;        (* body of coroutine  *)    
  22.             space : ADDRESS;    (* ptr to workspace   *)
  23.             size  : CARDINAL;    (* size of workspace  *)
  24.             VAR this  : Coroutine);    (* returned coroutine *)
  25.  
  26.   PROCEDURE TRANSFER (VAR thisCo : Coroutine;    (* current saved here *)
  27.               VAR destCo : Coroutine);  (* target to activate *)
  28.  
  29. END Coroutines.
  30.