NEP 4.0.0
NetCDF Expansion Pack
Loading...
Searching...
No Matches
Functions
nxt4file.c File Reference

File state, markers, synchronization, and cleanup for NEXTCDF-4. More...

#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "nxt4internal.h"

Functions

int NEXTCDF4_hdf_error (void)
 
static void close_group_hdf (NC_GRP_INFO_T *grp)
 
int NEXTCDF4_free_file (NEXTCDF4_FILE_INFO_T *file)
 
int NEXTCDF4_add_file (int ncid, const char *path, int mode, NEXTCDF4_FILE_INFO_T **filep)
 
int NEXTCDF4_get_file (int ncid, NC_FILE_INFO_T **h5p, NEXTCDF4_FILE_INFO_T **filep)
 
static int write_string_att (hid_t location, const char *name, const char *value)
 
int NEXTCDF4_write_markers (NEXTCDF4_FILE_INFO_T *file)
 
int NEXTCDF4_read_markers (NEXTCDF4_FILE_INFO_T *file)
 
int NEXTCDF4_sync (int ncid)
 
int NEXTCDF4_close (int ncid, void *parameters)
 
int NEXTCDF4_abort (int ncid)
 
int NEXTCDF4_inq_format (int ncid, int *formatp)
 
int NEXTCDF4_inq_format_extended (int ncid, int *formatp, int *modep)
 
int NEXTCDF4__enddef (int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align)
 
int NEXTCDF4_redef (int ncid)
 

Detailed Description

File state, markers, synchronization, and cleanup for NEXTCDF-4.

Author
Edward Hartnett
Date
2026-08-28

Function Documentation

◆ close_group_hdf()

static void close_group_hdf ( NC_GRP_INFO_T *  grp)
static

◆ NEXTCDF4__enddef()

int NEXTCDF4__enddef ( int  ncid,
size_t  h_minfree,
size_t  v_align,
size_t  v_minfree,
size_t  r_align 
)

Materialize pending root-group metadata to HDF5 and exit define mode.

Parameters
ncidNetCDF file identifier.
h_minfreeIgnored (reserved for future alignment control).
v_alignIgnored (reserved for future alignment control).
v_minfreeIgnored (reserved for future alignment control).
r_alignIgnored (reserved for future alignment control).
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_abort()

int NEXTCDF4_abort ( int  ncid)

Abort a NEXTCDF-4 file operation and release its resources.

Parameters
ncidNetCDF file identifier.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_add_file()

int NEXTCDF4_add_file ( int  ncid,
const char *  path,
int  mode,
NEXTCDF4_FILE_INFO_T **  filep 
)

Allocate and register per-file NEXTCDF-4 state.

Parameters
ncidNetCDF file identifier.
pathFile-system path.
modeEffective NetCDF mode.
filepDestination for the allocated state.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_close()

int NEXTCDF4_close ( int  ncid,
void *  parameters 
)

Close a NEXTCDF-4 file and release its resources.

Parameters
ncidNetCDF file identifier.
parametersOptional close parameters; currently ignored.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_free_file()

int NEXTCDF4_free_file ( NEXTCDF4_FILE_INFO_T file)

Close HDF5 identifiers and free per-file state.

Parameters
fileState to release; may be NULL.
Returns
NC_NOERR or NC_EHDFERR if an HDF5 close fails.

◆ NEXTCDF4_get_file()

int NEXTCDF4_get_file ( int  ncid,
NC_FILE_INFO_T **  h5p,
NEXTCDF4_FILE_INFO_T **  filep 
)

Resolve registered NEXTCDF-4 state from a NetCDF identifier.

Parameters
ncidNetCDF file identifier.
h5pOptional destination for common NetCDF-4 state.
filepOptional destination for NEXTCDF-4 state.
Returns
NC_NOERR on success, or NC_EBADID for invalid state.

◆ NEXTCDF4_hdf_error()

int NEXTCDF4_hdf_error ( void  )

Return the NetCDF error used for an HDF5-layer failure.

Returns
NC_EHDFERR.

◆ NEXTCDF4_inq_format()

int NEXTCDF4_inq_format ( int  ncid,
int *  formatp 
)

Inquire the public NetCDF format class.

Parameters
ncidNetCDF file identifier.
formatpOptional destination for NC_FORMAT_NETCDF4.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_inq_format_extended()

int NEXTCDF4_inq_format_extended ( int  ncid,
int *  formatp,
int *  modep 
)

Inquire the extended NEXTCDF-4 format and effective mode.

Parameters
ncidNetCDF file identifier.
formatpOptional destination for NC_FORMATX_NEXTCDF4.
modepOptional destination for the effective open/create mode.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_read_markers()

int NEXTCDF4_read_markers ( NEXTCDF4_FILE_INFO_T file)

Read and validate NEXTCDF-4 provenance and compatibility markers.

Parameters
fileOpen NEXTCDF-4 state.
Returns
NC_NOERR on success, or NC_EFILEMETA for invalid markers.

◆ NEXTCDF4_redef()

int NEXTCDF4_redef ( int  ncid)

Return the file to define mode.

Parameters
ncidNetCDF file identifier.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_sync()

int NEXTCDF4_sync ( int  ncid)

Flush a writable NEXTCDF-4 file to storage.

Parameters
ncidNetCDF file identifier.
Returns
NC_NOERR on success, or a NetCDF error code.

◆ NEXTCDF4_write_markers()

int NEXTCDF4_write_markers ( NEXTCDF4_FILE_INFO_T file)

Write NEXTCDF-4 provenance and compatibility markers.

Parameters
fileOpen writable NEXTCDF-4 state.
Returns
NC_NOERR on success, or NC_EHDFERR.

◆ write_string_att()

static int write_string_att ( hid_t  location,
const char *  name,
const char *  value 
)
static