ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
extraUtilFile.c
Go to the documentation of this file.
1
20
21#ifdef WIN32
22#include <windows.h>
23#define PATH_MAX MAX_PATH
24#else
25#include <limits.h>
26#endif
27
28#include "extra.h"
29
31
32
33/*---------------------------------------------------------------------------*/
34/* Constant declarations */
35/*---------------------------------------------------------------------------*/
36
37/*---------------------------------------------------------------------------*/
38/* Stucture declarations */
39/*---------------------------------------------------------------------------*/
40
41/*---------------------------------------------------------------------------*/
42/* Type declarations */
43/*---------------------------------------------------------------------------*/
44
45/*---------------------------------------------------------------------------*/
46/* Variable declarations */
47/*---------------------------------------------------------------------------*/
48
49/*---------------------------------------------------------------------------*/
50/* Macro declarations */
51/*---------------------------------------------------------------------------*/
52
53
55
56/*---------------------------------------------------------------------------*/
57/* Static function prototypes */
58/*---------------------------------------------------------------------------*/
59
61
62
63/*---------------------------------------------------------------------------*/
64/* Definition of exported functions */
65/*---------------------------------------------------------------------------*/
66
78char * Extra_FileGetSimilarName( char * pFileNameWrong, char * pS1, char * pS2, char * pS3, char * pS4, char * pS5 )
79{
80 FILE * pFile;
81 char * pFileNameOther;
82 char * pFileGen;
83
84 if ( pS1 == NULL )
85 return NULL;
86
87 // get the generic file name
88 pFileGen = Extra_FileNameGeneric( pFileNameWrong );
89 pFileNameOther = Extra_FileNameAppend( pFileGen, pS1 );
90 pFile = fopen( pFileNameOther, "r" );
91 if ( pFile == NULL && pS2 )
92 { // try one more
93 pFileNameOther = Extra_FileNameAppend( pFileGen, pS2 );
94 pFile = fopen( pFileNameOther, "r" );
95 if ( pFile == NULL && pS3 )
96 { // try one more
97 pFileNameOther = Extra_FileNameAppend( pFileGen, pS3 );
98 pFile = fopen( pFileNameOther, "r" );
99 if ( pFile == NULL && pS4 )
100 { // try one more
101 pFileNameOther = Extra_FileNameAppend( pFileGen, pS4 );
102 pFile = fopen( pFileNameOther, "r" );
103 if ( pFile == NULL && pS5 )
104 { // try one more
105 pFileNameOther = Extra_FileNameAppend( pFileGen, pS5 );
106 pFile = fopen( pFileNameOther, "r" );
107 }
108 }
109 }
110 }
111 ABC_FREE( pFileGen );
112 if ( pFile )
113 {
114 fclose( pFile );
115 return pFileNameOther;
116 }
117 // did not find :(
118 return NULL;
119}
120
132char * Extra_FileNameExtension( char * FileName )
133{
134 char * pDot;
135 // find the last "dot" in the file name, if it is present
136 for ( pDot = FileName + strlen(FileName)-1; pDot >= FileName; pDot-- )
137 if ( *pDot == '.' )
138 return pDot + 1;
139 return FileName;
140}
141
153char * Extra_FileNameAppend( char * pBase, char * pSuffix )
154{
155 static char Buffer[500];
156 assert( strlen(pBase) + strlen(pSuffix) < 500 );
157 sprintf( Buffer, "%s%s", pBase, pSuffix );
158 return Buffer;
159}
160
172char * Extra_FileNameGeneric( char * FileName )
173{
174 char * pDot, * pRes;
175 pRes = Extra_UtilStrsav( FileName );
176 if ( (pDot = strrchr( pRes, '.' )) )
177 *pDot = 0;
178 return pRes;
179}
180
192char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
193{
194 static char Buffer[PATH_MAX];
195 char * pDot;
196 assert( strlen(pBase) + strlen(pSuffix) < PATH_MAX );
197 strcpy( Buffer, pBase );
198 if ( (pDot = strrchr( Buffer, '.' )) )
199 *pDot = 0;
200 strcat( Buffer, pSuffix );
201 return Buffer;
202}
203
215void Extra_FileNameCorrectPath( char * FileName )
216{
217 char * pStart;
218 if ( FileName )
219 for ( pStart = FileName; *pStart; pStart++ )
220 if ( *pStart == '>' || *pStart == '\\' )
221 *pStart = '/';
222}
223
235char * Extra_FileNameWithoutPath( char * FileName )
236{
237 char * pRes;
238 for ( pRes = FileName + strlen(FileName) - 1; pRes >= FileName; pRes-- )
239 if ( *pRes == '\\' || *pRes == '/' )
240 return pRes + 1;
241 return FileName;
242}
243char * Extra_FilePathWithoutName( char * FileName )
244{
245 char * pRes;
246 FileName = Abc_UtilStrsav( FileName );
247 for ( pRes = FileName + strlen(FileName) - 1; pRes >= FileName; pRes-- )
248 if ( *pRes == '\\' || *pRes == '/' )
249 {
250 pRes[1] = '\0';
251 Extra_FileNameCorrectPath( FileName );
252 return FileName;
253 }
254 ABC_FREE( FileName );
255 return NULL;
256}
257char * Extra_FileInTheSameDir( char * pPathFile, char * pFileName )
258{
259 static char pBuffer[1000]; char * pThis;
260 assert( strlen(pPathFile) + strlen(pFileName) < 990 );
261 memmove( pBuffer, pPathFile, strlen(pPathFile) );
262 for ( pThis = pBuffer + strlen(pPathFile) - 1; pThis >= pBuffer; pThis-- )
263 if ( *pThis == '\\' || *pThis == '/' )
264 break;
265 memmove( ++pThis, pFileName, strlen(pFileName) );
266 pThis[strlen(pFileName)] = '\0';
267 return pBuffer;
268}
269char * Extra_FileDesignName( char * pFileName )
270{
271 char * pBeg, * pEnd, * pStore, * pCur;
272 // find the first dot
273 for ( pEnd = pFileName; *pEnd; pEnd++ )
274 if ( *pEnd == '.' )
275 break;
276 // find the first char
277 for ( pBeg = pEnd - 1; pBeg >= pFileName; pBeg-- )
278 if ( !((*pBeg >= 'a' && *pBeg <= 'z') || (*pBeg >= 'A' && *pBeg <= 'Z') || (*pBeg >= '0' && *pBeg <= '9') || *pBeg == '_') )
279 break;
280 pBeg++;
281 // fill up storage
282 pStore = ABC_ALLOC( char, pEnd - pBeg + 1 );
283 for ( pCur = pStore; pBeg < pEnd; pBeg++, pCur++ )
284 *pCur = *pBeg;
285 *pCur = 0;
286 return pStore;
287}
288
300int Extra_FileCheck( char * pFileName )
301{
302 FILE * pFile;
303 pFile = fopen( pFileName, "rb" );
304 if ( pFile == NULL )
305 {
306 printf( "Extra_FileCheck(): File \"%s\" does not exist.\n", pFileName );
307 return 0;
308 }
309 fseek( pFile, 0, SEEK_END );
310 if ( ftell( pFile ) == 0 )
311 printf( "Extra_FileCheck(): File \"%s\" is empty.\n", pFileName );
312 fclose( pFile );
313 return 1;
314}
315
327int Extra_FileSize( char * pFileName )
328{
329 FILE * pFile;
330 int nFileSize;
331 pFile = fopen( pFileName, "rb" );
332 if ( pFile == NULL )
333 {
334 printf( "Extra_FileSize(): The file is unavailable (absent or open).\n" );
335 return 0;
336 }
337 fseek( pFile, 0, SEEK_END );
338 nFileSize = ftell( pFile );
339 fclose( pFile );
340 return nFileSize;
341}
342
343
355char * Extra_FileRead( FILE * pFile )
356{
357 int nFileSize;
358 char * pBuffer;
359 int RetValue;
360 // get the file size, in bytes
361 fseek( pFile, 0, SEEK_END );
362 nFileSize = ftell( pFile );
363 // move the file current reading position to the beginning
364 rewind( pFile );
365 // load the contents of the file into memory
366 pBuffer = ABC_ALLOC( char, nFileSize + 3 );
367 RetValue = fread( pBuffer, nFileSize, 1, pFile );
368 // terminate the string with '\0'
369 pBuffer[ nFileSize + 0] = '\n';
370 pBuffer[ nFileSize + 1] = '\0';
371 return pBuffer;
372}
373char * Extra_FileRead2( FILE * pFile, FILE * pFile2 )
374{
375 char * pBuffer;
376 int nSize, nSize2;
377 int RetValue;
378 // get the file size, in bytes
379 fseek( pFile, 0, SEEK_END );
380 nSize = ftell( pFile );
381 rewind( pFile );
382 // get the file size, in bytes
383 fseek( pFile2, 0, SEEK_END );
384 nSize2 = ftell( pFile2 );
385 rewind( pFile2 );
386 // load the contents of the file into memory
387 pBuffer = ABC_ALLOC( char, nSize + nSize2 + 3 );
388 RetValue = fread( pBuffer, nSize, 1, pFile );
389 RetValue = fread( pBuffer + nSize, nSize2, 1, pFile2 );
390 // terminate the string with '\0'
391 pBuffer[ nSize + nSize2 + 0] = '\n';
392 pBuffer[ nSize + nSize2 + 1] = '\0';
393 return pBuffer;
394}
395
407char * Extra_FileReadContents( char * pFileName )
408{
409 FILE * pFile;
410 char * pBuffer;
411 pFile = fopen( pFileName, "rb" );
412 pBuffer = pFile ? Extra_FileRead( pFile ) : NULL;
413 if ( pFile ) fclose( pFile );
414 return pBuffer;
415}
416char * Extra_FileReadContents2( char * pFileName, char * pFileName2 )
417{
418 FILE * pFile, * pFile2;
419 char * pBuffer;
420 pFile = fopen( pFileName, "rb" );
421 pFile2 = fopen( pFileName2, "rb" );
422 pBuffer = (pFile && pFile2) ? Extra_FileRead2( pFile, pFile2 ) : NULL;
423 if ( pFile ) fclose( pFile );
424 if ( pFile2 ) fclose( pFile2 );
425 return pBuffer;
426}
427
439int Extra_FileIsType( char * pFileName, char * pS1, char * pS2, char * pS3 )
440{
441 int lenS, lenF = strlen(pFileName);
442 lenS = pS1 ? strlen(pS1) : 0;
443 if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS1, lenS ) )
444 return 1;
445 lenS = pS2 ? strlen(pS2) : 0;
446 if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS2, lenS ) )
447 return 1;
448 lenS = pS3 ? strlen(pS3) : 0;
449 if ( lenS && lenF > lenS && !strncmp( pFileName+lenF-lenS, pS3, lenS ) )
450 return 1;
451 return 0;
452}
453
466{
467 static char Buffer[100];
468 char * TimeStamp;
469 time_t ltime;
470 // get the current time
471 time( &ltime );
472 TimeStamp = asctime( localtime( &ltime ) );
473 TimeStamp[ strlen(TimeStamp) - 1 ] = 0;
474 strcpy( Buffer, TimeStamp );
475 return Buffer;
476}
477
489unsigned Extra_ReadBinary( char * Buffer )
490{
491 unsigned Result;
492 int i;
493
494 Result = 0;
495 for ( i = 0; Buffer[i]; i++ )
496 if ( Buffer[i] == '0' || Buffer[i] == '1' )
497 Result = Result * 2 + Buffer[i] - '0';
498 else
499 {
500 assert( 0 );
501 }
502 return Result;
503}
504
516void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits )
517{
518 int i;
519 for ( i = nBits-1; i >= 0; i-- )
520 fprintf( pFile, "%c", '0' + Abc_InfoHasBit(Sign, i) );
521// fprintf( pFile, "\n" );
522}
523void Extra_PrintBinary2( FILE * pFile, unsigned Sign[], int nBits )
524{
525 int i;
526 for ( i = 0; i < nBits; i++ )
527 fprintf( pFile, "%c", '0' + Abc_InfoHasBit(Sign, i) );
528// fprintf( pFile, "\n" );
529}
530
542int Extra_ReadHex( unsigned Sign[], char * pString, int nDigits )
543{
544 int Digit, k, c;
545 for ( k = 0; k < nDigits; k++ )
546 {
547 c = nDigits-1-k;
548 if ( pString[c] >= '0' && pString[c] <= '9' )
549 Digit = pString[c] - '0';
550 else if ( pString[c] >= 'A' && pString[c] <= 'F' )
551 Digit = pString[c] - 'A' + 10;
552 else if ( pString[c] >= 'a' && pString[c] <= 'f' )
553 Digit = pString[c] - 'a' + 10;
554 else { assert( 0 ); return 0; }
555 Sign[k/8] |= ( (Digit & 15) << ((k%8) * 4) );
556 }
557 return 1;
558}
559int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars )
560{
561 int nWords, nDigits, k;
562 nWords = Extra_TruthWordNum( nVars );
563 for ( k = 0; k < nWords; k++ )
564 Sign[k] = 0;
565 // read the number from the string
566 nDigits = (1 << nVars) / 4;
567 if ( nDigits == 0 )
568 nDigits = 1;
569 Extra_ReadHex( Sign, pString, nDigits );
570 return 1;
571}
572
584void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars )
585{
586 int nDigits, Digit, k;
587 // write the number into the file
588 nDigits = (1 << nVars) / 4;
589 for ( k = nDigits - 1; k >= 0; k-- )
590 {
591 Digit = ((Sign[k/8] >> ((k%8) * 4)) & 15);
592 if ( Digit < 10 )
593 fprintf( pFile, "%d", Digit );
594 else
595 fprintf( pFile, "%c", 'a' + Digit-10 );
596 }
597// fprintf( pFile, "\n" );
598}
599
611void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars )
612{
613 int nDigits, Digit, k;
614 if ( nVars == 0 && !(Sign[0] & 1) ) { sprintf(pString, "0"); return; } // const0
615 if ( nVars == 0 && (Sign[0] & 1) ) { sprintf(pString, "1"); return; } // const1
616 if ( nVars == 1 && (Sign[0] & 1) ) { sprintf(pString, "1"); return; } // inverter
617 if ( nVars == 1 && !(Sign[0] & 1) ) { sprintf(pString, "2"); return; } // buffer
618 // write the number into the file
619 nDigits = (1 << nVars) / 4;
620 for ( k = nDigits - 1; k >= 0; k-- )
621 {
622 Digit = ((Sign[k/8] >> ((k%8) * 4)) & 15);
623 if ( Digit < 10 )
624 *pString++ = '0' + Digit;
625 else
626 *pString++ = 'a' + Digit-10;
627 }
628// fprintf( pFile, "\n" );
629 *pString = 0;
630}
631
643void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars )
644{
645 int nMints, nDigits, Digit, k;
646
647 // write the number into the file
648 fprintf( pFile, "0x" );
649 nMints = (1 << nVars);
650 nDigits = nMints / 4 + ((nMints % 4) > 0);
651 for ( k = nDigits - 1; k >= 0; k-- )
652 {
653 Digit = ((pTruth[k/8] >> (k * 4)) & 15);
654 if ( Digit < 10 )
655 fprintf( pFile, "%d", Digit );
656 else
657 fprintf( pFile, "%c", 'A' + Digit-10 );
658 }
659// fprintf( pFile, "\n" );
660}
661void Extra_PrintHex2( FILE * pFile, unsigned * pTruth, int nVars )
662{
663 int nMints, nDigits, Digit, k;
664
665 // write the number into the file
666 //fprintf( pFile, "0x" );
667 nMints = (1 << nVars);
668 nDigits = nMints / 4 + ((nMints % 4) > 0);
669 for ( k = nDigits - 1; k >= 0; k-- )
670 {
671 Digit = ((pTruth[k/8] >> (k * 4)) & 15);
672 if ( Digit < 10 )
673 fprintf( pFile, "%d", Digit );
674 else
675 fprintf( pFile, "%c", 'A' + Digit-10 );
676 }
677// fprintf( pFile, "\n" );
678}
679void Extra_PrintHexReverse( FILE * pFile, unsigned * pTruth, int nVars )
680{
681 int nMints, nDigits, Digit, k;
682
683 // write the number into the file
684 fprintf( pFile, "0x" );
685 nMints = (1 << nVars);
686 nDigits = nMints / 4 + ((nMints % 4) > 0);
687 for ( k = 0; k < nDigits; k++ )
688 {
689 Digit = ((pTruth[k/8] >> (k * 4)) & 15);
690 if ( Digit < 10 )
691 fprintf( pFile, "%d", Digit );
692 else
693 fprintf( pFile, "%c", 'A' + Digit-10 );
694 }
695// fprintf( pFile, "\n" );
696}
697
709void Extra_PrintSymbols( FILE * pFile, char Char, int nTimes, int fPrintNewLine )
710{
711 int i;
712 for ( i = 0; i < nTimes; i++ )
713 printf( "%c", Char );
714 if ( fPrintNewLine )
715 printf( "\n" );
716}
717
731char * Extra_StringAppend( char * pStrGiven, char * pStrAdd )
732{
733 char * pTemp;
734 if ( pStrGiven )
735 {
736 pTemp = ABC_ALLOC( char, strlen(pStrGiven) + strlen(pStrAdd) + 2 );
737 sprintf( pTemp, "%s%s", pStrGiven, pStrAdd );
738 ABC_FREE( pStrGiven );
739 }
740 else
741 pTemp = Extra_UtilStrsav( pStrAdd );
742 return pTemp;
743}
744
756void Extra_StringClean( char * pStrGiven, char * pCharKeep )
757{
758 char * pTemp, * pChar, * pSave = pStrGiven;
759 for ( pTemp = pStrGiven; *pTemp; pTemp++ )
760 {
761 for ( pChar = pCharKeep; *pChar; pChar++ )
762 if ( *pTemp == *pChar )
763 break;
764 if ( *pChar == 0 )
765 continue;
766 *pSave++ = *pTemp;
767 }
768 *pSave = 0;
769}
770
782int Extra_StringCompare( const char * pp1, const char * pp2 )
783{
784 return strcmp(*(char **)pp1, *(char **)pp2);
785}
786
798void Extra_FileSort( char * pFileName, char * pFileNameOut )
799{
800 FILE * pFile;
801 char * pContents;
802 char ** pLines;
803 int i, nLines, Begin;
804 pFile = fopen( pFileName, "rb" );
805 if ( pFile == NULL )
806 {
807 printf( "Extra_FileSort(): Cannot open file \"%s\".\n", pFileName );
808 return;
809 }
810 pContents = Extra_FileRead( pFile );
811 fclose( pFile );
812 if ( pContents == NULL )
813 {
814 printf( "Extra_FileSort(): Cannot read contents of file \"%s\".\n", pFileName );
815 return;
816 }
817 // count end of lines
818 for ( nLines = 0, i = 0; pContents[i]; i++ )
819 nLines += (pContents[i] == '\n');
820 // break the file into lines
821 pLines = (char **)malloc( sizeof(char *) * nLines );
822 Begin = 0;
823 for ( nLines = 0, i = 0; pContents[i]; i++ )
824 if ( pContents[i] == '\n' )
825 {
826 pContents[i] = 0;
827 pLines[nLines++] = pContents + Begin;
828 Begin = i + 1;
829 }
830 // sort the lines
831 qsort( pLines, (size_t)nLines, sizeof(char *), (int(*)(const void *,const void *))Extra_StringCompare );
832 // write a new file
833 pFile = fopen( pFileNameOut, "wb" );
834 for ( i = 0; i < nLines; i++ )
835 if ( pLines[i][0] )
836 fprintf( pFile, "%s\n", pLines[i] );
837 fclose( pFile );
838 // cleanup
839 free( pLines );
840 free( pContents );
841 // report the result
842 printf( "The file after sorting is \"%s\".\n", pFileNameOut );
843}
844
845
857void Extra_FileLineNumAdd( char * pFileName, char * pFileNameOut )
858{
859 char Buffer[1000];
860 FILE * pFile;
861 FILE * pFile2;
862 int iLine;
863 pFile = fopen( pFileName, "rb" );
864 if ( pFile == NULL )
865 {
866 printf( "Extra_FileLineNumAdd(): Cannot open file \"%s\".\n", pFileName );
867 return;
868 }
869 pFile2 = fopen( pFileNameOut, "wb" );
870 if ( pFile2 == NULL )
871 {
872 fclose( pFile );
873 printf( "Extra_FileLineNumAdd(): Cannot open file \"%s\".\n", pFileNameOut );
874 return;
875 }
876 for ( iLine = 0; fgets( Buffer, 1000, pFile ); iLine++ )
877 {
878 sprintf( Buffer + strlen(Buffer) - 2, "%03d\n%c", iLine, 0 );
879 fputs( Buffer, pFile2 );
880 }
881 fclose( pFile );
882 fclose( pFile2 );
883 // report the result
884 printf( "The resulting file is \"%s\".\n", pFileNameOut );
885}
886
898/*
899int main( int argc, char ** argv )
900{
901 if ( argc == 2 )
902 Extra_FileSort( argv[1], Extra_FileNameAppend(argv[1], "_sorted") );
903 else
904 printf( "%s: Wrong number of command line arguments.\n", argv[0] );
905 return 1;
906}
907*/
908
909/*---------------------------------------------------------------------------*/
910/* Definition of internal functions */
911/*---------------------------------------------------------------------------*/
912
913/*---------------------------------------------------------------------------*/
914/* Definition of static Functions */
915/*---------------------------------------------------------------------------*/
916
917
921
922
924
int nWords
Definition abcNpn.c:127
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
char Char
int Extra_FileSize(char *pFileName)
void Extra_PrintBinary2(FILE *pFile, unsigned Sign[], int nBits)
char * Extra_FilePathWithoutName(char *FileName)
void Extra_PrintSymbols(FILE *pFile, char Char, int nTimes, int fPrintNewLine)
int Extra_ReadHex(unsigned Sign[], char *pString, int nDigits)
char * Extra_FileNameWithoutPath(char *FileName)
void Extra_PrintHex(FILE *pFile, unsigned *pTruth, int nVars)
unsigned Extra_ReadBinary(char *Buffer)
void Extra_FileSort(char *pFileName, char *pFileNameOut)
void Extra_FileLineNumAdd(char *pFileName, char *pFileNameOut)
char * Extra_FileDesignName(char *pFileName)
int Extra_ReadHexadecimal(unsigned Sign[], char *pString, int nVars)
void Extra_PrintHexadecimal(FILE *pFile, unsigned Sign[], int nVars)
char * Extra_StringAppend(char *pStrGiven, char *pStrAdd)
char * Extra_TimeStamp()
int Extra_FileCheck(char *pFileName)
char * Extra_FileRead2(FILE *pFile, FILE *pFile2)
void Extra_PrintHexReverse(FILE *pFile, unsigned *pTruth, int nVars)
char * Extra_FileInTheSameDir(char *pPathFile, char *pFileName)
char * Extra_FileReadContents2(char *pFileName, char *pFileName2)
char * Extra_FileNameAppend(char *pBase, char *pSuffix)
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
DECLARATIONS ///.
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
void Extra_PrintHex2(FILE *pFile, unsigned *pTruth, int nVars)
void Extra_StringClean(char *pStrGiven, char *pCharKeep)
int Extra_StringCompare(const char *pp1, const char *pp2)
char * Extra_FileReadContents(char *pFileName)
char * Extra_FileNameExtension(char *FileName)
char * Extra_FileNameGeneric(char *FileName)
void Extra_PrintHexadecimalString(char *pString, unsigned Sign[], int nVars)
ABC_NAMESPACE_IMPL_START char * Extra_FileGetSimilarName(char *pFileNameWrong, char *pS1, char *pS2, char *pS3, char *pS4, char *pS5)
char * Extra_FileRead(FILE *pFile)
int Extra_FileIsType(char *pFileName, char *pS1, char *pS2, char *pS3)
void Extra_FileNameCorrectPath(char *FileName)
char * Extra_UtilStrsav(const char *s)
#define assert(ex)
Definition util_old.h:213
int strncmp()
char * strrchr()
int strlen()
int strcmp()
char * sprintf()
char * memmove()
char * strcpy()
VOID_HACK free()
VOID_HACK rewind()
char * strcat()
char * malloc()
#define SEEK_END
Definition zconf.h:392