diff options
Diffstat (limited to 'string-tick.h')
-rw-r--r-- | string-tick.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/string-tick.h b/string-tick.h new file mode 100644 index 000000000000..21e0c0c67e7c --- /dev/null +++ b/string-tick.h @@ -0,0 +1,49 @@ +#ifndef STRING_TICK_H +#define STRING_TICK_H + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +struct string { + char* data; + size_t len; +}; + +typedef struct string String; + +/** + * Creates and returns a STRING + * object with size 1 and no data + * @return STRING object + */ +String* api_string_init(void); + +/** + * Changes letters in a string to lowercase + * @param str the string + */ +void strtolower(char* str); + +/** + * Changes letters in a string to uppercase + * @param str the string + */ +void strtoupper(char* str); + +/** + * Returns the input string, stripped of the given char + * @param string the string to strip the char from + * @param c the char to strip + * @return input string + */ +char* strip_char(char* string, char c); + +/** + * Destroys String object and frees memory + * @param phString the String to destroy + */ +void api_string_destroy(String** phString); + +#endif
\ No newline at end of file |