Lines Matching refs:scriptRun
30 #define STACK_IS_EMPTY(scriptRun) ((scriptRun)->pushCount <= 0) argument
31 #define STACK_IS_NOT_EMPTY(scriptRun) (! STACK_IS_EMPTY(scriptRun)) argument
32 #define TOP(scriptRun) ((scriptRun)->parenStack[(scriptRun)->parenSP]) argument
33 #define SYNC_FIXUP(scriptRun) ((scriptRun)->fixupCount = 0) argument
78 static void push(UScriptRun *scriptRun, int32_t pairIndex, UScriptCode scriptCode) in push() argument
80 scriptRun->pushCount = LIMIT_INC(scriptRun->pushCount); in push()
81 scriptRun->fixupCount = LIMIT_INC(scriptRun->fixupCount); in push()
83 scriptRun->parenSP = INC1(scriptRun->parenSP); in push()
84 scriptRun->parenStack[scriptRun->parenSP].pairIndex = pairIndex; in push()
85 scriptRun->parenStack[scriptRun->parenSP].scriptCode = scriptCode; in push()
88 static void pop(UScriptRun *scriptRun) in pop() argument
90 if (STACK_IS_EMPTY(scriptRun)) { in pop()
94 if (scriptRun->fixupCount > 0) { in pop()
95 scriptRun->fixupCount -= 1; in pop()
98 scriptRun->pushCount -= 1; in pop()
99 scriptRun->parenSP = DEC1(scriptRun->parenSP); in pop()
104 if (STACK_IS_EMPTY(scriptRun)) { in pop()
105 scriptRun->parenSP = -1; in pop()
109 static void fixup(UScriptRun *scriptRun, UScriptCode scriptCode) in fixup() argument
111 int32_t fixupSP = DEC(scriptRun->parenSP, scriptRun->fixupCount); in fixup()
113 while (scriptRun->fixupCount-- > 0) { in fixup()
115 scriptRun->parenStack[fixupSP].scriptCode = scriptCode; in fixup()
219 uscript_closeRun(UScriptRun *scriptRun) in uscript_closeRun() argument
221 if (scriptRun != NULL) { in uscript_closeRun()
222 uprv_free(scriptRun); in uscript_closeRun()
227 uscript_resetRun(UScriptRun *scriptRun) in uscript_resetRun() argument
229 if (scriptRun != NULL) { in uscript_resetRun()
230 scriptRun->scriptStart = 0; in uscript_resetRun()
231 scriptRun->scriptLimit = 0; in uscript_resetRun()
232 scriptRun->scriptCode = USCRIPT_INVALID_CODE; in uscript_resetRun()
233 scriptRun->parenSP = -1; in uscript_resetRun()
234 scriptRun->pushCount = 0; in uscript_resetRun()
235 scriptRun->fixupCount = 0; in uscript_resetRun()
240 uscript_setRunText(UScriptRun *scriptRun, const UChar *src, int32_t length, UErrorCode *pErrorCode) in uscript_setRunText() argument
246 if (scriptRun == NULL || length < 0 || ((src == NULL) != (length == 0))) { in uscript_setRunText()
251 scriptRun->textArray = src; in uscript_setRunText()
252 scriptRun->textLength = length; in uscript_setRunText()
254 uscript_resetRun(scriptRun); in uscript_setRunText()
258 uscript_nextRun(UScriptRun *scriptRun, int32_t *pRunStart, int32_t *pRunLimit, UScriptCode *pRunScr… in uscript_nextRun() argument
263 if (scriptRun == NULL || scriptRun->scriptLimit >= scriptRun->textLength) { in uscript_nextRun()
267 SYNC_FIXUP(scriptRun); in uscript_nextRun()
268 scriptRun->scriptCode = USCRIPT_COMMON; in uscript_nextRun()
270 …for (scriptRun->scriptStart = scriptRun->scriptLimit; scriptRun->scriptLimit < scriptRun->textLeng… in uscript_nextRun()
271 UChar high = scriptRun->textArray[scriptRun->scriptLimit]; in uscript_nextRun()
280 … if (high >= 0xD800 && high <= 0xDBFF && scriptRun->scriptLimit < scriptRun->textLength - 1) { in uscript_nextRun()
281 UChar low = scriptRun->textArray[scriptRun->scriptLimit + 1]; in uscript_nextRun()
289 scriptRun->scriptLimit += 1; in uscript_nextRun()
306 push(scriptRun, pairIndex, scriptRun->scriptCode); in uscript_nextRun()
310 while (STACK_IS_NOT_EMPTY(scriptRun) && TOP(scriptRun).pairIndex != pi) { in uscript_nextRun()
311 pop(scriptRun); in uscript_nextRun()
314 if (STACK_IS_NOT_EMPTY(scriptRun)) { in uscript_nextRun()
315 sc = TOP(scriptRun).scriptCode; in uscript_nextRun()
320 if (sameScript(scriptRun->scriptCode, sc)) { in uscript_nextRun()
321 if (scriptRun->scriptCode <= USCRIPT_INHERITED && sc > USCRIPT_INHERITED) { in uscript_nextRun()
322 scriptRun->scriptCode = sc; in uscript_nextRun()
324 fixup(scriptRun, scriptRun->scriptCode); in uscript_nextRun()
332 pop(scriptRun); in uscript_nextRun()
340 scriptRun->scriptLimit -= 1; in uscript_nextRun()
349 *pRunStart = scriptRun->scriptStart; in uscript_nextRun()
353 *pRunLimit = scriptRun->scriptLimit; in uscript_nextRun()
357 *pRunScript = scriptRun->scriptCode; in uscript_nextRun()