-/* Generated by re2c 0.13.4.dev on Mon Mar 24 01:44:05 2008 */
+/* Generated by re2c 0.13.4.dev on Mon Mar 24 14:11:59 2008 */
/* $Id$ */
#include <stdlib.h>
#include <string.h>
{
if(!eof)
{
- uint cnt = tok - bot;
- if(cnt)
+ uint cnt;
+ /* Do not get rid of anything when rFlag is active. Otherwise
+ * get rid of everything that was already handedout. */
+ if (!rFlag)
{
- memmove(bot, tok, top - tok);
- tok = bot;
- ptr -= cnt;
- cursor -= cnt;
- pos -= cnt;
- lim -= cnt;
+ cnt = tok - bot;
+ if (cnt)
+ {
+ memmove(bot, tok, top - tok);
+ tok = bot;
+ ptr -= cnt;
+ cursor -= cnt;
+ pos -= cnt;
+ lim -= cnt;
+ }
}
+ /* In crease buffer size. */
need = MAX(need, BSIZE);
- if(static_cast<uint>(top - lim) < need)
+ if (static_cast<uint>(top - lim) < need)
{
char *buf = new char[(lim - bot) + need];
if (!buf)
delete [] bot;
bot = buf;
}
+ /* Append to buffer. */
in.read(lim, need);
- if((cnt = in.gcount()) != need)
+ if ((cnt = in.gcount()) != need)
{
eof = &lim[cnt];
*eof++ = '\0';
{
if(!eof)
{
- uint cnt = tok - bot;
- if(cnt)
+ uint cnt;
+ /* Do not get rid of anything when rFlag is active. Otherwise
+ * get rid of everything that was already handedout. */
+ if (!rFlag)
{
- memmove(bot, tok, top - tok);
- tok = bot;
- ptr -= cnt;
- cursor -= cnt;
- pos -= cnt;
- lim -= cnt;
+ cnt = tok - bot;
+ if (cnt)
+ {
+ memmove(bot, tok, top - tok);
+ tok = bot;
+ ptr -= cnt;
+ cursor -= cnt;
+ pos -= cnt;
+ lim -= cnt;
+ }
}
+ /* In crease buffer size. */
need = MAX(need, BSIZE);
- if(static_cast<uint>(top - lim) < need)
+ if (static_cast<uint>(top - lim) < need)
{
char *buf = new char[(lim - bot) + need];
if (!buf)
delete [] bot;
bot = buf;
}
+ /* Append to buffer. */
in.read(lim, need);
- if((cnt = in.gcount()) != need)
+ if ((cnt = in.gcount()) != need)
{
eof = &lim[cnt];
*eof++ = '\0';