Example #1
0
/*
|| Retrieve and validate a standard label
*/
int
get_sl( SLLABEL *lab )
{
    int rc;
    
    /*
    || Read a block
    */
    if ( opts.faketape )
        rc = fet_read( opts.fetb, blkptr );
    else
        rc = het_read( opts.hetb, blkptr );
    if( rc >= 0 )
    {
        /*
        || Does is look like a standard label?
        */
        if( sl_islabel( lab, blkptr, rc ) == TRUE )
        {
            return( 0 );
        }
    }
    else
    {
        if ( opts.faketape )
            WRMSG( HHC00075, "E", "fet_read()", fet_error( rc ) );
        else
            WRMSG( HHC00075, "E", "het_read()", het_error( rc ) );
    }

    return( -1 );
}
Example #2
0
/*
|| Retrieve and validate a standard label
*/
int
get_sl( HETB *hetb, SLLABEL *lab )
{
    int rc;
    
    /*
    || Read a block
    */
    rc = het_read( hetb, blkptr );
    if( rc >= 0 )
    {
        /*
        || Does is look like a standard label?
        */
        if( sl_islabel( lab, blkptr, rc ) == TRUE )
        {
            return( 0 );
        }
    }
    else
    {
        printf( "%s while reading block\n", het_error( rc ) );
    }

    return( -1 );
}
Example #3
0
/*
|| Print terse dataset information (from VOL1/EOF1/EOF2)
*/
void
printdataset( char *buf, int len, int fileno )
{
    SLLABEL lab;
    SLFMT fmt;
    char crtdt[ 9 ];
    char expdt[ 9 ];
    char recfm[ 4 ];

    if( sl_islabel( &lab, buf, len ) == FALSE )
    {
        return;
    }

    sl_fmtlab( &fmt, &lab );

    if( sl_isvol( buf, 1 ) )
    {
        printf( "vol=%-17.17s  owner=%s\n\n",
                fmt.slvol.volser,
                fmt.slvol.owner);
    }
    else if( sl_iseof( buf, 1 ) )
    {
        printf( "seq=%-17d  file#=%d\n",
                atoi( fmt.slds1.dsseq ),
                fileno );
        printf( "dsn=%-17.17s  crtdt=%-8.8s  expdt=%-8.8s  blocks=%d\n",
                fmt.slds1.dsid,
                sl_fmtdate( crtdt, fmt.slds1.crtdt, TRUE ),
                sl_fmtdate( expdt, fmt.slds1.expdt, TRUE ),
                atoi( fmt.slds1.blkhi ) * 1000000 + atoi( fmt.slds1.blklo ) );
    }
    else if( sl_iseof( buf, 2 ) )
    {
        recfm[ 0 ] = '\0';
        strcat( strcat( strcat( recfm,
                                fmt.slds2.recfm ),
                        fmt.slds2.blkattr ),
                fmt.slds2.ctrl );
        printf( "job=%17.17s  recfm=%-3.3s       lrecl=%-5d     blksize=%-5d\n\n",
                fmt.slds2.jobid,
                recfm,
                atoi( fmt.slds2.lrecl ),
                atoi( fmt.slds2.blksize ) );
    }

    return;
}
Example #4
0
/*
 || Print label fields in TAPEMAP format
 */
void
Print_Label_Tapemap( SInt32 len )
{
    SLLABEL lab;
    char labelrec[81];
    SInt32 i;

    if( sl_islabel( &lab, gBuffer, len ) == FALSE )
    {
        return;
    }
    for (i=0; i < 80; i++)
    {
        labelrec[i] = guest_to_host(gBuffer[i]);
    }
    labelrec[i] = '\0';
    printf ("%s\n", labelrec);
}
Example #5
0
/*
|| Print label fields in TAPEMAP format
 */
void
printlabeltapemap( char *buf, int len )
{
    SLLABEL lab;
    BYTE labelrec[81];
    int i;

    if( sl_islabel( &lab, buf, len ) == FALSE )
    {
        return;
    }
    for (i=0; i < 80; i++)
    {
        labelrec[i] = guest_to_host(buf[i]);
    }
    labelrec[i] = '\0';
    printf("%s\n", labelrec);
}
Example #6
0
/*
 || Print all label fields
 */
void
Print_Label( SInt32 len )
{
    SLLABEL lab;
    SLFMT fmt;
    SInt32 i;

    if( sl_islabel( &lab, gBuffer, len ) == FALSE )
    {
        return;
    }

    sl_fmtlab( &fmt, &lab );

    printf ( "%s", sep );

    for( i = 0; fmt.key[ i ] != NULL; i++ )
    {
        printf ("%-20.20s: '%s'\n", fmt.key[ i ] , fmt.val[ i ] );
    }

    return;
}
Example #7
0
/*
|| Print all label fields
*/
void
printlabel( char *buf, int len )
{
    SLLABEL lab;
    SLFMT fmt;
    int i;

    if( sl_islabel( &lab, buf, len ) == FALSE )
    {
        return;
    }

    sl_fmtlab( &fmt, &lab );

    printf( sep );

    for( i = 0; fmt.key[ i ] != NULL; i++ )
    {
        printf("%-20.20s: '%s'\n", fmt.key[ i ] , fmt.val[ i ] );
    }

    return;
}