mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2301 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8f3f0c20bd
commit
60836e9864
11 changed files with 3982 additions and 0 deletions
95
Headers/gnustep/base/NSGSequence.h
Normal file
95
Headers/gnustep/base/NSGSequence.h
Normal file
|
@ -0,0 +1,95 @@
|
|||
/* Interface to implementation of composite character sequence
|
||||
class for GNUSTEP
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Stevo Crvenkovski
|
||||
Date: Marth 1997
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __NSGSequence_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __NSGSequence_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSRange.h>
|
||||
|
||||
|
||||
|
||||
@class NSArray;
|
||||
@class NSCharacterSet;
|
||||
@class NSData;
|
||||
@class NSDictionary;
|
||||
@class NSString;
|
||||
@class NSGSequence;
|
||||
|
||||
@protocol NSGSequence <NSCopying>
|
||||
|
||||
// Creating Temporary Sequences
|
||||
+ (NSGSequence*) sequenceWithString: (NSString*) aString
|
||||
range: (NSRange)aRange;
|
||||
+ (NSGSequence*) sequenceWithSequence: (NSGSequence*) aSequence ;
|
||||
+ (NSGSequence*) sequenceWithCharacters: (unichar *) characters
|
||||
length: (int) len;
|
||||
|
||||
// Initializing Newly Allocated Sequences
|
||||
- (id) init;
|
||||
- (id) initWithString: (NSString*)string
|
||||
range: (NSRange)aRange;
|
||||
- (id) initWithSequence: (NSGSequence*) aSequence;
|
||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag;
|
||||
- (id) initWithCharacters: (const unichar*)chars
|
||||
length: (unsigned int)length;
|
||||
|
||||
// Getting a Length of Sequence
|
||||
- (unsigned int) length;
|
||||
|
||||
// Accessing Characters
|
||||
- (unichar) characterAtIndex: (unsigned int)index;
|
||||
- (unichar) baseCharacter;
|
||||
- (unichar) precomposedCharacter;
|
||||
- (void) getCharacters: (unichar*)buffer;
|
||||
- (void) getCharacters: (unichar*)buffer
|
||||
range: (NSRange)aRange;
|
||||
- (NSString*) description;
|
||||
- (NSGSequence*) decompose;
|
||||
- (NSGSequence*) order;
|
||||
- (NSGSequence*) normalize;
|
||||
- (BOOL) isEqual: (NSGSequence*) aSequence;
|
||||
- (BOOL) isNormalized;
|
||||
- (BOOL) isComposite;
|
||||
- (NSGSequence*) maxComposed;
|
||||
- (NSGSequence*) lowercase;
|
||||
- (NSGSequence*) uppercase;
|
||||
- (NSGSequence*) titlecase;
|
||||
- (NSComparisonResult) compare: (NSGSequence*) aSequence;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSGSequence : NSObject <NSGSequence>
|
||||
{
|
||||
unichar * _contents_chars;
|
||||
int _count;
|
||||
BOOL _normalized;
|
||||
BOOL _free_contents;
|
||||
}
|
||||
@end
|
||||
|
||||
#endif /* __NSGSequence_h_GNUSTEP_BASE_INCLUDE */
|
55
Headers/gnustep/base/NSGString.h
Normal file
55
Headers/gnustep/base/NSGString.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/* Interface to NSString implementation with Unicode-string backing
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
|
||||
Unicode implementation by: Stevo Crvenkovski
|
||||
<stevoc@lotus.mpt.com.mk>
|
||||
Date: February 1997
|
||||
|
||||
Based on NSGCSting written by: Andrew Kachites McCallum
|
||||
<mccallum@gnu.ai.mit.edu>
|
||||
Date: March 1995
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __NSGString_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __NSGString_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
/* NSGString and NSGMutableString must have the same initial ivar layout
|
||||
because of class_add_behavior() in NSGMutableString's +initialize. */
|
||||
|
||||
@interface NSGString : NSString
|
||||
{
|
||||
unichar * _contents_chars;
|
||||
int _count;
|
||||
BOOL _free_contents;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface NSGMutableString : NSMutableString
|
||||
{
|
||||
unichar * _contents_chars;
|
||||
int _count;
|
||||
BOOL _free_contents;
|
||||
int _capacity;
|
||||
}
|
||||
@end
|
||||
|
||||
#endif /* __NSGString_h_GNUSTEP_BASE_INCLUDE */
|
17
Headers/gnustep/base/Unicode.h
Normal file
17
Headers/gnustep/base/Unicode.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#ifndef __Unicode_h_OBJECTS_INCLUDE
|
||||
#define __Unicode_h_OBJECTS_INCLUDE
|
||||
|
||||
unichar encode_chartouni(char c, NSStringEncoding enc);
|
||||
char encode_unitochar(unichar u, NSStringEncoding enc);
|
||||
unichar chartouni(char c);
|
||||
char unitochar(unichar u);
|
||||
int strtoustr(unichar * u1,const char *s1,int size);
|
||||
int ustrtostr(char *s2,unichar *u1,int size);
|
||||
int uslen (unichar *u);
|
||||
unichar uni_tolower(unichar ch);
|
||||
unichar uni_toupper(unichar ch);
|
||||
unsigned char uni_cop(unichar u);
|
||||
BOOL uni_isnonsp(unichar u);
|
||||
unichar *uni_is_decomp(unichar u);
|
||||
|
||||
#endif /* __Unicode_h_OBJECTS_INCLUDE */
|
788
Headers/gnustep/unicode/caseconv.h
Normal file
788
Headers/gnustep/unicode/caseconv.h
Normal file
|
@ -0,0 +1,788 @@
|
|||
int t_len_tolower=388;
|
||||
|
||||
int t_len_toupper=389;
|
||||
|
||||
unichar t_tolower[][2]=
|
||||
{
|
||||
{0x0041,0x0061},
|
||||
{0x0042,0x0062},
|
||||
{0x0043,0x0063},
|
||||
{0x0044,0x0064},
|
||||
{0x0045,0x0065},
|
||||
{0x0046,0x0066},
|
||||
{0x0047,0x0067},
|
||||
{0x0048,0x0068},
|
||||
{0x0049,0x0069},
|
||||
{0x004a,0x006a},
|
||||
{0x004b,0x006b},
|
||||
{0x004c,0x006c},
|
||||
{0x004d,0x006d},
|
||||
{0x004e,0x006e},
|
||||
{0x004f,0x006f},
|
||||
{0x0050,0x0070},
|
||||
{0x0051,0x0071},
|
||||
{0x0052,0x0072},
|
||||
{0x0053,0x0073},
|
||||
{0x0054,0x0074},
|
||||
{0x0055,0x0075},
|
||||
{0x0056,0x0076},
|
||||
{0x0057,0x0077},
|
||||
{0x0058,0x0078},
|
||||
{0x0059,0x0079},
|
||||
{0x005a,0x007a},
|
||||
{0x00c0,0x00e0},
|
||||
{0x00c1,0x00e1},
|
||||
{0x00c2,0x00e2},
|
||||
{0x00c3,0x00e3},
|
||||
{0x00c4,0x00e4},
|
||||
{0x00c5,0x00e5},
|
||||
{0x00c6,0x00e6},
|
||||
{0x00c7,0x00e7},
|
||||
{0x00c8,0x00e8},
|
||||
{0x00c9,0x00e9},
|
||||
{0x00ca,0x00ea},
|
||||
{0x00cb,0x00eb},
|
||||
{0x00cc,0x00ec},
|
||||
{0x00cd,0x00ed},
|
||||
{0x00ce,0x00ee},
|
||||
{0x00cf,0x00ef},
|
||||
{0x00d0,0x00f0},
|
||||
{0x00d1,0x00f1},
|
||||
{0x00d2,0x00f2},
|
||||
{0x00d3,0x00f3},
|
||||
{0x00d4,0x00f4},
|
||||
{0x00d5,0x00f5},
|
||||
{0x00d6,0x00f6},
|
||||
{0x00d8,0x00f8},
|
||||
{0x00d9,0x00f9},
|
||||
{0x00da,0x00fa},
|
||||
{0x00db,0x00fb},
|
||||
{0x00dc,0x00fc},
|
||||
{0x00dd,0x00fd},
|
||||
{0x00de,0x00fe},
|
||||
{0x0100,0x0101},
|
||||
{0x0102,0x0103},
|
||||
{0x0104,0x0105},
|
||||
{0x0106,0x0107},
|
||||
{0x0108,0x0109},
|
||||
{0x010a,0x010b},
|
||||
{0x010c,0x010d},
|
||||
{0x010e,0x010f},
|
||||
{0x0110,0x0111},
|
||||
{0x0112,0x0113},
|
||||
{0x0114,0x0115},
|
||||
{0x0116,0x0117},
|
||||
{0x0118,0x0119},
|
||||
{0x011a,0x011b},
|
||||
{0x011c,0x011d},
|
||||
{0x011e,0x011f},
|
||||
{0x0120,0x0121},
|
||||
{0x0122,0x0123},
|
||||
{0x0124,0x0125},
|
||||
{0x0126,0x0127},
|
||||
{0x0128,0x0129},
|
||||
{0x012a,0x012b},
|
||||
{0x012c,0x012d},
|
||||
{0x012e,0x012f},
|
||||
{0x0130,0x0131},
|
||||
{0x0132,0x0133},
|
||||
{0x0134,0x0135},
|
||||
{0x0136,0x0137},
|
||||
{0x0139,0x013a},
|
||||
{0x013b,0x013c},
|
||||
{0x013d,0x013e},
|
||||
{0x013f,0x0140},
|
||||
{0x0141,0x0142},
|
||||
{0x0143,0x0144},
|
||||
{0x0145,0x0146},
|
||||
{0x0147,0x0148},
|
||||
{0x014a,0x014b},
|
||||
{0x014c,0x014d},
|
||||
{0x014e,0x014f},
|
||||
{0x0150,0x0151},
|
||||
{0x0152,0x0153},
|
||||
{0x0154,0x0155},
|
||||
{0x0156,0x0157},
|
||||
{0x0158,0x0159},
|
||||
{0x015a,0x015b},
|
||||
{0x015c,0x015d},
|
||||
{0x015e,0x015f},
|
||||
{0x0160,0x0161},
|
||||
{0x0162,0x0163},
|
||||
{0x0164,0x0165},
|
||||
{0x0166,0x0167},
|
||||
{0x0168,0x0169},
|
||||
{0x016a,0x016b},
|
||||
{0x016c,0x016d},
|
||||
{0x016e,0x016f},
|
||||
{0x0170,0x0171},
|
||||
{0x0172,0x0173},
|
||||
{0x0174,0x0175},
|
||||
{0x0176,0x0177},
|
||||
{0x0179,0x017a},
|
||||
{0x017b,0x017c},
|
||||
{0x017d,0x017e},
|
||||
{0x0187,0x0188},
|
||||
{0x0191,0x0192},
|
||||
{0x0198,0x0199},
|
||||
{0x01a0,0x01a1},
|
||||
{0x01a2,0x01a3},
|
||||
{0x01af,0x01b0},
|
||||
{0x01b5,0x01b6},
|
||||
{0x01b7,0x0292},
|
||||
{0x01cd,0x01ce},
|
||||
{0x01cf,0x01d0},
|
||||
{0x01d1,0x01d2},
|
||||
{0x01d3,0x01d4},
|
||||
{0x01d5,0x01d6},
|
||||
{0x01d7,0x01d8},
|
||||
{0x01d9,0x01da},
|
||||
{0x01db,0x01dc},
|
||||
{0x01de,0x01df},
|
||||
{0x01e0,0x01e1},
|
||||
{0x01e2,0x01e3},
|
||||
{0x01e4,0x01e5},
|
||||
{0x01e6,0x01e7},
|
||||
{0x01e8,0x01e9},
|
||||
{0x01ea,0x01eb},
|
||||
{0x01ec,0x01ed},
|
||||
{0x01ee,0x01ef},
|
||||
{0x01f8,0x01f9},
|
||||
{0x01fa,0x01fb},
|
||||
{0x01fc,0x01fd},
|
||||
{0x0200,0x0201},
|
||||
{0x0202,0x0203},
|
||||
{0x0204,0x0205},
|
||||
{0x0206,0x0207},
|
||||
{0x0208,0x0209},
|
||||
{0x020a,0x020b},
|
||||
{0x020c,0x020d},
|
||||
{0x020e,0x020f},
|
||||
{0x0210,0x0211},
|
||||
{0x0212,0x0213},
|
||||
{0x0214,0x0215},
|
||||
{0x0216,0x0217},
|
||||
{0x0386,0x03ac},
|
||||
{0x0388,0x03ad},
|
||||
{0x0389,0x03ae},
|
||||
{0x038a,0x03af},
|
||||
{0x038c,0x03cc},
|
||||
{0x038e,0x03cd},
|
||||
{0x038f,0x03ce},
|
||||
{0x0391,0x03b1},
|
||||
{0x0392,0x03b2},
|
||||
{0x0393,0x03b3},
|
||||
{0x0394,0x03b4},
|
||||
{0x0395,0x03b5},
|
||||
{0x0396,0x03b6},
|
||||
{0x0397,0x03b7},
|
||||
{0x0398,0x03b8},
|
||||
{0x0399,0x03b9},
|
||||
{0x039a,0x03ba},
|
||||
{0x039b,0x03bb},
|
||||
{0x039c,0x03bc},
|
||||
{0x039d,0x03bd},
|
||||
{0x039e,0x03be},
|
||||
{0x039f,0x03bf},
|
||||
{0x03a0,0x03c0},
|
||||
{0x03a1,0x03c1},
|
||||
{0x03a3,0x03c3},
|
||||
{0x03a4,0x03c4},
|
||||
{0x03a5,0x03c5},
|
||||
{0x03a6,0x03c6},
|
||||
{0x03a7,0x03c7},
|
||||
{0x03a8,0x03c8},
|
||||
{0x03a9,0x03c9},
|
||||
{0x03aa,0x03ca},
|
||||
{0x03ab,0x03cb},
|
||||
{0x0401,0x0451},
|
||||
{0x0402,0x0452},
|
||||
{0x0403,0x0453},
|
||||
{0x0404,0x0454},
|
||||
{0x0405,0x0455},
|
||||
{0x0406,0x0456},
|
||||
{0x0407,0x0457},
|
||||
{0x0408,0x0458},
|
||||
{0x0409,0x0459},
|
||||
{0x040a,0x045a},
|
||||
{0x040b,0x045b},
|
||||
{0x040c,0x045c},
|
||||
{0x040f,0x045f},
|
||||
{0x0410,0x0430},
|
||||
{0x0411,0x0431},
|
||||
{0x0412,0x0432},
|
||||
{0x0413,0x0433},
|
||||
{0x0414,0x0434},
|
||||
{0x0415,0x0435},
|
||||
{0x0416,0x0436},
|
||||
{0x0417,0x0437},
|
||||
{0x0418,0x0438},
|
||||
{0x0419,0x0439},
|
||||
{0x041a,0x043a},
|
||||
{0x041b,0x043b},
|
||||
{0x041c,0x043c},
|
||||
{0x041d,0x043d},
|
||||
{0x041e,0x043e},
|
||||
{0x041f,0x043f},
|
||||
{0x0420,0x0440},
|
||||
{0x0421,0x0441},
|
||||
{0x0422,0x0442},
|
||||
{0x0423,0x0443},
|
||||
{0x0424,0x0444},
|
||||
{0x0425,0x0445},
|
||||
{0x0426,0x0446},
|
||||
{0x0427,0x0447},
|
||||
{0x0428,0x0448},
|
||||
{0x0429,0x0449},
|
||||
{0x042a,0x044a},
|
||||
{0x042b,0x044b},
|
||||
{0x042c,0x044c},
|
||||
{0x042d,0x044d},
|
||||
{0x042e,0x044e},
|
||||
{0x042f,0x044f},
|
||||
{0x0462,0x0463},
|
||||
{0x046a,0x046b},
|
||||
{0x0472,0x0473},
|
||||
{0x0474,0x0475},
|
||||
{0x0480,0x0481},
|
||||
{0x0490,0x0491},
|
||||
{0x1e00,0x1e01},
|
||||
{0x1e02,0x1e03},
|
||||
{0x1e04,0x1e05},
|
||||
{0x1e06,0x1e07},
|
||||
{0x1e08,0x1e09},
|
||||
{0x1e0a,0x1e0b},
|
||||
{0x1e0c,0x1e0d},
|
||||
{0x1e0e,0x1e0f},
|
||||
{0x1e10,0x1e11},
|
||||
{0x1e12,0x1e13},
|
||||
{0x1e14,0x1e15},
|
||||
{0x1e16,0x1e17},
|
||||
{0x1e18,0x1e19},
|
||||
{0x1e1a,0x1e1b},
|
||||
{0x1e1c,0x1e1d},
|
||||
{0x1e1e,0x1e1f},
|
||||
{0x1e20,0x1e21},
|
||||
{0x1e22,0x1e23},
|
||||
{0x1e24,0x1e25},
|
||||
{0x1e26,0x1e27},
|
||||
{0x1e28,0x1e29},
|
||||
{0x1e2a,0x1e2b},
|
||||
{0x1e2c,0x1e2d},
|
||||
{0x1e2e,0x1e2f},
|
||||
{0x1e30,0x1e31},
|
||||
{0x1e32,0x1e33},
|
||||
{0x1e34,0x1e35},
|
||||
{0x1e36,0x1e37},
|
||||
{0x1e38,0x1e39},
|
||||
{0x1e3a,0x1e3b},
|
||||
{0x1e3c,0x1e3d},
|
||||
{0x1e3e,0x1e3f},
|
||||
{0x1e40,0x1e41},
|
||||
{0x1e42,0x1e43},
|
||||
{0x1e44,0x1e45},
|
||||
{0x1e46,0x1e47},
|
||||
{0x1e48,0x1e49},
|
||||
{0x1e4a,0x1e4b},
|
||||
{0x1e4c,0x1e4d},
|
||||
{0x1e4e,0x1e4f},
|
||||
{0x1e50,0x1e51},
|
||||
{0x1e52,0x1e53},
|
||||
{0x1e54,0x1e55},
|
||||
{0x1e56,0x1e57},
|
||||
{0x1e58,0x1e59},
|
||||
{0x1e5a,0x1e5b},
|
||||
{0x1e5c,0x1e5d},
|
||||
{0x1e5e,0x1e5f},
|
||||
{0x1e60,0x1e61},
|
||||
{0x1e62,0x1e63},
|
||||
{0x1e64,0x1e65},
|
||||
{0x1e66,0x1e67},
|
||||
{0x1e68,0x1e69},
|
||||
{0x1e6a,0x1e6b},
|
||||
{0x1e6c,0x1e6d},
|
||||
{0x1e6e,0x1e6f},
|
||||
{0x1e70,0x1e71},
|
||||
{0x1e72,0x1e73},
|
||||
{0x1e74,0x1e75},
|
||||
{0x1e76,0x1e77},
|
||||
{0x1e78,0x1e79},
|
||||
{0x1e7a,0x1e7b},
|
||||
{0x1e7c,0x1e7d},
|
||||
{0x1e7e,0x1e7f},
|
||||
{0x1e80,0x1e81},
|
||||
{0x1e82,0x1e83},
|
||||
{0x1e84,0x1e85},
|
||||
{0x1e86,0x1e87},
|
||||
{0x1e88,0x1e89},
|
||||
{0x1e8a,0x1e8b},
|
||||
{0x1e8c,0x1e8d},
|
||||
{0x1e8e,0x1e8f},
|
||||
{0x1e90,0x1e91},
|
||||
{0x1e92,0x1e93},
|
||||
{0x1e94,0x1e95},
|
||||
{0x1ea0,0x1ea1},
|
||||
{0x1ea2,0x1ea3},
|
||||
{0x1ea4,0x1ea5},
|
||||
{0x1ea6,0x1ea7},
|
||||
{0x1ea8,0x1ea9},
|
||||
{0x1eaa,0x1eab},
|
||||
{0x1eac,0x1ead},
|
||||
{0x1eae,0x1eaf},
|
||||
{0x1eb0,0x1eb1},
|
||||
{0x1eb2,0x1eb3},
|
||||
{0x1eb4,0x1eb5},
|
||||
{0x1eb6,0x1eb7},
|
||||
{0x1eb8,0x1eb9},
|
||||
{0x1eba,0x1ebb},
|
||||
{0x1ebc,0x1ebd},
|
||||
{0x1ebe,0x1ebf},
|
||||
{0x1ec0,0x1ec1},
|
||||
{0x1ec2,0x1ec3},
|
||||
{0x1ec4,0x1ec5},
|
||||
{0x1ec6,0x1ec7},
|
||||
{0x1ec8,0x1ec9},
|
||||
{0x1eca,0x1ecb},
|
||||
{0x1ecc,0x1ecd},
|
||||
{0x1ece,0x1ecf},
|
||||
{0x1ed0,0x1ed1},
|
||||
{0x1ed2,0x1ed3},
|
||||
{0x1ed4,0x1ed5},
|
||||
{0x1ed6,0x1ed7},
|
||||
{0x1ed8,0x1ed9},
|
||||
{0x1eda,0x1edb},
|
||||
{0x1edc,0x1edd},
|
||||
{0x1ede,0x1edf},
|
||||
{0x1ee0,0x1ee1},
|
||||
{0x1ee2,0x1ee3},
|
||||
{0x1ee4,0x1ee5},
|
||||
{0x1ee6,0x1ee7},
|
||||
{0x1ee8,0x1ee9},
|
||||
{0x1eea,0x1eeb},
|
||||
{0x1eec,0x1eed},
|
||||
{0x1eee,0x1eef},
|
||||
{0x1ef0,0x1ef1},
|
||||
{0x1ef2,0x1ef3},
|
||||
{0x1ef4,0x1ef5},
|
||||
{0x1ef6,0x1ef7},
|
||||
{0x1ef8,0x1ef9},
|
||||
{0x24b6,0x24d0},
|
||||
{0x24b7,0x24d1},
|
||||
{0x24b8,0x24d2},
|
||||
{0x24b9,0x24d3},
|
||||
{0x24ba,0x24d4},
|
||||
{0x24bb,0x24d5},
|
||||
{0x24bc,0x24d6},
|
||||
{0x24bd,0x24d7},
|
||||
{0x24be,0x24d8},
|
||||
{0x24bf,0x24d9},
|
||||
{0x24c0,0x24da},
|
||||
{0x24c1,0x24db},
|
||||
{0x24c2,0x24dc},
|
||||
{0x24c3,0x24dd},
|
||||
{0x24c4,0x24de},
|
||||
{0x24c5,0x24df},
|
||||
{0x24c6,0x24e0},
|
||||
{0x24c7,0x24e1},
|
||||
{0x24c8,0x24e2},
|
||||
{0x24c9,0x24e3},
|
||||
{0x24ca,0x24e4},
|
||||
{0x24cb,0x24e5},
|
||||
{0x24cc,0x24e6},
|
||||
{0x24cd,0x24e7},
|
||||
{0x24ce,0x24e8},
|
||||
{0x24cf,0x24e9},
|
||||
};
|
||||
|
||||
unichar t_toupper[][2]=
|
||||
{
|
||||
{0x0061,0x0041},
|
||||
{0x0062,0x0042},
|
||||
{0x0063,0x0043},
|
||||
{0x0064,0x0044},
|
||||
{0x0065,0x0045},
|
||||
{0x0066,0x0046},
|
||||
{0x0067,0x0047},
|
||||
{0x0068,0x0048},
|
||||
{0x0069,0x0049},
|
||||
{0x006a,0x004a},
|
||||
{0x006b,0x004b},
|
||||
{0x006c,0x004c},
|
||||
{0x006d,0x004d},
|
||||
{0x006e,0x004e},
|
||||
{0x006f,0x004f},
|
||||
{0x0070,0x0050},
|
||||
{0x0071,0x0051},
|
||||
{0x0072,0x0052},
|
||||
{0x0073,0x0053},
|
||||
{0x0074,0x0054},
|
||||
{0x0075,0x0055},
|
||||
{0x0076,0x0056},
|
||||
{0x0077,0x0057},
|
||||
{0x0078,0x0058},
|
||||
{0x0079,0x0059},
|
||||
{0x007a,0x005a},
|
||||
{0x00e0,0x00c0},
|
||||
{0x00e1,0x00c1},
|
||||
{0x00e2,0x00c2},
|
||||
{0x00e3,0x00c3},
|
||||
{0x00e4,0x00c4},
|
||||
{0x00e5,0x00c5},
|
||||
{0x00e6,0x00c6},
|
||||
{0x00e7,0x00c7},
|
||||
{0x00e8,0x00c8},
|
||||
{0x00e9,0x00c9},
|
||||
{0x00ea,0x00ca},
|
||||
{0x00eb,0x00cb},
|
||||
{0x00ec,0x00cc},
|
||||
{0x00ed,0x00cd},
|
||||
{0x00ee,0x00ce},
|
||||
{0x00ef,0x00cf},
|
||||
{0x00f0,0x00d0},
|
||||
{0x00f1,0x00d1},
|
||||
{0x00f2,0x00d2},
|
||||
{0x00f3,0x00d3},
|
||||
{0x00f4,0x00d4},
|
||||
{0x00f5,0x00d5},
|
||||
{0x00f6,0x00d6},
|
||||
{0x00f8,0x00d8},
|
||||
{0x00f9,0x00d9},
|
||||
{0x00fa,0x00da},
|
||||
{0x00fb,0x00db},
|
||||
{0x00fc,0x00dc},
|
||||
{0x00fd,0x00dd},
|
||||
{0x00fe,0x00de},
|
||||
{0x0101,0x0100},
|
||||
{0x0103,0x0102},
|
||||
{0x0105,0x0104},
|
||||
{0x0107,0x0106},
|
||||
{0x0109,0x0108},
|
||||
{0x010b,0x010a},
|
||||
{0x010d,0x010c},
|
||||
{0x010f,0x010e},
|
||||
{0x0111,0x0110},
|
||||
{0x0113,0x0112},
|
||||
{0x0115,0x0114},
|
||||
{0x0117,0x0116},
|
||||
{0x0119,0x0118},
|
||||
{0x011b,0x011a},
|
||||
{0x011d,0x011c},
|
||||
{0x011f,0x011e},
|
||||
{0x0121,0x0120},
|
||||
{0x0123,0x0122},
|
||||
{0x0125,0x0124},
|
||||
{0x0127,0x0126},
|
||||
{0x0129,0x0128},
|
||||
{0x012b,0x012a},
|
||||
{0x012d,0x012c},
|
||||
{0x012f,0x012e},
|
||||
{0x0131,0x0130},
|
||||
{0x0133,0x0132},
|
||||
{0x0135,0x0134},
|
||||
{0x0137,0x0136},
|
||||
{0x013a,0x0139},
|
||||
{0x013c,0x013b},
|
||||
{0x013e,0x013d},
|
||||
{0x0140,0x013f},
|
||||
{0x0142,0x0141},
|
||||
{0x0144,0x0143},
|
||||
{0x0146,0x0145},
|
||||
{0x0148,0x0147},
|
||||
{0x014b,0x014a},
|
||||
{0x014d,0x014c},
|
||||
{0x014f,0x014e},
|
||||
{0x0151,0x0150},
|
||||
{0x0153,0x0152},
|
||||
{0x0155,0x0154},
|
||||
{0x0157,0x0156},
|
||||
{0x0159,0x0158},
|
||||
{0x015b,0x015a},
|
||||
{0x015d,0x015c},
|
||||
{0x015f,0x015e},
|
||||
{0x0161,0x0160},
|
||||
{0x0163,0x0162},
|
||||
{0x0165,0x0164},
|
||||
{0x0167,0x0166},
|
||||
{0x0169,0x0168},
|
||||
{0x016b,0x016a},
|
||||
{0x016d,0x016c},
|
||||
{0x016f,0x016e},
|
||||
{0x0171,0x0170},
|
||||
{0x0173,0x0172},
|
||||
{0x0175,0x0174},
|
||||
{0x0177,0x0176},
|
||||
{0x017a,0x0179},
|
||||
{0x017c,0x017b},
|
||||
{0x017e,0x017d},
|
||||
{0x0188,0x0187},
|
||||
{0x0192,0x0191},
|
||||
{0x0199,0x0198},
|
||||
{0x01a1,0x01a0},
|
||||
{0x01a3,0x01a2},
|
||||
{0x01b0,0x01af},
|
||||
{0x01b6,0x01b5},
|
||||
{0x01ce,0x01cd},
|
||||
{0x01d0,0x01cf},
|
||||
{0x01d2,0x01d1},
|
||||
{0x01d4,0x01d3},
|
||||
{0x01d6,0x01d5},
|
||||
{0x01d8,0x01d7},
|
||||
{0x01da,0x01d9},
|
||||
{0x01dc,0x01db},
|
||||
{0x01df,0x01de},
|
||||
{0x01e1,0x01e0},
|
||||
{0x01e3,0x01e2},
|
||||
{0x01e5,0x01e4},
|
||||
{0x01e7,0x01e6},
|
||||
{0x01e9,0x01e8},
|
||||
{0x01eb,0x01ea},
|
||||
{0x01ed,0x01ec},
|
||||
{0x01ef,0x01ee},
|
||||
{0x01f9,0x01f8},
|
||||
{0x01fb,0x01fa},
|
||||
{0x01fd,0x01fc},
|
||||
{0x0201,0x0200},
|
||||
{0x0203,0x0202},
|
||||
{0x0205,0x0204},
|
||||
{0x0207,0x0206},
|
||||
{0x0209,0x0208},
|
||||
{0x020b,0x020a},
|
||||
{0x020d,0x020c},
|
||||
{0x020f,0x020e},
|
||||
{0x0211,0x0210},
|
||||
{0x0213,0x0212},
|
||||
{0x0215,0x0214},
|
||||
{0x0217,0x0216},
|
||||
{0x0292,0x01b7},
|
||||
{0x03ac,0x0386},
|
||||
{0x03ad,0x0388},
|
||||
{0x03ae,0x0389},
|
||||
{0x03af,0x038a},
|
||||
{0x03b1,0x0391},
|
||||
{0x03b2,0x0392},
|
||||
{0x03b3,0x0393},
|
||||
{0x03b4,0x0394},
|
||||
{0x03b5,0x0395},
|
||||
{0x03b6,0x0396},
|
||||
{0x03b7,0x0397},
|
||||
{0x03b8,0x0398},
|
||||
{0x03b9,0x0399},
|
||||
{0x03ba,0x039a},
|
||||
{0x03bb,0x039b},
|
||||
{0x03bc,0x039c},
|
||||
{0x03bd,0x039d},
|
||||
{0x03be,0x039e},
|
||||
{0x03bf,0x039f},
|
||||
{0x03c0,0x03a0},
|
||||
{0x03c1,0x03a1},
|
||||
{0x03c2,0x03a3},
|
||||
{0x03c3,0x03a3},
|
||||
{0x03c4,0x03a4},
|
||||
{0x03c5,0x03a5},
|
||||
{0x03c6,0x03a6},
|
||||
{0x03c7,0x03a7},
|
||||
{0x03c8,0x03a8},
|
||||
{0x03c9,0x03a9},
|
||||
{0x03ca,0x03aa},
|
||||
{0x03cb,0x03ab},
|
||||
{0x03cc,0x038c},
|
||||
{0x03cd,0x038e},
|
||||
{0x03ce,0x038f},
|
||||
{0x0430,0x0410},
|
||||
{0x0431,0x0411},
|
||||
{0x0432,0x0412},
|
||||
{0x0433,0x0413},
|
||||
{0x0434,0x0414},
|
||||
{0x0435,0x0415},
|
||||
{0x0436,0x0416},
|
||||
{0x0437,0x0417},
|
||||
{0x0438,0x0418},
|
||||
{0x0439,0x0419},
|
||||
{0x043a,0x041a},
|
||||
{0x043b,0x041b},
|
||||
{0x043c,0x041c},
|
||||
{0x043d,0x041d},
|
||||
{0x043e,0x041e},
|
||||
{0x043f,0x041f},
|
||||
{0x0440,0x0420},
|
||||
{0x0441,0x0421},
|
||||
{0x0442,0x0422},
|
||||
{0x0443,0x0423},
|
||||
{0x0444,0x0424},
|
||||
{0x0445,0x0425},
|
||||
{0x0446,0x0426},
|
||||
{0x0447,0x0427},
|
||||
{0x0448,0x0428},
|
||||
{0x0449,0x0429},
|
||||
{0x044a,0x042a},
|
||||
{0x044b,0x042b},
|
||||
{0x044c,0x042c},
|
||||
{0x044d,0x042d},
|
||||
{0x044e,0x042e},
|
||||
{0x044f,0x042f},
|
||||
{0x0451,0x0401},
|
||||
{0x0452,0x0402},
|
||||
{0x0453,0x0403},
|
||||
{0x0454,0x0404},
|
||||
{0x0455,0x0405},
|
||||
{0x0456,0x0406},
|
||||
{0x0457,0x0407},
|
||||
{0x0458,0x0408},
|
||||
{0x0459,0x0409},
|
||||
{0x045a,0x040a},
|
||||
{0x045b,0x040b},
|
||||
{0x045c,0x040c},
|
||||
{0x045f,0x040f},
|
||||
{0x0463,0x0462},
|
||||
{0x046b,0x046a},
|
||||
{0x0473,0x0472},
|
||||
{0x0475,0x0474},
|
||||
{0x0481,0x0480},
|
||||
{0x0491,0x0490},
|
||||
{0x1e01,0x1e00},
|
||||
{0x1e03,0x1e02},
|
||||
{0x1e05,0x1e04},
|
||||
{0x1e07,0x1e06},
|
||||
{0x1e09,0x1e08},
|
||||
{0x1e0b,0x1e0a},
|
||||
{0x1e0d,0x1e0c},
|
||||
{0x1e0f,0x1e0e},
|
||||
{0x1e11,0x1e10},
|
||||
{0x1e13,0x1e12},
|
||||
{0x1e15,0x1e14},
|
||||
{0x1e17,0x1e16},
|
||||
{0x1e19,0x1e18},
|
||||
{0x1e1b,0x1e1a},
|
||||
{0x1e1d,0x1e1c},
|
||||
{0x1e1f,0x1e1e},
|
||||
{0x1e21,0x1e20},
|
||||
{0x1e23,0x1e22},
|
||||
{0x1e25,0x1e24},
|
||||
{0x1e27,0x1e26},
|
||||
{0x1e29,0x1e28},
|
||||
{0x1e2b,0x1e2a},
|
||||
{0x1e2d,0x1e2c},
|
||||
{0x1e2f,0x1e2e},
|
||||
{0x1e31,0x1e30},
|
||||
{0x1e33,0x1e32},
|
||||
{0x1e35,0x1e34},
|
||||
{0x1e37,0x1e36},
|
||||
{0x1e39,0x1e38},
|
||||
{0x1e3b,0x1e3a},
|
||||
{0x1e3d,0x1e3c},
|
||||
{0x1e3f,0x1e3e},
|
||||
{0x1e41,0x1e40},
|
||||
{0x1e43,0x1e42},
|
||||
{0x1e45,0x1e44},
|
||||
{0x1e47,0x1e46},
|
||||
{0x1e49,0x1e48},
|
||||
{0x1e4b,0x1e4a},
|
||||
{0x1e4d,0x1e4c},
|
||||
{0x1e4f,0x1e4e},
|
||||
{0x1e51,0x1e50},
|
||||
{0x1e53,0x1e52},
|
||||
{0x1e55,0x1e54},
|
||||
{0x1e57,0x1e56},
|
||||
{0x1e59,0x1e58},
|
||||
{0x1e5b,0x1e5a},
|
||||
{0x1e5d,0x1e5c},
|
||||
{0x1e5f,0x1e5e},
|
||||
{0x1e61,0x1e60},
|
||||
{0x1e63,0x1e62},
|
||||
{0x1e65,0x1e64},
|
||||
{0x1e67,0x1e66},
|
||||
{0x1e69,0x1e68},
|
||||
{0x1e6b,0x1e6a},
|
||||
{0x1e6d,0x1e6c},
|
||||
{0x1e6f,0x1e6e},
|
||||
{0x1e71,0x1e70},
|
||||
{0x1e73,0x1e72},
|
||||
{0x1e75,0x1e74},
|
||||
{0x1e77,0x1e76},
|
||||
{0x1e79,0x1e78},
|
||||
{0x1e7b,0x1e7a},
|
||||
{0x1e7d,0x1e7c},
|
||||
{0x1e7f,0x1e7e},
|
||||
{0x1e81,0x1e80},
|
||||
{0x1e83,0x1e82},
|
||||
{0x1e85,0x1e84},
|
||||
{0x1e87,0x1e86},
|
||||
{0x1e89,0x1e88},
|
||||
{0x1e8b,0x1e8a},
|
||||
{0x1e8d,0x1e8c},
|
||||
{0x1e8f,0x1e8e},
|
||||
{0x1e91,0x1e90},
|
||||
{0x1e93,0x1e92},
|
||||
{0x1e95,0x1e94},
|
||||
{0x1ea1,0x1ea0},
|
||||
{0x1ea3,0x1ea2},
|
||||
{0x1ea5,0x1ea4},
|
||||
{0x1ea7,0x1ea6},
|
||||
{0x1ea9,0x1ea8},
|
||||
{0x1eab,0x1eaa},
|
||||
{0x1ead,0x1eac},
|
||||
{0x1eaf,0x1eae},
|
||||
{0x1eb1,0x1eb0},
|
||||
{0x1eb3,0x1eb2},
|
||||
{0x1eb5,0x1eb4},
|
||||
{0x1eb7,0x1eb6},
|
||||
{0x1eb9,0x1eb8},
|
||||
{0x1ebb,0x1eba},
|
||||
{0x1ebd,0x1ebc},
|
||||
{0x1ebf,0x1ebe},
|
||||
{0x1ec1,0x1ec0},
|
||||
{0x1ec3,0x1ec2},
|
||||
{0x1ec5,0x1ec4},
|
||||
{0x1ec7,0x1ec6},
|
||||
{0x1ec9,0x1ec8},
|
||||
{0x1ecb,0x1eca},
|
||||
{0x1ecd,0x1ecc},
|
||||
{0x1ecf,0x1ece},
|
||||
{0x1ed1,0x1ed0},
|
||||
{0x1ed3,0x1ed2},
|
||||
{0x1ed5,0x1ed4},
|
||||
{0x1ed7,0x1ed6},
|
||||
{0x1ed9,0x1ed8},
|
||||
{0x1edb,0x1eda},
|
||||
{0x1edd,0x1edc},
|
||||
{0x1edf,0x1ede},
|
||||
{0x1ee1,0x1ee0},
|
||||
{0x1ee3,0x1ee2},
|
||||
{0x1ee5,0x1ee4},
|
||||
{0x1ee7,0x1ee6},
|
||||
{0x1ee9,0x1ee8},
|
||||
{0x1eeb,0x1eea},
|
||||
{0x1eed,0x1eec},
|
||||
{0x1eef,0x1eee},
|
||||
{0x1ef1,0x1ef0},
|
||||
{0x1ef3,0x1ef2},
|
||||
{0x1ef5,0x1ef4},
|
||||
{0x1ef7,0x1ef6},
|
||||
{0x1ef9,0x1ef8},
|
||||
{0x24d0,0x24b6},
|
||||
{0x24d1,0x24b7},
|
||||
{0x24d2,0x24b8},
|
||||
{0x24d3,0x24b9},
|
||||
{0x24d4,0x24ba},
|
||||
{0x24d5,0x24bb},
|
||||
{0x24d6,0x24bc},
|
||||
{0x24d7,0x24bd},
|
||||
{0x24d8,0x24be},
|
||||
{0x24d9,0x24bf},
|
||||
{0x24da,0x24c0},
|
||||
{0x24db,0x24c1},
|
||||
{0x24dc,0x24c2},
|
||||
{0x24dd,0x24c3},
|
||||
{0x24de,0x24c4},
|
||||
{0x24df,0x24c5},
|
||||
{0x24e0,0x24c6},
|
||||
{0x24e1,0x24c7},
|
||||
{0x24e2,0x24c8},
|
||||
{0x24e3,0x24c9},
|
||||
{0x24e4,0x24ca},
|
||||
{0x24e5,0x24cb},
|
||||
{0x24e6,0x24cc},
|
||||
{0x24e7,0x24cd},
|
||||
{0x24e8,0x24ce},
|
||||
{0x24e9,0x24cf},
|
||||
};
|
364
Headers/gnustep/unicode/cop.h
Normal file
364
Headers/gnustep/unicode/cop.h
Normal file
|
@ -0,0 +1,364 @@
|
|||
/* COP table */
|
||||
|
||||
struct _cop_ {unichar code; unsigned char cop;};
|
||||
const unsigned int uni_cop_table_size = 355;
|
||||
|
||||
struct _cop_ uni_cop_table[]=
|
||||
{
|
||||
{0x0300,230},
|
||||
{0x0301,230},
|
||||
{0x0302,230},
|
||||
{0x0303,230},
|
||||
{0x0304,230},
|
||||
{0x0305,230},
|
||||
{0x0306,230},
|
||||
{0x0307,230},
|
||||
{0x0308,230},
|
||||
{0x0309,230},
|
||||
{0x030A,230},
|
||||
{0x030B,230},
|
||||
{0x030C,230},
|
||||
{0x030D,230},
|
||||
{0x030E,230},
|
||||
{0x030F,230},
|
||||
{0x0310,230},
|
||||
{0x0311,230},
|
||||
{0x0312,230},
|
||||
{0x0313,230},
|
||||
{0x0314,230},
|
||||
{0x0315,232},
|
||||
{0x0316,220},
|
||||
{0x0317,220},
|
||||
{0x0318,220},
|
||||
{0x0319,220},
|
||||
{0x031A,232},
|
||||
{0x031B,216},
|
||||
{0x031C,220},
|
||||
{0x031D,220},
|
||||
{0x031E,220},
|
||||
{0x031F,220},
|
||||
{0x0320,220},
|
||||
{0x0321,202},
|
||||
{0x0322,202},
|
||||
{0x0323,220},
|
||||
{0x0324,220},
|
||||
{0x0325,220},
|
||||
{0x0326,220},
|
||||
{0x0327,202},
|
||||
{0x0328,202},
|
||||
{0x0329,220},
|
||||
{0x032A,220},
|
||||
{0x032B,220},
|
||||
{0x032C,220},
|
||||
{0x032D,220},
|
||||
{0x032E,220},
|
||||
{0x032F,220},
|
||||
{0x0330,220},
|
||||
{0x0331,220},
|
||||
{0x0332,220},
|
||||
{0x0333,220},
|
||||
{0x0334,1},
|
||||
{0x0335,1},
|
||||
{0x0336,1},
|
||||
{0x0337,1},
|
||||
{0x0338,1},
|
||||
{0x0339,220},
|
||||
{0x033A,220},
|
||||
{0x033B,220},
|
||||
{0x033C,220},
|
||||
{0x033D,230},
|
||||
{0x033E,230},
|
||||
{0x033F,230},
|
||||
{0x0340,230},
|
||||
{0x0341,230},
|
||||
{0x0342,230},
|
||||
{0x0343,230},
|
||||
{0x0344,230},
|
||||
{0x0345,220},
|
||||
{0x0360,234},
|
||||
{0x0361,234},
|
||||
{0x0483,230},
|
||||
{0x0484,230},
|
||||
{0x0485,230},
|
||||
{0x0486,230},
|
||||
{0x0591,220},
|
||||
{0x0592,230},
|
||||
{0x0593,230},
|
||||
{0x0594,230},
|
||||
{0x0595,230},
|
||||
{0x0596,220},
|
||||
{0x0597,230},
|
||||
{0x0598,230},
|
||||
{0x0599,230},
|
||||
{0x059A,222},
|
||||
{0x059B,220},
|
||||
{0x059C,230},
|
||||
{0x059D,230},
|
||||
{0x059E,230},
|
||||
{0x059F,230},
|
||||
{0x05A0,230},
|
||||
{0x05A1,230},
|
||||
{0x05A3,220},
|
||||
{0x05A4,220},
|
||||
{0x05A5,220},
|
||||
{0x05A6,220},
|
||||
{0x05A7,220},
|
||||
{0x05A8,230},
|
||||
{0x05A9,230},
|
||||
{0x05AA,220},
|
||||
{0x05AB,230},
|
||||
{0x05AC,230},
|
||||
{0x05AD,222},
|
||||
{0x05AE,230},
|
||||
{0x05AF,230},
|
||||
{0x05B0,10},
|
||||
{0x05B1,11},
|
||||
{0x05B2,12},
|
||||
{0x05B3,13},
|
||||
{0x05B4,14},
|
||||
{0x05B5,15},
|
||||
{0x05B6,16},
|
||||
{0x05B7,17},
|
||||
{0x05B8,18},
|
||||
{0x05B9,19},
|
||||
{0x05BB,20},
|
||||
{0x05BC,21},
|
||||
{0x05BD,22},
|
||||
{0x05BF,23},
|
||||
{0x05C1,24},
|
||||
{0x05C2,25},
|
||||
{0x05C4,230},
|
||||
{0x064B,27},
|
||||
{0x064C,28},
|
||||
{0x064D,29},
|
||||
{0x064E,30},
|
||||
{0x064F,31},
|
||||
{0x0650,32},
|
||||
{0x0651,33},
|
||||
{0x0652,34},
|
||||
{0x0670,35},
|
||||
{0x06D6,230},
|
||||
{0x06D7,230},
|
||||
{0x06D8,230},
|
||||
{0x06D9,230},
|
||||
{0x06DA,230},
|
||||
{0x06DB,230},
|
||||
{0x06DC,230},
|
||||
{0x06DF,230},
|
||||
{0x06E0,230},
|
||||
{0x06E1,230},
|
||||
{0x06E2,230},
|
||||
{0x06E3,220},
|
||||
{0x06E4,230},
|
||||
{0x06E7,230},
|
||||
{0x06E8,230},
|
||||
{0x06EA,220},
|
||||
{0x06EB,230},
|
||||
{0x06EC,230},
|
||||
{0x06ED,220},
|
||||
{0x0901,37},
|
||||
{0x0902,36},
|
||||
{0x093C,7},
|
||||
{0x0941,38},
|
||||
{0x0942,39},
|
||||
{0x0943,40},
|
||||
{0x0944,41},
|
||||
{0x0945,42},
|
||||
{0x0946,43},
|
||||
{0x0947,44},
|
||||
{0x0948,45},
|
||||
{0x094D,9},
|
||||
{0x0951,46},
|
||||
{0x0952,47},
|
||||
{0x0953,230},
|
||||
{0x0954,230},
|
||||
{0x0962,48},
|
||||
{0x0963,49},
|
||||
{0x0981,50},
|
||||
{0x09BC,7},
|
||||
{0x09C1,51},
|
||||
{0x09C2,52},
|
||||
{0x09C3,53},
|
||||
{0x09C4,54},
|
||||
{0x09CD,9},
|
||||
{0x09E2,55},
|
||||
{0x09E3,56},
|
||||
{0x0A02,57},
|
||||
{0x0A3C,7},
|
||||
{0x0A41,58},
|
||||
{0x0A42,59},
|
||||
{0x0A47,60},
|
||||
{0x0A48,61},
|
||||
{0x0A4B,62},
|
||||
{0x0A4C,63},
|
||||
{0x0A4D,9},
|
||||
{0x0A70,64},
|
||||
{0x0A71,65},
|
||||
{0x0A81,67},
|
||||
{0x0A82,66},
|
||||
{0x0ABC,7},
|
||||
{0x0AC1,68},
|
||||
{0x0AC2,69},
|
||||
{0x0AC3,70},
|
||||
{0x0AC4,71},
|
||||
{0x0AC5,72},
|
||||
{0x0AC7,73},
|
||||
{0x0AC8,74},
|
||||
{0x0ACD,9},
|
||||
{0x0B01,75},
|
||||
{0x0B3C,7},
|
||||
{0x0B3F,76},
|
||||
{0x0B41,77},
|
||||
{0x0B42,78},
|
||||
{0x0B43,79},
|
||||
{0x0B4D,9},
|
||||
{0x0B56,230},
|
||||
{0x0BC0,80},
|
||||
{0x0BCD,9},
|
||||
{0x0C3E,81},
|
||||
{0x0C3F,82},
|
||||
{0x0C40,83},
|
||||
{0x0C46,84},
|
||||
{0x0C47,85},
|
||||
{0x0C48,86},
|
||||
{0x0C4A,87},
|
||||
{0x0C4B,88},
|
||||
{0x0C4C,89},
|
||||
{0x0C4D,9},
|
||||
{0x0C55,90},
|
||||
{0x0C56,91},
|
||||
{0x0CBF,92},
|
||||
{0x0CC6,93},
|
||||
{0x0CCC,94},
|
||||
{0x0CCD,9},
|
||||
{0x0D41,95},
|
||||
{0x0D42,96},
|
||||
{0x0D43,97},
|
||||
{0x0D4D,9},
|
||||
{0x0E31,98},
|
||||
{0x0E34,99},
|
||||
{0x0E35,100},
|
||||
{0x0E36,101},
|
||||
{0x0E37,102},
|
||||
{0x0E38,103},
|
||||
{0x0E39,104},
|
||||
{0x0E3A,105},
|
||||
{0x0E47,106},
|
||||
{0x0E48,107},
|
||||
{0x0E49,108},
|
||||
{0x0E4A,109},
|
||||
{0x0E4B,110},
|
||||
{0x0E4C,111},
|
||||
{0x0E4D,112},
|
||||
{0x0E4E,128},
|
||||
{0x0EB1,113},
|
||||
{0x0EB4,114},
|
||||
{0x0EB5,115},
|
||||
{0x0EB6,116},
|
||||
{0x0EB7,117},
|
||||
{0x0EB8,118},
|
||||
{0x0EB9,119},
|
||||
{0x0EBB,120},
|
||||
{0x0EBC,121},
|
||||
{0x0EC8,122},
|
||||
{0x0EC9,123},
|
||||
{0x0ECA,124},
|
||||
{0x0ECB,125},
|
||||
{0x0ECC,126},
|
||||
{0x0ECD,127},
|
||||
{0x0F18,220},
|
||||
{0x0F19,220},
|
||||
{0x0F35,230},
|
||||
{0x0F37,230},
|
||||
{0x0F39,216},
|
||||
{0x0F3E,220},
|
||||
{0x0F3F,220},
|
||||
{0x0F71,129},
|
||||
{0x0F72,130},
|
||||
{0x0F73,131},
|
||||
{0x0F74,132},
|
||||
{0x0F75,133},
|
||||
{0x0F76,134},
|
||||
{0x0F77,135},
|
||||
{0x0F78,136},
|
||||
{0x0F79,137},
|
||||
{0x0F7A,138},
|
||||
{0x0F7B,139},
|
||||
{0x0F7C,140},
|
||||
{0x0F7D,141},
|
||||
{0x0F7E,142},
|
||||
{0x0F80,143},
|
||||
{0x0F81,144},
|
||||
{0x0F82,230},
|
||||
{0x0F83,230},
|
||||
{0x0F84,9},
|
||||
{0x0F86,230},
|
||||
{0x0F87,230},
|
||||
{0x0F88,230},
|
||||
{0x0F89,230},
|
||||
{0x0F8A,230},
|
||||
{0x0F8B,230},
|
||||
{0x0F90,6},
|
||||
{0x0F91,6},
|
||||
{0x0F92,6},
|
||||
{0x0F93,6},
|
||||
{0x0F94,6},
|
||||
{0x0F95,6},
|
||||
{0x0F97,6},
|
||||
{0x0F99,6},
|
||||
{0x0F9A,6},
|
||||
{0x0F9B,6},
|
||||
{0x0F9C,6},
|
||||
{0x0F9D,6},
|
||||
{0x0F9E,6},
|
||||
{0x0F9F,6},
|
||||
{0x0FA0,6},
|
||||
{0x0FA1,6},
|
||||
{0x0FA2,6},
|
||||
{0x0FA3,6},
|
||||
{0x0FA4,6},
|
||||
{0x0FA5,6},
|
||||
{0x0FA6,6},
|
||||
{0x0FA7,6},
|
||||
{0x0FA8,6},
|
||||
{0x0FA9,6},
|
||||
{0x0FAA,6},
|
||||
{0x0FAB,6},
|
||||
{0x0FAC,6},
|
||||
{0x0FAD,6},
|
||||
{0x0FB1,6},
|
||||
{0x0FB2,6},
|
||||
{0x0FB3,6},
|
||||
{0x0FB4,6},
|
||||
{0x0FB5,6},
|
||||
{0x0FB6,6},
|
||||
{0x0FB7,6},
|
||||
{0x0FB9,6},
|
||||
{0x20D0,230},
|
||||
{0x20D1,230},
|
||||
{0x20D2,1},
|
||||
{0x20D3,1},
|
||||
{0x20D4,230},
|
||||
{0x20D5,230},
|
||||
{0x20D6,230},
|
||||
{0x20D7,230},
|
||||
{0x20D8,1},
|
||||
{0x20D9,1},
|
||||
{0x20DA,1},
|
||||
{0x20DB,230},
|
||||
{0x20DC,230},
|
||||
{0x20E1,1},
|
||||
{0x302A,218},
|
||||
{0x302B,228},
|
||||
{0x302C,232},
|
||||
{0x302D,222},
|
||||
{0x302E,224},
|
||||
{0x302F,224},
|
||||
{0x3099,8},
|
||||
{0x309A,8},
|
||||
{0xFB1E,26},
|
||||
{0xFE20,230},
|
||||
{0xFE21,230},
|
||||
{0xFE22,230},
|
||||
{0xFE23,230},
|
||||
};
|
271
Headers/gnustep/unicode/cyrillic.h
Normal file
271
Headers/gnustep/unicode/cyrillic.h
Normal file
|
@ -0,0 +1,271 @@
|
|||
// ISO_8859-5,1988 to Unicode maping
|
||||
|
||||
const unsigned int Cyrillic_conv_base = 0x80;
|
||||
|
||||
unichar Cyrillic_char_to_uni_table[] =
|
||||
{
|
||||
0x0080,
|
||||
0x0081,
|
||||
0x0082,
|
||||
0x0083,
|
||||
0x0084,
|
||||
0x0085,
|
||||
0x0086,
|
||||
0x0087,
|
||||
0x0088,
|
||||
0x0089,
|
||||
0x008A,
|
||||
0x008B,
|
||||
0x008C,
|
||||
0x008D,
|
||||
0x008E,
|
||||
0x008F,
|
||||
0x0090,
|
||||
0x0091,
|
||||
0x0092,
|
||||
0x0093,
|
||||
0x0094,
|
||||
0x0095,
|
||||
0x0096,
|
||||
0x0097,
|
||||
0x0098,
|
||||
0x0099,
|
||||
0x009A,
|
||||
0x009B,
|
||||
0x009C,
|
||||
0x009D,
|
||||
0x009E,
|
||||
0x009F,
|
||||
0x00A0,
|
||||
0x0401,
|
||||
0x0402,
|
||||
0x0403,
|
||||
0x0404,
|
||||
0x0405,
|
||||
0x0406,
|
||||
0x0407,
|
||||
0x0408,
|
||||
0x0409,
|
||||
0x040A,
|
||||
0x040B,
|
||||
0x040C,
|
||||
0x00AD,
|
||||
0x040E,
|
||||
0x040F,
|
||||
0x0410,
|
||||
0x0411,
|
||||
0x0412,
|
||||
0x0413,
|
||||
0x0414,
|
||||
0x0415,
|
||||
0x0416,
|
||||
0x0417,
|
||||
0x0418,
|
||||
0x0419,
|
||||
0x041A,
|
||||
0x041B,
|
||||
0x041C,
|
||||
0x041D,
|
||||
0x041E,
|
||||
0x041F,
|
||||
0x0420,
|
||||
0x0421,
|
||||
0x0422,
|
||||
0x0423,
|
||||
0x0424,
|
||||
0x0425,
|
||||
0x0426,
|
||||
0x0427,
|
||||
0x0428,
|
||||
0x0429,
|
||||
0x042A,
|
||||
0x042B,
|
||||
0x042C,
|
||||
0x042D,
|
||||
0x042E,
|
||||
0x042F,
|
||||
0x0430,
|
||||
0x0431,
|
||||
0x0432,
|
||||
0x0433,
|
||||
0x0434,
|
||||
0x0435,
|
||||
0x0436,
|
||||
0x0437,
|
||||
0x0438,
|
||||
0x0439,
|
||||
0x043A,
|
||||
0x043B,
|
||||
0x043C,
|
||||
0x043D,
|
||||
0x043E,
|
||||
0x043F,
|
||||
0x0440,
|
||||
0x0441,
|
||||
0x0442,
|
||||
0x0443,
|
||||
0x0444,
|
||||
0x0445,
|
||||
0x0446,
|
||||
0x0447,
|
||||
0x0448,
|
||||
0x0449,
|
||||
0x044A,
|
||||
0x044B,
|
||||
0x044C,
|
||||
0x044D,
|
||||
0x044E,
|
||||
0x044F,
|
||||
0x2116,
|
||||
0x0451,
|
||||
0x0452,
|
||||
0x0453,
|
||||
0x0454,
|
||||
0x0455,
|
||||
0x0456,
|
||||
0x0457,
|
||||
0x0458,
|
||||
0x0459,
|
||||
0x045A,
|
||||
0x045B,
|
||||
0x045C,
|
||||
0x00A7,
|
||||
0x045E,
|
||||
0x045F,
|
||||
};
|
||||
|
||||
// Unicode to ISO_8859-5,1988 maping
|
||||
|
||||
const unsigned int Cyrillic_uni_to_char_table_size = 128;
|
||||
|
||||
struct _ucc_ Cyrillic_uni_to_char_table[]=
|
||||
{
|
||||
{0x0080,0x80},
|
||||
{0x0081,0x81},
|
||||
{0x0082,0x82},
|
||||
{0x0083,0x83},
|
||||
{0x0084,0x84},
|
||||
{0x0085,0x85},
|
||||
{0x0086,0x86},
|
||||
{0x0087,0x87},
|
||||
{0x0088,0x88},
|
||||
{0x0089,0x89},
|
||||
{0x008A,0x8A},
|
||||
{0x008B,0x8B},
|
||||
{0x008C,0x8C},
|
||||
{0x008D,0x8D},
|
||||
{0x008E,0x8E},
|
||||
{0x008F,0x8F},
|
||||
{0x0090,0x90},
|
||||
{0x0091,0x91},
|
||||
{0x0092,0x92},
|
||||
{0x0093,0x93},
|
||||
{0x0094,0x94},
|
||||
{0x0095,0x95},
|
||||
{0x0096,0x96},
|
||||
{0x0097,0x97},
|
||||
{0x0098,0x98},
|
||||
{0x0099,0x99},
|
||||
{0x009A,0x9A},
|
||||
{0x009B,0x9B},
|
||||
{0x009C,0x9C},
|
||||
{0x009D,0x9D},
|
||||
{0x009E,0x9E},
|
||||
{0x009F,0x9F},
|
||||
{0x00A0,0xA0},
|
||||
{0x00A7,0xFD},
|
||||
{0x00AD,0xAD},
|
||||
{0x0401,0xA1},
|
||||
{0x0402,0xA2},
|
||||
{0x0403,0xA3},
|
||||
{0x0404,0xA4},
|
||||
{0x0405,0xA5},
|
||||
{0x0406,0xA6},
|
||||
{0x0407,0xA7},
|
||||
{0x0408,0xA8},
|
||||
{0x0409,0xA9},
|
||||
{0x040A,0xAA},
|
||||
{0x040B,0xAB},
|
||||
{0x040C,0xAC},
|
||||
{0x040E,0xAE},
|
||||
{0x040F,0xAF},
|
||||
{0x0410,0xB0},
|
||||
{0x0411,0xB1},
|
||||
{0x0412,0xB2},
|
||||
{0x0413,0xB3},
|
||||
{0x0414,0xB4},
|
||||
{0x0415,0xB5},
|
||||
{0x0416,0xB6},
|
||||
{0x0417,0xB7},
|
||||
{0x0418,0xB8},
|
||||
{0x0419,0xB9},
|
||||
{0x041A,0xBA},
|
||||
{0x041B,0xBB},
|
||||
{0x041C,0xBC},
|
||||
{0x041D,0xBD},
|
||||
{0x041E,0xBE},
|
||||
{0x041F,0xBF},
|
||||
{0x0420,0xC0},
|
||||
{0x0421,0xC1},
|
||||
{0x0422,0xC2},
|
||||
{0x0423,0xC3},
|
||||
{0x0424,0xC4},
|
||||
{0x0425,0xC5},
|
||||
{0x0426,0xC6},
|
||||
{0x0427,0xC7},
|
||||
{0x0428,0xC8},
|
||||
{0x0429,0xC9},
|
||||
{0x042A,0xCA},
|
||||
{0x042B,0xCB},
|
||||
{0x042C,0xCC},
|
||||
{0x042D,0xCD},
|
||||
{0x042E,0xCE},
|
||||
{0x042F,0xCF},
|
||||
{0x0430,0xD0},
|
||||
{0x0431,0xD1},
|
||||
{0x0432,0xD2},
|
||||
{0x0433,0xD3},
|
||||
{0x0434,0xD4},
|
||||
{0x0435,0xD5},
|
||||
{0x0436,0xD6},
|
||||
{0x0437,0xD7},
|
||||
{0x0438,0xD8},
|
||||
{0x0439,0xD9},
|
||||
{0x043A,0xDA},
|
||||
{0x043B,0xDB},
|
||||
{0x043C,0xDC},
|
||||
{0x043D,0xDD},
|
||||
{0x043E,0xDE},
|
||||
{0x043F,0xDF},
|
||||
{0x0440,0xE0},
|
||||
{0x0441,0xE1},
|
||||
{0x0442,0xE2},
|
||||
{0x0443,0xE3},
|
||||
{0x0444,0xE4},
|
||||
{0x0445,0xE5},
|
||||
{0x0446,0xE6},
|
||||
{0x0447,0xE7},
|
||||
{0x0448,0xE8},
|
||||
{0x0449,0xE9},
|
||||
{0x044A,0xEA},
|
||||
{0x044B,0xEB},
|
||||
{0x044C,0xEC},
|
||||
{0x044D,0xED},
|
||||
{0x044E,0xEE},
|
||||
{0x044F,0xEF},
|
||||
{0x0451,0xF1},
|
||||
{0x0452,0xF2},
|
||||
{0x0453,0xF3},
|
||||
{0x0454,0xF4},
|
||||
{0x0455,0xF5},
|
||||
{0x0456,0xF6},
|
||||
{0x0457,0xF7},
|
||||
{0x0458,0xF8},
|
||||
{0x0459,0xF9},
|
||||
{0x045A,0xFA},
|
||||
{0x045B,0xFB},
|
||||
{0x045C,0xFC},
|
||||
{0x045E,0xFE},
|
||||
{0x045F,0xFF},
|
||||
{0x2116,0xF0},
|
||||
};
|
1060
Headers/gnustep/unicode/decomp.h
Normal file
1060
Headers/gnustep/unicode/decomp.h
Normal file
File diff suppressed because it is too large
Load diff
255
Headers/gnustep/unicode/nextstep.h
Normal file
255
Headers/gnustep/unicode/nextstep.h
Normal file
|
@ -0,0 +1,255 @@
|
|||
// Next to Unicode maping
|
||||
const unsigned int Next_conv_base = 0x80;
|
||||
unichar Next_char_to_uni_table[] =
|
||||
{
|
||||
0x00A0,
|
||||
0x00C0,
|
||||
0x00C1,
|
||||
0x00C2,
|
||||
0x00C3,
|
||||
0x00C4,
|
||||
0x00C5,
|
||||
0x00C7,
|
||||
0x00C8,
|
||||
0x00C9,
|
||||
0x00CA,
|
||||
0x00CB,
|
||||
0x00CC,
|
||||
0x00CD,
|
||||
0x00CE,
|
||||
0x00CF,
|
||||
0x00D0,
|
||||
0x00D1,
|
||||
0x00D2,
|
||||
0x00D3,
|
||||
0x00D4,
|
||||
0x00D5,
|
||||
0x00D6,
|
||||
0x00D9,
|
||||
0x00DA,
|
||||
0x00DB,
|
||||
0x00DC,
|
||||
0x00DD,
|
||||
0x00DE,
|
||||
0x00B5,
|
||||
0x00D7,
|
||||
0x00F7,
|
||||
0x00A9,
|
||||
0x00A1,
|
||||
0x00A2,
|
||||
0x00A3,
|
||||
0x2044,
|
||||
0x00A5,
|
||||
0x0192,
|
||||
0x00A7,
|
||||
0x00A4,
|
||||
0x201C,
|
||||
0x00AB,
|
||||
0xFB01,
|
||||
0xFB02,
|
||||
0x00AE,
|
||||
0x2013,
|
||||
0x2020,
|
||||
0x2021,
|
||||
0x00B7,
|
||||
0x00A6,
|
||||
0x00B6,
|
||||
0x2022,
|
||||
0x201D,
|
||||
0x00BB,
|
||||
0x2026,
|
||||
0x2030,
|
||||
0x00AC,
|
||||
0x00BF,
|
||||
0x00B9,
|
||||
0x02CB,
|
||||
0x00B4,
|
||||
0x02C6,
|
||||
0x02DC,
|
||||
0x00AF,
|
||||
0x02D8,
|
||||
0x02D9,
|
||||
0x00A8,
|
||||
0x00B2,
|
||||
0x02DA,
|
||||
0x00B8,
|
||||
0x00B3,
|
||||
0x02DD,
|
||||
0x02DB,
|
||||
0x02C7,
|
||||
0x2014,
|
||||
0x00B1,
|
||||
0x00BC,
|
||||
0x00BD,
|
||||
0x00BE,
|
||||
0x00E0,
|
||||
0x00E1,
|
||||
0x00E2,
|
||||
0x00E3,
|
||||
0x00E4,
|
||||
0x00E5,
|
||||
0x00E7,
|
||||
0x00E8,
|
||||
0x00E9,
|
||||
0x00EA,
|
||||
0x00EB,
|
||||
0x00EC,
|
||||
0x00C6,
|
||||
0x00ED,
|
||||
0x00AA,
|
||||
0x00EE,
|
||||
0x00EF,
|
||||
0x00F0,
|
||||
0x00F1,
|
||||
0x0141,
|
||||
0x00D8,
|
||||
0x0152,
|
||||
0x00BA,
|
||||
0x00F2,
|
||||
0x00F3,
|
||||
0x00F4,
|
||||
0x00F5,
|
||||
0x00F6,
|
||||
0x00E6,
|
||||
0x00F9,
|
||||
0x00FA,
|
||||
0x00FB,
|
||||
0x0131,
|
||||
0x00FC,
|
||||
0x00FD,
|
||||
0x0142,
|
||||
0x00F8,
|
||||
0x0153,
|
||||
0x00DF,
|
||||
0x00FE,
|
||||
0x00FF,
|
||||
};
|
||||
|
||||
// Unicode to NextStep maping
|
||||
|
||||
const unsigned int Next_uni_to_char_table_size = 128;
|
||||
|
||||
struct _ucc_ Next_uni_to_char_table[]=
|
||||
{
|
||||
{0x00A0,0x80},
|
||||
{0x00A1,0xA1},
|
||||
{0x00A2,0xA2},
|
||||
{0x00A3,0xA3},
|
||||
{0x00A4,0xA8},
|
||||
{0x00A5,0xA5},
|
||||
{0x00A6,0xB5},
|
||||
{0x00A7,0xA7},
|
||||
{0x00A8,0xC8},
|
||||
{0x00A9,0xA0},
|
||||
{0x00AA,0xE3},
|
||||
{0x00AB,0xAB},
|
||||
{0x00AC,0xBE},
|
||||
{0x00AE,0xB0},
|
||||
{0x00AF,0xC5},
|
||||
{0x00B1,0xD1},
|
||||
{0x00B2,0xC9},
|
||||
{0x00B3,0xCC},
|
||||
{0x00B4,0xC2},
|
||||
{0x00B5,0x9D},
|
||||
{0x00B6,0xB6},
|
||||
{0x00B7,0xB4},
|
||||
{0x00B8,0xCB},
|
||||
{0x00B9,0xC0},
|
||||
{0x00BA,0xEB},
|
||||
{0x00BB,0xBB},
|
||||
{0x00BC,0xD2},
|
||||
{0x00BD,0xD3},
|
||||
{0x00BE,0xD4},
|
||||
{0x00BF,0xBF},
|
||||
{0x00C0,0x81},
|
||||
{0x00C1,0x82},
|
||||
{0x00C2,0x83},
|
||||
{0x00C3,0x84},
|
||||
{0x00C4,0x85},
|
||||
{0x00C5,0x86},
|
||||
{0x00C6,0xE1},
|
||||
{0x00C7,0x87},
|
||||
{0x00C8,0x88},
|
||||
{0x00C9,0x89},
|
||||
{0x00CA,0x8A},
|
||||
{0x00CB,0x8B},
|
||||
{0x00CC,0x8C},
|
||||
{0x00CD,0x8D},
|
||||
{0x00CE,0x8E},
|
||||
{0x00CF,0x8F},
|
||||
{0x00D0,0x90},
|
||||
{0x00D1,0x91},
|
||||
{0x00D2,0x92},
|
||||
{0x00D3,0x93},
|
||||
{0x00D4,0x94},
|
||||
{0x00D5,0x95},
|
||||
{0x00D6,0x96},
|
||||
{0x00D7,0x9E},
|
||||
{0x00D8,0xE9},
|
||||
{0x00D9,0x97},
|
||||
{0x00DA,0x98},
|
||||
{0x00DB,0x99},
|
||||
{0x00DC,0x9A},
|
||||
{0x00DD,0x9B},
|
||||
{0x00DE,0x9C},
|
||||
{0x00DF,0xFB},
|
||||
{0x00E0,0xD5},
|
||||
{0x00E1,0xD6},
|
||||
{0x00E2,0xD7},
|
||||
{0x00E3,0xD8},
|
||||
{0x00E4,0xD9},
|
||||
{0x00E5,0xDA},
|
||||
{0x00E6,0xF1},
|
||||
{0x00E7,0xDB},
|
||||
{0x00E8,0xDC},
|
||||
{0x00E9,0xDD},
|
||||
{0x00EA,0xDE},
|
||||
{0x00EB,0xDF},
|
||||
{0x00EC,0xE0},
|
||||
{0x00ED,0xE2},
|
||||
{0x00EE,0xE4},
|
||||
{0x00EF,0xE5},
|
||||
{0x00F0,0xE6},
|
||||
{0x00F1,0xE7},
|
||||
{0x00F2,0xEC},
|
||||
{0x00F3,0xED},
|
||||
{0x00F4,0xEE},
|
||||
{0x00F5,0xEF},
|
||||
{0x00F6,0xF0},
|
||||
{0x00F7,0x9F},
|
||||
{0x00F8,0xF9},
|
||||
{0x00F9,0xF2},
|
||||
{0x00FA,0xF3},
|
||||
{0x00FB,0xF4},
|
||||
{0x00FC,0xF6},
|
||||
{0x00FD,0xF7},
|
||||
{0x00FE,0xFC},
|
||||
{0x00FF,0xFD},
|
||||
{0x0131,0xF5},
|
||||
{0x0141,0xE8},
|
||||
{0x0142,0xF8},
|
||||
{0x0152,0xEA},
|
||||
{0x0153,0xFA},
|
||||
{0x0192,0xA6},
|
||||
{0x02C6,0xC3},
|
||||
{0x02C7,0xCF},
|
||||
{0x02CB,0xC1},
|
||||
{0x02D8,0xC6},
|
||||
{0x02D9,0xC7},
|
||||
{0x02DA,0xCA},
|
||||
{0x02DB,0xCE},
|
||||
{0x02DC,0xC4},
|
||||
{0x02DD,0xCD},
|
||||
{0x2013,0xB1},
|
||||
{0x2014,0xD0},
|
||||
{0x201C,0xAA},
|
||||
{0x201D,0xBA},
|
||||
{0x2020,0xB2},
|
||||
{0x2021,0xB3},
|
||||
{0x2022,0xB7},
|
||||
{0x2026,0xBC},
|
||||
{0x2030,0xBD},
|
||||
{0x2044,0xA4},
|
||||
{0xFB01,0xAE},
|
||||
{0xFB02,0xAF},
|
||||
};
|
382
Source/NSGSequence.m
Normal file
382
Source/NSGSequence.m
Normal file
|
@ -0,0 +1,382 @@
|
|||
/* Implementation of composite character sequence class for GNUSTEP
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Stevo Crvenkovski
|
||||
Date: March 1997
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <gnustep/base/Coding.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSCharacterSet.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <gnustep/base/IndexedCollection.h>
|
||||
#include <gnustep/base/IndexedCollectionPrivate.h>
|
||||
#include <limits.h>
|
||||
#include <string.h> // for strstr()
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gnustep/base/NSGSequence.h>
|
||||
#include <gnustep/base//Unicode.h>
|
||||
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
@implementation NSGSequence
|
||||
|
||||
// Creating Temporary Sequences
|
||||
|
||||
+ (NSGSequence*) sequenceWithString: (NSString*) aString
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
return [[[self alloc] initWithString: aString range: aRange]
|
||||
autorelease];
|
||||
}
|
||||
|
||||
+ (NSGSequence*) sequenceWithSequence: (NSGSequence*) aSequence
|
||||
|
||||
{
|
||||
return [[[self alloc]
|
||||
initWithSequence: aSequence]
|
||||
autorelease];
|
||||
}
|
||||
|
||||
+ (NSGSequence*) sequenceWithCharacters: (unichar *) characters
|
||||
length: (int) len
|
||||
{
|
||||
return [[[self alloc]
|
||||
initWithCharacters: characters length: len]
|
||||
autorelease];
|
||||
}
|
||||
|
||||
// Initializing Newly Allocated Sequences
|
||||
|
||||
// xxx take care of _normalize in all init* methods
|
||||
- (id) init
|
||||
{
|
||||
return [self initWithString:@"" range: NSMakeRange(0,0)];
|
||||
}
|
||||
|
||||
- (id) initWithString: (NSString*)string
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
unichar *s;
|
||||
if (aRange.location > [string length])
|
||||
[NSException raise: NSRangeException format:@"Invalid location."];
|
||||
|
||||
if (aRange.length > ([string length] - aRange.location))
|
||||
[NSException raise: NSRangeException format:@"Invalid location+length."];
|
||||
OBJC_MALLOC(s, unichar, aRange.length+1);
|
||||
[string getCharacters:s range: aRange];
|
||||
s[aRange.length] = (unichar)0;
|
||||
return [self initWithCharactersNoCopy:s length: aRange.length freeWhenDone:YES];
|
||||
}
|
||||
|
||||
- (id) initWithSequence: (NSGSequence*) aSequence
|
||||
{
|
||||
unichar *s;
|
||||
int len=[aSequence length];
|
||||
OBJC_MALLOC(s, unichar, len+1);
|
||||
[aSequence getCharacters:s];
|
||||
s[len] = (unichar)0;
|
||||
return [self initWithCharactersNoCopy:s length:len freeWhenDone:YES];
|
||||
}
|
||||
|
||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag
|
||||
{
|
||||
_count = length;
|
||||
_contents_chars = chars;
|
||||
_free_contents = flag;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithCharacters: (const unichar*)chars
|
||||
length: (unsigned int)length
|
||||
{
|
||||
unichar *s;
|
||||
OBJC_MALLOC(s, unichar, length+1);
|
||||
if (chars)
|
||||
memcpy(s, chars,2*length);
|
||||
s[length] = (unichar)0;
|
||||
return [self initWithCharactersNoCopy:s length:length freeWhenDone:YES];
|
||||
}
|
||||
|
||||
// Getting a Length of Sequence
|
||||
|
||||
- (unsigned int) length
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
// Accessing Characters
|
||||
|
||||
- (unichar) characterAtIndex: (unsigned int)index
|
||||
{
|
||||
/* xxx raise NSException instead of assert. */
|
||||
assert(index < [self length]);
|
||||
return _contents_chars[index];
|
||||
}
|
||||
|
||||
- (unichar) baseCharacter
|
||||
{
|
||||
if(![self isNormalized])
|
||||
[self normalize];
|
||||
return _contents_chars[0];
|
||||
}
|
||||
|
||||
- (unichar) precomposedCharacter
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return _contents_chars[0];
|
||||
}
|
||||
|
||||
/* Inefficient. */
|
||||
- (void) getCharacters: (unichar*)buffer
|
||||
{
|
||||
[self getCharacters:buffer range:((NSRange){0,[self length]})];
|
||||
return;
|
||||
}
|
||||
|
||||
/* Inefficient. */
|
||||
- (void) getCharacters: (unichar*)buffer
|
||||
range: (NSRange)aRange
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < aRange.length; i++)
|
||||
{
|
||||
buffer[i] = [self characterAtIndex: aRange.location+i];
|
||||
}
|
||||
}
|
||||
|
||||
//for debuging
|
||||
- (NSString*) description
|
||||
{
|
||||
unichar * point;
|
||||
point=_contents_chars;
|
||||
while(*point)
|
||||
printf("%X ",*point++);
|
||||
printf("\n");
|
||||
return @"";
|
||||
}
|
||||
|
||||
- (NSGSequence*) decompose
|
||||
{
|
||||
#define MAXDEC 18
|
||||
|
||||
unichar *source;
|
||||
unichar *target;
|
||||
unichar *spoint;
|
||||
unichar *tpoint;
|
||||
unichar *dpoint;
|
||||
BOOL notdone;
|
||||
|
||||
OBJC_MALLOC(source, unichar, _count*MAXDEC+1);
|
||||
OBJC_MALLOC(target, unichar, _count*MAXDEC+1);
|
||||
|
||||
spoint = source;
|
||||
tpoint = target;
|
||||
|
||||
if (_count)
|
||||
memcpy(source, _contents_chars,2*_count);
|
||||
source[_count]=(unichar)(0);
|
||||
|
||||
do
|
||||
{
|
||||
notdone=FALSE;
|
||||
do
|
||||
{
|
||||
if(!(dpoint=uni_is_decomp(*spoint)))
|
||||
*tpoint++ = *spoint;
|
||||
else
|
||||
{
|
||||
while(*dpoint)
|
||||
*tpoint++=*dpoint++;
|
||||
notdone=TRUE;
|
||||
} /* else */
|
||||
} while(*spoint++);
|
||||
|
||||
*tpoint=(unichar)0; // *** maybe not needed
|
||||
|
||||
memcpy(source, target,2*(_count*MAXDEC+1));
|
||||
|
||||
tpoint = target; // ***
|
||||
spoint = source; // ***
|
||||
|
||||
} while(notdone);
|
||||
|
||||
return [self initWithCharacters: source length: uslen(source)];
|
||||
}
|
||||
|
||||
- (NSGSequence*) order
|
||||
{
|
||||
unichar *first,*second,tmp;
|
||||
int count,len;
|
||||
BOOL notdone;
|
||||
|
||||
do
|
||||
{
|
||||
notdone=NO;
|
||||
first=_contents_chars;
|
||||
second=first+1;
|
||||
len=[self length];
|
||||
for(count=1;count<len;count++)
|
||||
{
|
||||
if(uni_cop(*second))
|
||||
{
|
||||
if(uni_cop(*first)>uni_cop(*second))
|
||||
{
|
||||
tmp= *first;
|
||||
*first= *second;
|
||||
*second=tmp;
|
||||
notdone=YES;
|
||||
}
|
||||
}
|
||||
first++;
|
||||
second++;
|
||||
}
|
||||
} while(notdone);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSGSequence*) normalize
|
||||
{
|
||||
if(![self isNormalized])
|
||||
{
|
||||
[[self decompose] order];
|
||||
_normalized=YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) isEqual: (NSGSequence*) aSequence
|
||||
{
|
||||
return [self compare:aSequence]==NSOrderedSame;
|
||||
}
|
||||
|
||||
- (BOOL) isNormalized
|
||||
{
|
||||
return _normalized;
|
||||
}
|
||||
|
||||
- (BOOL) isComposite
|
||||
{
|
||||
if(uni_is_decomp(_contents_chars[0]))
|
||||
return YES;
|
||||
else
|
||||
if([self length]<2)
|
||||
return NO;
|
||||
else
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSGSequence*) maxComposed
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSGSequence*) lowercase
|
||||
{
|
||||
unichar *s;
|
||||
int count;
|
||||
int len=[self length];
|
||||
OBJC_MALLOC(s, unichar,len +1);
|
||||
for(count=0;count<len;count++)
|
||||
s[count]=uni_tolower(_contents_chars[count]);
|
||||
s[len] = (unichar)0;
|
||||
return [NSGSequence sequenceWithCharacters:s length:len];
|
||||
}
|
||||
|
||||
- (NSGSequence*) uppercase
|
||||
{
|
||||
unichar *s;
|
||||
int count;
|
||||
int len=[self length];
|
||||
OBJC_MALLOC(s, unichar,len +1);
|
||||
for(count=0;count<len;count++)
|
||||
s[count]=uni_toupper(_contents_chars[count]);
|
||||
s[len] = (unichar)0;
|
||||
return [NSGSequence sequenceWithCharacters:s length:len];
|
||||
}
|
||||
|
||||
- (NSGSequence*) titlecase
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return self;
|
||||
}
|
||||
|
||||
/* Inefficient */
|
||||
- (NSComparisonResult) compare: (NSGSequence*) aSequence
|
||||
{
|
||||
int i,end;
|
||||
if(![self isNormalized])
|
||||
[self normalize];
|
||||
if(![aSequence isNormalized])
|
||||
[aSequence normalize];
|
||||
if([self length] < [aSequence length])
|
||||
end=[self length];
|
||||
else
|
||||
end=[aSequence length];
|
||||
for (i = 0; i < end; i ++)
|
||||
{
|
||||
if ([self characterAtIndex:i] < [aSequence characterAtIndex:i]) return NSOrderedAscending;
|
||||
if ([self characterAtIndex:i] > [aSequence characterAtIndex:i]) return NSOrderedDescending;
|
||||
}
|
||||
if([self length]<[aSequence length])
|
||||
return NSOrderedAscending;
|
||||
if([self length]>[aSequence length])
|
||||
return NSOrderedDescending;
|
||||
return NSOrderedSame;
|
||||
}
|
||||
|
||||
|
||||
/* NSCopying Protocol */
|
||||
|
||||
- copyWithZone: (NSZone*)zone
|
||||
{
|
||||
return [[[self class] allocWithZone:zone] initWithSequence:self];
|
||||
}
|
||||
|
||||
|
||||
// **************** do I need this?
|
||||
- copy
|
||||
{
|
||||
return [self copyWithZone: NSDefaultMallocZone ()];
|
||||
}
|
||||
|
||||
// **************** do I need this?
|
||||
- mutableCopyWithZone: (NSZone*)zone
|
||||
{
|
||||
return [[[self class] allocWithZone:zone]
|
||||
initWithSequence: self];
|
||||
}
|
||||
|
||||
@end
|
424
Source/NSGString.m
Normal file
424
Source/NSGString.m
Normal file
|
@ -0,0 +1,424 @@
|
|||
/* Implementation for GNUStep of NSStrings with Unicode-string backing
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
Written by Stevo Crvenkovski <stevoc@lotus.mpt.com.mk>
|
||||
Date: February 1997
|
||||
|
||||
Based on NSGCSting and NSString
|
||||
Written by: Andrew Kachites McCallum
|
||||
<mccallum@gnu.ai.mit.edu>
|
||||
Date: March 1995
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <gnustep/base/NSString.h>
|
||||
#include <Foundation/NSGString.h>
|
||||
#include <gnustep/base/NSGString.h>
|
||||
#include <gnustep/base/IndexedCollection.h>
|
||||
#include <gnustep/base/IndexedCollectionPrivate.h>
|
||||
#include <gnustep/base/MallocAddress.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
#include <gnustep/base/behavior.h>
|
||||
#include <gnustep/base/NSGSequence.h>
|
||||
/* memcpy(), strlen(), strcmp() are gcc builtin's */
|
||||
|
||||
#include <gnustep/base/Unicode.h>
|
||||
|
||||
|
||||
@implementation NSGString
|
||||
|
||||
// Initializing Newly Allocated Strings
|
||||
|
||||
/* This is the designated initializer for this class. */
|
||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag
|
||||
{
|
||||
/* assert(!flag); xxx need to make a subclass to handle this. */
|
||||
_count = length;
|
||||
_contents_chars = chars;
|
||||
_free_contents = flag;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithCharacters: (const unichar*)chars
|
||||
length: (unsigned int)length
|
||||
{
|
||||
unichar *s;
|
||||
OBJC_MALLOC(s, unichar, length+1);
|
||||
if (chars)
|
||||
memcpy(s, chars,2*length);
|
||||
s[length] = (unichar)0;
|
||||
return [self initWithCharactersNoCopy:s length:length freeWhenDone:YES];
|
||||
}
|
||||
|
||||
// xxx Folowing two methods should not be in this class.
|
||||
|
||||
// xxx This is not NoCopy.
|
||||
- (id) initWithCStringNoCopy: (char*)byteString
|
||||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag
|
||||
{ unichar *s;
|
||||
OBJC_MALLOC(s, unichar, length+1);
|
||||
if (byteString)
|
||||
strtoustr(s, byteString, length);
|
||||
s[length] = (unichar)0;
|
||||
return [self initWithCharactersNoCopy:s length:length freeWhenDone:flag];
|
||||
}
|
||||
|
||||
- (id) initWithCString: (const char*)byteString length: (unsigned int)length
|
||||
{
|
||||
unichar *s;
|
||||
// xxx int cnt from strtoustr gets real length !!!
|
||||
OBJC_MALLOC(s, unichar, length+1);
|
||||
if (byteString)
|
||||
strtoustr(s, byteString, length);
|
||||
s[length] = (unichar)0;
|
||||
return [self initWithCharactersNoCopy:s length:length freeWhenDone:YES];
|
||||
}
|
||||
|
||||
// Getting a String's Length
|
||||
|
||||
- (unsigned int) length
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
// Accessing Characters
|
||||
|
||||
- (unichar) characterAtIndex: (unsigned int)index
|
||||
{
|
||||
/* xxx This should raise an NSException. */
|
||||
CHECK_INDEX_RANGE_ERROR(index, _count);
|
||||
return _contents_chars[index];
|
||||
}
|
||||
|
||||
// Dividing Strings into Substrings
|
||||
|
||||
- (NSString*) substringFromRange: (NSRange)aRange
|
||||
{
|
||||
if (aRange.location > _count)
|
||||
[NSException raise: NSRangeException format:@"Invalid location."];
|
||||
if (aRange.length > (_count - aRange.location))
|
||||
[NSException raise: NSRangeException format:@"Invalid location+length."];
|
||||
return [[self class] stringWithCharacters: _contents_chars + aRange.location
|
||||
length: aRange.length];
|
||||
}
|
||||
|
||||
// Getting C Strings
|
||||
|
||||
- (const char *) cString
|
||||
{
|
||||
char *r;
|
||||
|
||||
OBJC_MALLOC(r, char, _count+1);
|
||||
ustrtostr(r,_contents_chars, _count);
|
||||
r[_count] = '\0';
|
||||
[[[MallocAddress alloc] initWithAddress:r] autorelease];
|
||||
return r;
|
||||
}
|
||||
|
||||
// xxx fix me
|
||||
- (unsigned int) cStringLength
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
// private method for Unicode level 3 implementation
|
||||
- (int) _baseLength
|
||||
{
|
||||
int count=0;
|
||||
int blen=0;
|
||||
while(count < [self length])
|
||||
if(!uni_isnonsp([self characterAtIndex: count++]))
|
||||
blen++;
|
||||
return blen;
|
||||
}
|
||||
|
||||
// #ifndef NO_GNUSTEP
|
||||
|
||||
// xxx This is Not NoCopy
|
||||
// copy of cString just for compatibility
|
||||
// Is this realy needed ???
|
||||
- (const char *) cStringNoCopy
|
||||
{
|
||||
char *r;
|
||||
|
||||
OBJC_MALLOC(r, char, _count+1);
|
||||
ustrtostr(r,_contents_chars, _count);
|
||||
r[_count] = '\0';
|
||||
[[[MallocAddress alloc] initWithAddress:r] autorelease];
|
||||
return r;
|
||||
}
|
||||
// #endif /* NO_GNUSTEP */
|
||||
|
||||
/* NSCoding Protocol */
|
||||
|
||||
- (void) encodeWithCoder: aCoder
|
||||
{
|
||||
[super encodeWithCoder:aCoder]; // *** added this
|
||||
[aCoder encodeValueOfObjCType:@encode(unichar*) at:&_contents_chars
|
||||
withName:@"Concrete String content_chars"];
|
||||
}
|
||||
|
||||
- initWithCoder: aCoder
|
||||
{
|
||||
[super initWithCoder:aCoder];
|
||||
[aCoder decodeValueOfObjCType:@encode(unichar*) at:&_contents_chars
|
||||
withName:NULL];
|
||||
_count = uslen(_contents_chars);
|
||||
_free_contents = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
// ******* Stuff from NSGCString *********
|
||||
// Do we need this ???
|
||||
|
||||
- (void) _collectionReleaseContents
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
- (void) _collectionDealloc
|
||||
{
|
||||
if (_free_contents)
|
||||
OBJC_FREE(_contents_chars);
|
||||
}
|
||||
|
||||
- (Class) classForConnectedCoder: aRmc
|
||||
{
|
||||
/* Make sure that Connection's always send us bycopy,
|
||||
i.e. as our own class, not a Proxy class. */
|
||||
return [self class];
|
||||
}
|
||||
|
||||
// FOR IndexedCollection SUPPORT;
|
||||
|
||||
- objectAtIndex: (unsigned)index
|
||||
{
|
||||
CHECK_INDEX_RANGE_ERROR(index, _count);
|
||||
return [NSNumber numberWithChar: unitochar(_contents_chars[index])];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation NSGMutableString
|
||||
|
||||
// @class NSMutableString;
|
||||
|
||||
// @protocol NSMutableString <NSString>
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
static int done = 0;
|
||||
if (!done)
|
||||
{
|
||||
done = 1;
|
||||
class_add_behavior(self, [NSGString class]);
|
||||
}
|
||||
}
|
||||
typedef struct {
|
||||
@defs(NSGMutableString)
|
||||
} NSGMutableStringStruct;
|
||||
|
||||
static inline void
|
||||
stringIncrementCountAndMakeHoleAt(NSGMutableStringStruct *self,
|
||||
int index, int size)
|
||||
{
|
||||
#ifndef STABLE_MEMCPY
|
||||
{
|
||||
int i;
|
||||
for (i = self->_count; i >= index; i--)
|
||||
self->_contents_chars[i+size] = self->_contents_chars[i];
|
||||
}
|
||||
#else
|
||||
memcpy(self->_contents_chars + index,
|
||||
self->_contents_chars + index + size,
|
||||
2*(self->_count - index));
|
||||
#endif /* STABLE_MEMCPY */
|
||||
(self->_count) += size;
|
||||
}
|
||||
|
||||
static inline void
|
||||
stringDecrementCountAndFillHoleAt(NSGMutableStringStruct *self,
|
||||
int index, int size)
|
||||
{
|
||||
(self->_count) -= size;
|
||||
#ifndef STABLE_MEMCPY
|
||||
{
|
||||
int i;
|
||||
for (i = index; i <= self->_count; i++)
|
||||
self->_contents_chars[i] = self->_contents_chars[i+size];
|
||||
}
|
||||
#else
|
||||
memcpy(self->_contents_chars + index + size,
|
||||
self->_contents_chars + index,
|
||||
2*(self->_count - index));
|
||||
#endif // STABLE_MEMCPY
|
||||
}
|
||||
|
||||
// Initializing Newly Allocated Strings
|
||||
|
||||
// This is the designated initializer for this class
|
||||
// xxx Should capacity include the '\0' terminator?
|
||||
- initWithCapacity: (unsigned)capacity
|
||||
{
|
||||
_count = 0;
|
||||
_capacity = MAX(capacity, 2);
|
||||
OBJC_MALLOC(_contents_chars, unichar, _capacity);
|
||||
_contents_chars[0] = 0;
|
||||
_free_contents = YES;
|
||||
return self;
|
||||
}
|
||||
|
||||
// Modify A String
|
||||
|
||||
- (void) deleteCharactersInRange: (NSRange)range
|
||||
{
|
||||
stringDecrementCountAndFillHoleAt((NSGMutableStringStruct*)self,
|
||||
range.location, range.length);
|
||||
}
|
||||
|
||||
// xxx Check this
|
||||
- (void) insertString: (NSString*)aString atIndex:(unsigned)index
|
||||
{
|
||||
unsigned c = [aString length];
|
||||
unichar * u;
|
||||
OBJC_MALLOC(u, unichar, c+1);
|
||||
if (_count + c >= _capacity)
|
||||
{
|
||||
_capacity = MAX(_capacity*2, _count+2*c);
|
||||
OBJC_REALLOC(_contents_chars, unichar, _capacity);
|
||||
}
|
||||
stringIncrementCountAndMakeHoleAt((NSGMutableStringStruct*)self, index, c);
|
||||
[aString getCharacters:u];
|
||||
memcpy(_contents_chars + index,u, 2*c);
|
||||
_contents_chars[_count] = 0;
|
||||
}
|
||||
|
||||
|
||||
- (void) setString: (NSString*)aString
|
||||
{
|
||||
int len = [aString length];
|
||||
if (_capacity < len+1)
|
||||
{
|
||||
_capacity = len+1;
|
||||
OBJC_REALLOC(_contents_chars, unichar, _capacity);
|
||||
}
|
||||
[aString getCharacters: _contents_chars];
|
||||
_contents_chars[len] = 0;
|
||||
_count = len;
|
||||
}
|
||||
|
||||
// ************ Stuff from NSGCString *********
|
||||
|
||||
/* xxx This method may be removed in future. */
|
||||
- (void) setCString: (const char *)byteString length: (unsigned)length
|
||||
{
|
||||
if (_capacity < length+1)
|
||||
{
|
||||
_capacity = length+1;
|
||||
OBJC_REALLOC(_contents_chars, unichar, _capacity);
|
||||
}
|
||||
strtoustr(_contents_chars, byteString, length);
|
||||
_contents_chars[length] = 0;
|
||||
_count = length;
|
||||
}
|
||||
|
||||
// xxx This should not be in this class
|
||||
/* Override NSString's designated initializer for CStrings. */
|
||||
- (id) initWithCStringNoCopy: (char*)byteString
|
||||
length: (unsigned int)length
|
||||
freeWhenDone: (BOOL)flag
|
||||
{
|
||||
[self initWithCapacity:length];
|
||||
[self setCString:byteString length:length];
|
||||
return self;
|
||||
}
|
||||
|
||||
/* For IndexedCollecting Protocol and other GNU libobjects conformity. */
|
||||
|
||||
/* xxx This should be made to return void, but we need to change
|
||||
IndexedCollecting and its conformers */
|
||||
- (void) removeRange: (IndexRange)range
|
||||
{
|
||||
stringDecrementCountAndFillHoleAt((NSGMutableStringStruct*)self,
|
||||
range.location, range.length);
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: aCoder // *** changed to unichar
|
||||
{
|
||||
[aCoder encodeValueOfObjCType:@encode(unsigned) at:&_capacity
|
||||
withName:@"String capacity"];
|
||||
[aCoder encodeValueOfObjCType:@encode(unichar*) at:&_contents_chars
|
||||
withName:@"String content_chars"];
|
||||
}
|
||||
|
||||
- initWithCoder: aCoder // *** changed to unichar
|
||||
{
|
||||
unsigned cap;
|
||||
|
||||
[aCoder decodeValueOfObjCType:@encode(unsigned) at:&cap withName:NULL];
|
||||
[self initWithCapacity:cap];
|
||||
[aCoder decodeValueOfObjCType:@encode(unichar*) at:&_contents_chars
|
||||
withName:NULL];
|
||||
_count = uslen(_contents_chars);
|
||||
_capacity = cap;
|
||||
return self;
|
||||
}
|
||||
|
||||
/* For IndexedCollecting protocol */
|
||||
|
||||
- (char) charAtIndex: (unsigned)index
|
||||
{
|
||||
CHECK_INDEX_RANGE_ERROR(index, _count);
|
||||
return unitochar(_contents_chars[index]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// FOR IndexedCollection and OrderedCollection SUPPORT;
|
||||
|
||||
- (void) insertObject: newObject atIndex: (unsigned)index
|
||||
{
|
||||
CHECK_INDEX_RANGE_ERROR(index, _count+1);
|
||||
// one for the next char, one for the '\0';
|
||||
if (_count+1 >= _capacity)
|
||||
{
|
||||
_capacity *= 2;
|
||||
OBJC_REALLOC(_contents_chars, unichar, _capacity);
|
||||
}
|
||||
stringIncrementCountAndMakeHoleAt((NSGMutableStringStruct*)self, index, 1);
|
||||
_contents_chars[index] = [newObject charValue];
|
||||
_contents_chars[_count] = 0;
|
||||
}
|
||||
|
||||
|
||||
- (void) removeObjectAtIndex: (unsigned)index
|
||||
{
|
||||
CHECK_INDEX_RANGE_ERROR(index, _count);
|
||||
stringDecrementCountAndFillHoleAt((NSGMutableStringStruct*)self, index, 1);
|
||||
_contents_chars[_count] = 0;
|
||||
}
|
||||
|
||||
@end
|
271
Source/Unicode.m
Normal file
271
Source/Unicode.m
Normal file
|
@ -0,0 +1,271 @@
|
|||
/* Support functions for Unicode implementation
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Stevo Crvenkovski <stevoc@lotus.mpt.com.mk>
|
||||
Date: March 1997
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
struct _ucc_ {unichar from; char to;};
|
||||
|
||||
#include "unicode/cyrillic.h"
|
||||
#include "unicode/nextstep.h"
|
||||
#include "unicode/caseconv.h"
|
||||
#include "unicode/cop.h"
|
||||
#include "unicode/decomp.h"
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
unichar encode_chartouni(char c, NSStringEncoding enc)
|
||||
{
|
||||
/* All that I could find in Next documentation
|
||||
on NSNonLossyASCIIStringEncoding was <<forthcoming>>. */
|
||||
if((enc==NSNonLossyASCIIStringEncoding)
|
||||
|| (enc==NSASCIIStringEncoding)
|
||||
|| (enc==NSISOLatin1StringEncoding))
|
||||
return (unichar)c;
|
||||
|
||||
if((enc==NSNEXTSTEPStringEncoding))
|
||||
if((unsigned char)c<Next_conv_base)
|
||||
return (unichar)c;
|
||||
else
|
||||
return(Next_char_to_uni_table[(unsigned char)c - Next_conv_base]);
|
||||
|
||||
if((enc==NSCyrillicStringEncoding))
|
||||
if((unsigned char)c<Cyrillic_conv_base)
|
||||
return (unichar)c;
|
||||
else
|
||||
return(Cyrillic_char_to_uni_table[(unsigned char)c - Cyrillic_conv_base]);
|
||||
|
||||
#if 0
|
||||
if((enc==NSSymbolStringEncoding))
|
||||
if((unsigned char)c<Symbol_conv_base)
|
||||
return (unichar)c;
|
||||
else
|
||||
return(Symbol_char_to_uni_table[(unsigned char)c - Symbol_conv_base]);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char encode_unitochar(unichar u, NSStringEncoding enc)
|
||||
{
|
||||
int res;
|
||||
int i=0;
|
||||
|
||||
if((enc==NSNonLossyASCIIStringEncoding)
|
||||
|| (enc==NSASCIIStringEncoding))
|
||||
if(u<128)
|
||||
return (char)u;
|
||||
else
|
||||
return 0;
|
||||
|
||||
|
||||
if((enc==NSISOLatin1StringEncoding))
|
||||
if(u<256)
|
||||
return (char)u;
|
||||
else
|
||||
return 0;
|
||||
|
||||
if((enc== NSNEXTSTEPStringEncoding))
|
||||
if(u<(unichar)Next_conv_base)
|
||||
return (char)u;
|
||||
else
|
||||
{
|
||||
while(((res=u-Next_uni_to_char_table[i++].from)>0) & (i<Next_uni_to_char_table_size));
|
||||
return res?0:Next_uni_to_char_table[--i].to;
|
||||
}
|
||||
|
||||
if((enc==NSCyrillicStringEncoding))
|
||||
if(u<(unichar)Cyrillic_conv_base)
|
||||
return (char)u;
|
||||
else
|
||||
{
|
||||
while(((res=u-Cyrillic_uni_to_char_table[i++].from)>0) & (i<Cyrillic_uni_to_char_table_size));
|
||||
return res?0:Cyrillic_uni_to_char_table[--i].to;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if((enc==NSSymbolStringEncoding))
|
||||
if(u<(unichar)Symbol_conv_base)
|
||||
return (char)u;
|
||||
else
|
||||
{
|
||||
while(((res=u-Symbol_uni_to_char_table[i++].from)>0) & (i<Symbol_uni_to_char_table_size));
|
||||
return res?'*':Symbol_uni_to_char_table[--i].to;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unichar chartouni(char c)
|
||||
{
|
||||
NSStringEncoding enc = [NSString defaultCStringEncoding];
|
||||
return encode_chartouni(c, enc);
|
||||
}
|
||||
|
||||
char unitochar(unichar u)
|
||||
{
|
||||
unsigned char res;
|
||||
NSStringEncoding enc = [NSString defaultCStringEncoding];
|
||||
if((res=encode_unitochar(u, enc)))
|
||||
return res;
|
||||
else
|
||||
return '*';
|
||||
}
|
||||
|
||||
int strtoustr(unichar * u1,const char *s1,int size)
|
||||
{
|
||||
int count;
|
||||
for(count=0;(s1[count]!=0)&(count<size);count++)
|
||||
u1[count]=chartouni(s1[count]);
|
||||
return count;
|
||||
}
|
||||
|
||||
int ustrtostr(char *s2,unichar *u1,int size)
|
||||
{
|
||||
int count;
|
||||
for(count=0;count<size;count++)
|
||||
s2[count]=unitochar(u1[count]);
|
||||
return(count);
|
||||
}
|
||||
|
||||
/* Be carefull if you use this. Unicode arrays returned by
|
||||
-getCharacters methods are not zero terminated */
|
||||
int
|
||||
uslen (unichar *u)
|
||||
{
|
||||
int len = 0;
|
||||
while (u[len] != 0)
|
||||
{
|
||||
if (u[++len] == 0)
|
||||
return len;
|
||||
++len;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
unichar uni_tolower(unichar ch)
|
||||
{
|
||||
int res;
|
||||
int count=0;
|
||||
while(((res=ch - t_tolower[count++][0])>0)&(count<t_len_tolower));
|
||||
return res?ch:t_tolower[--count][1];
|
||||
}
|
||||
|
||||
unichar uni_toupper(unichar ch)
|
||||
{
|
||||
int res;
|
||||
int count=0;
|
||||
while(((res=ch - t_toupper[count++][0])>0)&(count<t_len_toupper));
|
||||
return res?ch:t_toupper[--count][1];
|
||||
}
|
||||
|
||||
unsigned char uni_cop(unichar u)
|
||||
{
|
||||
unichar count,first,last,comp;
|
||||
BOOL notfound;
|
||||
|
||||
first = 0;
|
||||
last = uni_cop_table_size;
|
||||
notfound = TRUE;
|
||||
count=0;
|
||||
|
||||
if(u > (unichar)0x0080) // no nonspacing in ascii
|
||||
{
|
||||
while(notfound & (first <= last))
|
||||
{
|
||||
if(!(first==last))
|
||||
{
|
||||
count = (first + last) / 2;
|
||||
comp=uni_cop_table[count].code;
|
||||
if(comp < u)
|
||||
first = count+1;
|
||||
else
|
||||
if(comp > u)
|
||||
last = count-1;
|
||||
else
|
||||
notfound = FALSE;
|
||||
}
|
||||
else /* first==last */
|
||||
{
|
||||
if(u == uni_cop_table[first].code)
|
||||
return uni_cop_table[first].cop;
|
||||
return 0;
|
||||
} /* else */
|
||||
} /* while notfound ...*/
|
||||
return notfound?0:uni_cop_table[count].cop;
|
||||
}
|
||||
else /* u is ascii */
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL uni_isnonsp(unichar u)
|
||||
{
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
// check is uni_cop good for this
|
||||
if(uni_cop(u))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
unichar *uni_is_decomp(unichar u)
|
||||
{
|
||||
unichar count,first,last,comp;
|
||||
BOOL notfound;
|
||||
|
||||
first = 0;
|
||||
last = uni_dec_table_size;
|
||||
notfound = TRUE;
|
||||
count=0;
|
||||
|
||||
if(u > (unichar)0x0080) // no composites in ascii
|
||||
{
|
||||
while(notfound & (first <= last))
|
||||
{
|
||||
if(!(first==last))
|
||||
{
|
||||
count = (first + last) / 2;
|
||||
comp=uni_dec_table[count].code;
|
||||
if(comp < u)
|
||||
first = count+1;
|
||||
else
|
||||
if(comp > u)
|
||||
last = count-1;
|
||||
else
|
||||
notfound = FALSE;
|
||||
}
|
||||
else /* first==last */
|
||||
{
|
||||
if(u == uni_dec_table[first].code)
|
||||
return uni_dec_table[first].decomp;
|
||||
return 0;
|
||||
} /* else */
|
||||
} /* while notfound ...*/
|
||||
return notfound?0:uni_dec_table[count].decomp;
|
||||
}
|
||||
else /* u is ascii */
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue