NAME

catinfo_loadfrom - connect configuration data to the catinfo structure

SYNOPSIS

#include <cat/cat.h>

int catinfo_loadfrom(const char *node, const char *path, int type);

DESCRIPTION

catinfo_loadfrom() informs the catinfo interface of the location of configuration data in files and directories on UNIX or files and the the Registry on Windows NT.

node is an absolute infopath.

path is a complete file or directory name in UNIX. In Windows NT, path is the full registry name of a subkey.

type is platform-dependent and can be either CATINFO_FILE or CATINFO_DIR on UNIX and CATINFO_FILE or CATINFO_REGISTRY on Windows NT. This determines how configuration data will be retrieved from files or the registry.

If type is CATINFO_FILE, node is added to the tree and the values under node will be read from the exact file specified in path. This type should be used if a single file or subkey is common to all sessions using the catinfo interface. This might be the global configuration data for the CAT.

If type is CATINFO_DIR, node is added and all configuration files in directory path are listed and added under node in the tree. The ".cfg" suffix is stripped from configuration file names, which are also converted using catinfo_name() before being added to the tree (under node).

If type is CATINFO_REG, everything under node is registered to be read from the registry subtree, starting at path.

Values are not read in from files or registry on a call to this function.

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

catinfo_loadfrom() returns 0 if successful or a negative code on error.

SEE ALSO

cat, catinfo