static GDALDataset *OGRSOSIDriverCreate( const char * pszName, CPL_UNUSED int nBands, CPL_UNUSED int nXSize, CPL_UNUSED int nYSize, CPL_UNUSED GDALDataType eDT, CPL_UNUSED char **papszOptions ) { if ( !bFYBAInit ) { LC_Init(); /* Init FYBA */ bFYBAInit = TRUE; } OGRSOSIDataSource *poDS = new OGRSOSIDataSource(); if ( !poDS->Create( pszName ) ) { delete poDS; return NULL; } return poDS; }
static GDALDataset *OGRSOSIDriverOpen( GDALOpenInfo* poOpenInfo ) { if( poOpenInfo->fpL == NULL || strstr((const char*)poOpenInfo->pabyHeader, ".HODE") == NULL ) return NULL; if ( !bFYBAInit ) { LC_Init(); /* Init FYBA */ bFYBAInit = TRUE; } OGRSOSIDataSource *poDS = new OGRSOSIDataSource(); if ( !poDS->Open( poOpenInfo->pszFilename, 0 ) ) { delete poDS; return NULL; } return poDS; }
DDD_Library::DDD_Library (int *argcp, char ***argvp) #endif { #ifdef CPP_FRONTEND // check existence of another instance of DDD_Library if (_instance!=0) { DDD_PrintError('E', 1021, "construction of two instances of DDD_Library is not allowed"); HARD_EXIT; } #endif int buffsize; /* init lineout-interface to stdout */ DDD_UserLineOutFunction = NULL; /* if first arg is NULL, we assume that PPIF has been initialized elsewhere */ if (argcp!=NULL) { /* init PPIF */ if (InitPPIF(argcp, argvp) != PPIF_SUCCESS) { DDD_PrintError('E', 1005, "PPIF initialization failed"); HARD_EXIT; } } /* printf("%4d: process_id=%d\n", me, getpid()); */ /* check max. number of procs (limited by GID construction) */ if (procs>MAX_PROCS) { DDD_PrintError('E', 1010, "too many processors, cannot construct global IDs in DDD_Init"); HARD_EXIT; } /* compute size for general buffer */ buffsize = (procs+1)*(sizeof(int)*BUFFER_SIZE_FACTOR); if (buffsize<MIN_BUFFER_SIZE) { buffsize = MIN_BUFFER_SIZE; } /* get bufferspace */ iBuffer = (int *)AllocFix(buffsize); if (iBuffer==NULL) { DDD_PrintError('E', 1000, "not enough memory in DDD_Init"); HARD_EXIT; } /* overlay with other buffers */ cBuffer = (char *)iBuffer; /* init all DDD components */ NotifyInit(); LC_Init(LowComm_DefaultAlloc, LowComm_DefaultFree); ddd_StatInit(); ddd_TypeMgrInit(); ddd_ObjMgrInit(); ddd_CplMgrInit(); ddd_TopoInit(); ddd_IdentInit(); ddd_IFInit(); ddd_XferInit(); ddd_PrioInit(); ddd_JoinInit(); ddd_ConsInit(); /* reset all global counters */ ddd_nObjs = 0; NCpl_Init; nCplItems = 0; /* set options on default values */ ddd_SetOption(OPT_WARNING_VARSIZE_OBJ, OPT_ON); ddd_SetOption(OPT_WARNING_SMALLSIZE, OPT_ON); ddd_SetOption(OPT_WARNING_PRIOCHANGE, OPT_ON); ddd_SetOption(OPT_WARNING_DESTRUCT_HDR, OPT_ON); ddd_SetOption(OPT_DEBUG_XFERMESGS, OPT_OFF); ddd_SetOption(OPT_QUIET_CONSCHECK, OPT_OFF); ddd_SetOption(OPT_IDENTIFY_MODE, IDMODE_LISTS); ddd_SetOption(OPT_WARNING_REF_COLLISION, OPT_ON); ddd_SetOption(OPT_INFO_XFER, XFER_SHOW_NONE); ddd_SetOption(OPT_INFO_JOIN, JOIN_SHOW_NONE); ddd_SetOption(OPT_WARNING_OLDSTYLE, OPT_ON); ddd_SetOption(OPT_INFO_IF_WITH_ATTR, OPT_OFF); ddd_SetOption(OPT_XFER_PRUNE_DELETE, OPT_OFF); ddd_SetOption(OPT_IF_REUSE_BUFFERS, OPT_OFF); ddd_SetOption(OPT_IF_CREATE_EXPLICIT, OPT_OFF); ddd_SetOption(OPT_CPLMGR_USE_FREELIST, OPT_ON); #ifdef CPP_FRONTEND // remember pointer to singleton _instance = this; #endif }