fixing windows build problem, plus documentation

This commit is contained in:
Ed Hartnett 2018-05-30 03:29:19 -06:00
parent aa4032a4f1
commit dbacd00c9c
2 changed files with 39 additions and 35 deletions

View File

@ -267,9 +267,6 @@ NC4_inq_unlimdims(int, int *, int *);
EXTERNL int
NC4_show_metadata(int);
EXTERNL int
NC4_initialize(void);
#if defined(__cplusplus)
}
#endif

View File

@ -68,40 +68,9 @@ static char HDF5_SIGNATURE[MAGIC_NUMBER_LEN] = "\211HDF\r\n\032\n";
/* User-defined formats. */
NC_Dispatch* UF0_dispatch_table = NULL;
NC_Dispatch* UF1_dispatch_table = NULL;
/**
* Add handling of user-defined format.
*
* @param mode_flag NC_UF0 or NC_UF1
* @param dispatch_table Pointer to dispatch table to use for this user format.
* @param magic_numer Magic number used to identify file. Ignored if NULL.
*
* @return ::NC_NOERR No error.
* @return ::NC_EINVAL Invalid input.
* @author Ed Hartnett
*/
int
nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number)
{
if (mode_flag != NC_UF0 && mode_flag != NC_UF1)
return NC_EINVAL;
if (!dispatch_table)
return NC_EINVAL;
switch(mode_flag)
{
case NC_UF0:
UF0_dispatch_table = dispatch_table;
break;
case NC_UF1:
UF1_dispatch_table = dispatch_table;
break;
}
return NC_NOERR;
}
#endif /* USE_NETCDF4 */
/** \defgroup datasets NetCDF File and Data I/O
NetCDF opens datasets as files or remote access URLs.
@ -138,6 +107,44 @@ interfaces, the rest of this chapter presents a detailed description
of the interfaces for these operations.
*/
#ifdef USE_NETCDF4
/**
* Add handling of user-defined format.
*
* @param mode_flag NC_UF0 or NC_UF1
* @param dispatch_table Pointer to dispatch table to use for this user format.
* @param magic_number Magic number used to identify file. Ignored if
* NULL.
*
* @return ::NC_NOERR No error.
* @return ::NC_EINVAL Invalid input.
* @author Ed Hartnett
* @ingroup datasets
*/
int
nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number)
{
/* Check inputs. */
if (mode_flag != NC_UF0 && mode_flag != NC_UF1)
return NC_EINVAL;
if (!dispatch_table)
return NC_EINVAL;
/* Retain a pointer to the dispatch_table. */
switch(mode_flag)
{
case NC_UF0:
UF0_dispatch_table = dispatch_table;
break;
case NC_UF1:
UF1_dispatch_table = dispatch_table;
break;
}
return NC_NOERR;
}
#endif /* USE_NETCDF4 */
/*!
Interpret the magic number found in the header of a netCDF file.
This function interprets the magic number/string contained in the header of a netCDF file and sets the appropriate NC_FORMATX flags.