aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-18 17:27:38 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-18 17:27:38 -0200
commit73664eb7399655e7cf65132c91a1aa16191a1667 (patch)
tree733f88cc9444c2563989a1dd404c62c617dee926
parentfeed56a01ccb9ca99271e0feca79f71aa5c38f8e (diff)
downloadlua-73664eb7399655e7cf65132c91a1aa16191a1667.tar.gz
lua-73664eb7399655e7cf65132c91a1aa16191a1667.tar.bz2
lua-73664eb7399655e7cf65132c91a1aa16191a1667.zip
function 'lua_createstring' moved from table.c to tree.c
-rw-r--r--table.c12
-rw-r--r--table.h3
-rw-r--r--tree.c5
-rw-r--r--tree.h4
4 files changed, 7 insertions, 17 deletions
diff --git a/table.c b/table.c
index ab5fd5e8..ced492a2 100644
--- a/table.c
+++ b/table.c
@@ -3,7 +3,7 @@
3** Module to control static tables 3** Module to control static tables
4*/ 4*/
5 5
6char *rcs_table="$Id: table.c,v 2.19 1994/11/16 17:39:16 roberto Exp $"; 6char *rcs_table="$Id: table.c,v 2.20 1994/11/17 13:58:57 roberto Exp roberto $";
7 7
8#include <string.h> 8#include <string.h>
9 9
@@ -180,16 +180,6 @@ void lua_pack (void)
180 180
181 181
182/* 182/*
183** If the string isn't allocated, allocate a new string at string tree.
184*/
185char *lua_createstring (char *s)
186{
187 if (s == NULL) return NULL;
188 return lua_strcreate(s);
189}
190
191
192/*
193** Add a file name at file table, checking overflow. This function also set 183** Add a file name at file table, checking overflow. This function also set
194** the external variable "lua_filename" with the function filename set. 184** the external variable "lua_filename" with the function filename set.
195** Return 0 on success or error message on error. 185** Return 0 on success or error message on error.
diff --git a/table.h b/table.h
index 1cc3fcca..0c2f0c0a 100644
--- a/table.h
+++ b/table.h
@@ -1,7 +1,7 @@
1/* 1/*
2** Module to control static tables 2** Module to control static tables
3** TeCGraf - PUC-Rio 3** TeCGraf - PUC-Rio
4** $Id: table.h,v 2.6 1994/11/16 16:03:48 roberto Exp roberto $ 4** $Id: table.h,v 2.7 1994/11/17 13:58:57 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef table_h 7#ifndef table_h
@@ -23,7 +23,6 @@ int luaI_findconstant (TreeNode *t);
23void lua_travsymbol (void (*fn)(Object *)); 23void lua_travsymbol (void (*fn)(Object *));
24void lua_markobject (Object *o); 24void lua_markobject (Object *o);
25void lua_pack (void); 25void lua_pack (void);
26char *lua_createstring (char *s);
27char *lua_addfile (char *fn); 26char *lua_addfile (char *fn);
28int lua_delfile (void); 27int lua_delfile (void);
29char *lua_filename (void); 28char *lua_filename (void);
diff --git a/tree.c b/tree.c
index 58f25de4..0f3e021c 100644
--- a/tree.c
+++ b/tree.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_tree="$Id: tree.c,v 1.7 1994/11/16 18:09:11 roberto Exp roberto $"; 6char *rcs_tree="$Id: tree.c,v 1.8 1994/11/17 13:58:57 roberto Exp roberto $";
7 7
8 8
9#include <string.h> 9#include <string.h>
@@ -53,9 +53,10 @@ static TreeNode *tree_create (TreeNode **node, char *str)
53 } 53 }
54} 54}
55 55
56char *lua_strcreate (char *str) 56char *lua_createstring (char *str)
57{ 57{
58 StringNode *newString; 58 StringNode *newString;
59 if (str == NULL) return NULL;
59 lua_pack(); 60 lua_pack();
60 newString = (StringNode *)luaI_malloc(sizeof(StringNode)+strlen(str)); 61 newString = (StringNode *)luaI_malloc(sizeof(StringNode)+strlen(str));
61 newString->mark = UNMARKED_STRING; 62 newString->mark = UNMARKED_STRING;
diff --git a/tree.h b/tree.h
index aa7a44c4..e8accc7e 100644
--- a/tree.h
+++ b/tree.h
@@ -1,7 +1,7 @@
1/* 1/*
2** tree.h 2** tree.h
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4** $Id: tree.h,v 1.3 1994/11/16 16:03:48 roberto Exp roberto $ 4** $Id: tree.h,v 1.4 1994/11/17 13:58:57 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef tree_h 7#ifndef tree_h
@@ -28,7 +28,7 @@ typedef struct TreeNode
28#define indexstring(s) (*(((Word *)s)-1)) 28#define indexstring(s) (*(((Word *)s)-1))
29 29
30 30
31char *lua_strcreate (char *str); 31char *lua_createstring (char *str);
32TreeNode *lua_constcreate (char *str); 32TreeNode *lua_constcreate (char *str);
33int lua_strcollector (void); 33int lua_strcollector (void);
34TreeNode *lua_varnext (char *n); 34TreeNode *lua_varnext (char *n);