The interface is typically used in the following way (example: Call a Natural subprogram):
Determine the location of the Natural binaries.
Load the Natural Native Interface library.
Call nni_get_interface
to retrieve an interface instance.
Call nni_initialize
to
initialize a Natural session.
Call nni_logon
to logon to a
specific Natural library.
Call nni_create_parm
or
a related function to create a set of parameters.
For each parameter
Call one of the nni_init_parm
functions to initialize the parameter to
the correct type.
Call one of the nni_put_parm
functions to assign a value to the
parameter.
Call nni_get_parm_info
to create the
parameter_description
structure.
Call nni_callnat
to call
the subprogram.
For each modifiable parameter.
Call one of the nni_get_parm
functions to retrieve the parameter
value.
Call nni_delete_parm
to
free the parameter structures.
Call nni_uninitialize
to uninitialize the Natural session.
Call nni_logoff
to return to
the previous library.
Call nni_free_interface
to free the interface instance.
An example C program nnisample.c that shows the usage of the interface is contained in <install-dir>/natural/samples/sysexnni.