91 Vec_Str_t* sCommandUsr = Vec_StrAlloc(1000);
92 char sCommandTmp[
ABC_MAX_STR], sReadCmd[1000], sWriteCmd[1000];
93 const char * sOutFile, * sInFile;
96 int c, fInitSource, fInitRead, fFinalWrite;
101 BATCH_THEN_INTERACTIVE,
103 BATCH_QUIET_THEN_INTERACTIVE,
110#if defined(_DEBUG) && defined(_MSC_VER)
111 _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
117 pAbc->sBinary = argv[0];
120 fBatch = INTERACTIVE;
124 sInFile = sOutFile = NULL;
129 while ((c =
Extra_UtilGetopt(argc, argv,
"dm:l:c:q:C:Q:S:hf:F:o:st:T:xb")) != EOF) {
137#if !defined(WIN32) && !defined(ABC_NO_RLIMIT)
139 printf(
"Limiting memory use to %d MB\n", maxMb);
140 struct rlimit limit = {
141 maxMb * (1llu << 20),
144 setrlimit(RLIMIT_AS, &limit);
149#if !defined(WIN32) && !defined(ABC_NO_RLIMIT)
151 printf(
"Limiting time to %d seconds\n", (
int)maxTime);
152 struct rlimit limit = {
156 setrlimit(RLIMIT_CPU, &limit);
161 if( Vec_StrSize(sCommandUsr) > 0 )
163 Vec_StrAppend(sCommandUsr,
" ; ");
170 if( Vec_StrSize(sCommandUsr) > 0 )
172 Vec_StrAppend(sCommandUsr,
" ; ");
175 fBatch = BATCH_QUIET;
179 if( Vec_StrSize(sCommandUsr) > 0 )
181 Vec_StrAppend(sCommandUsr,
" ; ");
184 fBatch = BATCH_QUIET_THEN_INTERACTIVE;
188 if( Vec_StrSize(sCommandUsr) > 0 )
190 Vec_StrAppend(sCommandUsr,
" ; ");
193 fBatch = BATCH_THEN_INTERACTIVE;
197 if( Vec_StrSize(sCommandUsr) > 0 )
199 Vec_StrAppend(sCommandUsr,
" ; ");
206 if( Vec_StrSize(sCommandUsr) > 0 )
208 Vec_StrAppend(sCommandUsr,
" ; ");
215 if( Vec_StrSize(sCommandUsr) > 0 )
217 Vec_StrAppend(sCommandUsr,
" ; ");
281 Vec_StrPush(sCommandUsr,
'\0');
283 if ( fBatch == BATCH_SMT )
295 else if ( fBatch!=INTERACTIVE && fBatch!=BATCH_QUIET && fBatch!=BATCH_QUIET_THEN_INTERACTIVE && Vec_StrSize(sCommandUsr)>0 )
296 Abc_Print( 1,
"ABC command line: \"%s\".\n\n", Vec_StrArray(sCommandUsr) );
298 if ( fBatch!=INTERACTIVE )
300 pAbc->fBatchMode = 1;
323 if ( fInitRead && sInFile )
325 sprintf( sCommandTmp,
"%s %s", sReadCmd, sInFile );
333 if ( (fStatus == 0 || fStatus == -1) && fFinalWrite && sOutFile )
335 sprintf( sCommandTmp,
"%s %s", sWriteCmd, sOutFile );
340 if (fBatch == BATCH_THEN_INTERACTIVE || fBatch == BATCH_QUIET_THEN_INTERACTIVE){
341 fBatch = INTERACTIVE;
342 pAbc->fBatchMode = 0;
346 Vec_StrFreeP(&sCommandUsr);
348 if ( fBatch==INTERACTIVE )
364 while ( !feof(stdin) )
374 if ( fStatus == -1 || fStatus == -2 )
ABC_DLL void Abc_FrameSetBridgeMode()
ABC_DLL int Abc_FrameIsBridgeMode()
ABC_DLL void Abc_UtilsPrintUsage(Abc_Frame_t *pAbc, char *ProgName)
ABC_DLL void Abc_UtilsPrintHello(Abc_Frame_t *pAbc)
ABC_DLL void Abc_UtilsSource(Abc_Frame_t *pAbc)
ABC_DLL char * Abc_UtilsGetUsersInput(Abc_Frame_t *pAbc)
unsigned enable_dbg_outs
FUNCTION DEFINITIONS ///.
int Abc_RealMain(int argc, char *argv[])