home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / GPMsym / hugeinout.def < prev    next >
Text File  |  1996-08-29  |  4KB  |  84 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. (****************************************************************)
  15. (*                                                              *)
  16. (*    High level input and output procedures for HUGEINTS    *)
  17. (*                                                              *)
  18. (*       modifications   : kjg September 1995                 *)
  19. (*                                                              *)
  20. (****************************************************************)
  21.  
  22. DEFINITION MODULE HugeInOut; 
  23.  
  24.   FROM HugeInts IMPORT HUGEINT;
  25.   FROM UxFiles  IMPORT File;
  26.  
  27.   VAR      Done : BOOLEAN ;  (* Status of some ReadInt procedure calls.
  28.                                 TRUE if the operation was successful,
  29.                                 FALSE otherwise. *)
  30.  
  31.            termCh : CHAR ;   (* Terminating character ReadInt call *)
  32.  
  33.         PROCEDURE ReadInt    (VAR n: HUGEINT);
  34.     PROCEDURE TextReadInt(f : File; VAR n : HUGEINT);
  35.     PROCEDURE StrReadInt (str : ARRAY OF CHAR; VAR n : HUGEINT);
  36.         (* Precondition  : TRUE
  37.            Postcondition : Done = TRUE if and only if the next sequence of 
  38.                            characters on the input stream represents a
  39.                            HUGEINT value. The variable termCh is set to the
  40.                            value of the character that terminates this 
  41.                            sequence.  *)
  42.  
  43.  
  44.         PROCEDURE WriteInt    (num : HUGEINT; wid : CARDINAL);
  45.     PROCEDURE TextWriteInt(fil : File; num : HUGEINT; wid : CARDINAL);
  46.     PROCEDURE StrWriteInt (num : HUGEINT; 
  47.                                wid : CARDINAL;
  48.                            VAR out : ARRAY OF CHAR);
  49.         (* Precondition  : fil is open, str is long enough for output.
  50.            Postcondition : The value of i is written to the output stream
  51.                            occupying at least w character positions. Leading
  52.                            blanks fill out the space if it is not all required.
  53.                            The decimal number system is used and a sign is 
  54.                            displayed only for negative numbers. 
  55.                            If wid=0 at least one blank is emitted.  *)
  56.  
  57.  
  58.         PROCEDURE WriteOct    (num : HUGEINT; wid : CARDINAL);
  59.     PROCEDURE TextWriteOct(fil : File; num : HUGEINT; wid : CARDINAL);
  60.     PROCEDURE StrWriteOct (num : HUGEINT; 
  61.                                wid : CARDINAL;
  62.                            VAR out : ARRAY OF CHAR);
  63.         (* Precondition  : fil is open, str is long enough for output.
  64.            Postcondition : The value of n is written to the output stream
  65.                            occupying at least w character positions. Leading
  66.                            blanks fill out the space if it is not all required.
  67.                            The octal number system is used.
  68.                            If wid=0 at least one blank is emitted.  *)
  69.  
  70.  
  71.         PROCEDURE WriteHex    (num : HUGEINT; wid : CARDINAL);
  72.     PROCEDURE TextWriteHex(fil : File; num : HUGEINT; wid : CARDINAL);
  73.     PROCEDURE StrWriteHex (num : HUGEINT; 
  74.                                wid : CARDINAL;
  75.                            VAR out : ARRAY OF CHAR);
  76.         (* Precondition  : fil is open, str is long enough for output.
  77.            Postcondition : The value of n is written to the output stream
  78.                            occupying at least w character positions. Leading
  79.                            blanks fill out the space if it is not all required.
  80.                            The hexadecimal number system is used.
  81.                            If wid=0 at least one blank is emitted.  *)
  82.  
  83. END HugeInOut.
  84.