NetCDF 4.9.3
Loading...
Searching...
No Matches
nc4internal.c File Reference
#include "config.h"
#include "netcdf.h"
#include "netcdf_filter.h"
#include "netcdf_meta.h"
#include "nc4internal.h"
#include "nc.h"
#include "ncdispatch.h"
#include "ncutf8.h"
#include <stdarg.h>
#include <stddef.h>
#include "ncrc.h"

Go to the source code of this file.

Macros

#define NRESERVED   (sizeof(NC_reserved) / sizeof(NC_reservedatt)) /*|NC_reservedatt*/
 

Functions

static int bincmp (const void *arg1, const void *arg2)
 
static int dim_free (NC_DIM_INFO_T *dim)
 
static void field_free (NC_FIELD_INFO_T *field)
 
int nc4_att_free (NC_ATT_INFO_T *att)
 
int nc4_att_list_add (NCindex *list, const char *name, NC_ATT_INFO_T **att)
 
int nc4_att_list_del (NCindex *list, NC_ATT_INFO_T *att)
 
int nc4_check_dup_name (NC_GRP_INFO_T *grp, char *name)
 
int nc4_check_name (const char *name, char *norm_name)
 
int nc4_dim_list_add (NC_GRP_INFO_T *grp, const char *name, size_t len, int assignedid, NC_DIM_INFO_T **dim)
 
int nc4_dim_list_del (NC_GRP_INFO_T *grp, NC_DIM_INFO_T *dim)
 
int nc4_enum_member_add (NC_TYPE_INFO_T *parent, size_t size, const char *name, const void *value)
 
int nc4_field_list_add (NC_TYPE_INFO_T *parent, const char *name, size_t offset, nc_type xtype, int ndims, const int *dim_sizesp)
 
int nc4_file_change_ncid (int ncid, unsigned short new_ncid_index)
 
int nc4_file_list_add (int ncid, const char *path, int mode, void **dispatchdata)
 
int nc4_file_list_del (int ncid)
 
int nc4_file_list_get (int ncid, char **path, int *mode, void **dispatchdata)
 
int nc4_find_dim (NC_GRP_INFO_T *grp, int dimid, NC_DIM_INFO_T **dim, NC_GRP_INFO_T **dim_grp)
 
int nc4_find_grp_att (NC_GRP_INFO_T *grp, int varid, const char *name, int attnum, NC_ATT_INFO_T **att)
 
int nc4_find_grp_h5 (int ncid, NC_GRP_INFO_T **grp, NC_FILE_INFO_T **h5)
 
int nc4_find_grp_h5_var (int ncid, int varid, NC_FILE_INFO_T **h5, NC_GRP_INFO_T **grp, NC_VAR_INFO_T **var)
 
int nc4_find_nc4_grp (int ncid, NC_GRP_INFO_T **grp)
 
int nc4_find_nc_att (int ncid, int varid, const char *name, int attnum, NC_ATT_INFO_T **att)
 
int nc4_find_nc_grp_h5 (int ncid, NC **nc, NC_GRP_INFO_T **grp, NC_FILE_INFO_T **h5)
 
int nc4_find_type (const NC_FILE_INFO_T *h5, nc_type typeid, NC_TYPE_INFO_T **type)
 
int nc4_find_var (NC_GRP_INFO_T *grp, const char *name, NC_VAR_INFO_T **var)
 
int nc4_grp_list_add (NC_FILE_INFO_T *h5, NC_GRP_INFO_T *parent, char *name, NC_GRP_INFO_T **grp)
 
static int NC4_move_in_NCList (NC *nc, int new_id)
 
int nc4_nc4f_list_add (NC *nc, const char *path, int mode)
 
int nc4_nc4f_list_del (NC_FILE_INFO_T *h5)
 
int nc4_normalize_name (const char *name, char *norm_name)
 
NC_TYPE_INFO_T * nc4_rec_find_named_type (NC_GRP_INFO_T *start_grp, char *name)
 
int nc4_rec_grp_del (NC_GRP_INFO_T *grp)
 
int nc4_rec_grp_del_att_data (NC_GRP_INFO_T *grp)
 
int NC4_show_metadata (int ncid)
 
int nc4_type_free (NC_TYPE_INFO_T *type)
 
int nc4_type_list_add (NC_GRP_INFO_T *grp, size_t size, const char *name, NC_TYPE_INFO_T **type)
 
int nc4_type_new (size_t size, const char *name, int assignedid, NC_TYPE_INFO_T **type)
 
int nc4_var_list_add (NC_GRP_INFO_T *grp, const char *name, int ndims, NC_VAR_INFO_T **var)
 
int nc4_var_list_add2 (NC_GRP_INFO_T *grp, const char *name, NC_VAR_INFO_T **var)
 
int nc4_var_list_del (NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var)
 
int nc4_var_set_ndims (NC_VAR_INFO_T *var, int ndims)
 
const NC_reservedatt * NC_findreserved (const char *name)
 
void NC_initialize_reserved (void)
 
static void obj_track (NC_FILE_INFO_T *file, NC_OBJ *obj)
 
static int sortcmp (const void *arg1, const void *arg2)
 
static int var_free (NC_VAR_INFO_T *var)
 

Variables

static NC_reservedatt NC_reserved []
 

Detailed Description

Internal netcdf-4 functions.

This file contains functions internal to the netcdf4 library. None of the functions in this file are exposed in the exetnal API. These functions all relate to the manipulation of netcdf-4's in-memory buffer of metadata information, i.e. the linked list of NC structs.

Author
Ed Hartnett, Dennis Heimbigner, Ward Fisher

Definition in file nc4internal.c.

Macro Definition Documentation

◆ NRESERVED

#define NRESERVED   (sizeof(NC_reserved) / sizeof(NC_reservedatt)) /*|NC_reservedatt*/

Definition at line 62 of file nc4internal.c.

Function Documentation

◆ bincmp()

static int bincmp ( const void * arg1,
const void * arg2 )
static

Definition at line 2075 of file nc4internal.c.

◆ dim_free()

static int dim_free ( NC_DIM_INFO_T * dim)
static

Free a dim

Parameters
dimPointer to dim info struct of type to delete.
Returns
NC_NOERR No error.
Author
Ed Hartnett, Ward Fisher

Definition at line 1451 of file nc4internal.c.

◆ field_free()

static void field_free ( NC_FIELD_INFO_T * field)
static

Free up a field

Parameters
fieldPointer to field info of field to delete.
Author
Ed Hartnett

Definition at line 1238 of file nc4internal.c.

◆ nc4_att_free()

int nc4_att_free ( NC_ATT_INFO_T * att)

Free memory of an attribute object

Parameters
attPointer to attribute info struct.
Returns
NC_NOERR No error.
Author
Ed Hartnett

Definition at line 1329 of file nc4internal.c.

◆ nc4_att_list_add()

int nc4_att_list_add ( NCindex * list,
const char * name,
NC_ATT_INFO_T ** att )

Add to an attribute list.

Parameters
listNCindex of att info structs.
namename of the new attribute
attPointer to pointer that gets the new att info struct. Ignored if NULL.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 910 of file nc4internal.c.

◆ nc4_att_list_del()

int nc4_att_list_del ( NCindex * list,
NC_ATT_INFO_T * att )

Remove a NC_ATT_INFO_T from an index. This will nc_free the memory too.

Parameters
listPointer to pointer of list.
attPointer to attribute info struct.
Returns
NC_NOERR No error.
Author
Dennis Heimbigner

Definition at line 1606 of file nc4internal.c.

◆ nc4_check_dup_name()

int nc4_check_dup_name ( NC_GRP_INFO_T * grp,
char * name )

Names for groups, variables, and types must not be the same. This function checks that a proposed name is not already in use. Normalzation of UTF8 strings should happen before this function is called.

Parameters
grpPointer to group info struct.
nameName to check.
Returns
NC_NOERR No error.
NC_ENAMEINUSE Name is in use.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1015 of file nc4internal.c.

◆ nc4_check_name()

int nc4_check_name ( const char * name,
char * norm_name )

Check and normalize and name.

Parameters
nameName to normalize.
norm_nameThe normalized name.
Returns
NC_NOERR No error.
NC_EMAXNAME Name too long.
NC_EINVAL NULL given for name.
NC_ENOMEM Out of memory.
Author
Dennis Heimbigner

Definition at line 154 of file nc4internal.c.

◆ nc4_dim_list_add()

int nc4_dim_list_add ( NC_GRP_INFO_T * grp,
const char * name,
size_t len,
int assignedid,
NC_DIM_INFO_T ** dim )

Add a dimension to the dimension list for a group.

Parameters
grpcontainer for the dim
namefor the dim
lenfor the dim
assignedidoverride dimid if >= 0
dimPointer to pointer that gets the new dim info struct.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 851 of file nc4internal.c.

◆ nc4_dim_list_del()

int nc4_dim_list_del ( NC_GRP_INFO_T * grp,
NC_DIM_INFO_T * dim )

Free a dim and unlist it

Parameters
grpPointer to dim's containing group
dimPointer to dim info struct of type to delete.
Returns
NC_NOERR No error.
Author
Dennis Heimbigner

Definition at line 1474 of file nc4internal.c.

◆ nc4_enum_member_add()

int nc4_enum_member_add ( NC_TYPE_INFO_T * parent,
size_t size,
const char * name,
const void * value )

Add a member to an enum type.

Parameters
parentContaining NC_TYPE_INFO_T object
sizeSize in bytes of new member.
nameName of the member.
valueValue to associate with member.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 1199 of file nc4internal.c.

◆ nc4_field_list_add()

int nc4_field_list_add ( NC_TYPE_INFO_T * parent,
const char * name,
size_t offset,
nc_type xtype,
int ndims,
const int * dim_sizesp )

Add to the compound field list.

Parameters
parentparent type
nameName of the field.
offsetOffset in bytes.
xtypeThe netCDF type of the field.
ndimsThe number of dimensions of the field.
dim_sizespAn array of dim sizes for the field.
Returns
NC_NOERR No error.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1142 of file nc4internal.c.

◆ nc4_file_change_ncid()

int nc4_file_change_ncid ( int ncid,
unsigned short new_ncid_index )

Change the ncid of an open file. This is needed for PIO integration.

Parameters
ncidThe ncid of the file (aka ext_ncid).
new_ncid_indexThe new ncid index to use (i.e. the first two bytes of the ncid).
Returns
NC_NOERR No error.
NC_EBADID No NC struct with this ext_ncid.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 247 of file nc4internal.c.

◆ nc4_file_list_add()

int nc4_file_list_add ( int ncid,
const char * path,
int mode,
void ** dispatchdata )

Add a file to the list of libsrc4 open files. This is used by dispatch layers that wish to use the libsrc4 metadata model, but don't know about struct NC. This is the same as nc4_nc4f_list_add(), except it takes an ncid instead of an NC *, and also passes back the dispatchdata pointer.

Parameters
ncidThe (already-assigned) ncid of the file (aka ext_ncid).
pathThe file name of the new file.
modeThe mode flag.
dispatchdataVoid * that gets pointer to dispatch data, which is the NC_FILE_INFO_T struct allocated for this file and its metadata. Ignored if NULL. (This is passed as a void to allow external user-defined formats to use this function.)
Returns
NC_NOERR No error.
NC_EBADID No NC struct with this ext_ncid.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 211 of file nc4internal.c.

◆ nc4_file_list_del()

int nc4_file_list_del ( int ncid)

Free all resources and memory associated with a NC_FILE_INFO_T. This is the same as nc4_nc4f_list_del(), except it takes ncid. This function allows external dispatch layers, like PIO, to manipulate the file list without needing to know about internal netcdf structures.

Parameters
ncidThe ncid of the file to release.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett

Definition at line 1627 of file nc4internal.c.

◆ nc4_file_list_get()

int nc4_file_list_get ( int ncid,
char ** path,
int * mode,
void ** dispatchdata )

Get info about a file on the list of libsrc4 open files. This is used by dispatch layers that wish to use the libsrc4 metadata model, but don't know about struct NC.

Parameters
ncidThe ncid of the file (aka ext_ncid).
pathA pointer that gets file name (< NC_MAX_NAME). Ignored if NULL.
modeA pointer that gets the mode flag. Ignored if NULL.
dispatchdataVoid * that gets pointer to dispatch data, which is the NC_FILE_INFO_T struct allocated for this file and its metadata. Ignored if NULL. (This is passed as a void to allow external user-defined formats to use this function.)
Returns
NC_NOERR No error.
NC_EBADID No NC struct with this ext_ncid.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 290 of file nc4internal.c.

◆ nc4_find_dim()

int nc4_find_dim ( NC_GRP_INFO_T * grp,
int dimid,
NC_DIM_INFO_T ** dim,
NC_GRP_INFO_T ** dim_grp )

Find a dim in the file.

Parameters
grpPointer to group info struct.
dimidDimension ID to find.
dimPointer that gets pointer to dim info if found.
dim_grpPointer that gets pointer to group info of group that contains dimension. Ignored if NULL.
Returns
NC_NOERR No error.
NC_EBADDIM Dimension not found.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 511 of file nc4internal.c.

◆ nc4_find_grp_att()

int nc4_find_grp_att ( NC_GRP_INFO_T * grp,
int varid,
const char * name,
int attnum,
NC_ATT_INFO_T ** att )

Given a group, find an att. If name is provided, use that, otherwise use the attnum.

Parameters
grpPointer to group info struct.
varidVariable ID.
nameName to of attribute.
attnumNumber of attribute.
attPointer to pointer that gets attribute info struct.
Returns
NC_NOERR No error.
NC_ENOTVAR Variable not found.
NC_ENOTATT Attribute not found.
Author
Ed Hartnett

Definition at line 629 of file nc4internal.c.

◆ nc4_find_grp_h5()

int nc4_find_grp_h5 ( int ncid,
NC_GRP_INFO_T ** grp,
NC_FILE_INFO_T ** h5 )

Given an ncid, find the relevant group and return a pointer to it, also set a pointer to the nc4_info struct of the related file.

Parameters
ncidFile and group ID.
grpPointer that gets pointer to group info struct. Ignored if NULL.
h5Pointer that gets pointer to file info struct. Ignored if NULL.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett

Definition at line 402 of file nc4internal.c.

◆ nc4_find_grp_h5_var()

int nc4_find_grp_h5_var ( int ncid,
int varid,
NC_FILE_INFO_T ** h5,
NC_GRP_INFO_T ** grp,
NC_VAR_INFO_T ** var )

Given an ncid and varid, get pointers to the group and var metadata.

Parameters
ncidFile ID.
varidVariable ID.
h5Pointer that gets pointer to the NC_FILE_INFO_T struct for this file. Ignored if NULL.
grpPointer that gets pointer to group info. Ignored if NULL.
varPointer that gets pointer to var info. Ignored if NULL.
Returns
NC_NOERR No error.
Author
Ed Hartnett

Definition at line 468 of file nc4internal.c.

◆ nc4_find_nc4_grp()

int nc4_find_nc4_grp ( int ncid,
NC_GRP_INFO_T ** grp )

Given an ncid, find the relevant group and return a pointer to it.

Parameters
ncidFile and group ID.
grpPointer that gets pointer to group info struct. Ignored if NULL.
Returns
NC_NOERR No error.
NC_ENOTNC4 Not a netCDF-4 file.
Author
Ed Hartnett

Definition at line 381 of file nc4internal.c.

◆ nc4_find_nc_att()

int nc4_find_nc_att ( int ncid,
int varid,
const char * name,
int attnum,
NC_ATT_INFO_T ** att )

Given an ncid, varid, and name or attnum, find and return pointer to NC_ATT_INFO_T metadata.

Parameters
ncidFile and group ID.
varidVariable ID.
nameName to of attribute.
attnumNumber of attribute.
attPointer to pointer that gets attribute info struct.
Returns
NC_NOERR No error.
NC_ENOTVAR Variable not found.
NC_ENOTATT Attribute not found.
Author
Ed Hartnett

Definition at line 686 of file nc4internal.c.

◆ nc4_find_nc_grp_h5()

int nc4_find_nc_grp_h5 ( int ncid,
NC ** nc,
NC_GRP_INFO_T ** grp,
NC_FILE_INFO_T ** h5 )

Find info for this file and group, and set pointers.

Parameters
ncidFile and group ID.
ncPointer that gets a pointer to the file's NC struct. Ignored if NULL.
grpPointer that gets a pointer to the group struct. Ignored if NULL.
h5Pointer that gets HDF5 file struct. Ignored if NULL.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 422 of file nc4internal.c.

◆ nc4_find_type()

int nc4_find_type ( const NC_FILE_INFO_T * h5,
nc_type typeid,
NC_TYPE_INFO_T ** type )

Use a netCDF typeid to find a type in a type_list.

Parameters
h5Pointer to HDF5 file info struct.
typeidThe netCDF type ID.
typePointer to pointer to the list of type info structs.
Returns
NC_NOERR No error.
NC_EINVAL Invalid input.
Author
Ed Hartnett

Definition at line 593 of file nc4internal.c.

◆ nc4_find_var()

int nc4_find_var ( NC_GRP_INFO_T * grp,
const char * name,
NC_VAR_INFO_T ** var )

Find a var (by name) in a grp.

Parameters
grpPointer to group info.
nameName of var to find.
varPointer that gets pointer to var info struct, if found.
Returns
NC_NOERR No error.
Author
Ed Hartnett

Definition at line 539 of file nc4internal.c.

◆ nc4_grp_list_add()

int nc4_grp_list_add ( NC_FILE_INFO_T * h5,
NC_GRP_INFO_T * parent,
char * name,
NC_GRP_INFO_T ** grp )

Add a group to a group list.

Parameters
h5Pointer to the file info.
parentPointer to the parent group. Will be NULL when adding the root group.
nameName of the group.
grpPointer to pointer that gets new group info struct. Ignored if NULL.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 953 of file nc4internal.c.

◆ NC4_move_in_NCList()

static int NC4_move_in_NCList ( NC * nc,
int new_id )
static

Definition at line 2055 of file nc4internal.c.

◆ nc4_nc4f_list_add()

int nc4_nc4f_list_add ( NC * nc,
const char * path,
int mode )

Given an NC pointer, add the necessary stuff for a netcdf-4 file. This allocates the NC_FILE_INFO_T struct for the file, which is used by libhdf5 and libhdf4 (and perhaps other future dispatch layers) to hold the metadata for the file.

Parameters
ncPointer to file's NC struct.
pathThe file name of the new file.
modeThe mode flag.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 329 of file nc4internal.c.

◆ nc4_nc4f_list_del()

int nc4_nc4f_list_del ( NC_FILE_INFO_T * h5)

Free all resources and memory associated with a NC_FILE_INFO_T.

Parameters
h5Pointer to NC_FILE_INFO_T to be freed.
Returns
NC_NOERR No error.
Author
Ed Hartnett

Definition at line 1654 of file nc4internal.c.

◆ nc4_normalize_name()

int nc4_normalize_name ( const char * name,
char * norm_name )

Normalize a UTF8 name. Put the result in norm_name, which can be NC_MAX_NAME + 1 in size. This function makes sure the free() gets called on the return from utf8proc_NFC, and also ensures that the name is not too long.

Parameters
nameName to normalize.
norm_nameThe normalized name.
Returns
NC_NOERR No error.
NC_EMAXNAME Name too long.
Author
Dennis Heimbigner

Definition at line 1700 of file nc4internal.c.

◆ nc4_rec_find_named_type()

NC_TYPE_INFO_T * nc4_rec_find_named_type ( NC_GRP_INFO_T * start_grp,
char * name )

Locate netCDF type by name.

Parameters
start_grpPointer to starting group info.
nameName of type to find.
Returns
Pointer to type info, or NULL if not found.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 558 of file nc4internal.c.

◆ nc4_rec_grp_del()

int nc4_rec_grp_del ( NC_GRP_INFO_T * grp)

Recursively delete the data for a group (and everything it contains) in our internal metadata store.

Parameters
grpPointer to group info struct.
Returns
NC_NOERR No error.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1496 of file nc4internal.c.

◆ nc4_rec_grp_del_att_data()

int nc4_rec_grp_del_att_data ( NC_GRP_INFO_T * grp)

Recursively delete the data for a group (and everything it contains) in our internal metadata store.

Parameters
grpPointer to group info struct.
Returns
NC_NOERR No error.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1556 of file nc4internal.c.

◆ NC4_show_metadata()

int NC4_show_metadata ( int ncid)

Show the in-memory metadata for a netcdf file. This function does nothing unless netCDF was built with the configure option –enable-logging.

Parameters
ncidFile and group ID.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett

Definition at line 2002 of file nc4internal.c.

◆ nc4_type_free()

int nc4_type_free ( NC_TYPE_INFO_T * type)

Free allocated space for type information.

Parameters
typePointer to type info struct.
Returns
NC_NOERR No error.
NC_EHDFERR HDF5 error.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1260 of file nc4internal.c.

◆ nc4_type_list_add()

int nc4_type_list_add ( NC_GRP_INFO_T * grp,
size_t size,
const char * name,
NC_TYPE_INFO_T ** type )

Add to the type list.

Parameters
grpPointer to group info struct.
sizeSize of type in bytes.
nameName of type.
typePointer that gets pointer to new type info struct.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 1096 of file nc4internal.c.

◆ nc4_type_new()

int nc4_type_new ( size_t size,
const char * name,
int assignedid,
NC_TYPE_INFO_T ** type )

Create a type, but do not add to various lists nor increment its ref count

Parameters
sizeSize of type in bytes.
nameName of type.
assignedidif >= 0 then override the default type id.
typePointer that gets pointer to new type info struct.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett, Ward Fisher

Definition at line 1053 of file nc4internal.c.

◆ nc4_var_list_add()

int nc4_var_list_add ( NC_GRP_INFO_T * grp,
const char * name,
int ndims,
NC_VAR_INFO_T ** var )

Create a new variable and insert int relevant list.

Parameters
grpthe containing group
namethe name for the new variable
ndimsthe rank of the new variable
varPointer in which to return a pointer to the new var.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 824 of file nc4internal.c.

◆ nc4_var_list_add2()

int nc4_var_list_add2 ( NC_GRP_INFO_T * grp,
const char * name,
NC_VAR_INFO_T ** var )

Create a new variable and insert into relevant lists. Dimensionality info need not be known.

Parameters
grpthe containing group
namethe name for the new variable
varPointer in which to return a pointer to the new var.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 740 of file nc4internal.c.

◆ nc4_var_list_del()

int nc4_var_list_del ( NC_GRP_INFO_T * grp,
NC_VAR_INFO_T * var )

Delete a var, and free the memory.

Parameters
grpPointer to the strct for the containing group.
varPointer to the var info struct of var to delete.
Returns
NC_NOERR No error.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1428 of file nc4internal.c.

◆ nc4_var_set_ndims()

int nc4_var_set_ndims ( NC_VAR_INFO_T * var,
int ndims )

Set the number of dims in an NC_VAR_INFO_T struct.

Parameters
varPointer to the var.
ndimsNumber of dimensions for this var.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 788 of file nc4internal.c.

◆ NC_findreserved()

const NC_reservedatt * NC_findreserved ( const char * name)

Define a binary searcher for reserved attributes

Parameters
namefor which to search
Returns
pointer to the matching NC_reservedatt structure.
NULL if not found.
Author
Dennis Heimbigner

Definition at line 2029 of file nc4internal.c.

◆ NC_initialize_reserved()

void NC_initialize_reserved ( void )

Definition at line 2083 of file nc4internal.c.

◆ obj_track()

static void obj_track ( NC_FILE_INFO_T * file,
NC_OBJ * obj )
static

Add NC_OBJ to allXXX lists in a file

Parameters
filePointer to the containing file
objPointer to object to add.
Author
Dennis Heimbigner

Definition at line 712 of file nc4internal.c.

◆ sortcmp()

static int sortcmp ( const void * arg1,
const void * arg2 )
static

Definition at line 2067 of file nc4internal.c.

◆ var_free()

static int var_free ( NC_VAR_INFO_T * var)
static

Delete a var, and free the memory. All HDF5 objects for the var must be closed before this is called.

Parameters
varPointer to the var info struct of var to delete.
Returns
NC_NOERR No error.
Author
Ed Hartnett, Dennis Heimbigner

Definition at line 1370 of file nc4internal.c.

Variable Documentation

◆ NC_reserved

NC_reservedatt NC_reserved[]
static
Initial value:
= {
{NC_ATT_CLASS, READONLYFLAG|HIDDENATTRFLAG},
{NC_ATT_DIMENSION_LIST, READONLYFLAG|HIDDENATTRFLAG},
{NC_ATT_NAME, READONLYFLAG|HIDDENATTRFLAG},
{NC_ATT_REFERENCE_LIST, READONLYFLAG|HIDDENATTRFLAG},
{NC_XARRAY_DIMS, READONLYFLAG|HIDDENATTRFLAG},
{NC_ATT_CODECS, VARFLAG|READONLYFLAG|NAMEONLYFLAG},
{NC_ATT_FORMAT, READONLYFLAG},
{ISNETCDF4ATT, READONLYFLAG|NAMEONLYFLAG|VIRTUALFLAG},
{NCPROPS,READONLYFLAG|NAMEONLYFLAG|HIDDENATTRFLAG},
{NC_ATT_COORDINATES, READONLYFLAG|HIDDENATTRFLAG},
{NC_ATT_DIMID_NAME, READONLYFLAG|HIDDENATTRFLAG},
{SUPERBLOCKATT, READONLYFLAG|NAMEONLYFLAG|VIRTUALFLAG},
{NC_ATT_NC3_STRICT_NAME, READONLYFLAG},
{NC_ATT_NC3_STRICT_NAME, READONLYFLAG},
{NC_NCZARR_ATTR, READONLYFLAG|HIDDENATTRFLAG},
{NC_NCZARR_GROUP, READONLYFLAG|HIDDENATTRFLAG},
{NC_NCZARR_ARRAY, READONLYFLAG|HIDDENATTRFLAG},
{NC_NCZARR_SUPERBLOCK, READONLYFLAG|HIDDENATTRFLAG},
}

Number of reserved attributes. These attributes are hidden from the netcdf user, but exist in the implementation datasets to help netcdf read the dataset. Moved here from hdf5file.c. These tables need to capture all reserved attributes across all possible dispatchers

List of reserved attributes. WARNING: This list will be sorted in (strcmp) sorted order for binary search. So order here does not matter; the table will be modified by sorting.

Definition at line 42 of file nc4internal.c.