SYNOPSIS

#include <atfs.h>

#include <atfstk.h>

int atBindAddRule (char *ruleName, char *ruleBody, char *srcFile, int srcLine);

int atBindDelRule (char *ruleName);

int atBindRuleFile (char *fileName);

int atBindDisplayErrors;

int atBindTestRule (char *ruleName);

int atBindShowRules (void);

char** atBindListRules (void);

DESCRIPTION

The atBind module maintains an internal database storing all known version bind rules.

The atBindAddRule function stores a new rule in the internal database. It expects the rule name, optionally including parameter definitions, and the rule body as string arguments. Additionally, the filename (srcFile) of the file, where the rule is read from, and the line within that file (srcLine), may be given. This is used for producing proper error messages. atBindAddRule returns -1 on error, 0 otherwise.

atBindDelRule removes a previously defined rule from the internal database. It returns a negative return value (-1), when no rule with the given name was not found in the internal database.

The atBindRuleFile function scans a file containing version bind rules and adds all contained rules to the internal database. It returns the number of version bind rules successfully added to the internal database. A zero return value may also indicate an error.

The switch atBindDisplayErrors may be set TRUE to enable error reporting during parsing of version binding rules. Error messages will be written directly to standard error. Initially, atBindDisplayErrors is set FALSE.

AtBindTestRule reports whether ruleName is defined as version binding rule or not. It returns a non zero (TRUE) value when the name is defined, otherwise FALSE.

atBindShowRules dumps the internal database to the standard output. Return value is always TRUE.

atBindListRules returns all known bind rule names in a list. The list memory is allocated by use of malloc(3). On error, atBindListRules returns a null pointer.

DIAGNOSTICS

Upon error, each routine returns a null value, the variable atBindError is set true (non-zero), and an explaining message is copied to the atBindErrorMsg string buffer. The atBindError variable is cleared upon successful calls, the message buffer remains unchanged.

ENVIRONMENT

SHAPETOOLS - list of path names as search space for files containing version bind rules. The bind rule files must be named BindRules. Default path is /usr/local/lib/shape.

FILES

$SHAPETOOLS/BindRules

RELATED TO atBindTestRule…