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