|
Compounds |
struct | cstring_t |
| The cstring structure. More...
|
Defines |
#define | CSTRING_VER_MAJOR 3 |
| The major version number of cstring.
|
#define | CSTRING_VER_MINOR 2 |
| The minor version number of cstring.
|
#define | CSTRING_VER_REVISION 1 |
| The revision version number of cstring.
|
#define | CSTRING_VER 0x03020100 |
| The current composite version number of cstring.
|
#define | CSTRING_EXTERN_C extern "C" |
#define | cstring_t_DEFAULT { 0, NULL, 0, 0 } |
| Default initialised value for a cstring_t instance.
|
#define | CSTRING_F_TYPE_MASK (0x003f) |
#define | CSTRING_F_MEMORY_IS_INTERNAL_HEAP (0x0000) |
#define | CSTRING_F_MEMORY_IS_BORROWED (0x0001) |
#define | CSTRING_F_MEMORY_IS_FIXED (0x0002) |
#define | CSTRING_F_MEMORY_IS_READONLY (0x0004) |
#define | CSTRING_F_MEMORY_IS_CONST CSTRING_F_MEMORY_IS_READONLY |
#define | CSTRING_F_ARENA_MASK (0xff00) |
#define | CSTRING_F_USE_REALLOC (0x0000) |
#define | CSTRING_F_USE_WIN32_GLOBAL_MEMORY (0x0100) |
#define | CSTRING_F_USE_WIN32_PROCESSHEAP_MEMORY (0x0200) |
#define | CSTRING_F_USE_WIN32_COM_TASK_MEMORY (0x0400) |
#define | CSTRING_F_USE_CUSTOMARENAFUNCTIONS (0x2000) |
#define | CSTRING_F_CUSTOMARENA_CC_CDECL (0x0000) |
#define | CSTRING_F_CUSTOMARENA_CC_STDCALL (0x0040) |
Typedefs |
typedef enum CSTRING_RC | CSTRING_RC |
typedef cstring_t | cstring_t |
Enumerations |
enum | CSTRING_RC {
CSTRING_RC_SUCCESS = 0,
CSTRING_RC_OUTOFMEMORY,
CSTRING_RC_FIXED,
CSTRING_RC_BORROWED,
CSTRING_RC_READONLY,
CSTRING_RC_INVALIDARENA,
CSTRING_RC_CUSTOMARENANOTSUPPORTED,
CSTRING_RC_EXCEEDFIXEDCAPACITY,
CSTRING_RC_EXCEEDBORROWEDCAPACITY
} |
| The return code type of the cstring API. More...
|
Functions |
char const * | cstring_error (CSTRING_RC rc) |
| Returns a non-NULL nul-terminated character string describing the given error code.
|
CSTRING_RC | cstring_init (struct cstring_t *pcs) |
| Initialises a cstring instance to a default form.
|
CSTRING_RC | cstring_create (struct cstring_t *pcs, char const *s) |
| Creates a cstring instance from a C-style string.
|
CSTRING_RC | cstring_createLen (struct cstring_t *pcs, char const *s, size_t cch) |
| Creates a cstring instance from a fixed number of characters.
|
CSTRING_RC | cstring_createEx (struct cstring_t *pcs, char const *s, size_t flags, void *arena, size_t capacity) |
| Creates a cstring instance with special characteristics from a C-style string.
|
CSTRING_RC | cstring_createLenEx (struct cstring_t *pcs, char const *s, size_t cch, size_t flags, void *arena, size_t capacity) |
| Creates a cstring instance with special characteristics from a fixed number of characters.
|
CSTRING_RC | cstring_destroy (struct cstring_t *pcs) |
| Releases resources and resets the attributes of the cstring instance.
|
CSTRING_RC | cstring_yield (struct cstring_t *pcs, char **ppBuff) |
| Removes the allocated buffer from the cstring instance into a caller supplied pointer.
|
CSTRING_RC | cstring_setCapacity (struct cstring_t *pcs, size_t capacity) |
| Sets the capacity of the cstring instance.
|
CSTRING_RC | cstring_assign (struct cstring_t *pcs, char const *s) |
| Assigns a C-style string to the cstring instance.
|
CSTRING_RC | cstring_assignLen (struct cstring_t *pcs, char const *s, size_t cch) |
| Assigns a fixed number of characters to the cstring instance.
|
CSTRING_RC | cstring_copy (struct cstring_t *pcs, struct cstring_t const *pcsSrc) |
| Copies the contents of one cstring instance to another.
|
CSTRING_RC | cstring_append (struct cstring_t *pcs, char const *s) |
| Appends a C-style string to the cstring instance.
|
CSTRING_RC | cstring_appendLen (struct cstring_t *pcs, char const *s, size_t cch) |
| Appends a fixed number of characters to the cstring instance.
|
CSTRING_RC | cstring_truncate (struct cstring_t *pcs, size_t len) |
| Truncates the cstring instance.
|
CSTRING_RC | cstring_swap (struct cstring_t *pcs1, struct cstring_t *pcs2) |
| Swaps the contents of the two cstring instances.
|