diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-02 18:30:53 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-02 18:30:53 -0200 |
| commit | fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022 (patch) | |
| tree | 030c6dd803fff11ae0c368e90b78a9fef2b8b731 /lua.h | |
| parent | ae77864844d6b933eb8be68694cbb8498af165dc (diff) | |
| download | lua-fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022.tar.gz lua-fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022.tar.bz2 lua-fbf887ec2be8b293d6f3ffc88b42c5a9e87bf022.zip | |
new way to call functions, plus several small changes. This is
a temporary version!
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 29 |
1 files changed, 24 insertions, 5 deletions
| @@ -2,13 +2,29 @@ | |||
| 2 | ** LUA - Linguagem para Usuarios de Aplicacao | 2 | ** LUA - Linguagem para Usuarios de Aplicacao |
| 3 | ** Grupo de Tecnologia em Computacao Grafica | 3 | ** Grupo de Tecnologia em Computacao Grafica |
| 4 | ** TeCGraf - PUC-Rio | 4 | ** TeCGraf - PUC-Rio |
| 5 | ** $Id: lua.h,v 1.4 1994/08/24 15:29:02 celes Exp roberto $ | 5 | ** $Id: lua.h,v 1.5 1994/11/01 17:54:31 roberto Exp $ |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | #ifndef lua_h | 9 | #ifndef lua_h |
| 10 | #define lua_h | 10 | #define lua_h |
| 11 | 11 | ||
| 12 | /* Private Part */ | ||
| 13 | |||
| 14 | typedef enum | ||
| 15 | { | ||
| 16 | LUA_T_MARK, | ||
| 17 | LUA_T_NIL, | ||
| 18 | LUA_T_NUMBER, | ||
| 19 | LUA_T_STRING, | ||
| 20 | LUA_T_ARRAY, | ||
| 21 | LUA_T_FUNCTION, | ||
| 22 | LUA_T_CFUNCTION, | ||
| 23 | LUA_T_USERDATA | ||
| 24 | } Type; | ||
| 25 | |||
| 26 | |||
| 27 | /* Public Part */ | ||
| 12 | 28 | ||
| 13 | typedef void (*lua_CFunction) (void); | 29 | typedef void (*lua_CFunction) (void); |
| 14 | typedef struct Object *lua_Object; | 30 | typedef struct Object *lua_Object; |
| @@ -19,8 +35,7 @@ void lua_errorfunction (void (*fn) (char *s)); | |||
| 19 | void lua_error (char *s); | 35 | void lua_error (char *s); |
| 20 | int lua_dofile (char *filename); | 36 | int lua_dofile (char *filename); |
| 21 | int lua_dostring (char *string); | 37 | int lua_dostring (char *string); |
| 22 | int lua_call (char *functionname, int nparam); | 38 | int lua_callfunction (lua_Object function); |
| 23 | int lua_callfunction (lua_Object function, int nparam); | ||
| 24 | 39 | ||
| 25 | lua_Object lua_getparam (int number); | 40 | lua_Object lua_getparam (int number); |
| 26 | float lua_getnumber (lua_Object object); | 41 | float lua_getnumber (lua_Object object); |
| @@ -33,8 +48,6 @@ lua_Object lua_getfield (lua_Object object, char *field); | |||
| 33 | lua_Object lua_getindexed (lua_Object object, float index); | 48 | lua_Object lua_getindexed (lua_Object object, float index); |
| 34 | lua_Object lua_getglobal (char *name); | 49 | lua_Object lua_getglobal (char *name); |
| 35 | 50 | ||
| 36 | lua_Object lua_pop (void); | ||
| 37 | |||
| 38 | int lua_pushnil (void); | 51 | int lua_pushnil (void); |
| 39 | int lua_pushnumber (float n); | 52 | int lua_pushnumber (float n); |
| 40 | int lua_pushstring (char *s); | 53 | int lua_pushstring (char *s); |
| @@ -57,4 +70,10 @@ int lua_isfunction (lua_Object object); | |||
| 57 | int lua_iscfunction (lua_Object object); | 70 | int lua_iscfunction (lua_Object object); |
| 58 | int lua_isuserdata (lua_Object object); | 71 | int lua_isuserdata (lua_Object object); |
| 59 | 72 | ||
| 73 | |||
| 74 | /* for lua 1.1 */ | ||
| 75 | |||
| 76 | #define lua_call(f) lua_callfunction(lua_getglobal(f)) | ||
| 77 | |||
| 78 | |||
| 60 | #endif | 79 | #endif |
