Loading...
Searching...
No Matches
dattput.c
Go to the documentation of this file.
/* Copyright 2018 University Corporation for Atmospheric
Research/Unidata. See copyright file for more info. */
#include "ncdispatch.h"
/* Start doxygen member group. */
int
nc_put_att_string(int ncid, int varid, const char *name,
size_t len, const char** value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, NC_STRING,
len, (void*)value, NC_STRING);
}
int nc_put_att_text(int ncid, int varid, const char *name,
size_t len, const char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, NC_CHAR, len,
(void *)value, NC_CHAR);
}
int
nc_put_att(int ncid, int varid, const char *name, nc_type xtype,
size_t len, const void *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
value, xtype);
}
int
nc_put_att_schar(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const signed char *value)
{
NC *ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_BYTE);
}
int
nc_put_att_uchar(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const unsigned char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_UBYTE);
}
int
nc_put_att_short(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const short *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_SHORT);
}
int
nc_put_att_int(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const int *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_INT);
}
int
nc_put_att_long(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const long *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, longtype);
}
int
nc_put_att_float(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const float *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_FLOAT);
}
int
nc_put_att_double(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const double *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_DOUBLE);
}
int
nc_put_att_ubyte(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const unsigned char *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_UBYTE);
}
int
nc_put_att_ushort(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const unsigned short *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_USHORT);
}
int
nc_put_att_uint(int ncid, int varid, const char *name,
nc_type xtype, size_t len, const unsigned int *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_UINT);
}
int
nc_put_att_longlong(int ncid, int varid, const char *name,
nc_type xtype, size_t len,
const long long *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_INT64);
}
int
nc_put_att_ulonglong(int ncid, int varid, const char *name,
nc_type xtype, size_t len,
const unsigned long long *value)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
(void *)value, NC_UINT64);
}
/* End doxygen member group. */
nc_put_att
int nc_put_att(int ncid, int varid, const char *name, nc_type xtype, size_t len, const void *value)
Write an attribute of any type.
Definition dattput.c:222
nc_put_att_uint
int nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned int *value)
Write an attribute of type unsigned int.
Definition dattput.c:562
nc_put_att_string
int nc_put_att_string(int ncid, int varid, const char *name, size_t len, const char **value)
Write a string attribute.
Definition dattput.c:75
nc_put_att_ubyte
int nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *value)
Write an attribute of type unsigned char.
Definition dattput.c:494
nc_put_att_text
int nc_put_att_text(int ncid, int varid, const char *name, size_t len, const char *value)
Write a text attribute.
Definition dattput.c:153
nc_put_att_schar
int nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const signed char *value)
Write an attribute of type signed char.
Definition dattput.c:256
nc_put_att_ushort
int nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned short *value)
Write an attribute of type unsigned short.
Definition dattput.c:528
nc_put_att_long
int nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long *value)
Write an attribute of type long.
Definition dattput.c:392
nc_put_att_float
int nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype, size_t len, const float *value)
Write an attribute of type float.
Definition dattput.c:426
nc_put_att_uchar
int nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *value)
Write an attribute of type unsigned char.
Definition dattput.c:290
nc_put_att_longlong
int nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long long *value)
Write an attribute of type long long.
Definition dattput.c:596
nc_put_att_ulonglong
int nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned long long *value)
Write an attribute of type unsigned long long.
Definition dattput.c:631
nc_put_att_int
int nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype, size_t len, const int *value)
Write an attribute of type int.
Definition dattput.c:358
nc_put_att_short
int nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype, size_t len, const short *value)
Write an attribute of type short.
Definition dattput.c:324
nc_put_att_double
int nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype, size_t len, const double *value)
Write an attribute of type double.
Definition dattput.c:460
NC_UINT
#define NC_UINT
unsigned 4-byte int
Definition netcdf.h:44
NC_INT
#define NC_INT
signed 4 byte integer
Definition netcdf.h:38
NC_BYTE
#define NC_BYTE
signed 1 byte integer
Definition netcdf.h:35
NC_DOUBLE
#define NC_DOUBLE
double precision floating point number
Definition netcdf.h:41
NC_UBYTE
#define NC_UBYTE
unsigned 1 byte int
Definition netcdf.h:42
NC_FLOAT
#define NC_FLOAT
single precision floating point number
Definition netcdf.h:40
NC_SHORT
#define NC_SHORT
signed 2 byte integer
Definition netcdf.h:37
NC_INT64
#define NC_INT64
signed 8-byte int
Definition netcdf.h:45
NC_UINT64
#define NC_UINT64
unsigned 8-byte int
Definition netcdf.h:46
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:417
NC_USHORT
#define NC_USHORT
unsigned 2-byte int
Definition netcdf.h:43
NC_STRING
#define NC_STRING
string
Definition netcdf.h:47
NC_CHAR
#define NC_CHAR
ISO/ASCII character.
Definition netcdf.h:36
nc_type
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25