nb.lib(3) NodeBrain Administrator Guide
Version 0.9.03 - December 2014
nb.lib(3)

NAME | SYNOPSIS | DESCRIPTION | EXAMPLE | FILES | ENVIRONMENT | BUGS | AUTHOR | DOCUMENTATION | SEE ALSO


NAME

  nb.lib - NodeBrain Library

SYNOPSIS

  #include <nb/nb.h>

gcc main_pgm.c -lnb

DESCRIPTION

  The NodeBrain library, libnb.so, makes the NodeBrain C API available to programs and modules that plug-in to the NodeBrain Rule Engine.

EXAMPLE

  If you want to experiment with embedding the NodeBrain interpreter in your own program, you can use nb.c and various modules in the source distribution as sample code. Here's a trivial example.

  #include <nb/nb.h>
  int main(int argc,char *argv[]){
    nbCELL context;

    printf("hello\n");

    // Start the NodeBrain interpreter
    context=nbStart(argc,argv);

    // Issue some commands 
    nbCmd(context,"assert a==x+y;",NB_CMDOPT_ECHO);
    nbCmd(context,"define r1 on(a>4):show -cells",NB_CMDOPT_ECHO);
    nbCmd(context,"assert x=2,y=3;",NB_CMDOPT_ECHO);

    // Stop the interpreter
    nbStop(context);
    }

The NodeBrain Library manual describing the C API functions.

FILES

 

nb.h    Header file for NodeBrain C API.
libnb.so    NodeBrain C API library - dynamic.
libnb.a    NodeBrain C API library - static.

ENVIRONMENT

 

NB_MODULE_PATH    See nb.mod(3).

BUGS

  See nb(1). Please report bugs to <bugs@nodebrain.org> or enter a bug report at http://nodebrain.org.

AUTHOR

  Ed Trettevik <eat@nodebrain.org>

DOCUMENTATION

  Online documentation is available at http://nodebrain.org. Manuals are also available in Texinfo format in the git repository. These documents are included in source distribution files.

SEE ALSO

  nodebrain(7), nb(1), nb.cfg(5), nb.syn(5), nb.mod(7) nbkit(1), nbkit.caboodle(7)

NodeBrain 0.9.03December 2014nb.lib(3)