9
9
Synopsis [Command file.]
10
10
11
11
Author [Alan Mishchenko]
12
-
12
+
13
13
Affiliation [UC Berkeley]
14
14
15
15
Date [Ver. 1.0. Started - June 20, 2005.]
18
18
19
19
***********************************************************************/
20
20
21
- #ifdef WIN32
21
+ #if defined( WIN32 ) || defined( __MINGW32__ )
22
22
#include <process.h>
23
23
#else
24
- #include <unistd.h>
25
24
#include <dirent.h>
25
+ #include <unistd.h>
26
26
#endif
27
27
28
28
#include "base/abc/abc.h"
@@ -50,7 +50,7 @@ static int CmdCommandUnsetVariable ( Abc_Frame_t * pAbc, int argc, char ** argv
50
50
static int CmdCommandUndo ( Abc_Frame_t * pAbc , int argc , char * * argv );
51
51
static int CmdCommandRecall ( Abc_Frame_t * pAbc , int argc , char * * argv );
52
52
static int CmdCommandEmpty ( Abc_Frame_t * pAbc , int argc , char * * argv );
53
- #if defined(WIN32 ) && ! defined(__cplusplus )
53
+ #if defined(WIN32 ) || defined(__MINGW32__ )
54
54
static int CmdCommandScanDir ( Abc_Frame_t * pAbc , int argc , char * * argv );
55
55
static int CmdCommandRenameFiles ( Abc_Frame_t * pAbc , int argc , char * * argv );
56
56
static int CmdCommandLs ( Abc_Frame_t * pAbc , int argc , char * * argv );
@@ -103,7 +103,7 @@ void Cmd_Init( Abc_Frame_t * pAbc )
103
103
Cmd_CommandAdd ( pAbc , "Basic" , "undo" , CmdCommandUndo , 0 );
104
104
Cmd_CommandAdd ( pAbc , "Basic" , "recall" , CmdCommandRecall , 0 );
105
105
Cmd_CommandAdd ( pAbc , "Basic" , "empty" , CmdCommandEmpty , 0 );
106
- #if defined(WIN32 ) && ! defined(__cplusplus )
106
+ #if defined(WIN32 ) || defined(__MINGW32__ )
107
107
Cmd_CommandAdd ( pAbc , "Basic" , "scandir" , CmdCommandScanDir , 0 );
108
108
Cmd_CommandAdd ( pAbc , "Basic" , "renamefiles" , CmdCommandRenameFiles , 0 );
109
109
Cmd_CommandAdd ( pAbc , "Basic" , "ls" , CmdCommandLs , 0 );
@@ -1148,7 +1148,7 @@ int CmdCommandUndo( Abc_Frame_t * pAbc, int argc, char **argv )
1148
1148
#endif
1149
1149
1150
1150
1151
- #if defined(WIN32 ) && ! defined(__cplusplus )
1151
+ #if defined(WIN32 ) || defined(__MINGW32__ )
1152
1152
#include <direct.h>
1153
1153
#include <io.h>
1154
1154
@@ -1335,6 +1335,7 @@ int CmfFindNumber( char * pName )
1335
1335
void CnfDupFileUnzip ( char * pOldName )
1336
1336
{
1337
1337
extern char * Io_MvLoadFileBz2 ( char * pFileName , int * pnFileSize );
1338
+
1338
1339
char pNewName [1000 ];
1339
1340
FILE * pFile ;
1340
1341
int nFileSize ;
@@ -1836,7 +1837,7 @@ int CmdCommandScrGen( Abc_Frame_t * pAbc, int argc, char **argv )
1836
1837
1837
1838
#else
1838
1839
1839
- Vec_Ptr_t * CmdReturnFileNames ( char * pDirStr )
1840
+ Vec_Ptr_t * CmdReturnFileNames ( char * pDirStr )
1840
1841
{
1841
1842
Vec_Ptr_t * vRes = Vec_PtrAlloc ( 100 );
1842
1843
struct dirent * * namelist ;
@@ -1848,7 +1849,7 @@ Vec_Ptr_t * CmdReturnFileNames( char * pDirStr )
1848
1849
for (int i = 0 ; i < num_files ; i ++ ) {
1849
1850
char * pExt = strstr (namelist [i ]-> d_name , "." );
1850
1851
if ( !pExt || !strcmp (pExt , "." ) || !strcmp (pExt , ".." ) || !strcmp (pExt , ".s" ) || !strcmp (pExt , ".txt" ) )
1851
- continue ;
1852
+ continue ;
1852
1853
Vec_PtrPush ( vRes , Abc_UtilStrsav (namelist [i ]-> d_name ) );
1853
1854
free (namelist [i ]);
1854
1855
}
@@ -1864,7 +1865,7 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv )
1864
1865
char * pDirStr = (char * )"." ;
1865
1866
char * pComStr = (char * )"ps" ;
1866
1867
char * pWriteStr = NULL ;
1867
- char * pWriteExt = NULL ;
1868
+ char * pWriteExt = NULL ;
1868
1869
char Line [2000 ], * pName ;
1869
1870
int nFileNameMax ;
1870
1871
int fBatch = 0 ;
@@ -1919,7 +1920,7 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv )
1919
1920
}
1920
1921
pWriteExt = argv [globalUtilOptind ];
1921
1922
globalUtilOptind ++ ;
1922
- break ;
1923
+ break ;
1923
1924
case 'b' :
1924
1925
fBatch ^= 1 ;
1925
1926
break ;
@@ -1949,8 +1950,8 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv )
1949
1950
int fAndSpace = pComStr [0 ] == '&' ;
1950
1951
fprintf ( pFile , "# Script file produced by ABC on %s\n" , Extra_TimeStamp () );
1951
1952
fprintf ( pFile , "# Command line was: scrgen -F %s -D %s -C \"%s\"%s%s%s%s\n" ,
1952
- pFileStr , pDirStr , pComStr ,
1953
- pWriteStr ?" -W " :"" , pWriteStr ?pWriteStr :"" ,
1953
+ pFileStr , pDirStr , pComStr ,
1954
+ pWriteStr ?" -W " :"" , pWriteStr ?pWriteStr :"" ,
1954
1955
pWriteExt ?" -E " :"" , pWriteExt ?pWriteExt :"" );
1955
1956
Vec_PtrForEachEntry ( char * , vNames , pName , k ) {
1956
1957
char * pExt = strstr (pName , "." );
@@ -1988,7 +1989,7 @@ int CmdCommandScrGenLinux( Abc_Frame_t * pAbc, int argc, char **argv )
1988
1989
fprintf ( pAbc -> Err , "\t-C str : the sequence of commands to run [default = \"ps\"]\n" );
1989
1990
fprintf ( pAbc -> Err , "\t-W str : the directory to write the resulting files [default = no writing]\n" );
1990
1991
fprintf ( pAbc -> Err , "\t-E str : the output files extension (with \".\") [default = the same as input files]\n" );
1991
- fprintf ( pAbc -> Err , "\t-b : toggles adding batch mode support [default = %s]\n" , fBatch ? "yes" : "no" );
1992
+ fprintf ( pAbc -> Err , "\t-b : toggles adding batch mode support [default = %s]\n" , fBatch ? "yes" : "no" );
1992
1993
fprintf ( pAbc -> Err , "\t-h : print the command usage\n\n" );
1993
1994
fprintf ( pAbc -> Err , "\tExample : scrgen -F test1.s -R a/in -C \"ps; st; ps\" -W a/out -E .blif\n" );
1994
1995
return 1 ;
@@ -2541,7 +2542,7 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv )
2541
2542
Synopsis []
2542
2543
2543
2544
Description []
2544
-
2545
+
2545
2546
SideEffects []
2546
2547
2547
2548
SeeAlso []
@@ -2568,7 +2569,7 @@ int CmdCommandStarter( Abc_Frame_t * pAbc, int argc, char ** argv )
2568
2569
}
2569
2570
nCores = atoi (argv [globalUtilOptind ]);
2570
2571
globalUtilOptind ++ ;
2571
- if ( nCores < 0 )
2572
+ if ( nCores < 0 )
2572
2573
goto usage ;
2573
2574
break ;
2574
2575
case 'C' :
@@ -2626,7 +2627,7 @@ int CmdCommandStarter( Abc_Frame_t * pAbc, int argc, char ** argv )
2626
2627
Synopsis []
2627
2628
2628
2629
Description []
2629
-
2630
+
2630
2631
SideEffects []
2631
2632
2632
2633
SeeAlso []
@@ -2654,7 +2655,7 @@ int CmdCommandAutoTuner( Abc_Frame_t * pAbc, int argc, char ** argv )
2654
2655
}
2655
2656
nCores = atoi (argv [globalUtilOptind ]);
2656
2657
globalUtilOptind ++ ;
2657
- if ( nCores < 0 )
2658
+ if ( nCores < 0 )
2658
2659
goto usage ;
2659
2660
break ;
2660
2661
case 'C' :
@@ -2775,7 +2776,7 @@ int CmdCommandVersion( Abc_Frame_t * pAbc, int argc, char **argv )
2775
2776
Synopsis []
2776
2777
2777
2778
Description []
2778
-
2779
+
2779
2780
SideEffects []
2780
2781
2781
2782
SeeAlso []
@@ -2800,7 +2801,7 @@ int CmdCommandSGen( Abc_Frame_t * pAbc, int argc, char ** argv )
2800
2801
}
2801
2802
nParts = atoi (argv [globalUtilOptind ]);
2802
2803
globalUtilOptind ++ ;
2803
- if ( nParts < 0 )
2804
+ if ( nParts < 0 )
2804
2805
goto usage ;
2805
2806
break ;
2806
2807
case 'I' :
@@ -2826,7 +2827,7 @@ int CmdCommandSGen( Abc_Frame_t * pAbc, int argc, char ** argv )
2826
2827
Abc_Print ( -2 , "There is no current network.\n" );
2827
2828
return 1 ;
2828
2829
}
2829
- if ( !Abc_NtkIsStrash (Abc_FrameReadNtk (pAbc )) )
2830
+ if ( !Abc_NtkIsStrash (Abc_FrameReadNtk (pAbc )) )
2830
2831
{
2831
2832
Abc_Print ( -2 , "The current network is not an AIG.\n" );
2832
2833
return 1 ;
0 commit comments