Lines Matching refs:state
36 static inline bool mbspartialc16(const mbstate_t* state) {
37 return mbstate_get_byte(state, 3) != 0;
41 size_t nconv, mbstate_t* state) {
45 mbstate_set_byte(state, 0, trail & 0x00ff);
46 mbstate_set_byte(state, 1, (trail & 0xff00) >> 8);
47 mbstate_set_byte(state, 3, nconv & 0xff);
54 static size_t finish_surrogate(char16_t* pc16, mbstate_t* state) {
55 char16_t trail = mbstate_get_byte(state, 1) << 8 |
56 mbstate_get_byte(state, 0);
58 return reset_and_return(mbstate_get_byte(state, 3), state);
63 mbstate_t* state = (ps == NULL) ? &__private_state : ps;
70 if (mbspartialc16(state)) {
71 return finish_surrogate(pc16, state);
75 size_t nconv = mbrtoc32(&c32, s, n, state);
79 return reset_and_return(nconv, state);
82 return reset_and_return_illegal(EILSEQ, state);
85 return reset_and_return(nconv, state);
87 return begin_surrogate(c32, pc16, nconv, state);