aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-04-30 17:13:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-04-30 17:13:38 -0300
commitb4cd38ba6c148cf7db5deae6208b660c3417cac9 (patch)
tree8818b5e364c8ad5489a9755d3fc24110bccfdfe2 /lapi.c
parent079facab40542ff2e6be9ecc254fd148772b47c9 (diff)
downloadlua-b4cd38ba6c148cf7db5deae6208b660c3417cac9.tar.gz
lua-b4cd38ba6c148cf7db5deae6208b660c3417cac9.tar.bz2
lua-b4cd38ba6c148cf7db5deae6208b660c3417cac9.zip
new scheme for configuration through `luaconf.h'
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/lapi.c b/lapi.c
index 37e9ce6b..4078bf02 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.5 2004/03/23 17:07:34 roberto Exp roberto $ 2** $Id: lapi.c,v 2.6 2004/04/05 14:43:17 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -10,6 +10,7 @@
10#include <string.h> 10#include <string.h>
11 11
12#define lapi_c 12#define lapi_c
13#define LUA_CORE
13 14
14#include "lua.h" 15#include "lua.h"
15 16
@@ -28,11 +29,6 @@
28#include "lvm.h" 29#include "lvm.h"
29 30
30 31
31/* function to convert a lua_Number to lua_Integer (with any rounding method) */
32#ifndef lua_number2integer
33#define lua_number2integer(i,n) ((i)=(lua_Integer)(n))
34#endif
35
36 32
37const char lua_ident[] = 33const char lua_ident[] =
38 "$Lua: " LUA_VERSION " " LUA_COPYRIGHT " $\n" 34 "$Lua: " LUA_VERSION " " LUA_COPYRIGHT " $\n"
@@ -41,10 +37,6 @@ const char lua_ident[] =
41 37
42 38
43 39
44#ifndef api_check
45#define api_check(L, o) lua_assert(o)
46#endif
47
48#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) 40#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base))
49 41
50#define api_checkvalidindex(L, i) api_check(L, (i) != &luaO_nilobject) 42#define api_checkvalidindex(L, i) api_check(L, (i) != &luaO_nilobject)
@@ -87,7 +79,7 @@ void luaA_pushobject (lua_State *L, const TValue *o) {
87LUA_API int lua_checkstack (lua_State *L, int size) { 79LUA_API int lua_checkstack (lua_State *L, int size) {
88 int res; 80 int res;
89 lua_lock(L); 81 lua_lock(L);
90 if ((L->top - L->base + size) > LUA_MAXCSTACK) 82 if ((L->top - L->base + size) > MAXCSTACK)
91 res = 0; /* stack overflow */ 83 res = 0; /* stack overflow */
92 else { 84 else {
93 luaD_checkstack(L, size); 85 luaD_checkstack(L, size);