]> git.saurik.com Git - wxWidgets.git/blame - src/stc/scintilla/lexlib/CharacterSet.cxx
Add missing WXK constants for the control keys
[wxWidgets.git] / src / stc / scintilla / lexlib / CharacterSet.cxx
CommitLineData
1dcf666d
RD
1// Scintilla source code edit control
2/** @file CharacterSet.cxx
3 ** Simple case functions for ASCII.
4 ** Lexer infrastructure.
5 **/
6// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
7// The License.txt file describes the conditions under which this software may be distributed.
8
9#include <stdlib.h>
10#include <string.h>
11#include <ctype.h>
12#include <stdio.h>
13#include <assert.h>
14
15#include "CharacterSet.h"
16
17#ifdef SCI_NAMESPACE
18using namespace Scintilla;
19#endif
20
21#ifdef SCI_NAMESPACE
22namespace Scintilla {
23#endif
24
25int CompareCaseInsensitive(const char *a, const char *b) {
26 while (*a && *b) {
27 if (*a != *b) {
28 char upperA = MakeUpperCase(*a);
29 char upperB = MakeUpperCase(*b);
30 if (upperA != upperB)
31 return upperA - upperB;
32 }
33 a++;
34 b++;
35 }
36 // Either *a or *b is nul
37 return *a - *b;
38}
39
40int CompareNCaseInsensitive(const char *a, const char *b, size_t len) {
41 while (*a && *b && len) {
42 if (*a != *b) {
43 char upperA = MakeUpperCase(*a);
44 char upperB = MakeUpperCase(*b);
45 if (upperA != upperB)
46 return upperA - upperB;
47 }
48 a++;
49 b++;
50 len--;
51 }
52 if (len == 0)
53 return 0;
54 else
55 // Either *a or *b is nul
56 return *a - *b;
57}
58
59#ifdef SCI_NAMESPACE
60}
61#endif