| 82 | |
| 83 | |
| 84 | static 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 | |
| 96 | static int str_lower (lua_State *L) { |
nothing calls this directly
no test coverage detected