Skip to content

Commit c4e7cdb

Browse files
committed
Renaming two new functions
'lua_numbertostrbuff' -> 'lua_numbertocstring' 'lua_pushextlstring' -> 'lua_pushexternalstring'
1 parent 7d7ae87 commit c4e7cdb

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

lapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
366366
}
367367

368368

369-
LUA_API unsigned (lua_numbertostrbuff) (lua_State *L, int idx, char *buff) {
369+
LUA_API unsigned (lua_numbertocstring) (lua_State *L, int idx, char *buff) {
370370
const TValue *o = index2value(L, idx);
371371
if (ttisnumber(o)) {
372372
unsigned len = luaO_tostringbuff(o, buff);
@@ -546,7 +546,7 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
546546
}
547547

548548

549-
LUA_API const char *lua_pushextlstring (lua_State *L,
549+
LUA_API const char *lua_pushexternalstring (lua_State *L,
550550
const char *s, size_t len, lua_Alloc falloc, void *ud) {
551551
TString *ts;
552552
lua_lock(L);

lauxlib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ LUALIB_API void luaL_pushresult (luaL_Buffer *B) {
622622
resizebox(L, -1, len + 1); /* adjust box size to content size */
623623
s = (char*)box->box; /* final buffer address */
624624
s[len] = '\0'; /* add ending zero */
625-
/* clear box, as 'lua_pushextlstring' will take control over buffer */
625+
/* clear box, as Lua will take control of the buffer */
626626
box->bsize = 0; box->box = NULL;
627-
lua_pushextlstring(L, s, len, allocf, ud);
627+
lua_pushexternalstring(L, s, len, allocf, ud);
628628
lua_closeslot(L, -2); /* close the box */
629629
lua_gc(L, LUA_GCSTEP, len);
630630
}
@@ -929,7 +929,7 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) {
929929
switch (lua_type(L, idx)) {
930930
case LUA_TNUMBER: {
931931
char buff[LUA_N2SBUFFSZ];
932-
lua_numbertostrbuff(L, idx, buff);
932+
lua_numbertocstring(L, idx, buff);
933933
lua_pushstring(L, buff);
934934
break;
935935
}

liolib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ static int g_write (lua_State *L, FILE *f, int arg) {
667667
for (; nargs--; arg++) {
668668
char buff[LUA_N2SBUFFSZ];
669669
const char *s;
670-
size_t len = lua_numbertostrbuff(L, arg, buff); /* try as a number */
670+
size_t len = lua_numbertocstring(L, arg, buff); /* try as a number */
671671
if (len > 0) { /* did conversion work (value was a number)? */
672672
s = buff;
673673
len--;

loadlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static void setpath (lua_State *L, const char *fieldname,
280280
if (path == NULL) /* no versioned environment variable? */
281281
path = getenv(envname); /* try unversioned name */
282282
if (path == NULL || noenv(L)) /* no environment variable? */
283-
lua_pushextlstring(L, dft, strlen(dft), NULL, NULL); /* use default */
283+
lua_pushexternalstring(L, dft, strlen(dft), NULL, NULL); /* use default */
284284
else if ((dftmark = strstr(path, LUA_PATH_SEP LUA_PATH_SEP)) == NULL)
285285
lua_pushstring(L, path); /* nothing to change */
286286
else { /* path contains a ";;": insert default path in its place */

ltests.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ static int checkpanic (lua_State *L) {
13891389
static int externKstr (lua_State *L) {
13901390
size_t len;
13911391
const char *s = luaL_checklstring(L, 1, &len);
1392-
lua_pushextlstring(L, s, len, NULL, NULL);
1392+
lua_pushexternalstring(L, s, len, NULL, NULL);
13931393
return 1;
13941394
}
13951395

@@ -1413,7 +1413,7 @@ static int externstr (lua_State *L) {
14131413
/* copy string content to buffer, including ending 0 */
14141414
memcpy(buff, s, (len + 1) * sizeof(char));
14151415
/* create external string */
1416-
lua_pushextlstring(L, buff, len, allocf, ud);
1416+
lua_pushexternalstring(L, buff, len, allocf, ud);
14171417
return 1;
14181418
}
14191419

lua.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ LUA_API void (lua_pushnil) (lua_State *L);
244244
LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n);
245245
LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n);
246246
LUA_API const char *(lua_pushlstring) (lua_State *L, const char *s, size_t len);
247-
LUA_API const char *(lua_pushextlstring) (lua_State *L,
247+
LUA_API const char *(lua_pushexternalstring) (lua_State *L,
248248
const char *s, size_t len, lua_Alloc falloc, void *ud);
249249
LUA_API const char *(lua_pushstring) (lua_State *L, const char *s);
250250
LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,
@@ -372,7 +372,7 @@ LUA_API void (lua_concat) (lua_State *L, int n);
372372
LUA_API void (lua_len) (lua_State *L, int idx);
373373

374374
#define LUA_N2SBUFFSZ 64
375-
LUA_API unsigned (lua_numbertostrbuff) (lua_State *L, int idx, char *buff);
375+
LUA_API unsigned (lua_numbertocstring) (lua_State *L, int idx, char *buff);
376376
LUA_API size_t (lua_stringtonumber) (lua_State *L, const char *s);
377377

378378
LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);

manual/manual.of

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3829,7 +3829,7 @@ This macro may evaluate its arguments more than once.
38293829

38303830
}
38313831

3832-
@APIEntry{unsigned (lua_numbertostrbuff) (lua_State *L, int idx,
3832+
@APIEntry{unsigned (lua_numbertocstring) (lua_State *L, int idx,
38333833
char *buff);|
38343834
@apii{0,0,-}
38353835

@@ -3955,7 +3955,7 @@ This function is equivalent to @Lid{lua_pushcclosure} with no upvalues.
39553955

39563956
}
39573957

3958-
@APIEntry{const char *(lua_pushextlstring) (lua_State *L,
3958+
@APIEntry{const char *(lua_pushexternalstring) (lua_State *L,
39593959
const char *s, size_t len, lua_Alloc falloc, void *ud);|
39603960
@apii{0,1,m}
39613961

0 commit comments

Comments
 (0)