Lines Matching refs:posi
75 lua_Integer posi = u_posrelat(luaL_optinteger(L, 2, 1), len); in utflen() local
77 luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 2, in utflen()
81 while (posi <= posj) { in utflen()
82 const char *s1 = utf8_decode(s + posi, NULL); in utflen()
85 lua_pushinteger(L, posi + 1); /* ... and current position */ in utflen()
88 posi = s1 - s; in utflen()
103 lua_Integer posi = u_posrelat(luaL_optinteger(L, 2, 1), len); in codepoint() local
104 lua_Integer pose = u_posrelat(luaL_optinteger(L, 3, posi), len); in codepoint()
107 luaL_argcheck(L, posi >= 1, 2, "out of range"); in codepoint()
109 if (posi > pose) return 0; /* empty interval; return no values */ in codepoint()
110 if (pose - posi >= INT_MAX) /* (lua_Integer -> int) overflow? */ in codepoint()
112 n = (int)(pose - posi) + 1; in codepoint()
116 for (s += posi - 1; s < se;) { in codepoint()
164 lua_Integer posi = (n >= 0) ? 1 : len + 1; in byteoffset() local
165 posi = u_posrelat(luaL_optinteger(L, 3, posi), len); in byteoffset()
166 luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 3, in byteoffset()
170 while (posi > 0 && iscont(s + posi)) posi--; in byteoffset()
173 if (iscont(s + posi)) in byteoffset()
176 while (n < 0 && posi > 0) { /* move back */ in byteoffset()
178 posi--; in byteoffset()
179 } while (posi > 0 && iscont(s + posi)); in byteoffset()
185 while (n > 0 && posi < (lua_Integer)len) { in byteoffset()
187 posi++; in byteoffset()
188 } while (iscont(s + posi)); /* (cannot pass final '\0') */ in byteoffset()
194 lua_pushinteger(L, posi + 1); in byteoffset()