/* ECP: FILEname=fig13_26.c */ /* 1*/ /* Print A Prompt */ /* 2*/ void /* 3*/ Prompt( int Num ) /* 4*/ { /* 5*/ printf( "[%d] ", Num ); /* 6*/ fflush( stdout ); /* 7*/ } /* 8*/ /* Simple main */ /* 9*/ main( void ) /*10*/ { /*11*/ FullCommand OneComm; /*12*/ char OneLine[ MaxLineLen ]; /*13*/ int RetCode; /*14*/ int CommandNum = 1; /*15*/ /*16*/ signal( SIGINT, SIG_IGN ); /* Ignore Signals */ /*17*/ signal( SIGQUIT, SIG_IGN ); /*18*/ for( Prompt( CommandNum ); GetLine( OneLine ) != NULL; ) /*19*/ { /*20*/ if( OneLine[ 0 ] != '\n' ) /*21*/ { /*22*/ CommandNum++; /*23*/ Parse( OneLine, &OneComm ); /*24*/ RunCommand( &OneComm ); /*25*/ } /*26*/ Prompt( CommandNum ); /*27*/ } /*28*/ return 0; /*29*/ }