All data that passes through the NuGraf interface is done so using
language-independent abstract data types. This allows a NuGraf program to be ported to
other languages without requiring any major changes to the code itself. The definitions
are contained in the include file 'ni.h' which must be included in every program which
makes calls to the NuGraf interface.
The datatypes are prefixed with the letters 'Nd_' and have a label name
that is similar to their 'C' language equivalents. The following table lists the
definitions that the datatypes take on by default. Note that some of these definitions may
differ in different implementations of NuGraf.
Definition
Explanation
typedef unsigned char Nd_Char;
8 bit character (same as 'Nd_UChar')
typedef unsigned char Nd_UChar;
8 bit unsigned character
typedef short Nd_Short;
16 bit integer
typedef unsigned short Nd_UShort;
16 bit unsigned integer
typedef long Nd_Int;
32 bit integer
typedef unsigned long Nd_UInt;
32 bit unsigned integer
typedef float Nd_Float;
Single precision floating
point variable
typedef char *Nd_String;
Pointer to a string
typedef char *Nd_Token;
Pointer to a command token
string
typedef Nd_Float Nd_Vector[3];
General-purpose X,Y,Z
vector
typedef Nd_Float Nd_Color[3];
R,G,B color value
typedef float Nd_Matrix[4][4];
General purpose 4x4 matrix
typedef void Nd_Void;
The general-purpose void
datatype
typedef void *Nd_Ptr;
A pointer to various data
types
typedef Nd_Void (*Nd_Func)();
Pointer to a function
returning nothing
The Nd_Token datatype is the backbone of the NuGraf
parameter passing interface; they are used as keyword identifiers in the NuGraf interface
language. For example, Nt_WIREFRAME is the keyword token used to select
the wireframe rendering mode in the rendering level option. These tokens are actually
string pointer constants that point to internal string identifier names.