Nexus question/suggestion.

Jon Tischler TischlerJZ at ornl.gov
Thu Apr 16 14:45:43 BST 1998


HDF certainly supports all kinds of attribute types.  An attribute is an
array of some type.  In the case of character strings, it is an array of
char.  I think that an attribute should be allowed to be any type, since
there are already some obvious types that should be non-character.  For
example the gain of a detector should be float.

So your suggestion of changing form "char* data" to "void* data" makes
sense.  I should also note that it will not have much effect since it is
just an address and you can do with it whatever you want anyhow.  It will
just affect whether the compiler generates a message.

Jon



>Hello,
>
>I work at the APS and am currently tring to add nexus support to some
>aqcuisition software we're developing and what I've come across is this:
>
>If I write an attribute that is of a data type other than CHAR, I have
>problems reading it back.  The problem, I believe, is due to the
>defenition of NXgetattr.  NXputattr accepts a void * to the value to
>write for the attribute, however, NXgetattr only allows for a CHAR * to
>retrieve the value.
>
>By changing the defenition for NXgetattr from
>
>NXstatus  NXgetattr(NXhandle handle, char* name, char* data, int*
>iDataLen, int* iType);
>
>to
>
>NXstatus  NXgetattr(NXhandle handle, char* name, void* data, int*
>iDataLen, int* iType);
>
>I can retrieve int, floats, ect...
>
>My question is, are attributes supposed to be restricted to char data
>only in the Nexus specification?  If so, not a problem, I can make the
>necessary changes.  If not, then can we get the function declaration
>changed to allow for the other data types?
>
>Thanks!
>
>Brian Tieman
>SRICAT--APS
>(630)252-0141



Jon Tischler
Oak Ridge National Lab
TischlerJZ at ornl.gov





More information about the NeXus mailing list