• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/ICU-511.35/icuSources/common/

Lines Matching defs:converter

150 and created from a converter that is shared across threads.
194 UTRACE_DATA3(UTRACE_OPEN_CLOSE, "clone converter %s at %p into stackBuffer %p",
291 Checking whether it's an algorithic converter is okay
305 toUArgs.converter = fromUArgs.converter = localConverter;
321 ucnv_close (UConverter * converter)
327 if (converter == NULL)
333 UTRACE_DATA3(UTRACE_OPEN_CLOSE, "close converter %s at %p, isCopyLocal=%b",
334 ucnv_getName(converter, &errorCode), converter, converter->isCopyLocal);
339 /* first, notify the callback functions that the converter is closed */
340 if (converter->fromCharErrorBehaviour != UCNV_TO_U_DEFAULT_CALLBACK) {
352 toUArgs.converter = converter;
354 converter->fromCharErrorBehaviour(converter->toUContext, &toUArgs, NULL, 0, UCNV_CLOSE, &errorCode);
356 if (converter->fromUCharErrorBehaviour != UCNV_FROM_U_DEFAULT_CALLBACK) {
367 fromUArgs.converter = converter;
369 converter->fromUCharErrorBehaviour(converter->fromUContext, &fromUArgs, NULL, 0, 0, UCNV_CLOSE, &errorCode);
372 if (converter->sharedData->impl->close != NULL) {
373 converter->sharedData->impl->close(converter);
376 if (converter->subChars != (uint8_t *)converter->subUChars) {
377 uprv_free(converter->subChars);
381 Checking whether it's an algorithic converter is okay
385 if (converter->sharedData->referenceCounter != ~0) {
386 ucnv_unloadSharedDataIfReady(converter->sharedData);
389 if(!converter->isCopyLocal){
390 uprv_free(converter);
419 ucnv_getSubstChars (const UConverter * converter,
427 if (converter->subCharLen <= 0) {
433 if (*len < converter->subCharLen) /*not enough space in subChars */
439 uprv_memcpy (mySubChar, converter->subChars, converter->subCharLen); /*fills in the subchars */
440 *len = converter->subCharLen; /*store # of bytes copied to buffer */
444 ucnv_setSubstChars (UConverter * converter,
453 if ((len > converter->sharedData->staticData->maxBytesPerChar)
454 || (len < converter->sharedData->staticData->minBytesPerChar))
460 uprv_memcpy (converter->subChars, mySubChar, len); /*copies the subchars */
461 converter->subCharLen = len; /*sets the new len */
468 converter->subChar1 = 0;
501 /* The converter is not stateful. Store the charset bytes as a fixed string. */
505 * The converter has a non-default writeSub() function, indicating
512 * Should not occur. The converter should output at least one byte
560 /*resets the internal states of a converter
561 *goal : have the same behaviour than a freshly created converter
563 static void _reset(UConverter *converter, UConverterResetChoice choice,
565 if(converter == NULL) {
570 /* first, notify the callback functions that the converter is reset */
573 if(choice<=UCNV_RESET_TO_UNICODE && converter->fromCharErrorBehaviour != UCNV_TO_U_DEFAULT_CALLBACK) {
584 toUArgs.converter = converter;
586 converter->fromCharErrorBehaviour(converter->toUContext, &toUArgs, NULL, 0, UCNV_RESET, &errorCode);
588 if(choice!=UCNV_RESET_TO_UNICODE && converter->fromUCharErrorBehaviour != UCNV_FROM_U_DEFAULT_CALLBACK) {
599 fromUArgs.converter = converter;
601 converter->fromUCharErrorBehaviour(converter->fromUContext, &fromUArgs, NULL, 0, 0, UCNV_RESET, &errorCode);
605 /* now reset the converter itself */
607 converter->toUnicodeStatus = converter->sharedData->toUnicodeStatus;
608 converter->mode = 0;
609 converter->toULength = 0;
610 converter->invalidCharLength = converter->UCharErrorBufferLength = 0;
611 converter->preToULength = 0;
614 converter->fromUnicodeStatus = 0;
615 converter->fromUChar32 = 0;
616 converter->invalidUCharLength = converter->charErrorBufferLength = 0;
617 converter->preFromUFirstCP = U_SENTINEL;
618 converter->preFromULength = 0;
621 if (converter->sharedData->impl->reset != NULL) {
623 converter->sharedData->impl->reset(converter, choice);
628 ucnv_reset(UConverter *converter)
630 _reset(converter, UCNV_RESET_BOTH, TRUE);
634 ucnv_resetToUnicode(UConverter *converter)
636 _reset(converter, UCNV_RESET_TO_UNICODE, TRUE);
640 ucnv_resetFromUnicode(UConverter *converter)
642 _reset(converter, UCNV_RESET_FROM_UNICODE, TRUE);
646 ucnv_getMaxCharSize (const UConverter * converter)
648 return converter->maxBytesPerUChar;
653 ucnv_getMinCharSize (const UConverter * converter)
655 return converter->sharedData->staticData->minBytesPerChar;
659 ucnv_getName (const UConverter * converter, UErrorCode * err)
664 if(converter->sharedData->impl->getName){
665 const char* temp= converter->sharedData->impl->getName(converter);
669 return converter->sharedData->staticData->name;
673 ucnv_getCCSID(const UConverter * converter,
680 ccsid = converter->sharedData->staticData->codepage;
684 const char *standardName = ucnv_getStandardName(ucnv_getName(converter, err), "IBM", err);
697 ucnv_getPlatform (const UConverter * converter,
703 return (UConverterPlatform)converter->sharedData->staticData->platform;
707 ucnv_getToUCallBack (const UConverter * converter,
711 *action = converter->fromCharErrorBehaviour;
712 *context = converter->toUContext;
716 ucnv_getFromUCallBack (const UConverter * converter,
720 *action = converter->fromUCharErrorBehaviour;
721 *context = converter->fromUContext;
725 ucnv_setToUCallBack (UConverter * converter,
734 if (oldAction) *oldAction = converter->fromCharErrorBehaviour;
735 converter->fromCharErrorBehaviour = newAction;
736 if (oldContext) *oldContext = converter->toUContext;
737 converter->toUContext = newContext;
741 ucnv_setFromUCallBack (UConverter * converter,
750 if (oldAction) *oldAction = converter->fromUCharErrorBehaviour;
751 converter->fromUCharErrorBehaviour = newAction;
752 if (oldContext) *oldContext = converter->fromUContext;
753 converter->fromUContext = newContext;
809 * source units, then they must be "replayed", i.e., fed back into the converter.
818 * It is conceivable that a callback function could call the converter
842 cnv=pArgs->converter;
847 /* get the converter implementation function */
907 * set a flag for whether the converter
944 * if a converter handles offsets and updates the offsets
1028 /* reset the converter without calling the callback function */
1089 /* set the converter state to deal with the next character */
1252 /* prepare the converter arguments */
1253 args.converter=cnv;
1287 cnv=pArgs->converter;
1292 /* get the converter implementation function */
1352 * set a flag for whether the converter
1389 * if a converter handles offsets and updates the offsets
1473 /* reset the converter without calling the callback function */
1532 /* set the converter state to deal with the next character */
1698 /* prepare the converter arguments */
1699 args.converter=cnv;
1905 * in case the converter outputs single surrogates from complete
1913 * do not simply return even if s==sourceLimit because the converter may
1917 /* prepare the converter arguments */
1918 args.converter=cnv;
1940 /* reset the converter without calling the callback function */
2178 /* prepare the converter arguments */
2179 fromUArgs.converter=targetCnv;
2186 toUArgs.converter=sourceCnv;
2553 /* create the algorithmic converter */
2560 /* reset the other converter */
2608 ucnv_getType(const UConverter* converter)
2610 int8_t type = converter->sharedData->staticData->conversionType;
2613 return ucnv_MBCSGetType(converter);
2620 ucnv_getStarters(const UConverter* converter,
2628 if(converter->sharedData->impl->getStarters != NULL) {
2629 converter->sharedData->impl->getStarters(converter, starters, err);
2701 ucnv_getInvalidChars (const UConverter * converter,
2710 if (len == NULL || errBytes == NULL || converter == NULL)
2715 if (*len < converter->invalidCharLength)
2720 if ((*len = converter->invalidCharLength) > 0)
2722 uprv_memcpy (errBytes, converter->invalidCharBuffer, *len);
2727 ucnv_getInvalidUChars (const UConverter * converter,
2736 if (len == NULL || errChars == NULL || converter == NULL)
2741 if (*len < converter->invalidUCharLength)
2746 if ((*len = converter->invalidUCharLength) > 0)
2748 uprv_memcpy (errChars, converter->invalidUCharBuffer, sizeof(UChar) * (*len));