Lines Matching refs:gs
83 struct gstr gs; in str_new() local
84 gs.s = xmalloc(sizeof(char) * 64); in str_new()
85 gs.len = 64; in str_new()
86 gs.max_width = 0; in str_new()
87 strcpy(gs.s, "\0"); in str_new()
88 return gs; in str_new()
92 void str_free(struct gstr *gs) in str_free() argument
94 if (gs->s) in str_free()
95 free(gs->s); in str_free()
96 gs->s = NULL; in str_free()
97 gs->len = 0; in str_free()
101 void str_append(struct gstr *gs, const char *s) in str_append() argument
105 l = strlen(gs->s) + strlen(s) + 1; in str_append()
106 if (l > gs->len) { in str_append()
107 gs->s = xrealloc(gs->s, l); in str_append()
108 gs->len = l; in str_append()
110 strcat(gs->s, s); in str_append()
115 void str_printf(struct gstr *gs, const char *fmt, ...) in str_printf() argument
121 str_append(gs, s); in str_printf()
126 const char *str_get(struct gstr *gs) in str_get() argument
128 return gs->s; in str_get()