/*GetElem scans line image, finds element with atom num j */ #include "cddefines.h" #include "elementnames.h" #include "getelem.h" #include "lgmatch.h" void GetElem(char *chCard, long int *j) { int lgFound; long int i; # ifdef DEBUG_FUN fputs( "<+>GetElem()\n", debug_fp ); # endif /* find which element */ i = 1; lgFound = FALSE; while( i <= LIMELM && !lgFound ) { if( lgMatch((char*)elementnames.chElementNameShort[i-1],chCard) ) { /* IEL is atomic number of element, is used below */ *j = i; lgFound = TRUE; } i += 1; } if( !lgFound ) { fprintf( ioQQQ, " GetElem did not find an element on the following line:\n" ); fprintf( ioQQQ, "%80.80s\n", chCard ); puts( "[Stop in getelem]" ); exit(1); } # ifdef DEBUG_FUN fputs( " <->GetElem()\n", debug_fp ); # endif return; }