NetCDF 4.8.0
Loading...
Searching...
No Matches
nc4internal.c File Reference
#include "config.h"
#include "netcdf.h"
#include "netcdf_filter.h"
#include "nc4internal.h"
#include "nc.h"
#include "ncdispatch.h"
#include "ncutf8.h"
#include "netcdf_aux.h"

Go to the source code of this file.

Macros

#define NRESERVED   11 /*|NC_reservedatt|*/
 

Functions

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_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)
 
static void obj_track (NC_FILE_INFO_T *file, NC_OBJ *obj)
 
static int var_free (NC_VAR_INFO_T *var)
 

Variables

size_t nc4_chunk_cache_nelems = CHUNK_CACHE_NELEMS
 Default chunk cache number of elements.
 
float nc4_chunk_cache_preemption = CHUNK_CACHE_PREEMPTION
 Default chunk cache preemption.
 
size_t nc4_chunk_cache_size = CHUNK_CACHE_SIZE
 Default chunk cache size.
 
static const NC_reservedatt NC_reserved [NRESERVED]
 

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   11 /*|NC_reservedatt|*/

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

Definition at line 35 of file nc4internal.c.

Function Documentation

◆ 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 1388 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.
Returns
NC_NOERR No error.
Author
Ed Hartnett

Definition at line 1166 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 1257 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 840 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 1495 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 945 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 80 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 781 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 1411 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 1126 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 1069 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_ncidThe 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 173 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 137 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 1516 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 216 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 435 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 554 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 328 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 392 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 307 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 611 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 348 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 518 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 463 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 883 of file nc4internal.c.

◆ NC4_move_in_NCList()

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

Definition at line 1850 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 255 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 1543 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 1580 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 482 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 1433 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 1803 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 1188 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 1026 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 983 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.
varPointer to pointer that gets variable info struct.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 754 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.
varPointer to pointer that gets variable info struct.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 667 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 1365 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.
varPointer to pointer that gets variable info struct.
Returns
NC_NOERR No error.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 716 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 1830 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 637 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 1309 of file nc4internal.c.

Variable Documentation

◆ nc4_chunk_cache_nelems

size_t nc4_chunk_cache_nelems = CHUNK_CACHE_NELEMS

Default chunk cache number of elements.

Definition at line 55 of file nc4internal.c.

◆ nc4_chunk_cache_preemption

float nc4_chunk_cache_preemption = CHUNK_CACHE_PREEMPTION

Default chunk cache preemption.

Definition at line 56 of file nc4internal.c.

◆ nc4_chunk_cache_size

size_t nc4_chunk_cache_size = CHUNK_CACHE_SIZE

Default chunk cache size.

Definition at line 54 of file nc4internal.c.

◆ NC_reserved

const NC_reservedatt NC_reserved[NRESERVED]
static
Initial value:
= {
{NC_ATT_CLASS, READONLYFLAG|DIMSCALEFLAG},
{NC_ATT_DIMENSION_LIST, READONLYFLAG|DIMSCALEFLAG},
{NC_ATT_NAME, READONLYFLAG|DIMSCALEFLAG},
{NC_ATT_REFERENCE_LIST, READONLYFLAG|DIMSCALEFLAG},
{NC_ATT_FORMAT, READONLYFLAG},
{ISNETCDF4ATT, READONLYFLAG|NAMEONLYFLAG},
{NCPROPS, READONLYFLAG|NAMEONLYFLAG|MATERIALIZEDFLAG},
{NC_ATT_COORDINATES, READONLYFLAG|DIMSCALEFLAG|MATERIALIZEDFLAG},
{NC_ATT_DIMID_NAME, READONLYFLAG|DIMSCALEFLAG|MATERIALIZEDFLAG},
{SUPERBLOCKATT, READONLYFLAG|NAMEONLYFLAG},
{NC_ATT_NC3_STRICT_NAME, READONLYFLAG|MATERIALIZEDFLAG},
}

List of reserved attributes. This list must be in sorted order for binary search.

Definition at line 39 of file nc4internal.c.