Ejemplo n.º 1
0
static cst_string ts_getc(cst_tokenstream *ts)
{
    if (ts->fd)
    {
	ts->current_char = cst_fgetc(ts->fd);
    }
    else if (ts->string_buffer)
    {
	if (ts->string_buffer[ts->file_pos] == '\0')
	    ts->current_char = TS_EOF;
	else
	    ts->current_char = ts->string_buffer[ts->file_pos];
    }
    
    if (ts->current_char != TS_EOF)
	ts->file_pos++;
    if (ts->current_char == '\n')
	ts->line_number++;
    return ts->current_char;
}
Ejemplo n.º 2
0
static unsigned char ts_getc(cst_tokenstream *ts)
{
    if (ts->fd)
    {
#ifndef FLITE_PLUS_HTS_ENGINE
	ts->current_char = cst_fgetc(ts->fd);
#endif /* !FLITE_PLUS_HTS_ENGINE */
    }
    else if (ts->string_buffer)
    {
	if (ts->string_buffer[ts->file_pos] == '\0')
	    ts->current_char = TS_EOF;
	else
	    ts->current_char = ts->string_buffer[ts->file_pos];
    }
    
    if (ts->current_char != TS_EOF)
	ts->file_pos++;
    if (ts->current_char == '\n')
	ts->line_number++;
    return ts->current_char;
}