| 94 | |
| 95 | |
| 96 | static 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 | |
| 109 | static int str_upper (lua_State *L) { |
nothing calls this directly
no test coverage detected