Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
balua.h File Reference
#include "lua.h"
#include "lauxlib.h"
#include "SharkSSL.h"
#include "AuthenticatedUser.h"
#include "ThreadLib.h"
#include "DoubleList.h"
#include "HttpCmdThreadPoolIntf.h"
Include dependency graph for balua.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BaLua_param
 Startup and runtime parameters for a BAS Lua VM. More...
 
struct  LHttpDir
 LHttpDir is the HttpDir instance used by Lua bindings and can be used by advanced Lua bindings creating new HttpDir type Lua interfaces. More...
 

Macros

#define balua_create(p)   _balua_create(p, BALUA_VERSION)
 Create a BAS Lua VM. More...
 
#define balua_getmutex(L)   balua_getparam(L)->mutex
 Get the SoDisp mutex associated with the Lua VM. More...
 
#define balua_releasemutex(m)   if(m) ThreadMutex_release(m)
 Release mutex m if it is not NULL. More...
 
#define balua_setmutex(m)   if(m) ThreadMutex_set(m)
 Acquire mutex m, waiting if necessary. More...
 

Typedefs

typedef struct LHttpDir LHttpDir
 LHttpDir is the HttpDir instance used by Lua bindings and can be used by advanced Lua bindings creating new HttpDir type Lua interfaces. More...
 

Functions

BA_API void * baLMalloc (lua_State *L, size_t size)
 Allocate application memory, retrying after a full Lua GC on allocation failure. More...
 
BA_API lua_State * _balua_create (const BaLua_param *p, int version)
 Create a BAS Lua VM. More...
 
BA_API void balua_close (lua_State *L)
 Close the BAS Lua VM, run finalizers, and free its copied parameters. More...
 
BA_API int balua_usertracker_create (lua_State *L, U32 noOfLoginTrackerNodes, U32 maxNumberOfLogins, BaTime banTime)
 Install Lua bindings for the default login tracker. More...
 
BA_API lua_State * balua_getmainthread (lua_State *L)
 Get the main state without changing the stack. More...
 
BA_API BaLua_parambalua_getparam (lua_State *L)
 Get the VM's stored parameter copy without changing the stack. More...
 
BA_API int balua_loadfile (lua_State *L, const char *filename, struct IoIntf *io, int envix)
 Compile a Lua source or bytecode file without executing it. More...
 
BA_API void balua_getuservalue (lua_State *L, int index)
 Pushes onto the stack the first user value associated with the full userdata at the given index. More...
 
BA_API int balua_wkRef (lua_State *L)
 Creates and returns a reference in the weak table, for the object on the top of the stack (and pops the object). More...
 
BA_API int balua_wkRefIx (lua_State *L, int index)
 Create a weak reference without popping the referenced value. More...
 
BA_API void balua_wkPush (lua_State *L, int reference)
 Pushes the value associated with the key 'index' on top of the stack. More...
 
BA_API void balua_wkUnref (lua_State *L, int reference)
 Releases the reference ref from the weak table. More...
 
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 int balua_loadconfigExt (lua_State *L, struct IoIntf *io, const char *filename, int nresults)
 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...
 
BA_API struct IoIntf ** balua_createiointf (lua_State *L)
 Push a Lua I/O userdata whose underlying interface is owned by Lua. More...
 
BA_API void balua_ubjson (lua_State *L)
 Install the UBJSON Lua API. More...
 
BA_API int baCheckZipSignature (const U8 *pubKey, U32 fileSize, struct CspReader *reader)
 Verify the signature of a ZIP file using a public key. More...
 
BA_API void balua_installZIO (lua_State *L, const char *name, struct ZipReader *reader)
 Install a Zip I/O interface into the Lua environment. More...