/* XXX - this gets a byte, not a character.  */
int file_getc(FILE_T file)
/* XXX - this gets a byte, not a character.  */
int file_getc(FILE_T file)
{
    unsigned char buf[1];
    int ret;
    if (file->err)
        return -1;
    if (file->have) {
        file->have--;
        file->pos++;
        return *(file->next)++;
    }
    ret = file_read(buf, 1, file);
    return ret < 1 ? -1 : buf[0];
}