Mercurial > hg > xemacs-beta
comparison src/mule-wnnfns.c @ 173:8eaf7971accc r20-3b13
Import from CVS: tag r20-3b13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:49:09 +0200 |
parents | 15872534500d |
children | 9ad43877534d |
comparison
equal
deleted
inserted
replaced
172:a38aed19690b | 173:8eaf7971accc |
---|---|
585 Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is T | 585 Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is T |
586 if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho. | 586 if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho. |
587 */ | 587 */ |
588 (bunNo, dai)) | 588 (bunNo, dai)) |
589 { | 589 { |
590 int no, offset; | 590 int no, offset; |
591 int snum; | 591 int snum; |
592 int uniq_level; | 592 int uniq_level; |
593 CHECK_INT (bunNo); | 593 CHECK_INT (bunNo); |
594 if ((snum = check_wnn_server_type ()) == -1) return Qnil; | 594 if ((snum = check_wnn_server_type ()) == -1) return Qnil; |
595 if (!wnnfns_buf[snum]) return Qnil; | 595 if (!wnnfns_buf[snum]) return Qnil; |
596 no = XINT (bunNo); | 596 no = XINT (bunNo); |
597 if (EQ(Vwnn_uniq_level, Qwnn_no_uniq)) uniq_level = WNN_NO_UNIQ; | 597 if (EQ(Vwnn_uniq_level, Qwnn_no_uniq)) uniq_level = WNN_NO_UNIQ; |
598 else if (EQ(Vwnn_uniq_level, Qwnn_uniq)) uniq_level = WNN_UNIQ; | 598 else if (EQ(Vwnn_uniq_level, Qwnn_uniq)) uniq_level = WNN_UNIQ; |
599 else uniq_level = WNN_UNIQ_KNJ; | 599 else uniq_level = WNN_UNIQ_KNJ; |
600 if (EQ(dai, Qnil)) | 600 if (NILP (dai)) |
601 { | 601 { |
602 if (offset = jl_zenkouho (wnnfns_buf[snum],no,WNN_USE_MAE, uniq_level) < 0) | 602 if ((offset = jl_zenkouho (wnnfns_buf[snum],no,WNN_USE_MAE, |
603 uniq_level)) < 0) | |
603 return Qnil; | 604 return Qnil; |
604 } | 605 } |
605 else | 606 else |
606 { | 607 { |
607 if (offset = jl_zenkouho_dai (wnnfns_buf[snum], no, dai_end (no, snum), | 608 if ((offset = jl_zenkouho_dai (wnnfns_buf[snum], no, dai_end (no, snum), |
608 WNN_USE_MAE, uniq_level) < 0) | 609 WNN_USE_MAE, uniq_level)) < 0) |
609 return Qnil; | 610 return Qnil; |
610 } | 611 } |
611 return make_int (offset); | 612 return make_int (offset); |
612 } | 613 } |
613 | 614 |
1906 { | 1907 { |
1907 w_char wc; | 1908 w_char wc; |
1908 w_char pzy[10]; | 1909 w_char pzy[10]; |
1909 int i, len; | 1910 int i, len; |
1910 | 1911 |
1911 while (wc = *wp++) | 1912 while ((wc = *wp++) != 0) |
1912 { | 1913 { |
1913 switch (wc & 0x8080) | 1914 switch (wc & 0x8080) |
1914 { | 1915 { |
1915 case 0x80: | 1916 case 0x80: |
1916 if (EQ(Vwnn_server_type, Qcserver)) | 1917 if (EQ(Vwnn_server_type, Qcserver)) |
1946 else if (lb == LEADING_BYTE_CHINESE_BIG5_1) | 1947 else if (lb == LEADING_BYTE_CHINESE_BIG5_1) |
1947 *mp++ = LEADING_BYTE_CHINESE_BIG5_2; | 1948 *mp++ = LEADING_BYTE_CHINESE_BIG5_2; |
1948 else | 1949 else |
1949 *mp++ = lb; | 1950 *mp++ = lb; |
1950 *mp++ = (wc & 0xff00) >> 8; | 1951 *mp++ = (wc & 0xff00) >> 8; |
1951 *mp++ = wc & 0x00ff | 0x80; | 1952 *mp++ = (wc & 0x00ff) | 0x80; |
1952 break; | 1953 break; |
1953 default: | 1954 default: |
1954 *mp++ = wc & 0x00ff; | 1955 *mp++ = wc & 0x00ff; |
1955 break; | 1956 break; |
1956 } | 1957 } |
1961 void | 1962 void |
1962 m2w (unsigned char *mp, w_char *wp) | 1963 m2w (unsigned char *mp, w_char *wp) |
1963 { | 1964 { |
1964 unsigned int ch; | 1965 unsigned int ch; |
1965 | 1966 |
1966 while (ch = *mp++) | 1967 while ((ch = *mp++) != 0) |
1967 { | 1968 { |
1968 if (BUFBYTE_LEADING_BYTE_P (ch)) | 1969 if (BUFBYTE_LEADING_BYTE_P (ch)) |
1969 { | 1970 { |
1970 switch (ch) | 1971 switch (ch) |
1971 { | 1972 { |
2037 } | 2038 } |
2038 | 2039 |
2039 void | 2040 void |
2040 c2m (unsigned char *cp, unsigned char *mp, unsigned char lb) | 2041 c2m (unsigned char *cp, unsigned char *mp, unsigned char lb) |
2041 { | 2042 { |
2042 unsigned char ch; | 2043 unsigned char ch; |
2043 while (ch = *cp) | 2044 while ((ch = *cp) != 0) |
2044 { | 2045 { |
2045 if (ch & 0x80) | 2046 if (ch & 0x80) |
2046 { | 2047 { |
2047 *mp++ = lb; | 2048 *mp++ = lb; |
2048 *mp++ = *cp++; | 2049 *mp++ = *cp++; |