home *** CD-ROM | disk | FTP | other *** search
Wrap
/* NXConnection stuff */ replace "[NXConnection connectToName:<exp cstr>]" with "[[NSConnection rootProxyForConnectionWithRegisteredName:<exp cstr> host:nil] retain]" replace "[NXConnection connectToName:<exp cstr> fromZone:<exp zone>]" with "[[NSConnection rootProxyForConnectionWithRegisteredName:<exp cstr> host:nil] retain]" replace "[NXConnection connectToName:<exp cstr> onHost:<exp hcstr>]" with "[[NSConnection rootProxyForConnectionWithRegisteredName:<exp cstr> host:<exp hcstr>] retain]" replace "[NXConnection connectToName:<exp cstr> onHost:<exp hcstr> fromZone:<exp zone>]" with "[[NSConnection rootProxyForConnectionWithRegisteredName:<exp cstr> host:<exp hcstr>] retain]" replace "[NXConnection connectToPort:<port>]" with "[[[NSConnection connectionWithReceivePort:[NSPort port] sendPort:<port>] rootProxy] retain]" replace "[NXConnection connectToPort:<port> fromZone:<exp zone>]" with "[[[NSConnection connectionWithReceivePort:[NSPort port] sendPort:<port>] rootProxy] retain]" replace "[NXConnection connectToPort:<sndport> withInPort:<rcvport>]" with "[[[NSConnection connectionWithReceivePort:<rcvport> sendPort:<sndport>] rootProxy] retain]" replace "[NXConnection connectToPort:<exp sndport> withInPort:<exp rcvport> fromZone:<exp zone>]" with "[[[NSConnection connectionWithReceivePort:<rcvport> sendPort:<sndport>] rootProxy] retain]" replace "[NXConnection registerRoot:<root>]" with "({id conn = [[NSConnection alloc] init]; [conn setRootObject:<root>]; conn;})" replace "[NXConnection registerRoot:<root> withName:<name>]" with "({id conn = [[NSConnection alloc] init]; [conn setRootObject:<root>]; [conn registerName:<name>]; conn;})" replace "[NXConnection registerRoot:<root> fromZone:<exp zone>]" with "({id conn = [[NSConnection alloc] init]; [conn setRootObject:<root>]; conn;})" replace "[NXConnection registerRoot:<root> withName:<name> fromZone:<exp zone>]" with "({id conn = [[NSConnection alloc] init]; [conn setRootObject:<root>]; [conn registerName:<name>]; conn;})" replace "[NXConnection removeObject:<exp obj>]" with same error "DO Conversion: there is no way to unexport an object" replace "[NXConnection messagesReceived]" with same error "DO Conversion: there is no direct way to report this information, try -statistics instead" replace "\<NXSenderIsInvalid>" with "" replace "NXSenderIsInvalid" with "NXSenderIsInvalid" warning "DO Conversion: NXSenderIsInvalid protocol has no equivalent - please remove" replace "[<conn> registerForInvalidationNotification:<target>]" with "[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(senderIsInvalid:) name:NSConnectionDidDieNotification object:<conn>]" replace "[NXConnection unregisterForInvalidationNotification:<exp obj>]" with "[[NSNotificationCenter defaultCenter] removeObserver:<exp obj> name:NSConnectionDidDieNotification]" replacemethod "senderIsInvalid:<conn>" with same { replace "<conn_type>" with "(NSNotification *)" } within ("<implementation>") { replace "<conn_param>" with "[<conn_param> object]" } replace "[NXConnection connections:<list>]" with "([<list> release], <list> = [NSConnection allConnections])" warning "DO Conversion: zapping earlier contents of list." replace "[NXConnection setDefaultTimeout:<milliseconds>];" with "{ id conn = [NSConnection defaultConnection]; [conn setRequestTimeout:((<milliseconds>)/1000.0)]; [conn setReplyTimeout:((<milliseconds>)/1000.0)];}" replace "[NXConnection defaultTimeout]" with "((int)([[NSConnection defaultConnection] requestTimeout]*1000.0))" replace "[NXConnection setDefaultZone:<zone>]" with "[NXConnection setDefaultZone:<zone>]" warning "DO Conversion: there is no NSConnection equivalent" replace "[NXConnection defaultZone]" with "NULL" replace "[<conn> <a nxmethod>]" with "[<conn> <a nsmethod>]" where ("<nxmethod>", "<nsmethod>") isOneOf { ("setRoot:<exp obj>", "setRootObject:<exp obj>"), ("setInTimeout:<timeout>", "setReplyTimeout:((<timeout>)/1000.0)"), ("setOutTimeout:<timeout>", "setRequestTimeout:((<timeout>)/1000.0)"), ("inPort", "receivePort"), ("outPort", "sendPort"), } replace "[<conn> inTimeout]" with "((int)[<conn> requestTimeout]/1000.0)" replace "[<conn> outTimeout]" with "((int)[<conn> replyTimeout]/1000.0)" replace "[<conn> newRemote:<name> withProtocol:<prot>]" with "({id res = [[NSDistantObject alloc] initWithTarget:<name> connection:<conn>]; [res setProtocolForProxy:<prot>]; res })" replace "[<conn> getLocal:<b obj>]" with "[NSDistantObject proxyWithLocal:<b obj> connection:<conn>]" replace "[NSApp run]" with "[NSAppSAFErun]" replace "[<conn> run]" with same warning "DO Conversion: The run method of NSConnection is obsolete. Use '[[NSRunLoop currentRunLoop] run]' instead. If this run message is being sent to an Application object, do not change it." replace "[NSAppSAFErun]" with "[NSApp run]" replace "[<b conn> runWithTimeout:<b tim>]" with "[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:(<b tim>/1000.0]]" replace "[<conn> runFromAppKit]" with "" replace "[<conn> runFromAppKitWithPriority:<prio>]" with "" /* NXEncoding, NXDecoding */ replacemethod "encodeUsing:<coder>" with "encodeWithCoder:<coder>" { replace "<rettype>" with "(void)" replace "<coder_type>" with "(NSPortCoder *)" replace "<coder_param>" with "aPortCoder" } within ("<implementation>") { replace "<coder_param>" with "aPortCoder" replace "return <exp>" with "return" } replacemethod "decodeUsing:<coder>" with "initWithCoder:<coder>" { replace "<rettype>" with "(id)" replace "<coder_type>" with "(NSPortCoder *)" replace "<coder_param>" with "aPortCoder" } within ("<implementation>") { replace "<coder_param>" with "aPortCoder" } replacemethod "encodeRemotelyFor:<conn> freeAfterEncoding:<freeit> isBycopy:<isBycopy>" with "replacementObjectForPortCoder:<conn>" { replace "<conn_type>" with "(NSPortCoder *)" replace "<conn_param>" with "aPortCoder" } within ("<implementation>") { replace "<isBycopy_param>" with "[aPortCoder isBycopy]" replace "<conn_param>" with "[aPortCoder connection]" } warning "DO Conversion: if freeAfterEncoding was true use autorelease instead." replace "[<coder> encodeData:<data> ofType:<type>]" with "[<coder> encodeValueOfObjCType:<type> at:<data>]" replace "[<coder> encodeBytes:<data> count:<count>]" with "[<coder> encodeBytes:<data> length:<count>]" replace "[<coder> encodeVM:<data> count:<count>]" with "[<coder> encodeBytes:<data> length:<count>]" replace "[<coder> encodeMachPort:<port>]" with "[<coder> encodePortObject:[NSPort portWithMachPort:<port>]" warning "DO Conversion: raw mach port will get deallocated if the NSPort is not retained elsewhere." replace "[<coder> encodeObjectBycopy:<obj>]" with "[<coder> encodeObject:<obj> isBycopy:YES]" replace "[<coder> decodeData:<data> ofType:<type>]" with "[<coder> decodeValueOfObjCType:<type> at:<data>]" replace "[<coder> decodeBytes:<bytes> count:<count>]" with "{unsigned length; bcopy([<coder> decodeBytesWithReturnedLength:&length], <bytes>, <count>);}" replace "[<coder> decodeVM:<bytes> count:<count>]" with "{unsigned length; bcopy([<coder> decodeBytesWithReturnedLength:&length], <bytes>, <count>);}" replace "[<coder> decodeMachPort:<portp>]" with "*(<portp>) = [<coder> decodePortObject]" warning "DO Conversion: underlying mach port will be deallocated if NSPort instance is not retained elsewhere." /* NXPort */ replace "[NXPort newWithMachPort:<port>]" with "[[NSPort alloc] initWithMachPort:<port>]" replace "[NXPort newWithMachPort:<port> dealloc:<flag>]" with "[[NSPort alloc] initWithMachPort:<port>]" replace "[NXPort worryAboutPortInvalidation]" with "" /* NXData */ /* Overall */ replace "remote/NXConnection.h" with "Foundation/NSConnection.h" replace "remote/NXProxy.h" with "Foundation/NSDistantObject.h" replace "remote/transport.h" with "Foundation/NSPortCoder.h" replace "machkit/NXPort.h" with "Foundation/NSPort.h" replace "NXProxy" with "NSDistantObject" replace "NXConnection" with "NSConnection" replace "NXPort" with "NSPort" replace "NXTransport" with "NSCoding"