MCPcopy Create free account
hub / github.com/F-Stack/f-stack / str_reverse

Function str_reverse

freebsd/contrib/openzfs/module/lua/lstrlib.c:77–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

luaL_buffinitsizeFunction · 0.85
luaL_pushresultsizeFunction · 0.85
luaL_checklstringFunction · 0.70

Tested by

no test coverage detected