home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sa104os2.zip / SATHR104.ZIP / SATHER / LIBRARY / ERR.SA < prev    next >
Text File  |  1994-12-22  |  3KB  |  93 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. -- err.sa: Output on stderr.
  9. -------------------------------------------------------------------
  10. class ERR is
  11.       -- Direct access to stderr.
  12.    
  13.    create:SAME is return self end;   
  14.  
  15.    plus(s:STR):SAME is 
  16.       -- Print `s' on stderr and return self.
  17.       C_ERR::c_err_nstr(s.size,s); return self end;
  18.    
  19.    plus(s:STR) is
  20.       -- Print `s' on stderr.
  21.       C_ERR::c_err_nstr(s.size,s) end;      
  22.  
  23.    plus(c:CHAR):SAME is 
  24.       -- Print the character `c' on stderr and return self.
  25.       C_ERR::c_err_char(c); return self end;
  26.  
  27.    plus(c:CHAR) is 
  28.       -- Print the character `c' on stderr.
  29.       C_ERR::c_err_char(c) end;
  30.  
  31.    plus(s:FSTR):SAME is 
  32.       -- Print `s' on stdout and return self.
  33.       C_ERR::c_err_nstr(s.size,s.str); return self end;
  34.    
  35.    plus(s:FSTR) is
  36.       -- Print `s' on stdout.
  37.       C_ERR::c_err_nstr(s.size,s.str) end;      
  38.  
  39.    plus(b:BOOL):SAME is 
  40.       -- Print `b' on stdout and return self.
  41.       C_ERR::c_err_str(b.str); return self end;
  42.    
  43.    plus(b:BOOL) is
  44.       -- Print `b' on stdout.
  45.       C_ERR::c_err_str(b.str) end;      
  46.    
  47.    plus(i:INT):SAME is 
  48.       -- Print `i' on stdout and return self.
  49.       C_ERR::c_err_str(i.str); return self end;
  50.    
  51.    plus(i:INT) is
  52.       -- Print `i' on stdout.
  53.       C_ERR::c_err_str(i.str) end;      
  54.  
  55.    plus(f:FLT):SAME is 
  56.       -- Print `f' on stdout and return self.
  57.       C_ERR::c_err_str(f.str); return self end;
  58.    
  59.    plus(f:FLT) is
  60.       -- Print `f' on stdout.
  61.       C_ERR::c_err_str(f.str) end;      
  62.  
  63.    plus(f:FLTD):SAME is 
  64.       -- Print `f' on stdout and return self.
  65.       C_ERR::c_err_str(f.str); return self end;
  66.    
  67.    plus(f:FLTD) is
  68.       -- Print `f' on stdout.
  69.       C_ERR::c_err_str(f.str) end;      
  70.  
  71.    flush is
  72.       -- Flush buffer.  For ERR, this shouldn't be necessary since
  73.       -- it should be unbuffered.  But you never know.
  74.       C_ERR::c_err_flush end;
  75.  
  76. end; -- class ERR
  77.    
  78. -------------------------------------------------------------------
  79. external class C_ERR is   
  80.    -- Interface to C functions supporting ERR.
  81.    
  82.    c_err_char(c:CHAR);        -- Print the char `c' on stderr.   
  83.    
  84.    c_err_str(s:STR);        -- Print the string `s' on stderr.
  85.  
  86.    c_err_flush;                 -- Flush the output buffer.
  87.    
  88.    c_err_nstr(n:INT,s:STR);   -- Print `n' characters of the string `s' on stderr.
  89.    
  90. end; -- external class C_ERR
  91.  
  92. -------------------------------------------------------------------
  93.