|
Hello List, I’m having trouble writing C code to access a
virtual dataset. Below is part of
example5 from the C library manual.
I am not able to get execution to get to my printf
(“d”) statement, with execution hanging in the vds_mmopen
statement. I would appreciate any suggestions, Thanks, Andrew Compiled with VC6 cl
example5.c /Ic:\ermapper62\include /link c:\ermapper62\lib\win32\ermapper.lib Windows XP Ermapper
6.3 /**************************************************************** *
* *****************************************************************
example5.c -
ermapper VDS example */ #include "ers.h" void
main( int argc, char *argv[] ) {
DatasetHeader *p_dshdr_src, *p_dshdr_dest;
VDataset *p_vds;
DatasetHeader *p_ds;
int err;
int i;
IEEE8 null_cell;
/* Check user input */
if ( argc !=3 ){ fprintf(stderr,"%s Usage: %s src.ers
dest.ers\n",argv[0],argv[0]); exit(EXIT_FAILURE);
}
/* initialise ERM process engine */
if ( PE_initialise(argv[0]) != ERS_SUCCESS){ fprintf(stderr, "%s Error: Unable to initialise process
engine: %s\n", argv[0], ERS_error_text()); exit(EXIT_FAILURE);
} printf("a");
/* get virtual dataset header */
if ( eg_dshdr(&p_dshdr_src, argv[1]) !=
ERS_SUCCESS ){ fprintf(stderr,"%s Error: Unable to get dataset header:
%s\n", argv[1], ERS_error_text()); exit(1);
} printf("b");
/* copy dataset headers */
cp_dshdr(&p_dshdr_dest, p_dshdr_src);
safe_free(p_dshdr_dest->name);
safe_free(p_dshdr_dest->datafile);
p_dshdr_dest->name = strsave(argv[2]); /* ERS_fspec_without_extent(&p_dshdr_dest->datafile,p_dshdr_dest->name);*/ printf("c");
/* open VDS */
if ( vds_mmopen(&p_vds, p_dshdr_src, 0, p_dshdr_src->u.ri.nr_lines,
0, p_dshdr_src->u.ri.cells_per_line,
NULL, p_dshdr_src->u.ri.nr_bands,
p_dshdr_src->u.ri.celltype )
!= ERS_SUCCESS ){ printf("c1"); fprintf(stderr,"%s Error: Unable to open virtual data: %s\n",argv[0], ERS_error_text()); exit(1);
} printf("d");
/* close and tidy up datasets */
vds_mmclose(&p_vds);
/* done */ printf("e"); } |
- RE: C Code examples -VDS, example 5 ermapperlist
- RE: C Code examples -VDS, example 5 Mike Dunne
- RE: C Code examples -VDS, example 5 ermapperlist
- RE: C Code examples -VDS, example 5 Stuart Nixon
