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

Function gmatch

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

Source from the content-addressed store, hash-verified

694
695
696static int gmatch (lua_State *L) {
697 size_t ls, lp;
698 const char *s = luaL_checklstring(L, 1, &ls);
699 const char *p = luaL_checklstring(L, 2, &lp);
700 GMatchState *gm;
701 lua_settop(L, 2); /* keep them on closure to avoid being collected */
702 gm = (GMatchState *)lua_newuserdata(L, sizeof(GMatchState));
703 prepstate(&gm->ms, L, s, ls, p, lp);
704 gm->src = s; gm->p = p; gm->lastmatch = NULL;
705 lua_pushcclosure(L, gmatch_aux, 3);
706 return 1;
707}
708
709
710static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,

Callers

nothing calls this directly

Calls 5

luaL_checklstringFunction · 0.85
lua_settopFunction · 0.85
lua_newuserdataFunction · 0.85
prepstateFunction · 0.85
lua_pushcclosureFunction · 0.85

Tested by

no test coverage detected