diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-03-06 15:47:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-03-06 15:47:42 -0300 |
commit | 043c2ac2584ee14865c41cbc07addd55f284e0a3 (patch) | |
tree | 0796c645370e32ba9d6349815e32c87d5c31cf86 | |
parent | 88a2023c3285c4514519158fba90e644fc6ffca3 (diff) | |
download | lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.tar.gz lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.tar.bz2 lua-043c2ac2584ee14865c41cbc07addd55f284e0a3.zip |
new names for "lua_pushlstr" and "lua_getstrlen"
-rw-r--r-- | lapi.c | 8 | ||||
-rw-r--r-- | lauxlib.c | 4 | ||||
-rw-r--r-- | liolib.c | 4 | ||||
-rw-r--r-- | lstrlib.c | 10 | ||||
-rw-r--r-- | lua.h | 6 |
5 files changed, 16 insertions, 16 deletions
@@ -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 | ||
296 | long lua_getstrlen (lua_Object object) | 296 | long 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 | ||
332 | void lua_pushlstr (char *s, long len) | 332 | void 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 | ||
348 | void lua_pushCclosure (lua_CFunction fn, int n) | 348 | void lua_pushCclosure (lua_CFunction fn, int n) |
@@ -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 | ||
@@ -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 | ||
@@ -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 | ||
35 | static void closeandpush (void) | 35 | static 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(); |
@@ -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 | ||
91 | double lua_getnumber (lua_Object object); | 91 | double lua_getnumber (lua_Object object); |
92 | char *lua_getstring (lua_Object object); | 92 | char *lua_getstring (lua_Object object); |
93 | long lua_getstrlen (lua_Object object); | 93 | long lua_strlen (lua_Object object); |
94 | lua_CFunction lua_getcfunction (lua_Object object); | 94 | lua_CFunction lua_getcfunction (lua_Object object); |
95 | void *lua_getuserdata (lua_Object object); | 95 | void *lua_getuserdata (lua_Object object); |
96 | 96 | ||
97 | 97 | ||
98 | void lua_pushnil (void); | 98 | void lua_pushnil (void); |
99 | void lua_pushnumber (double n); | 99 | void lua_pushnumber (double n); |
100 | void lua_pushlstr (char *s, long len); | 100 | void lua_pushlstring (char *s, long len); |
101 | void lua_pushstring (char *s); | 101 | void lua_pushstring (char *s); |
102 | void lua_pushCclosure (lua_CFunction fn, int n); | 102 | void lua_pushCclosure (lua_CFunction fn, int n); |
103 | void lua_pushusertag (void *u, int tag); | 103 | void lua_pushusertag (void *u, int tag); |