diff options
| author | Simon Tatham <anakin@pobox.com> | 1999-11-07 18:49:58 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 1999-11-07 18:49:58 +0000 |
| commit | b28dd9a135da2d62073840d05de430ec8dd8a58d (patch) | |
| tree | 4aaecfbbdbefb5085a3b50e39d0b1511fb6e8240 /ustring.c | |
| parent | 6dff7b9ee671925f8c5dae1cd34bdc55f3236c38 (diff) | |
| download | halibut-b28dd9a135da2d62073840d05de430ec8dd8a58d.zip halibut-b28dd9a135da2d62073840d05de430ec8dd8a58d.tar.gz halibut-b28dd9a135da2d62073840d05de430ec8dd8a58d.tar.bz2 halibut-b28dd9a135da2d62073840d05de430ec8dd8a58d.tar.xz | |
First stab at text backend configurability
[originally from svn r276]
Diffstat (limited to 'ustring.c')
| -rw-r--r-- | ustring.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -94,6 +94,36 @@ wchar_t *ustrlow(wchar_t *s) { return s; } +int utoi(wchar_t *s) { + int sign = +1; + int n; + + if (*s == L'-') { + s++; + sign = -1; + } + + n = 0; + while (*s && *s >= L'0' && *s <= L'9') { + n *= 10; + n += (*s - '0'); + s++; + } + + return n; +} + +int utob(wchar_t *s) { + if (!ustricmp(s, L"yes") || !ustricmp(s, L"y") || + !ustricmp(s, L"true") || !ustricmp(s, L"t")) + return TRUE; + return FALSE; +} + +int uisdigit(wchar_t c) { + return c >= L'0' && c <= L'9'; +} + #define USTRFTIME_DELTA 128 wchar_t *ustrftime(wchar_t *wfmt, struct tm *timespec) { void *blk = NULL; |