![]() |
NORSYS SOFTWARE © 2002 | NETICA API | C   VERSION   2.15  |
int InitNetica_bn ( | environ_ns** env, char* mesg ) |
This initializes the Netica system. Call it before any other Netica functions except NewNeticaEnviron_ns, GetNeticaVersion_bn, or one of the environment configuration functions, such as ArgumentChecking_ns.
It should be passed the address of a pointer to an environ_ns structure which has been created by NewNeticaEnviron_ns. mesg should be a pointer to a character array which is allocated at least MESG_LEN_ns characters long. A startup welcome message will be left in mesg if InitNetica_bn is successful, or an error message if it isn't.
It will return 0 or greater on success, or a negative value on failure. If it fails, then no other Netica API functions should be called with env except CloseNetica_bn. Use the return value to check for an error, rather than the regular Netica error system (e.g., GetError_ns).
Notice that env is a pointer to a pointer to an environ_ns. See the example below.
Version:
See also:
NewNeticaEnviron_ns | Creates the required environ_ns struct | |
CloseNetica_bn | Reverses the effects of InitNetica_bn |
Example:
int main (void){ char mesg[MESG_LEN_ns]; environ_ns* env; int res; env = NewNeticaEnviron_ns (NULL, NULL, NULL); // substitute your license string for the first NULL, if desired res = InitNetica_bn (&env, mesg); printf ("%s\n", mesg); if (res < 0) exit (-1); .... .... [rest of program] .... res = CloseNetica_bn (env, mesg); printf ("%s\n", mesg); exit (res < 0 ? -1: 0); }