--
--	Inmos Libraries
--	Copyright (C) 1988, 1989, 1990, 1991, 1993  Inmos Limited
--
--	This library is free software; you can redistribute it and/or
--	modify it under the terms of the GNU Lesser General Public
--	License as published by the Free Software Foundation; either
--	version 2 of the License, or (at your option) any later version.
--
--	This library is distributed in the hope that it will be useful,
--	but WITHOUT ANY WARRANTY; without even the implied warranty of
--	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--	Lesser General Public License for more details.
--
--	You should have received a copy of the GNU Lesser General Public
--	License along with this library; if not, write to the Free Software
--	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
--

--** @module hostio

#COMMENT "Host i/o library, V1.00, 10/03/89"
#COMMENT "(c) Copyright INMOS Limited 1989"
#COMMENT "KROC simplified version 1995"
#PRAGMA EXTERNAL "PROC C.fflush (INT result, VAL INT32 handle)  = 0 "
#INCLUDE "hostio.inc"
#INCLUDE "unixerrs.inc"
--{{{  sp.flush
--* Flush the specified output stream.
--
-- To flush means to write out any internally buffered data to the
-- stream that it is associated with. The stream remains open.
--
-- @param fs from server
-- @param ts to server
-- @param streamid the identification number of the open stream to be
--   flushed
-- @param result equal to spr.ok stream successfully flushed; otherwise
--   >= spr.operation.failed - see hostio.inc or iserver documentation
--   for further details
PROC sp.flush (CHAN OF SP fs, ts, VAL INT32 streamid, BYTE result)
  --{{{  more info
  --           This routine is unnecessary for streamid = spid.stdout ( standard
  --           output ) since this stream is always flushed automatically.
  --}}}  

  --{{{  Call Unix
  INT res:
  SEQ
    C.fflush (res, streamid)
    IF
      res = 0
        result := spr.ok
      res = Unix.INVALID.HANDLE
        result := spr.invalid.streamid
      TRUE
        result := spr.operation.failed
  --}}}  
:
--}}}  sp.flush
--{{{  so.flush
PROC so.flush (CHAN OF SP fs, ts, VAL INT32 streamid, BYTE result)

  sp.flush (fs, ts, streamid, result)
:
--}}}  so.flush
