From 3ae295ca676ac0db275ad2cc1945fa0eca4a19bd Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 12 Jun 2004 20:09:40 +0000 Subject: Initial checkin of the shiny new rewritten-from-scratch HTML back end. There's a lot more _potentiality_ for new features than there are actual new features just yet, but future highlights include: configurable flavour of HTML (3.2, 4, XHTML Transitional or Strict), proper character set support (this is half way there already), and more flexible allocation of sections between multiple HTML files. Meanwhile, immediate benefits include correct handling of special characters within `author' and `description' strings, omission of the filename part in hyperlinks within the same HTML file (in particular, this means a single output file is now totally independent of its filename), and hyperlinks to the index from the top-level contents page (I'm amazed nobody has complained at the lack of this yet!). There are no doubt some shiny new bugs as well, but I'll never find them unless people start using the thing... [originally from svn r4275] --- ustring.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ustring.c') diff --git a/ustring.c b/ustring.c index 8b0c865..3f52972 100644 --- a/ustring.c +++ b/ustring.c @@ -288,7 +288,7 @@ int uisalpha(wchar_t c) { #endif } -int ustricmp(wchar_t *lhs, wchar_t *rhs) { +int ustricmp(wchar_t const *lhs, wchar_t const *rhs) { wchar_t lc, rc; while ((lc = utolower(*lhs)) == (rc = utolower(*rhs)) && lc && rc) lhs++, rhs++; @@ -300,6 +300,19 @@ int ustricmp(wchar_t *lhs, wchar_t *rhs) { return 1; } +int ustrnicmp(wchar_t const *lhs, wchar_t const *rhs, int maxlen) { + wchar_t lc = 0, rc = 0; + while (maxlen-- > 0 && + (lc = utolower(*lhs)) == (rc = utolower(*rhs)) && lc && rc) + lhs++, rhs++; + if (lc < rc) + return -1; + else if (lc > rc) + return 1; + else + return 0; +} + wchar_t *ustrlow(wchar_t *s) { wchar_t *p = s; while (*p) { -- cgit v1.1