home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
modu1096.zip
/
GPMsym
/
coroutines.def
< prev
next >
Wrap
Text File
|
1996-08-29
|
1KB
|
30 lines
(****************************************************************)
(* *)
(* Gardens Point Modula-2 Library Definition *)
(* *)
(* *)
(* (c) Copyright 1996 Faculty of Information Technology *)
(* Queensland University of Technology *)
(* *)
(* Permission is granted to use, copy and change this *)
(* program as long as the copyright message is left intact *)
(* *)
(****************************************************************)
FOREIGN DEFINITION MODULE Coroutines; (* coroutines as in PIM *)
IMPORT IMPLEMENTATION FROM "coroutines.o";
FROM SYSTEM IMPORT ADDRESS;
TYPE Coroutine = ADDRESS; (* use of this type avoids SYSTEM import *)
PROCEDURE NEWPROCESS (code : PROC; (* body of coroutine *)
space : ADDRESS; (* ptr to workspace *)
size : CARDINAL; (* size of workspace *)
VAR this : Coroutine); (* returned coroutine *)
PROCEDURE TRANSFER (VAR thisCo : Coroutine; (* current saved here *)
VAR destCo : Coroutine); (* target to activate *)
END Coroutines.