MODULE Glue;
IMPORT S := SYSTEM, Trace;
TYPE
Address = S.ADDRESS;
PtrElemDesc* = RECORD a: ANY END;
CONST
AdrSize = S.SIZEOF( S.ADDRESS );
VAR
AAgetadr : Address;
dlsym- : PROCEDURE {C} ( handle: Address; name: Address; adr: Address );
dlopen- : PROCEDURE {C} ( pathname: Address; mode: LONGINT ): Address;
dlclose- : PROCEDURE {C} ( handle: Address );
cout : PROCEDURE {C} ( c: CHAR );
debug- : SET;
stackBottom- : Address;
PROCEDURE Char ( c: CHAR );
BEGIN
cout( c )
END Char;
PROCEDURE Init;
VAR i: LONGINT;
BEGIN
S.MOVE( S.ADR( AAgetadr ), S.ADR( dlsym ), AdrSize );
dlsym( 0, S.ADR( "dlopen" ), S.ADR( dlopen ) );
dlsym( 0, S.ADR( "dlclose" ), S.ADR( dlclose ) );
dlsym( 0, S.ADR( "debug" ), S.ADR( debug ) );
dlsym( 0, S.ADR( "cout" ), S.ADR( cout ) );
stackBottom := S.ADR( i ) + 2*AdrSize;
Trace.Char := Char;
END Init;
BEGIN
Init;
END Glue.