On Fri, 16 Dec 2005, Mark Taylor wrote:
> On Thu, 8 Dec 2005, Tim Jenness wrote:
>
> 1. Will datGetVC() be forthcoming? If not that's OK, I'll just drop
> it from the java interface, it's not currently used anywhere.
>
Sorry. I'll add it. I thought I had done it. It will be like datGet1C and
so will be giving you a char**. I'm currently working on the datGetNx and
datPutNx routines. They will be the last dat* routines. At that point we
could move the cmp* routines to a separate library for the momment (that
would be included by hds_link) so that libhds just had pure C.
> 2. I think the third argument of datRef() should be a size_t *
> and not a size_t?
No.
In the Fortran interface it is returned (since fortran knows the buffer
length but doesn't know the length of interest) but in the C interface
it's the size of the input buffer (required to stop overruns). The
assumption is that you can always use strlen if you really care about it.
The fortran interface takes care of the return value. I think the Java
interface shouldn't have the string length in it at all since Java strings
know how long they are.
If people think this logic is wrong then let me know. We will still need
an input length.
>
> 3. DAT__NOLOC and DAT__ROOT are still char *s (#defined as character
> literals). Shouldn't they be HDSLocs?
They should not be used at all. They are no longer part of the C
interface.
>
> 4. What include files am I supposed to be using? I presume only
> hds.h and hds_types.h. However, doing this I can't allocate
star/hds.h (this will include hds_types.h)
> an HDSLoc, since it doesn't know what sizeof(HDSLoc) is.
HDSLoc is an opaque type.
> That is defined in dat1.h, but dat1.h is not installed under
You pass in a HDSLoc** to any routines that return hds locators so there
is no need to know the size of it. It's now just a pointer. datAnnul
should free the memory.
> /star/include. dat1.h also contains the types _BYTE, _WORD etc,
> which I want to use to find the sizes of the various mapped HDS
> types.
I could add SIZEOF_HDS_BYTE_TYPE etc into hds_types.h if necessary.
That would be easy.
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|