Lines Matching +full:conversion +full:- +full:interval

3 ** Standard library for UTF-8 manipulation
29 #define MSGInvalid "invalid UTF-8 code"
32 ** Integer type for decoded UTF-8 values; MAXUTF needs 31 bits.
49 else if (0u - (size_t)pos > len) return 0; in u_posrelat()
55 ** Decode one UTF-8 sequence, returning NULL if byte sequence is
58 ** entry forces an error for non-ascii bytes with no continuation
92 ** utf8len(s [, i [, j [, lax]]]) --> number of characters that
94 ** well formed in that interval
101 lua_Integer posj = u_posrelat(luaL_optinteger(L, 3, -1), len); in utflen()
103 luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 2, in utflen()
105 luaL_argcheck(L, --posj < (lua_Integer)len, 3, in utflen()
109 if (s1 == NULL) { /* conversion error? */ in utflen()
114 posi = s1 - s; in utflen()
123 ** codepoint(s, [i, [j [, lax]]]) -> returns codepoints for all
136 if (posi > pose) return 0; /* empty interval; return no values */ in codepoint()
137 if (pose - posi >= INT_MAX) /* (lua_Integer -> int) overflow? */ in codepoint()
139 n = (int)(pose - posi) + 1; /* upper bound for number of returns */ in codepoint()
143 for (s += posi - 1; s < se;) { in codepoint()
163 ** utfchar(n1, n2, ...) -> char(n1)..char(n2)...
184 ** offset(s, n, [i]) -> index where n-th character counting from
193 luaL_argcheck(L, 1 <= posi && --posi <= (lua_Integer)len, 3, in byteoffset()
197 while (posi > 0 && iscontp(s + posi)) posi--; in byteoffset()
205 posi--; in byteoffset()
211 n--; /* do not move for 1st character */ in byteoffset()
216 n--; in byteoffset()
269 /* pattern to match a single UTF-8 character */
270 #define UTF8PATT "[\0-\x7F\xC2-\xFD][\x80-\xBF]*"
287 lua_pushlstring(L, UTF8PATT, sizeof(UTF8PATT)/sizeof(char) - 1); in luaopen_utf8()
288 lua_setfield(L, -2, "charpattern"); in luaopen_utf8()