wings 0.2.1
An embeddable header-only Python interpreter for C/C++.
Wg_Config Struct Reference

The configuration used to initialise an interpreter. More...

#include <wings.h>

Data Fields

bool enableOSAccess
 Enables the os module and the global 'open' function. More...
 
int maxAlloc
 The maximum number of objects allowed to be allocated at a time before a MemoryError will be raised. More...
 
int maxRecursion
 The maximum recursion depth allowed before a RecursionError will be raised. More...
 
float gcRunFactor
 The 'aggressiveness' of the garbage collector. Higher means less aggressive. More...
 
Wg_PrintFunction print
 The callback to be invoked when print is called in the interpreter. If this is NULL, then print messages are discarded. More...
 
void * printUserdata
 The userdata passed to the print callback. More...
 
const char * importPath
 The path to search in when importing file modules. The terminating directory separator is optional. More...
 
const char *const * argv
 The commandline arguments passed to the interpreter. If argc is 0, then this can be NULL. More...
 
int argc
 The length of the argv array. If argc is 0, then a length 1 array with an empty string is implied. More...
 

Detailed Description

The configuration used to initialise an interpreter.

The configuration cannot be changed after the interpreter is initialised.

See also
Wg_CreateContext

Field Documentation

◆ argc

int argc

The length of the argv array. If argc is 0, then a length 1 array with an empty string is implied.

This is set to 0 by default.

◆ argv

const char* const* argv

The commandline arguments passed to the interpreter. If argc is 0, then this can be NULL.

◆ enableOSAccess

bool enableOSAccess

Enables the os module and the global 'open' function.

This is set to false by default.

Warning
Although this option can be enabled to prevent scripts from directly accessing OS resources, it does not provide a full sandbox. Untrusted scripts should never be run with or without this option enabled.

◆ gcRunFactor

float gcRunFactor

The 'aggressiveness' of the garbage collector. Higher means less aggressive.

The garbage collector runs when the number of allocated objects reaches floor(gcRunFactor * lastObjectCountAfterGC).

This is set to 2.0 by default and must be >= 1.0.

◆ importPath

const char* importPath

The path to search in when importing file modules. The terminating directory separator is optional.

This is set to NULL by default which indicates the current working directory.

◆ maxAlloc

int maxAlloc

The maximum number of objects allowed to be allocated at a time before a MemoryError will be raised.

This is set to 1 000 000 by default.

◆ maxRecursion

int maxRecursion

The maximum recursion depth allowed before a RecursionError will be raised.

This is set to 50 by default.

◆ print

The callback to be invoked when print is called in the interpreter. If this is NULL, then print messages are discarded.

This is set to forward to std::cout by default.

See also
Wg_Print, Wg_PrintString

◆ printUserdata

void* printUserdata

The userdata passed to the print callback.