Barracuda Application Server C/C++ Reference
 All Classes Functions Variables Typedefs Enumerations Enumerator Groups Pages
The Lua Server Pages (LSP) Plugin.

balua.h is header file that provides the public symbols for creating, destroying and configuring an LSP VM. More...

Collaboration diagram for The Lua Server Pages (LSP) Plugin.:

Classes

struct  BaLua_param
 The startup and runtime parameters for a Barracuda Server Lua VM. More...
 
struct  LSharkSSLFuncs
 
struct  LHttpDir
 

Macros

#define balua_create(p)   _balua_create(p, BALUA_VERSION)
 Creates the Barracuda Lua VM.
 
#define balua_getmutex(L)   balua_getparam(L)->mutex
 Get the SoDisp mutex.
 
#define balua_releasemutex(m)   if(m) ThreadMutex_release(m)
 Release mutex 'm'.
 
#define balua_setmutex(m)   if(m) ThreadMutex_set(m)
 Set mutex 'm'.
 

Functions

BA_API void * baLMalloc (lua_State *L, U32 size)
 Same as baMalloc, but does an emergency GC if baMalloc returns NULL. More...
 
BA_API lua_State * _balua_create (const BaLua_param *p, int version)
 Creates the Barracuda Lua VM; Note: use macro balua_create(BaLua_param).
 
BA_API int balua_usertracker_create (lua_State *L, U32 noOfLoginTrackerNodes, U32 maxNumberOfLogins, BaTime banTime)
 Install the Lua version of the client login tracker.
 
BA_API int balua_loadconfig (lua_State *L, struct IoIntf *io, const char *filename)
 Load a Lua script and run the script at startup. More...
 
BA_API IoIntfbalua_iointf (lua_State *L, const char *name, struct IoIntf *newio)
 Register an IoIntf instance with the Lua VM. More...
 

Detailed Description

balua.h is header file that provides the public symbols for creating, destroying and configuring an LSP VM.

Creating and initializing A Barracuda Lua VM consists of calling balua_create() and calling balua_loadconfig().

See the C startup source code for the two following examples for more information on how to initialize the LSP plugin:

Function Documentation

BA_API void* baLMalloc ( lua_State *  L,
U32  size 
)

Same as baMalloc, but does an emergency GC if baMalloc returns NULL.

BA_API IoIntf* balua_iointf ( lua_State *  L,
const char *  name,
struct IoIntf newio 
)

Register an IoIntf instance with the Lua VM.

You may install any number of I/O interfaces, but each I/O interface must be registered with a unique name.

Parameters
Lthe Lua state.
namethe name makes it possible to fetch the I/O using the Lua function ba.openio(name).
newiothe IoIntf instance, such as DiskIo, ZipIo, NetIo, or your own implementation.
BA_API int balua_loadconfig ( lua_State *  L,
struct IoIntf io,
const char *  filename 
)

Load a Lua script and run the script at startup.

You may call this function multiple times during startup.

Parameters
Lthe Lua state.
iothe I/O interface to use when loading script 'filename'.
filenamethe path+name of the Lua script. The name defaults to .config if this parameter is NULL.