Revert "Add string literal concatenation using ellipses "..." (bug 4261, PR #5)"
This reverts commit 7868767dde.
This commit is contained in:
@@ -146,6 +146,16 @@ void pc_closesrc(void *handle)
|
||||
fclose((FILE*)handle);
|
||||
}
|
||||
|
||||
/* pc_resetsrc()
|
||||
* "position" may only hold a pointer that was previously obtained from
|
||||
* pc_getpossrc()
|
||||
*/
|
||||
void pc_resetsrc(void *handle,void *position)
|
||||
{
|
||||
assert(handle!=NULL);
|
||||
fsetpos((FILE*)handle,(fpos_t *)position);
|
||||
}
|
||||
|
||||
/* pc_readsrc()
|
||||
* Reads a single line from the source file (or up to a maximum number of
|
||||
* characters if the line in the input file is too long).
|
||||
@@ -164,40 +174,12 @@ int pc_writesrc(void *handle,unsigned char *source)
|
||||
return fputs((char*)source,(FILE*)handle) >= 0;
|
||||
}
|
||||
|
||||
#define MAXPOSITIONS 4
|
||||
static fpos_t srcpositions[MAXPOSITIONS];
|
||||
static unsigned char srcposalloc[MAXPOSITIONS];
|
||||
|
||||
void *pc_getpossrc(void *handle,void *position)
|
||||
void *pc_getpossrc(void *handle)
|
||||
{
|
||||
if (position==NULL) {
|
||||
/* allocate a new slot */
|
||||
int i;
|
||||
for (i=0; i<MAXPOSITIONS && srcposalloc[i]!=0; i++)
|
||||
/* nothing */;
|
||||
assert(i<MAXPOSITIONS); /* if not, there is a queue overrun */
|
||||
if (i>=MAXPOSITIONS)
|
||||
return NULL;
|
||||
position=&srcpositions[i];
|
||||
srcposalloc[i]=1;
|
||||
} else {
|
||||
/* use the gived slot */
|
||||
assert((fpos_t*)position>=srcpositions && (fpos_t*)position<srcpositions+sizeof(srcpositions));
|
||||
} /* if */
|
||||
fgetpos((FILE*)handle,(fpos_t*)position);
|
||||
return position;
|
||||
}
|
||||
static fpos_t lastpos; /* may need to have a LIFO stack of such positions */
|
||||
|
||||
/* pc_resetsrc()
|
||||
* "position" may only hold a pointer that was previously obtained from
|
||||
* pc_getpossrc()
|
||||
*/
|
||||
void pc_resetsrc(void *handle,void *position)
|
||||
{
|
||||
assert(handle!=NULL);
|
||||
assert(position!=NULL);
|
||||
fsetpos((FILE*)handle,(fpos_t *)position);
|
||||
/* note: the item is not cleared from the pool */
|
||||
fgetpos((FILE*)handle,&lastpos);
|
||||
return &lastpos;
|
||||
}
|
||||
|
||||
int pc_eofsrc(void *handle)
|
||||
|
||||
Reference in New Issue
Block a user