---
name: "CL_Lua"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_Lua"
---

# CL\_Lua(3)

CL\_Lua class

## NAME

CL\_Lua - CL\_Lua class

## DESCRIPTION

Binds global functions of Lua API. Refer to Lua manual for details.

## CLASS MEMBERS

- static int **dofile**(

  ```
  char *filename)
  ```

- static int **dostring**(

  ```
  char *string)
  ```

- static void **error**(

  ```
  char* message)
  ```

- static CL\_LuaObject **getparam**(

  ```
  int number)
  ```

- static CL\_LuaObject **getresult**(

  ```
  int number)
  ```

- static CL\_LuaObject **getglobal**(

  ```
  char* var)
  ```

- static CL\_LuaObject **setfallback**(

  ```
  char* name,
  lua_CFunction fallback)
  ```

- static void **record**(

  ```
  char* name,
  lua_CFunction func)
  ```

- static CL\_LuaObject **createObject**(

  ```
  lua_Object lo)
  ```

- static void **iolibopen**(

  ```
  void)
  ```

- static void **strlibopen**(

  ```
  void)
  ```

- static void **mathlibopen**(

  ```
  void)
  ```

- static void **dblibopen**(

  ```
  void)
  ```

## MEMBERS WITH DESCRIPTIONS

- static int **dofile**(

  ```
  char *filename)
  ```

  ```
  Parameters:
  filename - the script file name
  ```

  ```
  Description:
  ```

  Execute a Lua chunk stored in a file

  ```
  Return value:
  ```

  the return code

- static int **dostring**(

  ```
  char *string)
  ```

  ```
  Parameters:
  string - the lua string
  ```

  ```
  Description:
  ```

  Execute a Lua chunk stored in a string

  ```
  Return value:
  ```

  the return code

- static void **error**(

  ```
  char* message)
  ```

  ```
  Parameters:
  message - the error message
  ```

  ```
  Description:
  ```

  Generate a Lua error, with the given message

- static CL\_LuaObject **getparam**(

  ```
  int number)
  ```

  ```
  Parameters:
  number: the number
  ```

  ```
  Description:
  ```

  Get a parameter from Lua stack

  ```
  Return value:
  ```

  the return code

- static CL\_LuaObject **getresult**(

  ```
  int number)
  ```

  ```
  Parameters:
  number: the number
  ```

  ```
  Description:
  ```

  Get a result from Lua stack

  ```
  Return value:
  ```

  the return code

- static CL\_LuaObject **getglobal**(

  ```
  char* var)
  ```

  ```
  Parameters:
  var: the name of the global variable
  ```

  ```
  Description:
  ```

  Get a Lua global variable

  ```
  Return value:
  ```

  the return code

- static CL\_LuaObject **setfallback**(

  ```
  char* name,
  lua_CFunction fallback)
  ```

  ```
  Parameters:
  name - the name of the fallback
  fallback - pointer to the function
  ```

  ```
  Description:
  ```

  Set Lua fallback

  ```
  Return value:
  ```

  the return code

- static void **record**(

  ```
  char* name,
  lua_CFunction func)
  ```

  ```
  Parameters:
  name - the name of the function
  func - pointer to the function
  ```

  ```
  Description:
  ```

  Register a C++ function to be called from Lua

- static CL\_LuaObject **createObject**(

  ```
  lua_Object lo)
  ```

  ```
  Parameters:
  obj - the object
  ```

  ```
  Description:
  ```

  Create a LuaObject from a lua\_Object

  ```
  Return value:
  ```

  the return code

- static void **iolibopen**(

  ```
  void)
  ```

  ```
  Description:
  ```

  Open the IO library

- static void **strlibopen**(

  ```
  void)
  ```

  ```
  Description:
  ```

  Open the string library

- static void **mathlibopen**(

  ```
  void)
  ```

  ```
  Description:
  ```

  Open the math library

- static void **dblibopen**(

  ```
  void)
  ```

  ```
  Description:
  ```

  Open the db library

## SEE ALSO

All ClanLib API classes can be found in **clanlib (3)**.

## AUTHORS

Originally written by Magnus Norddahl \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at **http://somewhere.in.the.world.org**).

See **clanlib (3)** to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.
