Lines Matching refs:st

56     _iconv_st *st;  in _icv_open()  local
58 if ((st = (_iconv_st *)malloc(sizeof(_iconv_st))) == NULL) { in _icv_open()
63 st->ustate = U0; in _icv_open()
64 st->_errno = 0; in _icv_open()
65 return ((void *) st); in _icv_open()
73 _icv_close(_iconv_st *st) in _icv_close() argument
75 if (!st) in _icv_close()
78 free(st); in _icv_close()
107 _icv_iconv(_iconv_st *st, char **inbuf, size_t *inbytesleft, in _icv_iconv() argument
118 if (st == NULL) { in _icv_iconv()
124 st->ustate = U0; in _icv_iconv()
125 st->_errno = 0; in _icv_iconv()
129 st->_errno = 0; /* reset internal errno */ in _icv_iconv()
137 switch (st->ustate) { in _icv_iconv()
151 st->_errno = errno = EILSEQ; in _icv_iconv()
153 st->ustate = U1; in _icv_iconv()
154 st->keepc[0] = **inbuf; in _icv_iconv()
157 st->ustate = U2; in _icv_iconv()
158 st->keepc[0] = **inbuf; in _icv_iconv()
162 st->_errno = errno = EILSEQ; in _icv_iconv()
164 st->ustate = U5; in _icv_iconv()
165 st->keepc[0] = **inbuf; in _icv_iconv()
174 st->keepc[1] = **inbuf; in _icv_iconv()
176 c1 = (st->keepc[0]&0x1c)>>2; in _icv_iconv()
177 c2 = ((st->keepc[0]&0x03)<<6) | ((st->keepc[1])&0x3f); in _icv_iconv()
178 st->ustate = U4; in _icv_iconv()
181 st->keepc[0]&ONEBYTE, st->keepc[1]&ONEBYTE); in _icv_iconv()
185 st->_errno = errno = EILSEQ; in _icv_iconv()
190 first_byte = (uchar_t)st->keepc[0]; in _icv_iconv()
196 st->_errno = errno = EILSEQ; in _icv_iconv()
198 st->ustate = U3; in _icv_iconv()
199 st->keepc[1] = **inbuf; in _icv_iconv()
205 st->ustate = U4; in _icv_iconv()
207 st->keepc[2] = **inbuf; in _icv_iconv()
208 c1 = ((st->keepc[0]&0x0f)<<4) | in _icv_iconv()
209 ((st->keepc[1]&0x3c)>>2); in _icv_iconv()
210 c2 = ((st->keepc[1]&0x03)<<6) | ((**inbuf)&0x3f); in _icv_iconv()
212 fprintf(stderr, "UTF8: %02x%02x%02x --> ", st->keepc[0]&ONEBYTE, in _icv_iconv()
213 st->keepc[1]&ONEBYTE, **inbuf&ONEBYTE); in _icv_iconv()
217 st->_errno = errno = EILSEQ; in _icv_iconv()
230 st->ustate = U0; in _icv_iconv()
233 first_byte = st->keepc[0]; in _icv_iconv()
241 st->_errno = errno = EILSEQ; in _icv_iconv()
243 st->ustate = U6; in _icv_iconv()
244 st->keepc[1] = **inbuf; in _icv_iconv()
250 st->ustate = U7; in _icv_iconv()
251 st->keepc[2] = **inbuf; in _icv_iconv()
253 st->_errno = errno = EILSEQ; in _icv_iconv()
260 st->_errno = errno = E2BIG; in _icv_iconv()
265 st->ustate = U0; in _icv_iconv()
268 st->_errno = errno = EILSEQ; in _icv_iconv()
272 st->_errno = errno = EILSEQ; in _icv_iconv()
273 st->ustate = U0; /* reset state */ in _icv_iconv()
277 if (st->_errno) { in _icv_iconv()
280 st->_errno, st->ustate); in _icv_iconv()
289 if (*inbytesleft == 0 && st->ustate != U0) in _icv_iconv()
298 switch (st->ustate) in _icv_iconv()
329 st->ustate = U0; in _icv_iconv()