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

Function str_lower

depends/lua/src/lstrlib.c:96–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94
95
96static int str_lower (lua_State *L) {
97 size_t l;
98 size_t 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] = tolower(uchar(s[i]));
104 luaL_pushresultsize(&b, l);
105 return 1;
106}
107
108
109static int str_upper (lua_State *L) {

Callers

nothing calls this directly

Calls 4

luaL_checklstringFunction · 0.85
luaL_buffinitsizeFunction · 0.85
tolowerFunction · 0.85
luaL_pushresultsizeFunction · 0.85

Tested by

no test coverage detected