summaryrefslogtreecommitdiff
path: root/tests/C/lua_pushcclosure-light.c
blob: a891450280a6b362bd2b7c758a6c7b97dc1d122f (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
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include <stdlib.h>
#include <stdio.h>

int func(lua_State *L) {
    return 0;
}

int main(void) {

    lua_State *L = luaL_newstate();

    luaL_openlibs(L);

    lua_pushcclosure(L, func, 0);

    printf("L->top(%d): %s\n", lua_gettop(L), luaL_typename(L, lua_gettop(L)));

    lua_close(L);

    return 0;

}