Changeset 4979

Show
Ignore:
Timestamp:
10/19/07 13:26:04 (11 months ago)
Author:
morris
Message:

Separate code that depends on libwired to WiredNetworking?.framework

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredAdditions/trunk/NSError-WIAdditions.h

    r4438 r4979  
    2727 */ 
    2828 
     29#define WIArgumentErrorKey                                              @"WIArgumentErrorKey" 
     30 
    2931@interface NSError(WIAdditions) 
    3032 
     33+ (id)errorWithDomain:(NSString *)domain code:(NSInteger)code argument:(id)argument; 
    3134+ (id)errorWithDomain:(NSString *)domain code:(NSInteger)code; 
    3235- (id)initWithDomain:(NSString *)domain code:(NSInteger)code; 
    3336 
     37- (NSAlert *)alert; 
     38 
    3439@end 
  • WiredAdditions/trunk/NSError-WIAdditions.m

    r4438 r4979  
    3131@implementation NSError(WIAdditions) 
    3232 
     33+ (id)errorWithDomain:(NSString *)domain code:(NSInteger)code argument:(id)argument { 
     34        return [self errorWithDomain:domain code:code userInfo:[NSDictionary dictionaryWithObject:argument forKey:WIArgumentErrorKey]]; 
     35} 
     36 
     37 
     38 
    3339+ (id)errorWithDomain:(NSString *)domain code:(NSInteger)code { 
    3440        return [self errorWithDomain:domain code:code userInfo:NULL]; 
     
    4147} 
    4248 
     49 
     50 
     51#pragma mark - 
     52 
     53- (NSAlert *)alert { 
     54        return [NSAlert alertWithMessageText:[self localizedDescription] 
     55                                                   defaultButton:WILS(@"OK", @"NSError-WIAdditions: OK button") 
     56                                                 alternateButton:NULL 
     57                                                         otherButton:NULL 
     58                           informativeTextWithFormat:@"%@", [self localizedFailureReason]]; 
     59} 
     60 
    4361@end 
  • WiredAdditions/trunk/WIApplication.m

    r4495 r4979  
    6868@implementation WIApplication 
    6969 
    70 + (void)load { 
    71         wi_initialize(); 
    72 } 
    73  
    74  
    75  
    7670- (void)finishLaunching { 
    77         NSArray                 *arguments; 
    78         const char              **argv; 
    79         int                             i, argc; 
    80          
    81         arguments       = [[NSProcessInfo processInfo] arguments]; 
    82         argc            = (int) [arguments count]; 
    83         argv            = malloc(argc); 
    84          
    85         for(i = 0; i < argc; i++) 
    86                 argv[i] = [[arguments objectAtIndex:i] UTF8String]; 
    87          
    88         wi_load(argc, argv); 
    89         free(argv); 
    90  
    91         wi_log_stderr = true; 
    92          
    9371        [[NSNotificationCenter defaultCenter] 
    9472                addObserver:self 
  • WiredAdditions/trunk/WNAddress.h

    r4438 r4979  
    2727 */ 
    2828 
    29 enum _WIAddressFamily { 
    30         WIAddressNull                                 = WI_ADDRESS_NULL, 
    31         WIAddressIPv4                                 = WI_ADDRESS_IPV4, 
    32         WIAddressIPv6                                 = WI_ADDRESS_IPV6 
     29enum _WNAddressFamily { 
     30        WNAddressNull                                 = WI_ADDRESS_NULL, 
     31        WNAddressIPv4                                 = WI_ADDRESS_IPV4, 
     32        WNAddressIPv6                                 = WI_ADDRESS_IPV6 
    3333}; 
    34 typedef enum _WIAddressFamily          WIAddressFamily; 
     34typedef enum _WNAddressFamily          WNAddressFamily; 
    3535 
    3636 
    37 @class WIError; 
     37@class WNError; 
    3838 
    39 @interface WIAddress : WIObject { 
     39@interface WNAddress : WIObject { 
    4040        wi_address_t                                    *_address; 
    4141} 
    4242 
    4343 
    44 + (WIAddress *)addressWithString:(NSString *)address error:(WIError **)error; 
    45 + (WIAddress *)addressWithNetService:(NSNetService *)netService error:(WIError **)error; 
     44+ (WNAddress *)addressWithString:(NSString *)address error:(WNError **)error; 
     45+ (WNAddress *)addressWithNetService:(NSNetService *)netService error:(WNError **)error; 
    4646 
    47 - (id)initWithString:(NSString *)address error:(WIError **)error; 
    48 - (id)initWithNetService:(NSNetService *)netService error:(WIError **)error; 
     47- (id)initWithString:(NSString *)address error:(WNError **)error; 
     48- (id)initWithNetService:(NSNetService *)netService error:(WNError **)error; 
    4949 
    5050- (void)setPort:(NSUInteger)port; 
    5151- (NSUInteger)port; 
    5252 
    53 - (WIAddressFamily)family; 
     53- (WNAddressFamily)family; 
    5454- (NSString *)string; 
    5555- (NSString *)hostname; 
     
    5858 
    5959 
    60 @interface WIAddress(WISocketAdditions) 
     60@interface WNAddress(WISocketAdditions) 
    6161 
    6262- (wi_address_t *)address; 
  • WiredAdditions/trunk/WNAddress.m

    r4438 r4979  
    2727 */ 
    2828 
    29 #import <WiredAdditions/NSError-WIAdditions.h> 
    30 #import <WiredAdditions/WIAddress.h> 
    31 #import <WiredAdditions/WIError.h> 
     29#import <WiredNetworking/WNAddress.h> 
     30#import <WiredNetworking/WNError.h> 
    3231 
    33 @implementation WIAddress 
     32@implementation WNAddress 
    3433 
    35 + (WIAddress *)addressWithString:(NSString *)address error:(WIError **)error { 
     34+ (WNAddress *)addressWithString:(NSString *)address error:(WNError **)error { 
    3635        return [[[self alloc] initWithString:address error:error] autorelease]; 
    3736} 
     
    3938 
    4039 
    41 + (WIAddress *)addressWithNetService:(NSNetService *)netService error:(WIError **)error { 
     40+ (WNAddress *)addressWithNetService:(NSNetService *)netService error:(WNError **)error { 
    4241        return [[[self alloc] initWithNetService:netService error:error] autorelease]; 
    4342} 
     
    4544 
    4645 
    47 - (id)initWithString:(NSString *)address error:(WIError **)error { 
     46- (id)initWithString:(NSString *)address error:(WNError **)error { 
    4847        wi_pool_t               *pool; 
    4948 
     
    5655        if(!_address) { 
    5756                if(error) { 
    58                         *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    59                                                                                  code:WIAddressLookupFailed 
     57                        *error = [WNError errorWithDomain:WNWiredNetworkingErrorDomain 
     58                                                                                 code:WNAddressLookupFailed 
    6059                                                                         userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    61                                                                                  [WIError errorWithDomain:WILibWiredErrorDomain],      WILibWiredErrorKey, 
     60                                                                                 [WNError errorWithDomain:WNLibWiredErrorDomain],      WNLibWiredErrorKey, 
    6261                                                                                 address,                                                                                       WIArgumentErrorKey, 
    6362                                                                                 NULL]]; 
     
    7473 
    7574 
    76 - (id)initWithNetService:(NSNetService *)netService error:(WIError **)error { 
     75- (id)initWithNetService:(NSNetService *)netService error:(WNError **)error { 
    7776        NSArray         *addresses; 
    7877        NSData          *data; 
     
    8584        if([addresses count] == 0) { 
    8685                if(error) { 
    87                         *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    88                                                                                  code:WIAddressNetServiceLookupFailed]; 
     86                        *error = [WNError errorWithDomain:WNWiredNetworkingErrorDomain 
     87                                                                                 code:WNAddressNetServiceLookupFailed]; 
    8988                } 
    9089                 
     
    133132#pragma mark - 
    134133 
    135 - (WIAddressFamily)family { 
    136         return (WIAddressFamily) wi_address_family(_address); 
     134- (WNAddressFamily)family { 
     135        return (WNAddressFamily) wi_address_family(_address); 
    137136} 
    138137 
     
    167166 
    168167 
    169 @implementation WIAddress(WISocketAdditions) 
     168@implementation WNAddress(WISocketAdditions) 
    170169 
    171170- (wi_address_t *)address { 
  • WiredAdditions/trunk/WNError.h

    r4438 r4979  
    2727 */ 
    2828 
    29 enum _WIWiredAdditionsErrorDomain { 
    30         WIAddressLookupFailed, 
    31         WIAddressNetServiceLookupFailed, 
    32          
    33         WISocketConnectFailed, 
    34         WISocketWriteFailed, 
    35         WISocketReadFailed 
     29enum _WNWiredAdditionsErrorDomain { 
     30        WNAddressLookupFailed, 
     31        WNAddressNetServiceLookupFailed, 
     32 
     33        WNSocketConnectFailed, 
     34        WNSocketWriteFailed, 
     35        WNSocketReadFailed 
    3636}; 
    3737 
    3838 
    39 @interface WIError : NSError 
    40  
    41 #define WIWiredAdditionsErrorDomain             @"WIWiredAdditionsErrorDomain" 
    42 #define WILibWiredErrorDomain                   @"WILibWiredErrorDomain" 
    43  
    44 #define WILibWiredErrorKey                              @"WILibWiredErrorKey" 
    45 #define WIArgumentErrorKey                              @"WIArgumentErrorKey" 
     39#define WNWiredNetworkingErrorDomain                    @"WNWiredNetworkingErrorDomain" 
     40#define WNLibWiredErrorDomain                                   @"WNLibWiredErrorDomain" 
     41#define WNLibWiredErrorKey                                              @"WNLibWiredErrorKey" 
    4642 
    4743 
    48 + (id)errorWithDomain:(NSString *)domain code:(NSInteger)code argument:(id)argument; 
     44@interface WNError : NSError 
     45 
    4946+ (id)errorWithDomain:(NSString *)domain; 
    5047- (id)initWithDomain:(NSString *)domain; 
    5148 
    52 - (NSAlert *)alert; 
    53  
    5449@end 
  • WiredAdditions/trunk/WNError.m

    r4438 r4979  
    2727 */ 
    2828 
    29 #import <WiredAdditions/WIError.h> 
     29#import <WiredNetworking/WNError.h> 
    3030 
    31 @implementation WIError 
     31@implementation WNError 
    3232 
    3333+ (id)errorWithDomain:(NSString *)domain code:(NSInteger)code argument:(id)argument { 
     
    4747        wi_pool_t               *pool; 
    4848         
    49         if([domain isEqualToString:WILibWiredErrorDomain]) { 
     49        if([domain isEqualToString:WNLibWiredErrorDomain]) { 
    5050                pool = wi_pool_init(wi_pool_alloc()); 
    5151                 
     
    7272 
    7373- (NSString *)localizedDescription { 
    74         if([[self domain] isEqualToString:WIWiredAdditionsErrorDomain]) { 
     74        if([[self domain] isEqualToString:WNWiredNetworkingErrorDomain]) { 
    7575                switch([self code]) { 
    76                         case WIAddressLookupFailed: 
    77                                 return WILS(@"Address Lookup Failed", @"WIError: WIAddressLookupFailed title"); 
     76                        case WNAddressLookupFailed: 
     77                                return WILS(@"Address Lookup Failed", @"WNError: WNAddressLookupFailed title"); 
    7878                                break; 
    7979                                 
    80                         case WIAddressNetServiceLookupFailed: 
    81                                 return WILS(@"Address Lookup Failed", @"WIError: WIAddressNetServiceLookupFailed title"); 
     80                        case WNAddressNetServiceLookupFailed: 
     81                                return WILS(@"Address Lookup Failed", @"WNError: WNAddressNetServiceLookupFailed title"); 
    8282                                break; 
    8383                                 
    84                         case WISocketConnectFailed: 
    85                                 return WILS(@"Connect Failed", @"WIError: WISocketConnectFailed title"); 
     84                        case WNSocketConnectFailed: 
     85                                return WILS(@"Connect Failed", @"WNError: WNSocketConnectFailed title"); 
    8686                                break; 
    8787                                 
    88                         case WISocketWriteFailed: 
    89                                 return WILS(@"Socket Write Failed", @"WIError: WISocketWriteFailed title"); 
     88                        case WNSocketWriteFailed: 
     89                                return WILS(@"Socket Write Failed", @"WNError: WNSocketWriteFailed title"); 
    9090                                break; 
    9191                                 
    92                         case WISocketReadFailed: 
    93                                 return WILS(@"Socket Read Failed", @"WIError: WISocketReadFailed title"); 
     92                        case WNSocketReadFailed: 
     93                                return WILS(@"Socket Read Failed", @"WNError: WNSocketReadFailed title"); 
    9494                                break; 
    9595                                 
     
    108108        id                              argument; 
    109109         
    110         if([[self domain] isEqualToString:WIWiredAdditionsErrorDomain]) { 
    111                 error = [[[self userInfo] objectForKey:WILibWiredErrorKey] localizedFailureReason]; 
     110        if([[self domain] isEqualToString:WNWiredNetworkingErrorDomain]) { 
     111                error = [[[self userInfo] objectForKey:WNLibWiredErrorKey] localizedFailureReason]; 
    112112                argument = [[self userInfo] objectForKey:WIArgumentErrorKey]; 
    113113 
    114114                switch([self code]) { 
    115                         case WIAddressLookupFailed: 
    116                                 return [NSSWF:WILS(@"Could not resolve the address \"%@\": %@.", @"WIError: WIAddressLookupFailed description (hostname, underlying error)"), 
     115                        case WNAddressLookupFailed: 
     116                                return [NSSWF:WILS(@"Could not resolve the address \"%@\": %@.", @"WNError: WNAddressLookupFailed description (hostname, underlying error)"), 
    117117                                        argument, error]; 
    118118                                break; 
    119119                         
    120                         case WIAddressNetServiceLookupFailed: 
    121                                 return WILS(@"Could not retrieve address for server via Bonjour.", @"WIError: WIAddressNetServiceLookupFailed description"); 
     120                        case WNAddressNetServiceLookupFailed: 
     121                                return WILS(@"Could not retrieve address for server via Bonjour.", @"WNError: WNAddressNetServiceLookupFailed description"); 
    122122                                break; 
    123123                                 
    124                         case WISocketConnectFailed: 
    125                                 return [NSSWF:WILS(@"Could not connect to %@: %@.", @"WIError: WISocketConnectFailed description (address, underlying error)"), 
     124                        case WNSocketConnectFailed: 
     125                                return [NSSWF:WILS(@"Could not connect to %@: %@.", @"WNError: WNSocketConnectFailed description (address, underlying error)"), 
    126126                                        argument, error]; 
    127127                                break; 
    128128                                 
    129                         case WISocketWriteFailed: 
    130                                 return [NSSWF:WILS(@"Could not write to %@: %@.", @"WIError: WISocketWriteFailed description (address, underlying error)"), 
     129                        case WNSocketWriteFailed: 
     130                                return [NSSWF:WILS(@"Could not write to %@: %@.", @"WNError: WNSocketWriteFailed description (address, underlying error)"), 
    131131                                        argument, error]; 
    132132                                break; 
    133133                                 
    134                         case WISocketReadFailed: 
    135                                 return [NSSWF:WILS(@"Could not read from %@: %@.", @"WIError: WISocketReadFailed description (address, underlying error)"), 
     134                        case WNSocketReadFailed: 
     135                                return [NSSWF:WILS(@"Could not read from %@: %@.", @"WNError: WNSocketReadFailed description (address, underlying error)"), 
    136136                                        argument, error]; 
    137137                                break; 
     
    141141                } 
    142142        } 
    143         else if([[self domain] isEqualToString:WILibWiredErrorDomain]) { 
     143        else if([[self domain] isEqualToString:WNLibWiredErrorDomain]) { 
    144144                return [self localizedDescription]; 
    145145        } 
     
    148148} 
    149149 
    150  
    151  
    152 #pragma mark - 
    153  
    154 - (NSAlert *)alert { 
    155         return [NSAlert alertWithMessageText:[self localizedDescription] 
    156                                                    defaultButton:WILS(@"OK", @"WIError: OK button") 
    157                                                  alternateButton:NULL 
    158                                                          otherButton:NULL 
    159                            informativeTextWithFormat:@"%@", [self localizedFailureReason]]; 
    160 } 
    161  
    162150@end 
  • WiredAdditions/trunk/WNSocket.h

    r4438 r4979  
    2929#import <openssl/ssl.h> 
    3030 
    31 @interface WISocketContext : WIObject { 
     31@interface WNSocketContext : WIObject { 
    3232        wi_socket_context_t                             *_context; 
    3333} 
    3434 
    3535 
    36 + (WISocketContext *)socketContextForClient; 
     36+ (WNSocketContext *)socketContextForClient; 
    3737 
    3838- (void)setSSLCiphers:(NSString *)iphers; 
     
    4141 
    4242 
    43 #define WISocketBufferSize                    WI_SOCKET_BUFFER_SIZE 
     43#define WNSocketBufferSize                    WI_SOCKET_BUFFER_SIZE 
    4444 
    4545 
    46 enum _WISocketType { 
    47         WISocketTCP                                           = WI_SOCKET_TCP, 
    48         WISocketUDP                                           = WI_SOCKET_UDP 
     46enum _WNSocketType { 
     47        WNSocketTCP                                           = WI_SOCKET_TCP, 
     48        WNSocketUDP                                           = WI_SOCKET_UDP 
    4949}; 
    50 typedef enum _WISocketType                     WISocketType; 
     50typedef enum _WNSocketType                     WNSocketType; 
    5151 
    5252 
    53 enum _WISocketDirection { 
    54         WISocketRead                                  = WI_SOCKET_READ, 
    55         WISocketWrite                                 = WI_SOCKET_WRITE 
     53enum _WNSocketDirection { 
     54        WNSocketRead                                  = WI_SOCKET_READ, 
     55        WNSocketWrite                                 = WI_SOCKET_WRITE 
    5656}; 
    57 typedef enum _WISocketDirection                WISocketDirection; 
     57typedef enum _WNSocketDirection                WNSocketDirection; 
    5858 
    5959 
    60 @class WIAddress, WIError; 
     60@class WNAddress, WNError; 
    6161 
    62 @interface WISocket : WIObject { 
     62@interface WNSocket : WIObject { 
    6363        wi_socket_t                                             *_socket; 
    6464         
    65         WIAddress                                             *_address; 
     65        WNAddress                                             *_address; 
    6666         
    6767        NSMutableString                                 *_buffer; 
     
    6969 
    7070 
    71 + (WISocket *)socketWithAddress:(WIAddress *)address type:(WISocketType)type; 
    72 + (WISocket *)socketWithFileDescriptor:(int)sd; 
     71+ (WNSocket *)socketWithAddress:(WNAddress *)address type:(WNSocketType)type; 
     72+ (WNSocket *)socketWithFileDescriptor:(int)sd; 
    7373 
    74 - (id)initWithAddress:(WIAddress *)address type:(WISocketType)type; 
     74- (id)initWithAddress:(WNAddress *)address type:(WNSocketType)type; 
    7575- (id)initWithFileDescriptor:(int)sd; 
    7676 
    77 - (WIAddress *)address; 
     77- (WNAddress *)address; 
    7878- (int)fileDescriptor; 
    7979- (SSL *)SSL; 
     
    8787- (void)setPort:(NSUInteger)port; 
    8888- (NSUInteger)port; 
    89 - (void)setDirection:(WISocketDirection)direction; 
    90 - (WISocketDirection)direction; 
     89- (void)setDirection:(WNSocketDirection)direction; 
     90- (WNSocketDirection)direction; 
    9191- (void)setBlocking:(BOOL)blocking; 
    9292- (BOOL)blocking; 
     
    9696- (BOOL)waitWithTimeout:(double)timeout; 
    9797 
    98 - (BOOL)connectWithContext:(WISocketContext *)context timeout:(double)timeout error:(WIError **)error; 
     98- (BOOL)connectWithContext:(WNSocketContext *)context timeout:(double)timeout error:(WNError **)error; 
    9999- (void)close; 
    100100 
    101 - (BOOL)writeString:(NSString *)string encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WIError **)error; 
     101- (BOOL)writeString:(NSString *)string encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WNError **)error; 
    102102 
    103 - (NSString *)readStringOfLength:(NSUInteger)length encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WIError **)error; 
    104 - (NSString *)readStringUpToString:(NSString *)separator encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WIError **)error; 
     103- (NSString *)readStringOfLength:(NSUInteger)length encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WNError **)error; 
     104- (NSString *)readStringUpToString:(NSString *)separator encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WNError **)error; 
    105105 
    106106@end 
  • WiredAdditions/trunk/WNSocket.m

    r4438 r4979  
    2727 */ 
    2828 
    29 #import <WiredAdditions/NSError-WIAdditions.h> 
    30 #import <WiredAdditions/WIAddress.h> 
    31 #import <WiredAdditions/WIError.h> 
    32 #import <WiredAdditions/WISocket.h> 
    33  
    34 #define _WISocketBufferMaxSize                          131072 
    35  
    36  
    37 @interface WISocketContext(Private) 
     29#import <WiredNetworking/WNAddress.h> 
     30#import <WiredNetworking/WNError.h> 
     31#import <WiredNetworking/WNSocket.h> 
     32 
     33#define _WNSocketBufferMaxSize                          131072 
     34 
     35 
     36@interface WNSocketContext(Private) 
    3837 
    3938- (wi_socket_context_t *)_context; 
     
    4241 
    4342 
    44 @implementation WISocketContext(Private) 
     43@implementation WNSocketContext(Private) 
    4544 
    4645- (wi_socket_context_t *)_context { 
     
    5150 
    5251 
    53 @implementation WISocketContext 
    54  
    55 + (WISocketContext *)socketContextForClient { 
    56         WISocketContext               *context; 
     52@implementation WNSocketContext 
     53 
     54+ (WNSocketContext *)socketContextForClient { 
     55        WNSocketContext               *context; 
    5756         
    5857        context = [[self alloc] init]; 
     
    10099 
    101100 
    102 @implementation WISocket 
    103  
    104 + (WISocket *)socketWithAddress:(WIAddress *)address type:(WISocketType)type { 
     101@implementation WNSocket 
     102 
     103+ (WNSocket *)socketWithAddress:(WNAddress *)address type:(WNSocketType)type { 
    105104        return [[[self alloc] initWithAddress:address type:type] autorelease]; 
    106105} 
     
    108107 
    109108 
    110 + (WISocket *)socketWithFileDescriptor:(int)sd { 
     109+ (WNSocket *)socketWithFileDescriptor:(int)sd { 
    111110        return [[[self alloc] initWithFileDescriptor:sd] autorelease]; 
    112111} 
     
    114113 
    115114 
    116 - (id)initWithAddress:(WIAddress *)address type:(WISocketType)type { 
     115- (id)initWithAddress:(WNAddress *)address type:(WNSocketType)type { 
    117116        wi_pool_t       *pool; 
    118117         
     
    147146        self = [super init]; 
    148147         
    149         _buffer = [[NSMutableString alloc] initWithCapacity:WISocketBufferSize]; 
     148        _buffer = [[NSMutableString alloc] initWithCapacity:WNSocketBufferSize]; 
    150149         
    151150        return self; 
     
    171170#pragma mark - 
    172171 
    173 - (WIAddress *)address { 
     172- (WNAddress *)address { 
    174173        return _address; 
    175174} 
     
    279278 
    280279 
    281 - (void)setDirection:(WISocketDirection)direction { 
     280- (void)setDirection:(WNSocketDirection)direction { 
    282281        wi_socket_set_direction(_socket, (wi_socket_direction_t) direction); 
    283282} 
     
    285284 
    286285 
    287 - (WISocketDirection)direction { 
    288         return (WISocketDirection) wi_socket_direction(_socket); 
     286- (WNSocketDirection)direction { 
     287        return (WNSocketDirection) wi_socket_direction(_socket); 
    289288} 
    290289 
     
    332331#pragma mark - 
    333332 
    334 - (BOOL)connectWithContext:(WISocketContext *)context timeout:(double)timeout error:(WIError **)error { 
     333- (BOOL)connectWithContext:(WNSocketContext *)context timeout:(double)timeout error:(WNError **)error { 
    335334        wi_pool_t               *pool; 
    336335        BOOL                    result = YES; 
     
    342341        if(!wi_socket_connect(_socket, [context _context], timeout)) { 
    343342                if(error) { 
    344                         *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    345                                                                                  code:WISocketConnectFailed 
     343                        *error = [WNError errorWithDomain:WNWiredNetworkingErrorDomain 
     344                                                                                 code:WNSocketConnectFailed 
    346345                                                                         userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    347                                                                                  [WIError errorWithDomain:WILibWiredErrorDomain],      WILibWiredErrorKey, 
     346                                                                                 [WNError errorWithDomain:WNLibWiredErrorDomain],      WNLibWiredErrorKey, 
    348347                                                                                 [_address string],                                                                     WIArgumentErrorKey, 
    349348                                                                                 NULL]]; 
     
    372371#pragma mark - 
    373372 
    374 - (BOOL)writeString:(NSString *)string encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WIError **)error { 
     373- (BOOL)writeString:(NSString *)string encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WNError **)error { 
    375374        NSData                  *data; 
    376375        wi_pool_t               *pool; 
     
    382381        if(wi_socket_write_buffer(_socket, timeout, [data bytes], [data length]) < 0) { 
    383382                if(error) { 
    384                         *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    385                                                                                  code:WISocketWriteFailed 
     383                        *error = [WNError errorWithDomain:WNWiredNetworkingErrorDomain 
     384                                                                                 code:WNSocketWriteFailed 
    386385                                                                         userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    387                                                                                  [WIError errorWithDomain:WILibWiredErrorDomain],      WILibWiredErrorKey, 
     386                                                                                 [WNError errorWithDomain:WNLibWiredErrorDomain],      WNLibWiredErrorKey, 
    388387                                                                                 [_address string],                                                                     WIArgumentErrorKey, 
    389388                                                                                 NULL]]; 
     
    402401#pragma mark - 
    403402 
    404 - (NSString *)readStringOfLength:(NSUInteger)length encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WIError **)error { 
     403- (NSString *)readStringOfLength:(NSUInteger)length encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WNError **)error { 
    405404        NSMutableString         *string, *substring; 
    406405        wi_pool_t                       *pool; 
    407         char                            buffer[WISocketBufferSize]; 
     406        char                            buffer[WNSocketBufferSize]; 
    408407        wi_integer_t            bytes = -1; 
    409408         
     
    447446                if(bytes < 0) { 
    448447                        if(error) { 
    449                                 *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    450                                                                                          code:WISocketReadFailed 
     448                                *error = [WNError errorWithDomain:WNWiredNetworkingErrorDomain 
     449                                                                                         code:WNSocketReadFailed 
    451450                                                                                 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    452                                                                                          [WIError errorWithDomain:WILibWiredErrorDomain],      WILibWiredErrorKey, 
     451                                                                                         [WNError errorWithDomain:WNLibWiredErrorDomain],      WNLibWiredErrorKey, 
    453452                                                                                         [_address string],                                                                     WIArgumentErrorKey, 
    454453                                                                                         NULL]]; 
     
    468467 
    469468 
    470 - (NSString *)readStringUpToString:(NSString *)separator encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WIError **)error { 
     469- (NSString *)readStringUpToString:(NSString *)separator encoding:(NSStringEncoding)encoding timeout:(double)timeout error:(WNError **)error { 
    471470        NSString                *string, *substring; 
    472471        NSUInteger              index; 
     
    482481        } 
    483482         
    484         while((string = [self readStringOfLength:WISocketBufferSize encoding:encoding timeout:timeout error:error])) { 
     483        while((string = [self readStringOfLength:WNSocketBufferSize encoding:encoding timeout:timeout error:error])) { 
    485484                if([string length] == 0) 
    486485                        return string; 
     
    491490                 
    492491                if(index == NSNotFound) { 
    493                         if([_buffer length] > _WISocketBufferMaxSize) { 
    494                                 substring = [_buffer substringToIndex:_WISocketBufferMaxSize]; 
     492                        if([_buffer length] > _WNSocketBufferMaxSize) { 
     493                                substring = [_buffer substringToIndex:_WNSocketBufferMaxSize]; 
    495494                                 
    496495                                [_buffer deleteCharactersInRange:NSMakeRange(0, [substring length])]; 
  • WiredAdditions/trunk/WNThread.h

    r4438 r4979  
    2727 */ 
    2828 
    29 @interface WIThread : NSThread 
     29@interface WNThread : NSThread 
    3030 
    3131@end 
  • WiredAdditions/trunk/WNThread.m

    r4438 r4979  
    2727 */ 
    2828 
    29 #import <WiredAdditions/NSInvocation-WIAdditions.h> 
    30 #import <WiredAdditions/WIThread.h> 
     29#import <WiredNetworking/WNThread.h> 
    3130 
    32 @interface WIThread(Private) 
     31@interface WNThread(Private) 
    3332 
    3433+ (void)_threadTrampoline:(id)arg; 
     
    3736 
    3837 
    39 @implementation WIThread(Private) 
     38@implementation WNThread(Private) 
    4039 
    4140+ (void)_threadTrampoline:(id)arg { 
     
    5251 
    5352 
    54 @implementation WIThread 
     53 
     54@implementation WNThread 
    5555 
    5656+ (void)detachNewThreadSelector:(SEL)selector toTarget:(id)target withObject:(id)argument { 
  • WiredAdditions/trunk/WiredAdditions.h

    r4787 r4979  
    6464#endif 
    6565 
    66 #import <wired/wired.h> 
    67  
    6866#import <WiredAdditions/WIFunctions.h> 
    6967#import <WiredAdditions/WIMacros.h> 
    &nbs