11 the our_* routines are implementations for the corresponding library
12 routines. for a while, i tried to actually name them wctomb etc
13 but stopped that after i found a system which made wchar_t an
42 Wchar1 = (1UL<<Bit1)-1,
43 Wchar2 = (1UL<<(Bit2+Bitx))-1,
44 Wchar3 = (1UL<<(Bit3+2*Bitx))-1,
45 Wchar4 = (1UL<<(Bit4+3*Bitx))-1,
46 Wchar5 = (1UL<<(Bit5+4*Bitx))-1
49 , /* we hate ansi c's comma rules */
55 our_wctomb(char *s, unsigned long wc)
58 return 0; /* no shift states */
63 s[0] = T6 | ((wc >> 5*Bitx) & Mask6);
64 s[1] = Tx | ((wc >> 4*Bitx) & Maskx);
65 s[2] = Tx | ((wc >> 3*Bitx) & Maskx);
66 s[3] = Tx | ((wc >> 2*Bitx) & Maskx);
67 s[4] = Tx | ((wc >> 1*Bitx) & Maskx);
68 s[5] = Tx | (wc & Maskx);
72 s[0] = T5 | (wc >> 4*Bitx);
73 s[1] = Tx | ((wc >> 3*Bitx) & Maskx);
74 s[2] = Tx | ((wc >> 2*Bitx) & Maskx);
75 s[3] = Tx | ((wc >> 1*Bitx) & Maskx);
76 s[4] = Tx | (wc & Maskx);
81 s[0] = T4 | (wc >> 3*Bitx);
82 s[1] = Tx | ((wc >> 2*Bitx) & Maskx);
83 s[2] = Tx | ((wc >> 1*Bitx) & Maskx);
84 s[3] = Tx | (wc & Maskx);
88 s[0] = T3 | (wc >> 2*Bitx);
89 s[1] = Tx | ((wc >> 1*Bitx) & Maskx);
90 s[2] = Tx | (wc & Maskx);
95 s[0] = T2 | (wc >> 1*Bitx);
96 s[1] = Tx | (wc & Maskx);