Exemple #1
0
static void TestSubroutine( void )
{
    dw_handle   inline_sub;

    inline_sub = DWBeginSubroutine( Client, DW_SB_NEAR_CALL,
        ConstCharStar, NULL, NULL, NULL, 0, NULL, "inline_me_baby", 0,
        DW_FLAG_DECLARATION | DW_FLAG_PROTOTYPED | DW_FLAG_DECLARED_INLINE );
    TestTypedef();
    DWEndSubroutine( Client );

    DWBeginInlineSubroutine( Client, inline_sub, NULL, NULL );
    TestArray();
    DWEndSubroutine( Client );
}
Exemple #2
0
static void BIOutDeclareSP( sym_id ste_ptr, long flags ) {
//========================================================

// Dump the name of an external or intrinsic function. and its data

    char                name[MAX_SYMLEN+1];
    dw_handle           handle;

    if ( ste_ptr == SubProgId ) return;
    flags |= DW_FLAG_DECLARATION;

    memset( name, 0, MAX_SYMLEN+1 );
    handle = DWBeginSubroutine( cBIId, 0, BIGetSPType( ste_ptr ), justJunk,
                 0, 0, 0, 0, strncpy( name, ste_ptr->u.ns.name,
                                        ste_ptr->u.ns.u2.name_len ), 0, flags );
    DWEndSubroutine ( cBIId );
    BISetHandle( ste_ptr, handle );
    BIRefSymbol( handle );
}
Exemple #3
0
static void BIOutSP( sym_id ste_ptr ) {
//=====================================

// Dump the subprogram.
    char        name[MAX_SYMLEN+1];
    uint        flags = 0;
    dw_handle   fret;

    DWDeclPos( cBIId, CurrFile->rec, 0 );
    if ( ( ste_ptr->u.ns.flags & SY_SUBPROG_TYPE ) == SY_FUNCTION ) {
        if( ste_ptr->u.ns.flags & SY_SENTRY ) {
            fret = subProgTyHandle;
        } else {
            if ( ste_ptr->u.ns.u1.s.typ == FT_STRUCTURE ) {
                fret = BIStartStructType( ste_ptr, FALSE );
            } else {
                fret = DWHandle( cBIId, DW_ST_NONE );
            }
            subProgTyHandle = fret;
        }
    } else {
        fret = BIGetSPType( ste_ptr );
    }
    memset( name, 0, MAX_SYMLEN+1 );
    strncpy( name, ste_ptr->u.ns.name, ste_ptr->u.ns.u2.name_len );
    if ( ste_ptr->u.ns.flags & SY_SENTRY ) {
        fret =    DWBeginEntryPoint( cBIId, fret, justJunk, 0, name, 0, flags );
    }else{
        if ( ( ste_ptr->u.ns.flags & SY_SUBPROG_TYPE ) == SY_PROGRAM ) {
            flags |= DW_FLAG_MAIN;
        }
        fret =    DWBeginSubroutine( cBIId, 0, fret, justJunk, 0, 0,
                    0, 0, name,
                    0, flags );

    }
    BISetHandle( ste_ptr, fret );
}