version 1.4, 2003/04/13 18:26:25 |
version 1.5, 2003/04/14 14:33:57 |
|
|
extern int autobuf; |
extern int autobuf; |
extern int sigs; |
extern int sigs; |
extern int secure; |
extern int secure; |
extern constant char helpdata[]; |
|
extern constant int size_helpdata; |
|
extern IFILE curr_ifile; |
extern IFILE curr_ifile; |
#if LOGFILE |
#if LOGFILE |
extern int logfile; |
extern int logfile; |
|
|
bp->data[bp->datasize] = ch_ungotchar; |
bp->data[bp->datasize] = ch_ungotchar; |
n = 1; |
n = 1; |
ch_ungotchar = -1; |
ch_ungotchar = -1; |
} else if (ch_flags & CH_HELPFILE) |
|
{ |
|
bp->data[bp->datasize] = helpdata[ch_fpos]; |
|
n = 1; |
|
} else |
} else |
{ |
{ |
n = iread(ch_file, &bp->data[bp->datasize], |
n = iread(ch_file, &bp->data[bp->datasize], |
|
|
{ |
{ |
if (ignore_eoi) |
if (ignore_eoi) |
return (NULL_POSITION); |
return (NULL_POSITION); |
if (ch_flags & CH_HELPFILE) |
|
return (size_helpdata); |
|
return (ch_fsize); |
return (ch_fsize); |
} |
} |
|
|
|
|
{ |
{ |
int keepstate = FALSE; |
int keepstate = FALSE; |
|
|
if (ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE)) |
if (ch_flags & (CH_CANSEEK|CH_POPENED)) |
{ |
{ |
/* |
/* |
* We can seek or re-open, so we don't need to keep buffers. |
* We can seek or re-open, so we don't need to keep buffers. |
|
|
* But don't really close it if it was opened via popen(), |
* But don't really close it if it was opened via popen(), |
* because pclose() wants to close it. |
* because pclose() wants to close it. |
*/ |
*/ |
if (!(ch_flags & (CH_POPENED|CH_HELPFILE))) |
if (!(ch_flags & CH_POPENED)) |
close(ch_file); |
close(ch_file); |
ch_file = -1; |
ch_file = -1; |
} else |
} else |