"Fossies" - the Fresh Open Source Software Archive

Member "fltk-1.3.2/documentation/html/mulelao_8h_source.html" (9 Dec 2012, 9221 Bytes) of package /linux/misc/fltk-1.3.2-docs-html.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted raw source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

FLTK 1.3.2
mulelao.h
00001 /* $XFree86: xc/lib/X11/lcUniConv/mulelao.h,v 1.3 2000/11/29 17:40:35 dawes Exp $ */
00002 
00003 /*
00004  * MULELAO-1
00005  */
00006 
00007 static const unsigned short mulelao_2uni[96] = {
00008   /* 0xa0 */
00009   0x00a0, 0x0e81, 0x0e82, 0xfffd, 0x0e84, 0xfffd, 0xfffd, 0x0e87,
00010   0x0e88, 0xfffd, 0x0e8a, 0xfffd, 0xfffd, 0x0e8d, 0xfffd, 0xfffd,
00011   /* 0xb0 */
00012   0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x0e94, 0x0e95, 0x0e96, 0x0e97,
00013   0xfffd, 0x0e99, 0x0e9a, 0x0e9b, 0x0e9c, 0x0e9d, 0x0e9e, 0x0e9f,
00014   /* 0xc0 */
00015   0xfffd, 0x0ea1, 0x0ea2, 0x0ea3, 0xfffd, 0x0ea5, 0xfffd, 0x0ea7,
00016   0xfffd, 0xfffd, 0x0eaa, 0x0eab, 0xfffd, 0x0ead, 0x0eae, 0x0eaf,
00017   /* 0xd0 */
00018   0x0eb0, 0x0eb1, 0x0eb2, 0x0eb3, 0x0eb4, 0x0eb5, 0x0eb6, 0x0eb7,
00019   0x0eb8, 0x0eb9, 0xfffd, 0x0ebb, 0x0ebc, 0x0ebd, 0xfffd, 0xfffd,
00020   /* 0xe0 */
00021   0x0ec0, 0x0ec1, 0x0ec2, 0x0ec3, 0x0ec4, 0xfffd, 0x0ec6, 0xfffd,
00022   0x0ec8, 0x0ec9, 0x0eca, 0x0ecb, 0x0ecc, 0x0ecd, 0xfffd, 0xfffd,
00023   /* 0xf0 */
00024   0x0ed0, 0x0ed1, 0x0ed2, 0x0ed3, 0x0ed4, 0x0ed5, 0x0ed6, 0x0ed7,
00025   0x0ed8, 0x0ed9, 0xfffd, 0xfffd, 0x0edc, 0x0edd, 0xfffd, 0xfffd,
00026 };
00027 
00028 static int
00029 mulelao_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
00030 {
00031   unsigned char c = *s;
00032   if (c < 0xa0) {
00033     *pwc = (ucs4_t) c;
00034     return 1;
00035   }
00036   else {
00037     unsigned short wc = mulelao_2uni[c-0xa0];
00038     if (wc != 0xfffd) {
00039       *pwc = (ucs4_t) wc;
00040       return 1;
00041     }
00042   }
00043   return RET_ILSEQ;
00044 }
00045 
00046 static const unsigned char mulelao_page0e[96] = {
00047   0x00, 0xa1, 0xa2, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0x80-0x87 */
00048   0xa8, 0x00, 0xaa, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0x88-0x8f */
00049   0x00, 0x00, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x90-0x97 */
00050   0x00, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x98-0x9f */
00051   0x00, 0xc1, 0xc2, 0xc3, 0x00, 0xc5, 0x00, 0xc7, /* 0xa0-0xa7 */
00052   0x00, 0x00, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf, /* 0xa8-0xaf */
00053   0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xb0-0xb7 */
00054   0xd8, 0xd9, 0x00, 0xdb, 0xdc, 0xdd, 0x00, 0x00, /* 0xb8-0xbf */
00055   0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x00, 0xe6, 0x00, /* 0xc0-0xc7 */
00056   0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0x00, 0x00, /* 0xc8-0xcf */
00057   0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xd0-0xd7 */
00058   0xf8, 0xf9, 0x00, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xd8-0xdf */
00059 };
00060 
00061 static int
00062 mulelao_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
00063 {
00064   unsigned char c = 0;
00065   if (wc < 0x00a0) {
00066     *r = wc;
00067     return 1;
00068   }
00069   else if (wc == 0x00a0)
00070     c = 0xa0;
00071   else if (wc >= 0x0e80 && wc < 0x0ee0)
00072     c = mulelao_page0e[wc-0x0e80];
00073   if (c != 0) {
00074     *r = c;
00075     return 1;
00076   }
00077   return RET_ILSEQ;
00078 }