~ubuntu-branches/ubuntu/utopic/geany/utopic

« back to all changes in this revision

Viewing changes to scintilla/lexlib/CharacterSet.cxx

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2011-12-10 07:43:26 UTC
  • mfrom: (3.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20111210074326-s8yqbew5i20h33tf
Tags: 0.21-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  - debian/patches/20_use_evince_viewer.patch:
     + use evince as viewer for pdf and dvi files
  - debian/patches/20_use_x_terminal_emulator.patch:
     + use x-terminal-emulator as terminal
  - debian/control
     + Add breaks on geany-plugins-common << 0.20
* Also fixes bugs:
  - Filter for MATLAB/Octave files filters everythign (LP: 885505)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
18
using namespace Scintilla;
 
19
#endif
 
20
 
 
21
#ifdef SCI_NAMESPACE
 
22
namespace Scintilla {
 
23
#endif
 
24
 
 
25
int 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
 
 
40
int 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