MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / str_reverse

Function str_reverse

libraries/AP_Scripting/lua/src/lstrlib.c:91–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89
90
91static int str_reverse (lua_State *L) {
92 size_t l, i;
93 luaL_Buffer b;
94 const char *s = luaL_checklstring(L, 1, &l);
95 char *p = luaL_buffinitsize(L, &b, l);
96 for (i = 0; i < l; i++)
97 p[i] = s[l - i - 1];
98 luaL_pushresultsize(&b, l);
99 return 1;
100}
101
102
103static int str_lower (lua_State *L) {

Callers

nothing calls this directly

Calls 3

luaL_checklstringFunction · 0.85
luaL_buffinitsizeFunction · 0.85
luaL_pushresultsizeFunction · 0.85

Tested by

no test coverage detected