Lines Matching full:gs
51 struct gstr gs; in str_new() local
52 gs.s = xmalloc(sizeof(char) * 64); in str_new()
53 gs.len = 64; in str_new()
54 gs.max_width = 0; in str_new()
55 strcpy(gs.s, "\0"); in str_new()
56 return gs; in str_new()
60 void str_free(struct gstr *gs) in str_free() argument
62 free(gs->s); in str_free()
63 gs->s = NULL; in str_free()
64 gs->len = 0; in str_free()
68 void str_append(struct gstr *gs, const char *s) in str_append() argument
72 l = strlen(gs->s) + strlen(s) + 1; in str_append()
73 if (l > gs->len) { in str_append()
74 gs->s = xrealloc(gs->s, l); in str_append()
75 gs->len = l; in str_append()
77 strcat(gs->s, s); in str_append()
82 void str_printf(struct gstr *gs, const char *fmt, ...) in str_printf() argument
88 str_append(gs, s); in str_printf()
93 char *str_get(const struct gstr *gs) in str_get() argument
95 return gs->s; in str_get()