home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / GPMsym / debugwrite.def < prev    next >
Text File  |  1996-08-29  |  3KB  |  91 lines

  1. (****************************************************************)
  2. (*                                                              *)
  3. (*         Gardens Point Modula-2 Library Definition            *)
  4. (*                                                              *)
  5. (*                                                              *)
  6. (*     (c) Copyright 1996 Faculty of Information Technology     *)
  7. (*              Queensland University of Technology             *)
  8. (*                                                              *)
  9. (*     Permission is granted to use, copy and change this       *)
  10. (*     program as long as the copyright message is left intact  *)
  11. (*                                                              *)
  12. (****************************************************************)
  13.  
  14. DEFINITION MODULE DebugWrite;
  15. (*
  16.  * Simplified interfaces to typical debug write formats.
  17.  *
  18.  * Each has a string initial parameter, which should be used to explain
  19.  * what the value is and/or the position in the code.
  20.  * The standard signature is "# [DebugWrite: ]"
  21.  * Special cases are translated to ensure readability.
  22.  * All output is to StdError.
  23.  *)
  24.  
  25. FROM SYSTEM IMPORT BYTE;
  26.  
  27. PROCEDURE DebugOn;
  28. (*
  29.  * Enable DebugWrite output (this is the default)
  30.  *)
  31.  
  32. PROCEDURE DebugOff;
  33. (*
  34.  * Disable DebugWrite output
  35.  *)
  36.  
  37. PROCEDURE DC(*DebugWriteChar*) (heading : ARRAY OF CHAR; char : CHAR);
  38. (*
  39.  * Write signature, heading, followed by ":" if not empty,
  40.  * then ch if printable, else its hex equivalent.
  41.  *)
  42.  
  43. PROCEDURE DCa(*DebugWriteCardinal*) (heading : ARRAY OF CHAR; card : CARDINAL);
  44. (*
  45.  * Write signature, heading, followed by ":" if not empty,
  46.  * then card in minimum field width.
  47.  *)
  48.  
  49. PROCEDURE DI(*DebugWriteInteger*) (heading : ARRAY OF CHAR; int : INTEGER);
  50. (*
  51.  * Write signature, heading, followed by ":" if not empty,
  52.  * then int in minimum field width.
  53.  *)
  54.  
  55. PROCEDURE DR(*DebugWriteReal*) (heading : ARRAY OF CHAR; real : REAL);
  56. (*
  57.  * Write signature, heading, followed by ":" if not empty,
  58.  * then real in full precision - fixed point if within whole number range,
  59.  * floating point otherwise.
  60.  *)
  61.  
  62. PROCEDURE DB(*DebugWriteBoolean*) (heading : ARRAY OF CHAR; boolean : BOOLEAN);
  63. (*
  64.  * Write signature, heading, followed by ":" if not empty,
  65.  * then "TRUE" or "FALSE".
  66.  *)
  67.  
  68. PROCEDURE DAll (heading : ARRAY OF CHAR; VAR value : ARRAY OF BYTE);
  69. (*
  70.  * Write signature, heading, followed by ":" if not empty,
  71.  * then 8 bytes starting at beginning of value in all formats.
  72.  *)
  73.  
  74. PROCEDURE DDump (heading : ARRAY OF CHAR; value : ARRAY OF BYTE; size : CARDINAL);
  75. (*
  76.  * Write signature, heading, followed by ":" if not empty,
  77.  * then size bytes starting at beginning of value in hexadecimal.
  78.  *)
  79.  
  80. PROCEDURE DW(*DebugWriteLn*);
  81. (*
  82.  * WriteLn
  83.  *)
  84.  
  85. PROCEDURE DS(*DebugWriteString*) (string : ARRAY OF CHAR);
  86. (*
  87.  * Write signature, string, ":".
  88.  *)
  89.  
  90. END DebugWrite.
  91.