MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / str_reverse

Function str_reverse

ThirdParty/lua/lua/lstrlib.c:79–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78
79static int str_reverse (lua_State *L) {
80 size_t l, i;
81 luaL_Buffer b;
82 const char *s = luaL_checklstring(L, 1, &l);
83 char *p = luaL_buffinitsize(L, &b, l);
84 for (i = 0; i < l; i++)
85 p[i] = s[l - i - 1];
86 luaL_pushresultsize(&b, l);
87 return 1;
88}
89
90
91static int str_lower (lua_State *L) {

Callers

nothing calls this directly

Calls 3

luaL_checklstringFunction · 0.85
luaL_buffinitsizeFunction · 0.85
luaL_pushresultsizeFunction · 0.85

Tested by

no test coverage detected