00001 #ifndef __BUFFIO_H__
00002 #define __BUFFIO_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "platform.h"
00021 #include "tidy.h"
00022
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026
00027
00028 TIDY_STRUCT
00029 struct _TidyBuffer
00030 {
00031 byte* bp;
00032 uint size;
00033 uint allocated;
00034 uint next;
00035 };
00036
00037
00038 TIDY_EXPORT void TIDY_CALL tidyBufInit( TidyBuffer* buf );
00039
00040
00041 TIDY_EXPORT void TIDY_CALL tidyBufAlloc( TidyBuffer* buf, uint allocSize );
00042
00043
00044
00045
00046 TIDY_EXPORT void TIDY_CALL tidyBufCheckAlloc( TidyBuffer* buf,
00047 uint allocSize, uint chunkSize );
00048
00049
00050 TIDY_EXPORT void TIDY_CALL tidyBufFree( TidyBuffer* buf );
00051
00052
00053 TIDY_EXPORT void TIDY_CALL tidyBufClear( TidyBuffer* buf );
00054
00055
00056 TIDY_EXPORT void TIDY_CALL tidyBufAttach( TidyBuffer* buf, byte* bp, uint size );
00057
00058
00059 TIDY_EXPORT void TIDY_CALL tidyBufDetach( TidyBuffer* buf );
00060
00061
00062
00063 TIDY_EXPORT void TIDY_CALL tidyBufAppend( TidyBuffer* buf, void* vp, uint size );
00064
00065
00066 TIDY_EXPORT void TIDY_CALL tidyBufPutByte( TidyBuffer* buf, byte bv );
00067
00068
00069 TIDY_EXPORT int TIDY_CALL tidyBufPopByte( TidyBuffer* buf );
00070
00071
00072
00073 TIDY_EXPORT int TIDY_CALL tidyBufGetByte( TidyBuffer* buf );
00074
00075
00076 TIDY_EXPORT Bool TIDY_CALL tidyBufEndOfInput( TidyBuffer* buf );
00077
00078
00079 TIDY_EXPORT void TIDY_CALL tidyBufUngetByte( TidyBuffer* buf, byte bv );
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 TIDY_EXPORT void TIDY_CALL initInputBuffer( TidyInputSource* inp, TidyBuffer* buf );
00091
00092
00093 TIDY_EXPORT void TIDY_CALL initOutputBuffer( TidyOutputSink* outp, TidyBuffer* buf );
00094
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098 #endif