1 2/* 3 * ASCII 4 */ 5 6static int 7ascii_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) 8{ 9 unsigned char c = *s; 10 if (c < 0x80) { 11 *pwc = (ucs4_t) c; 12 return 1; 13 } 14 return RET_ILSEQ; 15} 16 17static int 18ascii_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) 19{ 20 if (wc < 0x0080) { 21 *r = wc; 22 return 1; 23 } 24 return RET_ILSEQ; 25} 26