| 77 | |
| 78 | |
| 79 | static int str_lower (lua_State *L) { |
| 80 | size_t l; |
| 81 | size_t i; |
| 82 | luaL_Buffer b; |
| 83 | const char *s = luaL_checklstring(L, 1, &l); |
| 84 | char *p = luaL_buffinitsize(L, &b, l); |
| 85 | for (i=0; i<l; i++) |
| 86 | p[i] = tolower(uchar(s[i])); |
| 87 | luaL_pushresultsize(&b, l); |
| 88 | return 1; |
| 89 | } |
| 90 | |
| 91 | |
| 92 | static int str_upper (lua_State *L) { |
nothing calls this directly
no test coverage detected