/***********************************************************************
  This file is part of HA, a general purpose file archiver.
  Copyright (C) 1995 Harri Hirvola

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program 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 General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
************************************************************************
	HA I/O routines
***********************************************************************/

#ifndef Included_haio_h
#define Included_haio_h

#include "ha.h"


struct haio
{
	unsigned char *ib,*ob;
	int ibl,ibf,obl,obf;
};

#define getbyte(h) (h->ibl>0?(--(h->ibl),h->ib[(h->ibf)++]):-1)
/* if expansion occours no more data is written into the output buffer */
#define putbyte(h,c) {if(h->obl<h->obf)h->ob[(h->obl)++]=(c);}
#define flush(h)

struct haio *init_io(unsigned char *ibuf, U32B ilen, unsigned char *obuf, U32B olen);
U32B end_io(struct haio *haio);

#endif/* !Included_haio_h */

