aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-05-08 16:32:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-05-08 16:32:53 -0300
commit11a70220670f25a9929439f0b27331f09f05235c (patch)
treec4a962b5a3e53ac6df8894fb3ad2248c4a1256cb /lobject.h
parent35a6ed283881f313152457f24cc6c677122d5058 (diff)
downloadlua-11a70220670f25a9929439f0b27331f09f05235c.tar.gz
lua-11a70220670f25a9929439f0b27331f09f05235c.tar.bz2
lua-11a70220670f25a9929439f0b27331f09f05235c.zip
global variables are stored in a Lua table
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/lobject.h b/lobject.h
index 921a7a05..c4e605c6 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.60 2000/04/10 19:20:24 roberto Exp roberto $ 2** $Id: lobject.h,v 1.61 2000/04/25 16:55:09 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -85,20 +85,13 @@ typedef struct TObject {
85} TObject; 85} TObject;
86 86
87 87
88typedef struct GlobalVar {
89 TObject value;
90 struct GlobalVar *next;
91 struct TString *name;
92} GlobalVar;
93
94
95/* 88/*
96** String headers for string table 89** String headers for string table
97*/ 90*/
98typedef struct TString { 91typedef struct TString {
99 union { 92 union {
100 struct { /* for strings */ 93 struct { /* for strings */
101 GlobalVar *gv; /* eventual global value with this name */ 94 unsigned long hash;
102 long len; 95 long len;
103 } s; 96 } s;
104 struct { /* for userdata */ 97 struct { /* for userdata */
@@ -107,7 +100,6 @@ typedef struct TString {
107 } d; 100 } d;
108 } u; 101 } u;
109 struct TString *nexthash; /* chain for hash table */ 102 struct TString *nexthash; /* chain for hash table */
110 unsigned long hash;
111 int constindex; /* hint to reuse constants (= -1 if this is a userdata) */ 103 int constindex; /* hint to reuse constants (= -1 if this is a userdata) */
112 unsigned char marked; 104 unsigned char marked;
113 char str[1]; /* variable length string!! must be the last field! */ 105 char str[1]; /* variable length string!! must be the last field! */