MCPcopy Create free account
hub / github.com/DFHack/dfhack / str_reverse

Function str_reverse

depends/lua/src/lstrlib.c:84–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83
84static int str_reverse (lua_State *L) {
85 size_t l, i;
86 luaL_Buffer b;
87 const char *s = luaL_checklstring(L, 1, &l);
88 char *p = luaL_buffinitsize(L, &b, l);
89 for (i = 0; i < l; i++)
90 p[i] = s[l - i - 1];
91 luaL_pushresultsize(&b, l);
92 return 1;
93}
94
95
96static 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