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)

Link Management Routines

Functions Modes
ier = cgio_is_link(int cgio_num, double id, int *link_len); r w m
ier = cgio_link_size(int cgio_num, double id, int *file_len, int *name_len); r w m
ier = cgio_create_link(int cgio_num, double pid, const char *name,
      const char *filename, const char *name_in_file, double *id);
- w m
ier = cgio_get_link(int cgio_num, double id, char *filename, char *name_in_file); r w m
call cgio_is_link_f(cgio_num, id, link_len, ier) r w m
call cgio_link_size_f(cgio_num, id, file_len, name_len, ier) r w m
call cgio_create_link_f(cgio_num, pid, name, filename, name_in_file, id, ier) - w m
call cgio_get_link_f(cgio_num, id, filename, name_in_file, ier) r w m

Input/Output

    cgio_num   Indentifier for the open database file.
id Node identifier.
pid Parent node identifier.
link_len Total length of the link information (file_len + name_len).
file_len Length of the name of the linked-to file. This will be 0 if this is an internal link.
name_len Length of the pathname of the linked-to node.
name Name of the link node.
filename Name of the linked-to file. If creating an internal link, then this should be NULL or an empty string. When reading an internal link, this will be returned as an empty string.
name_in_file Pathname of the linked-to node.
ier Error status.

Function Descriptions

cgio_is_link
Determines if the node indentified by id in the database given by cgio_num is a link or not. The function returns 0 if successfull, else an error code. If this node is a link, then the total length of the linked-to file and node information in returned in link_len. If the node is not a link, link_len will be 0.
 
cgio_link_size
Gets the size of the linked-to file name in file_len and the node pathname length in name_len for the node identified by id in the database given by cgio_num. The function returns 0 for success, else an error code. If this is an internal link (link to a node in the same database), then file_len will be returned as 0.
 
cgio_create_link
Creates a link node as a child of the parent node identified by pid in the database given by cgio_num. The name of the node is given by name, the name of the linked-to file by filename, and the pathname to the linked-to node by name_in_file. If this is an internal link (link to a node in the same database), then filename should be defined as NULL or an empty string. The function returns 0 and the indentifier of the new node in id on success, otherwise an error code is returned.
 
cgio_get_link
Gets the link information for the node identified by id in the database given by cgio_num. If successfull, the function returns 0 and the linked-to file name in filename and the node pathname in name_in_file. These strings are '0'-terminated, and thus should be dimensioned at least (file_len + 1) and (name_len + 1), respectively If this is an internal link (link to a node in the same database), then filename will be an empty string. The maximum length for a file name is given by CGIO_MAX_FILE_LENGTH (1024) and for a link pathname by CGIO_MAX_LINK_LENGTH (4096).