Home | History | Annotate | Download | only in common

Lines Matching refs:match

108  * or if the match length fits with the current converter state
110 #define UCNV_EXT_TO_U_VERIFY_SISO_MATCH(sisoState, match) \
111 ((sisoState)<0 || ((sisoState)==0) == (match==1))
132 return 0; /* no extension data, no match */
145 return 0; /* no match of a DBCS sequence in SBCS mode */
158 /* match input units until there is a full match or the input is consumed */
172 /* remember longest match so far */
177 /* match pre[] then src[] */
183 /* all input consumed, partial match */
186 * end of the entire input stream, stop with the longest match so far
187 * or: partial match must not be longer than UCNV_EXT_MAX_BYTES
200 /* no match here, stop with the longest match so far */
204 /* partial match, continue */
211 /* full match, stop with result */
215 /* full match on fallback not taken, stop with the longest match so far */
223 /* no match at all */
283 int32_t match;
285 /* try to match */
286 match=ucnv_extMatchToU(cx, (int8_t)UCNV_SISO_STATE(cnv),
291 if(match>0) {
293 *src+=match-firstLength;
302 } else if(match<0) {
303 /* save state for partial match */
316 match=-match;
317 for(; j<match; ++j) {
321 cnv->preToULength=(int8_t)match;
323 } else /* match==0 no match */ {
333 int32_t match;
339 /* try to match */
340 match=ucnv_extMatchToU(cx, -1,
345 if(match==length) {
353 * return no match because
354 * - match>0 && value points to string: simple conversion cannot handle multiple code points
355 * - match>0 && match!=length: not all input consumed, forbidden for this function
356 * - match==0: no match found in the first place
357 * - match<0: partial match, not supported for simple conversion (and flush==TRUE)
363 * continue partial match with new input
371 int32_t match, length;
373 match=ucnv_extMatchToU(cnv->sharedData->mbcs.extIndexes, (int8_t)UCNV_SISO_STATE(cnv),
378 if(match>0) {
379 if(match>=cnv->preToULength) {
381 pArgs->source+=match-cnv->preToULength;
384 /* the match did not use all of preToU[] - keep the rest for replay */
385 length=cnv->preToULength-match;
386 uprv_memmove(cnv->preToU, cnv->preToU+match, length);
396 } else if(match<0) {
397 /* save state for partial match */
403 match=-match;
404 for(j=cnv->preToULength; j<match; ++j) {
408 cnv->preToULength=(int8_t)match;
409 } else /* match==0 */ {
411 * no match
500 * @param pre UChars that must match; !initialMatch: partial match with them
502 * @param src UChars that can be used to complete a match
504 * @param pMatchValue [out] output result value for the match from the data structure
507 * @return >1: matched, return value=total match length (number of input units matched)
510 * 0: no match
511 * <0: partial match, return value=negative total match length
535 return 0; /* no extension data, no match */
561 /* partial match, enter the loop below */
573 /* match input units until there is a full match or the input is consumed */
587 /* remember longest match so far */
592 /* match pre[] then src[] */
598 /* all input consumed, partial match */
601 * end of the entire input stream, stop with the longest match so far
602 * or: partial match must not be longer than UCNV_EXT_MAX_UCHARS
615 /* no match here, stop with the longest match so far */
620 /* partial match, continue */
627 /* full match, stop with result */
631 /* full match on fallback not taken, stop with the longest match so far */
639 /* 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) {
908 cnv->preFromULength=(int8_t)match;
909 } else /* match==0 or 1 */ {
911 * no match
928 if(match==1) {