24 #ifdef ABC_USE_READLINE
25 #include <readline/readline.h>
26 #include <readline/history.h>
54 static char Version[1000];
72 static char Prompt[5000];
73 sprintf( Prompt,
"abc %02d> ", pAbc->nSteps );
74 #ifdef ABC_USE_READLINE
76 static char * line = NULL;
78 line = readline(Prompt);
79 if (line == NULL){ printf(
"***EOF***\n");
exit(0); }
86 fprintf( pAbc->Out,
"%s", Prompt );
87 pRetValue = fgets( Prompt, 5000, stdin );
106 fprintf( pAbc->Out,
"%s\n", pAbc->sVersion );
122 fprintf( pAbc->Err,
"\n" );
124 "usage: %s [-c cmd] [-f script] [-h] [-o file] [-s] [-t type] [-T type] [-x] [-b] [file]\n",
126 fprintf( pAbc->Err,
" -c cmd\texecute commands `cmd'\n");
127 fprintf( pAbc->Err,
" -q cmd\texecute commands `cmd' quietly\n");
128 fprintf( pAbc->Err,
" -C cmd\texecute commands `cmd', then continue in interactive mode\n");
129 fprintf( pAbc->Err,
" -F script\texecute commands from a script file and echo commands\n");
130 fprintf( pAbc->Err,
" -f script\texecute commands from a script file\n");
131 fprintf( pAbc->Err,
" -h\t\tprint the command usage\n");
132 fprintf( pAbc->Err,
" -o file\tspecify output filename to store the result\n");
133 fprintf( pAbc->Err,
" -s\t\tdo not read any initialization file\n");
134 fprintf( pAbc->Err,
" -t type\tspecify input type (blif_mv (default), blif_mvs, blif, or none)\n");
135 fprintf( pAbc->Err,
" -T type\tspecify output type (blif_mv (default), blif_mvs, blif, or none)\n");
136 fprintf( pAbc->Err,
" -x\t\tequivalent to '-t none -T none'\n");
137 fprintf( pAbc->Err,
" -b\t\trunning in bridge mode\n");
138 fprintf( pAbc->Err,
"\n" );
158 printf(
"Loaded \"abc.rc\" from the parent directory.\n" );
160 printf(
"Loaded \"abc.rc\" from the grandparent directory.\n" );
166 char * sPath1, * sPath2;
173 if ( sPath1 && sPath2 ) {
193 #ifdef ABC_PYTHON_EMBED
194 if (
getenv(
"ABC_PYTHON_ABC_RC") )
198 char * sPath =
getenv(
"ABC_PYTHON_ABC_RC");
202 (void)
sprintf(sCmd,
"source -s %s", sPath);
211 char * sPath1, * sPath2;
219 (void)
sprintf(sPath3,
"%s/", home);
227 if ( sPath1 && sPath2 ) {
230 (void)
sprintf(tmp_cmd,
"source -s %s", sPath1);
238 (void)
sprintf(tmp_cmd,
"source -s %s", sPath1);
245 (void)
sprintf(tmp_cmd,
"source -s %s", sPath2);
284 if (sscanf(datestr,
"%s %s %2d %2d:%2d:%2d %s %4d",
285 day, month, &date, &hour, &minute, &second, zone, &year) == 8) {
287 if (hour >= 13) hour -= 12;
291 if (hour == 0) hour = 12;
294 (void)
sprintf(result,
"%d-%3s-%02d at %d:%02d %s",
295 date, month, year % 100, hour, minute, at);
char * Abc_UtilsGetUsersInput(Abc_Frame_t *pAbc)
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
void Abc_UtilsSource(Abc_Frame_t *pAbc)
static ABC_NAMESPACE_IMPL_START char * DateReadFromDateString(char *datestr)
DECLARATIONS ///.
#define ABC_ALLOC(type, num)
void Abc_UtilsPrintHello(Abc_Frame_t *pAbc)
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_END
#define ABC_VERSION
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
void Abc_UtilsPrintUsage(Abc_Frame_t *pAbc, char *ProgName)
char * Abc_UtilsGetVersion(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.