/*------------------------------------------------------------------------------ strings.h - Declaration of a variable length string type Version 1.0 2015-01-30 Brian B. McGuinness ------------------------------------------------------------------------------*/ #ifndef strings_h #define strings_h #include "types.h" typedef struct string { int capacity; // Number of characters allocated int length; // Number of characters currently used, omitting the '\0' at the end character text[0]; // The character string, with '\0' at the end } string; int append_char (string **str, character c); int append_char_array (string **str, character *s); int append_string (string **str, string *s); void clear_string (string *str); string *clone_string (string *str); void delete_string (string *str); character *get_character_array (string *str); string *new_string (); string *new_string_from_array (character *s); int prefix_char (string **str, character c); int string_size (string *str); string *substring (string *str, int start, int end); #endif // ! strings_h