MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / luaL_addgsub

Function luaL_addgsub

xrepo/packages/l/lua/port/lua/src/lauxlib.c:988–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

986
987
988LUALIB_API void luaL_addgsub (luaL_Buffer *b, const char *s,
989 const char *p, const char *r) {
990 const char *wild;
991 size_t l = strlen(p);
992 while ((wild = strstr(s, p)) != NULL) {
993 luaL_addlstring(b, s, wild - s); /* push prefix */
994 luaL_addstring(b, r); /* push replacement in place of pattern */
995 s = wild + l; /* continue after 'p' */
996 }
997 luaL_addstring(b, s); /* push last suffix */
998}
999
1000
1001LUALIB_API const char *luaL_gsub (lua_State *L, const char *s,

Callers 3

luaL_gsubFunction · 0.85
pusherrornotfoundFunction · 0.85
searchpathFunction · 0.85

Calls 2

luaL_addstringFunction · 0.85
luaL_addlstringFunction · 0.70

Tested by

no test coverage detected