home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sa104os2.zip / SATHR104.ZIP / SATHER / LIBRARY / OUT.SA < prev    next >
Text File  |  1994-12-22  |  4KB  |  125 lines

  1. -- Copyright (C) International Computer Science Institute, 1994.  COPYRIGHT  --
  2. -- NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject --
  3. -- to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in    --
  4. -- the file "Doc/License" of the Sather distribution.  The license is also   --
  5. -- available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA.  --
  6. --------> Please email comments to "sather-bugs@icsi.berkeley.edu". <----------
  7.  
  8. -- out.sa: Output on stdout.
  9. -------------------------------------------------------------------
  10. class OUT is
  11.    -- Direct access to stdout.
  12.  
  13.    create:SAME is return self end;
  14.    
  15.    plus(s:STR):SAME is 
  16.       -- Print `s' on stdout and return self.
  17.       C_OUT::c_out_nstr(s.size,s); return self end;
  18.    
  19.    plus(s:STR) is
  20.       -- Print `s' on stdout.
  21.      C_OUT::c_out_nstr(s.size,s) end;
  22.  
  23.    plus(c:CHAR):SAME is 
  24.       -- Print the character `c' on stdout and return self.
  25.       C_OUT::c_out_char(c); return self end;
  26.  
  27.    plus(c:CHAR) is 
  28.       -- Print the character `c' on stdout.
  29.       C_OUT::c_out_char(c) end;
  30.  
  31.    plus(s:FSTR):SAME is 
  32.       -- Print `s' on stdout and return self.
  33.       C_OUT::c_out_nstr(s.size,s.str); return self end;
  34.    
  35.    plus(s:FSTR) is
  36.       -- Print `s' on stdout.
  37.       C_OUT::c_out_nstr(s.size,s.str) end;      
  38.  
  39.    plus(b:BOOL):SAME is 
  40.       -- Print `b' on stdout and return self.
  41.       C_OUT::c_out_str(b.str); return self end;
  42.    
  43.    plus(b:BOOL) is
  44.       -- Print `b' on stdout.
  45.       C_OUT::c_out_str(b.str) end;      
  46.    
  47.    plus(i:INT):SAME is 
  48.       -- Print `i' on stdout and return self.
  49.       C_OUT::c_out_str(i.str); return self end;
  50.    
  51.    plus(i:INT) is
  52.       -- Print `i' on stdout.
  53.       C_OUT::c_out_str(i.str) end;      
  54.  
  55.    plus(i:INTI):SAME is 
  56.       -- Print `i' on stdout and return self.
  57.       C_OUT::c_out_str(i.str); return self end;
  58.       
  59.    plus(i:INTI) is
  60.       -- Print `i' on stdout.
  61.       C_OUT::c_out_str(i.str) end;            
  62.    
  63.    plus(f:FLT):SAME is 
  64.       -- Print `f' on stdout and return self.
  65.       C_OUT::c_out_str(f.str); return self end;
  66.    
  67.    plus(f:FLT) is
  68.       -- Print `f' on stdout.
  69.       C_OUT::c_out_str(f.str) end;      
  70.  
  71.    plus(f:FLTD):SAME is 
  72.       -- Print `f' on stdout and return self.
  73.       C_OUT::c_out_str(f.str); return self end;
  74.    
  75.    plus(f:FLTD) is
  76.       -- Print `f' on stdout.
  77.       C_OUT::c_out_str(f.str) end;      
  78.  
  79.    plus(f:FLTX):SAME is 
  80.       -- Print `f' on stdout and return self.
  81.       C_OUT::c_out_str(f.str); return self end;
  82.    
  83.    plus(f:FLTX) is
  84.       -- Print `f' on stdout.
  85.       C_OUT::c_out_str(f.str) end;      
  86.  
  87.    plus(f:FLTDX):SAME is 
  88.       -- Print `f' on stdout and return self.
  89.       C_OUT::c_out_str(f.str); return self end;
  90.    
  91.    plus(f:FLTDX) is
  92.       -- Print `f' on stdout.
  93.       C_OUT::c_out_str(f.str) end;
  94.  
  95.    plus(f:FLTI):SAME is 
  96.       -- Print `f' on stdout and return self.
  97.       C_OUT::c_out_str(f.str); return self end;
  98.    
  99.    plus(f:FLTI) is
  100.       -- Print `f' on stdout.
  101.       C_OUT::c_out_str(f.str) end;      
  102.  
  103.    flush is
  104.       -- Flush buffers.
  105.       C_OUT::c_out_flush end;
  106.  
  107. end; -- class OUT
  108.  
  109. -------------------------------------------------------------------
  110. external class C_OUT is   
  111.    -- Interface to C functions supporting OUT.
  112.  
  113.    c_out_char(c:CHAR);        -- Print the char `c' on stdout.   
  114.    
  115.    c_out_str(s:STR);        -- Print the string `s' on stdout.
  116.    
  117.    c_out_flush;                -- Flushes internal buffers.
  118.  
  119.    c_out_nstr(n:INT,s:STR);     -- Print `n' characters of the string `s'
  120.                 -- on std out.
  121.  
  122. end; -- external class C_OUT
  123.    
  124. -------------------------------------------------------------------
  125.