Lines Matching refs:st

58 	_iconv_st *st;  in _icv_open()  local
60 if ((st = (_iconv_st *)malloc(sizeof(_iconv_st))) == NULL) { in _icv_open()
65 st->ustate = U0; in _icv_open()
66 st->_errno = 0; in _icv_open()
68 return ((void *) st); in _icv_open()
76 _icv_close(_iconv_st *st) in _icv_close() argument
78 if (!st) in _icv_close()
81 free(st); in _icv_close()
111 _icv_iconv(_iconv_st *st, char **inbuf, size_t *inbytesleft, in _icv_iconv() argument
121 if (st == NULL) { in _icv_iconv()
127 st->ustate = U0; in _icv_iconv()
128 st->_errno = 0; in _icv_iconv()
132 st->_errno = 0; /* reset internal errno */ in _icv_iconv()
140 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()
165 st->ustate = U5; in _icv_iconv()
166 st->keepc[0] = **inbuf; in _icv_iconv()
173 st->ustate = U4; in _icv_iconv()
174 st->keepc[1] = **inbuf; in _icv_iconv()
175 c1 = (st->keepc[0]&0x1c)>>2; in _icv_iconv()
176 c2 = ((st->keepc[0]&0x03)<<6) | ((**inbuf)&0x3f); in _icv_iconv()
179 st->keepc[0]&ONEBYTE, st->keepc[1]&ONEBYTE); in _icv_iconv()
183 st->_errno = errno = EILSEQ; in _icv_iconv()
188 first_byte = st->keepc[0]; in _icv_iconv()
195 st->_errno = errno = EILSEQ; in _icv_iconv()
197 st->ustate = U3; in _icv_iconv()
198 st->keepc[1] = **inbuf; in _icv_iconv()
203 st->ustate = U4; in _icv_iconv()
204 st->keepc[2] = **inbuf; in _icv_iconv()
205 c1 = ((st->keepc[0]&0x0f)<<4) | in _icv_iconv()
206 ((st->keepc[1]&0x3c)>>2); in _icv_iconv()
207 c2 = ((st->keepc[1]&0x03)<<6) | ((**inbuf)&0x3f); in _icv_iconv()
209 fprintf(stderr, "UTF8: %02x%02x%02x --> ", st->keepc[0]&ONEBYTE, in _icv_iconv()
210 st->keepc[1]&ONEBYTE, **inbuf&ONEBYTE); in _icv_iconv()
214 st->_errno = errno = EILSEQ; in _icv_iconv()
220 st->_errno = errno = EILSEQ; in _icv_iconv()
237 st->ustate = U0; in _icv_iconv()
239 st->_errno = errno = E2BIG; in _icv_iconv()
243 first_byte = st->keepc[0]; in _icv_iconv()
251 st->_errno = errno = EILSEQ; in _icv_iconv()
254 st->ustate = U6; in _icv_iconv()
255 st->keepc[1] = **inbuf; in _icv_iconv()
261 st->ustate = U7; in _icv_iconv()
262 st->keepc[2] = **inbuf; in _icv_iconv()
265 st->_errno = errno = EILSEQ; in _icv_iconv()
270 st->ustate = U0; in _icv_iconv()
273 st->_errno = errno = EILSEQ; in _icv_iconv()
276 st->_errno = errno = EILSEQ; in _icv_iconv()
277 st->ustate = U0; /* reset state */ in _icv_iconv()
281 if (st->_errno) { in _icv_iconv()
284 st->_errno, st->ustate); in _icv_iconv()
295 if (*inbytesleft == 0 && st->ustate != U0) { in _icv_iconv()