| 106 | |
| 107 | |
| 108 | static int str_upper(lua_State *L) { |
| 109 | size_t l; |
| 110 | size_t i; |
| 111 | luaL_Buffer b; |
| 112 | const char *s = luaL_checklstring(L, 1, &l); |
| 113 | char *p = luaL_buffinitsize(L, &b, l); |
| 114 | for (i = 0; i < l; i++) |
| 115 | p[i] = toupper(uchar(s[i])); |
| 116 | luaL_pushresultsize(&b, l); |
| 117 | return 1; |
| 118 | } |
| 119 | |
| 120 | |
| 121 | static int str_rep(lua_State *L) { |
nothing calls this directly
no test coverage detected