#ifndef STR_H #define STR_H #include "util.h" typedef struct str_s str; str *new_str(char *s, NUM size); /* flag non-zero => free the stored character array as well */ void destroy_str(str *s, int flag); /* deliberately expose this struct */ struct str_info_s { NUM value; size_t step; }; typedef struct str_info_s str_info; #define EMPTY_STR_INFO ((str_info) { 0, 1 }) str_info get_info(const str * const restrict s, UNUM n); char *get_data(const str * const restrict s); NUM str_length(const str * const restrict s); void str_set_length(str *s, UNUM size); void change_str_content(str *, char *, NUM); BOOL copy_str(str *dest, str *source); #endif