Ejemplo n.º 1
0
static void TestArray( void )
{
#if 0
    dw_dim_info         dim_info;
    dw_vardim_info      vdim_info;
    dw_handle           array_hdl;
    dw_loc_handle       buf_loc;
    dw_loc_handle       buf2_loc;
    dw_loc_id           id;

    /* char buf[80]; */
    DWDeclPos( Client, 55, 79 );
    array_hdl = DWBeginArray( Client, 1 );
    dim_info.index_type = FundamentalTypes[DW_FT_UNSIGNED];
    dim_info.lo_data = 0;
    dim_info.hi_data = 79;
    DWArrayDimension( Client, &dim_info );
    DWEndArray( Client );
    SymHandles[3] = 0x1234bUL;
    id = DWLocInit( Client );
    DWLocStatic( Client, id, (dw_sym_handle)3 );
    buf_loc = DWLocFini( Client, id );
    DWDeclPos( Client, 55, 80 );
    DWVariable( Client, array_hdl, buf_loc, 0, NULL, "buf", 0, DW_FLAG_GLOBAL );
    DWLocTrash( Client, buf_loc );

    /* INTEGER*4 A(1:N) */
    DWDeclPos( Client, 55, 81 );
    array_hdl = DWBeginArray( Client, 1 );
    dim_info.index_type = FundamentalTypes[DW_FT_SIGNED];
    dim_info.lo_data = 1;
    id = DWLocInit( Client );   /* assume N is at -4[ebp] */
    DWLocOp( Client, id, DW_LOC_fbreg, -4 );
    buf2_loc = DWLocFini( Client, id );
    vdim_info.count_data = (dw_handle)buf2_loc;
    DWArrayDimension( Client, &dim_info );
    DWLocTrash( Client, buf2_loc );
    DWEndArray( Client );
#endif
}
Ejemplo n.º 2
0
static dw_handle BIGetArrayType( sym_id ste_ptr ) {
//=================================================

// Get An array type of a named symbol

    int         dim = _DimCount( ste_ptr->u.ns.si.va.u.dim_ext->dim_flags );
    int         x = 0;
    dw_dim_info data;
    intstar4    *sub;
    dw_handle   ret;

    data.index_type = BIGetBaseType( FT_INTEGER );
    sub = &( ste_ptr->u.ns.si.va.u.dim_ext->subs_1_lo );

    ret = DWBeginArray( cBIId, BIGetType( ste_ptr ), 0, NULL, 0, 0 );
    for( x = 0; x < dim; x++ ) {
        data.lo_data = *sub++;
        data.hi_data = *sub++;
        DWArrayDimension( cBIId, &data );
    }
    DWDeclPos( cBIId, CurrFile->rec, 0 );
    DWEndArray( cBIId );
    return( ret );
}