diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-01-26 13:38:01 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-01-26 13:38:01 -0200 |
commit | fd25d4ad85302a84551ac6ed915435c035a978e4 (patch) | |
tree | 83b182dd0a067bf4087f859cd82f4eb26324899d | |
parent | 2431534f1061149bf7db7985dd137cd6324056a8 (diff) | |
download | lua-fd25d4ad85302a84551ac6ed915435c035a978e4.tar.gz lua-fd25d4ad85302a84551ac6ed915435c035a978e4.tar.bz2 lua-fd25d4ad85302a84551ac6ed915435c035a978e4.zip |
no need to define functions for macros...
-rw-r--r-- | lapi.c | 25 | ||||
-rw-r--r-- | lbuiltin.c | 4 | ||||
-rw-r--r-- | lua.h | 12 |
3 files changed, 5 insertions, 36 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.30 1998/12/30 17:26:49 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.31 1999/01/15 13:11:22 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 | */ |
@@ -622,29 +622,6 @@ lua_Object lua_getref (int ref) | |||
622 | /* }====================================================== */ | 622 | /* }====================================================== */ |
623 | 623 | ||
624 | 624 | ||
625 | /* | ||
626 | ** {====================================================== | ||
627 | ** Derived functions | ||
628 | ** ======================================================= | ||
629 | */ | ||
630 | int (lua_call) (char *name) { return lua_call(name); } | ||
631 | |||
632 | void (lua_pushref) (int ref) { lua_pushref(ref); } | ||
633 | |||
634 | int (lua_refobject) (lua_Object o, int l) { return lua_refobject(o, l); } | ||
635 | |||
636 | void (lua_register) (char *n, lua_CFunction f) { lua_register(n, f); } | ||
637 | |||
638 | void (lua_pushuserdata) (void *u) { lua_pushuserdata(u); } | ||
639 | |||
640 | void (lua_pushcfunction) (lua_CFunction f) { lua_pushcfunction(f); } | ||
641 | |||
642 | int (lua_clonetag) (int t) { return lua_clonetag(t); } | ||
643 | |||
644 | /* }====================================================== */ | ||
645 | |||
646 | |||
647 | |||
648 | 625 | ||
649 | #ifdef LUA_COMPAT2_5 | 626 | #ifdef LUA_COMPAT2_5 |
650 | /* | 627 | /* |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.46 1999/01/22 18:46:11 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.47 1999/01/25 12:30:11 roberto Exp roberto $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -650,7 +650,7 @@ static void testC (void) { | |||
650 | case '=': lua_setglobal(getname(s)); break; | 650 | case '=': lua_setglobal(getname(s)); break; |
651 | case 's': lua_pushstring(getname(s)); break; | 651 | case 's': lua_pushstring(getname(s)); break; |
652 | case 'o': lua_pushobject(reg[getnum(s)]); break; | 652 | case 'o': lua_pushobject(reg[getnum(s)]); break; |
653 | case 'f': (lua_call)(getname(s)); break; | 653 | case 'f': lua_call(getname(s)); break; |
654 | case 'i': reg[getnum(s)] = lua_gettable(); break; | 654 | case 'i': reg[getnum(s)] = lua_gettable(); break; |
655 | case 'I': reg[getnum(s)] = lua_rawgettable(); break; | 655 | case 'I': reg[getnum(s)] = lua_rawgettable(); break; |
656 | case 't': lua_settable(); break; | 656 | case 't': lua_settable(); break; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.24 1998/08/21 17:43:44 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.25 1998/12/15 14:59: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 |
@@ -100,30 +100,22 @@ long lua_collectgarbage (long limit); | |||
100 | 100 | ||
101 | 101 | ||
102 | /* =============================================================== */ | 102 | /* =============================================================== */ |
103 | /* some useful macros/derived functions */ | 103 | /* some useful macros/functions */ |
104 | 104 | ||
105 | int (lua_call) (char *name); | ||
106 | #define lua_call(name) lua_callfunction(lua_getglobal(name)) | 105 | #define lua_call(name) lua_callfunction(lua_getglobal(name)) |
107 | 106 | ||
108 | void (lua_pushref) (int ref); | ||
109 | #define lua_pushref(ref) lua_pushobject(lua_getref(ref)) | 107 | #define lua_pushref(ref) lua_pushobject(lua_getref(ref)) |
110 | 108 | ||
111 | int (lua_refobject) (lua_Object o, int l); | ||
112 | #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) | 109 | #define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l)) |
113 | 110 | ||
114 | void (lua_register) (char *n, lua_CFunction f); | ||
115 | #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n)) | 111 | #define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n)) |
116 | 112 | ||
117 | void (lua_pushuserdata) (void *u); | ||
118 | #define lua_pushuserdata(u) lua_pushusertag(u, 0) | 113 | #define lua_pushuserdata(u) lua_pushusertag(u, 0) |
119 | 114 | ||
120 | void (lua_pushcfunction) (lua_CFunction f); | ||
121 | #define lua_pushcfunction(f) lua_pushcclosure(f, 0) | 115 | #define lua_pushcfunction(f) lua_pushcclosure(f, 0) |
122 | 116 | ||
123 | int (lua_clonetag) (int t); | ||
124 | #define lua_clonetag(t) lua_copytagmethods(lua_newtag(), (t)) | 117 | #define lua_clonetag(t) lua_copytagmethods(lua_newtag(), (t)) |
125 | 118 | ||
126 | |||
127 | lua_Object lua_seterrormethod (void); /* In: new method */ | 119 | lua_Object lua_seterrormethod (void); /* In: new method */ |
128 | 120 | ||
129 | /* ========================================================================== | 121 | /* ========================================================================== |