public static bool rgc_buffer_insert_char(input_port p, int c)
{
rgc_buffer_reserve_space(p, 1);
int matchstop = p.matchstop;
p.buffer[matchstop - 1] = (byte) c;
if ( p.filepos > 0 )
p.filepos--;
else
p.filepos = 0;
p.matchstop--;
p.forward = p.matchstop;
p.matchstart = p.matchstop;
return true;
}