/* ECP: FILEname=fig10_31.c */ /* 1*/ void /* 2*/ ProcessRequests( Vertex Graph[ ], HashTbl H ) /* 3*/ { /* 4*/ NodeName Source, Dest; /* 5*/ int SourceNum, DestNum; /* 6*/ int RetVal; /* 7*/ while( ( RetVal = GetTwoStrings( Source, Dest, MaxNodeLen ) ) /* 8*/ > 0 ) /* 9*/ { /*10*/ if( RetVal != 2 ) /*11*/ { /*12*/ printf( "Format error: skipping this line\n" ); /*13*/ continue; /*14*/ } /*15*/ SourceNum = Find( Source, H ); /*16*/ DestNum = Find( Dest, H ); /*17*/ if( SourceNum == -1 || DestNum == -1 ) /*18*/ printf( "Illegal vertex specified\n" ); /*19*/ else /*20*/ { /*21*/ EvaluateShort( SourceNum, Graph ); /*22*/ PrintPath( DestNum, Graph ); /*23*/ } /*24*/ } /*25*/ } /* 1*/ main( void ) /* 2*/ { /* 3*/ HashTbl H = HaMakeEmpty( NULL ); /* 4*/ Vertex G[ MaxNodes + 1 ]; /* 5*/ ReadGraph( G, H ); /* 6*/ ProcessRequests( G, H ); /* 7*/ return 0; /* 8*/ }