mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
remove conflicts
This commit is contained in:
parent
87497d79cf
commit
64111c7f5e
@ -78,6 +78,8 @@ NCD4_parcelvars(NCD4meta* meta, NCD4response* resp)
|
||||
var->data.response = resp; /* cross link */
|
||||
}
|
||||
done:
|
||||
nclistfree(toplevel);
|
||||
nullfree(offset);
|
||||
return THROW(ret);
|
||||
}
|
||||
|
||||
@ -421,6 +423,7 @@ NCD4_inferChecksums(NCD4meta* meta, NCD4response* resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
nclistfree(toplevel);
|
||||
resp->attrchecksumming = (attrfound ? 1 : 0);
|
||||
/* Infer checksums */
|
||||
resp->inferredchecksumming = ((resp->attrchecksumming || resp->querychecksumming) ? 1 : 0);
|
||||
|
@ -546,6 +546,7 @@ NCD4_newInfo(NCD4INFO** d4infop)
|
||||
if((info = calloc(1,sizeof(NCD4INFO)))==NULL)
|
||||
{ret = NC_ENOMEM; goto done;}
|
||||
info->platform.hostlittleendian = NCD4_isLittleEndian();
|
||||
info->responses = nclistnew();
|
||||
if(d4infop) {*d4infop = info; info = NULL;}
|
||||
done:
|
||||
if(info) NCD4_reclaimInfo(info);
|
||||
@ -570,13 +571,12 @@ NCD4_reclaimInfo(NCD4INFO* d4info)
|
||||
nclistfree(d4info->blobs);
|
||||
/* Reclaim dmr node tree */
|
||||
NCD4_reclaimMeta(d4info->dmrmetadata);
|
||||
/* Reclaim all responses */
|
||||
for(i=0;i<nclistlength(d4info->responses);i++) {
|
||||
NCD4response* resp = nclistget(d4info->responses,i);
|
||||
NCD4_reclaimResponse(resp);
|
||||
}
|
||||
nclistfree(d4info->responses);
|
||||
/* Reclaim all responses */
|
||||
NCD4_resetMeta(d4info->dmrmetadata);
|
||||
free(d4info);
|
||||
}
|
||||
|
||||
@ -597,10 +597,9 @@ NCD4_resetInfoForRead(NCD4INFO* d4info)
|
||||
*/
|
||||
if(d4info->substrate.filename != NULL) {
|
||||
unlink(d4info->substrate.filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
NCD4_resetMeta(d4info->dmrmetadata);
|
||||
nullfree(d4info->dmrmetadata);
|
||||
NCD4_reclaimMeta(d4info->dmrmetadata);
|
||||
d4info->dmrmetadata = NULL;
|
||||
}
|
||||
|
||||
@ -641,50 +640,8 @@ NCD4_reclaimResponse(NCD4response* d4resp)
|
||||
d4resp->controller = NULL; /* break link */
|
||||
|
||||
nullfree(d4resp->raw.memory);
|
||||
|
||||
nullfree(serial->errdata);
|
||||
nullfree(serial->dmr);
|
||||
nullfree(serial->dap);
|
||||
/* clear all fields */
|
||||
memset(serial,0,sizeof(struct NCD4serial));
|
||||
|
||||
nullfree(d4resp->error.parseerror);
|
||||
nullfree(d4resp->error.message);
|
||||
nullfree(d4resp->error.context);
|
||||
nullfree(d4resp->error.otherinfo);
|
||||
memset(&d4resp->error,0,sizeof(d4resp->error));
|
||||
|
||||
free(d4resp);
|
||||
}
|
||||
|
||||
|
||||
/* Create an empty NCD4meta object for
|
||||
use in subsequent calls
|
||||
(is the the right src file to hold this?)
|
||||
*/
|
||||
|
||||
int
|
||||
NCD4_newMeta(NCD4INFO* info, NCD4meta** metap)
|
||||
{
|
||||
int ret = NC_NOERR;
|
||||
NCD4meta* meta = (NCD4meta*)calloc(1,sizeof(NCD4meta));
|
||||
if(meta == NULL) return NC_ENOMEM;
|
||||
meta->allnodes = nclistnew();
|
||||
#ifdef D4DEBUG
|
||||
meta->debuglevel = 1;
|
||||
#endif
|
||||
meta->controller = info;
|
||||
meta->ncid = info->substrate.nc4id; /* Transfer netcdf ncid */
|
||||
if(metap) {*metap = meta; meta = NULL;}
|
||||
return THROW(ret);
|
||||
}
|
||||
|
||||
void
|
||||
NCD4_reclaimMeta(NCD4meta* dataset)
|
||||
{
|
||||
int i;
|
||||
if(dataset == NULL) return;
|
||||
NCD4_resetMeta(dataset);
|
||||
nullfree(serial->errdata);
|
||||
|
||||
for(i=0;i<nclistlength(dataset->allnodes);i++) {
|
||||
NCD4node* node = (NCD4node*)nclistget(dataset->allnodes,i);
|
||||
@ -696,6 +653,7 @@ NCD4_reclaimMeta(NCD4meta* dataset)
|
||||
free(dataset);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
NCD4_resetMeta(NCD4meta* dataset)
|
||||
{
|
||||
@ -708,3 +666,4 @@ NCD4_resetMeta(NCD4meta* dataset)
|
||||
nclistfree(dataset->blobs);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -228,7 +228,8 @@ traverse(NCD4parser* parser, ncxml_t dom)
|
||||
if((ret=makeNode(parser,NULL,NULL,NCD4_GROUP,NC_NULL,&parser->metadata->root))) goto done;
|
||||
parser->metadata->root->group.isdataset = 1;
|
||||
parser->metadata->root->meta.id = parser->metadata->ncid;
|
||||
parser->metadata->groupbyid = nclistnew();
|
||||
if(parser->metadata->groupbyid == NULL)
|
||||
parser->metadata->groupbyid = nclistnew();
|
||||
SETNAME(parser->metadata->root,"/");
|
||||
xattr = ncxml_attr(dom,"name");
|
||||
if(xattr != NULL) parser->metadata->root->group.datasetname = xattr;
|
||||
|
@ -286,15 +286,9 @@ static int
|
||||
mapvars(NCD4meta* dapmeta, NCD4meta* dmrmeta, int inferredchecksumming)
|
||||
{
|
||||
int i, ret = NC_NOERR;
|
||||
NCD4node* dmrroot = dmrmeta->root;
|
||||
NClist* dmrtop = NULL; /* top variables in dmr tree */
|
||||
NCD4node* daproot = dapmeta->root;
|
||||
NClist* daptop = NULL; /* top variables in dap tree */
|
||||
|
||||
/* Get top level variables from the dmr node tree */
|
||||
dmrtop = nclistnew();
|
||||
NCD4_getToplevelVars(dmrmeta,dmrroot,dmrtop);
|
||||
|
||||
/* Get top level variables from the dap node tree */
|
||||
daptop = nclistnew();
|
||||
NCD4_getToplevelVars(dapmeta,daproot,daptop);
|
||||
@ -311,5 +305,6 @@ mapvars(NCD4meta* dapmeta, NCD4meta* dmrmeta, int inferredchecksumming)
|
||||
}
|
||||
|
||||
done:
|
||||
nclistfree(daptop);
|
||||
return THROW(ret);
|
||||
}
|
||||
|
@ -388,11 +388,11 @@ NCD4_inq_attname(int ncid, int varid, int attnum, char* name)
|
||||
const NC_reservedatt* rsvp = NULL;
|
||||
|
||||
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
|
||||
substrateid = makenc4id(ncp,ncid);
|
||||
ret = nc_inq_attname(substrateid, varid, attnum, name);
|
||||
/* Is this a reserved attribute name? */
|
||||
if(name && (rsvp = NCD4_lookupreserved(name)))
|
||||
return NC_EATTMETA;
|
||||
substrateid = makenc4id(ncp,ncid);
|
||||
ret = nc_inq_attname(substrateid, varid, attnum, name);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user