mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +00:00
Some MacOS panther additions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26143 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
425290fda5
commit
f3ab133d03
5 changed files with 169 additions and 14 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2008-02-25 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSObject.h: Moved some headers to NSObjCRuntime.h
|
||||
* Headers/Foundation/NSObjCRuntime.h: Added NSInbteger and NSUInteger
|
||||
for MacOSX compatibiulity.
|
||||
* Headers/Additions/GNUstep/GSVersionMacros.h: Don't declare constants
|
||||
which should be set by the user to say which MacOSX version they want.
|
||||
* Headers/Foundation/NSPointerFunctions.h: New MacOSX declarations ...
|
||||
no definitions yet.
|
||||
|
||||
2008-02-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSKeyValueObserving.m:
|
||||
|
|
|
@ -61,13 +61,6 @@
|
|||
#endif /* MAC_OS_X_VERSION_MIN_ALLOWED */
|
||||
#endif /* GS_OPENSTEP_V */
|
||||
|
||||
#ifndef MAC_OS_X_VERSION_MIN_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MIN_ALLOWED GS_OPENSTEP_V
|
||||
#endif
|
||||
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED GS_OPENSTEP_V
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NB. The version values below must be integers ... by convention these are
|
||||
* made up of two digits each for major, minor and subminor version numbers
|
||||
|
|
|
@ -29,13 +29,17 @@
|
|||
#ifndef __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __NSObjCRuntime_h_GNUSTEP_BASE_INCLUDE
|
||||
#import <GNUstepBase/GSVersionMacros.h>
|
||||
|
||||
#import <GNUstepBase/preface.h>
|
||||
#import <GNUstepBase/GSConfig.h>
|
||||
#import <GNUstepBase/GSObjCRuntime.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef gsaddr NSInteger;
|
||||
typedef gsuaddr NSUInteger;
|
||||
|
||||
GS_EXPORT NSString *NSStringFromSelector(SEL aSelector);
|
||||
GS_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
|
||||
GS_EXPORT Class NSClassFromString(NSString *aClassName);
|
||||
|
|
|
@ -27,13 +27,9 @@
|
|||
|
||||
#ifndef __NSObject_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __NSObject_h_GNUSTEP_BASE_INCLUDE
|
||||
#import <GNUstepBase/GSVersionMacros.h>
|
||||
|
||||
#import <Foundation/NSObjCRuntime.h>
|
||||
#import <GNUstepBase/preface.h>
|
||||
#include <GNUstepBase/GSConfig.h>
|
||||
#include <objc/objc.h>
|
||||
#include <objc/typedstream.h>
|
||||
#import <objc/objc.h>
|
||||
#import <objc/typedstream.h>
|
||||
#import <Foundation/NSZone.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
152
Headers/Foundation/NSPointerFunctions.h
Normal file
152
Headers/Foundation/NSPointerFunctions.h
Normal file
|
@ -0,0 +1,152 @@
|
|||
/**Interface for NSPointerFunctions for GNUStep
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||
Date: 2008
|
||||
|
||||
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 3 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.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __NSPointerFunctions_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __NSPointerFunctions_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
#if OS_API_VERSION(100500, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Options flags come in three groups ...<br />
|
||||
* Memory management options (only one of which may be set)<br />
|
||||
* Personality options (only one of which may be set)<br />
|
||||
* Others.
|
||||
*/
|
||||
enum {
|
||||
/** Garbage collected strong references , or retain counting if GC
|
||||
* is not active. */
|
||||
NSPointerFunctionsStrongMemory = (0<<0),
|
||||
|
||||
/** Garbage collected weak references */
|
||||
NSPointerFunctionsZeroingWeakgMemory = (1<<0),
|
||||
|
||||
/** Non-GC memory */
|
||||
NSPointerFunctionsOpaqueMemory = (2<<0),
|
||||
|
||||
/** Heap (calloc/free) memory */
|
||||
NSPointerFunctionsMallocMemory = (3<<0),
|
||||
|
||||
/** MACH virtual memory (not implemented) */
|
||||
NSPointerFunctionsMachVirtualMemory = (4<<0),
|
||||
|
||||
|
||||
/** Use the -hash and -isEqual: methods for storing objects, and the
|
||||
* -description method to describe them. */
|
||||
NSPointerFunctionsObjectPersonality = (0<<8),
|
||||
|
||||
/** Use the pointer (shifted) as a hash, and compare for bitwise quality.
|
||||
*/
|
||||
NSPointerFunctionsOpaquePersonality = (1<<8),
|
||||
|
||||
/** Use the pointer (shifted) as a hash, and compare for bitwise quality,
|
||||
* but use -description to desribe the objects.
|
||||
*/
|
||||
NSPointerFunctionsObjectPointerPersonality = (2<<8),
|
||||
|
||||
/** Use strcmp for comparison and a hash of the string contents. Describe
|
||||
* assuming that the string contains UTF-8 data.
|
||||
*/
|
||||
NSPointerFunctionsCStringPersonality = (3<<8),
|
||||
|
||||
/** Use memcmp for comparison and a hash of the sructure contents.
|
||||
* A size function must be set so that the size of the memcmp and hash
|
||||
* are known,
|
||||
*/
|
||||
NSPointerFunctionsStructPersonality = (4<<8),
|
||||
|
||||
/** Use unmodified integer value for both hash and equality test.
|
||||
*/
|
||||
NSPointerFunctionsIntegerPersonality = (5<<8),
|
||||
|
||||
|
||||
/** Request the memory aquire function to allocate/copy items.
|
||||
*/
|
||||
NSPointerFunctionsCopyIn = (1<<16)
|
||||
};
|
||||
|
||||
/** An integer value containing memory option, personality option,
|
||||
* and copying option.
|
||||
*/
|
||||
typedef NSUInteger NSPointerFunctionsOptions;
|
||||
|
||||
@interface NSPointerFunctions : NSObject <NSCopying>
|
||||
|
||||
+ (id) pointerFunctionsWithOptions: (NSPointerFunctionsOptions)options;
|
||||
|
||||
- (id) initWithOptions: (NSPointerFunctionsOptions)options;
|
||||
|
||||
- (void* (*)(const void *item,
|
||||
NSUInteger (*size)(const void *item), BOOL shouldCopy)) aquireFunction;
|
||||
|
||||
- (NSString (*)(const void *item)) descriptionFunction;
|
||||
|
||||
- (NSUInteger (*)(const void *item,
|
||||
NSUInteger (*size)(const void *item))) hashFunction;
|
||||
|
||||
- (BOOL (*)(const void *item1, const void *item2,
|
||||
NSUInteger (*size)(const void *item))) isEqualFunction;
|
||||
|
||||
- (void (*)(const void *item,
|
||||
NSUInteger (*size)(const void *item))) relinquishFunction;
|
||||
|
||||
- (void) setAcquireFunction: (void* (*)(const void *item,
|
||||
NSUInteger (*size)(const void *item), BOOL shouldCopy))func;
|
||||
|
||||
- (void) setDescriptionFunction: (NSString (*)(const void *item))func;
|
||||
|
||||
- (void) setHashFunction: (NSUInteger (*)(const void *item,
|
||||
NSUInteger (*size)(const void *item)))func;
|
||||
|
||||
- (void) setIsEqualFunction: (BOOL (*)(const void *item1, const void *item2,
|
||||
NSUInteger (*size)(const void *item)))func;
|
||||
|
||||
- (void) setRelinquishFunction: (NSUInteger (*)(const void *item,
|
||||
NSUInteger (*size)(const void *item)))func;
|
||||
|
||||
- (void) setSizeFunction: (NSUInteger (*)(const void *item))func;
|
||||
|
||||
- (void) setUsesStrongWriteBarrier: (BOOL)flag;
|
||||
|
||||
- (void) setUsesWeakReadAndWriteBarriers: (BOOL)flag;
|
||||
|
||||
- (NSUInteger (*)(const void *item)) sizeFunction;
|
||||
|
||||
- (BOOL) usesStrongWriteBarrier;
|
||||
|
||||
- (BOOL) usesWeak ReadAndWriteBarriers;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OS_API_VERSION(100500, GS_API_LATEST) */
|
||||
#endif /* __NSPointerFunctions_h_GNUSTEP_BASE_INCLUDE */
|
Loading…
Reference in a new issue