HTML Tidy  5.8.0
The HTACG Tidy HTML Project
tidybuffio.h File Reference

Detailed Description

Treat buffer as a stream that Tidy can use for I/O operations.

It offers the ability for the buffer to grow as bytes are added, and keeps track of current read and write points.

Author
HTACG, et al (consult git log)
Date
Consult git log.

Go to the source code of this file.

Data Structures

struct  TidyBuffer
 A TidyBuffer is chunk of memory that can be used for multiple I/O purposes within Tidy. More...
 

Functions

void TIDY_CALL tidyBufAlloc (TidyBuffer *buf, uint allocSize)
 Free current buffer, allocate given amount, reset input pointer, use the default allocator. More...
 
void TIDY_CALL tidyBufAllocWithAllocator (TidyBuffer *buf, TidyAllocator *allocator, uint allocSize)
 Free current buffer, allocate given amount, reset input pointer, use the given custom allocator. More...
 
void TIDY_CALL tidyBufAppend (TidyBuffer *buf, void *vp, uint size)
 Append bytes to buffer. More...
 
void TIDY_CALL tidyBufAttach (TidyBuffer *buf, byte *bp, uint size)
 Attach to existing buffer. More...
 
void TIDY_CALL tidyBufCheckAlloc (TidyBuffer *buf, uint allocSize, uint chunkSize)
 Expand buffer to given size. More...
 
void TIDY_CALL tidyBufClear (TidyBuffer *buf)
 Set buffer bytes to 0. More...
 
void TIDY_CALL tidyBufDetach (TidyBuffer *buf)
 Detach from buffer. More...
 
Bool TIDY_CALL tidyBufEndOfInput (TidyBuffer *buf)
 At end of buffer? More...
 
void TIDY_CALL tidyBufFree (TidyBuffer *buf)
 Free current contents and zero out. More...
 
int TIDY_CALL tidyBufGetByte (TidyBuffer *buf)
 Get byte from front of buffer. More...
 
void TIDY_CALL tidyBufInit (TidyBuffer *buf)
 Initialize data structure using the default allocator. More...
 
void TIDY_CALL tidyBufInitWithAllocator (TidyBuffer *buf, TidyAllocator *allocator)
 Initialize data structure using the given custom allocator. More...
 
int TIDY_CALL tidyBufPopByte (TidyBuffer *buf)
 Get byte from end of buffer. More...
 
void TIDY_CALL tidyBufPutByte (TidyBuffer *buf, byte bv)
 Append one byte to buffer. More...
 
void TIDY_CALL tidyBufUngetByte (TidyBuffer *buf, byte bv)
 Put a byte back into the buffer. More...
 
void TIDY_CALL tidyInitInputBuffer (TidyInputSource *inp, TidyBuffer *buf)
 Initialize a buffer input source. More...
 
void TIDY_CALL tidyInitOutputBuffer (TidyOutputSink *outp, TidyBuffer *buf)
 Initialize a buffer output sink. More...
 

Function Documentation

◆ tidyBufAlloc()

void TIDY_CALL tidyBufAlloc ( TidyBuffer *  buf,
uint  allocSize 
)

Free current buffer, allocate given amount, reset input pointer, use the default allocator.

◆ tidyBufAllocWithAllocator()

void TIDY_CALL tidyBufAllocWithAllocator ( TidyBuffer *  buf,
TidyAllocator *  allocator,
uint  allocSize 
)

Free current buffer, allocate given amount, reset input pointer, use the given custom allocator.

◆ tidyBufAppend()

void TIDY_CALL tidyBufAppend ( TidyBuffer *  buf,
void *  vp,
uint  size 
)

Append bytes to buffer.

Expand if necessary.

◆ tidyBufAttach()

void TIDY_CALL tidyBufAttach ( TidyBuffer *  buf,
byte bp,
uint  size 
)

Attach to existing buffer.

◆ tidyBufCheckAlloc()

void TIDY_CALL tidyBufCheckAlloc ( TidyBuffer *  buf,
uint  allocSize,
uint  chunkSize 
)

Expand buffer to given size.

Chunk size is minimum growth. Pass 0 for default of 256 bytes.

◆ tidyBufClear()

void TIDY_CALL tidyBufClear ( TidyBuffer *  buf)

Set buffer bytes to 0.

◆ tidyBufDetach()

void TIDY_CALL tidyBufDetach ( TidyBuffer *  buf)

Detach from buffer.

Caller must free.

◆ tidyBufEndOfInput()

Bool TIDY_CALL tidyBufEndOfInput ( TidyBuffer *  buf)

At end of buffer?

◆ tidyBufFree()

void TIDY_CALL tidyBufFree ( TidyBuffer *  buf)

Free current contents and zero out.

◆ tidyBufGetByte()

int TIDY_CALL tidyBufGetByte ( TidyBuffer *  buf)

Get byte from front of buffer.

Increment input offset.

◆ tidyBufInit()

void TIDY_CALL tidyBufInit ( TidyBuffer *  buf)

Initialize data structure using the default allocator.

◆ tidyBufInitWithAllocator()

void TIDY_CALL tidyBufInitWithAllocator ( TidyBuffer *  buf,
TidyAllocator *  allocator 
)

Initialize data structure using the given custom allocator.

◆ tidyBufPopByte()

int TIDY_CALL tidyBufPopByte ( TidyBuffer *  buf)

Get byte from end of buffer.

◆ tidyBufPutByte()

void TIDY_CALL tidyBufPutByte ( TidyBuffer *  buf,
byte  bv 
)

Append one byte to buffer.

Expand if necessary.

◆ tidyBufUngetByte()

void TIDY_CALL tidyBufUngetByte ( TidyBuffer *  buf,
byte  bv 
)

Put a byte back into the buffer.

Decrement input offset.

◆ tidyInitInputBuffer()

void TIDY_CALL tidyInitInputBuffer ( TidyInputSource inp,
TidyBuffer *  buf 
)

Initialize a buffer input source.

◆ tidyInitOutputBuffer()

void TIDY_CALL tidyInitOutputBuffer ( TidyOutputSink outp,
TidyBuffer *  buf 
)

Initialize a buffer output sink.