| 165 | |
| 166 | |
| 167 | static int str_char (lua_State *L) { |
| 168 | int n = lua_gettop(L); /* number of arguments */ |
| 169 | int i; |
| 170 | luaL_Buffer b; |
| 171 | char *p = luaL_buffinitsize(L, &b, n); |
| 172 | for (i=1; i<=n; i++) { |
| 173 | lua_Integer c = luaL_checkinteger(L, i); |
| 174 | luaL_argcheck(L, uchar(c) == c, i, "value out of range"); |
| 175 | p[i - 1] = uchar(c); |
| 176 | } |
| 177 | luaL_pushresultsize(&b, n); |
| 178 | return 1; |
| 179 | } |
| 180 | |
| 181 | |
| 182 | static int writer (lua_State *L, const void *b, size_t size, void *B) { |
nothing calls this directly
no test coverage detected