Commit aa21961c by Miodrag Milanovic

Support using large liberty files

parent 20f970f5
...@@ -63,7 +63,7 @@ struct Scl_Tree_t_ ...@@ -63,7 +63,7 @@ struct Scl_Tree_t_
{ {
char * pFileName; // input Liberty file name char * pFileName; // input Liberty file name
char * pContents; // file contents char * pContents; // file contents
int nContents; // file size long nContents; // file size
int nLines; // line counter int nLines; // line counter
int nItems; // number of items int nItems; // number of items
int nItermAlloc; // number of items allocated int nItermAlloc; // number of items allocated
...@@ -506,10 +506,10 @@ void Scl_LibertyFixFileName( char * pFileName ) ...@@ -506,10 +506,10 @@ void Scl_LibertyFixFileName( char * pFileName )
if ( *pHead == '>' ) if ( *pHead == '>' )
*pHead = '\\'; *pHead = '\\';
} }
int Scl_LibertyFileSize( char * pFileName ) long Scl_LibertyFileSize( char * pFileName )
{ {
FILE * pFile; FILE * pFile;
int nFileSize; long nFileSize;
pFile = fopen( pFileName, "rb" ); pFile = fopen( pFileName, "rb" );
if ( pFile == NULL ) if ( pFile == NULL )
{ {
...@@ -521,7 +521,7 @@ int Scl_LibertyFileSize( char * pFileName ) ...@@ -521,7 +521,7 @@ int Scl_LibertyFileSize( char * pFileName )
fclose( pFile ); fclose( pFile );
return nFileSize; return nFileSize;
} }
char * Scl_LibertyFileContents( char * pFileName, int nContents ) char * Scl_LibertyFileContents( char * pFileName, long nContents )
{ {
FILE * pFile = fopen( pFileName, "rb" ); FILE * pFile = fopen( pFileName, "rb" );
char * pContents = ABC_ALLOC( char, nContents+1 ); char * pContents = ABC_ALLOC( char, nContents+1 );
...@@ -558,7 +558,7 @@ void Scl_LibertyStringDump( char * pFileName, Vec_Str_t * vStr ) ...@@ -558,7 +558,7 @@ void Scl_LibertyStringDump( char * pFileName, Vec_Str_t * vStr )
Scl_Tree_t * Scl_LibertyStart( char * pFileName ) Scl_Tree_t * Scl_LibertyStart( char * pFileName )
{ {
Scl_Tree_t * p; Scl_Tree_t * p;
int RetValue; long RetValue;
// read the file into the buffer // read the file into the buffer
Scl_LibertyFixFileName( pFileName ); Scl_LibertyFixFileName( pFileName );
RetValue = Scl_LibertyFileSize( pFileName ); RetValue = Scl_LibertyFileSize( pFileName );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment