/* ECP: FILEname=fig10_29.c */ /* 1*/ #define MaxNodeLen 80 /* 2*/ typedef char NodeName[ MaxNodeLen + 1 ]; /* 3*/ const char *Term = "##"; /* 4*/ void /* 5*/ ReadGraph( Vertex Graph[ ], HashTbl H ) /* 6*/ { /* 7*/ NodeName Source, Dest; /* 8*/ int RetVal; /* 9*/ while( ( RetVal = GetTwoStrings( Source, Dest, MaxNodeLen ) ) /*10*/ > 0 ) /*11*/ { /*12*/ if( RetVal != 2 ) /*13*/ printf( "Warning: skipped an input line\n" ); /*14*/ else /*15*/ if( !strcmp( Source, Term ) && !strcmp( Dest, Term ) ) /*16*/ return; /*17*/ else /*18*/ AddEdge( AddNode( Source, H, Graph ), /*19*/ AddNode( Dest, H, Graph ), Graph ); /*20*/ } /*21*/ printf( "Input terminated early???\n" ); /*22*/ }