Functions | |
void | ReAdjustEmptyBuf (StrBuf *Buf, long ThreshHold, long NewSize) |
shrink / increase an _EMPTY_ buffer to NewSize. Buffercontent is thoroughly ignored and flushed. | |
long | StrBufShrinkToFit (StrBuf *Buf, int Force) |
shrink long term buffers to their real size so they don't waste memory | |
StrBuf * | NewStrBuf (void) |
Allocate a new buffer with default buffer size. | |
StrBuf * | NewStrBufDup (const StrBuf *CopyMe) |
Copy Constructor; returns a duplicate of CopyMe. | |
StrBuf * | NewStrBufPlain (const char *ptr, int nChars) |
create a new Buffer using an existing c-string this function should also be used if you want to pre-suggest the buffer size to allocate in conjunction with ptr == NULL | |
int | StrBufPlain (StrBuf *Buf, const char *ptr, int nChars) |
Set an existing buffer from a c-string. | |
StrBuf * | _NewConstStrBuf (const char *StringConstant, size_t SizeOfStrConstant) |
use strbuf as wrapper for a string constant for easy handling | |
int | FlushStrBuf (StrBuf *buf) |
flush the content of a Buf; keep its struct | |
int | FLUSHStrBuf (StrBuf *buf) |
wipe the content of a Buf thoroughly (overwrite it -> expensive); keep its struct | |
void | FreeStrBuf (StrBuf **FreeMe) |
Release a Buffer Its a double pointer, so it can NULL your pointer so fancy SIG11 appear instead of random results. | |
char * | SmashStrBuf (StrBuf **SmashMe) |
flatten a Buffer to the Char * we return Its a double pointer, so it can NULL your pointer so fancy SIG11 appear instead of random results The Callee then owns the buffer and is responsible for freeing it. | |
void | HFreeStrBuf (void *VFreeMe) |
Release the buffer If you want put your StrBuf into a Hash, use this as Destructor. |
StrBuf* _NewConstStrBuf | ( | const char * | StringConstant, | |
size_t | SizeOfStrConstant | |||
) |
use strbuf as wrapper for a string constant for easy handling
StringConstant | a string to wrap | |
SizeOfStrConstant | should be sizeof(StringConstant)-1 |
int FlushStrBuf | ( | StrBuf * | buf | ) |
flush the content of a Buf; keep its struct
buf | Buffer to flush |
int FLUSHStrBuf | ( | StrBuf * | buf | ) |
wipe the content of a Buf thoroughly (overwrite it -> expensive); keep its struct
buf | Buffer to wipe |
void FreeStrBuf | ( | StrBuf ** | FreeMe | ) |
Release a Buffer Its a double pointer, so it can NULL your pointer so fancy SIG11 appear instead of random results.
FreeMe | Pointer Pointer to the buffer to free |
void HFreeStrBuf | ( | void * | VFreeMe | ) |
StrBuf* NewStrBuf | ( | void | ) |
Allocate a new buffer with default buffer size.
Copy Constructor; returns a duplicate of CopyMe.
CopyMe | Buffer to faxmilate |
StrBuf* NewStrBufPlain | ( | const char * | ptr, | |
int | nChars | |||
) |
create a new Buffer using an existing c-string this function should also be used if you want to pre-suggest the buffer size to allocate in conjunction with ptr == NULL
ptr | the c-string to copy; may be NULL to create a blank instance | |
nChars | How many chars should we copy; -1 if we should measure the length ourselves |
void ReAdjustEmptyBuf | ( | StrBuf * | Buf, | |
long | ThreshHold, | |||
long | NewSize | |||
) |
shrink / increase an _EMPTY_ buffer to NewSize. Buffercontent is thoroughly ignored and flushed.
Buf | Buffer to shrink (has to be empty) | |
ThreshHold | if the buffer is bigger then this, its readjusted | |
NewSize | if we Shrink it, how big are we going to be afterwards? |
char* SmashStrBuf | ( | StrBuf ** | SmashMe | ) |
flatten a Buffer to the Char * we return Its a double pointer, so it can NULL your pointer so fancy SIG11 appear instead of random results The Callee then owns the buffer and is responsible for freeing it.
SmashMe | Pointer Pointer to the buffer to release Buf from and free |
int StrBufPlain | ( | StrBuf * | Buf, | |
const char * | ptr, | |||
int | nChars | |||
) |
Set an existing buffer from a c-string.
Buf | buffer to load | |
ptr | c-string to put into | |
nChars | set to -1 if we should work 0-terminated |
long StrBufShrinkToFit | ( | StrBuf * | Buf, | |
int | Force | |||
) |
shrink long term buffers to their real size so they don't waste memory
Buf | buffer to shrink | |
Force | if not set, will just executed if the buffer is much to big; set for lifetime strings |