From e78cf96c971234ea25e35a9672ef00ea389d843f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 24 Oct 1997 15:17:24 -0200 Subject: first version of Cclosures. --- lobject.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index ee97f8cd..7e9afd62 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.5 1997/10/16 20:07:40 roberto Exp roberto $ +** $Id: lobject.h,v 1.6 1997/10/23 16:26:37 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -39,12 +39,11 @@ typedef enum { LUA_T_NUMBER = -1, /* fixed tag for numbers */ LUA_T_STRING = -2, /* fixed tag for strings */ LUA_T_ARRAY = -3, /* tag default for tables (or arrays) */ - LUA_T_FUNCTION = -4, /* fixed tag for functions */ - LUA_T_CFUNCTION= -5, /* fixed tag for Cfunctions */ + LUA_T_PROTO = -4, /* fixed tag for functions */ + LUA_T_CPROTO = -5, /* fixed tag for Cfunctions */ LUA_T_NIL = -6, /* last "pre-defined" tag */ - LUA_T_PROTO = -7, + LUA_T_FUNCTION = -7, LUA_T_MARK = -8, - LUA_T_CMARK = -9, LUA_T_LINE = -10 } lua_Type; @@ -53,7 +52,7 @@ typedef enum { typedef union { - lua_CFunction f; /* LUA_T_CFUNCTION, LUA_T_CMARK */ + lua_CFunction f; /* LUA_T_CPROTO */ real n; /* LUA_T_NUMBER */ struct TaggedString *ts; /* LUA_T_STRING, LUA_T_USERDATA */ struct TProtoFunc *tf; /* LUA_T_PROTO */ @@ -132,6 +131,7 @@ typedef struct LocVar { #define fvalue(o) ((o)->value.f) #define tfvalue(o) ((o)->value.tf) +#define protovalue(o) (&(o)->value.cl->consts[0]) /* ** Closures -- cgit v1.2.3-55-g6feb