[AD] pack_ungetc

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


While trying to understand the problems related to packfiles, I found this
bit of code in src/file.c:

/* pack_ungetc:
 *  Puts a character back in the file's input buffer.  Added by gfoot for
 *  use in the fgets function; maybe it should be in the API.  It only works
 *  for characters just fetched by pack_getc.
 */
static void pack_ungetc(int ch, PACKFILE *f)
{
   *(--f->buf_pos) = (unsigned char)ch;
   f->buf_size++;
   f->flags &= ~PACKFILE_FLAG_EOF;
}


Should we add it to the API ? It of course has got the limitation described
in the comment, but pack_fseek() also has got its own limitations with
regard to fseek().

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/