Sometimes we need to reset the UTF8 state-machine, for instance when
resetting the VTE. This function simply resets the internal state to
KMSCON_UTF8_START so we start all over on the next input character.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
return mach->ch;
}
+
+void kmscon_utf8_mach_reset(struct kmscon_utf8_mach *mach)
+{
+ if (!mach)
+ return;
+
+ mach->state = KMSCON_UTF8_START;
+}
int kmscon_utf8_mach_feed(struct kmscon_utf8_mach *mach, char c);
uint32_t kmscon_utf8_mach_get(struct kmscon_utf8_mach *mach);
+void kmscon_utf8_mach_reset(struct kmscon_utf8_mach *mach);
#endif /* KMSCON_UNICODE_H */