Home | History | Annotate | Download | only in common

Lines Matching full:scsu

35 /* SCSU definitions --------------------------------------------------------- */
37 /* SCSU command byte values */
156 /* SCSU setup functions ----------------------------------------------------- */
160 SCSUData *scsu=(SCSUData *)cnv->extraInfo;
164 uprv_memcpy(scsu->toUDynamicOffsets, initialDynamicOffsets, 32);
166 scsu->toUIsSingleByteMode=TRUE;
167 scsu->toUState=readCommand;
168 scsu->toUQuoteWindow=scsu->toUDynamicWindow=0;
169 scsu->toUByteOne=0;
175 uprv_memcpy(scsu->fromUDynamicOffsets, initialDynamicOffsets, 32);
177 scsu->fromUIsSingleByteMode=TRUE;
178 scsu->fromUDynamicWindow=0;
180 scsu->nextWindowUseIndex=0;
181 switch(scsu->locale) {
183 uprv_memcpy(scsu->windowUse, initialWindowUse_ja, 8);
186 uprv_memcpy(scsu->windowUse, initialWindowUse, 8);
229 /* SCSU-to-Unicode conversion functions ------------------------------------- */
235 SCSUData *scsu;
250 scsu=(SCSUData *)cnv->extraInfo;
259 isSingleByteMode=scsu->toUIsSingleByteMode;
260 state=scsu->toUState;
261 quoteWindow=scsu->toUQuoteWindow;
262 dynamicWindow=scsu->toUDynamicWindow;
263 byteOne=scsu->toUByteOne;
273 * Instead, there are two code blocks for the two SCSU modes.
303 uint32_t c=scsu->toUDynamicOffsets[dynamicWindow]+(b&0x7f);
411 uint32_t c=scsu->toUDynamicOffsets[quoteWindow]+(b&0x7f);
449 scsu->toUDynamicOffsets[dynamicWindow]=0x10000+(byteOne<<15UL | b<<7UL);
460 scsu->toUDynamicOffsets[dynamicWindow]=b<<7UL;
462 scsu->toUDynamicOffsets[dynamicWindow]=(b<<7UL)+gapOffset;
464 scsu->toUDynamicOffsets[dynamicWindow]=fixedOffsets[b-fixedThreshold];
565 scsu->toUIsSingleByteMode=isSingleByteMode;
566 scsu->toUState=state;
567 scsu->toUQuoteWindow=quoteWindow;
568 scsu->toUDynamicWindow=dynamicWindow;
569 scsu->toUByteOne=byteOne;
589 SCSUData *scsu;
601 scsu=(SCSUData *)cnv->extraInfo;
609 isSingleByteMode=scsu->toUIsSingleByteMode;
610 state=scsu->toUState;
611 quoteWindow=scsu->toUQuoteWindow;
612 dynamicWindow=scsu->toUDynamicWindow;
613 byteOne=scsu->toUByteOne;
619 * Instead, there are two code blocks for the two SCSU modes.
645 uint32_t c=scsu->toUDynamicOffsets[dynamicWindow]+(b&0x7f);
728 uint32_t c=scsu->toUDynamicOffsets[quoteWindow]+(b&0x7f);
755 scsu->toUDynamicOffsets[dynamicWindow]=0x10000+(byteOne<<15UL | b<<7UL);
765 scsu->toUDynamicOffsets[dynamicWindow]=b<<7UL;
767 scsu->toUDynamicOffsets[dynamicWindow]=(b<<7UL)+gapOffset;
769 scsu->toUDynamicOffsets[dynamicWindow]=fixedOffsets[b-fixedThreshold];
858 scsu->toUIsSingleByteMode=isSingleByteMode;
859 scsu->toUState=state;
860 scsu->toUQuoteWindow=quoteWindow;
861 scsu->toUDynamicWindow=dynamicWindow;
862 scsu->toUByteOne=byteOne;
870 /* SCSU-from-Unicode conversion functions ----------------------------------- */
873 * This SCSU Encoder is fairly simple but uses all SCSU commands to achieve
909 getNextDynamicWindow(SCSUData *scsu) {
910 int8_t window=scsu->windowUse[scsu->nextWindowUseIndex];
911 if(++scsu->nextWindowUseIndex==8) {
912 scsu->nextWindowUseIndex=0;
924 useDynamicWindow(SCSUData *scsu, int8_t window) {
933 i=scsu->nextWindowUseIndex;
938 } while(scsu->windowUse[i]!=window);
945 while(j!=scsu->nextWindowUseIndex) {
946 scsu->windowUse[i]=scsu->windowUse[j];
952 scsu->windowUse[i]=window;
1002 * it is desirable to encode U+feff as SQU fe ff for the SCSU signature, and
1014 SCSUData *scsu;
1038 scsu=(SCSUData *)cnv->extraInfo;
1048 isSingleByteMode=scsu->fromUIsSingleByteMode;
1049 dynamicWindow=scsu->fromUDynamicWindow;
1050 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1142 } else if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) {
1145 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1146 useDynamicWindow(scsu, dynamicWindow);
1154 dynamicWindow=getNextDynamicWindow(scsu);
1155 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1156 useDynamicWindow(scsu, dynamicWindow);
1184 if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) {
1186 if(source>=sourceLimit || isInOffsetWindowOrDirect(scsu->fromUDynamicOffsets[window], *source)) {
1189 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1190 useDynamicWindow(scsu, dynamicWindow);
1196 c=((uint32_t)(SQ0+window)<<8)|(c-scsu->fromUDynamicOffsets[window])|0x80;
1207 dynamicWindow=getNextDynamicWindow(scsu);
1208 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1209 useDynamicWindow(scsu, dynamicWindow);
1276 } else if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) {
1280 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1281 useDynamicWindow(scsu, dynamicWindow);
1288 dynamicWindow=getNextDynamicWindow(scsu);
1289 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1290 useDynamicWindow(scsu, dynamicWindow);
1332 if( (window=getWindow(scsu->fromUDynamicOffsets, c))>=0 &&
1342 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1343 useDynamicWindow(scsu, dynamicWindow);
1353 dynamicWindow=getNextDynamicWindow(scsu);
1354 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1355 useDynamicWindow(scsu, dynamicWindow);
1366 /* quote to avoid SCSU tags */
1380 scsu->fromUIsSingleByteMode=isSingleByteMode;
1381 scsu->fromUDynamicWindow=dynamicWindow;
1522 SCSUData *scsu;
1543 scsu=(SCSUData *)cnv->extraInfo;
1552 isSingleByteMode=scsu->fromUIsSingleByteMode;
1553 dynamicWindow=scsu->fromUDynamicWindow;
1554 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1628 } else if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) {
1631 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1632 useDynamicWindow(scsu, dynamicWindow);
1640 dynamicWindow=getNextDynamicWindow(scsu);
1641 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1642 useDynamicWindow(scsu, dynamicWindow);
1667 if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) {
1669 if(source>=sourceLimit || isInOffsetWindowOrDirect(scsu->fromUDynamicOffsets[window], *source)) {
1672 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1673 useDynamicWindow(scsu, dynamicWindow);
1679 c=((uint32_t)(SQ0+window)<<8)|(c-scsu->fromUDynamicOffsets[window])|0x80;
1690 dynamicWindow=getNextDynamicWindow(scsu);
1691 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1692 useDynamicWindow(scsu, dynamicWindow);
1753 } else if((window=getWindow(scsu->fromUDynamicOffsets, c))>=0) {
1757 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1758 useDynamicWindow(scsu, dynamicWindow);
1765 dynamicWindow=getNextDynamicWindow(scsu);
1766 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1767 useDynamicWindow(scsu, dynamicWindow);
1808 if( (window=getWindow(scsu->fromUDynamicOffsets, c))>=0 &&
1818 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow];
1819 useDynamicWindow(scsu, dynamicWindow);
1829 dynamicWindow=getNextDynamicWindow(scsu);
1830 currentOffset=scsu->fromUDynamicOffsets[dynamicWindow]=offset;
1831 useDynamicWindow(scsu, dynamicWindow);
1842 /* quote to avoid SCSU tags */
1855 scsu->fromUIsSingleByteMode=isSingleByteMode;
1856 scsu->fromUDynamicWindow=dynamicWindow;
1954 SCSUData *scsu=(SCSUData *)cnv->extraInfo;
1956 switch(scsu->locale) {
1958 return "SCSU,locale=ja";
1960 return "SCSU";
2027 "SCSU",
2028 1212, /* CCSID for SCSU */