On Thu, 17 Aug 2006, David Berry wrote:
> On Thu, 17 Aug 2006, Peter W. Draper wrote:
>
> > On Thu, 17 Aug 2006, David Berry wrote:
> >
> > > What is the equivalent of the Fortran DAT__ROOT constant in
> > > the new HDS C interface? That is, how do I specify DAT__ROOT when
> > > calling (for instance) ndfPlace? I suppose I can explicitly import the
> > > DAT__ROOT constant into an HDSLoc using HDS_IMPORT_FLOCATOR, but
> > > presumably it should not really be necessary for application code to do
> > > this.
> >
> > David,
> >
> > just pass in NULL.
>
> But that gets translated to DAT__NULL doesn't it, not DAT__ROOT?
Not for NDF calls, all input locators are translated into DAT__ROOT, if a
NULL HDSLoc pointer is given (ndf.c):
void ndfPlace( const HDSLoc * loc,
const char *name,
int *place,
int *status ) {
DECLARE_CHARACTER(floc,DAT__SZLOC);
DECLARE_CHARACTER_DYN(fname);
DECLARE_INTEGER(fplace);
DECLARE_INTEGER(fstatus);
if ( loc == NULL ) {
F77_EXPORT_LOCATOR( DAT__ROOT, floc );
} else {
if (*status == SAI__OK) {
HDS_EXPORT_CLOCATOR( loc, floc, status );
if (*status != SAI__OK) {
emsSetc("F",name);
emsRep("ndfPlace_err",
"ndfPlace: Error finding placeholder for file ^F", status);
}
}
}
F77_CREATE_CHARACTER( fname, strlen( name ) );
F77_EXPORT_CHARACTER( name, fname, fname_length );
F77_EXPORT_INTEGER( *status, fstatus );
F77_CALL(ndf_place)( CHARACTER_ARG(floc),
CHARACTER_ARG(fname),
INTEGER_ARG(&fplace),
INTEGER_ARG(&fstatus)
TRAIL_ARG(floc)
TRAIL_ARG(fname) );
F77_FREE_CHARACTER( fname );
F77_IMPORT_INTEGER( fplace, *place );
F77_IMPORT_INTEGER( fstatus, *status );
return;
}
|