summaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-04 19:24:51 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-04-04 19:24:51 -0300
commit42fa305649199712aad1c96beadb944b01277e3f (patch)
treed20afcf78aebc8b7fad91ce4e3b9061c2a29b000 /lua.h
parent9319735744404831f7153653930d56826a4d2f6a (diff)
downloadlua-42fa305649199712aad1c96beadb944b01277e3f.tar.gz
lua-42fa305649199712aad1c96beadb944b01277e3f.tar.bz2
lua-42fa305649199712aad1c96beadb944b01277e3f.zip
better error messages;
better names for some API functions.
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/lua.h b/lua.h
index 2c07125f..4ef9f60c 100644
--- a/lua.h
+++ b/lua.h
@@ -2,7 +2,7 @@
2** LUA - An Extensible Extension Language 2** LUA - An Extensible Extension Language
3** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 3** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
4** e-mail: lua@tecgraf.puc-rio.br 4** e-mail: lua@tecgraf.puc-rio.br
5** $Id: lua.h,v 3.42 1997/04/02 23:04:12 roberto Exp roberto $ 5** $Id: lua.h,v 4.1 1997/04/03 18:26:08 roberto Exp roberto $
6*/ 6*/
7 7
8 8
@@ -19,9 +19,8 @@
19typedef void (*lua_CFunction) (void); 19typedef void (*lua_CFunction) (void);
20typedef unsigned int lua_Object; 20typedef unsigned int lua_Object;
21 21
22lua_Object lua_setfallback (char *event, lua_CFunction fallback); 22void lua_settagmethod (int tag, char *event, lua_CFunction method);
23void lua_setintmethod (int tag, char *event, lua_CFunction method); 23void lua_gettagmethod (int tag, char *event); /* out: method */
24void lua_getintmethod (int tag, char *event); /* out: method */
25void lua_seterrormethod (lua_CFunction method); 24void lua_seterrormethod (lua_CFunction method);
26 25
27int lua_newtag (void); 26int lua_newtag (void);
@@ -53,26 +52,26 @@ int lua_isfunction (lua_Object object);
53float lua_getnumber (lua_Object object); 52float lua_getnumber (lua_Object object);
54char *lua_getstring (lua_Object object); 53char *lua_getstring (lua_Object object);
55lua_CFunction lua_getcfunction (lua_Object object); 54lua_CFunction lua_getcfunction (lua_Object object);
56void *lua_getbinarydata (lua_Object object); 55void *lua_getbindata (lua_Object object);
57int lua_getbindatasize (lua_Object object); 56int lua_getbindatasize (lua_Object object);
58 57
59void lua_pushnil (void); 58void lua_pushnil (void);
60void lua_pushnumber (float n); 59void lua_pushnumber (float n);
61void lua_pushstring (char *s); 60void lua_pushstring (char *s);
62void lua_pushcfunction (lua_CFunction fn); 61void lua_pushcfunction (lua_CFunction fn);
63void lua_pushbinarydata (void *buff, int size, int tag); 62void lua_pushbindata (void *buff, int size, int tag);
64void lua_pushusertag (void *u, int tag); 63void lua_pushusertag (void *u, int tag);
65void lua_pushobject (lua_Object object); 64void lua_pushobject (lua_Object object);
66 65
67lua_Object lua_getglobal (char *name); 66lua_Object lua_getglobal (char *name);
68lua_Object lua_basicgetglobal (char *name); 67lua_Object lua_rawgetglobal (char *name);
69void lua_setglobal (char *name); /* In: value */ 68void lua_setglobal (char *name); /* In: value */
70void lua_basicsetglobal (char *name); /* In: value */ 69void lua_rawsetglobal (char *name); /* In: value */
71 70
72void lua_storesubscript (void); /* In: table, index, value */ 71void lua_settable (void); /* In: table, index, value */
73void lua_basicstoreindex (void); /* In: table, index, value */ 72void lua_rawsettable (void); /* In: table, index, value */
74lua_Object lua_getsubscript (void); /* In: table, index */ 73lua_Object lua_gettable (void); /* In: table, index */
75lua_Object lua_basicindex (void); /* In: table, index */ 74lua_Object lua_rawgettable (void); /* In: table, index */
76 75
77int lua_tag (lua_Object object); 76int lua_tag (lua_Object object);
78 77
@@ -98,6 +97,8 @@ lua_Object lua_createtable (void);
98/* =============================================================== */ 97/* =============================================================== */
99/* for compatibility with old versions. Avoid using these macros/functions */ 98/* for compatibility with old versions. Avoid using these macros/functions */
100 99
100lua_Object lua_setfallback (char *event, lua_CFunction fallback);
101
101#define lua_storeglobal(n) lua_setglobal(n) 102#define lua_storeglobal(n) lua_setglobal(n)
102#define lua_type(o) (lua_tag(o)) 103#define lua_type(o) (lua_tag(o))
103 104
@@ -111,9 +112,10 @@ void *lua_getuserdata (lua_Object object);
111 112
112#define lua_pushliteral(o) lua_pushstring(o) 113#define lua_pushliteral(o) lua_pushstring(o)
113 114
114#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_getsubscript()) 115#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_gettable())
115#define lua_getfield(o,f) (lua_pushobject(o), lua_pushliteral(f), lua_getsubscript()) 116#define lua_getfield(o,f) (lua_pushobject(o), lua_pushliteral(f), lua_gettable())
116 117
117#define lua_copystring(o) (strdup(lua_getstring(o))) 118#define lua_copystring(o) (strdup(lua_getstring(o)))
118 119
120#define lua_getsubscript lua_gettable
119#endif 121#endif