+typedef struct vchar_t vchar_t;
+struct vchar_t {
+ const void *string; /**< the string */
+ size_t position; /**< current position */
+ size_t size; /**< size of the string */
+
+ /** return the first character of the string and setthe position to 0. */
+ unsigned (*first)(vchar_t *self);
+ /** return the next character of the string */
+ unsigned (*next)(vchar_t *self);
+ /** return non_zero if the given character is a digit */
+ int (*is_digit)(unsigned vchar);
+};
+
+static unsigned string_first(vchar_t *self) {
+ self->position = 0;
+ const string_t *string = self->string;
+ return string->begin[0];
+}
+
+static unsigned string_next(vchar_t *self) {
+ ++self->position;
+ const string_t *string = self->string;
+ return string->begin[self->position];
+}
+
+static int string_isdigit(unsigned vchar) {
+ return isdigit(vchar);
+}
+
+static unsigned wstring_first(vchar_t *self) {
+ self->position = 0;
+ const wide_string_t *wstring = self->string;
+ return wstring->begin[0];
+}
+
+static unsigned wstring_next(vchar_t *self) {
+ ++self->position;
+ const wide_string_t *wstring = self->string;
+ return wstring->begin[self->position];
+}
+
+static int wstring_isdigit(unsigned vchar) {
+ return iswdigit(vchar);
+}
+
+static bool atend(vchar_t *self) {
+ return self->position + 1 == self->size;
+}
+