NAME

catinfo_get - retreive information from the catinfo tree

SYNOPSIS

#include <cat/cat.h>

int catinfo_get(cat_session *sess, const char *name, char **result);

DESCRIPTION

The catinfo_get() function reads configuration data from the info tree. If name is absolute (starts with ``.''), only one entry can be retrieved from the tree. If the name is relative, the different entries in the session search path are tried in sequence until a match is found or the search path is exhausted. For relative names to work, a search path must have been established with catinfo_setpath().

The data is read, on demand, from permanent storage. This means that if an entry for the service ``oracle-1'' is not present in the tree, but there is a configuration file or registry key, data can be read in from permanent storage, but only the data for this specific service. Calls to catinfo_loadfrom() must have been made to enable the loading of data from files or the registry.

Memory is allocated for the result. If no value is found, the result is set to NULL. Allocated memory must be freed by the caller.

A successful call to catinfo_init() must have been made prior to any call to this function.

catinfo_get() returns 0 if successful or a negative code on error. Specifically, the function returns CAT_ENODE if name refers to a node, or CAT_ENOTFOUND if name does not exist in the tree.

SEE ALSO

cat, catinfo

catinfo_set