index

Reference: Library functions

extern "C"
{
  AS_API asIScriptEngine *  asCreateScriptEngine(asDWORD version);
  AS_API const char *       asGetLibraryVersion();
  AS_API asIScriptContext * asGetActiveContext();
  AS_API int                asThreadCleanup();
}

asCreateScriptEngine

asIScriptEngine *asCreateScriptEngine(asDWORD version);

Exported as "_asCreateScriptEngine".

Description

Creates a new script engine object, based on the version specified.

Parameters

version 

The engine version wanted.

Returns

Returns a pointer to the engine object if successful, or 0 if the version is not supported or memory couldn't be allocated.

asGetLibraryVersion

const char *asGetLibraryVersion();

Exported as "_asGetLibraryVersion".

Description

Use this to verify library version.

Returns

Returns a pointer to a constant string holding the library version.

asGetActiveContext

asIScriptContext *asGetActiveContext();

Exported as "_asGetActiveContext".

Description

This function is used to retrieve the context interface from within system functions that need it, e.g to set script exceptions.

Returns

Returns a pointer to the script context currently executing, or 0 if no context is executing.

asThreadCleanup

int asThreadCleanup();

Exported as "_asThreadCleanup".

Description

If you are using multiple threads it is a good idea to call this function just before terminating a thread. It will allow AngelScript to cleanup some memory that is local to the current running thread.

Returns

If the cleanup couldn't be performed, e.g. if a context is currently active, the function returns a negative value.

top