1 /* Copyright (c) 2006-2007 Christopher J. W. Lloyd
3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
9 #import <Foundation/NSPlatform.h>
10 #import <Foundation/NSThread.h>
11 #import <Foundation/NSString.h>
12 #import <Foundation/NSRaise.h>
13 #import <Foundation/NSDebug.h>
14 #import <Foundation/NSArray.h>
15 #import <Foundation/NSPipe.h>
16 #import <Foundation/NSMutableDictionary.h>
17 #import <Foundation/NSNotificationCenter.h>
18 #import <Foundation/NSFileHandle.h>
19 #import <Foundation/NSRunLoop.h>
20 #import <Foundation/NSData.h>
21 #import <Foundation/NSRaiseException.h>
23 extern NSString *NSPlatformClassName;
25 @implementation NSPlatform
28 return NSThreadSharedInstance(NSPlatformClassName);
31 -(NSInputSource *)parentDeathInputSource {
36 NSInvalidAbstractInvocation();
41 NSInvalidAbstractInvocation();
45 -(Class)socketPortClass {
46 NSInvalidAbstractInvocation();
51 NSInvalidAbstractInvocation();
56 NSInvalidAbstractInvocation();
60 -(Class)recursiveLockClass
62 NSInvalidAbstractInvocation();
66 -(Class)conditionLockClass {
67 NSInvalidAbstractInvocation();
71 -(Class)conditionClass;
73 NSInvalidAbstractInvocation();
77 -(Class)persistantDomainClass {
78 NSInvalidAbstractInvocation();
82 -(Class)timeZoneClass {
83 NSInvalidAbstractInvocation();
87 -(NSString *)userName {
88 NSInvalidAbstractInvocation();
92 -(NSString *)fullUserName {
93 NSInvalidAbstractInvocation();
97 -(NSString *)homeDirectory {
98 NSInvalidAbstractInvocation();
102 -(NSString *)libraryDirectory {
103 NSInvalidAbstractInvocation();
107 -(NSString *)temporaryDirectory {
108 NSInvalidAbstractInvocation();
112 -(NSArray *)arguments {
113 NSInvalidAbstractInvocation();
117 -(NSDictionary *)environment {
118 NSInvalidAbstractInvocation();
122 -(NSString *)hostName {
123 NSInvalidAbstractInvocation();
127 -(NSString *)DNSHostName {
128 NSInvalidAbstractInvocation();
132 -(NSArray *)addressesForDNSHostName:(NSString *)name {
133 NSInvalidAbstractInvocation();
137 -(NSString *)hostNameByAddress:(NSString *)address{
138 NSInvalidAbstractInvocation();
142 -(void *)mapContentsOfFile:(NSString *)path length:(NSUInteger *)length {
143 NSInvalidAbstractInvocation();
147 -(void)unmapAddress:(void *)ptr length:(NSUInteger)length {
148 NSInvalidAbstractInvocation();
151 -(BOOL)writeContentsOfFile:(NSString *)path bytes:(const void *)bytes length:(NSUInteger)length options:(NSUInteger)options error:(NSError **)errorp {
152 NSInvalidAbstractInvocation();
156 -(void)checkEnvironmentKey:(NSString *)key value:(NSString *)value {
157 if([key isEqualToString:@"NSZombieEnabled"]){
158 if((NSZombieEnabled=[value isEqual:@"YES"]))
159 NSCLog("NSZombieEnabled=YES");