mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Updates to reduce global namespace pollution. Plenty more remaining.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4874117588
commit
31342aef09
85 changed files with 1090 additions and 1277 deletions
|
@ -27,10 +27,57 @@
|
|||
#include <Foundation/Foundation.h>
|
||||
#include "GNUstepBase/GSCategories.h"
|
||||
#include "GNUstepBase/GSLock.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
/* Test for ASCII whitespace which is safe for unicode characters */
|
||||
#define space(C) ((C) > 127 ? NO : isspace(C))
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
const char *
|
||||
strerror(int eno)
|
||||
{
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
if (eno < 0 || eno >= sys_nerr)
|
||||
{
|
||||
return("unknown error number");
|
||||
}
|
||||
return(sys_errlist[eno]);
|
||||
}
|
||||
#endif
|
||||
|
||||
@implementation _GSPrivate
|
||||
|
||||
+ (NSString*) error
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
return [self error: GetLastError()];
|
||||
#else
|
||||
extern int errno;
|
||||
return [self error: errno];
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (NSString*) error: (long)number
|
||||
{
|
||||
NSString *text;
|
||||
#if defined(__MINGW32__)
|
||||
LPVOID lpMsgBuf;
|
||||
|
||||
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, nuymber, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPWSTR) &lpMsgBuf, 0, NULL );
|
||||
text = [NSString stringWithCharacters: lpMsgBuf length: wcslen(lpMsgBuf)];
|
||||
LocalFree(lpMsgBuf);
|
||||
#else
|
||||
text = [NSString stringWithCString: strerror(number)
|
||||
encoding: [NSString defaultCStringEncoding]];
|
||||
#endif
|
||||
return text;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSArray (GSCategories)
|
||||
|
||||
- (unsigned) insertionPosition: (id)item
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
*/
|
||||
#include "config.h"
|
||||
|
@ -260,7 +261,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -277,8 +278,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) < 0)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr),
|
||||
NSSwapBigShortToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr),
|
||||
NSSwapBigShortToHost(sin.sin_port), [_GSPrivate error]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -286,7 +287,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
if (listen(net, 5) < 0)
|
||||
{
|
||||
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to listen on port - %@", [_GSPrivate error]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -294,7 +295,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
if (getsockname(net, (struct sockaddr*)&sin, &size) < 0)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -323,7 +324,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
if (getsockname([self fileDescriptor], (struct sockaddr*)&sin, &size) < 0)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ GSFindNamedFile(NSArray *paths, NSString *aName, NSString *anExtension)
|
|||
NSCParameterAssert(aName != nil);
|
||||
NSCParameterAssert(paths != nil);
|
||||
|
||||
GSOnceFLog(@"deprecated ... trivial to code directly");
|
||||
|
||||
/* make up the name with extension if given */
|
||||
if (anExtension != nil)
|
||||
{
|
||||
|
|
|
@ -122,14 +122,12 @@ UTF8Str(const unsigned char *bytes)
|
|||
inline static NSString*
|
||||
UTF8StrLen(const unsigned char *bytes, unsigned length)
|
||||
{
|
||||
unsigned char *buf = NSZoneMalloc(NSDefaultMallocZone(), length+1);
|
||||
NSString *str;
|
||||
|
||||
memcpy(buf, bytes, length);
|
||||
buf[length] = '\0';
|
||||
str = UTF8Str(buf);
|
||||
NSZoneFree(NSDefaultMallocZone(), buf);
|
||||
return str;
|
||||
str = [[NSString_class alloc] initWithBytes: bytes
|
||||
length: length
|
||||
encoding: NSUTF8StringEncoding];
|
||||
return AUTORELEASE(str);
|
||||
}
|
||||
|
||||
static BOOL cacheDone = NO;
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -42,6 +43,7 @@
|
|||
#include "GNUstepBase/GSLock.h"
|
||||
#include "GNUstepBase/GSCategories.h"
|
||||
#include "GNUstepBase/Unicode.h"
|
||||
#include "../GSPrivate.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -52,15 +54,15 @@
|
|||
|
||||
typedef struct {unichar from; unsigned char to;} _ucc_;
|
||||
|
||||
#include "GNUstepBase/unicode/cyrillic.h"
|
||||
#include "GNUstepBase/unicode/latin2.h"
|
||||
#include "GNUstepBase/unicode/latin9.h"
|
||||
#include "GNUstepBase/unicode/nextstep.h"
|
||||
#include "GNUstepBase/unicode/caseconv.h"
|
||||
#include "GNUstepBase/unicode/cop.h"
|
||||
#include "GNUstepBase/unicode/decomp.h"
|
||||
#include "GNUstepBase/unicode/gsm0338.h"
|
||||
#include "GNUstepBase/unicode/thai.h"
|
||||
#include "unicode/cyrillic.h"
|
||||
#include "unicode/latin2.h"
|
||||
#include "unicode/latin9.h"
|
||||
#include "unicode/nextstep.h"
|
||||
#include "unicode/caseconv.h"
|
||||
#include "unicode/cop.h"
|
||||
#include "unicode/decomp.h"
|
||||
#include "unicode/gsm0338.h"
|
||||
#include "unicode/thai.h"
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#ifdef HAVE_GICONV_H
|
||||
|
@ -329,7 +331,7 @@ static void GSSetupEncodingTable(void)
|
|||
}
|
||||
}
|
||||
|
||||
BOOL GSEncodingSupported(NSStringEncoding enc)
|
||||
static BOOL isEncodingSupported(NSStringEncoding enc)
|
||||
{
|
||||
GSSetupEncodingTable();
|
||||
|
||||
|
@ -385,9 +387,6 @@ BOOL GSEncodingSupported(NSStringEncoding enc)
|
|||
return NO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a nul terminated array of the available string encodings.
|
||||
*/
|
||||
NSStringEncoding *
|
||||
GetAvailableEncodings()
|
||||
{
|
||||
|
@ -412,7 +411,7 @@ GetAvailableEncodings()
|
|||
pos = 0;
|
||||
for (i = 0; i < encTableSize+1; i++)
|
||||
{
|
||||
if (GSEncodingSupported(i) == YES)
|
||||
if (isEncodingSupported(i) == YES)
|
||||
{
|
||||
encodings[pos++] = i;
|
||||
}
|
||||
|
@ -532,7 +531,7 @@ GSEncodingForRegistry (NSString *registry, NSString *encoding)
|
|||
* deduced from the clocale string itself. If clocale isn't set or
|
||||
* no match can be found, returns GSUndefinedEncoding.
|
||||
*/
|
||||
/* It would be really nice if this could be used in GetDefEncoding, but
|
||||
/* It would be really nice if this could be used in +defaultCStringEncoding, but
|
||||
* there are too many dependancies on other parts of the library to
|
||||
* make this practical (even if everything possible was written in C,
|
||||
* we'd still need some way to find the Locale.encodings file).
|
||||
|
@ -559,7 +558,7 @@ GSEncodingFromLocale(const char *clocale)
|
|||
char *s;
|
||||
|
||||
s = strchr (clocale, '.');
|
||||
registry = [[NSString stringWithCString: s+1] lowercaseString];
|
||||
registry = [[NSString stringWithUTF8String: s+1] lowercaseString];
|
||||
array = [registry componentsSeparatedByString: @"-"];
|
||||
registry = [array objectAtIndex: 0];
|
||||
if ([array count] > 1)
|
||||
|
@ -594,7 +593,7 @@ GSEncodingFromLocale(const char *clocale)
|
|||
|
||||
dict = [NSDictionary dictionaryWithContentsOfFile: table];
|
||||
encodstr = [dict objectForKey:
|
||||
[NSString stringWithCString: clocale]];
|
||||
[NSString stringWithUTF8String: clocale]];
|
||||
if (encodstr == nil)
|
||||
return GSUndefinedEncoding;
|
||||
|
||||
|
@ -620,299 +619,6 @@ GSEncodingFromLocale(const char *clocale)
|
|||
return encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default encoding
|
||||
*/
|
||||
NSStringEncoding
|
||||
GetDefEncoding(void)
|
||||
{
|
||||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
char *encoding;
|
||||
unsigned int count;
|
||||
|
||||
GSSetupEncodingTable();
|
||||
|
||||
[GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock];
|
||||
if (defEnc != GSUndefinedEncoding)
|
||||
{
|
||||
[local_lock unlock];
|
||||
return defEnc;
|
||||
}
|
||||
|
||||
encoding = getenv("GNUSTEP_STRING_ENCODING");
|
||||
if (encoding != 0)
|
||||
{
|
||||
count = 0;
|
||||
while (str_encoding_table[count].enc
|
||||
&& strcasecmp(str_encoding_table[count].ename, encoding)
|
||||
&& strcasecmp(str_encoding_table[count].iconv, encoding))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if (str_encoding_table[count].enc)
|
||||
{
|
||||
defEnc = str_encoding_table[count].enc;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
"WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr,
|
||||
" NSISOLatin1StringEncoding set as default.\n");
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
}
|
||||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
/* Encoding not set */
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
/* Take it from the system locale information. */
|
||||
encoding = nl_langinfo(CODESET);
|
||||
/*
|
||||
* First handle the fallback response from nl_langinfo() ...
|
||||
* if we are getting the default value we can't assume that
|
||||
* the user has set anything up at all, so we must use the
|
||||
* OpenStep/GNUstep default encopding ... latin1, even though
|
||||
* the nl_langinfo() stuff would say default is ascii.
|
||||
*/
|
||||
if (strcmp(encoding, "ANSI_X3.4-1968") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO_646.IRV:1983") == 0 /* glibc */
|
||||
|| strcmp(encoding, "646") == 0 /* Solaris NetBSD */)
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
else if (strcmp(encoding, "EUC-JP") == 0 /* glibc */
|
||||
/* HP-UX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "eucJP") == 0
|
||||
|| strcmp(encoding, "IBM-eucJP") == 0 /* AIX */)
|
||||
defEnc = NSJapaneseEUCStringEncoding;
|
||||
else if (strcmp(encoding, "UTF-8") == 0 /* glibc AIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "utf8") == 0 /* HP-UX */)
|
||||
defEnc = NSUTF8StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-1") == 0 /* glibc */
|
||||
/* AIX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-1") == 0
|
||||
|| strcmp(encoding, "iso88591") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
else if (strcmp(encoding, "IBM-932") == 0 /* AIX */
|
||||
|| strcmp(encoding, "SJIS") == 0 /* HP-UX OSF/1 NetBSD */
|
||||
|| strcmp(encoding, "PCK") == 0 /* Solaris */)
|
||||
defEnc = NSShiftJISStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-2") == 0 /* glibc */
|
||||
/* AIX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-2") == 0
|
||||
|| strcmp(encoding, "iso88592") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin2StringEncoding;
|
||||
else if (strcmp(encoding, "CP1251") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ansi-1251") == 0 /* Solaris */)
|
||||
defEnc = NSWindowsCP1251StringEncoding;
|
||||
else if (strcmp(encoding, "CP1252") == 0 /* */
|
||||
|| strcmp(encoding, "IBM-1252") == 0 /* AIX */)
|
||||
defEnc = NSWindowsCP1252StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-5") == 0 /* glibc */
|
||||
/* AIX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-5") == 0
|
||||
|| strcmp(encoding, "iso88595") == 0 /* HP-UX */)
|
||||
defEnc = NSISOCyrillicStringEncoding;
|
||||
else if (strcmp(encoding, "KOI8-R") == 0 /* glibc */
|
||||
|| strcmp(encoding, "koi8-r") == 0 /* Solaris */)
|
||||
defEnc = NSKOI8RStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-3") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-3") == 0 /* Solaris */)
|
||||
defEnc = NSISOLatin3StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-4") == 0 /* */
|
||||
|| strcmp(encoding, "ISO8859-4") == 0 /* OSF/1 Solaris NetBSD */)
|
||||
defEnc = NSISOLatin4StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-6") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-6") == 0 /* AIX Solaris */
|
||||
|| strcmp(encoding, "iso88596") == 0 /* HP-UX */)
|
||||
defEnc = NSISOArabicStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-7") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-7") == 0 /* AIX IRIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "iso88597") == 0 /* HP-UX */)
|
||||
defEnc = NSISOGreekStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-8") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-8") == 0 /* AIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "iso88598") == 0 /* HP-UX */)
|
||||
defEnc = NSISOHebrewStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-9") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-9") == 0 /* AIX IRIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "iso88599") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin5StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-10") == 0 /* */
|
||||
|| strcmp(encoding, "ISO8859-10") == 0 /* */)
|
||||
defEnc = NSISOLatin6StringEncoding;
|
||||
else if (strcmp(encoding, "TIS-620") == 0 /* glibc AIX */
|
||||
|| strcmp(encoding, "tis620") == 0 /* HP-UX */
|
||||
|| strcmp(encoding, "TIS620.2533") == 0 /* Solaris */
|
||||
|| strcmp(encoding, "TACTIS") == 0 /* OSF/1 */)
|
||||
defEnc = NSISOThaiStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-13") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-13") == 0 /* */
|
||||
|| strcmp(encoding, "IBM-921") == 0 /* AIX */)
|
||||
defEnc = NSISOLatin7StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-14") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-14") == 0 /* */)
|
||||
defEnc = NSISOLatin8StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-15") == 0 /* glibc */
|
||||
/* AIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-15") == 0
|
||||
|| strcmp(encoding, "iso885915") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin9StringEncoding;
|
||||
else if (strcmp(encoding, "GB2312") == 0 /* glibc */
|
||||
|| strcmp(encoding, "gb2312") == 0 /* Solaris */
|
||||
|| strcmp(encoding, "eucCN") == 0 /* IRIX NetBSD */
|
||||
|| strcmp(encoding, "IBM-eucCN") == 0 /* AIX */
|
||||
|| strcmp(encoding, "hp15CN") == 0 /* HP-UX */)
|
||||
defEnc = NSGB2312StringEncoding;
|
||||
else if (strcmp(encoding, "BIG5") == 0 /* glibc Solaris NetBSD */
|
||||
|| strcmp(encoding, "big5") == 0 /* AIX HP-UX OSF/1 */)
|
||||
defEnc = NSBIG5StringEncoding;
|
||||
else if (strcmp(encoding, "EUC-KR") == 0 /* glibc */
|
||||
|| strcmp(encoding, "eucKR") == 0 /* HP-UX IRIX OSF/1 NetBSD */
|
||||
|| strcmp(encoding, "IBM-eucKR") == 0 /* AIX */
|
||||
|| strcmp(encoding, "5601") == 0 /* Solaris */)
|
||||
defEnc = NSKoreanEUCStringEncoding;
|
||||
else
|
||||
#endif
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
else if (GSEncodingSupported(defEnc) == NO)
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not implemented as "
|
||||
"default c string encoding.\n", encoding);
|
||||
fprintf(stderr,
|
||||
" NSISOLatin1StringEncoding set as default.\n");
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
[local_lock unlock];
|
||||
}
|
||||
return defEnc;
|
||||
}
|
||||
|
||||
BOOL
|
||||
GSIsByteEncoding(NSStringEncoding encoding)
|
||||
{
|
||||
if (GSEncodingSupported(encoding) == NO)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return encodingTable[encoding]->eightBit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the standard name for the specified encoding.
|
||||
*/
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
NSString*
|
||||
GSEncodingName(NSStringEncoding encoding)
|
||||
{
|
||||
if (GSEncodingSupported(encoding) == NO)
|
||||
{
|
||||
return @"Unknown encoding";
|
||||
}
|
||||
return [NSString stringWithCString: encodingTable[encoding]->ename];
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong> Use GSEncodingName()
|
||||
*/
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
NSString*
|
||||
GetEncodingName(NSStringEncoding encoding)
|
||||
{
|
||||
return GSEncodingName(encoding);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
unichar
|
||||
encode_chartouni(unsigned char c, NSStringEncoding enc)
|
||||
{
|
||||
BOOL result;
|
||||
unsigned int size = 1;
|
||||
unichar u = 0;
|
||||
unichar *dst = &u;
|
||||
|
||||
result = GSToUnicode(&dst, &size, &c, 1, enc, 0, 0);
|
||||
if (result == NO)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return u;
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
unsigned char
|
||||
encode_unitochar(unichar u, NSStringEncoding enc)
|
||||
{
|
||||
BOOL result;
|
||||
unsigned int size = 1;
|
||||
unsigned char c = 0;
|
||||
unsigned char *dst = &c;
|
||||
|
||||
result = GSFromUnicode(&dst, &size, &u, 1, enc, 0, 0);
|
||||
if (result == NO)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
unsigned
|
||||
encode_unitochar_strict(unichar u, NSStringEncoding enc)
|
||||
{
|
||||
BOOL result;
|
||||
unsigned int size = 1;
|
||||
unsigned char c = 0;
|
||||
unsigned char *dst = &c;
|
||||
|
||||
result = GSFromUnicode(&dst, &size, &u, 1, enc, 0, GSUniStrict);
|
||||
if (result == NO)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
unichar
|
||||
chartouni(unsigned char c)
|
||||
{
|
||||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
defEnc = GetDefEncoding();
|
||||
}
|
||||
return encode_chartouni(c, defEnc);
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
unsigned char
|
||||
unitochar(unichar u)
|
||||
{
|
||||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
defEnc = GetDefEncoding();
|
||||
}
|
||||
return encode_unitochar(u, defEnc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses direct access into a two-level table to map cases.<br />
|
||||
* The two-level table method is less space efficient (but still not bad) than
|
||||
|
@ -1050,46 +756,6 @@ uni_is_decomp(unichar u)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
int encode_ustrtocstr(char *dst, int dl, const unichar *src, int sl,
|
||||
NSStringEncoding enc, BOOL strict)
|
||||
{
|
||||
BOOL result;
|
||||
unsigned int options = (strict == YES) ? GSUniStrict : 0;
|
||||
unsigned int old = dl;
|
||||
|
||||
result = GSFromUnicode((unsigned char**)&dst, (unsigned int*)&dl,
|
||||
src, sl, enc, 0, options);
|
||||
if (result == NO)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return old - dl; // Number of characters.
|
||||
}
|
||||
|
||||
/**
|
||||
* <strong>deprecated</strong>
|
||||
* See GSToUnicode() and GSFromUnicode()
|
||||
*/
|
||||
int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl,
|
||||
NSStringEncoding enc)
|
||||
{
|
||||
BOOL result;
|
||||
unsigned int old = dl;
|
||||
|
||||
result = GSToUnicode(&dst, (unsigned int*)&dl, (unsigned char*)src,
|
||||
sl, enc, 0, 0);
|
||||
if (result == NO)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return old - dl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to check a block of data for validity as a unicode string and
|
||||
* say whether it contains solely ASCII or solely Latin1 data.<br />
|
||||
|
@ -1531,7 +1197,7 @@ tables:
|
|||
const char *estr = 0;
|
||||
BOOL done = NO;
|
||||
|
||||
if (GSEncodingSupported(enc) == YES)
|
||||
if (isEncodingSupported(enc) == YES)
|
||||
{
|
||||
estr = encodingTable[enc]->iconv;
|
||||
}
|
||||
|
@ -1552,7 +1218,7 @@ tables:
|
|||
if (cd == (iconv_t)-1)
|
||||
{
|
||||
NSLog(@"No iconv for encoding %@ tried to use %s",
|
||||
GetEncodingName(enc), estr);
|
||||
[_GSPrivate encodingName: enc], estr);
|
||||
result = NO;
|
||||
goto done;
|
||||
}
|
||||
|
@ -2224,7 +1890,7 @@ iconv_start:
|
|||
const char *estr = 0;
|
||||
BOOL done = NO;
|
||||
|
||||
if (GSEncodingSupported(enc) == YES)
|
||||
if (isEncodingSupported(enc) == YES)
|
||||
{
|
||||
if (strict == NO)
|
||||
{
|
||||
|
@ -2257,7 +1923,7 @@ iconv_start:
|
|||
if (cd == (iconv_t)-1)
|
||||
{
|
||||
NSLog(@"No iconv for encoding %@ tried to use %s",
|
||||
GetEncodingName(enc), estr);
|
||||
[_GSPrivate encodingName: enc], estr);
|
||||
result = NO;
|
||||
goto done;
|
||||
}
|
||||
|
@ -2414,3 +2080,231 @@ iconv_start:
|
|||
|
||||
#undef GROW
|
||||
|
||||
@implementation _GSPrivate (Unicode)
|
||||
|
||||
+ (NSStringEncoding*) availableEncodings
|
||||
{
|
||||
if (_availableEncodings == 0)
|
||||
{
|
||||
GSSetupEncodingTable();
|
||||
[GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock];
|
||||
if (_availableEncodings == 0)
|
||||
{
|
||||
NSStringEncoding *encodings;
|
||||
unsigned pos;
|
||||
unsigned i;
|
||||
|
||||
/*
|
||||
* Now build up a list of supported encodings ... in the
|
||||
* format needed to support [NSString+availableStringEncodings]
|
||||
* Check to see what iconv support we have as we go along.
|
||||
* This is also the place where we determine the name we use
|
||||
* for iconv to support unicode.
|
||||
*/
|
||||
encodings = objc_malloc(sizeof(NSStringEncoding) * (encTableSize+1));
|
||||
pos = 0;
|
||||
for (i = 0; i < encTableSize+1; i++)
|
||||
{
|
||||
if (isEncodingSupported(i) == YES)
|
||||
{
|
||||
encodings[pos++] = i;
|
||||
}
|
||||
}
|
||||
encodings[pos] = 0;
|
||||
_availableEncodings = encodings;
|
||||
}
|
||||
[local_lock unlock];
|
||||
}
|
||||
return _availableEncodings;
|
||||
}
|
||||
|
||||
+ (NSStringEncoding) defaultCStringEncoding
|
||||
{
|
||||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
char *encoding;
|
||||
unsigned int count;
|
||||
|
||||
GSSetupEncodingTable();
|
||||
|
||||
[GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock];
|
||||
if (defEnc != GSUndefinedEncoding)
|
||||
{
|
||||
[local_lock unlock];
|
||||
return defEnc;
|
||||
}
|
||||
|
||||
encoding = getenv("GNUSTEP_STRING_ENCODING");
|
||||
if (encoding != 0)
|
||||
{
|
||||
count = 0;
|
||||
while (str_encoding_table[count].enc
|
||||
&& strcasecmp(str_encoding_table[count].ename, encoding)
|
||||
&& strcasecmp(str_encoding_table[count].iconv, encoding))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if (str_encoding_table[count].enc)
|
||||
{
|
||||
defEnc = str_encoding_table[count].enc;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,
|
||||
"WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr,
|
||||
" NSISOLatin1StringEncoding set as default.\n");
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
}
|
||||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
/* Encoding not set */
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
/* Take it from the system locale information. */
|
||||
encoding = nl_langinfo(CODESET);
|
||||
/*
|
||||
* First handle the fallback response from nl_langinfo() ...
|
||||
* if we are getting the default value we can't assume that
|
||||
* the user has set anything up at all, so we must use the
|
||||
* OpenStep/GNUstep default encopding ... latin1, even though
|
||||
* the nl_langinfo() stuff would say default is ascii.
|
||||
*/
|
||||
if (strcmp(encoding, "ANSI_X3.4-1968") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO_646.IRV:1983") == 0 /* glibc */
|
||||
|| strcmp(encoding, "646") == 0 /* Solaris NetBSD */)
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
else if (strcmp(encoding, "EUC-JP") == 0 /* glibc */
|
||||
/* HP-UX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "eucJP") == 0
|
||||
|| strcmp(encoding, "IBM-eucJP") == 0 /* AIX */)
|
||||
defEnc = NSJapaneseEUCStringEncoding;
|
||||
else if (strcmp(encoding, "UTF-8") == 0 /* glibc AIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "utf8") == 0 /* HP-UX */)
|
||||
defEnc = NSUTF8StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-1") == 0 /* glibc */
|
||||
/* AIX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-1") == 0
|
||||
|| strcmp(encoding, "iso88591") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
else if (strcmp(encoding, "IBM-932") == 0 /* AIX */
|
||||
|| strcmp(encoding, "SJIS") == 0 /* HP-UX OSF/1 NetBSD */
|
||||
|| strcmp(encoding, "PCK") == 0 /* Solaris */)
|
||||
defEnc = NSShiftJISStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-2") == 0 /* glibc */
|
||||
/* AIX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-2") == 0
|
||||
|| strcmp(encoding, "iso88592") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin2StringEncoding;
|
||||
else if (strcmp(encoding, "CP1251") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ansi-1251") == 0 /* Solaris */)
|
||||
defEnc = NSWindowsCP1251StringEncoding;
|
||||
else if (strcmp(encoding, "CP1252") == 0 /* */
|
||||
|| strcmp(encoding, "IBM-1252") == 0 /* AIX */)
|
||||
defEnc = NSWindowsCP1252StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-5") == 0 /* glibc */
|
||||
/* AIX IRIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-5") == 0
|
||||
|| strcmp(encoding, "iso88595") == 0 /* HP-UX */)
|
||||
defEnc = NSISOCyrillicStringEncoding;
|
||||
else if (strcmp(encoding, "KOI8-R") == 0 /* glibc */
|
||||
|| strcmp(encoding, "koi8-r") == 0 /* Solaris */)
|
||||
defEnc = NSKOI8RStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-3") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-3") == 0 /* Solaris */)
|
||||
defEnc = NSISOLatin3StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-4") == 0 /* */
|
||||
|| strcmp(encoding, "ISO8859-4") == 0 /* OSF/1 Solaris NetBSD */)
|
||||
defEnc = NSISOLatin4StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-6") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-6") == 0 /* AIX Solaris */
|
||||
|| strcmp(encoding, "iso88596") == 0 /* HP-UX */)
|
||||
defEnc = NSISOArabicStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-7") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-7") == 0 /* AIX IRIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "iso88597") == 0 /* HP-UX */)
|
||||
defEnc = NSISOGreekStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-8") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-8") == 0 /* AIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "iso88598") == 0 /* HP-UX */)
|
||||
defEnc = NSISOHebrewStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-9") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-9") == 0 /* AIX IRIX OSF/1 Solaris */
|
||||
|| strcmp(encoding, "iso88599") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin5StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-10") == 0 /* */
|
||||
|| strcmp(encoding, "ISO8859-10") == 0 /* */)
|
||||
defEnc = NSISOLatin6StringEncoding;
|
||||
else if (strcmp(encoding, "TIS-620") == 0 /* glibc AIX */
|
||||
|| strcmp(encoding, "tis620") == 0 /* HP-UX */
|
||||
|| strcmp(encoding, "TIS620.2533") == 0 /* Solaris */
|
||||
|| strcmp(encoding, "TACTIS") == 0 /* OSF/1 */)
|
||||
defEnc = NSISOThaiStringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-13") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-13") == 0 /* */
|
||||
|| strcmp(encoding, "IBM-921") == 0 /* AIX */)
|
||||
defEnc = NSISOLatin7StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-14") == 0 /* glibc */
|
||||
|| strcmp(encoding, "ISO8859-14") == 0 /* */)
|
||||
defEnc = NSISOLatin8StringEncoding;
|
||||
else if (strcmp(encoding, "ISO-8859-15") == 0 /* glibc */
|
||||
/* AIX OSF/1 Solaris NetBSD */
|
||||
|| strcmp(encoding, "ISO8859-15") == 0
|
||||
|| strcmp(encoding, "iso885915") == 0 /* HP-UX */)
|
||||
defEnc = NSISOLatin9StringEncoding;
|
||||
else if (strcmp(encoding, "GB2312") == 0 /* glibc */
|
||||
|| strcmp(encoding, "gb2312") == 0 /* Solaris */
|
||||
|| strcmp(encoding, "eucCN") == 0 /* IRIX NetBSD */
|
||||
|| strcmp(encoding, "IBM-eucCN") == 0 /* AIX */
|
||||
|| strcmp(encoding, "hp15CN") == 0 /* HP-UX */)
|
||||
defEnc = NSGB2312StringEncoding;
|
||||
else if (strcmp(encoding, "BIG5") == 0 /* glibc Solaris NetBSD */
|
||||
|| strcmp(encoding, "big5") == 0 /* AIX HP-UX OSF/1 */)
|
||||
defEnc = NSBIG5StringEncoding;
|
||||
else if (strcmp(encoding, "EUC-KR") == 0 /* glibc */
|
||||
|| strcmp(encoding, "eucKR") == 0 /* HP-UX IRIX OSF/1 NetBSD */
|
||||
|| strcmp(encoding, "IBM-eucKR") == 0 /* AIX */
|
||||
|| strcmp(encoding, "5601") == 0 /* Solaris */)
|
||||
defEnc = NSKoreanEUCStringEncoding;
|
||||
else
|
||||
#endif
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
else if (isEncodingSupported(defEnc) == NO)
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not implemented as "
|
||||
"default c string encoding.\n", encoding);
|
||||
fprintf(stderr,
|
||||
" NSISOLatin1StringEncoding set as default.\n");
|
||||
defEnc = NSISOLatin1StringEncoding;
|
||||
}
|
||||
[local_lock unlock];
|
||||
}
|
||||
return defEnc;
|
||||
}
|
||||
|
||||
+ (NSString*) encodingName: (NSStringEncoding)encoding
|
||||
{
|
||||
if (isEncodingSupported(encoding) == NO)
|
||||
{
|
||||
return @"Unknown encoding";
|
||||
}
|
||||
return [NSString stringWithUTF8String: encodingTable[encoding]->ename];
|
||||
}
|
||||
|
||||
+ (BOOL) isByteEncoding: (NSStringEncoding)encoding
|
||||
{
|
||||
if (isEncodingSupported(encoding) == NO)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return encodingTable[encoding]->eightBit;
|
||||
}
|
||||
|
||||
+ (BOOL) isEncodingSupported: (NSStringEncoding)encoding
|
||||
{
|
||||
return isEncodingSupported(encoding);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
6485
Source/Additions/unicode/caseconv.h
Normal file
6485
Source/Additions/unicode/caseconv.h
Normal file
File diff suppressed because it is too large
Load diff
372
Source/Additions/unicode/cop.h
Normal file
372
Source/Additions/unicode/cop.h
Normal file
|
@ -0,0 +1,372 @@
|
|||
/* COP table */
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
|
||||
struct _cop_ {unichar code; unsigned char cop;};
|
||||
|
||||
static const unsigned int uni_cop_table_size = 355;
|
||||
static 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},
|
||||
};
|
277
Source/Additions/unicode/cyrillic.h
Normal file
277
Source/Additions/unicode/cyrillic.h
Normal file
|
@ -0,0 +1,277 @@
|
|||
// ISO_8859-5,1988 to Unicode maping
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
|
||||
static const unsigned int Cyrillic_conv_base = 0x80;
|
||||
static 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
|
||||
|
||||
static const unsigned int Cyrillic_uni_to_char_table_size = 128;
|
||||
static _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},
|
||||
};
|
1068
Source/Additions/unicode/decomp.h
Normal file
1068
Source/Additions/unicode/decomp.h
Normal file
File diff suppressed because it is too large
Load diff
336
Source/Additions/unicode/gsm0338.h
Normal file
336
Source/Additions/unicode/gsm0338.h
Normal file
|
@ -0,0 +1,336 @@
|
|||
/* Created by Richard Frith-Macdonald <rfm@gnu.org> on 2002 Jan 24 */
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
|
||||
// GSM0338 to Unicode maping
|
||||
|
||||
static const unsigned int GSM0338_conv_base = 0x00;
|
||||
static unichar GSM0338_char_to_uni_table[] =
|
||||
{
|
||||
0x0040,
|
||||
0x00A3,
|
||||
0x0024,
|
||||
0x00A5,
|
||||
0x00E8,
|
||||
0x00E9,
|
||||
0x00F9,
|
||||
0x00EC,
|
||||
0x00F2,
|
||||
0x00E7,
|
||||
0x000A,
|
||||
0x00D8,
|
||||
0x00F8,
|
||||
0x000D,
|
||||
0x00C5,
|
||||
0x00E5,
|
||||
0x0394,
|
||||
0x005F,
|
||||
0x03A6,
|
||||
0x0393,
|
||||
0x039B,
|
||||
0x03A9,
|
||||
0x03A0,
|
||||
0x03A8,
|
||||
0x03A3,
|
||||
0x0398,
|
||||
0x039E,
|
||||
0x00A0,
|
||||
0x00C6,
|
||||
0x00E6,
|
||||
0x00DF,
|
||||
0x00C9,
|
||||
0x0020,
|
||||
0x0021,
|
||||
0x0022,
|
||||
0x0023,
|
||||
0x00A4,
|
||||
0x0025,
|
||||
0x0026,
|
||||
0x0027,
|
||||
0x0028,
|
||||
0x0029,
|
||||
0x002A,
|
||||
0x002B,
|
||||
0x002C,
|
||||
0x002D,
|
||||
0x002E,
|
||||
0x002F,
|
||||
0x0030,
|
||||
0x0031,
|
||||
0x0032,
|
||||
0x0033,
|
||||
0x0034,
|
||||
0x0035,
|
||||
0x0036,
|
||||
0x0037,
|
||||
0x0038,
|
||||
0x0039,
|
||||
0x003A,
|
||||
0x003B,
|
||||
0x003C,
|
||||
0x003D,
|
||||
0x003E,
|
||||
0x003F,
|
||||
0x00A1,
|
||||
0x0041,
|
||||
0x0042,
|
||||
0x0043,
|
||||
0x0044,
|
||||
0x0045,
|
||||
0x0046,
|
||||
0x0047,
|
||||
0x0048,
|
||||
0x0049,
|
||||
0x004A,
|
||||
0x004B,
|
||||
0x004C,
|
||||
0x004D,
|
||||
0x004E,
|
||||
0x004F,
|
||||
0x0050,
|
||||
0x0051,
|
||||
0x0052,
|
||||
0x0053,
|
||||
0x0054,
|
||||
0x0055,
|
||||
0x0056,
|
||||
0x0057,
|
||||
0x0058,
|
||||
0x0059,
|
||||
0x005A,
|
||||
0x00C4,
|
||||
0x00D6,
|
||||
0x00D1,
|
||||
0x00DC,
|
||||
0x00A7,
|
||||
0x00BF,
|
||||
0x0061,
|
||||
0x0062,
|
||||
0x0063,
|
||||
0x0064,
|
||||
0x0065,
|
||||
0x0066,
|
||||
0x0067,
|
||||
0x0068,
|
||||
0x0069,
|
||||
0x006A,
|
||||
0x006B,
|
||||
0x006C,
|
||||
0x006D,
|
||||
0x006E,
|
||||
0x006F,
|
||||
0x0070,
|
||||
0x0071,
|
||||
0x0072,
|
||||
0x0073,
|
||||
0x0074,
|
||||
0x0075,
|
||||
0x0076,
|
||||
0x0077,
|
||||
0x0078,
|
||||
0x0079,
|
||||
0x007A,
|
||||
0x00E4,
|
||||
0x00F6,
|
||||
0x00F1,
|
||||
0x00FC,
|
||||
0x00E0
|
||||
};
|
||||
|
||||
static _ucc_ GSM0338_uni_to_char_table[] =
|
||||
{
|
||||
{0x000A,0x0A,},
|
||||
{0x000D,0x0D,},
|
||||
{0x0020,0x20,},
|
||||
{0x0021,0x21,},
|
||||
{0x0022,0x22,},
|
||||
{0x0023,0x23,},
|
||||
{0x0024,0x02,},
|
||||
{0x0025,0x25,},
|
||||
{0x0026,0x26,},
|
||||
{0x0027,0x27,},
|
||||
{0x0028,0x28,},
|
||||
{0x0029,0x29,},
|
||||
{0x002A,0x2A,},
|
||||
{0x002B,0x2B,},
|
||||
{0x002C,0x2C,},
|
||||
{0x002D,0x2D,},
|
||||
{0x002E,0x2E,},
|
||||
{0x002F,0x2F,},
|
||||
{0x0030,0x30,},
|
||||
{0x0031,0x31,},
|
||||
{0x0032,0x32,},
|
||||
{0x0033,0x33,},
|
||||
{0x0034,0x34,},
|
||||
{0x0035,0x35,},
|
||||
{0x0036,0x36,},
|
||||
{0x0037,0x37,},
|
||||
{0x0038,0x38,},
|
||||
{0x0039,0x39,},
|
||||
{0x003A,0x3A,},
|
||||
{0x003B,0x3B,},
|
||||
{0x003C,0x3C,},
|
||||
{0x003D,0x3D,},
|
||||
{0x003E,0x3E,},
|
||||
{0x003F,0x3F,},
|
||||
{0x0040,0x00,},
|
||||
{0x0041,0x41,},
|
||||
{0x0042,0x42,},
|
||||
{0x0043,0x43,},
|
||||
{0x0044,0x44,},
|
||||
{0x0045,0x45,},
|
||||
{0x0046,0x46,},
|
||||
{0x0047,0x47,},
|
||||
{0x0048,0x48,},
|
||||
{0x0049,0x49,},
|
||||
{0x004A,0x4A,},
|
||||
{0x004B,0x4B,},
|
||||
{0x004C,0x4C,},
|
||||
{0x004D,0x4D,},
|
||||
{0x004E,0x4E,},
|
||||
{0x004F,0x4F,},
|
||||
{0x0050,0x50,},
|
||||
{0x0051,0x51,},
|
||||
{0x0052,0x52,},
|
||||
{0x0053,0x53,},
|
||||
{0x0054,0x54,},
|
||||
{0x0055,0x55,},
|
||||
{0x0056,0x56,},
|
||||
{0x0057,0x57,},
|
||||
{0x0058,0x58,},
|
||||
{0x0059,0x59,},
|
||||
{0x005A,0x5A,},
|
||||
{0x005F,0x11,},
|
||||
{0x0061,0x61,},
|
||||
{0x0062,0x62,},
|
||||
{0x0063,0x63,},
|
||||
{0x0064,0x64,},
|
||||
{0x0065,0x65,},
|
||||
{0x0066,0x66,},
|
||||
{0x0067,0x67,},
|
||||
{0x0068,0x68,},
|
||||
{0x0069,0x69,},
|
||||
{0x006A,0x6A,},
|
||||
{0x006B,0x6B,},
|
||||
{0x006C,0x6C,},
|
||||
{0x006D,0x6D,},
|
||||
{0x006E,0x6E,},
|
||||
{0x006F,0x6F,},
|
||||
{0x0070,0x70,},
|
||||
{0x0071,0x71,},
|
||||
{0x0072,0x72,},
|
||||
{0x0073,0x73,},
|
||||
{0x0074,0x74,},
|
||||
{0x0075,0x75,},
|
||||
{0x0076,0x76,},
|
||||
{0x0077,0x77,},
|
||||
{0x0078,0x78,},
|
||||
{0x0079,0x79,},
|
||||
{0x007A,0x7A,},
|
||||
{0x00A0,0x20,}, /* Map unicode no-break-space to gsm space */
|
||||
{0x00A1,0x40,},
|
||||
{0x00A3,0x01,},
|
||||
{0x00A4,0x24,},
|
||||
{0x00A5,0x03,},
|
||||
{0x00A7,0x5F,},
|
||||
{0x00BF,0x60,},
|
||||
{0x00C4,0x5B,},
|
||||
{0x00C5,0x0E,},
|
||||
{0x00C6,0x1C,},
|
||||
{0x00C9,0x1F,},
|
||||
{0x00D1,0x5D,},
|
||||
{0x00D6,0x5C,},
|
||||
{0x00D8,0x0B,},
|
||||
{0x00DC,0x5E,},
|
||||
{0x00DF,0x1E,},
|
||||
{0x00E0,0x7F,},
|
||||
{0x00E4,0x7B,},
|
||||
{0x00E5,0x0F,},
|
||||
{0x00E6,0x1D,},
|
||||
{0x00E7,0x09,},
|
||||
{0x00E8,0x04,},
|
||||
{0x00E9,0x05,},
|
||||
{0x00EC,0x07,},
|
||||
{0x00F1,0x7D,},
|
||||
{0x00F2,0x08,},
|
||||
{0x00F6,0x7C,},
|
||||
{0x00F8,0x0C,},
|
||||
{0x00F9,0x06,},
|
||||
{0x00FC,0x7E,},
|
||||
{0x0393,0x13,},
|
||||
{0x0394,0x10,},
|
||||
{0x0398,0x19,},
|
||||
{0x039B,0x14,},
|
||||
{0x039E,0x1A,},
|
||||
{0x03A0,0x16,},
|
||||
{0x03A3,0x18,},
|
||||
{0x03A6,0x12,},
|
||||
{0x03A8,0x17,},
|
||||
{0x03A9,0x15,}
|
||||
};
|
||||
#define GSM0338_tsize (sizeof(GSM0338_uni_to_char_table)/sizeof(_ucc_))
|
||||
|
||||
static _ucc_ GSM0338_escapes[] =
|
||||
{
|
||||
{0x000C,0x0A}, /* Form feed */
|
||||
{0x005B,0x3C}, /* '[' */
|
||||
{0x005C,0x2F}, /* '\\' */
|
||||
{0x005D,0x3E}, /* ']' */
|
||||
{0x005E,0x14}, /* '^' */
|
||||
{0x007B,0x28}, /* '{' */
|
||||
{0x007C,0x40}, /* '|' */
|
||||
{0x007D,0x29}, /* '}' */
|
||||
{0x007E,0x3D}, /* '~' */
|
||||
{0x20AC,0x65} /* Euro symbol */
|
||||
};
|
||||
|
||||
#define GSM0338_esize (sizeof(GSM0338_escapes)/sizeof(_ucc_))
|
||||
|
||||
/*
|
||||
* Some of these conversions should not be needed because they are
|
||||
* already handled by escape sequences ... I put them here so we can
|
||||
* support two varieties of the GSM alphabet. The official one, and
|
||||
* a cut down version suitable for use when delivering data to phones
|
||||
* which don't support escape sequences.
|
||||
*/
|
||||
static _ucc_ GSM0338_lossy[] =
|
||||
{
|
||||
{0x005B,0x3C}, /* '[' => '<' */
|
||||
{0x005C,0x2F}, /* '\\' => '/' */
|
||||
{0x005D,0x3E}, /* ']' => '>' */
|
||||
{0x005E,0x14}, /* '^' => lambda */
|
||||
{0x0060,0x27}, /* '`' => '\'' */
|
||||
{0x007B,0x28}, /* '{' => '(' */
|
||||
{0x007C,0x40}, /* '|' => 'i' */
|
||||
{0x007D,0x29}, /* '}' => ')' */
|
||||
{0x007E,0x3D}, /* '~' => '=' */
|
||||
{0x00C7,0x09}, /* C cedilla */
|
||||
{0x0391,0x41}, /* Alpha */
|
||||
{0x0392,0x42}, /* Beta */
|
||||
{0x0395,0x45}, /* Epsilon */
|
||||
{0x0396,0x5A}, /* Zeta */
|
||||
{0x0397,0x48}, /* Eta */
|
||||
{0x0399,0x49}, /* Iota */
|
||||
{0x039A,0x4B}, /* Kappa */
|
||||
{0x039C,0x4D}, /* Mu */
|
||||
{0x039D,0x4E}, /* Nu */
|
||||
{0x039F,0x4F}, /* Omicron */
|
||||
{0x03A1,0x50}, /* Rho */
|
||||
{0x03A4,0x54}, /* Tau */
|
||||
{0x03A5,0x55}, /* Upsilon */
|
||||
{0x03A7,0x58}, /* Chi */
|
||||
{0x2014,0x2D}, /* Em-dash */
|
||||
{0x2018,0x27}, /* left single quote */
|
||||
{0x2019,0x27}, /* right single quote */
|
||||
{0x201C,0x22}, /* left double quote */
|
||||
{0x201D,0x22} /* right double quote */
|
||||
};
|
||||
|
||||
#define GSM0338_lsize (sizeof(GSM0338_lossy)/sizeof(_ucc_))
|
||||
|
280
Source/Additions/unicode/latin2.h
Normal file
280
Source/Additions/unicode/latin2.h
Normal file
|
@ -0,0 +1,280 @@
|
|||
/* Created by Stefan Urbanek <urbane@decef.elf.stuba.sk> on 2000 Apr 6 */
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
|
||||
// ISO_8859-2 to Unicode maping
|
||||
|
||||
static const unsigned int Latin2_conv_base = 0x80;
|
||||
static unichar Latin2_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,
|
||||
0x0104,
|
||||
0x02D8,
|
||||
0x0141,
|
||||
0x00A4,
|
||||
0x013D,
|
||||
0x015A,
|
||||
0x00A7,
|
||||
0x00A8,
|
||||
0x0160,
|
||||
0x015E,
|
||||
0x0164,
|
||||
0x0179,
|
||||
0x00AD,
|
||||
0x017D,
|
||||
0x017B,
|
||||
0x00B0,
|
||||
0x0105,
|
||||
0x02DB,
|
||||
0x0142,
|
||||
0x00B4,
|
||||
0x013E,
|
||||
0x015B,
|
||||
0x02C7,
|
||||
0x00B8,
|
||||
0x0161,
|
||||
0x015F,
|
||||
0x0165,
|
||||
0x017A,
|
||||
0x02DD,
|
||||
0x017E,
|
||||
0x017C,
|
||||
0x0154,
|
||||
0x00C1,
|
||||
0x00C2,
|
||||
0x0102,
|
||||
0x00C4,
|
||||
0x0139,
|
||||
0x0106,
|
||||
0x00C7,
|
||||
0x010C,
|
||||
0x00C9,
|
||||
0x0118,
|
||||
0x00CB,
|
||||
0x011A,
|
||||
0x00CD,
|
||||
0x00CE,
|
||||
0x010E,
|
||||
0x0110,
|
||||
0x0143,
|
||||
0x0147,
|
||||
0x00D3,
|
||||
0x00D4,
|
||||
0x0150,
|
||||
0x00D6,
|
||||
0x00D7,
|
||||
0x0158,
|
||||
0x016E,
|
||||
0x00DA,
|
||||
0x0170,
|
||||
0x00DC,
|
||||
0x00DD,
|
||||
0x0162,
|
||||
0x00DF,
|
||||
0x0155,
|
||||
0x00E1,
|
||||
0x00E2,
|
||||
0x0103,
|
||||
0x00E4,
|
||||
0x013A,
|
||||
0x0107,
|
||||
0x00E7,
|
||||
0x010D,
|
||||
0x00E9,
|
||||
0x0119,
|
||||
0x00EB,
|
||||
0x011B,
|
||||
0x00ED,
|
||||
0x00EE,
|
||||
0x010F,
|
||||
0x0111,
|
||||
0x0144,
|
||||
0x0148,
|
||||
0x00F3,
|
||||
0x00F4,
|
||||
0x0151,
|
||||
0x00F6,
|
||||
0x00F7,
|
||||
0x0159,
|
||||
0x016F,
|
||||
0x00FA,
|
||||
0x0171,
|
||||
0x00FC,
|
||||
0x00FD,
|
||||
0x0163,
|
||||
0x02D9,
|
||||
};
|
||||
|
||||
// Unicode to ISO_8859-2 maping
|
||||
|
||||
static const unsigned int Latin2_uni_to_char_table_size = 128;
|
||||
static _ucc_ Latin2_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},
|
||||
{0x00A4,0xA4},
|
||||
{0x00A7,0xA7},
|
||||
{0x00A8,0xA8},
|
||||
{0x00AD,0xAD},
|
||||
{0x00B0,0xB0},
|
||||
{0x00B4,0xB4},
|
||||
{0x00B8,0xB8},
|
||||
{0x00C1,0xC1},
|
||||
{0x00C2,0xC2},
|
||||
{0x00C4,0xC4},
|
||||
{0x00C7,0xC7},
|
||||
{0x00C9,0xC9},
|
||||
{0x00CB,0xCB},
|
||||
{0x00CD,0xCD},
|
||||
{0x00CE,0xCE},
|
||||
{0x00D3,0xD3},
|
||||
{0x00D4,0xD4},
|
||||
{0x00D6,0xD6},
|
||||
{0x00D7,0xD7},
|
||||
{0x00DA,0xDA},
|
||||
{0x00DC,0xDC},
|
||||
{0x00DD,0xDD},
|
||||
{0x00DF,0xDF},
|
||||
{0x00E1,0xE1},
|
||||
{0x00E2,0xE2},
|
||||
{0x00E4,0xE4},
|
||||
{0x00E7,0xE7},
|
||||
{0x00E9,0xE9},
|
||||
{0x00EB,0xEB},
|
||||
{0x00ED,0xED},
|
||||
{0x00EE,0xEE},
|
||||
{0x00F3,0xF3},
|
||||
{0x00F4,0xF4},
|
||||
{0x00F6,0xF6},
|
||||
{0x00F7,0xF7},
|
||||
{0x00FA,0xFA},
|
||||
{0x00FC,0xFC},
|
||||
{0x00FD,0xFD},
|
||||
{0x0102,0xC3},
|
||||
{0x0103,0xE3},
|
||||
{0x0104,0xA1},
|
||||
{0x0105,0xB1},
|
||||
{0x0106,0xC6},
|
||||
{0x0107,0xE6},
|
||||
{0x010C,0xC8},
|
||||
{0x010D,0xE8},
|
||||
{0x010E,0xCF},
|
||||
{0x010F,0xEF},
|
||||
{0x0110,0xD0},
|
||||
{0x0111,0xF0},
|
||||
{0x0118,0xCA},
|
||||
{0x0119,0xEA},
|
||||
{0x011A,0xCC},
|
||||
{0x011B,0xEC},
|
||||
{0x0139,0xC5},
|
||||
{0x013A,0xE5},
|
||||
{0x013D,0xA5},
|
||||
{0x013E,0xB5},
|
||||
{0x0141,0xA3},
|
||||
{0x0142,0xB3},
|
||||
{0x0143,0xD1},
|
||||
{0x0144,0xF1},
|
||||
{0x0147,0xD2},
|
||||
{0x0148,0xF2},
|
||||
{0x0150,0xD5},
|
||||
{0x0151,0xF5},
|
||||
{0x0154,0xC0},
|
||||
{0x0155,0xE0},
|
||||
{0x0158,0xD8},
|
||||
{0x0159,0xF8},
|
||||
{0x015A,0xA6},
|
||||
{0x015B,0xB6},
|
||||
{0x015E,0xAA},
|
||||
{0x015F,0xBA},
|
||||
{0x0160,0xA9},
|
||||
{0x0161,0xB9},
|
||||
{0x0162,0xDE},
|
||||
{0x0163,0xFE},
|
||||
{0x0164,0xAB},
|
||||
{0x0165,0xBB},
|
||||
{0x016E,0xD9},
|
||||
{0x016F,0xF9},
|
||||
{0x0170,0xDB},
|
||||
{0x0171,0xFB},
|
||||
{0x0179,0xAC},
|
||||
{0x017A,0xBC},
|
||||
{0x017B,0xAF},
|
||||
{0x017C,0xBF},
|
||||
{0x017D,0xAE},
|
||||
{0x017E,0xBE},
|
||||
{0x02C7,0xB7},
|
||||
{0x02D8,0xA2},
|
||||
{0x02D9,0xFF},
|
||||
{0x02DB,0xB2},
|
||||
{0x02DD,0xBD},
|
||||
};
|
||||
|
280
Source/Additions/unicode/latin9.h
Normal file
280
Source/Additions/unicode/latin9.h
Normal file
|
@ -0,0 +1,280 @@
|
|||
/* Created by Stefan Urbanek <urbane@decef.elf.stuba.sk> on 2000 Apr 6 */
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
|
||||
// ISO_8859-15 to Unicode maping
|
||||
|
||||
static const unsigned int Latin9_conv_base = 0x80;
|
||||
static unichar Latin9_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,
|
||||
0x00A1,
|
||||
0x00A2,
|
||||
0x00A3,
|
||||
0x20AC,
|
||||
0x00A5,
|
||||
0x0160,
|
||||
0x00A7,
|
||||
0x0161,
|
||||
0x00A9,
|
||||
0x00AA,
|
||||
0x00AB,
|
||||
0x00AC,
|
||||
0x00AD,
|
||||
0x00AE,
|
||||
0x00AF,
|
||||
0x00B0,
|
||||
0x00B1,
|
||||
0x00B2,
|
||||
0x00B3,
|
||||
0x017D,
|
||||
0x00B5,
|
||||
0x00B6,
|
||||
0x00B7,
|
||||
0x017E,
|
||||
0x00B9,
|
||||
0x00BA,
|
||||
0x00BB,
|
||||
0x0152,
|
||||
0x0153,
|
||||
0x0178,
|
||||
0x00BF,
|
||||
0x00C0,
|
||||
0x00C1,
|
||||
0x00C2,
|
||||
0x00C3,
|
||||
0x00C4,
|
||||
0x00C5,
|
||||
0x00C6,
|
||||
0x00C7,
|
||||
0x00C8,
|
||||
0x00C9,
|
||||
0x00CA,
|
||||
0x00CB,
|
||||
0x00CC,
|
||||
0x00CD,
|
||||
0x00CE,
|
||||
0x00CF,
|
||||
0x00D0,
|
||||
0x00D1,
|
||||
0x00D2,
|
||||
0x00D3,
|
||||
0x00D4,
|
||||
0x00D5,
|
||||
0x00D6,
|
||||
0x00D7,
|
||||
0x00D8,
|
||||
0x00D9,
|
||||
0x00DA,
|
||||
0x00DB,
|
||||
0x00DC,
|
||||
0x00DD,
|
||||
0x00DE,
|
||||
0x00DF,
|
||||
0x00E0,
|
||||
0x00E1,
|
||||
0x00E2,
|
||||
0x00E3,
|
||||
0x00E4,
|
||||
0x00E5,
|
||||
0x00E6,
|
||||
0x00E7,
|
||||
0x00E8,
|
||||
0x00E9,
|
||||
0x00EA,
|
||||
0x00EB,
|
||||
0x00EC,
|
||||
0x00ED,
|
||||
0x00EE,
|
||||
0x00EF,
|
||||
0x00F0,
|
||||
0x00F1,
|
||||
0x00F2,
|
||||
0x00F3,
|
||||
0x00F4,
|
||||
0x00F5,
|
||||
0x00F6,
|
||||
0x00F7,
|
||||
0x00F8,
|
||||
0x00F9,
|
||||
0x00FA,
|
||||
0x00FB,
|
||||
0x00FC,
|
||||
0x00FD,
|
||||
0x00FE,
|
||||
0x00FF
|
||||
};
|
||||
|
||||
// Unicode to ISO_8859-15 maping
|
||||
|
||||
static const unsigned int Latin9_uni_to_char_table_size = 128;
|
||||
static _ucc_ Latin9_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},
|
||||
{0x00A1, 0xA1},
|
||||
{0x00A2, 0xA2},
|
||||
{0x00A3, 0xA3},
|
||||
{0x00A5, 0xA5},
|
||||
{0x00A7, 0xA7},
|
||||
{0x00A9, 0xA9},
|
||||
{0x00AA, 0xAA},
|
||||
{0x00AB, 0xAB},
|
||||
{0x00AC, 0xAC},
|
||||
{0x00AD, 0xAD},
|
||||
{0x00AE, 0xAE},
|
||||
{0x00AF, 0xAF},
|
||||
{0x00B0, 0xB0},
|
||||
{0x00B1, 0xB1},
|
||||
{0x00B2, 0xB2},
|
||||
{0x00B3, 0xB3},
|
||||
{0x00B5, 0xB5},
|
||||
{0x00B6, 0xB6},
|
||||
{0x00B7, 0xB7},
|
||||
{0x00B9, 0xB9},
|
||||
{0x00BA, 0xBA},
|
||||
{0x00BB, 0xBB},
|
||||
{0x00BF, 0xBF},
|
||||
{0x00C0, 0xC0},
|
||||
{0x00C1, 0xC1},
|
||||
{0x00C2, 0xC2},
|
||||
{0x00C3, 0xC3},
|
||||
{0x00C4, 0xC4},
|
||||
{0x00C5, 0xC5},
|
||||
{0x00C6, 0xC6},
|
||||
{0x00C7, 0xC7},
|
||||
{0x00C8, 0xC8},
|
||||
{0x00C9, 0xC9},
|
||||
{0x00CA, 0xCA},
|
||||
{0x00CB, 0xCB},
|
||||
{0x00CC, 0xCC},
|
||||
{0x00CD, 0xCD},
|
||||
{0x00CE, 0xCE},
|
||||
{0x00CF, 0xCF},
|
||||
{0x00D0, 0xD0},
|
||||
{0x00D1, 0xD1},
|
||||
{0x00D2, 0xD2},
|
||||
{0x00D3, 0xD3},
|
||||
{0x00D4, 0xD4},
|
||||
{0x00D5, 0xD5},
|
||||
{0x00D6, 0xD6},
|
||||
{0x00D7, 0xD7},
|
||||
{0x00D8, 0xD8},
|
||||
{0x00D9, 0xD9},
|
||||
{0x00DA, 0xDA},
|
||||
{0x00DB, 0xDB},
|
||||
{0x00DC, 0xDC},
|
||||
{0x00DD, 0xDD},
|
||||
{0x00DE, 0xDE},
|
||||
{0x00DF, 0xDF},
|
||||
{0x00E0, 0xE0},
|
||||
{0x00E1, 0xE1},
|
||||
{0x00E2, 0xE2},
|
||||
{0x00E3, 0xE3},
|
||||
{0x00E4, 0xE4},
|
||||
{0x00E5, 0xE5},
|
||||
{0x00E6, 0xE6},
|
||||
{0x00E7, 0xE7},
|
||||
{0x00E8, 0xE8},
|
||||
{0x00E9, 0xE9},
|
||||
{0x00EA, 0xEA},
|
||||
{0x00EB, 0xEB},
|
||||
{0x00EC, 0xEC},
|
||||
{0x00ED, 0xED},
|
||||
{0x00EE, 0xEE},
|
||||
{0x00EF, 0xEF},
|
||||
{0x00F0, 0xF0},
|
||||
{0x00F1, 0xF1},
|
||||
{0x00F2, 0xF2},
|
||||
{0x00F3, 0xF3},
|
||||
{0x00F4, 0xF4},
|
||||
{0x00F5, 0xF5},
|
||||
{0x00F6, 0xF6},
|
||||
{0x00F7, 0xF7},
|
||||
{0x00F8, 0xF8},
|
||||
{0x00F9, 0xF9},
|
||||
{0x00FA, 0xFA},
|
||||
{0x00FB, 0xFB},
|
||||
{0x00FC, 0xFC},
|
||||
{0x00FD, 0xFD},
|
||||
{0x00FE, 0xFE},
|
||||
{0x00FF, 0xFF},
|
||||
{0x0152, 0xBC},
|
||||
{0x0153, 0xBD},
|
||||
{0x0160, 0xA6},
|
||||
{0x0161, 0xA8},
|
||||
{0x0178, 0xBE},
|
||||
{0x017D, 0xB4},
|
||||
{0x017E, 0xB8},
|
||||
{0x20AC, 0xA4}
|
||||
};
|
||||
|
262
Source/Additions/unicode/nextstep.h
Normal file
262
Source/Additions/unicode/nextstep.h
Normal file
|
@ -0,0 +1,262 @@
|
|||
// Next to Unicode maping
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
static const unsigned int Next_conv_base = 0x80;
|
||||
static 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
|
||||
|
||||
static const unsigned int Next_uni_to_char_table_size = 128;
|
||||
static _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},
|
||||
};
|
205
Source/Additions/unicode/thai.h
Normal file
205
Source/Additions/unicode/thai.h
Normal file
|
@ -0,0 +1,205 @@
|
|||
/* ISO_8859-11 to Unicode maping */
|
||||
/*
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
*/
|
||||
|
||||
|
||||
static const unsigned int Thai_conv_base = 0xA0;
|
||||
static unichar Thai_char_to_uni_table[] =
|
||||
{
|
||||
0x00A0,
|
||||
0x0E01,
|
||||
0x0E02,
|
||||
0x0E03,
|
||||
0x0E04,
|
||||
0x0E05,
|
||||
0x0E06,
|
||||
0x0E07,
|
||||
0x0E08,
|
||||
0x0E09,
|
||||
0x0E0A,
|
||||
0x0E0B,
|
||||
0x0E0C,
|
||||
0x0E0D,
|
||||
0x0E0E,
|
||||
0x0E0F,
|
||||
0x0E10,
|
||||
0x0E11,
|
||||
0x0E12,
|
||||
0x0E13,
|
||||
0x0E14,
|
||||
0x0E15,
|
||||
0x0E16,
|
||||
0x0E17,
|
||||
0x0E18,
|
||||
0x0E19,
|
||||
0x0E1A,
|
||||
0x0E1B,
|
||||
0x0E1C,
|
||||
0x0E1D,
|
||||
0x0E1E,
|
||||
0x0E1F,
|
||||
0x0E20,
|
||||
0x0E21,
|
||||
0x0E22,
|
||||
0x0E23,
|
||||
0x0E24,
|
||||
0x0E25,
|
||||
0x0E26,
|
||||
0x0E27,
|
||||
0x0E28,
|
||||
0x0E29,
|
||||
0x0E2A,
|
||||
0x0E2B,
|
||||
0x0E2C,
|
||||
0x0E2D,
|
||||
0x0E2E,
|
||||
0x0E2F,
|
||||
0x0E30,
|
||||
0x0E31,
|
||||
0x0E32,
|
||||
0x0E33,
|
||||
0x0E34,
|
||||
0x0E35,
|
||||
0x0E36,
|
||||
0x0E37,
|
||||
0x0E38,
|
||||
0x0E39,
|
||||
0x0E3A,
|
||||
0xFFFD,
|
||||
0xFFFD,
|
||||
0xFFFD,
|
||||
0xFFFD,
|
||||
0x0E3F,
|
||||
0x0E40,
|
||||
0x0E41,
|
||||
0x0E42,
|
||||
0x0E43,
|
||||
0x0E44,
|
||||
0x0E45,
|
||||
0x0E46,
|
||||
0x0E47,
|
||||
0x0E48,
|
||||
0x0E49,
|
||||
0x0E4A,
|
||||
0x0E4B,
|
||||
0x0E4C,
|
||||
0x0E4D,
|
||||
0x0E4E,
|
||||
0x0E4F,
|
||||
0x2116,
|
||||
0x0E51,
|
||||
0x0E52,
|
||||
0x0E53,
|
||||
0x0E54,
|
||||
0x0E55,
|
||||
0x0E56,
|
||||
0x0E57,
|
||||
0x0E58,
|
||||
0x0E59,
|
||||
0x0E5A,
|
||||
0x0E5B,
|
||||
0xFFFD,
|
||||
0xFFFD,
|
||||
0xFFFD,
|
||||
0xFFFD,
|
||||
};
|
||||
|
||||
/* Unicode to ISO_8859-11 maping */
|
||||
|
||||
static const unsigned int Thai_uni_to_char_table_size = 88;
|
||||
static _ucc_ Thai_uni_to_char_table[]=
|
||||
{
|
||||
{0x00A0,0xA0},
|
||||
{0x0E01,0xA1},
|
||||
{0x0E02,0xA2},
|
||||
{0x0E03,0xA3},
|
||||
{0x0E04,0xA4},
|
||||
{0x0E05,0xA5},
|
||||
{0x0E06,0xA6},
|
||||
{0x0E07,0xA7},
|
||||
{0x0E08,0xA8},
|
||||
{0x0E09,0xA9},
|
||||
{0x0E0A,0xAA},
|
||||
{0x0E0B,0xAB},
|
||||
{0x0E0C,0xAC},
|
||||
{0x0E0D,0xAD},
|
||||
{0x0E0E,0xAE},
|
||||
{0x0E0F,0xAF},
|
||||
{0x0E10,0xB0},
|
||||
{0x0E11,0xB1},
|
||||
{0x0E12,0xB2},
|
||||
{0x0E13,0xB3},
|
||||
{0x0E14,0xB4},
|
||||
{0x0E15,0xB5},
|
||||
{0x0E16,0xB6},
|
||||
{0x0E17,0xB7},
|
||||
{0x0E18,0xB8},
|
||||
{0x0E19,0xB9},
|
||||
{0x0E1A,0xBA},
|
||||
{0x0E1B,0xBB},
|
||||
{0x0E1C,0xBC},
|
||||
{0x0E1D,0xBD},
|
||||
{0x0E1E,0xBE},
|
||||
{0x0E1F,0xBF},
|
||||
{0x0E20,0xC0},
|
||||
{0x0E21,0xC1},
|
||||
{0x0E22,0xC2},
|
||||
{0x0E23,0xC3},
|
||||
{0x0E24,0xC4},
|
||||
{0x0E25,0xC5},
|
||||
{0x0E26,0xC6},
|
||||
{0x0E27,0xC7},
|
||||
{0x0E28,0xC8},
|
||||
{0x0E29,0xC9},
|
||||
{0x0E2A,0xCA},
|
||||
{0x0E2B,0xCB},
|
||||
{0x0E2C,0xCC},
|
||||
{0x0E2D,0xCD},
|
||||
{0x0E2E,0xCE},
|
||||
{0x0E2F,0xCF},
|
||||
{0x0E30,0xD0},
|
||||
{0x0E31,0xD1},
|
||||
{0x0E32,0xD2},
|
||||
{0x0E33,0xD3},
|
||||
{0x0E34,0xD4},
|
||||
{0x0E35,0xD5},
|
||||
{0x0E36,0xD6},
|
||||
{0x0E37,0xD7},
|
||||
{0x0E38,0xD8},
|
||||
{0x0E39,0xD9},
|
||||
{0x0E3A,0xDA},
|
||||
{0x0E3F,0xDF},
|
||||
{0x0E40,0xE0},
|
||||
{0x0E41,0xE1},
|
||||
{0x0E42,0xE2},
|
||||
{0x0E43,0xE3},
|
||||
{0x0E44,0xE4},
|
||||
{0x0E45,0xE5},
|
||||
{0x0E46,0xE6},
|
||||
{0x0E47,0xE7},
|
||||
{0x0E48,0xE8},
|
||||
{0x0E49,0xE9},
|
||||
{0x0E4A,0xEA},
|
||||
{0x0E4B,0xEB},
|
||||
{0x0E4C,0xEC},
|
||||
{0x0E4D,0xED},
|
||||
{0x0E4E,0xEE},
|
||||
{0x0E4F,0xEF},
|
||||
{0x0E50,0xF0},
|
||||
{0x0E51,0xF1},
|
||||
{0x0E52,0xF2},
|
||||
{0x0E53,0xF3},
|
||||
{0x0E54,0xF4},
|
||||
{0x0E55,0xF5},
|
||||
{0x0E56,0xF6},
|
||||
{0x0E57,0xF7},
|
||||
{0x0E58,0xF8},
|
||||
{0x0E59,0xF9},
|
||||
{0x0E5A,0xFA},
|
||||
{0x0E5B,0xFB},
|
||||
};
|
|
@ -370,17 +370,8 @@ NSValue.h \
|
|||
NSXMLParser.h \
|
||||
NSZone.h
|
||||
|
||||
UNICODE_HEADERS = \
|
||||
unicode/caseconv.h \
|
||||
unicode/cop.h \
|
||||
unicode/cyrillic.h \
|
||||
unicode/latin2.h \
|
||||
unicode/decomp.h \
|
||||
unicode/nextstep.h
|
||||
|
||||
HEADERS_INSTALL = $(GNU_HEADERS) \
|
||||
$(FOUNDATION_HEADERS) \
|
||||
$(UNICODE_HEADERS)
|
||||
$(FOUNDATION_HEADERS)
|
||||
|
||||
GENERATED_HFILES = \
|
||||
dynamic-load.h \
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -43,17 +44,17 @@ static double rint(double a)
|
|||
|
||||
BOOL GSMacOSXCompatibleGeometry(void)
|
||||
{
|
||||
if (GSUserDefaultsFlag(GSOldStyleGeometry) == YES)
|
||||
if ([_GSPrivate userDefaultsFlag: GSOldStyleGeometry] == YES)
|
||||
return NO;
|
||||
return GSUserDefaultsFlag(GSMacOSXCompatible);
|
||||
return [_GSPrivate userDefaultsFlag: GSMacOSXCompatible];
|
||||
}
|
||||
|
||||
BOOL GSMacOSXCompatiblePropertyLists(void)
|
||||
{
|
||||
#if defined(HAVE_LIBXML)
|
||||
if (GSUserDefaultsFlag(NSWriteOldStylePropertyLists) == YES)
|
||||
if ([_GSPrivate userDefaultsFlag: NSWriteOldStylePropertyLists] == YES)
|
||||
return NO;
|
||||
return GSUserDefaultsFlag(GSMacOSXCompatible);
|
||||
return [_GSPrivate userDefaultsFlag: GSMacOSXCompatible];
|
||||
#else
|
||||
return NO;
|
||||
#endif
|
||||
|
|
|
@ -168,7 +168,7 @@ gs_offset(const char *type, int index)
|
|||
/* Determines if the structure type can be returned entirely in registers.
|
||||
See the avcall or vacall man pages for more info. FIXME: I'm betting
|
||||
this won't work if a structure contains another structure */
|
||||
int
|
||||
static int
|
||||
gs_splittable (const char *type)
|
||||
{
|
||||
int i, numtypes;
|
||||
|
@ -297,7 +297,7 @@ gs_find_by_receiver_best_typed_sel (id receiver, SEL sel)
|
|||
Only passes the first part. Is used for determining
|
||||
the return type for the vacall macros.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
gs_sel_type_to_callback_type (const char *sel_type,
|
||||
vacallReturnTypeInfo *vatype)
|
||||
{
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
@ -36,6 +37,7 @@
|
|||
#include "Foundation/NSFileHandle.h"
|
||||
#include "Foundation/NSDebug.h"
|
||||
#include "GNUstepBase/GSMime.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
GS_EXPORT NSString * const GSTelnetNotification;
|
||||
GS_EXPORT NSString * const GSTelnetErrorKey;
|
||||
|
@ -972,14 +974,12 @@ static NSLock *urlLock = nil;
|
|||
protocol: @"tcp"];
|
||||
if (sock == nil)
|
||||
{
|
||||
extern int errno;
|
||||
|
||||
/*
|
||||
* Tell superclass that the load failed - let it do housekeeping.
|
||||
*/
|
||||
[self backgroundLoadDidFailWithReason: [NSString stringWithFormat:
|
||||
@"Unable to connect to %@:%@ ... %s",
|
||||
host, port, GSLastErrorStr(errno)]];
|
||||
@"Unable to connect to %@:%@ ... %@",
|
||||
host, port, [_GSPrivate error]]];
|
||||
return;
|
||||
}
|
||||
cHandle = [[GSTelnetHandle alloc] initWithHandle: sock isConnected: NO];
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "Foundation/NSProcessInfo.h"
|
||||
#include "Foundation/NSUserDefaults.h"
|
||||
#include "Foundation/NSDebug.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
#include "../Tools/gdomap.h"
|
||||
|
||||
|
@ -797,7 +798,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == -1)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error: errno]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -811,8 +812,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
if (bind(net, (struct sockaddr *)&lsin, sizeof(lsin)) == -1)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(lsin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(lsin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error: errno]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -830,9 +831,9 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
if (errno != EINPROGRESS)
|
||||
{
|
||||
NSLog(@"unable to make connection to %s:%d - %s",
|
||||
NSLog(@"unable to make connection to %s:%d - %@",
|
||||
inet_ntoa(sin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -896,7 +897,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == -1)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -913,8 +914,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) == -1)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -922,7 +923,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (listen(net, 256) == -1)
|
||||
{
|
||||
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to listen on port - %@", [_GSPrivate error]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -930,7 +931,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getsockname(net, (struct sockaddr*)&sin, &size) == -1)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
(void) close(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -1095,8 +1096,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (fstat(desc, &sbuf) < 0)
|
||||
{
|
||||
NSLog(@"unable to get status of descriptor %d - %s",
|
||||
desc, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get status of descriptor %d - %@",
|
||||
desc, [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1317,8 +1318,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (len < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
@ -1342,8 +1343,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (len < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
@ -1368,8 +1369,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (got < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
[d setLength: got];
|
||||
}
|
||||
|
@ -1391,8 +1392,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
else if (got < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
while (len > 0 && got > 0);
|
||||
|
@ -1437,8 +1438,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (rval < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to write to descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to write to descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1543,8 +1544,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (result < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"failed to move to offset in file - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"failed to move to offset in file - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return (unsigned long long)result;
|
||||
}
|
||||
|
@ -1567,8 +1568,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (result < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"failed to move to offset in file - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"failed to move to offset in file - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return (unsigned long long)result;
|
||||
}
|
||||
|
@ -1591,8 +1592,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (result < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"failed to move to offset in file - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"failed to move to offset in file - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1927,8 +1928,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Accept attempt failed - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
s = [NSString stringWithFormat: @"Accept attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[readInfo setObject: s forKey: GSFileHandleNotificationError];
|
||||
}
|
||||
else
|
||||
|
@ -1995,8 +1996,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Read attempt failed - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
s = [NSString stringWithFormat: @"Read attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[readInfo setObject: s forKey: GSFileHandleNotificationError];
|
||||
[self postReadNotification];
|
||||
}
|
||||
|
@ -2031,8 +2032,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Connect attempt failed - %s",
|
||||
GSLastErrorStr(result)];
|
||||
s = [NSString stringWithFormat: @"Connect attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[info setObject: s forKey: GSFileHandleNotificationError];
|
||||
}
|
||||
else
|
||||
|
@ -2065,7 +2066,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat:
|
||||
@"Write attempt failed - %s", GSLastErrorStr(errno)];
|
||||
@"Write attempt failed - %@", [_GSPrivate error]];
|
||||
[info setObject: s forKey: GSFileHandleNotificationError];
|
||||
[self postWriteNotification];
|
||||
}
|
||||
|
@ -2141,8 +2142,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
}
|
||||
if (fcntl(descriptor, F_SETFL, e) < 0)
|
||||
{
|
||||
NSLog(@"unable to set non-blocking mode for %d - %s",
|
||||
descriptor, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set non-blocking mode for %d - %@",
|
||||
descriptor, [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2151,8 +2152,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"unable to get non-blocking mode for %d - %s",
|
||||
descriptor, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get non-blocking mode for %d - %@",
|
||||
descriptor, [_GSPrivate error]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2170,11 +2171,11 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == -1)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = [NSString stringWithCString: (char*)inet_ntoa(sin.sin_addr)];
|
||||
str = [NSString stringWithUTF8String: (char*)inet_ntoa(sin.sin_addr)];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
@ -2187,7 +2188,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == -1)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -758,6 +758,10 @@ parse_one_spec (const unichar *format, size_t posn, struct printf_spec *spec,
|
|||
return nargs;
|
||||
}
|
||||
|
||||
static inline void GSStrAppendUnichar(GSStr s, unichar u)
|
||||
{
|
||||
GSStrAppendUnichars(s, &u, 1);
|
||||
}
|
||||
|
||||
#define outchar(Ch) GSStrAppendUnichar(s, Ch)
|
||||
#define outstring(String, Len) GSStrAppendUnichars(s, String, Len)
|
||||
|
@ -1690,9 +1694,9 @@ NSDictionary *locale)
|
|||
|
||||
LABEL (form_strerror):
|
||||
/* Print description of error ERRNO. */
|
||||
string =
|
||||
(unichar *) GSLastErrorStr(save_errno);
|
||||
is_long = 0; /* This is no wide-char string. */
|
||||
string = (unichar *)[[_GSPrivate error: save_errno]
|
||||
cStringUsingEncoding: NSUnicodeStringEncoding];
|
||||
is_long = 1; /* This is a unicode string. */
|
||||
goto LABEL (print_string);
|
||||
LABEL (form_character):
|
||||
/* Character. */
|
||||
|
@ -1735,7 +1739,7 @@ NSDictionary *locale)
|
|||
{
|
||||
/* Write "(null)" if there's space. */
|
||||
if (prec == -1
|
||||
|| prec >= (int) (sizeof (null) / sizeof (null[0])) - 1)
|
||||
|| prec >= (int) (sizeof (null) / sizeof (null[0])) - 1)
|
||||
{
|
||||
string = (unichar *) null;
|
||||
len = (sizeof (null) / sizeof (null[0])) - 1;
|
||||
|
@ -1757,8 +1761,8 @@ NSDictionary *locale)
|
|||
|
||||
if (enc == GSUndefinedEncoding)
|
||||
{
|
||||
enc = GetDefEncoding();
|
||||
byteEncoding = GSIsByteEncoding(enc);
|
||||
enc = [NSString defaultCStringEncoding];
|
||||
byteEncoding = [_GSPrivate isByteEncoding: enc];
|
||||
}
|
||||
|
||||
len = strlen(str); // Number of bytes to convert.
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "GNUstepBase/GSLock.h"
|
||||
#include "NSCallBacks.h"
|
||||
#include "GSURLPrivate.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@ -1267,8 +1268,8 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
* Tell superclass that the load failed - let it do housekeeping.
|
||||
*/
|
||||
[self backgroundLoadDidFailWithReason:
|
||||
[NSString stringWithFormat: @"Unable to connect to %@:%@ ... %s",
|
||||
host, port, GSLastErrorStr(errno)]];
|
||||
[NSString stringWithFormat: @"Unable to connect to %@:%@ ... %@",
|
||||
host, port, [_GSPrivate error]]];
|
||||
return;
|
||||
}
|
||||
RETAIN(sock);
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "GNUstepBase/GSLocale.h"
|
||||
|
@ -75,12 +76,12 @@ GSSetLocale(int category, NSString *locale)
|
|||
locale = nil;
|
||||
if (clocale != 0)
|
||||
{
|
||||
locale = [NSString stringWithCString: clocale];
|
||||
locale = [NSString stringWithUTF8String: clocale];
|
||||
}
|
||||
return locale;
|
||||
}
|
||||
|
||||
#define GSLanginfo(value) [NSString stringWithCString: nl_langinfo (value)]
|
||||
#define GSLanginfo(value) [NSString stringWithUTF8String: nl_langinfo (value)]
|
||||
|
||||
/* Creates a locale dictionary from information provided by i18n functions.
|
||||
Many, but not all, of the keys are filled in or inferred from the
|
||||
|
@ -154,33 +155,33 @@ GSDomainFromDefaultLocale(void)
|
|||
/* Currency Information */
|
||||
if (lconv->currency_symbol)
|
||||
{
|
||||
[dict setObject: [NSString stringWithCString: lconv->currency_symbol]
|
||||
[dict setObject: [NSString stringWithUTF8String: lconv->currency_symbol]
|
||||
forKey: NSCurrencySymbol];
|
||||
}
|
||||
if (lconv->int_curr_symbol)
|
||||
{
|
||||
[dict setObject: [NSString stringWithCString: lconv->int_curr_symbol]
|
||||
[dict setObject: [NSString stringWithUTF8String: lconv->int_curr_symbol]
|
||||
forKey: NSInternationalCurrencyString];
|
||||
}
|
||||
if (lconv->mon_decimal_point)
|
||||
{
|
||||
[dict setObject: [NSString stringWithCString: lconv->mon_decimal_point]
|
||||
[dict setObject: [NSString stringWithUTF8String: lconv->mon_decimal_point]
|
||||
forKey: NSInternationalCurrencyString];
|
||||
}
|
||||
if (lconv->mon_thousands_sep)
|
||||
{
|
||||
[dict setObject: [NSString stringWithCString: lconv->mon_thousands_sep]
|
||||
[dict setObject: [NSString stringWithUTF8String: lconv->mon_thousands_sep]
|
||||
forKey: NSInternationalCurrencyString];
|
||||
}
|
||||
|
||||
if (lconv->decimal_point)
|
||||
{
|
||||
[dict setObject: [NSString stringWithCString: lconv->decimal_point]
|
||||
[dict setObject: [NSString stringWithUTF8String: lconv->decimal_point]
|
||||
forKey: NSDecimalSeparator];
|
||||
}
|
||||
if (lconv->thousands_sep)
|
||||
{
|
||||
[dict setObject: [NSString stringWithCString: lconv->thousands_sep]
|
||||
[dict setObject: [NSString stringWithUTF8String: lconv->thousands_sep]
|
||||
forKey: NSThousandsSeparator];
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
|
||||
#include "GNUstepBase/GSObjCRuntime.h"
|
||||
#include "Foundation/NSString.h"
|
||||
|
||||
/**
|
||||
* Macro to manage memory for chunks of code that need to work with
|
||||
|
@ -100,17 +101,6 @@
|
|||
because NXConstantString returns a pointer
|
||||
to it's internal pointer. */
|
||||
|
||||
/*
|
||||
* Function to get the name of a string encoding as an NSString.
|
||||
*/
|
||||
GS_EXPORT NSString *GSEncodingName(NSStringEncoding encoding);
|
||||
|
||||
/*
|
||||
* Function to determine whether data in a particular encoding can
|
||||
* generally be represented as 8-bit characters including ascii.
|
||||
*/
|
||||
GS_EXPORT BOOL GSIsByteEncoding(NSStringEncoding encoding);
|
||||
|
||||
/*
|
||||
* Type to hold either UTF-16 (unichar) or 8-bit encodings,
|
||||
* while satisfying alignment constraints.
|
||||
|
@ -173,10 +163,15 @@ typedef struct {
|
|||
typedef GSStr_t *GSStr;
|
||||
|
||||
/*
|
||||
* Functions to append to GSStr
|
||||
* Function to append to GSStr
|
||||
*/
|
||||
extern void GSStrAppendUnichar(GSStr s, unichar);
|
||||
extern void GSStrAppendUnichars(GSStr s, const unichar *u, unsigned l);
|
||||
/*
|
||||
* Make the content of this string into unicode if it is not in
|
||||
* the external defaults C string encoding.
|
||||
*/
|
||||
void GSStrExternalize(GSStr s);
|
||||
|
||||
|
||||
/*
|
||||
* Enumeration for MacOS-X compatibility user defaults settings.
|
||||
|
@ -192,21 +187,6 @@ typedef enum {
|
|||
GSUserDefaultMaxFlag // End marker.
|
||||
} GSUserDefaultFlagType;
|
||||
|
||||
/*
|
||||
* Get the dictionary representation.
|
||||
*/
|
||||
NSDictionary *GSUserDefaultsDictionaryRepresentation(void);
|
||||
|
||||
/*
|
||||
* Get one of several potentially useful flags.
|
||||
*/
|
||||
BOOL GSUserDefaultsFlag(GSUserDefaultFlagType type);
|
||||
|
||||
/**
|
||||
* Get a flag from an environment variable - return def if not defined.
|
||||
*/
|
||||
BOOL GSEnvironmentFlag(const char *name, BOOL def);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -238,5 +218,68 @@ extern void GSNotifyASAP(void);
|
|||
extern void GSNotifyIdle(void);
|
||||
extern BOOL GSNotifyMore(void);
|
||||
|
||||
/* This class exists to encapsulate various otherwise unrelated functions
|
||||
* so that we expose a single global symbol (the class) whose name marks it
|
||||
* very clearly as for private/internal use only. Avoiding the exposure
|
||||
* (and hence possible accidental use) of symbols for each function ...
|
||||
* The formal implementation of the class is a near empty implementation
|
||||
* (in Additions/GSCategories.h), with most methods being provided by other
|
||||
* categories in the files wishing to expose some functionality for use
|
||||
* by other parts of the base library.
|
||||
*/
|
||||
@interface _GSPrivate : NSObject
|
||||
/* Return the text describing the last system error to have occurred.
|
||||
*/
|
||||
+ (NSString*) error;
|
||||
+ (NSString*) error: (long)number;
|
||||
@end
|
||||
|
||||
@interface _GSPrivate (ProcessInfo)
|
||||
/* Used by NSException uncaught exception handler - must not call any
|
||||
* methods/functions which might cause a recursive exception.
|
||||
*/
|
||||
+ (const char*) argZero;
|
||||
|
||||
/* get a flag from an environment variable - return def if not defined.
|
||||
*/
|
||||
+ (BOOL) environmentFlag: (const char *)name defaultValue: (BOOL)def;
|
||||
@end
|
||||
|
||||
@interface _GSPrivate (Unicode)
|
||||
/* get the available string encodings (nul terminated array)
|
||||
*/
|
||||
+ (NSStringEncoding*) availableEncodings;
|
||||
|
||||
/* get the default C-string encoding.
|
||||
*/
|
||||
+ (NSStringEncoding) defaultCStringEncoding;
|
||||
|
||||
/* get the name of a string encoding as an NSString.
|
||||
*/
|
||||
+ (NSString*) encodingName: (NSStringEncoding)encoding;
|
||||
|
||||
/* determine whether data in a particular encoding can
|
||||
* generally be represented as 8-bit characters including ascii.
|
||||
*/
|
||||
+ (BOOL) isByteEncoding: (NSStringEncoding)encoding;
|
||||
|
||||
/* determine whether encoding is currently supported.
|
||||
*/
|
||||
+ (BOOL) isEncodingSupported: (NSStringEncoding)encoding;
|
||||
|
||||
@end
|
||||
|
||||
@interface _GSPrivate (UserDefaults)
|
||||
/*
|
||||
* Get the dictionary representation.
|
||||
*/
|
||||
+ (NSDictionary*) userDefaultsDictionaryRepresentation;
|
||||
|
||||
/*
|
||||
* Get one of several potentially useful flags.
|
||||
*/
|
||||
+ (BOOL) userDefaultsFlag: (GSUserDefaultFlagType)type;
|
||||
@end
|
||||
|
||||
#endif /* __GSPrivate_h_ */
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <Foundation/NSDebug.h>
|
||||
|
||||
#include "GSStream.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
NSString * const NSStreamDataWrittenToMemoryStreamKey
|
||||
= @"NSStreamDataWrittenToMemoryStreamKey";
|
||||
|
@ -364,7 +365,7 @@ static RunLoopEventType typeForStream(NSStream *aStream)
|
|||
theError = [NSError errorWithDomain: NSPOSIXErrorDomain
|
||||
code: errno
|
||||
userInfo: nil];
|
||||
NSLog(@"%@ error(%d): - %s", self, errno, GSLastErrorStr(errno));
|
||||
NSLog(@"%@ error(%d): - %@", self, errno, [_GSPrivate error]);
|
||||
ASSIGN(_lastError, theError);
|
||||
_currentStatus = NSStreamStatusError;
|
||||
}
|
||||
|
|
|
@ -52,12 +52,15 @@
|
|||
|
||||
#include "GSPrivate.h"
|
||||
|
||||
extern BOOL GSEncodingSupported(NSStringEncoding enc);
|
||||
|
||||
/* memcpy(), strlen(), strcmp() are gcc builtin's */
|
||||
|
||||
#include "GNUstepBase/Unicode.h"
|
||||
|
||||
static BOOL isByteEncoding(NSStringEncoding enc)
|
||||
{
|
||||
return [_GSPrivate isByteEncoding: enc];
|
||||
}
|
||||
|
||||
#ifdef NeXT_RUNTIME
|
||||
/* Used by the Darwin/NeXT ObjC Runtime
|
||||
until Apple Radar 2870817 is fixed. */
|
||||
|
@ -249,10 +252,18 @@ setup(void)
|
|||
|
||||
if (beenHere == NO)
|
||||
{
|
||||
extern NSStringEncoding GetDefEncoding(void);
|
||||
|
||||
beenHere = YES;
|
||||
|
||||
/*
|
||||
* Cache the default string encoding, and set the internal encoding
|
||||
* used by 8-bit character strings to match if possible.
|
||||
*/
|
||||
externalEncoding = [_GSPrivate defaultCStringEncoding];
|
||||
if (isByteEncoding(externalEncoding) == YES)
|
||||
{
|
||||
internalEncoding = externalEncoding;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cache pointers to classes to work round misfeature in
|
||||
* GNU compiler/runtime system where class lookup is very slow.
|
||||
|
@ -290,16 +301,6 @@ setup(void)
|
|||
caiSel = @selector(characterAtIndex:);
|
||||
gcrSel = @selector(getCharacters:range:);
|
||||
ranSel = @selector(rangeOfComposedCharacterSequenceAtIndex:);
|
||||
|
||||
/*
|
||||
* Cache the default string encoding, and set the internal encoding
|
||||
* used by 8-bit character strings to match if possible.
|
||||
*/
|
||||
externalEncoding = GetDefEncoding();
|
||||
if (GSIsByteEncoding(externalEncoding) == YES)
|
||||
{
|
||||
internalEncoding = externalEncoding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -450,7 +451,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree,
|
|||
void *chars = 0;
|
||||
BOOL flag = NO;
|
||||
|
||||
if (GSEncodingSupported(encoding) == NO)
|
||||
if ([_GSPrivate isEncodingSupported: encoding] == NO)
|
||||
{
|
||||
return nil; // Invalid encoding
|
||||
}
|
||||
|
@ -493,7 +494,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree,
|
|||
BOOL isLatin1 = NO;
|
||||
GSStr me;
|
||||
|
||||
if (GSEncodingSupported(encoding) == NO)
|
||||
if ([_GSPrivate isEncodingSupported: encoding] == NO)
|
||||
{
|
||||
if (flag == YES && bytes != 0)
|
||||
{
|
||||
|
@ -535,7 +536,7 @@ fixBOM(unsigned char **bytes, unsigned *length, BOOL *shouldFree,
|
|||
encoding = internalEncoding;
|
||||
}
|
||||
}
|
||||
else if (encoding != internalEncoding && GSIsByteEncoding(encoding) == YES)
|
||||
else if (encoding != internalEncoding && isByteEncoding(encoding) == YES)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
|
@ -1025,7 +1026,7 @@ canBeConvertedToEncoding_c(GSStr self, NSStringEncoding enc)
|
|||
&& enc != internalEncoding
|
||||
&& enc != NSUTF8StringEncoding
|
||||
&& enc != NSUnicodeStringEncoding
|
||||
&& ((internalEncoding != NSASCIIStringEncoding) || !GSIsByteEncoding(enc)))
|
||||
&& ((internalEncoding != NSASCIIStringEncoding) || !isByteEncoding(enc)))
|
||||
{
|
||||
unsigned l = 0;
|
||||
unichar *r = 0;
|
||||
|
@ -1403,7 +1404,7 @@ dataUsingEncoding_c(GSStr self, NSStringEncoding encoding, BOOL lossy)
|
|||
|
||||
if ((encoding == internalEncoding)
|
||||
|| ((internalEncoding == NSASCIIStringEncoding)
|
||||
&& (encoding == NSUTF8StringEncoding || GSIsByteEncoding(encoding))))
|
||||
&& (encoding == NSUTF8StringEncoding || isByteEncoding(encoding))))
|
||||
{
|
||||
unsigned char *buff;
|
||||
|
||||
|
@ -1787,7 +1788,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength,
|
|||
}
|
||||
|
||||
if (enc == NSUTF8StringEncoding
|
||||
&& GSIsByteEncoding(internalEncoding))
|
||||
&& isByteEncoding(internalEncoding))
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
|
@ -1822,7 +1823,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength,
|
|||
}
|
||||
|
||||
if (enc == NSASCIIStringEncoding
|
||||
&& GSIsByteEncoding(internalEncoding))
|
||||
&& isByteEncoding(internalEncoding))
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
|
@ -3759,7 +3760,7 @@ NSAssert(_flags.free == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
encoding = internalEncoding;
|
||||
}
|
||||
}
|
||||
else if (encoding != internalEncoding && GSIsByteEncoding(encoding) == YES)
|
||||
else if (encoding != internalEncoding && isByteEncoding(encoding) == YES)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
|
@ -5078,44 +5079,7 @@ void GSStrAppendUnichars(GSStr s, const unichar *u, unsigned l)
|
|||
}
|
||||
}
|
||||
|
||||
void GSStrAppendUnichar(GSStr s, unichar u)
|
||||
{
|
||||
/*
|
||||
* Make the string wide if necessary.
|
||||
*/
|
||||
if (s->_flags.wide == 0)
|
||||
{
|
||||
if (u > 255 || (u > 127 && internalEncoding != NSISOLatin1StringEncoding))
|
||||
{
|
||||
GSStrWiden(s);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Make room for the characters we are appending.
|
||||
*/
|
||||
if (s->_count + 2 >= s->_capacity)
|
||||
{
|
||||
GSStrMakeSpace(s, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the characters into place.
|
||||
*/
|
||||
if (s->_flags.wide == 1)
|
||||
{
|
||||
s->_contents.u[s->_count++] = u;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->_contents.c[s->_count++] = u;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the content of this string into unicode if it is not in
|
||||
* the external defaults C string encoding.
|
||||
*/
|
||||
void GSStrExternalize(GSStr s)
|
||||
{
|
||||
if (s->_flags.wide == 0 && internalEncoding != externalEncoding)
|
||||
|
|
|
@ -858,7 +858,7 @@ static Class NSMutableDataMallocClass;
|
|||
if (node)
|
||||
{
|
||||
c = (Class)node->value.ptr;
|
||||
return [NSString stringWithCString: GSNameFromClass(c)];
|
||||
return [NSString stringWithUTF8String: GSNameFromClass(c)];
|
||||
}
|
||||
}
|
||||
return trueName;
|
||||
|
|
|
@ -1202,7 +1202,7 @@ compare(id elem1, id elem2, void* context)
|
|||
*/
|
||||
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
||||
{
|
||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||
NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
NSString *desc = nil;
|
||||
NSData *data;
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ compare(id elem1, id elem2, void* context)
|
|||
*/
|
||||
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
||||
{
|
||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||
NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
NSString *desc = nil;
|
||||
NSData *data;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include "Foundation/NSPathUtilities.h"
|
||||
#include "Foundation/NSData.h"
|
||||
#include "Foundation/NSValue.h"
|
||||
#include "GNUstepBase/GSFunctions.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -226,7 +226,7 @@ static NSString *ExecutablePath()
|
|||
#ifdef PROCFS_EXE_LINK
|
||||
executablePath = [[NSFileManager defaultManager]
|
||||
pathContentOfSymbolicLinkAtPath:
|
||||
[NSString stringWithCString: PROCFS_EXE_LINK]];
|
||||
[NSString stringWithUTF8String: PROCFS_EXE_LINK]];
|
||||
|
||||
/*
|
||||
On some systems, the link is of the form "[device]:inode", which
|
||||
|
@ -377,11 +377,29 @@ _bundle_name_first_match(NSString* directory, NSString* name)
|
|||
static inline NSString *
|
||||
_find_framework(NSString *name)
|
||||
{
|
||||
NSArray *paths;
|
||||
NSArray *paths;
|
||||
NSFileManager *file_mgr = [NSFileManager defaultManager];
|
||||
NSString *file_name;
|
||||
NSString *file_path;
|
||||
NSString *path;
|
||||
NSEnumerator *enumerator;
|
||||
|
||||
NSCParameterAssert(name != nil);
|
||||
|
||||
paths = NSSearchPathForDirectoriesInDomains(GSFrameworksDirectory,
|
||||
NSAllDomainsMask,YES);
|
||||
return GSFindNamedFile(paths, name, @"framework");
|
||||
|
||||
enumerator = [paths objectEnumerator];
|
||||
while ((path = [enumerator nextObject]))
|
||||
{
|
||||
file_path = [path stringByAppendingPathComponent: file_name];
|
||||
|
||||
if ([file_mgr fileExistsAtPath: file_path] == YES)
|
||||
{
|
||||
return file_path; // Found it!
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@interface NSBundle (Private)
|
||||
|
@ -464,8 +482,9 @@ _find_framework(NSString *name)
|
|||
&& !strncmp ("NSFramework_", frameworkClass->name, 12))
|
||||
{
|
||||
/* The name of the framework. */
|
||||
NSString *name = [NSString stringWithCString: &frameworkClass->name[12]];
|
||||
NSString *name;
|
||||
|
||||
name = [NSString stringWithUTF8String: &frameworkClass->name[12]];
|
||||
/* Important - gnustep-make mangles framework names to encode
|
||||
* them as ObjC class names. Here we need to demangle them. We
|
||||
* apply the reverse transformations in the reverse order.
|
||||
|
|
|
@ -653,7 +653,7 @@ static inline int getDigits(const char *from, char *to, int limit)
|
|||
sourceLen = strlen(source);
|
||||
if (locale == nil)
|
||||
{
|
||||
locale = GSUserDefaultsDictionaryRepresentation();
|
||||
locale = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
}
|
||||
if (fmt == nil)
|
||||
{
|
||||
|
@ -1064,7 +1064,7 @@ static inline int getDigits(const char *from, char *to, int limit)
|
|||
NSString *currAMPM;
|
||||
NSArray *amPMNames;
|
||||
|
||||
currAMPM = [NSString stringWithCString: tmpStr];
|
||||
currAMPM = [NSString stringWithUTF8String: tmpStr];
|
||||
amPMNames = [locale objectForKey: NSAMPMDesignation];
|
||||
|
||||
/*
|
||||
|
@ -1170,7 +1170,7 @@ static inline int getDigits(const char *from, char *to, int limit)
|
|||
tmpStr[tmpIdx - sourceIdx] = '\0';
|
||||
sourceIdx += tmpIdx - sourceIdx;
|
||||
{
|
||||
NSString *z = [NSString stringWithCString: tmpStr];
|
||||
NSString *z = [NSString stringWithUTF8String: tmpStr];
|
||||
|
||||
/* Abbreviations aren't one-to-one with time zone names
|
||||
so just look for the zone named after the abbreviation,
|
||||
|
@ -2191,7 +2191,7 @@ static void Grow(DescriptionInfo *info, unsigned size)
|
|||
DescriptionInfo info;
|
||||
|
||||
if (locale == nil)
|
||||
locale = GSUserDefaultsDictionaryRepresentation();
|
||||
locale = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
if (format == nil)
|
||||
format = [locale objectForKey: NSTimeDateFormatString];
|
||||
|
||||
|
|
143
Source/NSData.m
143
Source/NSData.m
|
@ -80,6 +80,7 @@
|
|||
#include "Foundation/NSRange.h"
|
||||
#include "Foundation/NSURL.h"
|
||||
#include "Foundation/NSZone.h"
|
||||
#include "GSPrivate.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h> /* for memset() */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@ -163,8 +164,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
|
||||
if (theFile == 0) /* We failed to open the file. */
|
||||
{
|
||||
NSWarnFLog(@"Open (%@) attempt failed - %s", path,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnFLog(@"Open (%@) attempt failed - %@", path, [_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -174,8 +174,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
c = fseek(theFile, 0L, SEEK_END);
|
||||
if (c != 0)
|
||||
{
|
||||
NSWarnFLog(@"Seek to end of file (%@) failed - %s", path,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnFLog(@"Seek to end of file (%@) failed - %@", path,
|
||||
[_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -186,8 +186,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
fileLength = ftell(theFile);
|
||||
if (fileLength == -1)
|
||||
{
|
||||
NSWarnFLog(@"Ftell on %@ failed - %s", path,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnFLog(@"Ftell on %@ failed - %@", path, [_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -198,8 +197,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
c = fseek(theFile, 0L, SEEK_SET);
|
||||
if (c != 0)
|
||||
{
|
||||
NSWarnFLog(@"Fseek to start of file (%@) failed - %s", path,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnFLog(@"Fseek to start of file (%@) failed - %@", path,
|
||||
[_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -224,8 +223,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
}
|
||||
if (tmp == 0)
|
||||
{
|
||||
NSLog(@"Malloc failed for file (%@) of length %d - %s", path,
|
||||
fileLength + c, GSLastErrorStr(errno));
|
||||
NSLog(@"Malloc failed for file (%@) of length %d - %@", path,
|
||||
fileLength + c, [_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
memcpy(tmp + fileLength, buf, c);
|
||||
|
@ -237,16 +236,16 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
tmp = NSZoneMalloc(zone, fileLength);
|
||||
if (tmp == 0)
|
||||
{
|
||||
NSLog(@"Malloc failed for file (%@) of length %d - %s", path,
|
||||
fileLength, GSLastErrorStr(errno));
|
||||
NSLog(@"Malloc failed for file (%@) of length %d - %@", path,
|
||||
fileLength, [_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
c = fread(tmp, 1, fileLength, theFile);
|
||||
if (c != (int)fileLength)
|
||||
{
|
||||
NSWarnFLog(@"read of file (%@) contents failed - %s", path,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnFLog(@"read of file (%@) contents failed - %@", path,
|
||||
[_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
|
@ -852,8 +851,7 @@ failure:
|
|||
strcat(thePath, "XXXXXX");
|
||||
if ((desc = mkstemp(thePath)) < 0)
|
||||
{
|
||||
NSWarnMLog(@"mkstemp (%s) failed - %s", thePath,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"mkstemp (%s) failed - %@", thePath, [_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
mask = umask(0);
|
||||
|
@ -880,9 +878,9 @@ failure:
|
|||
wcscat(wthePath, L"XXXXXX");
|
||||
if (_wmktemp(wthePath) == 0)
|
||||
{
|
||||
NSWarnMLog(@"mktemp (%@) failed - %s",
|
||||
[NSString stringWithCharacters:wthePath length:wcslen(wthePath)],
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"mktemp (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
[_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
#else
|
||||
|
@ -890,8 +888,7 @@ failure:
|
|||
strcat(thePath, "XXXXXX");
|
||||
if (mktemp(thePath) == 0)
|
||||
{
|
||||
NSWarnMLog(@"mktemp (%s) failed - %s", thePath,
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"mktemp (%s) failed - %@", thePath, [_GSPrivate error]);
|
||||
goto failure;
|
||||
}
|
||||
#endif
|
||||
|
@ -918,11 +915,11 @@ failure:
|
|||
/* Something went wrong; we weren't
|
||||
* even able to open the file. */
|
||||
#if defined(__MINGW32__)
|
||||
NSWarnMLog(@"Open (%@) failed - %s",
|
||||
NSWarnMLog(@"Open (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
GSLastErrorStr(errno));
|
||||
[_GSPrivate error]);
|
||||
#else
|
||||
NSWarnMLog(@"Open (%s) failed - %s", thePath, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Open (%s) failed - %@", thePath, [_GSPrivate error]);
|
||||
#endif
|
||||
goto failure;
|
||||
}
|
||||
|
@ -936,11 +933,11 @@ failure:
|
|||
* some reason. */
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
NSWarnMLog(@"Fwrite (%@) failed - %s",
|
||||
[NSString stringWithCharacters:wthePath length:wcslen(wthePath)],
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Fwrite (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
[_GSPrivate error]);
|
||||
#else
|
||||
NSWarnMLog(@"Fwrite (%s) failed - %s", thePath, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Fwrite (%s) failed - %@", thePath, [_GSPrivate error]);
|
||||
#endif
|
||||
goto failure;
|
||||
}
|
||||
|
@ -953,11 +950,11 @@ failure:
|
|||
* so we need to deal with it. */
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
NSWarnMLog(@"Fclose (%@) failed - %s",
|
||||
[NSString stringWithCharacters:wthePath length:wcslen(wthePath)],
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Fclose (%@) failed - %@",
|
||||
[NSString stringWithCharacters: wthePath length: wcslen(wthePath)],
|
||||
[_GSPrivate error]);
|
||||
#else
|
||||
NSWarnMLog(@"Fclose (%s) failed - %s", thePath, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Fclose (%s) failed - %@", thePath, [_GSPrivate error]);
|
||||
#endif
|
||||
goto failure;
|
||||
}
|
||||
|
@ -1038,14 +1035,15 @@ failure:
|
|||
if (c != 0) /* Many things could go wrong, I guess. */
|
||||
{
|
||||
#if defined(__MINGW32__)
|
||||
NSWarnMLog(@"Rename ('%@' to '%@') failed - %s",
|
||||
[NSString stringWithCharacters: wthePath length:wcslen(wthePath)],
|
||||
[NSString stringWithCharacters:
|
||||
wtheRealPath length:wcslen(wtheRealPath)],
|
||||
GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Rename ('%@' to '%@') failed - %@",
|
||||
[NSString stringWithCharacters: wthePath
|
||||
length: wcslen(wthePath)],
|
||||
[NSString stringWithCharacters: wtheRealPath
|
||||
length: wcslen(wtheRealPath)],
|
||||
[_GSPrivate error]);
|
||||
#else
|
||||
NSWarnMLog(@"Rename ('%s' to '%s') failed - %s",
|
||||
thePath, theRealPath, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"Rename ('%s' to '%s') failed - %@",
|
||||
thePath, theRealPath, [_GSPrivate error]);
|
||||
#endif
|
||||
goto failure;
|
||||
}
|
||||
|
@ -2918,7 +2916,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
#endif
|
||||
if (fd < 0)
|
||||
{
|
||||
NSWarnMLog(@"unable to open %@ - %s", path, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"unable to open %@ - %@", path, [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -2926,7 +2924,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
length = lseek(fd, 0, SEEK_END);
|
||||
if (length < 0)
|
||||
{
|
||||
NSWarnMLog(@"unable to seek to eof %@ - %s", path, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"unable to seek to eof %@ - %@", path, [_GSPrivate error]);
|
||||
close(fd);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -2934,7 +2932,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
/* Position at start of file. */
|
||||
if (lseek(fd, 0, SEEK_SET) != 0)
|
||||
{
|
||||
NSWarnMLog(@"unable to seek to sof %@ - %s", path, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"unable to seek to sof %@ - %@", path, [_GSPrivate error]);
|
||||
close(fd);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -2942,7 +2940,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
bytes = mmap(0, length, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (bytes == MAP_FAILED)
|
||||
{
|
||||
NSWarnMLog(@"mapping failed for %s - %s", path, GSLastErrorStr(errno));
|
||||
NSWarnMLog(@"mapping failed for %s - %@", path, [_GSPrivate error]);
|
||||
close(fd);
|
||||
RELEASE(self);
|
||||
self = [dataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
|
@ -2969,15 +2967,15 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
struct shmid_ds buf;
|
||||
|
||||
if (shmctl(shmid, IPC_STAT, &buf) < 0)
|
||||
NSLog(@"[NSDataShared -dealloc] shared memory control failed - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"[NSDataShared -dealloc] shared memory control failed - %@",
|
||||
[_GSPrivate error]);
|
||||
else if (buf.shm_nattch == 1)
|
||||
if (shmctl(shmid, IPC_RMID, &buf) < 0) /* Mark for deletion. */
|
||||
NSLog(@"[NSDataShared -dealloc] shared memory delete failed - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"[NSDataShared -dealloc] shared memory delete failed - %@",
|
||||
[_GSPrivate error]);
|
||||
if (shmdt(bytes) < 0)
|
||||
NSLog(@"[NSDataShared -dealloc] shared memory detach failed - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"[NSDataShared -dealloc] shared memory detach failed - %@",
|
||||
[_GSPrivate error]);
|
||||
bytes = 0;
|
||||
length = 0;
|
||||
shmid = -1;
|
||||
|
@ -2993,8 +2991,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
shmid = shmget(IPC_PRIVATE, bufferSize, IPC_CREAT|VM_RDONLY);
|
||||
if (shmid == -1) /* Created memory? */
|
||||
{
|
||||
NSLog(@"[-initWithBytes:length:] shared mem get failed for %u - %s",
|
||||
bufferSize, GSLastErrorStr(errno));
|
||||
NSLog(@"[-initWithBytes:length:] shared mem get failed for %u - %@",
|
||||
bufferSize, [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
self = [dataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
return [self initWithBytes: aBuffer length: bufferSize];
|
||||
|
@ -3003,8 +3001,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
bytes = shmat(shmid, 0, 0);
|
||||
if (bytes == (void*)-1)
|
||||
{
|
||||
NSLog(@"[-initWithBytes:length:] shared mem attach failed for %u - %s",
|
||||
bufferSize, GSLastErrorStr(errno));
|
||||
NSLog(@"[-initWithBytes:length:] shared mem attach failed for %u - %@",
|
||||
bufferSize, [_GSPrivate error]);
|
||||
bytes = 0;
|
||||
RELEASE(self);
|
||||
self = [dataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
|
@ -3022,21 +3020,23 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
shmid = anId;
|
||||
if (shmctl(shmid, IPC_STAT, &buf) < 0)
|
||||
{
|
||||
NSLog(@"[NSDataShared -initWithShmID:length:] shared memory control failed - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"[NSDataShared -initWithShmID:length:] shared memory "
|
||||
@"control failed - %@", [_GSPrivate error]);
|
||||
RELEASE(self); /* Unable to access memory. */
|
||||
return nil;
|
||||
}
|
||||
if (buf.shm_segsz < bufferSize)
|
||||
{
|
||||
NSLog(@"[NSDataShared -initWithShmID:length:] shared memory segment too small");
|
||||
NSLog(@"[NSDataShared -initWithShmID:length:] shared memory "
|
||||
@"segment too small");
|
||||
RELEASE(self); /* Memory segment too small. */
|
||||
return nil;
|
||||
}
|
||||
bytes = shmat(shmid, 0, 0);
|
||||
if (bytes == (void*)-1)
|
||||
{
|
||||
NSLog(@"[NSDataShared -initWithShmID:length:] shared memory attach failed - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"[NSDataShared -initWithShmID:length:] shared memory "
|
||||
@"attach failed - %s", [_GSPrivate error]);
|
||||
bytes = 0;
|
||||
RELEASE(self); /* Unable to attach to memory. */
|
||||
return nil;
|
||||
|
@ -3162,7 +3162,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (bytes == 0)
|
||||
{
|
||||
NSLog(@"[NSMutableDataMalloc -initWithCapacity:] out of memory "
|
||||
@"for %u bytes - %s", size, GSLastErrorStr(errno));
|
||||
@"for %u bytes - %@", size, [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -3658,20 +3658,20 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (shmctl(shmid, IPC_STAT, &buf) < 0)
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -dealloc] shared memory "
|
||||
@"control failed - %s", GSLastErrorStr(errno));
|
||||
@"control failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
else if (buf.shm_nattch == 1)
|
||||
{
|
||||
if (shmctl(shmid, IPC_RMID, &buf) < 0) /* Mark for deletion. */
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -dealloc] shared memory "
|
||||
@"delete failed - %s", GSLastErrorStr(errno));
|
||||
@"delete failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
}
|
||||
if (shmdt(bytes) < 0)
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -dealloc] shared memory "
|
||||
@"detach failed - %s", GSLastErrorStr(errno));
|
||||
@"detach failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
bytes = 0;
|
||||
length = 0;
|
||||
|
@ -3695,24 +3695,21 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
|
||||
- (id) initWithCapacity: (unsigned int)bufferSize
|
||||
{
|
||||
int e;
|
||||
|
||||
shmid = shmget(IPC_PRIVATE, bufferSize, IPC_CREAT|VM_ACCESS);
|
||||
if (shmid == -1) /* Created memory? */
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -initWithCapacity:] shared memory "
|
||||
@"get failed for %u - %s", bufferSize, GSLastErrorStr(errno));
|
||||
@"get failed for %u - %@", bufferSize, [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
self = [mutableDataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
return [self initWithCapacity: bufferSize];
|
||||
}
|
||||
|
||||
bytes = shmat(shmid, 0, 0);
|
||||
e = errno;
|
||||
if (bytes == (void*)-1)
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -initWithCapacity:] shared memory "
|
||||
@"attach failed for %u - %s", bufferSize, GSLastErrorStr(e));
|
||||
@"attach failed for %u - %@", bufferSize, [_GSPrivate error]);
|
||||
bytes = 0;
|
||||
RELEASE(self);
|
||||
self = [mutableDataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
|
@ -3732,7 +3729,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (shmctl(shmid, IPC_STAT, &buf) < 0)
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -initWithShmID:length:] shared memory "
|
||||
@"control failed - %s", GSLastErrorStr(errno));
|
||||
@"control failed - %@", [_GSPrivate error]);
|
||||
RELEASE(self); /* Unable to access memory. */
|
||||
return nil;
|
||||
}
|
||||
|
@ -3747,7 +3744,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (bytes == (void*)-1)
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -initWithShmID:length:] shared memory "
|
||||
@"attach failed - %s", GSLastErrorStr(errno));
|
||||
@"attach failed - %@", [_GSPrivate error]);
|
||||
bytes = 0;
|
||||
RELEASE(self); /* Unable to attach to memory. */
|
||||
return nil;
|
||||
|
@ -3769,8 +3766,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (newid == -1) /* Created memory? */
|
||||
{
|
||||
[NSException raise: NSMallocException
|
||||
format: @"Unable to create shared memory segment (size:%u) - %s.",
|
||||
size, GSLastErrorStr(errno)];
|
||||
format: @"Unable to create shared memory segment (size:%u) - %@.",
|
||||
size, [_GSPrivate error]];
|
||||
}
|
||||
tmp = shmat(newid, 0, 0);
|
||||
if ((intptr_t)tmp == -1) /* Attached memory? */
|
||||
|
@ -3786,20 +3783,20 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
if (shmctl(shmid, IPC_STAT, &buf) < 0)
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -setCapacity:] shared memory "
|
||||
@"control failed - %s", GSLastErrorStr(errno));
|
||||
@"control failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
else if (buf.shm_nattch == 1)
|
||||
{
|
||||
if (shmctl(shmid, IPC_RMID, &buf) < 0) /* Mark for deletion. */
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -setCapacity:] shared memory "
|
||||
@"delete failed - %s", GSLastErrorStr(errno));
|
||||
@"delete failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
}
|
||||
if (shmdt(bytes) < 0) /* Detach memory. */
|
||||
{
|
||||
NSLog(@"[NSMutableDataShared -setCapacity:] shared memory "
|
||||
@"detach failed - %s", GSLastErrorStr(errno));
|
||||
@"detach failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
}
|
||||
bytes = tmp;
|
||||
|
|
|
@ -264,7 +264,7 @@ otherTime(NSDate* other)
|
|||
|
||||
if (locale == nil)
|
||||
{
|
||||
locale = GSUserDefaultsDictionaryRepresentation();
|
||||
locale = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
}
|
||||
ws = [NSCharacterSet whitespaceAndNewlineCharacterSet];
|
||||
digits = [NSCharacterSet decimalDigitCharacterSet];
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
<title>NSDateFormatter class reference</title>
|
||||
$Date$ $Revision$
|
||||
|
|
|
@ -957,6 +957,7 @@ const char *_NSPrintForDebugger(id object)
|
|||
|
||||
NSString *_NSNewStringFromCString(const char *cstring)
|
||||
{
|
||||
return [NSString stringWithCString: cstring];
|
||||
return [NSString stringWithCString: cstring
|
||||
encoding: [NSString defaultCStringEncoding]];
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
<title>NSDecimal class reference</title>
|
||||
$Date$ $Revision$
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
<title>NSDecimalNumber class reference</title>
|
||||
$Date$ $Revision$
|
||||
|
@ -260,7 +261,7 @@ static NSDecimalNumber *one;
|
|||
- (id) initWithString: (NSString*)numberValue
|
||||
{
|
||||
return [self initWithString: numberValue
|
||||
locale: GSUserDefaultsDictionaryRepresentation()];
|
||||
locale: [_GSPrivate userDefaultsDictionaryRepresentation]];
|
||||
}
|
||||
|
||||
- (id) initWithString: (NSString*)numberValue
|
||||
|
|
|
@ -929,7 +929,7 @@ compareIt(id o1, id o2, void* context)
|
|||
*/
|
||||
- (BOOL) writeToFile: (NSString *)path atomically: (BOOL)useAuxiliaryFile
|
||||
{
|
||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||
NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
NSString *desc = nil;
|
||||
NSData *data;
|
||||
|
||||
|
@ -954,7 +954,7 @@ compareIt(id o1, id o2, void* context)
|
|||
*/
|
||||
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
||||
{
|
||||
NSDictionary *loc = GSUserDefaultsDictionaryRepresentation();
|
||||
NSDictionary *loc = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
NSString *desc = nil;
|
||||
NSData *data;
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
<title>NSDistributedLock class reference</title>
|
||||
$Date$ $Revision$
|
||||
|
@ -31,6 +32,7 @@
|
|||
#include "Foundation/NSException.h"
|
||||
#include "Foundation/NSValue.h"
|
||||
#include "Foundation/NSDebug.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
|
@ -76,13 +78,13 @@ static NSFileManager *mgr = nil;
|
|||
|
||||
if ([mgr removeFileAtPath: _lockPath handler: nil] == NO)
|
||||
{
|
||||
const char *err = GSLastErrorStr(errno);
|
||||
NSString *err = [_GSPrivate error];
|
||||
|
||||
attributes = [mgr fileAttributesAtPath: _lockPath traverseLink: YES];
|
||||
if ([modDate isEqual: [attributes fileModificationDate]] == YES)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"Failed to remove lock directory '%@' - %s",
|
||||
format: @"Failed to remove lock directory '%@' - %@",
|
||||
_lockPath, err];
|
||||
}
|
||||
}
|
||||
|
@ -201,8 +203,8 @@ static NSFileManager *mgr = nil;
|
|||
attributes: attributesToSet];
|
||||
if (locked == NO)
|
||||
{
|
||||
NSLog(@"Failed to create lock directory '%@' - %s",
|
||||
_lockPath, GSLastErrorStr(errno));
|
||||
NSLog(@"Failed to create lock directory '%@' - %@",
|
||||
_lockPath, [_GSPrivate error]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,8 +259,8 @@ static NSFileManager *mgr = nil;
|
|||
if ([mgr removeFileAtPath: _lockPath handler: nil] == NO)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"Failed to remove lock directory '%@' - %s",
|
||||
_lockPath, GSLastErrorStr(errno)];
|
||||
format: @"Failed to remove lock directory '%@' - %@",
|
||||
_lockPath, [_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -353,8 +353,9 @@ static void find_address (bfd *abfd, asection *section,
|
|||
fi = [GSFunctionInfo alloc];
|
||||
fi = [fi initWithModule: info->module
|
||||
address: info->theAddress
|
||||
file: [NSString stringWithCString: fileName]
|
||||
function: [NSString stringWithCString: functionName]
|
||||
file: [NSString stringWithCString: fileName
|
||||
encoding: [NSString defaultCStringEncoding]]
|
||||
function: [NSString stringWithUTF8String: functionName]
|
||||
line: line];
|
||||
[fi autorelease];
|
||||
info->theInfo = fi;
|
||||
|
@ -584,7 +585,8 @@ static void _terminate()
|
|||
#else
|
||||
shouldAbort = NO; // exit() by default.
|
||||
#endif
|
||||
shouldAbort = GSEnvironmentFlag("CRASH_ON_ABORT", shouldAbort);
|
||||
shouldAbort = [_GSPrivate environmentFlag: "CRASH_ON_ABORT"
|
||||
defaultValue: shouldAbort];
|
||||
if (shouldAbort == YES)
|
||||
{
|
||||
abort();
|
||||
|
@ -598,9 +600,8 @@ static void _terminate()
|
|||
static void
|
||||
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||
{
|
||||
extern const char* GSArgZero(void);
|
||||
|
||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n", GSArgZero(),
|
||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n",
|
||||
[_GSPrivate argZero],
|
||||
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
||||
fflush(stderr); /* NEEDED UNDER MINGW */
|
||||
|
||||
|
|
|
@ -401,8 +401,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileOwnerAccountID to '%u' - %s",
|
||||
num, GSLastErrorStr(errno)];
|
||||
@"Unable to change NSFileOwnerAccountID to '%u' - %@",
|
||||
num, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
@ -425,8 +425,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileOwnerAccountName to '%@' - %s",
|
||||
str, GSLastErrorStr(errno)];
|
||||
@"Unable to change NSFileOwnerAccountName to '%@' - %@",
|
||||
str, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
@ -439,8 +439,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileGroupOwnerAccountID to '%u' - %s",
|
||||
num, GSLastErrorStr(errno)];
|
||||
@"Unable to change NSFileGroupOwnerAccountID to '%u' - %@",
|
||||
num, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
@ -461,8 +461,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileGroupOwnerAccountName to '%@' - %s",
|
||||
str, GSLastErrorStr(errno)];
|
||||
@"Unable to change NSFileGroupOwnerAccountName to '%@' - %@",
|
||||
str, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
@ -475,8 +475,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFilePosixPermissions to '%o' - %s",
|
||||
num, GSLastErrorStr(errno)];
|
||||
@"Unable to change NSFilePosixPermissions to '%o' - %@",
|
||||
num, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
@ -519,8 +519,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
allOk = NO;
|
||||
str = [NSString stringWithFormat:
|
||||
@"Unable to change NSFileModificationDate to '%@' - %s",
|
||||
date, GSLastErrorStr(errno)];
|
||||
@"Unable to change NSFileModificationDate to '%@' - %@",
|
||||
date, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, str);
|
||||
}
|
||||
}
|
||||
|
@ -747,8 +747,8 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Could not create '%s' - '%s'",
|
||||
dirpath, GSLastErrorStr(errno)];
|
||||
s = [NSString stringWithFormat: @"Could not create '%s' - '%@'",
|
||||
dirpath, [_GSPrivate error]];
|
||||
ASSIGN(_lastError, s);
|
||||
return NO;
|
||||
}
|
||||
|
@ -1278,8 +1278,8 @@ static NSStringEncoding defaultEncoding;
|
|||
#endif
|
||||
{
|
||||
return [self _proceedAccordingToHandler: handler
|
||||
forError: [NSString stringWithCString: GSLastErrorStr (errno)]
|
||||
inPath: path];
|
||||
forError: [_GSPrivate error]
|
||||
inPath: path];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1312,8 +1312,8 @@ static NSStringEncoding defaultEncoding;
|
|||
if (_RMDIR([self fileSystemRepresentationWithPath: path]) < 0)
|
||||
{
|
||||
return [self _proceedAccordingToHandler: handler
|
||||
forError: [NSString stringWithCString: GSLastErrorStr (errno)]
|
||||
inPath: path];
|
||||
forError: [_GSPrivate error]
|
||||
inPath: path];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2031,8 +2031,8 @@ inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Failed to recurse into directory '%@' - %s", path,
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"Failed to recurse into directory '%@' - %@", path,
|
||||
[_GSPrivate error]);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -2198,8 +2198,8 @@ inline void gsedRelease(GSEnumeratedDirectory X)
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Failed to recurse into directory '%@' - %s",
|
||||
_currentFilePath, GSLastErrorStr(errno));
|
||||
NSLog(@"Failed to recurse into directory '%@' - %@",
|
||||
_currentFilePath, [_GSPrivate error]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2940,7 +2940,8 @@ static NSSet *fileKeys = nil;
|
|||
gp = getgrgid(statbuf.st_gid);
|
||||
if (gp != 0)
|
||||
{
|
||||
group = [NSString stringWithCString: gp->gr_name];
|
||||
group = [NSString stringWithCString: gp->gr_name
|
||||
encoding: defaultEncoding];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -3081,7 +3082,8 @@ static NSSet *fileKeys = nil;
|
|||
|
||||
if (pw != 0)
|
||||
{
|
||||
owner = [NSString stringWithCString: pw->pw_name];
|
||||
owner = [NSString stringWithCString: pw->pw_name
|
||||
encoding: defaultEncoding];
|
||||
}
|
||||
#endif /* HAVE_PWD_H */
|
||||
#endif
|
||||
|
|
|
@ -204,7 +204,7 @@ static NSMutableDictionary *_hostCache = nil;
|
|||
break;
|
||||
}
|
||||
|
||||
h_name = [NSString stringWithCString: entry->h_name];
|
||||
h_name = [NSString stringWithUTF8String: entry->h_name];
|
||||
[names addObject: h_name];
|
||||
|
||||
if (entry->h_aliases != 0)
|
||||
|
@ -212,7 +212,7 @@ static NSMutableDictionary *_hostCache = nil;
|
|||
i = 0;
|
||||
while ((ptr = entry->h_aliases[i++]) != 0)
|
||||
{
|
||||
[names addObject: [NSString stringWithCString: ptr]];
|
||||
[names addObject: [NSString stringWithUTF8String: ptr]];
|
||||
}
|
||||
}
|
||||
if (entry->h_addr_list != 0)
|
||||
|
@ -223,7 +223,7 @@ static NSMutableDictionary *_hostCache = nil;
|
|||
NSString *addr;
|
||||
|
||||
memcpy((void*)&in.s_addr, (const void*)ptr, entry->h_length);
|
||||
addr = [NSString stringWithCString: (char*)inet_ntoa(in)];
|
||||
addr = [NSString stringWithUTF8String: (char*)inet_ntoa(in)];
|
||||
[addresses addObject: addr];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -648,13 +648,13 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
char buffer[1024];
|
||||
|
||||
snprintf (buffer, 1024, "<%s %p selector: %s target: %s>", \
|
||||
GSClassNameFromObject(self), \
|
||||
self, \
|
||||
_selector ? GSNameFromSelector(_selector) : "nil", \
|
||||
_target ? GSNameFromClass([_target class]) : "nil" \
|
||||
);
|
||||
GSClassNameFromObject(self), \
|
||||
self, \
|
||||
_selector ? GSNameFromSelector(_selector) : "nil", \
|
||||
_target ? GSNameFromClass([_target class]) : "nil" \
|
||||
);
|
||||
|
||||
return [NSString stringWithCString: buffer];
|
||||
return [NSString stringWithUTF8String: buffer];
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
|
|
|
@ -669,7 +669,7 @@ static NSDictionary *makeReference(unsigned ref)
|
|||
* Bizzarely MacOS-X seems to encode char* values by creating
|
||||
* string objects and encoding those objects!
|
||||
*/
|
||||
o = [NSString stringWithCString: (char*)address];
|
||||
o = [NSString stringWithUTF8String: (char*)address];
|
||||
[self encodeObject: o];
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -144,7 +144,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
|||
|
||||
OutputDebugStringW(null_terminated_buf);
|
||||
|
||||
if ((GSUserDefaultsFlag(GSLogSyslog) == YES
|
||||
if (([_GSPrivate userDefaultsFlag: GSLogSyslog] == YES
|
||||
|| write(_NSLogDescriptor, buf, len) != (int)len) && !IsDebuggerPresent())
|
||||
{
|
||||
static HANDLE eventloghandle = 0;
|
||||
|
@ -170,7 +170,7 @@ _NSLog_standard_printf_handler (NSString* message)
|
|||
#else
|
||||
|
||||
#if defined(HAVE_SYSLOG)
|
||||
if (GSUserDefaultsFlag(GSLogSyslog) == YES
|
||||
if ([_GSPrivate userDefaultsFlag: GSLogSyslog] == YES
|
||||
|| write(_NSLogDescriptor, buf, len) != (int)len)
|
||||
{
|
||||
null_terminated_buf = objc_malloc (sizeof (char) * (len + 1));
|
||||
|
@ -302,9 +302,9 @@ NSLogv (NSString* format, va_list args)
|
|||
}
|
||||
|
||||
#ifdef HAVE_SYSLOG
|
||||
if (GSUserDefaultsFlag(GSLogSyslog) == YES)
|
||||
if ([_GSPrivate userDefaultsFlag: GSLogSyslog] == YES)
|
||||
{
|
||||
if (GSUserDefaultsFlag(GSLogThread) == YES)
|
||||
if ([_GSPrivate userDefaultsFlag: GSLogThread] == YES)
|
||||
{
|
||||
prefix = [NSString stringWithFormat: @"[thread:%x] ",
|
||||
GSCurrentThread()];
|
||||
|
@ -317,7 +317,7 @@ NSLogv (NSString* format, va_list args)
|
|||
else
|
||||
#endif
|
||||
{
|
||||
if (GSUserDefaultsFlag(GSLogThread) == YES)
|
||||
if ([_GSPrivate userDefaultsFlag: GSLogThread] == YES)
|
||||
{
|
||||
prefix = [NSString
|
||||
stringWithFormat: @"%@ %@[%d,%x] ",
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "Foundation/NSFileManager.h"
|
||||
#include "Foundation/NSProcessInfo.h"
|
||||
|
||||
#include "GSPrivate.h"
|
||||
#include "GSPortPrivate.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -302,15 +303,15 @@ static Class runLoopClass;
|
|||
e |= NBLK_OPT;
|
||||
if (fcntl(d, F_SETFL, e) < 0)
|
||||
{
|
||||
NSLog(@"unable to set non-blocking mode on %d - %s",
|
||||
d, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set non-blocking mode on %d - %@",
|
||||
d, [_GSPrivate error]);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"unable to get non-blocking mode on %d - %s",
|
||||
d, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get non-blocking mode on %d - %@",
|
||||
d, [_GSPrivate error]);
|
||||
return nil;
|
||||
}
|
||||
handle = (GSMessageHandle*)NSAllocateObject(self, 0, NSDefaultMallocZone());
|
||||
|
@ -379,9 +380,8 @@ static Class runLoopClass;
|
|||
{
|
||||
if (errno != EINPROGRESS)
|
||||
{
|
||||
NSLog(@"unable to make connection to %s - %s",
|
||||
sockAddr.sun_path,
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"unable to make connection to %s - %@",
|
||||
sockAddr.sun_path, [_GSPrivate error]);
|
||||
M_UNLOCK(myLock);
|
||||
return NO;
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ static Class runLoopClass;
|
|||
else if (errno != EINTR && errno != EAGAIN)
|
||||
{
|
||||
NSDebugMLLog(@"NSMessagePort",
|
||||
@"read failed - %s on 0x%x", GSLastErrorStr(errno), self);
|
||||
@"read failed - %@ on 0x%p", [_GSPrivate error], self);
|
||||
M_UNLOCK(myLock);
|
||||
[self invalidate];
|
||||
return;
|
||||
|
@ -906,7 +906,7 @@ static Class runLoopClass;
|
|||
&& res != 0)
|
||||
{
|
||||
state = GS_H_UNCON;
|
||||
NSLog(@"connect attempt failed - %s", GSLastErrorStr(res));
|
||||
NSLog(@"connect attempt failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -922,8 +922,8 @@ static Class runLoopClass;
|
|||
else
|
||||
{
|
||||
state = GS_H_UNCON;
|
||||
NSLog(@"connect write attempt failed - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"connect write attempt failed - %@",
|
||||
[_GSPrivate error]);
|
||||
}
|
||||
RELEASE(d);
|
||||
}
|
||||
|
@ -957,7 +957,7 @@ static Class runLoopClass;
|
|||
{
|
||||
if (errno != EINTR && errno != EAGAIN)
|
||||
{
|
||||
NSLog(@"write attempt failed - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"write attempt failed - %@", [_GSPrivate error]);
|
||||
M_UNLOCK(myLock);
|
||||
[self invalidate];
|
||||
return;
|
||||
|
@ -1249,7 +1249,7 @@ typedef struct {
|
|||
sizeof(sockAddr.sun_path));
|
||||
if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
desc = -1;
|
||||
}
|
||||
else if (bind(desc, (struct sockaddr *)&sockAddr,
|
||||
|
@ -1263,23 +1263,23 @@ typedef struct {
|
|||
close(desc);
|
||||
if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@",
|
||||
[_GSPrivate error]);
|
||||
desc = -1;
|
||||
}
|
||||
else if (bind(desc, (struct sockaddr *)&sockAddr,
|
||||
SUN_LEN(&sockAddr)) < 0)
|
||||
{
|
||||
NSLog(@"unable to bind to %s - %s",
|
||||
sockAddr.sun_path, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to %s - %@",
|
||||
sockAddr.sun_path, [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
desc = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"unable to bind to %s - %s",
|
||||
sockAddr.sun_path, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to %s - %@",
|
||||
sockAddr.sun_path, [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
desc = -1;
|
||||
}
|
||||
|
@ -1291,13 +1291,13 @@ typedef struct {
|
|||
}
|
||||
else if (listen(desc, 128) < 0)
|
||||
{
|
||||
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to listen on port - %@", [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
DESTROY(port);
|
||||
}
|
||||
else if (getsockname(desc, (struct sockaddr*)&sockAddr, &i) < 0)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
DESTROY(port);
|
||||
}
|
||||
|
@ -1492,7 +1492,7 @@ typedef struct {
|
|||
sock = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC);
|
||||
if (sock < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
}
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
/*
|
||||
|
@ -1505,13 +1505,13 @@ typedef struct {
|
|||
sizeof(opt)) < 0)
|
||||
{
|
||||
(void)close(sock);
|
||||
NSLog(@"unable to set reuse on socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set reuse on socket - %@", [_GSPrivate error]);
|
||||
}
|
||||
#endif
|
||||
else if ((handle = [GSMessageHandle handleWithDescriptor: sock]) == nil)
|
||||
{
|
||||
(void)close(sock);
|
||||
NSLog(@"unable to create GSMessageHandle - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create GSMessageHandle - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
<title>NSObjCRuntime class reference</title>
|
||||
$Date$ $Revision$
|
||||
|
@ -40,7 +41,7 @@ NSString *
|
|||
NSStringFromSelector(SEL aSelector)
|
||||
{
|
||||
if (aSelector != (SEL)0)
|
||||
return [NSString stringWithCString: GSNameFromSelector(aSelector)];
|
||||
return [NSString stringWithUTF8String: GSNameFromSelector(aSelector)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -92,7 +93,7 @@ NSString *
|
|||
NSStringFromClass(Class aClass)
|
||||
{
|
||||
if (aClass != (Class)0)
|
||||
return [NSString stringWithCString: (char*)GSNameFromClass(aClass)];
|
||||
return [NSString stringWithUTF8String: (char*)GSNameFromClass(aClass)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ static void GSLogZombie(id o, SEL sel)
|
|||
NSLog(@"Deallocated %@ (0x%x) sent %@",
|
||||
NSStringFromClass(c), o, NSStringFromSelector(sel));
|
||||
}
|
||||
if (GSEnvironmentFlag("CRASH_ON_ZOMBIE", NO) == YES)
|
||||
if ([_GSPrivate environmentFlag: "CRASH_ON_ZOMBIE" defaultValue: NO] == YES)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
@ -968,8 +968,10 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
zombieMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 0);
|
||||
zombieClass = [NSZombie class];
|
||||
NSZombieEnabled = GSEnvironmentFlag("NSZombieEnabled", NO);
|
||||
NSDeallocateZombies = GSEnvironmentFlag("NSDeallocateZombies", NO);
|
||||
NSZombieEnabled = [_GSPrivate environmentFlag: "NSZombieEnabled"
|
||||
defaultValue: NO];
|
||||
NSDeallocateZombies = [_GSPrivate environmentFlag: "NSDeallocateZombies"
|
||||
defaultValue: NO];
|
||||
|
||||
autorelease_class = [NSAutoreleasePool class];
|
||||
autorelease_sel = @selector(addObject:);
|
||||
|
@ -1295,7 +1297,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
if (aSelector == 0)
|
||||
{
|
||||
if (GSUserDefaultsFlag(GSMacOSXCompatible))
|
||||
if ([_GSPrivate userDefaultsFlag: GSMacOSXCompatible])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given",
|
||||
|
@ -1868,7 +1870,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
if (aSelector == 0)
|
||||
{
|
||||
if (GSUserDefaultsFlag(GSMacOSXCompatible))
|
||||
if ([_GSPrivate userDefaultsFlag: GSMacOSXCompatible])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given",
|
||||
|
|
|
@ -1082,7 +1082,7 @@ NSHomeDirectoryForUser(NSString *loginName)
|
|||
pw = getpwnam ([loginName cString]);
|
||||
if (pw != 0 && pw->pw_dir != NULL)
|
||||
{
|
||||
s = [NSString stringWithCString: pw->pw_dir];
|
||||
s = [NSString stringWithUTF8String: pw->pw_dir];
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
#else
|
||||
|
@ -1152,7 +1152,7 @@ NSFullUserName(void)
|
|||
struct passwd *pw;
|
||||
|
||||
pw = getpwnam([NSUserName() cString]);
|
||||
userName = [NSString stringWithCString: pw->pw_gecos];
|
||||
userName = [NSString stringWithUTF8String: pw->pw_gecos];
|
||||
#else
|
||||
NSLog(@"Warning: NSFullUserName not implemented\n");
|
||||
userName = NSUserName();
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
$Date$ $Revision$
|
||||
*/
|
||||
|
@ -28,6 +29,7 @@
|
|||
#include "Foundation/NSObject.h"
|
||||
#include "Foundation/NSFileHandle.h"
|
||||
#include "Foundation/NSDebug.h"
|
||||
#include "GSPrivate.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -77,7 +79,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Failed to create pipe ... %s", GSLastErrorStr(errno));
|
||||
NSLog(@"Failed to create pipe ... %@", [_GSPrivate error]);
|
||||
DESTROY(self);
|
||||
}
|
||||
#else
|
||||
|
@ -95,6 +97,11 @@
|
|||
writeHandle = [[NSFileHandle alloc] initWithNativeHandle: writeh
|
||||
closeOnDealloc: YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Failed to create pipe ... %@", [_GSPrivate error]);
|
||||
DESTROY(self);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return self;
|
||||
|
|
|
@ -262,7 +262,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
objc_free(buffer);
|
||||
}
|
||||
}
|
||||
tmp = [arg0 UTF8String];
|
||||
tmp = [arg0 cStringUsingEncoding: [NSString defaultCStringEncoding]];
|
||||
_gnu_arg_zero = (char*)objc_malloc(strlen(tmp) + 1);
|
||||
strcpy(_gnu_arg_zero, tmp);
|
||||
#else
|
||||
|
@ -317,6 +317,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
NSMutableSet *mySet;
|
||||
id obj_argv[argc];
|
||||
int added = 1;
|
||||
NSStringEncoding enc = [_GSPrivate defaultCStringEncoding];
|
||||
|
||||
mySet = [NSMutableSet new];
|
||||
|
||||
|
@ -325,7 +326,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
str = [NSString stringWithCString: argv[i]];
|
||||
str = [NSString stringWithCString: argv[i] encoding: enc];
|
||||
|
||||
if ([str hasPrefix: @"--GNU-Debug="])
|
||||
[mySet addObject: [str substringFromIndex: 12]];
|
||||
|
@ -345,6 +346,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
{
|
||||
NSMutableArray *keys = [NSMutableArray new];
|
||||
NSMutableArray *values = [NSMutableArray new];
|
||||
NSStringEncoding enc = [_GSPrivate defaultCStringEncoding];
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
if (fallbackInitialisation == NO)
|
||||
|
@ -408,8 +410,10 @@ _gnu_process_args(int argc, char *argv[], char *env[])
|
|||
strcpy(buf, env[i]);
|
||||
cp = &buf[cp - env[i]];
|
||||
*cp++ = '\0';
|
||||
[keys addObject: [NSString stringWithCString: buf]];
|
||||
[values addObject: [NSString stringWithCString: cp]];
|
||||
[keys addObject:
|
||||
[NSString stringWithCString: buf encoding: enc]];
|
||||
[values addObject:
|
||||
[NSString stringWithCString: cp encoding: enc]];
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
@ -1230,11 +1234,8 @@ BOOL GSDebugSet(NSString *level)
|
|||
return YES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal function for GNUstep base library
|
||||
*/
|
||||
BOOL
|
||||
GSEnvironmentFlag(const char *name, BOOL def)
|
||||
@implementation _GSPrivate (ProcessInfo)
|
||||
+ (BOOL) environmentFlag: (const char *)name defaultValue: (BOOL)def
|
||||
{
|
||||
const char *c = getenv(name);
|
||||
BOOL a = def;
|
||||
|
@ -1261,13 +1262,7 @@ GSEnvironmentFlag(const char *name, BOOL def)
|
|||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal function for GNUstep base library.
|
||||
* Used by NSException uncaught exception handler - must not call any
|
||||
* methods/functions which might cause a recursive exception.
|
||||
*/
|
||||
const char*
|
||||
GSArgZero(void)
|
||||
+ (const char*) argZero
|
||||
{
|
||||
if (_gnu_arg_zero == 0)
|
||||
return "";
|
||||
|
@ -1275,4 +1270,5 @@ GSArgZero(void)
|
|||
return _gnu_arg_zero;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -2168,7 +2168,7 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
|||
{
|
||||
style = NSPropertyListXMLFormat_v1_0;
|
||||
}
|
||||
else if (GSUserDefaultsFlag(NSWriteOldStylePropertyLists))
|
||||
else if ([_GSPrivate userDefaultsFlag: NSWriteOldStylePropertyLists] == YES)
|
||||
{
|
||||
style = NSPropertyListOpenStepFormat;
|
||||
}
|
||||
|
|
|
@ -140,8 +140,8 @@ typedef struct {
|
|||
GSPlaceholderStringClass = [GSPlaceholderString class];
|
||||
NSConstantStringClass = [NSString constantStringClass];
|
||||
_holder = (id)NSAllocateObject(GSPlaceholderStringClass, 0, 0);
|
||||
externalEncoding = GetDefEncoding();
|
||||
if (GSIsByteEncoding(externalEncoding) == YES)
|
||||
externalEncoding = [NSString defaultCStringEncoding];
|
||||
if ([_GSPrivate isByteEncoding: externalEncoding] == YES)
|
||||
{
|
||||
internalEncoding = externalEncoding;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ typedef struct {
|
|||
|
||||
if (scanner != nil)
|
||||
{
|
||||
[scanner setLocale: GSUserDefaultsDictionaryRepresentation()];
|
||||
[scanner setLocale: [_GSPrivate userDefaultsDictionaryRepresentation]];
|
||||
}
|
||||
return scanner;
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ decodePort(NSData *data, NSString *defaultAddress)
|
|||
pi->addr, pnum);
|
||||
return nil;
|
||||
}
|
||||
addr = [NSString stringWithCString: pi->addr];
|
||||
addr = [NSString stringWithUTF8String: pi->addr];
|
||||
|
||||
NSDebugFLLog(@"NSPort", @"Decoded port as '%@:%d'", addr, pnum);
|
||||
|
||||
|
@ -390,8 +390,8 @@ static Class runLoopClass;
|
|||
dummy = 1;
|
||||
if (ioctlsocket(d, FIONBIO, &dummy) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to set non-blocking mode on %d - %s",
|
||||
d, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set non-blocking mode on %d - %@",
|
||||
d, [_GSPrivate error]);
|
||||
return nil;
|
||||
}
|
||||
#else /* !__MINGW32__ */
|
||||
|
@ -400,15 +400,15 @@ static Class runLoopClass;
|
|||
e |= NBLK_OPT;
|
||||
if (fcntl(d, F_SETFL, e) < 0)
|
||||
{
|
||||
NSLog(@"unable to set non-blocking mode on %d - %s",
|
||||
d, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set non-blocking mode on %d - %@",
|
||||
d, [_GSPrivate error]);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"unable to get non-blocking mode on %d - %s",
|
||||
d, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get non-blocking mode on %d - %@",
|
||||
d, [_GSPrivate error]);
|
||||
return nil;
|
||||
}
|
||||
#endif
|
||||
|
@ -545,9 +545,9 @@ static Class runLoopClass;
|
|||
if (errno != EINPROGRESS)
|
||||
#endif
|
||||
{
|
||||
NSLog(@"unable to make connection to %s:%d - %s",
|
||||
NSLog(@"unable to make connection to %s:%d - %@",
|
||||
inet_ntoa(sockAddr.sin_addr),
|
||||
GSSwapBigI16ToHost(sockAddr.sin_port), GSLastErrorStr(errno));
|
||||
GSSwapBigI16ToHost(sockAddr.sin_port), [_GSPrivate error]);
|
||||
if (addrNum < [addrs count])
|
||||
{
|
||||
BOOL result;
|
||||
|
@ -817,7 +817,7 @@ static Class runLoopClass;
|
|||
#endif /* !__MINGW32__ */
|
||||
{
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"read failed - %s on 0x%x", GSLastErrorStr(errno), self);
|
||||
@"read failed - %@ on 0x%p", [_GSPrivate error], self);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
|
@ -1108,7 +1108,7 @@ static Class runLoopClass;
|
|||
&& res != 0)
|
||||
{
|
||||
state = GS_H_UNCON;
|
||||
NSLog(@"connect attempt failed - %s", GSLastErrorStr(res));
|
||||
NSLog(@"connect attempt failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1118,7 +1118,7 @@ static Class runLoopClass;
|
|||
if (len == (int)[d length])
|
||||
{
|
||||
RELEASE(defaultAddress);
|
||||
defaultAddress = RETAIN([NSString stringWithCString:
|
||||
defaultAddress = RETAIN([NSString stringWithUTF8String:
|
||||
inet_ntoa(sockAddr.sin_addr)]);
|
||||
NSDebugMLLog(@"GSTcpHandle",
|
||||
@"wrote %d bytes on 0x%x", len, self);
|
||||
|
@ -1127,8 +1127,8 @@ static Class runLoopClass;
|
|||
else
|
||||
{
|
||||
state = GS_H_UNCON;
|
||||
NSLog(@"connect write attempt failed - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"connect write attempt failed - %@",
|
||||
[_GSPrivate error]);
|
||||
}
|
||||
RELEASE(d);
|
||||
}
|
||||
|
@ -1166,7 +1166,7 @@ static Class runLoopClass;
|
|||
if (errno != EINTR && errno != EAGAIN)
|
||||
#endif /* !__MINGW32__ */
|
||||
{
|
||||
NSLog(@"write attempt failed - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"write attempt failed - %@", [_GSPrivate error]);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
|
@ -1635,7 +1635,7 @@ static Class tcpPortClass;
|
|||
else if ((desc = socket(AF_INET, SOCK_STREAM, PF_UNSPEC))
|
||||
== INVALID_SOCKET)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
DESTROY(port);
|
||||
}
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
|
@ -1649,29 +1649,29 @@ static Class tcpPortClass;
|
|||
sizeof(reuse)) < 0)
|
||||
{
|
||||
(void) close(desc);
|
||||
NSLog(@"unable to set reuse on socket - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set reuse on socket - %@",
|
||||
[_GSPrivate error]);
|
||||
DESTROY(port);
|
||||
}
|
||||
#endif
|
||||
else if (bind(desc, (struct sockaddr *)&sockaddr,
|
||||
sizeof(sockaddr)) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s",
|
||||
inet_ntoa(sockaddr.sin_addr), number, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to port %s:%d - %@",
|
||||
inet_ntoa(sockaddr.sin_addr), number, [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
DESTROY(port);
|
||||
}
|
||||
else if (listen(desc, 128) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to listen on port - %@", [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
DESTROY(port);
|
||||
}
|
||||
else if (getsockname(desc, (struct sockaddr*)&sockaddr, &i)
|
||||
== SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
(void) close(desc);
|
||||
DESTROY(port);
|
||||
}
|
||||
|
@ -1971,7 +1971,7 @@ static Class tcpPortClass;
|
|||
handle = nil;
|
||||
if ((sock = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
}
|
||||
#ifndef BROKEN_SO_REUSEADDR
|
||||
/*
|
||||
|
@ -1984,13 +1984,13 @@ static Class tcpPortClass;
|
|||
sizeof(opt)) < 0)
|
||||
{
|
||||
(void)close(sock);
|
||||
NSLog(@"unable to set reuse on socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set reuse on socket - %@", [_GSPrivate error]);
|
||||
}
|
||||
#endif
|
||||
else if ((handle = [GSTcpHandle handleWithDescriptor: sock]) == nil)
|
||||
{
|
||||
(void)close(sock);
|
||||
NSLog(@"unable to create GSTcpHandle - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create GSTcpHandle - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2179,7 +2179,7 @@ static Class tcpPortClass;
|
|||
*/
|
||||
handle = [GSTcpHandle handleWithDescriptor: desc];
|
||||
memcpy(&handle->sockAddr, &sockAddr, sizeof(sockAddr));
|
||||
handle->defaultAddress = RETAIN([NSString stringWithCString:
|
||||
handle->defaultAddress = RETAIN([NSString stringWithUTF8String:
|
||||
inet_ntoa(sockAddr.sin_addr)]);
|
||||
|
||||
[handle setState: GS_H_ACCEPT];
|
||||
|
|
|
@ -554,7 +554,7 @@ typedef enum {
|
|||
serverLock = [NSRecursiveLock new];
|
||||
modes = [[NSArray alloc] initWithObjects: &mode count: 1];
|
||||
#ifdef GDOMAP_PORT_OVERRIDE
|
||||
serverPort = RETAIN([NSString stringWithCString:
|
||||
serverPort = RETAIN([NSString stringWithUTF8String:
|
||||
make_gdomap_port(GDOMAP_PORT_OVERRIDE)]);
|
||||
#endif
|
||||
portClass = [NSSocketPort class];
|
||||
|
@ -738,7 +738,7 @@ typedef enum {
|
|||
[array addObject: com];
|
||||
RELEASE(com);
|
||||
[com setAddr: svrs[count]];
|
||||
addr = [NSString stringWithCString:
|
||||
addr = [NSString stringWithUTF8String:
|
||||
(char*)inet_ntoa(svrs[count])];
|
||||
[com startPortLookup: name onHost: addr];
|
||||
count++;
|
||||
|
@ -802,7 +802,7 @@ typedef enum {
|
|||
|
||||
if (*port)
|
||||
{
|
||||
*addr = [NSString stringWithCString: inet_ntoa(singleServer)];
|
||||
*addr = [NSString stringWithUTF8String: inet_ntoa(singleServer)];
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -566,8 +566,8 @@ handle_printf_atsign (FILE *stream,
|
|||
gcrSel = @selector(getCharacters:range:);
|
||||
ranSel = @selector(rangeOfComposedCharacterSequenceAtIndex:);
|
||||
|
||||
_DefaultStringEncoding = GetDefEncoding();
|
||||
_ByteEncodingOk = GSIsByteEncoding(_DefaultStringEncoding);
|
||||
_DefaultStringEncoding = [_GSPrivate defaultCStringEncoding];
|
||||
_ByteEncodingOk = [_GSPrivate isByteEncoding: _DefaultStringEncoding];
|
||||
|
||||
NSStringClass = self;
|
||||
[self setVersion: 1];
|
||||
|
@ -1057,7 +1057,6 @@ handle_printf_atsign (FILE *stream,
|
|||
locale: (NSDictionary*)locale
|
||||
arguments: (va_list)argList
|
||||
{
|
||||
extern void GSStrExternalize();
|
||||
unsigned char buf[2048];
|
||||
GSStr_t f;
|
||||
unichar fbuf[1024];
|
||||
|
@ -2685,7 +2684,7 @@ handle_printf_atsign (FILE *stream,
|
|||
*/
|
||||
+ (NSStringEncoding*) availableStringEncodings
|
||||
{
|
||||
return GetAvailableEncodings();
|
||||
return [_GSPrivate availableEncodings];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2703,7 +2702,7 @@ handle_printf_atsign (FILE *stream,
|
|||
*/
|
||||
ourbundle = [NSBundle bundleForLibrary: @"gnustep-base"];
|
||||
|
||||
ourname = GetEncodingName(encoding);
|
||||
ourname = [_GSPrivate encodingName: encoding];
|
||||
return [ourbundle localizedStringForKey: ourname
|
||||
value: ourname
|
||||
table: nil];
|
||||
|
@ -4151,7 +4150,7 @@ static NSFileManager *fm = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
dict = GSUserDefaultsDictionaryRepresentation();
|
||||
dict = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
ret = AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
|
||||
initWithFormat: format locale: dict arguments: ap]);
|
||||
}
|
||||
|
@ -4203,7 +4202,7 @@ static NSFileManager *fm = nil;
|
|||
*/
|
||||
- (NSComparisonResult) localizedCompare: (NSString *)string
|
||||
{
|
||||
NSDictionary *dict = GSUserDefaultsDictionaryRepresentation();
|
||||
NSDictionary *dict = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
|
||||
return [self compare: string
|
||||
options: 0
|
||||
|
@ -4217,7 +4216,7 @@ static NSFileManager *fm = nil;
|
|||
*/
|
||||
- (NSComparisonResult) localizedCaseInsensitiveCompare: (NSString *)string
|
||||
{
|
||||
NSDictionary *dict = GSUserDefaultsDictionaryRepresentation();
|
||||
NSDictionary *dict = [_GSPrivate userDefaultsDictionaryRepresentation];
|
||||
|
||||
return [self compare: string
|
||||
options: NSCaseInsensitiveSearch
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "Foundation/NSTimer.h"
|
||||
#include "Foundation/NSLock.h"
|
||||
#include "Foundation/NSDebug.h"
|
||||
#include "GSPrivate.h"
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@ -1561,8 +1562,8 @@ GSCheckTasks()
|
|||
result = waitpid(_taskId, &_terminationStatus, WNOHANG);
|
||||
if (result < 0)
|
||||
{
|
||||
NSLog(@"waitpid %d, result %d, error %s",
|
||||
_taskId, result, GSLastErrorStr(errno));
|
||||
NSLog(@"waitpid %d, result %d, error %@",
|
||||
_taskId, result, [_GSPrivate error]);
|
||||
[self _terminatedChild: -1];
|
||||
}
|
||||
else if (result == _taskId || (result > 0 && errno == 0))
|
||||
|
@ -1594,8 +1595,8 @@ GSCheckTasks()
|
|||
#ifdef WAITDEBUG
|
||||
else
|
||||
{
|
||||
NSLog(@"waitpid %d, result %d, error %s",
|
||||
_taskId, result, GSLastErrorStr(errno));
|
||||
NSLog(@"waitpid %d, result %d, error %@",
|
||||
_taskId, result, [_GSPrivate error]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#include "Foundation/NSConnection.h"
|
||||
#include "Foundation/NSInvocation.h"
|
||||
|
||||
#include "GSPrivate.h"
|
||||
#include "GSRunLoopCtxt.h"
|
||||
|
||||
@interface NSAutoreleasePool (NSThread)
|
||||
|
@ -889,12 +890,12 @@ static NSDate *theFuture;
|
|||
#if defined(__MINGW32__)
|
||||
if (SetEvent(event) == 0)
|
||||
{
|
||||
NSLog(@"Set event failed - %@", GSLastErrorStr(errno));
|
||||
NSLog(@"Set event failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
#else
|
||||
if (write(outputFd, "0", 1) != 1)
|
||||
{
|
||||
NSLog(@"Write to pipe failed - %@", GSLastErrorStr(errno));
|
||||
NSLog(@"Write to pipe failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -918,12 +919,12 @@ static NSDate *theFuture;
|
|||
#if defined(__MINGW32__)
|
||||
if (ResetEvent(event) == 0)
|
||||
{
|
||||
NSLog(@"Reset event failed - %@", GSLastErrorStr(errno));
|
||||
NSLog(@"Reset event failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
#else
|
||||
if (read(inputFd, &c, 1) != 1)
|
||||
{
|
||||
NSLog(@"Read pipe failed - %@", GSLastErrorStr(errno));
|
||||
NSLog(@"Read pipe failed - %@", [_GSPrivate error]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1487,7 +1487,7 @@ static NSMapTable *absolutes = 0;
|
|||
bufsize--;
|
||||
}
|
||||
localZoneString
|
||||
= [NSString stringWithCString: buf length: bufsize];
|
||||
= [NSString stringWithUTF8String: buf length: bufsize];
|
||||
}
|
||||
RegCloseKey(regkey);
|
||||
}
|
||||
|
|
|
@ -1955,8 +1955,9 @@ static BOOL isLocked = NO;
|
|||
}
|
||||
@end
|
||||
|
||||
NSDictionary*
|
||||
GSUserDefaultsDictionaryRepresentation()
|
||||
@implementation _GSPrivate (UserDefaults)
|
||||
|
||||
+ (NSDictionary*) userDefaultsDictionaryRepresentation
|
||||
{
|
||||
NSDictionary *defs;
|
||||
|
||||
|
@ -1970,11 +1971,7 @@ GSUserDefaultsDictionaryRepresentation()
|
|||
return defs;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get one of several potentially useful flags.
|
||||
*/
|
||||
BOOL
|
||||
GSUserDefaultsFlag(GSUserDefaultFlagType type)
|
||||
+ (BOOL) userDefaultsFlag: (GSUserDefaultFlagType)type
|
||||
{
|
||||
if (sharedDefaults == nil)
|
||||
{
|
||||
|
@ -1982,4 +1979,5 @@ GSUserDefaultsFlag(GSUserDefaultFlagType type)
|
|||
}
|
||||
return flags[type];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ objc_get_symbol_path(Class theClass, Category *theCategory)
|
|||
|
||||
if (ret)
|
||||
{
|
||||
return [NSString stringWithCString: ret];
|
||||
return [NSString stringWithUTF8String: ret];
|
||||
}
|
||||
|
||||
return nil;
|
||||
|
|
|
@ -419,8 +419,8 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
/* Some exceptional condition happened. */
|
||||
/* xxx We can do something with exception_fds, instead of
|
||||
aborting here. */
|
||||
NSLog (@"poll() error in -acceptInputForMode:beforeDate: '%s'",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog (@"poll() error in -acceptInputForMode:beforeDate: '%@'",
|
||||
[_GSPrivate error]);
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
@ -800,8 +800,8 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
/* Some exceptional condition happened. */
|
||||
/* xxx We can do something with exception_fds, instead of
|
||||
aborting here. */
|
||||
NSLog (@"select() error in -acceptInputForMode:beforeDate: '%s'",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog (@"select() error in -acceptInputForMode:beforeDate: '%@'",
|
||||
[_GSPrivate error]);
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
@ -792,7 +793,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -806,8 +807,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
if (bind(net, (struct sockaddr *)&lsin, sizeof(lsin)) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(lsin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(lsin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]);
|
||||
(void) closesocket(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -825,9 +826,9 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
if (WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
{
|
||||
NSLog(@"unable to make connection to %s:%d - %s",
|
||||
NSLog(@"unable to make connection to %s:%d - %@",
|
||||
inet_ntoa(sin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -891,7 +892,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if ((net = socket(AF_INET, SOCK_STREAM, PF_UNSPEC)) == INVALID_SOCKET)
|
||||
{
|
||||
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -908,8 +909,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (bind(net, (struct sockaddr *)&sin, sizeof(sin)) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to bind to port %s:%d - %s", inet_ntoa(sin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), GSLastErrorStr(errno));
|
||||
NSLog(@"unable to bind to port %s:%d - %@", inet_ntoa(sin.sin_addr),
|
||||
GSSwapBigI16ToHost(sin.sin_port), [_GSPrivate error]);
|
||||
(void) closesocket(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -917,7 +918,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (listen(net, 256) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to listen on port - %@", [_GSPrivate error]);
|
||||
(void) closesocket(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -925,7 +926,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getsockname(net, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
(void) closesocket(net);
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
|
@ -1092,8 +1093,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (_fstat(desc, &sbuf) != 0)
|
||||
{
|
||||
NSLog(@"unable to get status of descriptor %d - %s",
|
||||
desc, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get status of descriptor %d - %@",
|
||||
desc, [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1293,8 +1294,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (len < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
@ -1318,8 +1319,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (len < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
@ -1344,8 +1345,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (got < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
[d setLength: got];
|
||||
}
|
||||
|
@ -1367,8 +1368,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
else if (got < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to read from descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to read from descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
while (len > 0 && got > 0);
|
||||
|
@ -1414,8 +1415,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (rval < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"unable to write to descriptor - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"unable to write to descriptor - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1520,8 +1521,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (result < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"failed to move to offset in file - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"failed to move to offset in file - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return (unsigned long long)result;
|
||||
}
|
||||
|
@ -1544,8 +1545,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (result < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"failed to move to offset in file - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"failed to move to offset in file - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
return (unsigned long long)result;
|
||||
}
|
||||
|
@ -1568,8 +1569,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (result < 0)
|
||||
{
|
||||
[NSException raise: NSFileHandleOperationException
|
||||
format: @"failed to move to offset in file - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
format: @"failed to move to offset in file - %@",
|
||||
[_GSPrivate error]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1927,8 +1928,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Accept attempt failed - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
s = [NSString stringWithFormat: @"Accept attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[readInfo setObject: s forKey: GSFileHandleNotificationError];
|
||||
}
|
||||
else
|
||||
|
@ -1996,8 +1997,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Read attempt failed - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
s = [NSString stringWithFormat: @"Read attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[readInfo setObject: s forKey: GSFileHandleNotificationError];
|
||||
[self postReadNotification];
|
||||
}
|
||||
|
@ -2005,8 +2006,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Read attempt failed - %s",
|
||||
GSLastErrorStr(errno)];
|
||||
s = [NSString stringWithFormat: @"Read attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[readInfo setObject: s forKey: GSFileHandleNotificationError];
|
||||
[self postReadNotification];
|
||||
}
|
||||
|
@ -2045,8 +2046,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat: @"Connect attempt failed - %s",
|
||||
GSLastErrorStr(result)];
|
||||
s = [NSString stringWithFormat: @"Connect attempt failed - %@",
|
||||
[_GSPrivate error]];
|
||||
[info setObject: s forKey: GSFileHandleNotificationError];
|
||||
}
|
||||
else
|
||||
|
@ -2080,7 +2081,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
NSString *s;
|
||||
|
||||
s = [NSString stringWithFormat:
|
||||
@"Write attempt failed - %s", GSLastErrorStr(errno)];
|
||||
@"Write attempt failed - %@", [_GSPrivate error]];
|
||||
[info setObject: s forKey: GSFileHandleNotificationError];
|
||||
[self postWriteNotification];
|
||||
}
|
||||
|
@ -2193,7 +2194,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
- (void) setAddr: (struct sockaddr_in *)sin
|
||||
{
|
||||
address = [[NSString alloc] initWithCString: (char*)inet_ntoa(sin->sin_addr)];
|
||||
address = [[NSString alloc] initWithUTF8String:
|
||||
(char*)inet_ntoa(sin->sin_addr)];
|
||||
service = [[NSString alloc] initWithFormat: @"%d",
|
||||
(int)GSSwapBigI16ToHost(sin->sin_port)];
|
||||
protocol = @"tcp";
|
||||
|
@ -2239,8 +2241,8 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (ioctlsocket((SOCKET)_get_osfhandle(descriptor), FIONBIO, &dummy)
|
||||
== SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to set non-blocking mode - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set non-blocking mode - %@",
|
||||
[_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
isNonBlocking = flag;
|
||||
|
@ -2251,8 +2253,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
if (ioctlsocket((SOCKET)_get_osfhandle(descriptor), FIONBIO, &dummy)
|
||||
== SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to set blocking mode - %s",
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set blocking mode - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
isNonBlocking = flag;
|
||||
|
@ -2273,11 +2274,11 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
str = [NSString stringWithCString: (char*)inet_ntoa(sin.sin_addr)];
|
||||
str = [NSString stringWithUTF8String: (char*)inet_ntoa(sin.sin_addr)];
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
@ -2290,7 +2291,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
|
||||
{
|
||||
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -436,8 +436,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
BOOL found = NO;
|
||||
|
||||
NSDebugMLLog(@"NSRunLoop", @"WaitForMultipleObjects() error in "
|
||||
@"-acceptInputForMode:beforeDate: %s",
|
||||
GSLastErrorStr(GetLastError()));
|
||||
@"-acceptInputForMode:beforeDate: %@", [_GSPrivate error]);
|
||||
/*
|
||||
* Check each handle in turn until either we find one which has an
|
||||
* event signalled, or we find the one which caused the original
|
||||
|
@ -458,8 +457,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
|
|||
if (found == NO)
|
||||
{
|
||||
NSLog(@"WaitForMultipleObjects() error in "
|
||||
@"-acceptInputForMode:beforeDate: %s",
|
||||
GSLastErrorStr(GetLastError()));
|
||||
@"-acceptInputForMode:beforeDate: %@", [_GSPrivate error]);
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -311,8 +311,8 @@ OutputDebugStringW(L"");
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Failed to insert HKEY_CURRENT_USER\\%@\\%@ (%x) %s",
|
||||
registry, n, rc, GSLastErrorStr(rc));
|
||||
NSLog(@"Failed to insert HKEY_CURRENT_USER\\%@\\%@ (%x) %@",
|
||||
registry, n, rc, [_GSPrivate error: rc]);
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
|
|
@ -206,8 +206,8 @@ static Class messagePortClass = 0;
|
|||
M_UNLOCK(messagePortLock);
|
||||
if ([p _setupSendPort] == NO)
|
||||
{
|
||||
NSLog(@"unable to access mailslot '%@' - %s",
|
||||
[p name], GSLastErrorStr(errno));
|
||||
NSLog(@"unable to access mailslot '%@' - %@",
|
||||
[p name], [_GSPrivate error]);
|
||||
DESTROY(p);
|
||||
}
|
||||
return p;
|
||||
|
@ -334,8 +334,8 @@ static Class messagePortClass = 0;
|
|||
|
||||
if (this->rHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
NSLog(@"unable to create mailslot '%@' - %s",
|
||||
this->name, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to create mailslot '%@' - %@",
|
||||
this->name, [_GSPrivate error]);
|
||||
DESTROY(self);
|
||||
}
|
||||
else
|
||||
|
@ -507,14 +507,14 @@ static Class messagePortClass = 0;
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"GetOverlappedResult failed ...%s", GSLastErrorStr(errno));
|
||||
NSLog(@"GetOverlappedResult failed ... %@", [_GSPrivate error]);
|
||||
this->rState = RS_NONE;
|
||||
this->rLength = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"GetOverlappedResult success ...%u", this->rSize);
|
||||
NSLog(@"GetOverlappedResult success ... %u", this->rSize);
|
||||
this->rState = RS_NONE;
|
||||
this->rLength = 0;
|
||||
}
|
||||
|
@ -529,8 +529,8 @@ static Class messagePortClass = 0;
|
|||
0,
|
||||
0) == 0)
|
||||
{
|
||||
NSLog(@"unable to get info from mailslot '%@' - %s",
|
||||
this->name, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to get info from mailslot '%@' - %@",
|
||||
this->name, [_GSPrivate error]);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
|
@ -546,16 +546,15 @@ static Class messagePortClass = 0;
|
|||
&this->rSize,
|
||||
NULL) == 0)
|
||||
{
|
||||
NSLog(@"unable to read from mailslot '%@' - %s",
|
||||
this->name, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to read from mailslot '%@' - %@",
|
||||
this->name, [_GSPrivate error]);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
if (this->rSize != this->rWant)
|
||||
{
|
||||
NSLog(@"only read %d of %d bytes from mailslot '%@' - %s",
|
||||
this->rSize, this->rWant, this->name,
|
||||
GSLastErrorStr(errno));
|
||||
NSLog(@"only read %d of %d bytes from mailslot '%@' - %@",
|
||||
this->rSize, this->rWant, this->name, [_GSPrivate error]);
|
||||
[self invalidate];
|
||||
return;
|
||||
}
|
||||
|
@ -749,8 +748,8 @@ static Class messagePortClass = 0;
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"unable to read from mailslot '%@' - %s",
|
||||
this->name, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to read from mailslot '%@' - %@",
|
||||
this->name, [_GSPrivate error]);
|
||||
[self invalidate];
|
||||
}
|
||||
}
|
||||
|
@ -804,7 +803,7 @@ static Class messagePortClass = 0;
|
|||
&this->wSize,
|
||||
TRUE) == 0)
|
||||
{
|
||||
NSLog(@"GetOverlappedResult failed ...%s", GSLastErrorStr(errno));
|
||||
NSLog(@"GetOverlappedResult failed ... %@", [_GSPrivate error]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -856,8 +855,8 @@ again:
|
|||
}
|
||||
else if ((errno = GetLastError()) != ERROR_IO_PENDING)
|
||||
{
|
||||
NSLog(@"unable to write to mailslot '%@' - %s",
|
||||
this->name, GSLastErrorStr(errno));
|
||||
NSLog(@"unable to write to mailslot '%@' - %@",
|
||||
this->name, [_GSPrivate error]);
|
||||
[self invalidate];
|
||||
}
|
||||
else
|
||||
|
|
|
@ -269,7 +269,7 @@ static void setNonblocking(SOCKET fd)
|
|||
unsigned long dummy = 1;
|
||||
|
||||
if (ioctlsocket(fd, FIONBIO, &dummy) == SOCKET_ERROR)
|
||||
NSLog(@"unable to set non-blocking mode - %s",GSLastErrorStr(errno));
|
||||
NSLog(@"unable to set non-blocking mode - %@", [_GSPrivate error]);
|
||||
}
|
||||
|
||||
@implementation GSFileInputStream
|
||||
|
@ -1866,8 +1866,8 @@ static void setNonblocking(SOCKET fd)
|
|||
if (handle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Unable to open named pipe '%@'... %s",
|
||||
path, GSLastErrorStr(GetLastError())];
|
||||
format: @"Unable to open named pipe '%@'... %@",
|
||||
path, [_GSPrivate error]];
|
||||
}
|
||||
|
||||
// the type of the stream does not matter, since we are only using the fd
|
||||
|
|
|
@ -228,30 +228,35 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
id v;
|
||||
NSString *k;
|
||||
|
||||
switch (type) {
|
||||
case REG_SZ: {
|
||||
int datacharlen = datalen / 2;
|
||||
if (datacharlen > 0 && data[datacharlen-1] == 0)
|
||||
datacharlen--;
|
||||
switch (type)
|
||||
{
|
||||
case REG_SZ:
|
||||
{
|
||||
int datacharlen = datalen / 2;
|
||||
if (datacharlen > 0 && data[datacharlen-1] == 0)
|
||||
datacharlen--;
|
||||
|
||||
v = [NSString stringWithCharacters:data length:datacharlen];
|
||||
}
|
||||
break;
|
||||
case REG_BINARY: {
|
||||
v = [NSString stringWithCString: (char*)data
|
||||
encoding: NSASCIIStringEncoding];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Bad registry type %d for '%S'", type, name);
|
||||
v = 0;
|
||||
}
|
||||
v = [NSString stringWithCharacters: data
|
||||
length: datacharlen];
|
||||
}
|
||||
break;
|
||||
case REG_BINARY:
|
||||
{
|
||||
v = [NSString stringWithCString: (char*)data
|
||||
encoding: NSASCIIStringEncoding];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Bad registry type %d for '%S'", type, name);
|
||||
v = 0;
|
||||
}
|
||||
v = [v propertyList];
|
||||
if (v)
|
||||
{
|
||||
k = [NSString stringWithCharacters: name length: namelen];
|
||||
[domainDict setObject: v forKey: k];
|
||||
}
|
||||
{
|
||||
k = [NSString stringWithCharacters: name
|
||||
length: namelen];
|
||||
[domainDict setObject: v forKey: k];
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
NSLog(@"Bad registry value for '%S'", name);
|
||||
|
@ -319,30 +324,35 @@ struct NSUserDefaultsWin32_DomainInfo
|
|||
id v;
|
||||
NSString *k;
|
||||
|
||||
switch (type) {
|
||||
case REG_SZ: {
|
||||
int datacharlen = datalen / 2;
|
||||
if (datacharlen > 0 && data[datacharlen-1] == 0)
|
||||
datacharlen--;
|
||||
switch (type)
|
||||
{
|
||||
case REG_SZ:
|
||||
{
|
||||
int datacharlen = datalen / 2;
|
||||
if (datacharlen > 0 && data[datacharlen-1] == 0)
|
||||
datacharlen--;
|
||||
|
||||
v = [NSString stringWithCharacters:data length:datacharlen];
|
||||
}
|
||||
break;
|
||||
case REG_BINARY: {
|
||||
v = [NSString stringWithCString: (char*)data
|
||||
encoding: NSASCIIStringEncoding];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Bad registry type %d for '%S'", type, name);
|
||||
v = 0;
|
||||
}
|
||||
v = [NSString stringWithCharacters: data
|
||||
length: datacharlen];
|
||||
}
|
||||
break;
|
||||
case REG_BINARY:
|
||||
{
|
||||
v = [NSString stringWithCString: (char*)data
|
||||
encoding: NSASCIIStringEncoding];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NSLog(@"Bad registry type %d for '%S'", type, name);
|
||||
v = 0;
|
||||
}
|
||||
v = [v propertyList];
|
||||
if (v)
|
||||
{
|
||||
k = [NSString stringWithCharacters: name length: namelen];
|
||||
[domainDict setObject: v forKey: k];
|
||||
}
|
||||
{
|
||||
k = [NSString stringWithCharacters: name
|
||||
length: namelen];
|
||||
[domainDict setObject: v forKey: k];
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
NSLog(@"Bad registry value for '%S'", name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue