MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / u_posrelat

Function u_posrelat

extlibs/lua/src/lutf8lib.c:43–47  ·  view source on GitHub ↗

from strlib */ translate a relative string position: negative means back from end */

Source from the content-addressed store, hash-verified

41/* from strlib */
42/* translate a relative string position: negative means back from end */
43static lua_Integer u_posrelat (lua_Integer pos, size_t len) {
44 if (pos >= 0) return pos;
45 else if (0u - (size_t)pos > len) return 0;
46 else return (lua_Integer)len + pos + 1;
47}
48
49
50/*

Callers 3

utflenFunction · 0.85
codepointFunction · 0.85
byteoffsetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected