diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-08 16:32:53 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-08 16:32:53 -0300 |
| commit | 11a70220670f25a9929439f0b27331f09f05235c (patch) | |
| tree | c4a962b5a3e53ac6df8894fb3ad2248c4a1256cb /lobject.h | |
| parent | 35a6ed283881f313152457f24cc6c677122d5058 (diff) | |
| download | lua-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.h | 12 |
1 files changed, 2 insertions, 10 deletions
| @@ -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 | ||
| 88 | typedef 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 | */ |
| 98 | typedef struct TString { | 91 | typedef 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! */ |
