static void InCplx( void ) { //======================== ftnfile *fcb; uint rpt; xcomplex value; fcb = IOCB->fileinfo; fcb->col++; Blanks(); GetFloat( &value.realpart, ( IOCB->typ - PT_CPLX_8 ) ); Blanks(); CheckEor(); if( fcb->buffer[ fcb->col ] != ',' ) { IOErr( IO_BAD_CHAR ); } fcb->col++; Blanks(); CheckEor(); GetFloat( &value.imagpart, ( IOCB->typ - PT_CPLX_8 ) ); Blanks(); if( fcb->buffer[ fcb->col ] != ')' ) { IOErr( IO_BAD_CHAR ); } fcb->col++; rpt = IOCB->rptnum; for(;;) { switch( IOCB->typ ) { case PT_CPLX_8: ((scomplex PGM *)(IORslt.pgm_ptr))->realpart = value.realpart; ((scomplex PGM *)(IORslt.pgm_ptr))->imagpart = value.imagpart; break; case PT_CPLX_16: ((dcomplex PGM *)(IORslt.pgm_ptr))->realpart = value.realpart; ((dcomplex PGM *)(IORslt.pgm_ptr))->imagpart = value.imagpart; break; case PT_CPLX_32: ((xcomplex PGM *)(IORslt.pgm_ptr))->realpart = value.realpart; ((xcomplex PGM *)(IORslt.pgm_ptr))->imagpart = value.imagpart; break; default: IOErr( IO_FREE_MISMATCH ); break; } FreeIOType(); if( ( rpt-- <= 1 ) || ( IOCB->typ == PT_NOTYPE ) ) break; } }
void BumpComma( void ) { //=================== ftnfile *fcb; fcb = IOCB->fileinfo; Blanks(); if( fcb->buffer[ fcb->col ] == ',' ) { fcb->col++; } }
bool ScanSNum( signed_32 PGM *num ) { //============================================== // Scan a signed number. char *ptr; Blanks(); ptr = Scanner(); if( ( *ptr == '+' ) || ( *ptr == '-' ) ) { ++ptr; } if( isdigit( *ptr ) ) { *num = GetNum(); Blanks(); return( TRUE ); } else { Blanks(); return( FALSE ); } }
void CheckEor( void ) { //================== ftnfile *fcb; fcb = IOCB->fileinfo; while( fcb->col >= fcb->len ) { NextRec(); if( IOCB->typ != PT_CHAR ) { Blanks(); } } }
void DoFreeIn( void ) { //================== ftnfile *fcb; char ch; fcb = IOCB->fileinfo; FreeIOType(); while( IOCB->typ != PT_NOTYPE ) { CheckEor(); Blanks(); RptNum(); if( fcb->col >= fcb->len ) { while( IOCB->rptnum-- > 0 ) { FreeIOType(); if( IOCB->typ == PT_NOTYPE ) break; } } else { ch = fcb->buffer[ fcb->col ]; if( ch == '/' ) break; switch( ch ) { case ',': case ' ': for(;;) { FreeIOType(); if( IOCB->typ == PT_NOTYPE ) break; if( IOCB->rptnum-- <= 1 ) break; } fcb->col++; break; case '\'': InString(); BumpComma(); break; case '(': InCplx(); BumpComma(); break; case 't': case 'T': case 'f': case 'F': InLog(); BumpComma(); break; case '-': case '+': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': InNumber(); BumpComma(); break; case '.': ch = toupper( fcb->buffer[ fcb->col + 1 ] ); if( ( ch != 'T' ) && ( ch != 'F' ) ) { InNumber(); } else { fcb->col++; InLog(); } BumpComma(); break; default: FreeIOErr( IO_BAD_CHAR ); break; } } } }