Esempio n. 1
0
void    Drop( char ch ) {
//=======================

    ftnfile     *fcb;
    bool        save;
    int         chr_size;

    fcb = IOCB->fileinfo;
    chr_size = 1;
    if( IOCB->flags & DBLE_BYTE_CHAR ) {
        // must be processing second byte of double-byte character
        IOCB->flags &= ~DBLE_BYTE_CHAR;
    } else {
        if( CharSetInfo.is_double_byte_char( ch ) ) {
            chr_size = 2;
            IOCB->flags |= DBLE_BYTE_CHAR;
        }
    }
    if( fcb->col + chr_size > fcb->bufflen ) {
        save = ( IOCB->flags & IOF_NOCR ) != 0;
        IOCB->flags &= ~IOF_NOCR;
        SendEOR();
        if( save ) {
            IOCB->flags |= IOF_NOCR;
        }
        if( ( ( IOCB->flags & IOF_NOFMT ) == 0 ) &&
            ( ( IOCB->set_flags & SET_FMTPTR ) == 0 ) && IsCarriage() ) {
            strcpy( fcb->buffer, NormalCtrlSeq );
            fcb->col = strlen( NormalCtrlSeq );
        }
    }
    fcb->buffer[ fcb->col ] = ch;
    fcb->col++;
}
Esempio n. 2
0
void    R_NewRec( void ) {
//==================

    if( IOCB->flags & IOF_OUTPT ) {
        IOCB->fileinfo->col = IOCB->fmtlen;
        CheckCCtrl();
        SendEOR();
        IOCB->fmtlen = IOCB->fileinfo->col;
    } else {
        NextRec();
    }
}
Esempio n. 3
0
static  void    NmlOut( void ) {
//========================

    byte        PGM *nml;
    byte        len;
    byte        info;
    PTYPE       typ;
    unsigned_32 num_elts;
    byte        PGM *data;
    string      scb;
    lg_adv      PGM *adv_ptr;

    nml = (byte PGM *)(IOCB->fmtptr);
    len = *nml; // get length of NAMELIST name
    ++nml;
    Drop( ' ' );
    Drop( '&' );
    SendStr( (char *)nml, len );
    nml += len;
    SendEOR();
    for(;;) {
        len = *nml;
        if( len == 0 ) break;
        ++nml;
        Drop( ' ' );
        SendStr( (char *)nml, len );
        nml += len;
        SendWSLStr( " = " );
        info = *nml;
        ++nml;
        typ = _GetNMLType( info );
        IOCB->typ = typ;
        if( _GetNMLSubScrs( info ) ) {
            if( info & NML_LG_ADV ) {
                adv_ptr = *(lg_adv PGM * PGM *)nml;
                num_elts = adv_ptr->num_elts;
                if( typ == PT_CHAR ) {
                    scb.len = adv_ptr->elt_size;
                    scb.strptr = (char PGM *)adv_ptr->origin;
                } else {
                    data = (byte PGM *)adv_ptr->origin;
                }
            } else {
                num_elts = *(unsigned_32 PGM *)nml;
                nml += sizeof( unsigned_32 ) + _GetNMLSubScrs( info ) *
                                   ( sizeof( unsigned_32 ) + sizeof( int ) );
                if( typ == PT_CHAR ) {
                    scb.len = *(uint PGM *)nml;
                    nml += sizeof( uint );
                    scb.strptr = *(char PGM * PGM *)nml;
                } else {
Esempio n. 4
0
void    F_SendData( char *str, uint width ) {
//===========================================
    int         blanks;
    ftnfile     *fcb;

    fcb = IOCB->fileinfo;
    if( fcb->col + width > fcb->bufflen ) {
        SendEOR();
    }
    blanks = width - strlen( str );
    if( blanks < 0 ) {
        SendChar( '*', width );
    } else {
        SendChar( ' ', blanks );
        SendWSLStr( str );
    }
}
Esempio n. 5
0
void    SendLine( char *str ) {
//=============================

    SendWSLStr( str );
    SendEOR();
}