Initializing Squirrel

Squirrel 2.2

Initializing Squirrel

The first thing that a host application has to do, is create a virtual machine. The host application can create any number of virtual machines through the function sq_open().

Every single VM has to be released with the function sq_close() when it is not needed anymore.

int main(int argc, char* argv[])
{
    HSQUIRRELVM v;
    v = sq_open(1024); //creates a VM with initial stack size 1024
    
    //do some stuff with squirrel here
    
    sq_close(v);
}