Changeset 2459
- Timestamp:
- 09/06/01 10:03:21 (7 years ago)
- Files:
-
- trunk/bridge/bridge_test.cpp (modified) (2 diffs)
- trunk/bridge/gbgetsymbol.cpp (modified) (2 diffs)
- trunk/bridge/gdalbridge.cpp (modified) (8 diffs)
- trunk/bridge/gdalbridge.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bridge/bridge_test.cpp
r1630 r2459 30 30 * 31 31 * $Log$ 32 * Revision 1.3 2001/09/06 14:03:21 warmerda 33 * upgrade bridge error reporting 34 * 32 35 * Revision 1.2 2000/08/25 20:03:40 warmerda 33 36 * added more entry points … … 50 53 GDALProjDefH hProjDef; 51 54 52 if( !GDALBridgeInitialize( ".." ) )55 if( !GDALBridgeInitialize( "..", stderr ) ) 53 56 { 54 57 fprintf( stderr, "Unable to intiailize GDAL bridge.\n" ); trunk/bridge/gbgetsymbol.cpp
r1716 r2459 31 31 * 32 32 * $Log$ 33 * Revision 1.3 2001/09/06 14:03:21 warmerda 34 * upgrade bridge error reporting 35 * 33 36 * Revision 1.2 2000/09/27 13:22:07 warmerda 34 37 * also allow for unix in check … … 78 81 if( pSymbol == NULL ) 79 82 { 80 fprintf( stderr, "GBGetSymbol(): %s ", dlerror() );83 fprintf( stderr, "GBGetSymbol(): %s\n", dlerror() ); 81 84 return NULL; 82 85 } trunk/bridge/gdalbridge.cpp
r2455 r2459 31 31 * 32 32 * $Log$ 33 * Revision 1.1 2 2001/09/06 01:54:31 warmerda34 * added gcp functions33 * Revision 1.13 2001/09/06 14:03:21 warmerda 34 * upgrade bridge error reporting 35 35 * 36 36 * Revision 1.10 2000/09/26 15:20:32 warmerda … … 69 69 #include <stdio.h> 70 70 #include <stdlib.h> 71 #include <string.h> 71 72 72 73 #ifdef _WIN32 … … 86 87 #endif 87 88 89 #define MAX_SYMBOL 1024 90 91 /************************************************************************/ 92 /* GBGetSymbolCheck() */ 93 /* */ 94 /* Get a symbol, and on error add the missing entry point to a */ 95 /* list of missing entry points. */ 96 /************************************************************************/ 97 98 static void *GBGetSymbolCheck( const char *pszLibrary, 99 const char *pszSymbolName, 100 char **papszErrorList ) 101 102 { 103 void *pReturn; 104 105 pReturn = GBGetSymbol( pszLibrary, pszSymbolName ); 106 107 if( pReturn == NULL && papszErrorList != NULL ) 108 { 109 int i; 110 111 for( i = 0; papszErrorList[i] != NULL; i++ ) {} 112 113 if( i < MAX_SYMBOL-1 ) 114 { 115 papszErrorList[i] = strdup( pszSymbolName ); 116 papszErrorList[i+1] = NULL; 117 } 118 } 119 120 return pReturn; 121 } 88 122 89 123 /************************************************************************/ … … 91 125 /************************************************************************/ 92 126 93 int GDALBridgeInitialize( const char * pszTargetDir )127 int GDALBridgeInitialize( const char * pszTargetDir, FILE *fpReportFailure ) 94 128 95 129 { … … 97 131 void *pfnTest = NULL; 98 132 int iSOFile; 99 133 char *apszFailed[MAX_SYMBOL]; 134 135 /* -------------------------------------------------------------------- */ 136 /* Do we want to force reporting on? */ 137 /* -------------------------------------------------------------------- */ 138 if( fpReportFailure == NULL 139 && (getenv("CPL_DEBUG") != NULL || getenv("GB_DEBUG") != NULL) ) 140 { 141 fpReportFailure = stderr; 142 } 143 100 144 /* -------------------------------------------------------------------- */ 101 145 /* The first phase is to try and find the shared library. */ … … 127 171 } 128 172 173 /* -------------------------------------------------------------------- */ 174 /* Did we fail to even find the DLL/.so? */ 175 /* -------------------------------------------------------------------- */ 129 176 if( pfnTest == NULL ) 177 { 178 179 if( fpReportFailure == NULL ) 180 return FALSE; 181 182 183 fprintf( fpReportFailure, 184 "GBBridgeInitialize() failed to find an suitable GDAL .DLL/.so file.\n" ); 185 fprintf( fpReportFailure, 186 "The following filenames were searched for:\n" ); 187 188 for( iSOFile = 0; papszSOFilenames[iSOFile] != NULL; iSOFile++ ) 189 fprintf( fpReportFailure, " o %s\n", papszSOFilenames[iSOFile] ); 190 191 fprintf( fpReportFailure, "\n" ); 192 fprintf( fpReportFailure, "The following locations were searched:\n" ); 193 194 if( pszTargetDir != NULL ) 195 fprintf( fpReportFailure, " o %s\n", pszTargetDir ); 196 197 if( getenv( "GDAL_HOME" ) != NULL ) 198 fprintf( fpReportFailure, " o %s\n", getenv( "GDAL_HOME" ) ); 199 200 fprintf( fpReportFailure, " o System default locations.\n" ); 201 fprintf( fpReportFailure, "\n" ); 202 203 fprintf( fpReportFailure, "\n" ); 204 #ifdef __unix__ 205 if( getenv("LD_LIBRARY_PATH") != NULL ) 206 { 207 fprintf( fpReportFailure, 208 "System default locations may be influenced by:\n" ); 209 fprintf( fpReportFailure, 210 "LD_LIBRARY_PATH = %s\n", getenv("LD_LIBRARY_PATH") ); 211 } 212 #else 213 if( getenv("PATH") != NULL ) 214 { 215 fprintf( fpReportFailure, 216 "System default locations may be influenced by:\n" ); 217 fprintf( fpReportFailure, 218 "PATH = %s\n", getenv("PATH") ); 219 } 220 #endif 221 130 222 return FALSE; 223 } 131 224 132 225 /* -------------------------------------------------------------------- */ 133 226 /* Start loading functions. */ 134 227 /* -------------------------------------------------------------------- */ 135 228 apszFailed[0] = NULL; 229 136 230 GDALGetDataTypeSize = (int (*)(GDALDataType)) 137 GBGetSymbol ( szPath, "GDALGetDataTypeSize");231 GBGetSymbolCheck( szPath, "GDALGetDataTypeSize", apszFailed ); 138 232 139 233 GDALAllRegister = (void (*)(void)) 140 GBGetSymbol ( szPath, "GDALAllRegister");234 GBGetSymbolCheck( szPath, "GDALAllRegister", apszFailed ); 141 235 142 236 GDALCreate = (GDALDatasetH (*)(GDALDriverH, const char *, int, int, int, 143 237 GDALDataType, char ** )) 144 GBGetSymbol ( szPath, "GDALCreate");238 GBGetSymbolCheck( szPath, "GDALCreate", apszFailed ); 145 239 146 240 GDALOpen = (GDALDatasetH (*)(const char *, GDALAccess)) 147 GBGetSymbol ( szPath, "GDALOpen");241 GBGetSymbolCheck( szPath, "GDALOpen", apszFailed ); 148 242 149 243 GDALGetDriverByName = (GDALDriverH (*)(const char *)) 150 GBGetSymbol ( szPath, "GDALGetDriverByName");244 GBGetSymbolCheck( szPath, "GDALGetDriverByName", apszFailed ); 151 245 152 246 GDALClose = (void (*)(GDALDatasetH)) 153 GBGetSymbol ( szPath, "GDALClose");247 GBGetSymbolCheck( szPath, "GDALClose", apszFailed ); 154 248 155 249 GDALGetRasterXSize = (int (*)(GDALDatasetH)) 156 GBGetSymbol ( szPath, "GDALGetRasterXSize");250 GBGetSymbolCheck( szPath, "GDALGetRasterXSize", apszFailed ); 157 251 158 252 GDALGetRasterYSize = (int (*)(GDALDatasetH)) 159 GBGetSymbol ( szPath, "GDALGetRasterYSize");253 GBGetSymbolCheck( szPath, "GDALGetRasterYSize", apszFailed ); 160 254 161 255 GDALGetRasterCount = (int (*)(GDALDatasetH)) 162 GBGetSymbol ( szPath, "GDALGetRasterCount");256 GBGetSymbolCheck( szPath, "GDALGetRasterCount", apszFailed ); 163 257 164 258 GDALGetRasterBand = (GDALRasterBandH (*)(GDALDatasetH, int)) 165 GBGetSymbol ( szPath, "GDALGetRasterBand");259 GBGetSymbolCheck( szPath, "GDALGetRasterBand", apszFailed ); 166 260 167 261 GDALGetProjectionRef = (const char *(*)(GDALDatasetH)) 168 GBGetSymbol ( szPath, "GDALGetProjectionRef");262 GBGetSymbolCheck( szPath, "GDALGetProjectionRef", apszFailed ); 169 263 170 264 GDALSetProjection = (CPLErr (*)(GDALDatasetH, const char *)) 171 GBGetSymbol ( szPath, "GDALSetProjection");265 GBGetSymbolCheck( szPath, "GDALSetProjection", apszFailed ); 172 266 173 267 GDALGetGeoTransform = (CPLErr (*)(GDALDatasetH, double *)) 174 GBGetSymbol ( szPath, "GDALGetGeoTransform");268 GBGetSymbolCheck( szPath, "GDALGetGeoTransform", apszFailed ); 175 269 176 270 GDALSetGeoTransform = (CPLErr (*)(GDALDatasetH, double *)) 177 GBGetSymbol ( szPath, "GDALSetGeoTransform");271 GBGetSymbolCheck( szPath, "GDALSetGeoTransform", apszFailed ); 178 272 179 273 GDALGetInternalHandle = (void *(*)(GDALDatasetH, const char *)) 180 GBGetSymbol ( szPath, "GDALGetInternalHandle");274 GBGetSymbolCheck( szPath, "GDALGetInternalHandle", apszFailed ); 181 275 182 276 GDALGetGCPCount = (int (*)(GDALDatasetH)) 183 GBGetSymbol ( szPath, "GDALGetGCPCount");277 GBGetSymbolCheck( szPath, "GDALGetGCPCount", apszFailed ); 184 278 185 279 GDALGetGCPProjection = (const char *(*)(GDALDatasetH)) 186 GBGetSymbol ( szPath, "GDALGetGCPProjection");280 GBGetSymbolCheck( szPath, "GDALGetGCPProjection", apszFailed ); 187 281 188 282 GDALGetGCPs = (const GDAL_GCP *(*)(GDALDatasetH)) 189 GBGetSymbol ( szPath, "GDALGetGCPs");283 GBGetSymbolCheck( szPath, "GDALGetGCPs", apszFailed ); 190 284 191 285 GDALGetRasterDataType = (GDALDataType (*)(GDALRasterBandH)) 192 GBGetSymbol ( szPath, "GDALGetRasterDataType");286 GBGetSymbolCheck( szPath, "GDALGetRasterDataType", apszFailed ); 193 287 194 288 GDALGetRasterBandXSize = (int (*)(GDALRasterBandH)) 195 GBGetSymbol ( szPath, "GDALGetRasterBandXSize");289 GBGetSymbolCheck( szPath, "GDALGetRasterBandXSize", apszFailed ); 196 290 197 291 GDALGetRasterBandYSize = (int (*)(GDALRasterBandH)) 198 GBGetSymbol ( szPath, "GDALGetRasterBandYSize");292 GBGetSymbolCheck( szPath, "GDALGetRasterBandYSize", apszFailed ); 199 293 200 294 GDALGetBlockSize = (void (*)(GDALRasterBandH, int *, int *)) 201 GBGetSymbol ( szPath, "GDALGetBlockSize");295 GBGetSymbolCheck( szPath, "GDALGetBlockSize", apszFailed ); 202 296 203 297 GDALRasterIO = (CPLErr (*)(GDALRasterBandH, GDALRWFlag, int, int, int, int, 204 298 void *, int, int, GDALDataType, int, int )) 205 GBGetSymbol ( szPath, "GDALRasterIO");299 GBGetSymbolCheck( szPath, "GDALRasterIO", apszFailed ); 206 300 207 301 GDALReadBlock = (CPLErr (*)(GDALRasterBandH, int, int, void *)) 208 GBGetSymbol ( szPath, "GDALReadBlock");302 GBGetSymbolCheck( szPath, "GDALReadBlock", apszFailed ); 209 303 210 304 GDALWriteBlock = (CPLErr (*)(GDALRasterBandH, int, int, void *)) 211 GBGetSymbol ( szPath, "GDALWriteBlock");305 GBGetSymbolCheck( szPath, "GDALWriteBlock", apszFailed ); 212 306 213 307 GDALGetOverviewCount = (int (*)(GDALRasterBandH)) 214 GBGetSymbol ( szPath, "GDALGetOverviewCount");308 GBGetSymbolCheck( szPath, "GDALGetOverviewCount", apszFailed ); 215 309 216 310 GDALGetOverview = (GDALRasterBandH (*)(GDALRasterBandH, int)) 217 GBGetSymbol ( szPath, "GDALGetOverview");311 GBGetSymbolCheck( szPath, "GDALGetOverview", apszFailed ); 218 312 219 313 GDALGetRasterNoDataValue = (double (*)(GDALRasterBandH, int*)) 220 GBGetSymbol ( szPath, "GDALGetRasterNoDataValue");314 GBGetSymbolCheck( szPath, "GDALGetRasterNoDataValue", apszFailed ); 221 315 222 316 GDALSetRasterNoDataValue = (CPLErr (*)(GDALRasterBandH, double)) 223 GBGetSymbol ( szPath, "GDALSetRasterNoDataValue");317 GBGetSymbolCheck( szPath, "GDALSetRasterNoDataValue", apszFailed ); 224 318 225 319 GDALGetRasterColorInterpretation = (GDALColorInterp (*)(GDALRasterBandH)) 226 GBGetSymbol ( szPath, "GDALGetRasterColorInterpretation");320 GBGetSymbolCheck( szPath, "GDALGetRasterColorInterpretation", apszFailed ); 227 321 228 322 GDALGetColorInterpretationName = (const char *(*)(GDALColorInterp)) 229 GBGetSymbol ( szPath, "GDALGetColorInterpretationName");323 GBGetSymbolCheck( szPath, "GDALGetColorInterpretationName", apszFailed ); 230 324 231 325 GDALGetRasterColorTable = (GDALColorTableH (*)(GDALRasterBandH)) 232 GBGetSymbol ( szPath, "GDALGetRasterColorTable");326 GBGetSymbolCheck( szPath, "GDALGetRasterColorTable", apszFailed ); 233 327 234 328 GDALCreateProjDef = (GDALProjDefH (*)(const char *)) 235 GBGetSymbol ( szPath, "GDALCreateProjDef");329 GBGetSymbolCheck( szPath, "GDALCreateProjDef", apszFailed ); 236 330 237 331 GDALReprojectToLongLat = (CPLErr (*)(GDALProjDefH, double *, double *)) 238 GBGetSymbol ( szPath, "GDALReprojectToLongLat");332 GBGetSymbolCheck( szPath, "GDALReprojectToLongLat", apszFailed ); 239 333 240 334 GDALReprojectFromLongLat = (CPLErr (*)(GDALProjDefH, double *, double *)) 241 GBGetSymbol ( szPath, "GDALReprojectFromLongLat");335 GBGetSymbolCheck( szPath, "GDALReprojectFromLongLat", apszFailed ); 242 336 243 337 GDALDestroyProjDef = (void (*)(GDALProjDefH)) 244 GBGetSymbol ( szPath, "GDALDestroyProjDef");338 GBGetSymbolCheck( szPath, "GDALDestroyProjDef", apszFailed ); 245 339 246 340 GDALDecToDMS = (const char *(*)(double, const char *, int )) 247 GBGetSymbol ( szPath, "GDALDecToDMS");341 GBGetSymbolCheck( szPath, "GDALDecToDMS", apszFailed ); 248 342 249 343 GDALGetPaletteInterpretation = (GDALPaletteInterp (*)(GDALColorTableH)) 250 GBGetSymbol ( szPath, "GDALGetPaletteInterpretation");344 GBGetSymbolCheck( szPath, "GDALGetPaletteInterpretation", apszFailed ); 251 345 252 346 GDALGetPaletteInterpretationName = (const char *(*)(GDALPaletteInterp)) 253 GBGetSymbol ( szPath, "GDALGetPaletteInterpretationName");347 GBGetSymbolCheck( szPath, "GDALGetPaletteInterpretationName", apszFailed ); 254 348 255 349 GDALGetColorEntryCount = (int (*)(GDALColorTableH)) 256 GBGetSymbol ( szPath, "GDALGetColorEntryCount");350 GBGetSymbolCheck( szPath, "GDALGetColorEntryCount", apszFailed ); 257 351 258 352 GDALGetColorEntry = (const GDALColorEntry *(*)(GDALColorTableH,int)) 259 GBGetSymbol ( szPath, "GDALGetColorEntry");353 GBGetSymbolCheck( szPath, "GDALGetColorEntry", apszFailed ); 260 354 261 355 GDALGetColorEntryAsRGB = (int (*)(GDALColorTableH,int, 262 356 GDALColorEntry*)) 263 GBGetSymbol ( szPath, "GDALGetColorEntryAsRGB");357 GBGetSymbolCheck( szPath, "GDALGetColorEntryAsRGB", apszFailed ); 264 358 265 359 GDALSetColorEntry = (void (*)(GDALColorTableH, int, const GDALColorEntry*)) 266 GBGetSymbol ( szPath, "GDALSetColorEntry");360 GBGetSymbolCheck( szPath, "GDALSetColorEntry", apszFailed ); 267 361 268 362 /* -------------------------------------------------------------------- */ … … 270 364 /* -------------------------------------------------------------------- */ 271 365 OSRNewSpatialReference = (OGRSpatialReferenceH (*)( const char * )) 272 GBGetSymbol ( szPath, "OSRNewSpatialReference");366 GBGetSymbolCheck( szPath, "OSRNewSpatialReference", apszFailed ); 273 367 274 368 OSRCloneGeogCS = (OGRSpatialReferenceH (*)(OGRSpatialReferenceH)) 275 GBGetSymbol ( szPath, "OSRCloneGeogCS");369 GBGetSymbolCheck( szPath, "OSRCloneGeogCS", apszFailed ); 276 370 277 371 OSRDestroySpatialReference = (void (*)(OGRSpatialReferenceH)) 278 GBGetSymbol ( szPath, "OSRDestroySpatialReference");372 GBGetSymbolCheck( szPath, "OSRDestroySpatialReference", apszFailed ); 279 373 280 374 OSRReference = (int (*)(OGRSpatialReferenceH)) 281 GBGetSymbol ( szPath, "OSRReference");375 GBGetSymbolCheck( szPath, "OSRReference", apszFailed ); 282 376 283 377 OSRDereference = (int (*)(OGRSpatialReferenceH)) 284 GBGetSymbol ( szPath, "OSRDereference");378 GBGetSymbolCheck( szPath, "OSRDereference", apszFailed ); 285 379 286 380 OSRImportFromEPSG = (OGRErr (*)(OGRSpatialReferenceH,int)) 287 GBGetSymbol ( szPath, "OSRImportFromEPSG");381 GBGetSymbolCheck( szPath, "OSRImportFromEPSG", apszFailed ); 288 382 289 383 OSRImportFromWkt = (OGRErr (*)(OGRSpatialReferenceH,char **)) 290 GBGetSymbol ( szPath, "OSRImportFromWkt");384 GBGetSymbolCheck( szPath, "OSRImportFromWkt", apszFailed ); 291 385 292 386 OSRImportFromProj4 = (OGRErr (*)(OGRSpatialReferenceH,const char *)) 293 GBGetSymbol ( szPath, "OSRImportFromProj4");387 GBGetSymbolCheck( szPath, "OSRImportFromProj4", apszFailed ); 294 388 295 389 OSRExportToWkt = (OGRErr (*)(OGRSpatialReferenceH, char **)) 296 GBGetSymbol ( szPath, "OSRExportToWkt");390 GBGetSymbolCheck( szPath, "OSRExportToWkt", apszFailed ); 297 391 298 392 OSRExportToPrettyWkt = (OGRErr (*)(OGRSpatialReferenceH, char **, int)) 299 GBGetSymbol ( szPath, "OSRExportToPrettyWkt");393 GBGetSymbolCheck( szPath, "OSRExportToPrettyWkt", apszFailed ); 300 394 301 395 OSRExportToProj4 = (OGRErr (*)(OGRSpatialReferenceH, char **)) 302 GBGetSymbol ( szPath, "OSRExportToProj4");396 GBGetSymbolCheck( szPath, "OSRExportToProj4", apszFailed ); 303 397 304 398 OSRSetAttrValue = (OGRErr (*)(OGRSpatialReferenceH, const char *, 305 399 const char *)) 306 GBGetSymbol ( szPath, "OSRSetAttrValue");400 GBGetSymbolCheck( szPath, "OSRSetAttrValue", apszFailed ); 307 401 308 402 OSRGetAttrValue = (const char *(*)(OGRSpatialReferenceH, const char *,int)) 309 GBGetSymbol ( szPath, "OSRGetAttrValue");403 GBGetSymbolCheck( szPath, "OSRGetAttrValue", apszFailed ); 310 404 311 405 OSRSetLinearUnits = (OGRErr (*)(OGRSpatialReferenceH, const char *,double)) 312 GBGetSymbol ( szPath, "OSRSetLinearUnits");406 GBGetSymbolCheck( szPath, "OSRSetLinearUnits", apszFailed ); 313 407 314 408 OSRGetLinearUnits = (double (*)(OGRSpatialReferenceH, char **)) 315 GBGetSymbol ( szPath, "OSRGetLinearUnits");409 GBGetSymbolCheck( szPath, "OSRGetLinearUnits", apszFailed ); 316 410 317 411 OSRIsGeographic = (int (*)(OGRSpatialReferenceH)) 318 GBGetSymbol ( szPath, "OSRIsGeographic");412 GBGetSymbolCheck( szPath, "OSRIsGeographic", apszFailed ); 319 413 320 414 OSRIsProjected = (int (*)(OGRSpatialReferenceH)) 321 GBGetSymbol ( szPath, "OSRIsProjected");415 GBGetSymbolCheck( szPath, "OSRIsProjected", apszFailed ); 322 416 323 417 OSRIsSameGeogCS = (int (*)(OGRSpatialReferenceH,OGRSpatialReferenceH)) 324 GBGetSymbol ( szPath, "OSRIsSameGeogCS");418 GBGetSymbolCheck( szPath, "OSRIsSameGeogCS", apszFailed ); 325 419 326 420 OSRIsSame = (int (*)(OGRSpatialReferenceH,OGRSpatialReferenceH)) 327 GBGetSymbol ( szPath, "OSRIsSame");421 GBGetSymbolCheck( szPath, "OSRIsSame", apszFailed ); 328 422 329 423 OSRSetProjCS = (OGRErr (*)(OGRSpatialReferenceH,const char*)) 330 GBGetSymbol ( szPath, "OSRSetProjCS");424 GBGetSymbolCheck( szPath, "OSRSetProjCS", apszFailed ); 331 425 332 426 OSRSetWellKnownGeogCS = (OGRErr (*)(OGRSpatialReferenceH, const char *)) 333 GBGetSymbol ( szPath, "OSRSetWellKnownGeogCS");427 GBGetSymbolCheck( szPath, "OSRSetWellKnownGeogCS", apszFailed ); 334 428 335 429 OSRSetGeogCS = (OGRErr (*)( OGRSpatialReferenceH hSRS, … … 342 436 const char * pszUnits /* = NULL */, 343 437 double dfConvertToRadians /* = 0.0 */ )) 344 GBGetSymbol ( szPath, "OSRSetGeogCS");438 GBGetSymbolCheck( szPath, "OSRSetGeogCS", apszFailed ); 345 439 346 440 OSRGetSemiMajor = (double (*)(OGRSpatialReferenceH, OGRErr *)) 347 GBGetSymbol ( szPath, "OSRGetSemiMajor");441 GBGetSymbolCheck( szPath, "OSRGetSemiMajor", apszFailed ); 348 442 349 443 OSRGetSemiMinor = (double (*)(OGRSpatialReferenceH, OGRErr *)) 350 GBGetSymbol ( szPath, "OSRGetSemiMinor");444 GBGetSymbolCheck( szPath, "OSRGetSemiMinor", apszFailed ); 351 445 352 446 OSRGetInvFlattening = (double (*)(OGRSpatialReferenceH, OGRErr *)) 353 GBGetSymbol ( szPath, "OSRGetInvFlattening");447 GBGetSymbolCheck( szPath, "OSRGetInvFlattening", apszFailed ); 354 448 355 449 OSRSetAuthority = (OGRErr (*)(OGRSpatialReferenceH, const char *, 356 450 const char *, int)) 357 GBGetSymbol ( szPath, "OSRSetAuthority");451 GBGetSymbolCheck( szPath, "OSRSetAuthority", apszFailed ); 358 452 359 453 OSRSetProjParm = (OGRErr (*)(OGRSpatialReferenceH, const char *, double)) 360 GBGetSymbol ( szPath, "OSRSetProjParm");454 GBGetSymbolCheck( szPath, "OSRSetProjParm", apszFailed ); 361 455 362 456 OSRGetProjParm = (double (*)(OGRSpatialReferenceH, const char *, 363 457 double, OGRErr *)) 364 GBGetSymbol ( szPath, "OSRGetProjParm");458 GBGetSymbolCheck( szPath, "OSRGetProjParm", apszFailed ); 365 459 366 460 OSRSetUTM = (OGRErr (*)(OGRSpatialReferenceH, int, int)) 367 GBGetSymbol ( szPath, "OSRSetUTM");461 GBGetSymbolCheck( szPath, "OSRSetUTM", apszFailed ); 368 462 369 463 OSRGetUTMZone = (int (*)(OGRSpatialReferenceH, int *)) 370 GBGetSymbol( szPath, "OSRGetUTMZone" ); 371 372 return TRUE; 464 GBGetSymbolCheck( szPath, "OSRGetUTMZone", apszFailed ); 465 466 /* -------------------------------------------------------------------- */ 467 /* Did we fail to find any entry points? */ 468 /* -------------------------------------------------------------------- */ 469 if( apszFailed[0] != NULL && fpReportFailure != NULL ) 470 { 471 int iError; 472 473 fprintf( fpReportFailure, 474 "While a GDAL .DLL/.so was found at `%s'\n" 475 "it appears to be missing the following entry points.\n" 476 "Consider upgrading to a more recent GDAL library.\n", 477 szPath ); 478 479 for( iError = 0; apszFailed[iError] != NULL; iError++ ) 480 { 481 fprintf( fpReportFailure, " o %s\n", apszFailed[iError] ); 482 free( apszFailed[iError] ); 483 } 484 } 485 486 return apszFailed[0] == NULL; 373 487 } 374 488 489 trunk/bridge/gdalbridge.h
r2455 r2459 31 31 * 32 32 * $Log$ 33 * Revision 1.1 0 2001/09/06 01:54:31 warmerda34 * added gcp functions33 * Revision 1.11 2001/09/06 14:03:21 warmerda 34 * upgrade bridge error reporting 35 35 * 36 36 * Revision 1.8 2000/11/09 16:25:30 warmerda … … 63 63 extern "C" { 64 64 #endif 65 66 #include <stdio.h> 65 67 66 68 /* ==================================================================== */ … … 660 662 /* returns TRUE if it succeeds, or FALSE otherwise. */ 661 663 /* -------------------------------------------------------------------- */ 662 int GDALBridgeInitialize( const char * );664 int GDALBridgeInitialize( const char *, FILE * ); 663 665 void *GBGetSymbol( const char *, const char * ); 664 666
