int _pSLbstring_foreach (SLtype type, SLang_Foreach_Context_Type *c) { unsigned char ch; SLwchar_Type wch; unsigned char *s, *s1, *smax; (void) type; s = c->s; smax = c->smax; if (s == smax) return 0; if (c->using_chars == 0) { ch = (unsigned char) *s++; c->s = s; if (-1 == SLclass_push_char_obj (SLANG_UCHAR_TYPE, ch)) return -1; return 1; } s1 = SLutf8_decode (s, smax, &wch, NULL); if (s1 == NULL) { int iwch = (int) *s; c->s = s + 1; /* Invalid encoded char-- return it as a negative int */ if (-1 == SLang_push_int (-iwch)) return -1; return 1; } c->s = s1; if (-1 == SLang_push_wchar (wch)) return -1; return 1; }
int SLang_push_uchar (unsigned char i) { return SLclass_push_char_obj (SLANG_UCHAR_TYPE, (char) i); }
int SLang_push_char (char i) { return SLclass_push_char_obj (SLANG_CHAR_TYPE, i); }
static int push_char_literal (SLtype type, VOID_STAR ptr) { return SLclass_push_char_obj (type, (char) *(long *) ptr); }