summaryrefslogtreecommitdiff
path: root/cd/src/lua5/cdluacontextplus5.c
blob: de69167d8a1786e47187637e0fc7be649402014a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/** \file
 * \brief Context Plus Lua 5 Binding
 *
 * See Copyright Notice in cd.h
 */

#include <stdlib.h>
#include <stdio.h>

#include "cd.h"

#include <lua.h>
#include <lauxlib.h>


static int cdlua5_initcontextplus(lua_State *L)
{
  (void)L;
  cdInitContextPlus();
  return 0;
}

static const struct luaL_reg cdlib[] = {
  {"InitContextPlus", cdlua5_initcontextplus},
  {NULL, NULL},
};


static int cdluacontextplus_open (lua_State *L)
{
  cdInitContextPlus();
  luaL_register(L, "cd", cdlib);   /* leave "cd" table at the top of the stack */
  return 1;
}

int luaopen_cdluacontextplus(lua_State* L)
{
  return cdluacontextplus_open(L);
}

int luaopen_cdluacontextplus51(lua_State* L)
{
  return cdluacontextplus_open(L);
}