/*ParseNorm parse parameters on the normalize command */ #include #include "cddefines.h" #include "norm.h" #include "ffmtread.h" #include "cap4.h" #include "nonumb.h" #include "getquote.h" #include "parse.h" void ParseNorm(char *chCard) { int lgEOL; long int i; char chLabel[81]; # ifdef DEBUG_FUN fputs( "<+>ParseNorm()\n", debug_fp ); # endif /* * get possible label - must do first since it can contain a number.*/ /* is there a double quote on the line? if so then this is a line label */ if( strchr( chCard , '\"' ) != NULL ) { /* GetQuote does the following - * first copy original version of name into chLabel, * string does include null termination. * set label in OrgCard and second parameter to spaces so * that not picked up below as keyword */ GetQuote( chLabel , chCard ); if( chLabel[4] !=0 ) { fprintf( ioQQQ, " The label must be exactly 4 char long.\n" ); fprintf( ioQQQ, "Sorry.\n" ); puts( "[Stop in ParseNorm]" ); exit(1); } /* copy first four char of label into caps, and null terminate*/ cap4( norm.chNormLab, chLabel); } /* normalise lines to this rather than h-b, sec number is scale factor */ i = 5; /* neg sign is flag that NormWL is wavelength not pointer to line array element * startr will convert it to a pointer in the line stack */ norm.ipNormWavL = (long)-FFmtRead(chCard,&i,76,&lgEOL); if( lgEOL ) { NoNumb(chCard); } norm.ScaleNormLine = FFmtRead(chCard,&i,76,&lgEOL); if( lgEOL ) norm.ScaleNormLine = 1.; /* confirm that scale factor is positive */ if( norm.ScaleNormLine <= 0. ) { fprintf( ioQQQ, " The scale factor for relative intensities must be greater than zero.\n" ); fprintf( ioQQQ, "Sorry.\n" ); puts( "[Stop in ParseNorm]" ); exit(1); } # ifdef DEBUG_FUN fputs( " <->ParseNorm()\n", debug_fp ); # endif return; }