Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 17, 2019
1 parent f004b23 commit bc125f8
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/ncint/ncintdispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ NC_Dispatch NCINT_dispatcher = {
NC_NOTNC4_get_var_chunk_cache
};

/**
* Pointer to the dispatch table used for netCDF/PIO
* integration. Files opened or created with mode flag NC_UDF0 will be
* opened using the functions in this dispatch table. */
const NC_Dispatch* NCINT_dispatch_table = NULL;

/**
Expand Down Expand Up @@ -151,6 +155,17 @@ PIO_NCINT_finalize(void)
/**
* Create a file using PIO via netCDF's nc_create().
*
* @param path The file name of the new file.
* @param cmode The creation mode flag.
* @param initialsz Ignored by this function.
* @param basepe Ignored by this function.
* @param chunksizehintp Ignored by this function.
* @param parameters pointer to struct holding extra data (e.g. for
* parallel I/O) layer. Ignored if NULL.
* @param dispatch Pointer to the dispatch table for this file.
* @param nc_file Pointer to an already-existing instance of NC.
*
* @return ::NC_NOERR No error, or error code.
* @author Ed Hartnett
*/
int
Expand Down Expand Up @@ -188,6 +203,25 @@ PIO_NCINT_create(const char *path, int cmode, size_t initialsz, int basepe,
return PIO_NOERR;
}

/**
* @internal Open a netCDF file with PIO.
*
* @param path The file name of the file.
* @param mode The open mode flag.
* @param basepe Ignored by this function.
* @param chunksizehintp Ignored by this function.
* @param parameters pointer to struct holding extra data (e.g. for
* parallel I/O) layer. Ignored if NULL. Ignored by this function.
* @param dispatch Pointer to the dispatch table for this file.
* @param nc_file Pointer to an instance of NC. The ncid has already
* been assigned, and is in nc_file->ext_ncid.
*
* @return ::NC_NOERR No error.
* @return ::NC_EINVAL Invalid input.
* @return ::NC_EHDFERR Error from HDF4 layer.
* @return ::NC_ENOMEM Out of memory.
* @author Ed Hartnett
*/
int
PIO_NCINT_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
void *parameters, const NC_Dispatch *dispatch, NC *nc_file)
Expand Down Expand Up @@ -326,6 +360,17 @@ PIO_NCINT_set_fill(int ncid, int fillmode, int *old_modep)
return PIOc_set_fill(ncid, fillmode, old_modep);
}

/**
* @internal Get the format (i.e. NC_FORMAT_UDF0) of a file opened
* with PIO.
*
* @param ncid File ID (ignored).
* @param formatp Pointer that gets the constant indicating format.
* @return ::NC_NOERR No error.
* @return ::NC_EBADID Bad ncid.
* @author Ed Hartnett
*/
int
PIO_NCINT_inq_format(int ncid, int *formatp)
{
Expand All @@ -336,6 +381,20 @@ PIO_NCINT_inq_format(int ncid, int *formatp)
return NC_NOERR;
}

/**
* @internal Return the extended format (i.e. the dispatch model),
* plus the mode associated with an open file.
*
* @param ncid File ID.
* @param formatp a pointer that gets the extended format. PIO files
* will always get NC_FORMATX_UDF0.
* @param modep a pointer that gets the open/create mode associated with
* this file. Ignored if NULL.
* @return ::NC_NOERR No error.
* @return ::NC_EBADID Bad ncid.
* @author Ed Hartnett
*/
int
PIO_NCINT_inq_format_extended(int ncid, int *formatp, int *modep)
{
Expand Down

0 comments on commit bc125f8

Please sign in to comment.