| 150 | |
| 151 | |
| 152 | static int str_char (lua_State *L) { |
| 153 | int n = lua_gettop(L); /* number of arguments */ |
| 154 | int i; |
| 155 | luaL_Buffer b; |
| 156 | char *p = luaL_buffinitsize(L, &b, n); |
| 157 | for (i=1; i<=n; i++) { |
| 158 | int c = luaL_checkint(L, i); |
| 159 | luaL_argcheck(L, uchar(c) == c, i, "value out of range"); |
| 160 | p[i - 1] = uchar(c); |
| 161 | } |
| 162 | luaL_pushresultsize(&b, n); |
| 163 | return 1; |
| 164 | } |
| 165 | |
| 166 | |
| 167 | static int writer (lua_State *L, const void* b, size_t size, void* B) { |
nothing calls this directly
no test coverage detected