NEP 4.3.0
NetCDF Expansion Pack
Loading...
Searching...
No Matches
nxcdf_remoteref.c File Reference

nxCDF remote reference API: resolve stored (URL, object path) pairs against remote datasets. More...

#include "nxcdf/nxcdf.h"
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <netcdf.h>
#include "nxcdf_internal.h"

Functions

int nc_ref_resolve (int ncid, const char *path, int *kindp, int *objidp, char *att_name, size_t att_name_size)
 Resolve an object path on an already-open remote session.
int nc_ref_open_remote (int ncid, const char *url, const char *path, int *target_ncidp, int *kindp, int *objidp, char *att_name, size_t att_name_size)
 Open a remote reference target and resolve its object path.

Detailed Description

nxCDF remote reference API: resolve stored (URL, object path) pairs against remote datasets.

Remote references are a stored convention, not an HDF5 token: the application keeps a URL and an object path as NC_STRING data, and nc_ref_open_remote() resolves one pair by calling nc_open() on the URL — plain upstream dispatch, so DAP2, DAP4 and NCZarr file/byte-range URLs all work — then resolving the path by name with the public inquiry API. nc_ref_resolve() exposes the path mapping alone so one remote session can serve many references without paying a remote open per element. See nxCDF References.

Compiled unconditionally; when the library is built without NEP_ENABLE_REMOTE_REFS both entry points return NC_ENOTBUILT.

Author
Edward Hartnett
Date
2026-11-27

Function Documentation

◆ nc_ref_open_remote()

int nc_ref_open_remote ( int ncid,
const char * url,
const char * path,
int * target_ncidp,
int * kindp,
int * objidp,
char * att_name,
size_t att_name_size )

Open a remote reference target and resolve its object path.

Implementation of the public contract declared in nep.h: the containing file is validated as nxCDF (context only), the URL is opened with plain nc_open(NC_NOWRITE) so any remote-capable upstream dispatch answers, and the path is resolved with nc_ref_resolve(). A failed resolution closes the fresh session.

Author
Edward Hartnett, Intelligent Data Design, Inc.

◆ nc_ref_resolve()

int nc_ref_resolve ( int ncid,
const char * path,
int * kindp,
int * objidp,
char * att_name,
size_t att_name_size )

Resolve an object path on an already-open remote session.

Implementation of the public contract declared in nep.h: split the optional #attname suffix, walk the group components with nc_inq_grp_ncid(), and resolve the leaf as variable, group or committed type in that order.

Author
Edward Hartnett, Intelligent Data Design, Inc.