MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / str_reverse

Function str_reverse

third-party/lua-5.5.0/src/lstrlib.c:97–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96
97static int str_reverse (lua_State *L) {
98 size_t l, i;
99 luaL_Buffer b;
100 const char *s = luaL_checklstring(L, 1, &l);
101 char *p = luaL_buffinitsize(L, &b, l);
102 for (i = 0; i < l; i++)
103 p[i] = s[l - i - 1];
104 luaL_pushresultsize(&b, l);
105 return 1;
106}
107
108
109static int str_lower (lua_State *L) {

Callers

nothing calls this directly

Calls 3

luaL_checklstringFunction · 0.70
luaL_buffinitsizeFunction · 0.70
luaL_pushresultsizeFunction · 0.70

Tested by

no test coverage detected