MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / str_char

Function str_char

src/Chain/libraries/glua/lstrlib.cpp:166–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
luaL_buffinitsizeFunction · 0.85
luaL_pushresultsizeFunction · 0.85

Tested by

no test coverage detected