** utfchar(n1, n2, ...) -> char(n1)..char(n2)... */
| 163 | ** utfchar(n1, n2, ...) -> char(n1)..char(n2)... |
| 164 | */ |
| 165 | static int utfchar (lua_State *L) { |
| 166 | int n = lua_gettop(L); /* number of arguments */ |
| 167 | if (n == 1) /* optimize common case of single char */ |
| 168 | pushutfchar(L, 1); |
| 169 | else { |
| 170 | int i; |
| 171 | luaL_Buffer b; |
| 172 | luaL_buffinit(L, &b); |
| 173 | for (i = 1; i <= n; i++) { |
| 174 | pushutfchar(L, i); |
| 175 | luaL_addvalue(&b); |
| 176 | } |
| 177 | luaL_pushresult(&b); |
| 178 | } |
| 179 | return 1; |
| 180 | } |
| 181 | |
| 182 | |
| 183 | /* |
nothing calls this directly
no test coverage detected