- Timestamp:
- 07/11/11 13:42:20 (7 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/napi.h (modified) (3 diffs)
-
include/napi5.h (modified) (1 diff)
-
src/napi.c (modified) (1 diff)
-
src/napi4.c (modified) (1 diff)
-
src/napi5.c (modified) (2 diffs)
-
src/nxxml.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/napi.h
r1735 r1738 198 198 199 199 # define NXopen MANGLE(nxiopen) 200 # define NXreopen MANGLE(nxireopen) 200 201 # define NXclose MANGLE(nxiclose) 201 202 # define NXmakegroup MANGLE(nximakegroup) … … 298 299 extern NXstatus NXopen(CONSTCHAR * filename, NXaccess access_method, NXhandle* pHandle); 299 300 301 /** 302 * Opens an existing NeXus file a second time for e.g. access from another thread. 303 * \return NX_OK on success, NX_ERROR in the case of an error. 304 * \ingroup c_init 305 */ 306 extern NXstatus NXreopen(NXhandle pOrigHandle, NXhandle* pNewHandle); 307 300 308 /** 301 309 * close a NeXus file … … 888 896 NXhandle pNexusData; 889 897 int stripFlag; 898 NXstatus ( *nxreopen)(NXhandle pOrigHandle, NXhandle* pNewHandle); 890 899 NXstatus ( *nxclose)(NXhandle* pHandle); 891 900 NXstatus ( *nxflush)(NXhandle* pHandle); -
trunk/include/napi5.h
r1736 r1738 9 9 10 10 extern NXstatus NX5open(CONSTCHAR *filename, NXaccess access_method, NXhandle* pHandle); 11 extern NXstatus NX5reopen(NXhandle pOrigHandle, NXhandle* pNewHandle); 12 11 13 extern NXstatus NX5close(NXhandle* pHandle); 12 14 extern NXstatus NX5flush(NXhandle* pHandle); -
trunk/src/napi.c
r1735 r1738 567 567 } 568 568 569 570 NXstatus NXreopen(NXhandle pOrigHandle, NXhandle* pNewHandle) 571 { 572 pFileStack newFileStack; 573 pFileStack origFileStack = (pFileStack)pOrigHandle; 574 pNexusFunction fOrigHandle = NULL, fNewHandle = NULL; 575 *pNewHandle = NULL; 576 newFileStack = makeFileStack(); 577 if(newFileStack == NULL){ 578 NXReportError ("ERROR: no memory to create filestack"); 579 return NX_ERROR; 580 } 581 // The code below will only open the last file on a stack 582 // for the moment raise an error, but this behaviour may be OK 583 if (fileStackDepth(origFileStack) > 0) 584 { 585 NXReportError ( 586 "ERROR: handle stack referes to many files - cannot reopen"); 587 return NX_ERROR; 588 } 589 fOrigHandle = peekFileOnStack(origFileStack); 590 if (fOrigHandle->nxreopen == NULL) 591 { 592 NXReportError ( 593 "ERROR: NXreopen not implemented for this underlying file format"); 594 return NX_ERROR; 595 } 596 fNewHandle = (NexusFunction*)malloc(sizeof(NexusFunction)); 597 memcpy(fNewHandle, fOrigHandle, sizeof(NexusFunction)); 598 LOCKED_CALL(fNewHandle->nxreopen( fOrigHandle->pNexusData, &(fNewHandle->pNexusData) )); 599 pushFileStack( newFileStack, fNewHandle, peekFilenameOnStack(origFileStack) ); 600 *pNewHandle = newFileStack; 601 return NX_OK; 602 } 603 604 569 605 /* ------------------------------------------------------------------------- */ 570 606 -
trunk/src/napi4.c
r1735 r1738 1950 1950 { 1951 1951 fHandle->nxclose=NX4close; 1952 fHandle->nxreopen=NULL; 1952 1953 fHandle->nxflush=NX4flush; 1953 1954 fHandle->nxmakegroup=NX4makegroup; -
trunk/src/napi5.c
r1737 r1738 115 115 ---------------------------------------------------------------------*/ 116 116 117 NXstatus NX5open(CONSTCHAR *filename, NXaccess am, 117 NXstatus NX5reopen(NXhandle pOrigHandle, NXhandle* pNewHandle) 118 { 119 pNexusFile5 pNew = NULL, pOrig = NULL; 120 *pNewHandle = NULL; 121 pOrig = (pNexusFile5)pOrigHandle; 122 pNew = (pNexusFile5) malloc (sizeof (NexusFile5)); 123 if (!pNew) { 124 NXReportError ("ERROR: no memory to create File datastructure"); 125 return NX_ERROR; 126 } 127 memset (pNew, 0, sizeof (NexusFile5)); 128 pNew->iFID = H5Freopen (pOrig->iFID); 129 if (pNew->iFID <= 0) { 130 NXReportError ("cannot clone file"); 131 free (pNew); 132 return NX_ERROR; 133 } 134 strcpy(pNew->iAccess, pOrig->iAccess); 135 pNew->iNXID = NX5SIGNATURE; 136 pNew->iStack5[0].iVref = 0; /* root! */ 137 *pNewHandle = (NXhandle)pNew; 138 return NX_OK; 139 } 140 141 NXstatus NX5open(CONSTCHAR *filename, NXaccess am, 118 142 NXhandle* pHandle) 119 143 { … … 2199 2223 void NX5assignFunctions(pNexusFunction fHandle) 2200 2224 { 2201 2225 2202 2226 fHandle->nxclose=NX5close; 2227 fHandle->nxreopen=NX5reopen; 2203 2228 fHandle->nxflush=NX5flush; 2204 2229 fHandle->nxmakegroup=NX5makegroup; -
trunk/src/nxxml.c
r1735 r1738 1939 1939 void NXXassignFunctions(pNexusFunction fHandle){ 1940 1940 fHandle->nxclose=NXXclose; 1941 fHandle->nxreopen=NULL; 1941 1942 fHandle->nxflush=NXXflush; 1942 1943 fHandle->nxmakegroup=NXXmakegroup;
Note: See TracChangeset
for help on using the changeset viewer.
