Lines Matching refs:api
33 UCharIterator api; member
69 UCharIterator *api=&uni->api; in initIndexes() local
73 api->start=api->index=api->limit=0; in initIndexes()
78 api->start=api->index=api->limit=uni->capacity; in initIndexes()
83 api->start=api->index=api->limit=uni->capacity/2; in initIndexes()
91 UCharIterator *api=&uni->api; in reallocArrays() local
105 start=api->start; in reallocArrays()
106 limit=api->limit; in reallocArrays()
116 api->start=start+delta; in reallocArrays()
117 api->index+=delta; in reallocArrays()
118 api->limit=limit+delta; in reallocArrays()
132 moveContentsTowardStart(UCharIterator *api, UChar chars[], uint32_t states[], int32_t delta) { in moveContentsTowardStart() argument
136 limit=api->limit; in moveContentsTowardStart()
138 if(srcIndex>api->start) { in moveContentsTowardStart()
146 api->start=destIndex=0; in moveContentsTowardStart()
155 api->limit=destIndex; in moveContentsTowardStart()
159 moveContentsTowardEnd(UCharIterator *api, UChar chars[], uint32_t states[], int32_t delta) { in moveContentsTowardEnd() argument
163 start=api->start; in moveContentsTowardEnd()
164 destIndex=((UNormIterator *)api)->capacity; in moveContentsTowardEnd()
166 if(srcIndex<api->limit) { in moveContentsTowardEnd()
174 api->limit=destIndex; in moveContentsTowardEnd()
184 api->start=destIndex; in moveContentsTowardEnd()
191 UCharIterator *api=&uni->api; in readNext() local
197 limit=api->limit; in readNext()
202 moveContentsTowardStart(api, uni->chars, uni->states, room); in readNext()
203 api->index=limit=api->limit; in readNext()
223 api->start=api->index=api->limit=limit=0; in readNext()
232 limit=api->limit; in readNext()
253 api->limit=limit; in readNext()
261 UCharIterator *api=&uni->api; in readPrevious() local
267 start=api->start; in readPrevious()
272 moveContentsTowardEnd(api, uni->chars, uni->states, room); in readPrevious()
273 api->index=start=api->start; in readPrevious()
293 api->start=api->index=api->limit=start=capacity; in readPrevious()
302 start=api->start; in readPrevious()
324 api->start=start; in readPrevious()
331 unormIteratorGetIndex(UCharIterator *api, UCharIteratorOrigin origin) { in unormIteratorGetIndex() argument
348 unormIteratorMove(UCharIterator *api, int32_t delta, UCharIteratorOrigin origin) { in unormIteratorMove() argument
349 UNormIterator *uni=(UNormIterator *)api; in unormIteratorMove()
359 api->start=api->index=api->limit=0; in unormIteratorMove()
360 uni->states[api->limit]=uni->state=uiter_getState(iter); in unormIteratorMove()
365 api->index=api->start; in unormIteratorMove()
375 api->start=api->index=api->limit=uni->capacity; in unormIteratorMove()
376 uni->states[api->limit]=uni->state=uiter_getState(iter); in unormIteratorMove()
381 api->index=api->limit; in unormIteratorMove()
394 pos=api->index+delta; /* requested position */ in unormIteratorMove()
395 delta=pos-api->limit; /* remainder beyond buffered text */ in unormIteratorMove()
397 api->index=pos; /* position reached */ in unormIteratorMove()
402 api->index=api->limit; in unormIteratorMove()
410 pos=api->index+delta; /* requested position */ in unormIteratorMove()
411 delta=pos-api->start; /* remainder beyond buffered text */ in unormIteratorMove()
413 api->index=pos; /* position reached */ in unormIteratorMove()
418 api->index=api->start; in unormIteratorMove()
425 if(api->index==api->start && !uni->hasPrevious) { in unormIteratorMove()
433 unormIteratorHasNext(UCharIterator *api) { in unormIteratorHasNext() argument
434 return api->index<api->limit || ((UNormIterator *)api)->hasNext; in unormIteratorHasNext()
438 unormIteratorHasPrevious(UCharIterator *api) { in unormIteratorHasPrevious() argument
439 return api->index>api->start || ((UNormIterator *)api)->hasPrevious; in unormIteratorHasPrevious()
443 unormIteratorCurrent(UCharIterator *api) { in unormIteratorCurrent() argument
444 UNormIterator *uni=(UNormIterator *)api; in unormIteratorCurrent()
446 if( api->index<api->limit || in unormIteratorCurrent()
449 return uni->chars[api->index]; in unormIteratorCurrent()
456 unormIteratorNext(UCharIterator *api) { in unormIteratorNext() argument
457 UNormIterator *uni=(UNormIterator *)api; in unormIteratorNext()
459 if( api->index<api->limit || in unormIteratorNext()
462 return uni->chars[api->index++]; in unormIteratorNext()
469 unormIteratorPrevious(UCharIterator *api) { in unormIteratorPrevious() argument
470 UNormIterator *uni=(UNormIterator *)api; in unormIteratorPrevious()
472 if( api->index>api->start || in unormIteratorPrevious()
475 return uni->chars[--api->index]; in unormIteratorPrevious()
482 unormIteratorGetState(const UCharIterator *api) { in unormIteratorGetState() argument
484 return ((UNormIterator *)api)->states[api->index]; in unormIteratorGetState()
488 unormIteratorSetState(UCharIterator *api, uint32_t state, UErrorCode *pErrorCode) { in unormIteratorSetState() argument
491 } else if(api==NULL) { in unormIteratorSetState()
496 UNormIterator *uni=(UNormIterator *)api; in unormIteratorSetState()
497 UCharIterator *iter=((UNormIterator *)api)->iter; in unormIteratorSetState()
509 if(state==uni->states[api->index]) { in unormIteratorSetState()
511 } else if(state==uni->states[api->limit]) { in unormIteratorSetState()
512 api->index=api->limit; in unormIteratorSetState()
518 for(i=api->start; i<api->limit; ++i) { in unormIteratorSetState()
520 api->index=i; in unormIteratorSetState()
527 initIndexes((UNormIterator *)api, iter); in unormIteratorSetState()
528 uni->states[api->limit]=state; in unormIteratorSetState()
597 uiter_setString(&uni->api, NULL, 0); in unorm_openIter()
628 uiter_setString(&uni->api, NULL, 0); in unorm_setIter()
634 uprv_memcpy(&uni->api, &unormIterator, sizeof(unormIterator)); in unorm_setIter()
640 uni->states[uni->api.limit]=uni->state=uiter_getState(iter); in unorm_setIter()
642 return &uni->api; in unorm_setIter()