home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / M2COMP_A.ZIP / TERMBASE.DEF < prev    next >
Encoding:
Modula Definition  |  1987-06-13  |  1.7 KB  |  64 lines

  1. DEFINITION MODULE TermBase;
  2.  
  3. (* (C) Copyright 1987 Fitted Software Tools. All rights reserved. *)
  4.  
  5. (*
  6.     The module Terminal does all of its work thru the procedures
  7.     KeyPressed, Read and Write in this module.
  8.  
  9.     The behaviour of these procedures can be modified by assigning
  10.     new procedures to do the work using AssignRead and AssignWrite.
  11. *)
  12.  
  13. TYPE
  14.     StatusProcedure = PROCEDURE() :BOOLEAN;
  15.     ReadProcedure   = PROCEDURE( VAR CHAR );
  16.     WriteProcedure  = PROCEDURE( CHAR );
  17.  
  18.  
  19. PROCEDURE AssignRead( rp :ReadProcedure; sp :StatusProcedure;
  20.                       VAR done :BOOLEAN );
  21. (*
  22.     save the current Read and KeyPressed procedures in a stack and
  23.     install the new procedures to be used in their place
  24. *)
  25.  
  26. PROCEDURE AssignWrite( wp :WriteProcedure;
  27.                        VAR done :BOOLEAN );
  28. (*
  29.     save the current Write procedure in a stack and install
  30.     the new procedure to be used in its place
  31. *)
  32.  
  33. PROCEDURE UnAssignRead( VAR done :BOOLEAN );
  34. (*
  35.     pop the Read and KeyPressed procedures saved by InstallRead off
  36.     the stack and make them active again.
  37. *)
  38.  
  39. PROCEDURE UnAssignWrite( VAR done :BOOLEAN );
  40. (*
  41.     pop the Write procedure saved by InstallWrite off the stack and
  42.     make it active again.
  43. *)
  44.  
  45. PROCEDURE KeyPressed() :BOOLEAN;
  46. (*
  47.     invokes the currently installed KeyPressed procedure.
  48.     During TermBase initialization, TermIO.KeyPressed is installed.
  49. *)
  50.  
  51. PROCEDURE Read( VAR ch :CHAR );
  52. (*
  53.     invokes the currently installed Read procedure.
  54.     During TermBase initialization, TermIO.Read is installed.
  55. *)
  56.  
  57. PROCEDURE Write( ch :CHAR );
  58. (*
  59.     invokes the currently installed Write procedure.
  60.     During TermBase initialization, TermIO.Write is installed.
  61. *)
  62.  
  63.  
  64. END TermBase.