getccent(3C)
NAME
getccent(), getcccid(), getccnam(), setccent(), endccent(), fgetccent() − get HP Cluster configuration entry
SYNOPSIS
#include <cluster.h>
struct cct_entry *getccent(void);
struct cct_entry *getcccid(cnode_t cid);
struct cct_entry *getccnam(const char *name);
void setccent(void);
void endccent(void);
struct cct_entry *fgetccent(FILE *stream);
DESCRIPTION
getccent(), getcccid(), and getccnam() each return a pointer to an object with the following structure containing the broken-out fields in the /etc/clusterconf file. The file contains a list of cct_entry structures, defined in the <cluster.h> header file. The cct_entry structure includes the following fields:
u_char machine_id[M_IDLEN]; /* Unique machine ID */
cnode_t cnode_id; /* cnode ID */
char cnode_name[15]; /* cnode name */
char cnode_type; /* ’r’=cluster server
’c’=all other cluster nodes */
cnode_t swap_serving_cnode; /* swap cnode */
int kcsp; /* default number of CSPs
to create see csp(1M) */
The constant M_IDLEN is defined in <cluster.h>.
getccent() When first called, getccent() opens the cluster configuration file /etc/clusterconf and returns a pointer to the first cct_entry structure in the file. Thereafter, it returns a pointer to the next cct_entry structure in the file. Successive calls can be used to search the entire file.
getcccid() Searches from the beginning of the file until an entry whose cnode ID matches cid is found, and returns a pointer to the particular structure in which it was found.
getccnam() Searches from the beginning of the file until a cnode name matching name is found and returns a pointer to the particular structure in which it was found. If an EOF or an error is encountered on reading, these functions return a NULL pointer.
setccent() Has the effect of rewinding the cluster configuration file to the beginning of the file to allow repeated searches.
endccent() Can be called to close the cluster configuration file when processing is complete.
fgetccent() Returns a pointer to the next cct_entry structure in the stream stream, which matches the format of /etc/clusterconf.
RETURN VALUE
A NULL pointer is returned on EOF or error.
WARNINGS
The above routines use <stdio.h>, which causes them to increase the size of programs not otherwise using standard I/O, more than might be expected.
All information is contained in a static area that is overwritten with each call; thus information must be copied if it is to be saved.
AUTHOR
getccent() was developed by HP.
FILES
/etc/clusterconf
SEE ALSO
Hewlett-Packard Company — HP-UX Release 9.0: August 1992