- Fixed missalignment in TAS scan messages

- Fixed a counting/driving race in devexec
- Fixed some problems with sanscheck


SKIPPED:
	psi/tasscan.c
	psi/utils/check/amorcheck
	psi/utils/check/dmccheck
	psi/utils/check/focuscheck
	psi/utils/check/hrptcheck
	psi/utils/check/sanscheck
	psi/utils/check/sicssyntaxlib.tcl
	psi/utils/check/topsicheck
	psi/utils/check/tricscheck
This commit is contained in:
cvs
2003-11-25 10:29:21 +00:00
parent 04bb17e56c
commit 90b5e37552
6 changed files with 220 additions and 124 deletions

281
napi5.c
View File

@@ -53,6 +53,11 @@
char iAccess[2];
} NexusFile5, *pNexusFile5;
/*
forward declaration of NX5closegroup in order to get rid of a nasty
warning
*/
NXstatus CALLING_STYLE NX5closegroup (NXhandle fid);
/*--------------------------------------------------------------------*/
@@ -116,14 +121,12 @@
unsigned int vers_major, vers_minor, vers_release, am1 ;
hid_t fapl;
int mdc_nelmts;
unsigned long rdcc_nelmts;
int rdcc_nelmts;
size_t rdcc_nbytes;
double rdcc_w0;
/* turn off the automatic HDF error handling */
H5Eset_auto(NULL,NULL);
/* turn off the automatic HDF error handling */
H5Eset_auto(NULL,NULL);
#ifdef USE_FTIME
struct timeb timeb_struct;
#endif
@@ -193,6 +196,12 @@
iRet=H5Pget_cache(fapl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
rdcc_nbytes=(size_t)cacheSize;
iRet = H5Pset_cache(fapl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
/*
setting the close degree is absolutely necessary in HDF5
versions > 1.6. If you use a lessere version and the compiler
complains, comment it out but keep this in mind.
*/
H5Pset_fclose_degree(fapl,H5F_CLOSE_STRONG);
am1 = H5F_ACC_TRUNC;
pNew->iFID = H5Fcreate (filename, am1, H5P_DEFAULT, fapl);
} else {
@@ -331,7 +340,8 @@
pNexusFile5 pFile = NULL;
int iRet;
pFile=NXI5assert(*fid);
pFile=NXI5assert(*fid);
iRet=0;
iRet = H5Fclose(pFile->iFID);
if (iRet < 0) {
@@ -347,6 +357,7 @@
}
free (pFile);
*fid = NULL;
H5garbage_collect();
return NX_OK;
}
@@ -1139,7 +1150,68 @@
}
return 1;
}
/* --------------------------------------------------------------------- */
/* Operator function. */
herr_t group_info1(hid_t loc_id, const char *name, void *opdata)
{
NexusFile5 self;
H5G_stat_t statbuf;
self.iNX = *((int*)opdata);
H5Gget_objinfo(loc_id, name, 0, &statbuf);
switch (statbuf.type)
{
case H5G_GROUP:
self.iNX++;
*((int*)opdata)=self.iNX;
break;
case H5G_DATASET:
self.iNX++;
*((int*)opdata)=self.iNX;
break;
}
return 0;
}
/*-------------------------------------------------------------------------*/
NXstatus CALLING_STYLE NX5getgroupinfo (NXhandle fid, int *iN, NXname pName, NXname pClass)
{
pNexusFile5 pFile;
hid_t atype,attr_id;
char data[64];
int iRet;
pFile = NXI5assert (fid);
/* check if there is a group open */
if (pFile->iCurrentG == 0) {
strcpy (pName, "root");
strcpy (pClass, "NXroot");
pFile->iNX=0;
iRet=H5Giterate(pFile->iFID,"/",0,group_info1,&pFile->iNX);
*iN=pFile->iNX;
}
else {
strcpy (pName,pFile->name_ref);
attr_id = H5Aopen_name(pFile->iCurrentG,"NX_class");
if (attr_id<0) {
strcpy(pClass,"non");
} else {
atype=H5Tcopy(H5T_C_S1);
H5Tset_size(atype,64);
H5Aread(attr_id, atype, data);
strcpy(pClass,data);
pFile->iNX=0;
iRet=H5Giterate(pFile->iFID,pFile->name_ref,0,group_info1, &pFile->iNX);
*iN=pFile->iNX;
H5Aclose(attr_id);
}
}
return NX_OK;
}
/*-------------------------------------------------------------------------*/
NXstatus CALLING_STYLE NX5getnextentry (NXhandle fid,NXname name, NXname nxclass, int *datatype)
@@ -1151,6 +1223,7 @@
char data[128];
char ph_name[1024];
info_type op_data;
int iRet_iNX=-1;
pFile = NXI5assert (fid);
op_data.iname = NULL;
@@ -1161,6 +1234,18 @@
}
iRet=H5Giterate(pFile->iFID,pFile->name_ref,&idx,nxgroup_info,&op_data);
strcpy(nxclass,"");
if (pFile->iCurrentG == 0) {
pFile->iNX=0;
iRet_iNX = H5Giterate(pFile->iFID,"/",0,group_info1,&pFile->iNX);
} else {
pFile->iNX=0;
iRet_iNX = H5Giterate(pFile->iFID,pFile->name_ref,0,group_info1, &pFile->iNX);
}
if (idx == pFile->iNX) {
iRet_iNX = 2;
}
if (iRet > 0)
{
pFile->iStack5[pFile->iStackPtr].iCurrentIDX++;
@@ -1245,23 +1330,22 @@
H5Tclose(atype);
H5Dclose(grp);
}
return NX_OK;
}
else if (iRet==0)
{
if (op_data.iname != NULL) {
free(op_data.iname);
}
pFile->iStack5[pFile->iStackPtr].iCurrentIDX = 0;
return NX_EOD;
}
return NX_OK;
}
else
{
if (iRet_iNX == 2) {
if (op_data.iname != NULL) {
free(op_data.iname);
}
pFile->iStack5[pFile->iStackPtr].iCurrentIDX = 0;
return NX_EOD;
}
if (op_data.iname != NULL) {
free(op_data.iname);
}
NXIReportError (NXpData,
"ERROR: Iteration was not successful");
"ERROR: Iteration (directory) was not successful");
return NX_ERROR;
}
}
@@ -1567,16 +1651,42 @@
int iPType,rank;
char *iname = NULL;
unsigned int idx;
int intern_idx=-1;
pFile = NXI5assert (fileid);
idx=pFile->iAtt5.iCurrentIDX;
iRet=0;
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
{
/* global attribute */
pFile->iVID=H5Gopen(pFile->iFID,"/");
iRet=H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
intern_idx=H5Aget_num_attrs(pFile->iVID);
if (intern_idx > idx) {
iRet=H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
}
else
{
iRet=0;
}
intern_idx=-1;
if (iRet < 0) {
NXIReportError (NXpData, "ERROR iterating through ROOT Attr. list!");
return NX_ERROR;
}
} else {
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
intern_idx=H5Aget_num_attrs(pFile->iCurrentD);
if (intern_idx > idx) {
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
}
else
{
iRet=0;
}
intern_idx=-1;
if (iRet < 0) {
NXIReportError (NXpData, "ERROR iterating through Attr. list!");
return NX_ERROR;
}
}
if (iRet>0)
{
@@ -1650,31 +1760,28 @@
H5Tclose(atype);
H5Sclose(aspace);
H5Aclose(pFile->iCurrentA);
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
{
/* close group for global attribute */
H5Gclose(pFile->iVID);
}
return NX_OK;
}
else if (iRet==0)
{
if (iname != NULL) {
free(iname);
}
if (idx == 0)
{
pFile->iAtt5.iCurrentIDX = 0;
return NX_EOD;
}
pFile->iAtt5.iCurrentIDX = 0;
return NX_EOD;
}
}
else
{
if (iname != NULL) {
free(iname);
}
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
{
/* global attribute */
intern_idx=H5Aget_num_attrs(pFile->iVID);
} else {
if (pFile->iCurrentD>0){
intern_idx=H5Aget_num_attrs(pFile->iCurrentD);
} else {
intern_idx=H5Aget_num_attrs(pFile->iCurrentG);
}
}
if ((intern_idx == 0)||(intern_idx == idx)) {
pFile->iAtt5.iCurrentIDX = 0;
if (iname != NULL) {
free(iname);
}
return NX_EOD;
}
NXIReportError (NXpData,
"ERROR: Iteration was not successful");
return NX_ERROR;
@@ -1792,33 +1899,42 @@
pNexusFile5 pFile;
char *iname = NULL;
unsigned int idx;
int iRet;
herr_t iRet;
pFile = NXI5assert (fid);
idx=0;
*iN = idx;
if (pFile->iCurrentD == 0 && pFile->iCurrentG == 0) {
/*
global attribute
*/
pFile->iVID=H5Gopen(pFile->iFID,"/");
iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
iRet = 1;
while (iRet != 0) {
iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
}
if (iRet < 0) {
NXIReportError (NXpData, "iterating ERROR!");
return NX_ERROR;
}
idx=H5Aget_num_attrs(pFile->iVID);
if (idx > 0) {
*iN = idx;
} else {
*iN = 1;
}
/*
if (iname != NULL) {
free(iname);
}
}
*/
return NX_OK;
}
else
{
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
if (pFile->iCurrentD>0) {
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
} else {
iRet=H5Aiterate(pFile->iCurrentG,&idx,attr_info,&iname);
}
}
if (iRet<0) {
NXIReportError (NXpData, "Attribute number cannot be fixed!");
@@ -1828,84 +1944,17 @@
*iN=idx;
return NX_OK;
}
iRet = 1;
while (iRet != 0) {
iRet = H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
}
idx=H5Aget_num_attrs(pFile->iCurrentD);
if (idx > 0) {
*iN = idx;
} else {
*iN = 1;
}
if (iname != NULL) {
free(iname);
}
return NX_OK;
}
/* --------------------------------------------------------------------- */
/* Operator function. */
herr_t group_info1(hid_t loc_id, const char *name, void *opdata)
{
NexusFile5 self;
H5G_stat_t statbuf;
self.iNX = *((int*)opdata);
H5Gget_objinfo(loc_id, name, 0, &statbuf);
switch (statbuf.type)
{
case H5G_GROUP:
self.iNX++;
*((int*)opdata)=self.iNX;
break;
case H5G_DATASET:
self.iNX++;
*((int*)opdata)=self.iNX;
break;
}
return 0;
}
/*-------------------------------------------------------------------------*/
NXstatus CALLING_STYLE NX5getgroupinfo (NXhandle fid, int *iN, NXname pName, NXname pClass)
{
pNexusFile5 pFile;
hid_t atype,attr_id;
char data[64];
int iRet;
pFile = NXI5assert (fid);
/* check if there is a group open */
if (pFile->iCurrentG == 0) {
strcpy (pName, "root");
strcpy (pClass, "NXroot");
pFile->iNX=0;
iRet=H5Giterate(pFile->iFID,"/",0,group_info1,&pFile->iNX);
*iN=pFile->iNX;
}
else {
strcpy (pName,pFile->name_ref);
attr_id = H5Aopen_name(pFile->iCurrentG,"NX_class");
if (attr_id<0) {
strcpy(pClass,"non");
} else {
atype=H5Tcopy(H5T_C_S1);
H5Tset_size(atype,64);
H5Aread(attr_id, atype, data);
strcpy(pClass,data);
pFile->iNX=0;
iRet=H5Giterate(pFile->iFID,pFile->name_ref,0,group_info1, &pFile->iNX);
*iN=pFile->iNX;
H5Aclose(attr_id);
}
}
return NX_OK;
}
/*-------------------------------------------------------------------------*/
NXstatus CALLING_STYLE NX5getgroupID (NXhandle fileid, NXlink* sRes)