diff options
Diffstat (limited to 'fgetc.c')
-rw-r--r-- | fgetc.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,11 +1,11 @@ /* ########################################################### */ /* This Software is licensed under the GPL licensed Version 2, */ -/* please read http://www.gnu.org/copyleft/gpl.html */ +/* please read http://www.gnu.org/copyleft/gpl.html. */ /* ########################################################### */ -/* ************************************************************************ */ -/* Custom fgetc/ungetc implementation able to unget more than one character */ -/* ************************************************************************ */ +/* ************************************************************************* */ +/* Custom fgetc/ungetc implementation able to unget more than one character. */ +/* ************************************************************************* */ #include <stdio.h> #include "fgetc.h" @@ -17,20 +17,20 @@ enum static char getc_buffer[GETC_BUFF_SIZE] = { '\0' }; -static long next_buffer_pos = 0; /* next free position in the getc buffer */ +static long next_buffer_pos = 0; /* Next free position in the getc buffer. */ -/* ======================================= */ -/* Gets a (possibly pushed-back) character */ -/* ======================================= */ +/* ======================================== */ +/* Gets a (possibly pushed-back) character. */ +/* ======================================== */ int my_fgetc(FILE * input) { return (next_buffer_pos > 0) ? getc_buffer[--next_buffer_pos] : fgetc(input); } -/* ============================== */ -/* Pushes character back on input */ -/* ============================== */ +/* =============================== */ +/* Pushes character back on input. */ +/* =============================== */ void my_ungetc(int c) { |