summaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h127
1 files changed, 66 insertions, 61 deletions
diff --git a/lua.h b/lua.h
index a4279ecb..f2cc880a 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.73 2000/10/05 12:14:08 roberto Exp roberto $ 2** $Id: lua.h,v 1.74 2000/10/09 15:46:43 roberto Exp roberto $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
5** e-mail: lua@tecgraf.puc-rio.br 5** e-mail: lua@tecgraf.puc-rio.br
@@ -16,6 +16,11 @@
16#include <stddef.h> 16#include <stddef.h>
17 17
18 18
19#ifndef LUA_API
20#define LUA_API extern
21#endif
22
23
19#define LUA_VERSION "Lua 4.0 (beta)" 24#define LUA_VERSION "Lua 4.0 (beta)"
20#define LUA_COPYRIGHT "Copyright (C) 1994-2000 TeCGraf, PUC-Rio" 25#define LUA_COPYRIGHT "Copyright (C) 1994-2000 TeCGraf, PUC-Rio"
21#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo" 26#define LUA_AUTHORS "W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
@@ -65,113 +70,113 @@ typedef int (*lua_CFunction) (lua_State *L);
65/* 70/*
66** state manipulation 71** state manipulation
67*/ 72*/
68lua_State *lua_open (int stacksize); 73LUA_API lua_State *lua_open (int stacksize);
69void lua_close (lua_State *L); 74LUA_API void lua_close (lua_State *L);
70 75
71 76
72/* 77/*
73** basic stack manipulation 78** basic stack manipulation
74*/ 79*/
75int lua_gettop (lua_State *L); 80LUA_API int lua_gettop (lua_State *L);
76void lua_settop (lua_State *L, int index); 81LUA_API void lua_settop (lua_State *L, int index);
77void lua_pushvalue (lua_State *L, int index); 82LUA_API void lua_pushvalue (lua_State *L, int index);
78void lua_remove (lua_State *L, int index); 83LUA_API void lua_remove (lua_State *L, int index);
79void lua_insert (lua_State *L, int index); 84LUA_API void lua_insert (lua_State *L, int index);
80int lua_stackspace (lua_State *L); 85LUA_API int lua_stackspace (lua_State *L);
81 86
82 87
83/* 88/*
84** access functions (stack -> C) 89** access functions (stack -> C)
85*/ 90*/
86 91
87int lua_type (lua_State *L, int index); 92LUA_API int lua_type (lua_State *L, int index);
88const char *lua_typename (lua_State *L, int t); 93LUA_API const char *lua_typename (lua_State *L, int t);
89int lua_isnumber (lua_State *L, int index); 94LUA_API int lua_isnumber (lua_State *L, int index);
90int lua_isstring (lua_State *L, int index); 95LUA_API int lua_isstring (lua_State *L, int index);
91int lua_iscfunction (lua_State *L, int index); 96LUA_API int lua_iscfunction (lua_State *L, int index);
92int lua_tag (lua_State *L, int index); 97LUA_API int lua_tag (lua_State *L, int index);
93 98
94int lua_equal (lua_State *L, int index1, int index2); 99LUA_API int lua_equal (lua_State *L, int index1, int index2);
95int lua_lessthan (lua_State *L, int index1, int index2); 100LUA_API int lua_lessthan (lua_State *L, int index1, int index2);
96 101
97double lua_tonumber (lua_State *L, int index); 102LUA_API double lua_tonumber (lua_State *L, int index);
98const char *lua_tostring (lua_State *L, int index); 103LUA_API const char *lua_tostring (lua_State *L, int index);
99size_t lua_strlen (lua_State *L, int index); 104LUA_API size_t lua_strlen (lua_State *L, int index);
100lua_CFunction lua_tocfunction (lua_State *L, int index); 105LUA_API lua_CFunction lua_tocfunction (lua_State *L, int index);
101void *lua_touserdata (lua_State *L, int index); 106LUA_API void *lua_touserdata (lua_State *L, int index);
102const void *lua_topointer (lua_State *L, int index); 107LUA_API const void *lua_topointer (lua_State *L, int index);
103 108
104 109
105/* 110/*
106** push functions (C -> stack) 111** push functions (C -> stack)
107*/ 112*/
108void lua_pushnil (lua_State *L); 113LUA_API void lua_pushnil (lua_State *L);
109void lua_pushnumber (lua_State *L, double n); 114LUA_API void lua_pushnumber (lua_State *L, double n);
110void lua_pushlstring (lua_State *L, const char *s, size_t len); 115LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len);
111void lua_pushstring (lua_State *L, const char *s); 116LUA_API void lua_pushstring (lua_State *L, const char *s);
112void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); 117LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);
113void lua_pushusertag (lua_State *L, void *u, int tag); 118LUA_API void lua_pushusertag (lua_State *L, void *u, int tag);
114 119
115 120
116/* 121/*
117** get functions (Lua -> stack) 122** get functions (Lua -> stack)
118*/ 123*/
119void lua_getglobal (lua_State *L, const char *name); 124LUA_API void lua_getglobal (lua_State *L, const char *name);
120void lua_gettable (lua_State *L, int index); 125LUA_API void lua_gettable (lua_State *L, int index);
121void lua_rawget (lua_State *L, int index); 126LUA_API void lua_rawget (lua_State *L, int index);
122void lua_rawgeti (lua_State *L, int index, int n); 127LUA_API void lua_rawgeti (lua_State *L, int index, int n);
123void lua_getglobals (lua_State *L); 128LUA_API void lua_getglobals (lua_State *L);
124void lua_gettagmethod (lua_State *L, int tag, const char *event); 129LUA_API void lua_gettagmethod (lua_State *L, int tag, const char *event);
125 130
126int lua_getref (lua_State *L, int ref); 131LUA_API int lua_getref (lua_State *L, int ref);
127 132
128void lua_newtable (lua_State *L); 133LUA_API void lua_newtable (lua_State *L);
129 134
130 135
131/* 136/*
132** set functions (stack -> Lua) 137** set functions (stack -> Lua)
133*/ 138*/
134void lua_setglobal (lua_State *L, const char *name); 139LUA_API void lua_setglobal (lua_State *L, const char *name);
135void lua_settable (lua_State *L, int index); 140LUA_API void lua_settable (lua_State *L, int index);
136void lua_rawset (lua_State *L, int index); 141LUA_API void lua_rawset (lua_State *L, int index);
137void lua_rawseti (lua_State *L, int index, int n); 142LUA_API void lua_rawseti (lua_State *L, int index, int n);
138void lua_setglobals (lua_State *L); 143LUA_API void lua_setglobals (lua_State *L);
139void lua_settagmethod (lua_State *L, int tag, const char *event); 144LUA_API void lua_settagmethod (lua_State *L, int tag, const char *event);
140int lua_ref (lua_State *L, int lock); 145LUA_API int lua_ref (lua_State *L, int lock);
141 146
142 147
143/* 148/*
144** "do" functions (run Lua code) 149** "do" functions (run Lua code)
145*/ 150*/
146int lua_call (lua_State *L, int nargs, int nresults); 151LUA_API int lua_call (lua_State *L, int nargs, int nresults);
147void lua_rawcall (lua_State *L, int nargs, int nresults); 152LUA_API void lua_rawcall (lua_State *L, int nargs, int nresults);
148int lua_dofile (lua_State *L, const char *filename); 153LUA_API int lua_dofile (lua_State *L, const char *filename);
149int lua_dostring (lua_State *L, const char *str); 154LUA_API int lua_dostring (lua_State *L, const char *str);
150int lua_dobuffer (lua_State *L, const char *buff, size_t size, 155LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size,
151 const char *name); 156 const char *name);
152 157
153/* 158/*
154** Garbage-collection functions 159** Garbage-collection functions
155*/ 160*/
156int lua_getgcthreshold (lua_State *L); 161LUA_API int lua_getgcthreshold (lua_State *L);
157int lua_getgccount (lua_State *L); 162LUA_API int lua_getgccount (lua_State *L);
158void lua_setgcthreshold (lua_State *L, int newthreshold); 163LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
159 164
160/* 165/*
161** miscellaneous functions 166** miscellaneous functions
162*/ 167*/
163int lua_newtag (lua_State *L); 168LUA_API int lua_newtag (lua_State *L);
164int lua_copytagmethods (lua_State *L, int tagto, int tagfrom); 169LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom);
165void lua_settag (lua_State *L, int tag); 170LUA_API void lua_settag (lua_State *L, int tag);
166 171
167void lua_error (lua_State *L, const char *s); 172LUA_API void lua_error (lua_State *L, const char *s);
168 173
169void lua_unref (lua_State *L, int ref); 174LUA_API void lua_unref (lua_State *L, int ref);
170 175
171int lua_next (lua_State *L, int index); 176LUA_API int lua_next (lua_State *L, int index);
172int lua_getn (lua_State *L, int index); 177LUA_API int lua_getn (lua_State *L, int index);
173 178
174void lua_concat (lua_State *L, int n); 179LUA_API void lua_concat (lua_State *L, int n);
175 180
176 181
177/* 182/*