+/EE312
software design
git clone https://git.julia.blue/+/EE312
acb4676
master
1#ifndef STRING_H 2#define STRING_H 1 3 4#include <stdint.h> 5 6typedef 7struct UTString { 8uint32_t length ;// number of characters before the null terminator 9uint32_t capacity ;// length of the longest string that can be stored 10char * string ;// pointer to the actual string (contains signature after string) 11}UTString ; 12 13UTString * utstrdup (const char * src ); 14uint32_t utstrlen (const UTString * src ); 15UTString * utstrcat (UTString * s ,const char * suffix );// append the suffix to s 16UTString * utstrcpy (UTString * dst ,const char * src );// overwrite dst with src 17void utstrfree (UTString * self ); 18UTString * utstrrealloc (UTString * s ,uint32_t new_capacity ); 19 20#endif /* STRING_H */