gclib/gcstring.h
author ali <ali@juiblex.co.uk>
Tue Jan 24 23:54:05 2012 +0000 (2012-01-24)
changeset 0 c2f4c0285180
permissions -rw-r--r--
Initial version
     1 #ifndef GC_STRING_H
     2 #define GC_STRING_H
     3 
     4 #include <unistd.h>
     5 #include <gclib/types.h>
     6 
     7 typedef struct {
     8     char *str;
     9     size_t alloc,len;
    10 } String;
    11 
    12 String *string_new(const char *init);
    13 char *string_free(String *string,boolean free_segment);
    14 void string_append_c(String *string,char c);
    15 void string_append_len(String *string,const char *s,ssize_t len);
    16 #define string_append(string,s)		string_append_len(string,s,-1)
    17 
    18 #endif /* GC_STRING_H */