nb.mod(7) | NodeBrain Administrator Guide
Version 0.9.02 - August 2014 |
nb.mod(7) |
NAME | SYNOPSIS | DESCRIPTION | FILES | RULES | ENVIRONMENT | DIAGNOSTICS | HISTORY | BUGS | AUTHOR | SEE ALSO
nb.mod - NodeBrain Node Modules (plug-ins) |
#include <nb/nb.h>
int skillAssert (nbCELL context , void * skillHandle , void * knowledgeHandle , nbCELL arglist ); nbCELL skillEvaluate (nbCELL context , void * skillHandle , void * knowledgeHandle , nbCELL arglist ); void * skillBind (nbCELL context ,nbCELL skill ,nbCELL arglist ,char * text ){
declare module module [ {"path"} ] [ package [ (args) ] [ ; | :text ] declare skill skill [ module. ] skill [ (args) ] [ ; | :text ] define term node [ skill [ (args) ] ] [ ; | :text ] |
NodeBrain modules
are dynamic load libraries used as plug-ins to extend the capabilities of NodeBrain,
nb(1),
using a defined application program interface (API). There is presently only one
such interface defined -
NodeBrain Node Module C API.
Within the context of NodeBrain, we refer to modules that use this interface simply as
"node modules." A node module implements one or more skills. For each skill, the
module must implement one or more skill methods (functions) within a defined set. Once
declared, a skill may be associated with any number of nodes. A node is an object
that has the defined skill, but also (often) the ability to accumulate a set of knowledge
independent of other nodes with the same skill.
You will not find enough information here to learn how to write a node module. Here we only provide enough information, hopefully, to demystify NodeBrain modules for those installing or using an existing module. A NodeBrain Library manual describing the API has been started, but needs a lot work. See http://www.nodebrain.org for more information. |
|
Here we use the Tree node module included in the NodeBrain distribution to
illustrate how a module is referenced in rules (commands). The Tree module implements a table using a
tree structure internally. In this example, we define two Tree nodes---one
for a critical device table and one for a problem device table.
|
Some of the C functions nb
calls (e.g. for loading dynamic modules) are influenced by environment variables in
ways we assume you can figure out for your environment.
|
If NodeBrain is unable to load a module an error message is displayed.
When a module is successfully loaded but the symbol referenced in a skill declaration is not found, a message is displayed.
NodeBrain does not attempt to load a module when it is declared. Instead, it waits until a module is referenced by a DEFINE command for a node to avoid loading modules unnecessarily. For this reason, either of the messages above will follow a node definition when there is an error. |
Node modules (plug-ins) were introduced in NodeBrain prototype release 0.6.0 in April, 2004. |
Although node modules were supported in prior releases on Linux, Solaris, HP-UX, OS X,
and Windows, release 0.8.15 has only been tested on Linux.
For a complete and current list of bugs, you should refer to the project web site. Please report bugs by linking to the project page from the home page, http://www.nodebrain.org, or send email to <bugs@nodebrain.org>. |
Ed Trettevik <eat@nodebrain.org> |
nodebrain(7),
nb(1),
nb.cfg(5),
nb.syn(5),
nbkit(1),
nbkit-caboodle(7)
[2] NodeBrain Guide |
NodeBrain 0.9.02 | August 2014 | nb.mod(7) |