forked from tdtrask/lua-subprocess
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathliolib-copy.h
More file actions
24 lines (20 loc) · 801 Bytes
/
liolib-copy.h
File metadata and controls
24 lines (20 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef LIOLIB_COPY_H
#define LIOLIB_COPY_H
#include "lua.h"
#include "stdio.h"
FILE *liolib_copy_tofile(lua_State *L, int index);
FILE **liolib_copy_newfile(lua_State *L);
#if LUA_VERSION_NUM >= 502
/* lua_equal deprecated in favour of lua_compare */
#define lua_equal(L,a,b) (lua_compare((L), (a), (b), LUA_OPEQ))
/* lua_setfenv/lua_getfenv are gone from Lua 5.2 onwards.
We can use lua_setuservalue/lua_getuservalue for userdata only
(which is the only thing we use it for here). */
#define lua_getfenv(L,i) (lua_getuservalue((L), (i)))
#define lua_setfenv(L,i) (lua_setuservalue((L), (i)))
/* lua_objlen renamed to lua_rawlen */
#define lua_objlen(L,i) (lua_rawlen((L), (i)))
#define luaL_optlong(L, arg, d) (luaL_optinteger((L), (arg), (d)))
#define LUA_NUMBER_SCAN "%lf"
#endif
#endif