nb.lib(3) NodeBrain Administrator Guide
Version 0.7.4 - February 2009
nb.lib(3)

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


NAME

  nb.lib - NodeBrain Library

SYNOPSIS

  #include <nb/nb.h>

gcc main_pgm.c -lnb [ -lm -ldl ]

DESCRIPTION

  The NodeBrain library, libnb.so, makes the NodeBrain C API available to main routines. This is the same API provided to node modules (plug-ins).

EXAMPLE

  If you want to experiment with embedding the NodeBrain interpreter in your own program, refer to the NodeBrain API Reference. 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);
    }

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

  The NodeBrain library is untested except for the API functions that are exercised by nb(1) and the distributed node modules.

AUTHOR

  Ed Trettevik <eat@nodebrain.org>

SEE ALSO

  nb(1), nb.man(7), nb.cfg(5), nb.syn(5), nb.mod(7)

[1] NodeBrain Home Page

[2] NodeBrain Tutorial

[3] NodeBrain User Guide

[4] NodeBrain Language Reference

[5] NodeBrain Module Reference

[6] NodeBrain API Reference


NodeBrain 0.7.4February 2009nb.lib(3)