Lines Matching refs:gs
34 struct gstr gs; in str_new() local
35 gs.s = xmalloc(sizeof(char) * 64); in str_new()
36 gs.len = 64; in str_new()
37 gs.max_width = 0; in str_new()
38 strcpy(gs.s, "\0"); in str_new()
39 return gs; in str_new()
43 void str_free(struct gstr *gs) in str_free() argument
45 if (gs->s) in str_free()
46 free(gs->s); in str_free()
47 gs->s = NULL; in str_free()
48 gs->len = 0; in str_free()
52 void str_append(struct gstr *gs, const char *s) in str_append() argument
56 l = strlen(gs->s) + strlen(s) + 1; in str_append()
57 if (l > gs->len) { in str_append()
58 gs->s = xrealloc(gs->s, l); in str_append()
59 gs->len = l; in str_append()
61 strcat(gs->s, s); in str_append()
66 void str_printf(struct gstr *gs, const char *fmt, ...) in str_printf() argument
72 str_append(gs, s); in str_printf()
77 const char *str_get(struct gstr *gs) in str_get() argument
79 return gs->s; in str_get()