summaryrefslogtreecommitdiff
path: root/iup/srclua5/iuplua_cd.c
blob: c14932ab9de956c4d87fa36f04549faf9f1cab59 (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
45
46
47
48
49
50
51
52
53
54
55
56
/** \file
 * \brief IUP Canvas Lua 5 Binding
 *
 * See Copyright Notice in cd.h
 */

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

#include <cd.h>
#include <cdiup.h>

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

#include "iup.h"
#include "iuplua.h"

#include <cdlua.h>
#include <cdluaiup.h>
#include <cdlua5_private.h>


static void *cdiup_checkdata(lua_State *L, int param)
{
  return iuplua_checkihandle(L, param);
}

static cdluaContext cdluaiupctx = 
{
  0,
  "IUP",
  cdContextIup,
  cdiup_checkdata,
  NULL,
  0
};

int cdluaiup_open (lua_State *L)
{
  cdluaLuaState* cdL = cdlua_getstate(L);
  lua_pushstring(L, "cd");
  lua_gettable(L, LUA_GLOBALSINDEX);     /* leave "cd" table at the top of the stack */
  cdlua_addcontext(L, cdL, &cdluaiupctx);
  return 1;
}

int luaopen_iupluacd(lua_State* L)
{
  return cdluaiup_open(L);
}

int luaopen_iupluacd51(lua_State* L)
{
  return cdluaiup_open(L);
}