home *** CD-ROM | disk | FTP | other *** search
- (*************************************************************************
-
- $RCSfile: Hooks1.mod $
- Description: Example of a callback hook function.
-
- Created by: fjc (Frank Copeland)
- $Revision: 1.4 $
- $Author: fjc $
- $Date: 1994/08/08 16:59:20 $
-
- Copyright © 1994, Frank Copeland.
- This example program is part of Oberon-A.
- See Oberon-A.doc for conditions of use and distribution.
-
- Log entries are at the end of the file.
-
- *************************************************************************)
-
- MODULE Hooks1;
-
- (*
- ** $C= CaseChk $I= IndexChk $L= LongAdr $N= NilChk
- ** $P- PortableCode $R= RangeChk $S= StackChk $T= TypeChk
- ** $V= OvflChk $Z= ZeroVars
- *)
-
- IMPORT
- SYS := SYSTEM,
- E := Exec,
- U := Utility,
- HU := HookUtil,
- IO := StdIO;
-
- CONST
- VersionTag = "\0$VER: Hook1 1.0 (9.6.94)\r\n";
- VersionStr = "Hook1 1.0 (9 Jun 1994)\r\n";
- AuthorStr = "Written by Frank Copeland\n";
-
- VAR
- myHook : U.Hook;
-
- (*------------------------------------*)
- PROCEDURE* MyFunction
- ( hook : U.HookPtr; obj : E.APTR; data : E.APTR )
- : E.APTR;
-
- BEGIN (* MyFunction *)
- IO.WriteStr ("Inside MyFunction\n\n");
- RETURN SYS.VAL (E.APTR, 1)
- END MyFunction;
-
- (*------------------------------------*)
- PROCEDURE Main ();
-
- BEGIN (* Main *)
- U.OpenLib (TRUE);
- HU.InitHook (myHook, MyFunction, NIL);
- IF U.base.CallHookPkt (SYS.ADR (myHook), NIL, NIL) = 1 THEN
- IO.WriteStr ("Hook returned OK\n")
- ELSE
- IO.WriteStr ("Some problem with hook\n")
- END
- END Main;
-
- BEGIN (* Hooks1 *)
- IO.WriteStr (VersionStr);
- IO.WriteStr (AuthorStr);
- IO.WriteLn ();
- Main ();
- END Hooks1.
-
- (*************************************************************************
-
- $Log: Hooks1.mod $
- # Revision 1.4 1994/08/08 16:59:20 fjc
- # Release 1.4
- #
- # Revision 1.3 1994/07/03 15:15:44 fjc
- # - Incorporated changes in 3.1 Interfaces
- #
- # Revision 1.2 1994/06/14 00:56:29 fjc
- # - Updated for release
- #
- # Revision 1.1 1994/06/09 22:11:44 oberon
- # Initial revision
- #
- *************************************************************************)
-
-