diff options
author | Preston Pan <preston@nullring.xyz> | 2024-01-09 22:41:14 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-01-09 22:41:14 -0800 |
commit | 3802eec07ec36a55815468a442add5debbbe7fb6 (patch) | |
tree | 99feb6c9f7147ca2f027338fc79187a95e7083e0 /include | |
parent | 532f0063cb6e1433f275f5685e707fe0025cac50 (diff) |
make shit build; add documentation homepage
Diffstat (limited to 'include')
-rw-r--r-- | include/better_string.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/include/better_string.h b/include/better_string.h index 03bc6f6..a30b7e2 100644 --- a/include/better_string.h +++ b/include/better_string.h @@ -1,28 +1,31 @@ #ifndef BETTER_STRING_H #define BETTER_STRING_H #include <stdlib.h> -/* We want better strings to realloc less and keep track of the length of the +/*! We want better strings to realloc less and keep track of the length of the * string so we don't have to call strlen every time */ + +/*! @brief An array implementation of the string data structure */ typedef struct STRING_STRUCT { - /* length of string */ + /*! length of string */ size_t length; - /* Size of current value buffer */ + /*! Size of current value buffer */ size_t bufsize; + /*! String used for the */ char *value; } string_t; -/* Allocates memory for new string */ +/*! Allocates memory for new string */ string_t *init_string(char *value); -/* Copies string to another string */ +/*! Copies string to another string */ string_t *string_copy(string_t *s); -/* Concatenates a string_t type and a char * type */ +/*! Concatenates a string_t type and a char * type */ void string_concat(string_t *s1, string_t *s2); -/* Appends single characters */ +/*! Appends single characters */ void string_append(string_t *s, char c); -/* Frees space for string */ +/*! Frees space for string */ void string_free(string_t *s); #endif |