Lines Matching refs:st

97 	_iconv_st  *st;  in _icv_open()  local
103 if ((st = (_iconv_st *) malloc(sizeof(_iconv_st))) == NULL){ in _icv_open()
112 st->cstate = C0; in _icv_open()
113 st->ishiftfunc = SI; in _icv_open()
114 st->iSOplane = -1; in _icv_open()
115 st->iSS2plane = -1; in _icv_open()
116 st->iSS3plane = -1; in _icv_open()
117 st->nonidcount = 0; in _icv_open()
118 st->_errno = 0; in _icv_open()
125 return ((void *) st); in _icv_open()
136 _icv_close(_iconv_st *st) in _icv_close() argument
138 if (st == NULL) in _icv_close()
141 free(st); in _icv_close()
162 _icv_iconv(_iconv_st *st, char **inbuf, size_t *inbytesleft, in _icv_iconv() argument
172 if (st == NULL) { in _icv_iconv()
179 if (st->ishiftfunc == SO) { in _icv_iconv()
189 st->cstate = C0; in _icv_iconv()
190 st->ishiftfunc = SI; in _icv_iconv()
191 st->iSOplane = -1; in _icv_iconv()
192 st->iSS2plane = -1; in _icv_iconv()
193 st->iSS3plane = -1; in _icv_iconv()
194 st->nonidcount = 0; in _icv_iconv()
195 st->_errno = 0; in _icv_iconv()
199 st->_errno = 0; in _icv_iconv()
219 switch (st->cstate) { in _icv_iconv()
223 st->keepc[0] = **inbuf; /*Save byte */ in _icv_iconv()
224 st->cstate = C1; /* Go to the next state where in _icv_iconv()
226 st->nonidcount += 1;/* Until we have verified that this and in _icv_iconv()
236 n = ascii_to_iso(NON_ID_CHAR, st, outbuf, outbytesleft); in _icv_iconv()
239 st->nonidcount += 1; in _icv_iconv()
241 n = ascii_to_iso(**inbuf, st, outbuf, outbytesleft); in _icv_iconv()
248 st->keepc[1] = (**inbuf); in _icv_iconv()
249 if (isbig5((unsigned char*) st->keepc) == 0) { in _icv_iconv()
250 if ((idx = hascns(st->keepc)) >= 0){ in _icv_iconv()
251 n = big5_to_iso(idx, st, outbuf, outbytesleft); in _icv_iconv()
254 st->nonidcount -= 1; /* The first byte of this big5 saved in in _icv_iconv()
260 n = ascii_to_iso(NON_ID_CHAR, st, outbuf, outbytesleft); in _icv_iconv()
263 n = ascii_to_iso(NON_ID_CHAR, st, outbuf, outbytesleft); in _icv_iconv()
266 st->nonidcount -= 1; /* Include the 2nd byte also as in _icv_iconv()
270 st->nonidcount += 1; in _icv_iconv()
271 st->_errno = errno = EILSEQ; /* This will cause the code to in _icv_iconv()
276 st->cstate = C0; /* Go to the initial state */ in _icv_iconv()
282 st->_errno = errno = EILSEQ; in _icv_iconv()
283 st->cstate = C0; in _icv_iconv()
291 if (st->_errno) in _icv_iconv()
310 return (*inbytesleft + st->nonidcount); in _icv_iconv()
358 static int ascii_to_iso(char c, _iconv_st *st, char **outbuf, in ascii_to_iso() argument
361 if (st->ishiftfunc != SI){ in ascii_to_iso()
365 st->ishiftfunc = SI; in ascii_to_iso()
368 st->_errno = errno = E2BIG; in ascii_to_iso()
382 st->iSOplane = -1; in ascii_to_iso()
383 st->iSS2plane = -1; in ascii_to_iso()
384 st->iSS3plane = -1; in ascii_to_iso()
401 static int big5_to_iso(int idx, _iconv_st *st, char **outbuf, in big5_to_iso() argument
416 st->_errno = errno = EILSEQ; in big5_to_iso()
422 if (st->iSOplane != cnsplane){ /* Is SODESIGNATION set to this plane?*/ in big5_to_iso()
426 st->_errno = errno = E2BIG; in big5_to_iso()
436 st->iSOplane = cnsplane; in big5_to_iso()
442 if (st->ishiftfunc != SO){ in big5_to_iso()
444 st->_errno = errno = E2BIG; in big5_to_iso()
451 st->ishiftfunc = SO; in big5_to_iso()
456 if (st->iSS2plane != cnsplane){ /* Is SS2DESIGNATION set tothis plane ? */ in big5_to_iso()
460 st->_errno = errno = E2BIG; in big5_to_iso()
470 st->iSS2plane = cnsplane; in big5_to_iso()
476 st->_errno = errno = E2BIG; in big5_to_iso()
496 if (st->iSS3plane != cnsplane){ /* Is SS3DESIGNATION set tothis plane? */ in big5_to_iso()
500 st->_errno = errno = E2BIG; in big5_to_iso()
510 st->iSS3plane = cnsplane; in big5_to_iso()
517 st->_errno = errno = E2BIG; in big5_to_iso()
534 st->_errno = errno = EILSEQ; in big5_to_iso()
543 st->_errno = errno = E2BIG; in big5_to_iso()