Loading...
Searching...
No Matches
denum.c
Go to the documentation of this file.
#include "ncdispatch.h"
/* All these functions are part of this named group... */
int
nc_def_enum(int ncid, nc_type base_typeid, const char *name, nc_type *typeidp)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->def_enum(ncid,base_typeid,name,typeidp);
}
int
nc_insert_enum(int ncid, nc_type xtype, const char *name,
const void *value)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->insert_enum(ncid, xtype, name,
value);
}
int
nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep,
size_t *base_sizep, size_t *num_membersp)
{
int class = 0;
int stat = nc_inq_user_type(ncid, xtype, name, base_sizep,
base_nc_typep, num_membersp, &class);
if(stat != NC_NOERR) return stat;
if(class != NC_ENUM) stat = NC_EBADTYPE;
return stat;
}
int
nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name,
void *value)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_enum_member(ncid, xtype, idx, name, value);
}
int
nc_inq_enum_ident(int ncid, nc_type xtype, long long value,
char *identifier)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->inq_enum_ident(ncid,xtype,value,identifier);
}
/* End of named group ...*/
nc_def_enum
int nc_def_enum(int ncid, nc_type base_typeid, const char *name, nc_type *typeidp)
Create an enum type.
Definition denum.c:43
nc_inq_enum_member
int nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, void *value)
Learn about a about a member of an enum type.
Definition denum.c:140
nc_insert_enum
int nc_insert_enum(int ncid, nc_type xtype, const char *name, const void *value)
Insert a named member into a enum type.
Definition denum.c:71
nc_inq_enum
int nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep, size_t *base_sizep, size_t *num_membersp)
Learn about a user-define enumeration type.
Definition denum.c:107
nc_inq_enum_ident
int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier)
Get the name which is associated with an enum member value.
Definition denum.c:164
nc_inq_user_type
EXTERNL int nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, nc_type *base_nc_typep, size_t *nfieldsp, int *classp)
Learn about a user defined type.
Definition dtype.c:146
NC_EBADTYPE
#define NC_EBADTYPE
Not a netcdf data type.
Definition netcdf.h:420
NC_ENUM
#define NC_ENUM
enum types
Definition netcdf.h:55
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:378
nc_type
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25