32 #define EXTRA_BUFFER_SIZE 4*1048576 // 1M - size of the data chunk stored in memory
33 #define EXTRA_OFFSET_SIZE 4096 // 4K - load new data when less than this is left
35 #define EXTRA_MINIMUM(a,b) (((a) < (b))? (a) : (b))
88 char * pCharsComment,
char * pCharsStop,
char * pCharsClean )
96 pFile = fopen( pFileName,
"rb" );
99 printf(
"Extra_FileReaderAlloc(): Cannot open input file \"%s\".\n", pFileName );
109 for ( pChar = pCharsComment; *pChar; pChar++ )
111 for ( pChar = pCharsStop; *pChar; pChar++ )
113 for ( pChar = pCharsClean; *pChar; pChar++ )
126 RetValue = fread( p->
pBuffer, nCharsToRead, 1, p->
pFile );
220 assert( iToken >= 0 && iToken < p->vTokens->nSize );
221 return p->
vLines->pArray[iToken];
240 if ( vTokens->nSize > 0 )
259 int fTokenStarted, MapValue;
273 for ( pChar = p->
pBufferCur; pChar < p->pBufferEnd; pChar++ )
276 if ( *pChar ==
'\n' )
279 MapValue = p->
pCharMap[(int)*pChar];
287 if ( *pChar !=
'/' || *(pChar+1) ==
'/' )
293 while ( *pChar !=
'\n' )
299 printf(
"Extra_FileReader failed to parse the file \"%s\".\n", p->
pFileName );
308 if ( !fTokenStarted )
339 printf(
"Extra_FileReader failed to parse the file \"%s\".\n", p->
pFileName );
364 int nCharsUsed, nCharsToRead;
377 RetValue = fread( p->
pBuffer + nCharsUsed, nCharsToRead, 1, p->
pFile );
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define ABC_NAMESPACE_IMPL_START
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Vec_IntFree(Vec_Int_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)