aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
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 /lstrlib.c
parent88a2023c3285c4514519158fba90e644fc6ffca3 (diff)
downloadlua-043c2ac2584ee14865c41cbc07addd55f284e0a3.tar.gz
lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.tar.bz2
lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.zip
new names for "lua_pushlstr" and "lua_getstrlen"
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c10
1 files changed, 5 insertions, 5 deletions
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();