mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
move a bit more stuff into additions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29666 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dc0c550db8
commit
85760d2563
17 changed files with 671 additions and 327 deletions
|
@ -46,6 +46,7 @@ Additions_OBJC_FILES =\
|
|||
NSBundle+GNUstepBase.m \
|
||||
NSCalendarDate+GNUstepBase.m \
|
||||
NSData+GNUstepBase.m \
|
||||
NSDebug+GNUstepBase.m \
|
||||
NSError+GNUstepBase.m \
|
||||
NSFileHandle+GNUstepBase.m \
|
||||
NSLock+GNUstepBase.m \
|
||||
|
@ -55,6 +56,7 @@ Additions_OBJC_FILES =\
|
|||
NSProcessInfo+GNUstepBase.m \
|
||||
NSString+GNUstepBase.m \
|
||||
NSTask+GNUstepBase.m \
|
||||
NSThread+GNUstepBase.m \
|
||||
NSURL+GNUstepBase.m \
|
||||
behavior.m
|
||||
|
||||
|
|
60
Source/Additions/NSDebug+GNUstepBase.m
Normal file
60
Source/Additions/NSDebug+GNUstepBase.m
Normal file
|
@ -0,0 +1,60 @@
|
|||
/** Debugging utilities for GNUStep and OpenStep
|
||||
Copyright (C) 1997,1999,2000,2001 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
Date: August 1997
|
||||
Extended by: Nicola Pero <n.pero@mi.flashnet.it>
|
||||
Date: December 2000, April 2001
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser 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.
|
||||
|
||||
$Date: 2010-02-17 11:47:06 +0000 (Wed, 17 Feb 2010) $ $Revision: 29657 $
|
||||
*/
|
||||
|
||||
#import "config.h"
|
||||
#import "Foundation/NSDebug.h"
|
||||
#import "Foundation/NSString.h"
|
||||
#import "GNUstepBase/NSDebug+GNUstepBase.h"
|
||||
|
||||
NSString*
|
||||
GSDebugFunctionMsg(const char *func, const char *file, int line, NSString *fmt)
|
||||
{
|
||||
NSString *message;
|
||||
|
||||
message = [NSString stringWithFormat: @"File %s: %d. In %s %@",
|
||||
file, line, func, fmt];
|
||||
return message;
|
||||
}
|
||||
|
||||
NSString*
|
||||
GSDebugMethodMsg(id obj, SEL sel, const char *file, int line, NSString *fmt)
|
||||
{
|
||||
NSString *message;
|
||||
Class cls = (Class)obj;
|
||||
char c = '+';
|
||||
|
||||
if ([obj isInstance] == YES)
|
||||
{
|
||||
c = '-';
|
||||
cls = [obj class];
|
||||
}
|
||||
message = [NSString stringWithFormat: @"File %s: %d. In [%@ %c%@] %@",
|
||||
file, line, NSStringFromClass(cls), c, NSStringFromSelector(sel), fmt];
|
||||
return message;
|
||||
}
|
||||
|
45
Source/Additions/NSThread+GNUstepBase.m
Normal file
45
Source/Additions/NSThread+GNUstepBase.m
Normal file
|
@ -0,0 +1,45 @@
|
|||
/** Control of executable units within a shared virtual memory space
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
This file is part of the GNUstep Objective-C Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser 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.
|
||||
|
||||
$Date: 2010-02-17 11:47:06 +0000 (Wed, 17 Feb 2010) $ $Revision: 29657 $
|
||||
*/
|
||||
|
||||
#import "config.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
||||
/* These functions are in NSThread.m in the base library.
|
||||
*/
|
||||
NSThread*
|
||||
GSCurrentThread(void)
|
||||
{
|
||||
return [NSThread currentThread];
|
||||
}
|
||||
|
||||
NSMutableDictionary*
|
||||
GSCurrentThreadDictionary(void)
|
||||
{
|
||||
return [GSCurrentThread() threadDictionary];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -155,6 +155,7 @@ NSAttributedString+GNUstepBase.h \
|
|||
NSBundle+GNUstepBase.h \
|
||||
NSCalendarDate+GNUstepBase.h \
|
||||
NSData+GNUstepBase.h \
|
||||
NSDebug+GNUstepBase.h \
|
||||
NSFileHandle+GNUstepBase.h \
|
||||
NSLock+GNUstepBase.h \
|
||||
NSMutableString+GNUstepBase.h \
|
||||
|
@ -163,6 +164,7 @@ NSObject+GNUstepBase.h \
|
|||
NSProcessInfo+GNUstepBase.h \
|
||||
NSString+GNUstepBase.h \
|
||||
NSTask+GNUstepBase.h \
|
||||
NSThread+GNUstepBase.h \
|
||||
NSURL+GNUstepBase.h \
|
||||
behavior.h \
|
||||
Unicode.h \
|
||||
|
|
|
@ -120,6 +120,7 @@ NSAttributedString+GNUstepBase.h \
|
|||
NSBundle+GNUstepBase.h \
|
||||
NSCalendarDate+GNUstepBase.h \
|
||||
NSData+GNUstepBase.h \
|
||||
NSDebug+GNUstepBase.h \
|
||||
NSFileHandle+GNUstepBase.h \
|
||||
NSLock+GNUstepBase.h \
|
||||
NSMutableString+GNUstepBase.h \
|
||||
|
@ -128,6 +129,7 @@ NSObject+GNUstepBase.h \
|
|||
NSProcessInfo+GNUstepBase.h \
|
||||
NSString+GNUstepBase.h \
|
||||
NSTask+GNUstepBase.h \
|
||||
NSThread+GNUstepBase.h \
|
||||
NSURL+GNUstepBase.h \
|
||||
Unicode.h \
|
||||
GNUstep.h \
|
||||
|
|
|
@ -834,34 +834,6 @@ GSDebugAllocationListRecordedObjects(Class c)
|
|||
}
|
||||
|
||||
|
||||
|
||||
NSString*
|
||||
GSDebugFunctionMsg(const char *func, const char *file, int line, NSString *fmt)
|
||||
{
|
||||
NSString *message;
|
||||
|
||||
message = [NSString stringWithFormat: @"File %s: %d. In %s %@",
|
||||
file, line, func, fmt];
|
||||
return message;
|
||||
}
|
||||
|
||||
NSString*
|
||||
GSDebugMethodMsg(id obj, SEL sel, const char *file, int line, NSString *fmt)
|
||||
{
|
||||
NSString *message;
|
||||
Class cls = (Class)obj;
|
||||
char c = '+';
|
||||
|
||||
if ([obj isInstance] == YES)
|
||||
{
|
||||
c = '-';
|
||||
cls = [obj class];
|
||||
}
|
||||
message = [NSString stringWithFormat: @"File %s: %d. In [%@ %c%@] %@",
|
||||
file, line, NSStringFromClass(cls), c, NSStringFromSelector(sel), fmt];
|
||||
return message;
|
||||
}
|
||||
|
||||
#define _NS_FRAME_HACK(a) \
|
||||
case a: env->addr = __builtin_frame_address(a + 1); break;
|
||||
#define _NS_RETURN_HACK(a) \
|
||||
|
|
|
@ -651,7 +651,7 @@
|
|||
roundedNumber = [roundedNumber decimalNumberByMultiplyingBy:
|
||||
(NSDecimalNumber*)[NSDecimalNumber numberWithInt: -1]];
|
||||
intPart = (NSDecimalNumber*)
|
||||
[NSDecimalNumber numberWithInt: [roundedNumber intValue]];
|
||||
[NSDecimalNumber numberWithInt: (int)[roundedNumber doubleValue]];
|
||||
fracPart = [roundedNumber decimalNumberBySubtracting: intPart];
|
||||
intPartString
|
||||
= AUTORELEASE([[intPart descriptionWithLocale: locale] mutableCopy]);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
#define INTEGER_MACRO(type, name, ignored) \
|
||||
- (type) name ## Value\
|
||||
{\
|
||||
return (type)VALUE;\
|
||||
return (type)VALUE;\
|
||||
}
|
||||
#include "GSNumberTypes.h"
|
||||
- (const char *)objCType
|
||||
- (const char *) objCType
|
||||
{
|
||||
return @encode(typeof(VALUE));
|
||||
return @encode(typeof(VALUE));
|
||||
}
|
||||
- (NSString*)descriptionWithLocale: (id)aLocale
|
||||
- (NSString*) descriptionWithLocale: (id)aLocale
|
||||
{
|
||||
return [[[NSString alloc] initWithFormat: FORMAT
|
||||
locale: aLocale, VALUE] autorelease];
|
||||
return [[[NSString alloc] initWithFormat: FORMAT
|
||||
locale: aLocale, VALUE] autorelease];
|
||||
}
|
||||
- (void)getValue: (void*)buffer
|
||||
- (void) getValue: (void*)buffer
|
||||
{
|
||||
typeof(VALUE) *ptr = buffer;
|
||||
*ptr = VALUE;
|
||||
typeof(VALUE) *ptr = buffer;
|
||||
*ptr = VALUE;
|
||||
}
|
||||
#undef FORMAT
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#import "Foundation/NSOperation.h"
|
||||
#import "Foundation/NSArray.h"
|
||||
#import "Foundation/NSAutoreleasePool.h"
|
||||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSLock.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue