コード例 #1
0
dip_status DIPLoad( const char *path )
{
    int         i;
    dip_status  status;

    for( i = 0; LoadedDIPs[i].rtns != NULL; ++i ) {
        if( i >= MAX_LOAD_DIPS ) {
            return( DS_ERR|DS_TOO_MANY_DIPS );
        }
    }
    status = DIPSysLoad( path, &DIPClientInterface, &LoadedDIPs[i].rtns, &LoadedDIPs[i].sys_hdl );
    if( status != DS_OK )
        return( status );
    if( DIPClientInterface.major != LoadedDIPs[i].rtns->major
      || DIPClientInterface.minor > LoadedDIPs[i].rtns->minor ) {
        if( LoadedDIPs[i].sys_hdl != NULL_SYSHDL ) {
            DIPSysUnload( &LoadedDIPs[i].sys_hdl );
        }
        LoadedDIPs[i].rtns = NULL;
        LoadedDIPs[i].sys_hdl = NULL_SYSHDL;
        return( DS_ERR|DS_INVALID_DIP_VERSION );
    }
    SetHdlSizes( LoadedDIPs[i].rtns );
    return( DS_OK );
}
コード例 #2
0
void DIPFini( void )
{
    int     i;

    for( i = 0; i < MAX_DIPS; ++i ) {
        if( LoadedDIPs[i].rtns != NULL ) {
            LoadedDIPs[i].rtns->Shutdown();
            if( LoadedDIPs[i].sys_hdl != NULL_SYSHDL ) {
                DIPSysUnload( &LoadedDIPs[i].sys_hdl );
            }
        }
        LoadedDIPs[i].rtns = NULL;
        LoadedDIPs[i].sys_hdl = NULL_SYSHDL;
    }
}
コード例 #3
0
ファイル: dipman.c プロジェクト: Ukusbobra/open-watcom-v2
void DIPFini( void )
{
    unsigned    i;

    for( i = 0; i < MAX_DIPS; ++i ) {
        if( LoadedDIPs[i].rtns != NULL ) {
            LoadedDIPs[i].rtns->shutdown();
            if( LoadedDIPs[i].sys_hdl != 0 ) {
                DIPSysUnload( LoadedDIPs[i].sys_hdl );
            }
        }
        LoadedDIPs[i].rtns = NULL;
        LoadedDIPs[i].sys_hdl = 0;
    }
}
コード例 #4
0
void DIPFiniLatest( void )
{
    int     i;

    for( i = MAX_DIPS - 1; i >= 0; --i ) {
        if( LoadedDIPs[i].rtns != NULL ) {
            LoadedDIPs[i].rtns->Shutdown();
            if( LoadedDIPs[i].sys_hdl != NULL_SYSHDL ) {
                DIPSysUnload( &LoadedDIPs[i].sys_hdl );
            }
            LoadedDIPs[i].rtns = NULL;
            LoadedDIPs[i].sys_hdl = NULL_SYSHDL;
            break;
        }
    }
}
コード例 #5
0
ファイル: dipman.c プロジェクト: Ukusbobra/open-watcom-v2
void DIPFiniLatest( void )
{
    unsigned    i;

    i = MAX_DIPS;
    for( ;; ) {
        --i;
        if( LoadedDIPs[i].rtns != NULL ) {
            LoadedDIPs[i].rtns->shutdown();
            if( LoadedDIPs[i].sys_hdl != 0 ) {
                DIPSysUnload( LoadedDIPs[i].sys_hdl );
            }
            LoadedDIPs[i].rtns = NULL;
            LoadedDIPs[i].sys_hdl = 0;
            return;
        }
        if( i == 0 ) return;
    }
}