UXProcs.mesa
Copyright Ó 1988, 1991 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, May 23, 1988 2:46:13 pm PDT
UXProcs: CEDAR DEFINITIONS
~ BEGIN
Conversion of procedure variables between Cedar programs and C programs.
CProc: TYPE = WORD;
UnsafeCedarProc: TYPE[SIZE[PROC]];
with unknown parameter and and return types !
FromCedarProc: PROC [proc: PROC ANY RETURNS ANY] RETURNS [CProc];
Converts Cedar procedure proc into the type used by C programs for procedure variables.
The procedure proc must be global.
This procedure is "safe" because the unsafe operations are performed by the C program on CProc.
ToCedarProc: PROC [CProc] RETURNS [UnsafeCedarProc];
Converts C procedure variable into Cedar procedure value [with unknown types].
Client then can LOOPHOLE this into the right procedure type. This procedure itself formally is safe because the unsafety is in the necessary LOOPHOLE before using UnsafeCedarProc.
This procedure might allocate memory!
END.