Changeset 1375
- Timestamp:
- 29/10/09 10:59:48 (3 years ago)
- Location:
- trunk
- Files:
-
- 27 edited
-
bindings/cpp/NeXusFile.cpp (modified) (1 diff)
-
bindings/cpp/NeXusFile.hpp (modified) (1 diff)
-
bindings/f77/napif.f (modified) (1 diff)
-
bindings/f77/napif.inc (modified) (3 diffs)
-
bindings/idl/NeXusIDL-API.c (modified) (2 diffs)
-
bindings/idl/NeXusIDL-API.dlm (modified) (1 diff)
-
bindings/java/native/NexusFile.c (modified) (2 diffs)
-
bindings/java/org/nexusformat/NeXusFileInterface.java (modified) (1 diff)
-
bindings/java/org/nexusformat/NexusFile.java (modified) (2 diffs)
-
bindings/swig/nxinter.i (modified) (1 diff)
-
bindings/swig/nxinterhelper.c (modified) (1 diff)
-
bindings/swig/nxinterhelper.h (modified) (1 diff)
-
include/napi.h (modified) (5 diffs)
-
src/Makefile.am (modified) (1 diff)
-
src/napi.c (modified) (12 diffs)
-
src/nexus_symbols.txt (modified) (2 diffs)
-
src/nxstack.c (modified) (5 diffs)
-
src/nxstack.h (modified) (3 diffs)
-
test/data/dmc01.h5 (modified) (previous)
-
test/data/dmc01.hdf (modified) (previous)
-
test/data/dmc02.h5 (modified) (previous)
-
test/data/dmc02.hdf (modified) (previous)
-
test/napi_test.c (modified) (4 diffs)
-
test/napi_test_cpp.cxx (modified) (1 diff)
-
test/napif4_test.f (modified) (4 diffs)
-
test/napif5_test.f (modified) (4 diffs)
-
test/napif_test.f (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bindings/cpp/NeXusFile.cpp
r1264 r1375 230 230 throw Exception(msg.str(), status); 231 231 } 232 } 233 234 std::string File::getPath(){ 235 char cPath[1024]; 236 237 memset(cPath,0,1024*sizeof(char)); 238 NXstatus status = NXgetpath(this->m_file_id,cPath, 1024); 239 if (status != NX_OK) { 240 stringstream msg; 241 msg << "NXgetpath() failed"; 242 throw Exception(msg.str(), status); 243 } 244 return std::string(cPath); 232 245 } 233 246 -
trunk/bindings/cpp/NeXusFile.hpp
r1263 r1375 191 191 */ 192 192 void openGroupPath(const std::string& path); 193 /** 194 * Get the path into the current file 195 * \return A unix like path string pointing to the current 196 * position in the file 197 */ 198 std::string getPath(); 193 199 194 200 /** -
trunk/bindings/f77/napif.f
r848 r1375 121 121 CALL EXTRACT_STRING(IPATH, 256, PATH) 122 122 NXOPENPATH = NXIOPENPATH(FILEID, IPATH) 123 END 124 125 INTEGER FUNCTION NXGETPATH(FILEID, PATH) 126 INTEGER FILEID(*),NXIGETPATH, NXIFGETPATH 127 CHARACTER*(*) PATH 128 INTEGER*1 IPATH(1024) 129 INTEGER PLEN 130 EXTERNAL NXIFGETPATH 131 PLEN = 1024 132 NXGETPATH = NXIFGETPATH(FILEID,IPATH,PLEN) 133 CALL REPLACE_STRING(PATH,IPATH) 123 134 END 124 135 -
trunk/bindings/f77/napif.inc
r952 r1375 36 36 C *** large enough to hold an NXhandle structure 37 37 INTEGER NXHANDLESIZE 38 PARAMETER(NXHANDLESIZE=5120) 38 C PARAMETER(NXHANDLESIZE=5120) 39 PARAMETER(NXHANDLESIZE=9058) 39 40 C *** NXLINKSIZE is (at least) the size of an INTEGER*4 array that can hold 40 41 C *** an NXlink structure: we'll assume 64bit alignment of structure members for safety … … 79 80 + NXINITATTRDIR, NXFLUSH, NXCOMPMAKEDATA, NXOPENPATH, 80 81 + NXSETNUMBERFORMAT, NXOPENGROUPPATH, NXOPENSOURCEGROUP, 81 + NXMAKENAMEDLINK 82 + NXMAKENAMEDLINK, NXGETPATH 82 83 LOGICAL NXSAMEID 83 84 EXTERNAL NXOPEN, NXCLOSE, NXMAKEGROUP, NXOPENGROUP, NXCLOSEGROUP, … … 91 92 + NXOPENPATH,NXSETNUMBERFORMAT, NXOPENGROUPPATH, 92 93 + NXOPENSOURCEGROUP, NXINQUIREFILE, NXISEXTERNALGROUP, 93 + NXLINKEXTERNAL, NXMAKENAMEDLINK 94 + NXLINKEXTERNAL, NXMAKENAMEDLINK, NXGETPATH -
trunk/bindings/idl/NeXusIDL-API.c
r1224 r1375 217 217 218 218 return IDL_GettmpInt(status); 219 } 220 /*====================================================================== 221 * NXgetpath 222 * string = NXgetpath(file_id) 223 *======================================================================*/ 224 static IDL_VPTR NXgetpath_this(int argc, IDL_VPTR *argv) 225 { 226 int fileid; 227 NXhandle hHandle; 228 int iHandle, status; 229 char path[1024]; 230 231 if (argc != 1) { 232 IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_INFO, "One argument expected"); 233 return IDL_StrToSTRING("One argument expected"); 234 } 235 236 IDL_ENSURE_SCALAR(argv[0]); 237 238 fileid = (int)IDL_LongScalar(argv[0]); 239 240 if(HHCheckIfHandleExists(fileid) == -1) { 241 IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_INFO, "Unknown file id"); 242 return IDL_StrToSTRING("ERROR: Unknown file ID"); 243 } 244 245 hHandle = HHGetPointer(fileid); 246 NXMSetError(NULL,idlError); 247 248 status = NXgetpath(hHandle,path,1024); 249 if(status == NX_ERROR){ 250 IDL_Message(IDL_M_NAMED_GENERIC, IDL_MSG_INFO, nexusError); 251 return IDL_StrToSTRING(nexusError); 252 } 253 return IDL_StrToSTRING(path); 219 254 } 220 255 … … 2549 2584 { NXsetnumberformat_this, "NXSETNUMBERFORMAT", 0, IDL_MAXPARAMS, 0, 0}, 2550 2585 { NXopenpath_this, "NXOPENPATH", 0, IDL_MAXPARAMS, 0, 0}, 2551 { NXopengrouppath_this, "NXOPENGROUPPATH", 0, IDL_MAXPARAMS, 0, 0}, 2586 { NXopengrouppath_this, "NXOPENGROUPPATH", 0, IDL_MAXPARAMS, 0, 0}, 2587 { NXgetpath_this, "NXGETPATH", 0, IDL_MAXPARAMS, 0, 0}, 2552 2588 { NXmakegroup_this, "NXMAKEGROUP", 0, IDL_MAXPARAMS, 0, 0}, 2553 2589 { NXopengroup_this, "NXOPENGROUP", 0, IDL_MAXPARAMS, 0, 0}, -
trunk/bindings/idl/NeXusIDL-API.dlm
r1153 r1375 8 8 FUNCTION NXOPENPATH 0 IDL_MAXPARAMS 9 9 FUNCTION NXOPENGROUPPATH 0 IDL_MAXPARAMS 10 FUNCTION NXGETPATH 0 IDL_MAXPARAMS 10 11 FUNCTION NXMAKEGROUP 0 IDL_MAXPARAMS 11 12 FUNCTION NXCLOSEGROUP 0 IDL_MAXPARAMS -
trunk/bindings/java/native/NexusFile.c
r1282 r1375 23 23 24 24 Added NXinitattrdir and NXinitgroupdir, Mark Koennecke, October 2009 25 26 Added NXgetpath, Mark Koennecke, October 2009 25 27 26 28 IMPLEMENTATION NOTES … … 307 309 (*env)->ReleaseStringUTFChars(env,path, nxpath); 308 310 } 311 /*-----------------------------------------------------------------------*/ 312 JNIEXPORT jstring JNICALL Java_org_nexusformat_NexusFile_nxgetpath 313 (JNIEnv *env, jobject obj, jint handle) 314 { 315 NXhandle nxhandle; 316 int iRet; 317 char path[1024]; 318 319 /* set error handler */ 320 NXMSetError(env,JapiError); 321 322 /* exchange the Java handler to a NXhandle */ 323 nxhandle = (NXhandle)HHGetPointer(handle); 324 325 iRet = NXgetpath(nxhandle, path,1024); 326 327 return (*env)->NewStringUTF(env,path); 328 } 329 309 330 /*------------------------------------------------------------------------ 310 331 nxclosegroup -
trunk/bindings/java/org/nexusformat/NeXusFileInterface.java
r848 r1375 89 89 public void opengrouppath(String path) throws 90 90 NexusException; 91 /** 92 * return the current path into the NeXus file in the 93 * form of a Unix path string. 94 * @return A unix path string 95 */ 96 public String getpath() throws NexusException; 91 97 /** 92 98 * closegroup closes access to the current group and steps down one -
trunk/bindings/java/org/nexusformat/NexusFile.java
r1282 r1375 186 186 protected native void nxopengrouppath(int handle, String path); 187 187 protected native void nxclosegroup(int handle); 188 protected native String nxgetpath(int handle); 188 189 189 190 /** … … 246 247 nxopengrouppath(handle,path); 247 248 } 248 249 /** 250 * return the current path into the NeXus file in the 251 * form of a Unix path string. 252 * @return A unix path string 253 */ 254 public String getpath() throws NexusException 255 { 256 if(handle < 0) throw new NexusException("NAPI-ERROR: File not open"); 257 return nxgetpath(handle); 258 } 249 259 /** 250 260 * closegroup closes access to the current group and steps down one -
trunk/bindings/swig/nxinter.i
r952 r1375 57 57 extern int nx_openpath(void *handle, char *path); 58 58 extern int nx_opengrouppath(void *handle, char *path); 59 extern char *nx_getpath(void *handle); 59 60 extern int nx_closegroup(void *handle); 60 61 extern char *nx_getnextentry(void *handle, char separator); -
trunk/bindings/swig/nxinterhelper.c
r942 r1375 114 114 } 115 115 /*--------------------------------------------------------------------*/ 116 char *nx_getpath(void *handle){ 117 int status; 118 NXhandle hfil; 119 char path[1024]; 120 121 hfil = (NXhandle)handle; 122 status = NXgetpath(hfil,path,1024); 123 if(status == NX_OK){ 124 return strdup(path); 125 } else { 126 return strdup("Error in NXgetpath"); 127 } 128 } 129 /*--------------------------------------------------------------------*/ 116 130 int nx_closegroup(void *handle){ 117 131 int status; -
trunk/bindings/swig/nxinterhelper.h
r942 r1375 23 23 int nx_opengrouppath(void *handle, char *path); 24 24 int nx_openpath(void *handle, char *path); 25 extern char *nx_getpath(void *handle); 25 26 int nx_closegroup(void *handle); 26 27 char *nx_getnextentry(void *handle, char separator); -
trunk/include/napi.h
r1277 r1375 180 180 # define NXopengroup MANGLE(nxiopengroup) 181 181 # define NXopenpath MANGLE(nxiopenpath) 182 # define NXgetpath MANGLE(nxigetpath) 182 183 # define NXopengrouppath MANGLE(nxiopengrouppath) 183 184 # define NXclosegroup MANGLE(nxiclosegroup) … … 228 229 # define NXfcompress MANGLE(nxifcompress) 229 230 # define NXfputattr MANGLE(nxifputattr) 230 231 # define NXfgetpath MANGLE(nxifgetpath) 231 232 232 233 /* … … 324 325 */ 325 326 extern NXstatus NXopengrouppath (NXhandle handle, CONSTCHAR *path); 327 /** 328 * Retrieve the current path in the NeXus file 329 * \param handle a NeXus file handle 330 * \param path A buffer to copy the path too 331 * \parm pathlen The maximum number of characters to copy into path 332 * \return NX_OK or NX_ERROR 333 */ 334 extern NXstatus NXgetpath(NXhandle handle, char *path, int pathlen); 326 335 327 336 /** … … 784 793 785 794 extern NXstatus NXfopen(char * filename, NXaccess* am, 786 N exusFunction*pHandle);787 extern NXstatus NXfclose (N exusFunction*pHandle);795 NXhandle pHandle); 796 extern NXstatus NXfclose (NXhandle pHandle); 788 797 extern NXstatus NXfputattr(NXhandle fid, char *name, void *data, 789 798 int *pDatalen, int *pIType); … … 795 804 extern NXstatus NXfmakedata(NXhandle fid, char *name, int *pDatatype, 796 805 int *pRank, int dimensions[]); 797 extern NXstatus NXfflush(N exusFunction*pHandle);798 806 extern NXstatus NXfflush(NXhandle pHandle); 807 extern NXstatus NXfgetpath(NXhandle fid, char *path, int *pathlen); 799 808 #ifdef __cplusplus 800 809 } -
trunk/src/Makefile.am
r1105 r1375 76 76 #SUBDIRS=nxdict 77 77 78 libNeXus_la_SOURCES = napi.c napiu.c nxstack.c nxstack.h stptok.c nxdataset.c nxdataset.h nx_stptok.h $(H4SRC) $(H5SRC) $(XMLSRC) $(MINGW_SRC)78 libNeXus_la_SOURCES = napi.c napiu.c nxstack.c nxstack.h stptok.c nxdataset.c nxdataset.h nx_stptok.h $(H4SRC) $(H5SRC) $(XMLSRC) $(MINGW_SRC) 79 79 libNeXus_la_LDFLAGS = -export-symbols nexus_symbols.sym @SHARED_LDFLAGS@ @HDF4_LDFLAGS@ @HDF5_LDFLAGS@ @XML_LDFLAGS@ $(LDFLAGS) 80 80 libNeXus_la_DEPENDENCIES = nexus_symbols.sym -
trunk/src/napi.c
r1220 r1375 545 545 546 546 status = pFunc->nxopengroup(pFunc->pNexusData, name, nxclass); 547 if(status == NX_OK){ 548 pushPath(fileStack,name); 549 } 547 550 oldError = NXMGetError(); 548 551 NXIReportError = NXNXNoReport; … … 580 583 fileStack = (pFileStack)fid; 581 584 if(fileStackDepth(fileStack) == 0){ 582 return pFunc->nxclosegroup(pFunc->pNexusData); 585 status = pFunc->nxclosegroup(pFunc->pNexusData); 586 if(status == NX_OK){ 587 popPath(fileStack); 588 } 589 return status; 583 590 } else { 584 591 /* we have to check for leaving an external file */ … … 590 597 } else { 591 598 status = pFunc->nxclosegroup(pFunc->pNexusData); 599 if(status == NX_OK){ 600 popPath(fileStack); 601 } 592 602 } 593 603 return status; … … 628 638 NXstatus NXopendata (NXhandle fid, CONSTCHAR *name) 629 639 { 640 int status; 641 pFileStack fileStack = NULL; 642 630 643 pNexusFunction pFunc = handleToNexusFunc(fid); 631 return pFunc->nxopendata(pFunc->pNexusData, name); 644 fileStack = (pFileStack)fid; 645 status = pFunc->nxopendata(pFunc->pNexusData, name); 646 if(status == NX_OK){ 647 pushPath(fileStack,name); 648 } 649 return status; 632 650 } 633 651 … … 637 655 NXstatus NXclosedata (NXhandle fid) 638 656 { 639 pNexusFunction pFunc = handleToNexusFunc(fid); 640 return pFunc->nxclosedata(pFunc->pNexusData); 657 int status; 658 pFileStack fileStack = NULL; 659 660 pNexusFunction pFunc = handleToNexusFunc(fid); 661 fileStack = (pFileStack)fid; 662 status = pFunc->nxclosedata(pFunc->pNexusData); 663 if(status == NX_OK){ 664 popPath(fileStack); 665 } 666 return status; 641 667 } 642 668 … … 1062 1088 } 1063 1089 /*------------------------------------------------------------------------ 1064 Implementation of NXopenpath .1090 Implementation of NXopenpath 1065 1091 --------------------------------------------------------------------------*/ 1066 1092 static int isDataSetOpen(NXhandle hfil) … … 1357 1383 return NX_OK; 1358 1384 } 1359 1385 /*---------------------------------------------------------------------*/ 1360 1386 NXstatus NXIprintlink(NXhandle fid, NXlink* link) 1361 1387 { 1362 1388 pNexusFunction pFunc = handleToNexusFunc(fid); 1363 1389 return pFunc->nxprintlink(pFunc->pNexusData, link); 1390 } 1391 /*----------------------------------------------------------------------*/ 1392 NXstatus NXgetpath(NXhandle fid, char *path, int pathlen){ 1393 int status; 1394 pFileStack fileStack = NULL; 1395 1396 fileStack = (pFileStack)fid; 1397 status = buildPath(fileStack,path,pathlen); 1398 if(status != 1){ 1399 return NX_ERROR; 1400 } 1401 return NX_OK; 1364 1402 } 1365 1403 … … 1446 1484 */ 1447 1485 NXstatus NXfopen(char * filename, NXaccess* am, 1448 N exusFunction*pHandle)1486 NXhandle pHandle) 1449 1487 { 1450 1488 NXstatus ret; … … 1453 1491 if (ret == NX_OK) 1454 1492 { 1455 memcpy(pHandle, fileid, sizeof(NexusFunction));1493 memcpy(pHandle, fileid, getFileStackSize()); 1456 1494 } 1457 1495 else 1458 1496 { 1459 memset(pHandle, 0, sizeof(NexusFunction));1497 memset(pHandle, 0, getFileStackSize()); 1460 1498 } 1461 1499 if (fileid != NULL) … … 1470 1508 * a temporary copy as NXclose will try to free() this 1471 1509 */ 1472 NXstatus NXfclose (N exusFunction*pHandle)1510 NXstatus NXfclose (NXhandle pHandle) 1473 1511 { 1474 1512 NXhandle h; 1475 1513 NXstatus ret; 1476 h = (NXhandle)malloc( sizeof(NexusFunction));1477 memcpy(h, pHandle, sizeof(NexusFunction));1514 h = (NXhandle)malloc(getFileStackSize()); 1515 memcpy(h, pHandle, getFileStackSize()); 1478 1516 ret = NXclose(&h); /* does free(h) */ 1479 memset(pHandle, 0, sizeof(NexusFunction));1517 memset(pHandle, 0, getFileStackSize()); 1480 1518 return ret; 1481 1519 } 1482 1520 1483 1521 /*---------------------------------------------------------------------*/ 1484 NXstatus NXfflush(N exusFunction*pHandle)1522 NXstatus NXfflush(NXhandle pHandle) 1485 1523 { 1486 1524 NXhandle h; 1487 1525 NXstatus ret; 1488 h = (NXhandle)malloc( sizeof(NexusFunction));1489 memcpy(h, pHandle, sizeof(NexusFunction));1526 h = (NXhandle)malloc(getFileStackSize()); 1527 memcpy(h, pHandle, getFileStackSize()); 1490 1528 ret = NXflush(&h); /* modifies and reallocates h */ 1491 memcpy(pHandle, h, sizeof(NexusFunction));1529 memcpy(pHandle, h, getFileStackSize()); 1492 1530 return ret; 1493 1531 } … … 1520 1558 } 1521 1559 1522 1560 /*-----------------------------------------------------------------------*/ 1523 1561 NXstatus NXfcompmakedata(NXhandle fid, char *name, 1524 1562 int *pDatatype, … … 1579 1617 } 1580 1618 1619 /*--------------------------------------------------------------------------*/ 1620 NXstatus NXfgetpath(NXhandle fid, char *path, int *pathlen) 1621 { 1622 return NXgetpath(fid,path,*pathlen); 1623 } -
trunk/src/nexus_symbols.txt
r1236 r1375 13 13 nxifputattr_ 14 14 nxifree_ 15 nxifgetpath_ 15 16 nxigetattr_ 16 17 nxigetattrinfo_ … … 34 35 nxiopengrouppath_ 35 36 nxiopenpath_ 37 nxigetpath_ 36 38 nxiopensourcegroup_ 37 39 nxiputattr_ -
trunk/src/nxstack.c
r996 r1375 20 20 21 21 For further information, see <http://www.neutron.anl.gov/NeXus/> 22 23 Added code to support the path stack for NXgetpath, 24 Mark Koennecke, October 2009 22 25 */ 23 26 #include <stdlib.h> … … 40 43 int fileStackPointer; 41 44 fileStackEntry fileStack[MAXEXTERNALDEPTH]; 45 int pathPointer; 46 char pathStack[NXMAXSTACK][NX_MAXNAMELEN]; 42 47 }fileStack; 43 48 /*---------------------------------------------------------------------*/ … … 51 56 memset(pNew,0,sizeof(fileStack)); 52 57 pNew->fileStackPointer = -1; 58 pNew->pathPointer = -1; 53 59 return pNew; 54 60 } … … 58 64 free(self); 59 65 } 66 } 67 /*---------------------------------------------------------------------*/ 68 int getFileStackSize(){ 69 return sizeof(fileStack); 60 70 } 61 71 /*----------------------------------------------------------------------*/ … … 99 109 return self->fileStackPointer; 100 110 } 111 /*----------------------------------------------------------------------*/ 112 void pushPath(pFileStack self, char *name){ 113 self->pathPointer++; 114 strncpy(self->pathStack[self->pathPointer],name,NX_MAXNAMELEN-1); 115 } 116 /*-----------------------------------------------------------------------*/ 117 void popPath(pFileStack self){ 118 self->pathPointer--; 119 if(self->pathPointer < -1){ 120 self->pathPointer = -1; 121 } 122 } 123 /*-----------------------------------------------------------------------*/ 124 int buildPath(pFileStack self, char *path, int pathlen){ 125 int i, totalPathLength; 126 char *totalPath; 127 128 for(i = 0, totalPathLength = 5; i <= self->pathPointer; i++){ 129 totalPathLength += strlen(self->pathStack[i]) + 1; 130 } 131 totalPath = malloc(totalPathLength*sizeof(char)); 132 if(totalPath == NULL){ 133 return 0; 134 } 135 memset(totalPath,0,totalPathLength*sizeof(char)); 136 for(i = 0; i <= self->pathPointer; i++){ 137 strcat(totalPath,"/"); 138 strcat(totalPath,self->pathStack[i]); 139 } 140 141 strncpy(path,totalPath,pathlen-1); 142 free(totalPath); 143 return 1; 144 } -
trunk/src/nxstack.h
r742 r1375 20 20 21 21 For further information, see <http://www.neutron.anl.gov/NeXus/> 22 23 Added functions to deal with the path stack for NXgetpath 24 Mark Koennecke, October 2009 25 22 26 */ 23 27 #ifndef NEXUSFILESTACK … … 29 33 pFileStack makeFileStack(); 30 34 void killFileStack(pFileStack self); 35 int getFileStackSize(); 31 36 32 37 void pushFileStack(pFileStack self, pNexusFunction pDriv, char *filename); … … 40 45 int fileStackDepth(pFileStack self); 41 46 47 void pushPath(pFileStack self, char *name); 48 void popPath(pFileStack self); 49 int buildPath(pFileStack self, char *path, int pathlen); 50 42 51 #endif 43 52 -
trunk/test/napi_test.c
r1178 r1375 66 66 int64_t grossezahl[4]; 67 67 const char* ch_test_data = "NeXus ><}&{'\\&\" Data"; 68 char path[512]; 68 69 69 70 grossezahl[0] = 12; … … 244 245 NXgetattrinfo(fileid,&i); 245 246 printf("Number of group attributes: %d\n", i); 247 if(NXgetpath(fileid,path,512) != NX_OK)return 1; 248 printf("NXentry path %s\n", path); 246 249 do { 247 250 attr_status = NXgetnextattr (fileid, name, NXdims, &NXtype); … … 270 273 if (entry_status == NX_OK) { 271 274 if (NXopendata (fileid, name) != NX_OK) return 1; 272 if (NXgetinfo (fileid, &NXrank, NXdims, &NXtype) != NX_OK) return 1; 275 if(NXgetpath(fileid,path,512) != NX_OK)return 1; 276 printf("Data path %s\n", path); 277 if (NXgetinfo (fileid, &NXrank, NXdims, &NXtype) != NX_OK) return 1; 273 278 printf (" %s(%d)", name, NXtype); 274 279 if (NXmalloc ((void **) &data_buffer, NXrank, NXdims, NXtype) != NX_OK) return 1; … … 365 370 if (NXopengroup (fileid, "link", "NXentry") != NX_OK) return 1; 366 371 if (NXopengroup (fileid, "sample", "NXsample") != NX_OK) return 1; 372 if(NXgetpath(fileid,path,512) != NX_OK)return 1; 373 printf("Group path %s\n", path); 367 374 if (NXgetgroupID (fileid, &blink) != NX_OK) return 1; 368 375 if (NXsameID(fileid, &glink, &blink) != NX_OK) -
trunk/test/napi_test_cpp.cxx
r1266 r1375 275 275 cout << toString(result); 276 276 } 277 cout << endl; 278 cout << " Path = " << file.getPath() << endl; 279 file.closeData(); 277 280 } 278 281 else { 279 cout << ":" << it->second; 280 } 281 cout << endl; 282 cout << ":" << it->second << endl; 283 } 282 284 } 283 285 file.closeGroup(); -
trunk/test/napif4_test.f
r835 r1375 27 27 INCLUDE 'napif.inc' 28 28 INTEGER NXRANK, NXDIMS(NX_MAXRANK), NXTYPE, NXLEN 29 INTEGER ENTRY_STATUS, ATTR_STATUS 29 INTEGER ENTRY_STATUS, ATTR_STATUS, STAT 30 30 INTEGER*4 I, J 31 31 REAL*4 R … … 41 41 CHARACTER*128 CHAR_BUFFER 42 42 INTEGER*1 CHAR_BUFFER_B(128) 43 CHARACTER*64 GROUP_NAME, CLASS_NAME 43 CHARACTER*64 GROUP_NAME, CLASS_NAME, PATH 44 44 INTEGER FILEID(NXHANDLESIZE) 45 45 INTEGER GLINK(NXLINKSIZE), DLINK(NXLINKSIZE), BLINK(NXLINKSIZE) … … 141 141 IF (NXPUTSLAB(FILEID, U_BUFFER(I), SLAB_START, 142 142 + SLAB_SIZE) .NE. NX_OK) STOP 143 STAT = NXCLOSEDATA(FILEID) 143 144 IF (NXFLUSH(FILEID) .NE. NX_OK) STOP 144 145 END DO … … 196 197 ELSE IF (ENTRY_STATUS .EQ. NX_OK) THEN 197 198 IF (NXOPENDATA(FILEID,NAME) .NE. NX_OK) STOP 199 IF(NXGETPATH(FILEID,PATH) .NE. NX_OK) STOP 200 WRITE(*,*),' Path = ', PATH 198 201 IF (NXGETINFO(FILEID,NXRANK,NXDIMS,NXTYPE) .NE. NX_OK) STOP 199 202 WRITE(*,FMT='(4X,A,I2,A)') NAME(1:LEN_TRIM(NAME))//'(', -
trunk/test/napif5_test.f
r835 r1375 27 27 INCLUDE 'napif.inc' 28 28 INTEGER NXRANK, NXDIMS(NX_MAXRANK), NXTYPE, NXLEN 29 INTEGER ENTRY_STATUS, ATTR_STATUS 29 INTEGER ENTRY_STATUS, ATTR_STATUS, STAT 30 30 INTEGER*4 I, J 31 31 REAL*4 R … … 42 42 INTEGER*1 CHAR_BUFFER_B(128) 43 43 CHARACTER*64 GROUP_NAME, CLASS_NAME 44 CHARACTER*70 PATH 44 45 INTEGER FILEID(NXHANDLESIZE) 45 46 INTEGER GLINK(NXLINKSIZE), DLINK(NXLINKSIZE), BLINK(NXLINKSIZE) … … 141 142 IF (NXPUTSLAB(FILEID, U_BUFFER(I), SLAB_START, 142 143 + SLAB_SIZE) .NE. NX_OK) STOP 144 STAT = NXCLOSEDATA(FILEID) 143 145 IF (NXFLUSH(FILEID) .NE. NX_OK) STOP 144 146 END DO … … 196 198 ELSE IF (ENTRY_STATUS .EQ. NX_OK) THEN 197 199 IF (NXOPENDATA(FILEID,NAME) .NE. NX_OK) STOP 200 IF(NXGETPATH(FILEID,PATH) .NE. NX_OK) STOP 201 WRITE(*,*)'Path = ', PATH 198 202 IF (NXGETINFO(FILEID,NXRANK,NXDIMS,NXTYPE) .NE. NX_OK) STOP 199 203 WRITE(*,FMT='(4X,A,I2,A)') NAME(1:LEN_TRIM(NAME))//'(', -
trunk/test/napif_test.f
r808 r1375 42 42 INTEGER*1 CHAR_BUFFER_B(128) 43 43 CHARACTER*64 GROUP_NAME, CLASS_NAME 44 CHARACTER*70 PATH 44 45 INTEGER FILEID(NXHANDLESIZE) 45 46 INTEGER GLINK(NXLINKSIZE), DLINK(NXLINKSIZE), BLINK(NXLINKSIZE) … … 196 197 ELSE IF (ENTRY_STATUS .EQ. NX_OK) THEN 197 198 IF (NXOPENDATA(FILEID,NAME) .NE. NX_OK) STOP 199 IF (NXGETPATH(FILEID,PATH) .NE. NX_OK)STOP 200 WRITE(*,*)'Path = ', PATH 198 201 IF (NXGETINFO(FILEID,NXRANK,NXDIMS,NXTYPE) .NE. NX_OK) STOP 199 202 WRITE(*,FMT='(4X,A,I2,A)') NAME(1:LEN_TRIM(NAME))//'(',
Note: See TracChangeset
for help on using the changeset viewer.
