#include "gi_buffer.h"
Go to the source code of this file.
Classes | |
| struct | GiString |
Defines | |
| #define | GI_STRBUF(string) (gi_string_buffer ((string))) |
| #define | GI_STRLEN(string) (gi_string_length ((string))) |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT void | gi_string_init (GiString *string) |
| LIBGIFT_EXPORT void | gi_string_initex (GiString *string, char *str, size_t alloc, size_t len, bool can_resize) |
| LIBGIFT_EXPORT void | gi_string_finish (GiString *string) |
| LIBGIFT_EXPORT char * | gi_string_finish_keep (GiString *string) |
| LIBGIFT_EXPORT GiString * | gi_string_new (char *str, size_t alloc, size_t len, bool rok) |
| LIBGIFT_EXPORT void | gi_string_free (GiString *string) |
| LIBGIFT_EXPORT char * | gi_string_free_keep (GiString *string) |
| LIBGIFT_EXPORT char * | gi_string_buffer (GiString *string) |
| LIBGIFT_EXPORT size_t | gi_string_length (GiString *string) |
| LIBGIFT_EXPORT int | gi_string_appendvf (GiString *string, const char *fmt, va_list args) |
| LIBGIFT_EXPORT int | gi_string_appendf (GiString *string, const char *fmt,...) |
| LIBGIFT_EXPORT int | gi_string_append (GiString *string, const char *str) |
| LIBGIFT_EXPORT int | gi_string_appendu (GiString *string, unsigned char *str, size_t len) |
| LIBGIFT_EXPORT int | gi_string_appendc (GiString *string, int c) |
Extremely crude string object. This supports only the most basic string building operations and even those leave a lot to be desired. Please don't expect much from this system.
|
||||||||||||
|
Append a single NUL-terminated string.
|
|
||||||||||||
|
Append a single character value. The supplied character should be unsigned and cast to an int to be passed to this API.
|
|
||||||||||||||||
|
See sprintf. |
|
||||||||||||||||
|
Append a single unsigned non-NUL terminated string.
|
|
||||||||||||||||
|
See vsprintf. |
|
|
Accessor for the underlying string buffer. |
|
|
Release any internally used memory. The object is not nullified and it is up to the caller to avoid further usage. |
|
|
Release all but the internally built string and return it. It is up to the caller to free() the resulting string manually, assuming it was allocated internally. Be careful when mixing usage of this with ::gi_string_setbuf. |
|
|
Destroy an allocated GiString object. All internally used memory will be destroyed as well. |
|
|
Destroy the allocated GiString object, but preserve the internally managed C string. See gi_string_finish_keep for more details. |
|
|
Initialize a string object given a pointer to it's present storage. This produces a blank object ready for use with the rest of the API. |
|
||||||||||||||||||||||||
|
Initialize a string object and manually set the internally managed buffer with another, generally found in the caller's localized scope.
|
|
|
Accessor for the string buffer's length (excluding the NUL, of course). |
|
||||||||||||||||||||
|
Allocates a new dynamic GiString object. Upon success, ::gi_string_setbuf is called with the calling parameters. |
1.3.7