void WPDipInit( void ) /********************/ { char *dip_name; unsigned dip_count; dip_status dip_stat; dip_stat = DIPInit(); if( dip_stat != DS_OK ) { fatal( LIT( Dip_Init_Failed ), dip_stat&~DS_ERR ); } dip_count = 0; if( WProfDips == NULL ) { dip_name = DIPDefaults; } else { dip_name = WProfDips; } for( ; *dip_name != NULLCHAR; dip_name += strlen( dip_name ) + 1 ) { if( loadDIP( dip_name, true, true ) ) { dip_count++; } } if( dip_count == 0 ) { DIPFini(); fatal( LIT( Dip_Find_Failed )); } }
/* * InitDip */ bool InitDip( void ) { if( DIPInit() & DS_ERR ) { RCMessageBox( NULL, STR_CANT_LOAD_DIP, AppName, MB_OK | MB_ICONEXCLAMATION ); return( false ); } return( LoadTheDips() ); }
/** * Initializes DIP. * * @returns success indicator. * @param dips Pointer to an array of dip names terminated by a NULL entry. */ static bool InitDIP( char **dips ) { bool rc = false; if( !(DIPInit() & DS_ERR) ) { char *ptr; unsigned dips_loaded = 0; for( ptr = *dips++; ptr; ptr = *dips++ ) { int rc = DIPLoad( ptr ); if( rc & DS_ERR ) { rc &= ~DS_ERR; switch( rc ) { case DS_FOPEN_FAILED: ErrorMsg( "%s - not found\n", ptr ); break; case DS_INVALID_DIP_VERSION: ErrorMsg( "%s - wrong DIP version\n", ptr ); break; case DS_INVALID_DIP: ErrorMsg( "%s - invalid DIP\n", ptr ); break; case DS_TOO_MANY_DIPS: ErrorMsg( "%s - too many DIPs\n", ptr ); break; default: ErrorMsg( "%s - rc=%#x (%d)\n", ptr, rc, rc ); break; } } else { InfoMsg( "Loaded DIP %s\n", ptr); dips_loaded++; } } rc = dips_loaded > 0; if( !dips_loaded ) { ErrorMsg( "Failed to load any DIPs!\n"); DIPFini(); } } return( rc ); }
/* * InitSymbols */ BOOL InitSymbols( void ) { int rc; BOOL diploaded; diploaded = FALSE; rc = DIPInit(); if( rc & DS_ERR ) { RCMessageBox( NULL, STR_CANT_INIT_DIP, AppName, MB_OK | MB_ICONEXCLAMATION ); return( FALSE ); } if( LoadTheDips() ) { dipIsLoaded = TRUE; return( TRUE ); } else { return( FALSE ); } }