Commit 5fff637f authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced zaxisInqLongname() by cdiZaxisInqKeyStr().

parent 07425b8d
...@@ -771,17 +771,23 @@ void gridDefYvals(int gridID, const double yvals[]); ...@@ -771,17 +771,23 @@ void gridDefYvals(int gridID, const double yvals[]);
int gridInqYvals(int gridID, double yvals[]); int gridInqYvals(int gridID, double yvals[]);
/* CDI grid string key values */ /* CDI grid string key values */
#define CDI_KEY_XNAME 901 // X-axis name #define CDI_KEY_XNAME 901 // X-axis name
#define CDI_KEY_YNAME 902 // Y-axis name #define CDI_KEY_XDIMNAME 902 // X-axis dimension name
#define CDI_KEY_XDIMNAME 903 // X-axis dimension name #define CDI_KEY_XLONGNAME 903 // X-axis longname
#define CDI_KEY_YDIMNAME 904 // Y-axis dimension name #define CDI_KEY_XUNITS 904 // X-axis units
#define CDI_KEY_VDIMNAME 905 // Vertex dimension name #define CDI_KEY_YNAME 911 // Y-axis name
#define CDI_KEY_XLONGNAME 906 // X-axis longname #define CDI_KEY_YDIMNAME 912 // Y-axis dimension name
#define CDI_KEY_YLONGNAME 907 // Y-axis longname #define CDI_KEY_YLONGNAME 913 // Y-axis longname
#define CDI_KEY_XUNITS 908 // X-axis units #define CDI_KEY_YUNITS 914 // Y-axis units
#define CDI_KEY_YUNITS 909 // Y-axis units #define CDI_KEY_VDIMNAME 920 // Vertex dimension name
#define CDI_KEY_MAPNAME 920 // Grid mapping var name #define CDI_KEY_MAPNAME 921 // Grid mapping var name
#define CDI_KEY_MAPPING 921 // Grid mapping name #define CDI_KEY_MAPPING 922 // Grid mapping name
/* CDI zaxis string key values */
#define CDI_KEY_NAME 941 // Z-axis name
#define CDI_KEY_DIMNAME 942 // Z-axis dimension name
#define CDI_KEY_LONGNAME 943 // Z-axis longname
#define CDI_KEY_UNITS 944 // Z-axis units
// cdiGridDefKeyStr: Define a CDI grid string value from a key // cdiGridDefKeyStr: Define a CDI grid string value from a key
int cdiGridDefKeyStr(int gridID, int key, int size, const char *mesg); int cdiGridDefKeyStr(int gridID, int key, int size, const char *mesg);
...@@ -979,13 +985,6 @@ void zaxisDefUUID(int zaxisID, const unsigned char uuid[CDI_UUID_SIZE]); ...@@ -979,13 +985,6 @@ void zaxisDefUUID(int zaxisID, const unsigned char uuid[CDI_UUID_SIZE]);
/* zaxisInqUUID: Get the UUID of a generalized Z-axis */ /* zaxisInqUUID: Get the UUID of a generalized Z-axis */
void zaxisInqUUID(int zaxisID, unsigned char uuid[CDI_UUID_SIZE]); void zaxisInqUUID(int zaxisID, unsigned char uuid[CDI_UUID_SIZE]);
/* CDI zaxis string key values */
#define CDI_ZAXIS_NAME 801 // Z-axis name
#define CDI_ZAXIS_DIMNAME 802 // Z-axis dimension name
#define CDI_ZAXIS_VDIMNAME 803 // Vertex dimension name
#define CDI_ZAXIS_LONGNAME 804 // Z-axis longname
#define CDI_ZAXIS_UNITS 805 // Z-axis units
// cdiZaxisDefKeyStr: Define a CDI Z-axis string value from a key // cdiZaxisDefKeyStr: Define a CDI Z-axis string value from a key
int cdiZaxisDefKeyStr(int zaxisID, int key, int size, const char *mesg); int cdiZaxisDefKeyStr(int zaxisID, int key, int size, const char *mesg);
......
...@@ -883,7 +883,7 @@ void gridInqYname(int gridID, char *yname) ...@@ -883,7 +883,7 @@ void gridInqYname(int gridID, char *yname)
@Function gridInqYlongname @Function gridInqYlongname
@Title Get the longname of a Y-axis @Title Get the longname of a Y-axis
@Prototype void gridInqXlongname(int gridID, char *longname) @Prototype void gridInqYlongname(int gridID, char *longname)
@Parameter @Parameter
@Item gridID Grid ID, from a previous call to @fref{gridCreate} or @fref{vlistInqVarGrid}. @Item gridID Grid ID, from a previous call to @fref{gridCreate} or @fref{vlistInqVarGrid}.
@Item longname Longname of the Y-axis. The caller must allocate space for the @Item longname Longname of the Y-axis. The caller must allocate space for the
......
...@@ -2890,10 +2890,10 @@ void cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int ...@@ -2890,10 +2890,10 @@ void cdf_define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int
if ( is_scalar ) zaxisDefScalar(ncvar->zaxisID); if ( is_scalar ) zaxisDefScalar(ncvar->zaxisID);
if ( zdimid != -1 ) if ( zdimid != -1 )
cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_ZAXIS_DIMNAME, (int)(strlen(ncdims[zdimid].name)+1), ncdims[zdimid].name); cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_KEY_DIMNAME, (int)(strlen(ncdims[zdimid].name)+1), ncdims[zdimid].name);
/* /*
if ( vdimid != -1 ) if ( vdimid != -1 )
cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_ZAXIS_VDIMNAME, strlen(ncdims[vdimid].name)+1, ncdims[vdimid].name); cdiZaxisDefKeyStr(ncvar->zaxisID, CDI_KEY_VDIMNAME, strlen(ncdims[vdimid].name)+1, ncdims[vdimid].name);
*/ */
Free(zvar); Free(zvar);
Free(lbounds); Free(lbounds);
......
...@@ -461,10 +461,10 @@ void cdfDefFC(stream_t *streamptr, int gridID, int gridindex) ...@@ -461,10 +461,10 @@ void cdfDefFC(stream_t *streamptr, int gridID, int gridindex)
static const struct cdfDefGridAxisInqs { static const struct cdfDefGridAxisInqs {
int (*axisSize)(int gridID); int (*axisSize)(int gridID);
int (*axisName)(int gridID, int key, int size, char *mesg); int (*axisName)(int cdiID, int key, int size, char *mesg);
void (*axisStdname)(int gridID, char *dimstdname); void (*axisStdname)(int cdiID, char *dimstdname);
void (*axisLongname)(int gridID, char *dimlongname); int (*axisLongname)(int cdiID, int key, int size, char *mesg);
void (*axisUnits)(int gridID, char *dimunits); void (*axisUnits)(int cdiID, char *dimunits);
double (*axisVal)(int gridID, int index); double (*axisVal)(int gridID, int index);
const double *(*axisValsPtr)(int gridID); const double *(*axisValsPtr)(int gridID);
const double *(*axisBoundsPtr)(int gridID); const double *(*axisBoundsPtr)(int gridID);
...@@ -472,7 +472,7 @@ static const struct cdfDefGridAxisInqs { ...@@ -472,7 +472,7 @@ static const struct cdfDefGridAxisInqs {
.axisSize = gridInqXsize, .axisSize = gridInqXsize,
.axisName = cdiGridInqKeyStr, .axisName = cdiGridInqKeyStr,
.axisStdname = gridInqXstdname, .axisStdname = gridInqXstdname,
.axisLongname = gridInqXlongname, .axisLongname = cdiGridInqKeyStr,
.axisUnits = gridInqXunits, .axisUnits = gridInqXunits,
.axisVal = gridInqXval, .axisVal = gridInqXval,
.axisValsPtr = gridInqXvalsPtr, .axisValsPtr = gridInqXvalsPtr,
...@@ -481,40 +481,37 @@ static const struct cdfDefGridAxisInqs { ...@@ -481,40 +481,37 @@ static const struct cdfDefGridAxisInqs {
.axisSize = gridInqYsize, .axisSize = gridInqYsize,
.axisName = cdiGridInqKeyStr, .axisName = cdiGridInqKeyStr,
.axisStdname = gridInqYstdname, .axisStdname = gridInqYstdname,
.axisLongname = gridInqYlongname, .axisLongname = cdiGridInqKeyStr,
.axisUnits = gridInqYunits, .axisUnits = gridInqYunits,
.axisVal = gridInqYval, .axisVal = gridInqYval,
.axisValsPtr = gridInqYvalsPtr, .axisValsPtr = gridInqYvalsPtr,
.axisBoundsPtr = gridInqYboundsPtr, .axisBoundsPtr = gridInqYboundsPtr,
}, gridInqsZ = { }, gridInqsZ = {
.axisStdname = zaxisInqStdname, .axisStdname = zaxisInqStdname,
.axisLongname = zaxisInqLongname, .axisLongname = cdiZaxisInqKeyStr,
.axisUnits = zaxisInqUnits, .axisUnits = zaxisInqUnits,
}; };
static void static
cdfPutGridStdAtts(int fileID, int ncvarid, void cdfPutGridStdAtts(int fileID, int ncvarid, int gridID, int dimtype, const struct cdfDefGridAxisInqs *inqs)
int gridID, const struct cdfDefGridAxisInqs *inqs)
{ {
size_t len; size_t len;
{
char stdname[CDI_MAX_NAME]; char stdname[CDI_MAX_NAME];
inqs->axisStdname(gridID, stdname); inqs->axisStdname(gridID, stdname);
if ( (len = strlen(stdname)) ) if ( (len = strlen(stdname)) )
cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname); cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
}
{ char longname[CDI_MAX_NAME]; longname[0] = 0;
char longname[CDI_MAX_NAME]; int keyname = (dimtype == 'Z') ? CDI_KEY_LONGNAME : (dimtype == 'X') ? CDI_KEY_XLONGNAME : CDI_KEY_YLONGNAME;
inqs->axisLongname(gridID, longname); inqs->axisLongname(gridID, keyname, CDI_MAX_NAME, longname);
if ( (len = strlen(longname)) ) if ( (len = strlen(longname)) )
cdf_put_att_text(fileID, ncvarid, "long_name", len, longname); cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
}
{ char units[CDI_MAX_NAME];
char units[CDI_MAX_NAME]; inqs->axisUnits(gridID, units);
inqs->axisUnits(gridID, units); if ( (len = strlen(units)) )
if ( (len = strlen(units)) ) cdf_put_att_text(fileID, ncvarid, "units", len, units);
cdf_put_att_text(fileID, ncvarid, "units", len, units);
}
} }
static void static void
...@@ -544,7 +541,7 @@ cdfDefTrajLatLon(stream_t *streamptr, int gridID, int gridindex, ...@@ -544,7 +541,7 @@ cdfDefTrajLatLon(stream_t *streamptr, int gridID, int gridindex,
int keyname = (dimtype == 'X') ? CDI_KEY_XNAME : CDI_KEY_YNAME; int keyname = (dimtype == 'X') ? CDI_KEY_XNAME : CDI_KEY_YNAME;
inqs->axisName(gridID, keyname, CDI_MAX_NAME, axisname); inqs->axisName(gridID, keyname, CDI_MAX_NAME, axisname);
cdf_def_var(fileID, axisname, xtype, 1, &dimNcID, &ncvarid); cdf_def_var(fileID, axisname, xtype, 1, &dimNcID, &ncvarid);
cdfPutGridStdAtts(fileID, ncvarid, gridID, inqs); cdfPutGridStdAtts(fileID, ncvarid, gridID, dimtype, inqs);
cdf_enddef(fileID); cdf_enddef(fileID);
streamptr->ncmode = 2; streamptr->ncmode = 2;
} }
...@@ -752,7 +749,7 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridindex, int ndims, ...@@ -752,7 +749,7 @@ cdfDefAxisCommon(stream_t *streamptr, int gridID, int gridindex, int ndims,
{ {
cdf_def_var(fileID, extendedAxisname, xtype, ndims, &dimID, &ncvarid); cdf_def_var(fileID, extendedAxisname, xtype, ndims, &dimID, &ncvarid);
cdfPutGridStdAtts(fileID, ncvarid, gridID, gridAxisInq); cdfPutGridStdAtts(fileID, ncvarid, gridID, axisLetter, gridAxisInq);
{ {
char axisStr[2] = { axisLetter, '\0' }; char axisStr[2] = { axisLetter, '\0' };
cdf_put_att_text(fileID, ncvarid, "axis", 1, axisStr); cdf_put_att_text(fileID, ncvarid, "axis", 1, axisStr);
...@@ -938,7 +935,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex) ...@@ -938,7 +935,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex)
cdf_def_var(fileID, xaxisname, xtype, 2, dimIDs, &ncxvarid); cdf_def_var(fileID, xaxisname, xtype, 2, dimIDs, &ncxvarid);
cdfGridCompress(fileID, ncxvarid, (int)(xdimlen*ydimlen), streamptr->filetype, streamptr->comptype); cdfGridCompress(fileID, ncxvarid, (int)(xdimlen*ydimlen), streamptr->filetype, streamptr->comptype);
cdfPutGridStdAtts(fileID, ncxvarid, gridID, &gridInqsX); cdfPutGridStdAtts(fileID, ncxvarid, gridID, 'X', &gridInqsX);
/* attribute for Panoply */ /* attribute for Panoply */
cdf_put_att_text(fileID, ncxvarid, "_CoordinateAxisType", 3, "Lon"); cdf_put_att_text(fileID, ncxvarid, "_CoordinateAxisType", 3, "Lon");
...@@ -964,7 +961,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex) ...@@ -964,7 +961,7 @@ void cdfDefCurvilinear(stream_t *streamptr, int gridID, int gridindex)
cdf_def_var(fileID, yaxisname, xtype, 2, dimIDs, &ncyvarid); cdf_def_var(fileID, yaxisname, xtype, 2, dimIDs, &ncyvarid);
cdfGridCompress(fileID, ncyvarid, (int)(xdimlen*ydimlen), streamptr->filetype, streamptr->comptype); cdfGridCompress(fileID, ncyvarid, (int)(xdimlen*ydimlen), streamptr->filetype, streamptr->comptype);
cdfPutGridStdAtts(fileID, ncyvarid, gridID, &gridInqsY); cdfPutGridStdAtts(fileID, ncyvarid, gridID, 'Y', &gridInqsY);
/* attribute for Panoply */ /* attribute for Panoply */
cdf_put_att_text(fileID, ncyvarid, "_CoordinateAxisType", 3, "Lat"); cdf_put_att_text(fileID, ncyvarid, "_CoordinateAxisType", 3, "Lat");
...@@ -1271,7 +1268,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex) ...@@ -1271,7 +1268,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex)
cdf_def_var(fileID, xaxisname, xtype, 1, &dimID, &ncxvarid); cdf_def_var(fileID, xaxisname, xtype, 1, &dimID, &ncxvarid);
cdfGridCompress(fileID, ncxvarid, (int)dimlen, streamptr->filetype, streamptr->comptype); cdfGridCompress(fileID, ncxvarid, (int)dimlen, streamptr->filetype, streamptr->comptype);
cdfPutGridStdAtts(fileID, ncxvarid, gridID, &gridInqsX); cdfPutGridStdAtts(fileID, ncxvarid, gridID, 'X', &gridInqsX);
if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID ) if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
{ {
...@@ -1294,7 +1291,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex) ...@@ -1294,7 +1291,7 @@ void cdfDefUnstructured(stream_t *streamptr, int gridID, int gridindex)
cdf_def_var(fileID, yaxisname, xtype, 1, &dimID, &ncyvarid); cdf_def_var(fileID, yaxisname, xtype, 1, &dimID, &ncyvarid);
cdfGridCompress(fileID, ncyvarid, (int)dimlen, streamptr->filetype, streamptr->comptype); cdfGridCompress(fileID, ncyvarid, (int)dimlen, streamptr->filetype, streamptr->comptype);
cdfPutGridStdAtts(fileID, ncyvarid, gridID, &gridInqsY); cdfPutGridStdAtts(fileID, ncyvarid, gridID, 'Y', &gridInqsY);
if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID ) if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
{ {
...@@ -1820,7 +1817,7 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID) ...@@ -1820,7 +1817,7 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
char dimname[CDI_MAX_NAME+3]; char dimname[CDI_MAX_NAME+3];
dimname[0] = 0; dimname[0] = 0;
//cdiZaxisInqKeyStr(zaxisID, CDI_ZAXIS_DIMNAME, CDI_MAX_NAME, dimname); //cdiZaxisInqKeyStr(zaxisID, CDI_KEY_DIMNAME, CDI_MAX_NAME, dimname);
if ( dimname[0] == 0 ) strcpy(dimname, axisname); if ( dimname[0] == 0 ) strcpy(dimname, axisname);
if ( type == ZAXIS_REFERENCE ) cdfDefZaxisUUID(streamptr, zaxisID); if ( type == ZAXIS_REFERENCE ) cdfDefZaxisUUID(streamptr, zaxisID);
...@@ -1839,7 +1836,7 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID) ...@@ -1839,7 +1836,7 @@ void cdfDefZaxis(stream_t *streamptr, int zaxisID)
cdf_def_var(fileID, axisname, (nc_type) xtype, ndims, &dimID, &ncvarid); cdf_def_var(fileID, axisname, (nc_type) xtype, ndims, &dimID, &ncvarid);
cdfPutGridStdAtts(fileID, ncvarid, zaxisID, &gridInqsZ); cdfPutGridStdAtts(fileID, ncvarid, zaxisID, 'Z', &gridInqsZ);
{ {
int positive = zaxisInqPositive(zaxisID); int positive = zaxisInqPositive(zaxisID);
......
...@@ -369,14 +369,17 @@ void zaxisGetString(char *name, const char *zaxisstrname, size_t len) ...@@ -369,14 +369,17 @@ void zaxisGetString(char *name, const char *zaxisstrname, size_t len)
} }
static static
char *zaxis_key_to_string(zaxis_t *zaxisptr, int key) void *zaxis_key_to_ptr(zaxis_t *zaxisptr, int key)
{ {
char *keyptr = NULL; void *keyptr = NULL;
switch (key) switch (key)
{ {
case CDI_ZAXIS_DIMNAME: keyptr = zaxisptr->dimname; break; case CDI_KEY_NAME: keyptr = (void*)zaxisptr->name; break;
case CDI_ZAXIS_VDIMNAME: keyptr = zaxisptr->vdimname; break; case CDI_KEY_LONGNAME: keyptr = (void*)zaxisptr->longname; break;
case CDI_KEY_UNITS: keyptr = (void*)zaxisptr->units; break;
case CDI_KEY_DIMNAME: keyptr = (void*)zaxisptr->dimname; break;
case CDI_KEY_VDIMNAME: keyptr = (void*)zaxisptr->vdimname; break;
} }
return keyptr; return keyptr;
...@@ -407,7 +410,7 @@ int cdiZaxisDefKeyStr(int zaxisID, int key, int size, const char *mesg) ...@@ -407,7 +410,7 @@ int cdiZaxisDefKeyStr(int zaxisID, int key, int size, const char *mesg)
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID); zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
char *keyptr = zaxis_key_to_string(zaxisptr, key); char *keyptr = (char*)zaxis_key_to_ptr(zaxisptr, key);
if ( keyptr == NULL) if ( keyptr == NULL)
{ {
Warning("CDI zaxis string key %d not supported!", key); Warning("CDI zaxis string key %d not supported!", key);
...@@ -447,7 +450,7 @@ int cdiZaxisInqKeyStr(int zaxisID, int key, int size, char *mesg) ...@@ -447,7 +450,7 @@ int cdiZaxisInqKeyStr(int zaxisID, int key, int size, char *mesg)
if ( size < 1 || mesg == NULL ) return -1; if ( size < 1 || mesg == NULL ) return -1;
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID); zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
const char *keyptr = zaxis_key_to_string(zaxisptr, key); const char *keyptr = (const char*)zaxis_key_to_ptr(zaxisptr, key);
if ( keyptr == NULL) if ( keyptr == NULL)
{ {
Warning("CDI zaxis string key %d not supported!", key); Warning("CDI zaxis string key %d not supported!", key);
...@@ -475,13 +478,7 @@ The function @func{zaxisDefName} defines the name of a Z-axis. ...@@ -475,13 +478,7 @@ The function @func{zaxisDefName} defines the name of a Z-axis.
*/ */
void zaxisDefName(int zaxisID, const char *name) void zaxisDefName(int zaxisID, const char *name)
{ {
if ( name ) (void)cdiZaxisDefKeyStr(zaxisID, CDI_KEY_NAME, CDI_MAX_NAME, name);
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
strncpy(zaxisptr->name, name, CDI_MAX_NAME - 1);
zaxisptr->name[CDI_MAX_NAME - 1] = '\0';
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
} }
/* /*
...@@ -500,13 +497,7 @@ The function @func{zaxisDefLongname} defines the longname of a Z-axis. ...@@ -500,13 +497,7 @@ The function @func{zaxisDefLongname} defines the longname of a Z-axis.
*/ */
void zaxisDefLongname(int zaxisID, const char *longname) void zaxisDefLongname(int zaxisID, const char *longname)
{ {
if ( longname ) (void)cdiZaxisDefKeyStr(zaxisID, CDI_KEY_LONGNAME, CDI_MAX_NAME, longname);
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
strncpy(zaxisptr->longname, longname, CDI_MAX_NAME - 1);
zaxisptr->longname[CDI_MAX_NAME - 1] = '\0';
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
} }
/* /*
...@@ -525,13 +516,7 @@ The function @func{zaxisDefUnits} defines the units of a Z-axis. ...@@ -525,13 +516,7 @@ The function @func{zaxisDefUnits} defines the units of a Z-axis.
*/ */
void zaxisDefUnits(int zaxisID, const char *units) void zaxisDefUnits(int zaxisID, const char *units)
{ {
if ( units ) (void)cdiZaxisDefKeyStr(zaxisID, CDI_KEY_UNITS, CDI_MAX_NAME, units);
{
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID);
strncpy(zaxisptr->units, units, CDI_MAX_NAME - 1);
zaxisptr->units[CDI_MAX_NAME - 1] = '\0';
reshSetStatus(zaxisID, &zaxisOps, RESH_DESYNC_IN_USE);
}
} }
...@@ -567,8 +552,7 @@ The function @func{zaxisInqName} returns the name of a Z-axis. ...@@ -567,8 +552,7 @@ The function @func{zaxisInqName} returns the name of a Z-axis.
*/ */
void zaxisInqName(int zaxisID, char *name) void zaxisInqName(int zaxisID, char *name)
{ {
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID); (void)cdiZaxisInqKeyStr(zaxisID, CDI_KEY_NAME, CDI_MAX_NAME, name);
strcpy(name, zaxisptr->name);
} }
const char *zaxisInqNamePtr(int zaxisID) const char *zaxisInqNamePtr(int zaxisID)
...@@ -598,8 +582,7 @@ The function @func{zaxisInqLongname} returns the longname of a Z-axis. ...@@ -598,8 +582,7 @@ The function @func{zaxisInqLongname} returns the longname of a Z-axis.
*/ */
void zaxisInqLongname(int zaxisID, char *longname) void zaxisInqLongname(int zaxisID, char *longname)
{ {
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID); (void)cdiZaxisInqKeyStr(zaxisID, CDI_KEY_LONGNAME, CDI_MAX_NAME, longname);
strcpy(longname, zaxisptr->longname);
} }
/* /*
...@@ -623,8 +606,7 @@ The function @func{zaxisInqUnits} returns the units of a Z-axis. ...@@ -623,8 +606,7 @@ The function @func{zaxisInqUnits} returns the units of a Z-axis.
*/ */
void zaxisInqUnits(int zaxisID, char *units) void zaxisInqUnits(int zaxisID, char *units)
{ {
zaxis_t *zaxisptr = zaxisID2Ptr(zaxisID); (void)cdiZaxisInqKeyStr(zaxisID, CDI_KEY_UNITS, CDI_MAX_NAME, units);
strcpy(units, zaxisptr->units);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment