Utility to assist with encode and decode operations. More...
Utility to assist with encode and decode operations.
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include "util.h"
Go to the source code of this file.
Data Structures | |
struct | DasBuf |
Little buffer class to handle accumulating string data. More... | |
Functions | |
ErrorCode | DasBuf_initReadOnly (DasBuf *pThis, const char *sBuf, size_t uLen) |
Initialize a read-only buffer than points to an external byte array. | |
int | DasBuf_writeFrom (DasBuf *pThis, FILE *pIn, size_t uLen) |
Add generic data to the buffer from a file. | |
size_t | DasBuf_writeSpace (const DasBuf *pThis) |
Get the remaining write space in the buffer. | |
size_t | DasBuf_readOffset (const DasBuf *pThis) |
Get the offset of the read position. | |
ErrorCode | DasBuf_setReadOffset (DasBuf *pThis, size_t uPos) |
Set the offset of the read position. |
Initialize a read-only buffer than points to an external byte array.
This function re-sets the read point for the buffer.
pThis | the buffer initialize | |
sBuf | an pre-allocated character buffer to receive new data | |
uLen | the length of the pre-allocated buffer |
int DasBuf_writeFrom | ( | DasBuf * | pThis, | |
FILE * | pIn, | |||
size_t | uLen | |||
) |
Add generic data to the buffer from a file.
size_t DasBuf_writeSpace | ( | const DasBuf * | pThis | ) |
Get the remaining write space in the buffer.
pThis | The buffer |
size_t DasBuf_readOffset | ( | const DasBuf * | pThis | ) |
Get the offset of the read position.
pThis | - The buffer to query |