فهرست منبع

new names for "lua_pushlstr" and "lua_getstrlen"

Roberto Ierusalimschy 27 سال پیش
والد
کامیت
043c2ac258
5فایلهای تغییر یافته به همراه16 افزوده شده و 16 حذف شده
  1. 4 4
      lapi.c
  2. 2 2
      lauxlib.c
  3. 2 2
      liolib.c
  4. 5 5
      lstrlib.c
  5. 3 3
      lua.h

+ 4 - 4
lapi.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lapi.c,v 1.21 1998/02/12 19:23:32 roberto Exp roberto $
+** $Id: lapi.c,v 1.22 1998/03/06 16:54:42 roberto Exp roberto $
 ** Lua API
 ** See Copyright Notice in lua.h
 */
@@ -293,7 +293,7 @@ char *lua_getstring (lua_Object object)
   else return (svalue(Address(object)));
 }
 
-long lua_getstrlen (lua_Object object)
+long lua_strlen (lua_Object object)
 {
   luaC_checkGC();  /* "tostring" may create a new string */
   if (object == LUA_NOOBJECT || tostring(Address(object)))
@@ -329,7 +329,7 @@ void lua_pushnumber (double n)
   incr_top;
 }
 
-void lua_pushlstr (char *s, long len)
+void lua_pushlstring (char *s, long len)
 {
   tsvalue(L->stack.top) = luaS_newlstr(s, len);
   ttype(L->stack.top) = LUA_T_STRING;
@@ -342,7 +342,7 @@ void lua_pushstring (char *s)
   if (s == NULL)
     lua_pushnil();
   else
-    lua_pushlstr(s, strlen(s));
+    lua_pushlstring(s, strlen(s));
 }
 
 void lua_pushCclosure (lua_CFunction fn, int n)

+ 2 - 2
lauxlib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lauxlib.c,v 1.8 1998/01/09 15:09:53 roberto Exp roberto $
+** $Id: lauxlib.c,v 1.9 1998/03/06 16:54:42 roberto Exp roberto $
 ** Auxiliar functions for building Lua libraries
 ** See Copyright Notice in lua.h
 */
@@ -35,7 +35,7 @@ char *luaL_check_lstr (int numArg, long *len)
 {
   lua_Object o = lua_getparam(numArg);
   luaL_arg_check(lua_isstring(o), numArg, "string expected");
-  if (len) *len = lua_getstrlen(o);
+  if (len) *len = lua_strlen(o);
   return lua_getstring(o);
 }
 

+ 2 - 2
liolib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: liolib.c,v 1.14 1998/01/07 16:26:48 roberto Exp roberto $
+** $Id: liolib.c,v 1.15 1998/03/06 16:54:42 roberto Exp roberto $
 ** Standard I/O (and system) library
 ** See Copyright Notice in lua.h
 */
@@ -233,7 +233,7 @@ static void io_read (void)
      ungetc(c, f);
   l = luaL_getsize();
   if (l > 0 || *p == 0)  /* read something or did not fail? */
-    lua_pushlstr(luaL_buffer(), l);
+    lua_pushlstring(luaL_buffer(), l);
 }
 
 

+ 5 - 5
lstrlib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lstrlib.c,v 1.8 1998/01/27 19:11:36 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.9 1998/03/06 16:54:42 roberto Exp roberto $
 ** Standard library for strings and pattern-matching
 ** See Copyright Notice in lua.h
 */
@@ -34,7 +34,7 @@ static void str_len (void)
 
 static void closeandpush (void)
 {
-  lua_pushlstr(luaL_buffer(), luaL_getsize());
+  lua_pushlstring(luaL_buffer(), luaL_getsize());
 }
 
 
@@ -52,7 +52,7 @@ static void str_sub (void)
   long start = posrelat(luaL_check_number(2), l);
   long end = posrelat(luaL_opt_number(3, -1), l);
   if (1 <= start && start <= end && end <= l)
-    lua_pushlstr(s+start-1, end-start+1);
+    lua_pushlstring(s+start-1, end-start+1);
   else lua_pushstring("");
 }
 
@@ -128,7 +128,7 @@ static void push_captures (struct Capture *cap)
 {
   int i;
   for (i=0; i<cap->level; i++)
-    lua_pushlstr(cap->capture[i].init, cap->capture[i].len);
+    lua_pushlstring(cap->capture[i].init, cap->capture[i].len);
 }
 
 
@@ -379,7 +379,7 @@ static void add_s (lua_Object newp, struct Capture *cap)
     }
     res = lua_getresult(1);
     if (lua_isstring(res))
-      addnchar(lua_getstring(res), lua_getstrlen(res));
+      addnchar(lua_getstring(res), lua_strlen(res));
     else
       addnchar(NULL, 0);
     lua_endblock();

+ 3 - 3
lua.h

@@ -1,5 +1,5 @@
 /*
-** $Id: lua.h,v 1.15 1998/02/12 19:23:32 roberto Exp roberto $
+** $Id: lua.h,v 1.16 1998/03/06 16:54:42 roberto Exp roberto $
 ** Lua - An Extensible Extension Language
 ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
 ** e-mail: [email protected]
@@ -90,14 +90,14 @@ int            lua_isfunction           (lua_Object object);
 
 double         lua_getnumber 		(lua_Object object);
 char          *lua_getstring 		(lua_Object object);
-long           lua_getstrlen 		(lua_Object object);
+long           lua_strlen 		(lua_Object object);
 lua_CFunction  lua_getcfunction 	(lua_Object object);
 void	      *lua_getuserdata		(lua_Object object);
 
 
 void 	       lua_pushnil 		(void);
 void           lua_pushnumber 		(double n);
-void           lua_pushlstr 		(char *s, long len);
+void           lua_pushlstring		(char *s, long len);
 void           lua_pushstring 		(char *s);
 void           lua_pushCclosure		(lua_CFunction fn, int n);
 void           lua_pushusertag          (void *u, int tag);