Intialization

SC is provided as a dynamic or static library. If you are using the dynamic library you must include sc/scdll.h , if the static one - sc/sclib.h . To use SC you must initialize the environment. It contains all data required to run scripts, manage memory, export your own data. To initialize the environment use SCInit function. It returns an object of ISCEnv class (singleton) that represents the environment.

Its declaration is presented below:

ISCEnv* SCInit(const ISCEnvDesc *desc);

SCInit function takes one argument of type ISCEnvDesc (may be also NULL). By filling the fields of this structure you may change some parameters of the environment.

Dll loading note

Because SC environment object is only one, to simplify API, you must declare a function pointer in the global scope:

SCGETENVPROC SCGetEnv = NULL;

It must be initialized before any use of API macros of functions.

Pointers to exported functions are declared as:

typedef ISCEnv* (*SCGETENVPROC)() // for dll function SCGetEnv
typedef ISCEnv* (*SCINITPROC)(const ISCEnvDesc *envDesc); // for dll function SCInit
typedef void (*SCDEINITPROC)(); // for dll function SCDeinit