Skip navigation links
(CGNS Documentation Home Page) (Steering Committee Charter) (Overview and Entry-Level Document) (A User's Guide to CGNS) (Mid-Level Library) (Standard Interface Data Structures) (SIDS File Mapping Manual) (CGIO User's Guide) (Parallel CGNS User's Guide) (ADF Implementation) (HDF5 Implementation) (Python Implementation) (CGNS Tools and Utilities)

(The CGIO Software Library) (Database-Level Routines) (Data Structure Management Routines) (Link Management Routines) (Node Management Routines) (Data I/O Routines) (Error Messages and Routines) (Miscellaneous Routines) (Example Programs)

Database-Level Routines

Functions Modes
ier = cgio_is_supported(int file_type); - - -
ier = cgio_check_file(const char *filename, int *file_type); - - -
ier = cgio_open_file(const char *filename, int file_mode, int file_type,
      int *cgio_num);
r w m
ier = cgio_close_file(int cgio_num); r w m
ier = cgio_get_file_type(int cgio_num, int *file_type); r w m
ier = cgio_get_root_id(int cgio_num, double *rootid); r w m
call cgio_is_supported_f(file_type, ier) - - -
call cgio_check_file_f(filename, file_type, ier) - - -
call cgio_open_file_f(filename, file_mode, file_type, cgio_num, ier) r w m
call cgio_close_file_f(cgio_num, ier) r w m
call cgio_get_file_type_f(cgio_num, file_type, ier) r w m
call cgio_get_root_id_f(cgio_num, rootid, ier) r w m


    file_type   Type of database file. acceptable values are CGIO_FILE_NONE, CGIO_FILE_ADF, CGIO_FILE_HDF5 and.CGIO_FILE_ADF2.
filename Name of the database file, including path name if necessary. There is no limit on the length of this character variable.
file_mode Mode used for opening the file. The supported modes are. CGIO_MODE_READ, CGIO_MODE_WRITE, and CGIO_MODE_MODIFY.
cgio_num Indentifier for the open database file.
rootid Node identifier for the root node of the database.
ier Error status.

Function Descriptions

Determines if the database type given by file_type is supported by the library. Retuns 0 if supported, else CGIO_ERR_FILE_TYPE if not. CGIO_FILE_ADF is always supported; CGIO_FILE_HDF5 is supported if the library was built with HDF5; and CGIO_FILE_ADF2 is supported when built in 32-bit mode.
Checks the file filename to determine if it is a valid database. If so, returns 0 and the type of database in file_type, otherwise returns an error code and file_type will be set to CGIO_FILE_NONE.
Opens a database file of the specified type and mode. If successfull, returns 0, and the database identifier in cgio_num, otherwise returns an error code. The database identifier is used to access the database in subsequent function calls.

The mode in which the database is opened is given by file_mode, which may take the value CGIO_MODE_READ, CGIO_MODE_WRITE, or CGIO_MODE_MODIFY. New databases should be opened with CGIO_MODE_WRITE, while existing databases are opened with either CGIO_MODE_READ (for read-only access) or CGIO_MODE_MODIFY (for read/write access).

A specific database type may be specified by file_type, which may be one of CGIO_FILE_NONE, CGIO_FILE_ADF, CGIO_FILE_HDF5, or CGIO_FILE_ADF2. When opening a database in write mode, CGIO_FILE_NONE indicates that the default database type should be used, otherwise the specified database type will be opened. When opening in read or modify mode, CGIO_FILE_NONE indicates that any database type is acceptable, otherwise if the database type does not match that given by file_type an error will be retuned.
Closes the database given by cgio_num. Returns 0 for success, else an error code.
Gets the type of the database given by cgio_num. Returns 0 and the type in file_type if successfull, else an error code.
Gets the unique node identifier for the root node in the database given by cgio_num. Returns 0 and the identifier in rootid if successfull, else an error code.