NetCDF 4.9.3
Loading...
Searching...
No Matches
nc4grp.c File Reference
#include "nc4internal.h"
#include "nc4dispatch.h"

Go to the source code of this file.

Functions

int int_cmp (const void *a, const void *b)
 
int NC4_inq_dimids (int ncid, int *ndims, int *dimids, int include_parents)
 
int NC4_inq_grp_full_ncid (int ncid, const char *full_name, int *grp_ncid)
 
int NC4_inq_grp_parent (int ncid, int *parent_ncid)
 
int NC4_inq_grpname (int ncid, char *name)
 
int NC4_inq_grpname_full (int ncid, size_t *lenp, char *full_name)
 
int NC4_inq_grps (int ncid, int *numgrps, int *ncids)
 
int NC4_inq_ncid (int ncid, const char *name, int *grp_ncid)
 
int NC4_inq_varids (int ncid, int *nvars, int *varids)
 

Detailed Description

This file is part of netcdf-4, a netCDF-like interface for HDF5, or a HDF5 backend for netCDF, depending on your point of view.

This file handles groups.

Author
Ed Hartnett

Definition in file nc4grp.c.

Function Documentation

◆ int_cmp()

int int_cmp ( const void * a,
const void * b )

This is the comparison function used for sorting dim ids. Integer comparison: returns negative if b > a and positive if a > b.

Parameters
aA pointer to an item to compare to b.
bA pointer to an item to compare to a.
Returns
a - b
Author
Ed Hartnett

Definition at line 389 of file nc4grp.c.

◆ NC4_inq_dimids()

int NC4_inq_dimids ( int ncid,
int * ndims,
int * dimids,
int include_parents )

Find all dimids for a location. This finds all dimensions in a group, with or without any of its parents, depending on last parameter.

Parameters
ncidFile and group ID.
ndimsPointer that gets number of dimensions available in group.
dimidsPointer that gets dim IDs.
include_parentsIf non-zero, include dimensions from parent groups.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett

Definition at line 412 of file nc4grp.c.

◆ NC4_inq_grp_full_ncid()

int NC4_inq_grp_full_ncid ( int ncid,
const char * full_name,
int * grp_ncid )

Given a full name and ncid, find group ncid.

Parameters
ncidFile and group ID.
full_nameFull name of group.
grp_ncidPointer that gets ncid of group.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
NC_ENOGRP Group not found.
NC_ENOMEM Out of memory.
NC_EINVAL Name is required.
Author
Ed Hartnett

Definition at line 275 of file nc4grp.c.

◆ NC4_inq_grp_parent()

int NC4_inq_grp_parent ( int ncid,
int * parent_ncid )

Find the parent ncid of a group. For the root group, return NC_ENOGRP error. Now I know what kind of tinfoil hat wearing nut job would call this function with a NULL pointer for parent_ncid - Russ Rew!!

Parameters
ncidFile and group ID.
parent_ncidPointer that gets the ncid of parent group.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
NC_ENOGRP Root has no parent.
Author
Ed Hartnett

Definition at line 235 of file nc4grp.c.

◆ NC4_inq_grpname()

int NC4_inq_grpname ( int ncid,
char * name )

Given locid, find name of group. (Root group is named "/".)

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

Definition at line 132 of file nc4grp.c.

◆ NC4_inq_grpname_full()

int NC4_inq_grpname_full ( int ncid,
size_t * lenp,
char * full_name )

Find the full path name to the group represented by ncid. Either pointer argument may be NULL; pass a NULL for the third parameter to get the length of the full path name. The length will not include room for a null pointer.

Parameters
ncidFile and group ID.
lenpPointer that gets length of full name.
full_namePointer that gets name.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
NC_ENOMEM Out of memory.
Author
Ed Hartnett

Definition at line 168 of file nc4grp.c.

◆ NC4_inq_grps()

int NC4_inq_grps ( int ncid,
int * numgrps,
int * ncids )

Given a location id, return the number of groups it contains, and an array of their locids.

Parameters
ncidFile and group ID.
numgrpsPointer that gets number of groups. Ignored if NULL.
ncidsPointer that gets array of ncids. Ignored if NULL.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett

Definition at line 84 of file nc4grp.c.

◆ NC4_inq_ncid()

int NC4_inq_ncid ( int ncid,
const char * name,
int * grp_ncid )

Given an ncid and group name (NULL gets root group), return the ncid of that group.

Parameters
ncidFile and group ID.
namePointer that gets name.
grp_ncidPointer that gets group ncid.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
NC_ENOTNC4 Not a netCDF-4 file.
NC_ENOGRP Group not found.
Author
Ed Hartnett

Definition at line 32 of file nc4grp.c.

◆ NC4_inq_varids()

int NC4_inq_varids ( int ncid,
int * nvars,
int * varids )

Get a list of ids for all the variables in a group.

Parameters
ncidFile and group ID.
nvarsPointer that gets number of vars in group.
varidsPointer that gets array of var IDs.
Returns
NC_NOERR No error.
NC_EBADID Bad ncid.
Author
Ed Hartnett

Definition at line 344 of file nc4grp.c.