state = 0; t = t_too_long;
newtokbufsize = p->size + TOKEN_LENGTH_INCREMENT; newtokbuf = realloc(p->tokbuf, newtokbufsize); fprintf(stderr, "realloc(%p, %d) = %p\n", p->tokbuf, newtokbufsize, newtokbuf); if (newtokbuf == 0) { state = 0; t = e_memory; } else { p->size = newtokbufsize; p->tokbuf = newtokbuf; p->tokbuf[i++] = c; }
static const char *gettoken(struct configuration *p){	int c;	char w;	size_t i;	char state;	const char *t;	i = 0;	state = 1;	t = e_help;	do {		w = 0;		if ((c = getc(p->config_file)) == EOF) {			state = 0;			t = t_eof;		} else if (c == '\n')			++p->line;		switch (state) {		case 1:			switch (c) {			case ' ':			case '\t':			case '\r':			case '\n':				break;			case '#':				state = 2;				break;			case '{':				t = t_open;				w = 1;				state = 0;				break;			case '}':				t = t_close;				w = 1;				state = 0;				break;			case '"':				t = t_string;				state = 3;				break;			default:				t = t_string;				w = 1;				state = 4;				break;			}			break;		case 2:			if (c == '\n')				state = 1;			break;		case 3:			if (c == '\\')				state = 5;			else if (c == '"')				state = 0;			else				w = 1;			break;		case 4:			switch (c) {			case ' ':			case '\t':			case '\r':			case '\n':				state = 0;				break;			case '#':			case '"':			case '{':			case '}':				ungetc(c, p->config_file);				state = 0;				break;			default:				w = 1;				break;			}			break;		case 5:			w = 1;			state = 3;			break;		}		if (w) {			if (i + 1 < p->size)				p->tokbuf[i++] = c;			else {				state = 0;				t = t_too_long;			}		}	} while (state);	p->tokbuf[i] = 0;	return t;}