- Fix to various drivers due to changes in rs232controller
- hkl now searches psi in .5 steps - first point of fastscan is driven normally SKIPPED: psi/amor2t.c psi/amor2t.h psi/amor2t.i psi/amor2t.tex psi/amor2t.w psi/dornier2.c psi/el734hp.c psi/nxamor.c psi/slsmagnet.c psi/sps.c
This commit is contained in:
47
nxxml.c
47
nxxml.c
@@ -30,7 +30,6 @@
|
||||
|
||||
|
||||
extern void *NXpData;
|
||||
extern char *NXIformatNeXusTime();
|
||||
|
||||
|
||||
/*----------------------- our data structures --------------------------
|
||||
@@ -59,21 +58,8 @@ typedef struct {
|
||||
xmlStack stack[NXMAXSTACK]; /* stack */
|
||||
}XMLNexus, *pXMLNexus;
|
||||
/*===================== support functions ===============================*/
|
||||
static int isDataNode(mxml_node_t *node){
|
||||
if(mxmlElementGetAttr(node,"name") != NULL){
|
||||
return 0;
|
||||
}
|
||||
if(strcmp(node->value.element.name,"NXroot") == 0){
|
||||
return 0;
|
||||
}
|
||||
if(strcmp(node->value.element.name,"NAPIlink") == 0){
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
extern char *stptok(char *s, char *tok, size_t toklen, char *brk);
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
static mxml_node_t *getLinkTarget(pXMLNexus xmlHandle, const char *target){
|
||||
mxml_node_t *node = NULL;
|
||||
mxml_node_t *testNode = NULL;
|
||||
@@ -160,7 +146,7 @@ NXstatus CALLING_STYLE NXXopen(CONSTCHAR *filename, NXaccess am,
|
||||
"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
current = mxmlNewElement(xmlHandle->root,"NXroot");
|
||||
mxmlElementSetAttr(current,"NeXus_version",NEXUS_VERSION);
|
||||
mxmlElementSetAttr(current,"XML_version","mxml-2.0");
|
||||
mxmlElementSetAttr(current,"XML_version","mxml");
|
||||
mxmlElementSetAttr(current,"file_name",filename);
|
||||
time_buffer = NXIformatNeXusTime();
|
||||
if(time_buffer != NULL){
|
||||
@@ -448,6 +434,24 @@ static mxml_node_t *searchSDSLinks(pXMLNexus xmlHandle, CONSTCHAR *name){
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int strtrimcr(char *szStr, char *szSet)
|
||||
{
|
||||
int i, j; /* Locale counters */
|
||||
|
||||
/*-------------------------------------------------*/
|
||||
|
||||
j = i = strlen(szStr) - 1; /* Find length of string */
|
||||
|
||||
while (strrchr(szSet, szStr[ i ])
|
||||
&& (0 <= i))
|
||||
{
|
||||
/* While string is terminated by one of the specified characters */
|
||||
szStr[ i-- ] = '\0'; /*- Replace character with '\0' */
|
||||
}
|
||||
|
||||
return(j - i); /* Return the difference between old and new length */
|
||||
}
|
||||
/*-----------------------------------------------------------------------*/
|
||||
NXstatus CALLING_STYLE NXXopendata (NXhandle fid, CONSTCHAR *name){
|
||||
pXMLNexus xmlHandle = NULL;
|
||||
@@ -603,7 +607,7 @@ NXstatus CALLING_STYLE NXXgetinfo (NXhandle fid, int *rank,
|
||||
*/
|
||||
*rank = 1;
|
||||
*iType = NX_CHAR;
|
||||
dimension[0]= strlen(userData->value.opaque) +1;
|
||||
dimension[0]= strlen(userData->value.opaque);
|
||||
} else {
|
||||
dataset = (pNXDS)userData->value.custom.data;
|
||||
assert(dataset);
|
||||
@@ -1015,8 +1019,13 @@ NXstatus CALLING_STYLE NXXgetnextentry (NXhandle fid,NXname name,
|
||||
assert(xmlHandle);
|
||||
|
||||
if(isDataNode(xmlHandle->stack[xmlHandle->stackPointer].current)){
|
||||
NXIReportError(NXpData,"Cannot search datasets");
|
||||
return NX_ERROR;
|
||||
/*
|
||||
be nice to users: close the open dataset even as this is
|
||||
a usage error
|
||||
*/
|
||||
NXIReportError(NXpData,
|
||||
"WARNING: fixing bad NAPI usage: dataset still open");
|
||||
NXXclosedata(fid);
|
||||
}
|
||||
|
||||
stackPtr = xmlHandle->stackPointer;
|
||||
|
||||
Reference in New Issue
Block a user