Lines Matching refs:match
109 * or if the match length fits with the current converter state
111 #define UCNV_EXT_TO_U_VERIFY_SISO_MATCH(sisoState, match) \
112 ((sisoState)<0 || ((sisoState)==0) == (match==1))
133 return 0; /* no extension data, no match */
146 return 0; /* no match of a DBCS sequence in SBCS mode */
159 /* match input units until there is a full match or the input is consumed */
173 /* remember longest match so far */
178 /* match pre[] then src[] */
184 /* all input consumed, partial match */
187 * end of the entire input stream, stop with the longest match so far
188 * or: partial match must not be longer than UCNV_EXT_MAX_BYTES
201 /* no match here, stop with the longest match so far */
205 /* partial match, continue */
212 /* full match, stop with result */
216 /* full match on fallback not taken, stop with the longest match so far */
224 /* no match at all */
284 int32_t match;
286 /* try to match */
287 match=ucnv_extMatchToU(cx, (int8_t)UCNV_SISO_STATE(cnv),
292 if(match>0) {
294 *src+=match-firstLength;
303 } else if(match<0) {
304 /* save state for partial match */
317 match=-match;
318 for(; j<match; ++j) {
322 cnv->preToULength=(int8_t)match;
324 } else /* match==0 no match */ {
334 int32_t match;
340 /* try to match */
341 match=ucnv_extMatchToU(cx, -1,
346 if(match==length) {
354 * return no match because
355 * - match>0 && value points to string: simple conversion cannot handle multiple code points
356 * - match>0 && match!=length: not all input consumed, forbidden for this function
357 * - match==0: no match found in the first place
358 * - match<0: partial match, not supported for simple conversion (and flush==TRUE)
364 * continue partial match with new input
372 int32_t match, length;
374 match=ucnv_extMatchToU(cnv->sharedData->mbcs.extIndexes, (int8_t)UCNV_SISO_STATE(cnv),
379 if(match>0) {
380 if(match>=cnv->preToULength) {
382 pArgs->source+=match-cnv->preToULength;
385 /* the match did not use all of preToU[] - keep the rest for replay */
386 length=cnv->preToULength-match;
387 uprv_memmove(cnv->preToU, cnv->preToU+match, length);
397 } else if(match<0) {
398 /* save state for partial match */
404 match=-match;
405 for(j=cnv->preToULength; j<match; ++j) {
409 cnv->preToULength=(int8_t)match;
410 } else /* match==0 */ {
412 * no match
510 match; !initialMatch: partial match with them
512 * @param src UChars that can be used to complete a match
514 * @param pMatchValue [out] output result value for the match from the data structure
517 * @return >1: matched, return value=total match length (number of input units matched)
520 * 0: no match
521 * <0: partial match, return value=negative total match length
545 return 0; /* no extension data, no match */
571 /* partial match, enter the loop below */
583 /* match input units until there is a full match or the input is consumed */
593 /* remember longest match so far */
598 /* match pre[] then src[] */
604 /* all input consumed, partial match */
607 * end of the entire input stream, stop with the longest match so far
608 * or: partial match must not be longer than UCNV_EXT_MAX_UCHARS
621 /* no match here, stop with the longest match so far */
626 /* partial match, continue */
630 /* full match, stop with result */
634 /* full match on fallback not taken, stop with the longest match so far */
642 /* no match at all */
647 /* full match, stop with result */
752 int32_t match;
754 /* try to match */
755 match=ucnv_extMatchFromU(cx, cp,
761 /* reject a match if the result is a single byte for DBCS-only */
762 if( match>=2 &&
767 *src+=match-2; /* remove 2 for the initial code point */
776 } else if(match<0) {
777 /* save state for partial match */
786 match=-match-2; /* remove 2 for the initial code point */
787 for(j=0; j<match; ++j) {
791 cnv->preFromULength=(int8_t)match;
793 } else if(match==1) {
797 } else /* match==0 no match */ {
811 int32_t match;
813 /* try to match */
814 match=ucnv_extMatchFromU(cx,
820 if(match>=2) {
847 * return no match because
848 * - match>1 && resultLength>4: result too long for simple conversion
849 * - match==1: no match found, <subchar1> preferred
850 * - match==0: no match found in the first place
851 * - match<0: partial match, not supported for simple conversion (and flush==TRUE)
857 * continue partial match with new input, requires cnv->preFromUFirstCP>=0
865 int32_t match;
867 match=ucnv_extMatchFromU(cnv->sharedData->mbcs.extIndexes,
873 if(match>=2) {
874 match-=2; /* remove 2 for the initial code point */
876 if(match>=cnv->preFromULength) {
878 pArgs->source+=match-cnv->preFromULength;
881 /* the match did not use all of preFromU[] - keep the rest for replay */
882 int32_t length=cnv->preFromULength-match;
883 uprv_memmove(cnv->preFromU, cnv->preFromU+match, length*U_SIZEOF_UCHAR);
887 /* finish the partial match */
896 } else if(match<0) {
897 /* save state for partial match */
903 match=-match-2; /* remove 2 for the initial code point */
904 for(j=cnv->preFromULength; j<match; ++j) {
909 cnv->preFromULength=(int8_t)match;
910 } else /* match==0 or 1 */ {
912 * no match
929 if(match==1) {