#ifndef __BUFFIO_H__
#define __BUFFIO_H__
#include "platform.h"
#include "tidy.h"
#ifdef __cplusplus
extern "C" {
#endif
TIDY_STRUCT
struct _TidyBuffer
{
byte* bp;
uint size;
uint allocated;
uint next;
};
TIDY_EXPORT void TIDY_CALL tidyBufInit( TidyBuffer* buf );
TIDY_EXPORT void TIDY_CALL tidyBufAlloc( TidyBuffer* buf, uint allocSize );
TIDY_EXPORT void TIDY_CALL tidyBufCheckAlloc( TidyBuffer* buf,
uint allocSize, uint chunkSize );
TIDY_EXPORT void TIDY_CALL tidyBufFree( TidyBuffer* buf );
TIDY_EXPORT void TIDY_CALL tidyBufClear( TidyBuffer* buf );
TIDY_EXPORT void TIDY_CALL tidyBufAttach( TidyBuffer* buf, byte* bp, uint size );
TIDY_EXPORT void TIDY_CALL tidyBufDetach( TidyBuffer* buf );
TIDY_EXPORT void TIDY_CALL tidyBufAppend( TidyBuffer* buf, void* vp, uint size );
TIDY_EXPORT void TIDY_CALL tidyBufPutByte( TidyBuffer* buf, byte bv );
TIDY_EXPORT int TIDY_CALL tidyBufPopByte( TidyBuffer* buf );
TIDY_EXPORT int TIDY_CALL tidyBufGetByte( TidyBuffer* buf );
TIDY_EXPORT Bool TIDY_CALL tidyBufEndOfInput( TidyBuffer* buf );
TIDY_EXPORT void TIDY_CALL tidyBufUngetByte( TidyBuffer* buf, byte bv );
TIDY_EXPORT void TIDY_CALL tidyInitInputBuffer( TidyInputSource* inp, TidyBuffer* buf );
TIDY_EXPORT void TIDY_CALL tidyInitOutputBuffer( TidyOutputSink* outp, TidyBuffer* buf );
#ifdef __cplusplus
}
#endif
#endif