aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-03-06 15:47:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-03-06 15:47:42 -0300
commit043c2ac2584ee14865c41cbc07addd55f284e0a3 (patch)
tree0796c645370e32ba9d6349815e32c87d5c31cf86
parent88a2023c3285c4514519158fba90e644fc6ffca3 (diff)
downloadlua-043c2ac2584ee14865c41cbc07addd55f284e0a3.tar.gz
lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.tar.bz2
lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.zip
new names for "lua_pushlstr" and "lua_getstrlen"
-rw-r--r--lapi.c8
-rw-r--r--lauxlib.c4
-rw-r--r--liolib.c4
-rw-r--r--lstrlib.c10
-rw-r--r--lua.h6
5 files changed, 16 insertions, 16 deletions
diff --git a/lapi.c b/lapi.c
index 5f1a81ba..9e1ca5a6 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.21 1998/02/12 19:23:32 roberto Exp roberto $ 2** $Id: lapi.c,v 1.22 1998/03/06 16:54:42 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*/
@@ -293,7 +293,7 @@ char *lua_getstring (lua_Object object)
293 else return (svalue(Address(object))); 293 else return (svalue(Address(object)));
294} 294}
295 295
296long lua_getstrlen (lua_Object object) 296long lua_strlen (lua_Object object)
297{ 297{
298 luaC_checkGC(); /* "tostring" may create a new string */ 298 luaC_checkGC(); /* "tostring" may create a new string */
299 if (object == LUA_NOOBJECT || tostring(Address(object))) 299 if (object == LUA_NOOBJECT || tostring(Address(object)))
@@ -329,7 +329,7 @@ void lua_pushnumber (double n)
329 incr_top; 329 incr_top;
330} 330}
331 331
332void lua_pushlstr (char *s, long len) 332void lua_pushlstring (char *s, long len)
333{ 333{
334 tsvalue(L->stack.top) = luaS_newlstr(s, len); 334 tsvalue(L->stack.top) = luaS_newlstr(s, len);
335 ttype(L->stack.top) = LUA_T_STRING; 335 ttype(L->stack.top) = LUA_T_STRING;
@@ -342,7 +342,7 @@ void lua_pushstring (char *s)
342 if (s == NULL) 342 if (s == NULL)
343 lua_pushnil(); 343 lua_pushnil();
344 else 344 else
345 lua_pushlstr(s, strlen(s)); 345 lua_pushlstring(s, strlen(s));
346} 346}
347 347
348void lua_pushCclosure (lua_CFunction fn, int n) 348void lua_pushCclosure (lua_CFunction fn, int n)
diff --git a/lauxlib.c b/lauxlib.c
index f94c9836..0a7475b1 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.8 1998/01/09 15:09:53 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.9 1998/03/06 16:54:42 roberto Exp roberto $
3** Auxiliar functions for building Lua libraries 3** Auxiliar functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -35,7 +35,7 @@ char *luaL_check_lstr (int numArg, long *len)
35{ 35{
36 lua_Object o = lua_getparam(numArg); 36 lua_Object o = lua_getparam(numArg);
37 luaL_arg_check(lua_isstring(o), numArg, "string expected"); 37 luaL_arg_check(lua_isstring(o), numArg, "string expected");
38 if (len) *len = lua_getstrlen(o); 38 if (len) *len = lua_strlen(o);
39 return lua_getstring(o); 39 return lua_getstring(o);
40} 40}
41 41
diff --git a/liolib.c b/liolib.c
index 260625bb..4a499de6 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 1.14 1998/01/07 16:26:48 roberto Exp roberto $ 2** $Id: liolib.c,v 1.15 1998/03/06 16:54:42 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -233,7 +233,7 @@ static void io_read (void)
233 ungetc(c, f); 233 ungetc(c, f);
234 l = luaL_getsize(); 234 l = luaL_getsize();
235 if (l > 0 || *p == 0) /* read something or did not fail? */ 235 if (l > 0 || *p == 0) /* read something or did not fail? */
236 lua_pushlstr(luaL_buffer(), l); 236 lua_pushlstring(luaL_buffer(), l);
237} 237}
238 238
239 239
diff --git a/lstrlib.c b/lstrlib.c
index 8ddf6428..5f88656c 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.8 1998/01/27 19:11:36 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.9 1998/03/06 16:54:42 roberto Exp roberto $
3** Standard library for strings and pattern-matching 3** Standard library for strings and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -34,7 +34,7 @@ static void str_len (void)
34 34
35static void closeandpush (void) 35static void closeandpush (void)
36{ 36{
37 lua_pushlstr(luaL_buffer(), luaL_getsize()); 37 lua_pushlstring(luaL_buffer(), luaL_getsize());
38} 38}
39 39
40 40
@@ -52,7 +52,7 @@ static void str_sub (void)
52 long start = posrelat(luaL_check_number(2), l); 52 long start = posrelat(luaL_check_number(2), l);
53 long end = posrelat(luaL_opt_number(3, -1), l); 53 long end = posrelat(luaL_opt_number(3, -1), l);
54 if (1 <= start && start <= end && end <= l) 54 if (1 <= start && start <= end && end <= l)
55 lua_pushlstr(s+start-1, end-start+1); 55 lua_pushlstring(s+start-1, end-start+1);
56 else lua_pushstring(""); 56 else lua_pushstring("");
57} 57}
58 58
@@ -128,7 +128,7 @@ static void push_captures (struct Capture *cap)
128{ 128{
129 int i; 129 int i;
130 for (i=0; i<cap->level; i++) 130 for (i=0; i<cap->level; i++)
131 lua_pushlstr(cap->capture[i].init, cap->capture[i].len); 131 lua_pushlstring(cap->capture[i].init, cap->capture[i].len);
132} 132}
133 133
134 134
@@ -379,7 +379,7 @@ static void add_s (lua_Object newp, struct Capture *cap)
379 } 379 }
380 res = lua_getresult(1); 380 res = lua_getresult(1);
381 if (lua_isstring(res)) 381 if (lua_isstring(res))
382 addnchar(lua_getstring(res), lua_getstrlen(res)); 382 addnchar(lua_getstring(res), lua_strlen(res));
383 else 383 else
384 addnchar(NULL, 0); 384 addnchar(NULL, 0);
385 lua_endblock(); 385 lua_endblock();
diff --git a/lua.h b/lua.h
index 90661078..47fb63aa 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.15 1998/02/12 19:23:32 roberto Exp roberto $ 2** $Id: lua.h,v 1.16 1998/03/06 16:54:42 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
@@ -90,14 +90,14 @@ int lua_isfunction (lua_Object object);
90 90
91double lua_getnumber (lua_Object object); 91double lua_getnumber (lua_Object object);
92char *lua_getstring (lua_Object object); 92char *lua_getstring (lua_Object object);
93long lua_getstrlen (lua_Object object); 93long lua_strlen (lua_Object object);
94lua_CFunction lua_getcfunction (lua_Object object); 94lua_CFunction lua_getcfunction (lua_Object object);
95void *lua_getuserdata (lua_Object object); 95void *lua_getuserdata (lua_Object object);
96 96
97 97
98void lua_pushnil (void); 98void lua_pushnil (void);
99void lua_pushnumber (double n); 99void lua_pushnumber (double n);
100void lua_pushlstr (char *s, long len); 100void lua_pushlstring (char *s, long len);
101void lua_pushstring (char *s); 101void lua_pushstring (char *s);
102void lua_pushCclosure (lua_CFunction fn, int n); 102void lua_pushCclosure (lua_CFunction fn, int n);
103void lua_pushusertag (void *u, int tag); 103void lua_pushusertag (void *u, int tag);