Lines Matching refs:string
43 /* buffer pool for allocating string structures */
45 string s[STRALLOC];
51 static string *freed = NULL;
52 static string *s_alloc(void);
53 static void s_simplegrow(string *, size_t);
56 s_free(string *sp)
64 /* allocate a string head */
65 static string *
71 perror("allocating string");
79 /* create a new `short' string */
80 string *
83 string *sp;
88 freed = (string *)(freed->ptr);
95 perror("allocating string");
103 /* grow a string's allocation by at least `incr' bytes */
105 s_simplegrow(string *sp, size_t incr)
122 perror("string:");
130 /* grow a string's allocation */
132 s_grow(string *sp, int c)
139 /* return a string containing a character array (this had better not grow) */
140 string *
143 string *sp = s_alloc();
150 /* return a string containing a copy of the passed char array */
151 string*
154 string *sp;
161 perror("string:");
170 /* convert string to lower case */
172 s_tolower(string *sp)
181 s_skipwhite(string *sp)
187 /* append a char array to a string */
188 string *
189 s_append(string *to, char *from)
202 * Append a logical input sequence into a string. Ignore blank and
208 * string *to; where to put token
211 * Returns a pointer to the string or NULL. Trailing newline is stripped off.
213 string *
214 s_seq_read(FILE *fp, string *to, int lineortoken)
281 string *
282 s_tok(string *from, char *split)
287 string *to = s_new();
300 string *to = s_clone(from);
311 * Append an input line to a string.
313 * Returns a pointer to the string (or NULL).
317 s_read_line(FILE *fp, string *to)
351 s_read_to_eof(FILE *fp, string *to)
381 * Get the next field from a string. The field is delimited by white space,
384 * string *from; string to parse
385 * string *to; where to put parsed token
387 string *
388 s_parse(string *from, string *to)