Skip to content

Commit

Permalink
C file operations
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed May 22, 2019
1 parent df2524b commit 31ec493
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
28 changes: 14 additions & 14 deletions doc/source/c_api.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/*! \page api PIO C Interface
/*! \page c_api PIO C Interface
This is a list of all user interface routines:

\section api_fileops PIO file Operations
- \ref PIO_openfile
- \ref PIO_createfile
- \ref PIO_syncfile
- \ref PIO_closefile
\section api_system PIO startup and shutdown routines
\section api_fileops_c PIO file Operations
- \ref PIO_open_file_c
- \ref PIO_create_file_c
- \ref PIO_sync_file_c
- \ref PIO_close_file_c
\section api_system_c PIO startup and shutdown routines
- \ref PIO_init
- \ref PIO_finalize
\section api_decomp PIO decomposition routines
\section api_decomp_c PIO decomposition routines
- \ref PIO_initdecomp
- \ref PIO_freedecomp
\section readwrite Reading and Writing distributed variables
\section readwrite_c Reading and Writing distributed variables
- \ref PIO_read_darray
- \ref PIO_write_darray
\section utility Utility routines
\section utility_c Utility routines
- \ref PIO_set_hint_grp
- \ref PIO_setframe
- \ref PIO_advanceframe
Expand All @@ -24,19 +24,19 @@
- \ref PIO_get_local_array_size
- \ref PIO_getnumiotasks
- \ref PIO_set_blocksize
\section netcdf NetCDF format specific routines
\section netcdf_c NetCDF format specific routines
Also see: http://www.unidata.ucar.edu/software/netcdf/docs/
\subsection putget Reading/Writing netcdf metadata
\subsection putget_c Reading/Writing netcdf metadata
- \ref PIO_get_att
- \ref PIO_put_att
- \ref PIO_get_var
- \ref PIO_put_var
\subsection utilnc Netcdf utility routines
\subsection utilnc_c Netcdf utility routines
- \ref PIO_enddef
- \ref PIO_redef
- \ref PIO_def_dim
- \ref PIO_def_var
\subsection inqnc NetCDF file inquiry routines
\subsection inqnc_c NetCDF file inquiry routines
- \ref PIO_inquire
- \ref PIO_inq_attname
- \ref PIO_inq_att
Expand Down
20 changes: 15 additions & 5 deletions src/clib/pio_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
#include <pio.h>
#include <pio_internal.h>
#include <uthash.h>

/**
* @defgroup PIO_open_file_c Open a File
* @defgroup PIO_create_file_c Create a File
* @defgroup PIO_sync_file_c Sync a File
* @defgroup PIO_close_file_c Close a File
*/

/* This is the next ncid that will be used when a file is opened or
created. We start at 16 so that it will be easy for us to notice
that it's not netcdf (starts at 4), pnetcdf (starts at 0) or
Expand All @@ -27,7 +35,7 @@ int pio_next_ncid = 16;
* @param filename : The filename to open
* @param mode : The netcdf mode for the open operation
* @return 0 for success, error code otherwise.
* @ingroup PIO_openfile
* @ingroup PIO_open_file_c
* @author Jim Edwards, Ed Hartnett
*/
int PIOc_openfile(int iosysid, int *ncidp, int *iotype, const char *filename,
Expand All @@ -54,7 +62,7 @@ int PIOc_openfile(int iosysid, int *ncidp, int *iotype, const char *filename,
* @param filename : The filename to open
* @param mode : The netcdf mode for the open operation
* @return 0 for success, error code otherwise.
* @ingroup PIO_openfile
* @ingroup PIO_open_file_c
* @author Ed Hartnett
*/
int PIOc_openfile2(int iosysid, int *ncidp, int *iotype, const char *filename,
Expand All @@ -75,7 +83,7 @@ int PIOc_openfile2(int iosysid, int *ncidp, int *iotype, const char *filename,
* @param mode The netcdf mode for the open operation
* @param ncidp pointer to int where ncid will go
* @return 0 for success, error code otherwise.
* @ingroup PIO_openfile
* @ingroup PIO_open_file_c
* @author Ed Hartnett
*/
int PIOc_open(int iosysid, const char *path, int mode, int *ncidp)
Expand Down Expand Up @@ -120,7 +128,7 @@ int PIOc_open(int iosysid, const char *path, int mode, int *ncidp)
* @param filename The filename to create.
* @param mode The netcdf mode for the create operation.
* @returns 0 for success, error code otherwise.
* @ingroup PIO_createfile
* @ingroup PIO_create_file_c
* @author Jim Edwards, Ed Hartnett
*/
int PIOc_createfile(int iosysid, int *ncidp, int *iotype, const char *filename,
Expand Down Expand Up @@ -164,7 +172,7 @@ int PIOc_createfile(int iosysid, int *ncidp, int *iotype, const char *filename,
* @param filename : The filename to open
* @param ncidp : A pio file descriptor (output)
* @return 0 for success, error code otherwise.
* @ingroup PIO_create
* @ingroup PIO_create_file_c
* @author Ed Hartnett
*/
int PIOc_create(int iosysid, const char *filename, int cmode, int *ncidp)
Expand Down Expand Up @@ -195,6 +203,7 @@ int PIOc_create(int iosysid, const char *filename, int cmode, int *ncidp)
*
* @param ncid: the file pointer
* @returns PIO_NOERR for success, error code otherwise.
* @ingroup PIO_close_file_c
* @author Jim Edwards, Ed Hartnett
*/
int PIOc_closefile(int ncid)
Expand Down Expand Up @@ -362,6 +371,7 @@ int PIOc_deletefile(int iosysid, const char *filename)
*
* @param ncid the ncid of the file to sync.
* @returns PIO_NOERR for success, error code otherwise.
* @ingroup PIO_sync_file_c
* @author Jim Edwards, Ed Hartnett
*/
int PIOc_sync(int ncid)
Expand Down

0 comments on commit 31ec493

Please sign in to comment.