home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / DPSConversion.tops < prev    next >
Encoding:
Text File  |  1996-11-20  |  23.3 KB  |  394 lines

  1. /*********** DPSConversion: method files ***********/
  2.  
  3. replace "#include <DPSClient/dpsNeXT.h>" with 
  4. "#include <AppKit/dpsOpenStep.h>
  5. #include <AppKit/NSDPSContext.h>"
  6.  
  7. replace "#include <DPSClient/dpsclient.h>" with 
  8. "#include <AppKit/dpsclient.h>
  9. #include <AppKit/NSDPSContext.h>"
  10.  
  11. replace "#import <DPSClient/dpsNeXT.h>" with 
  12. "#import <AppKit/dpsOpenStep.h>
  13. #import <AppKit/NSDPSContext.h>"
  14.  
  15. replace "#import <DPSClient/dpsclient.h>" with 
  16. "#import <AppKit/dpsclient.h>
  17. #import <AppKit/NSDPSContext.h>"
  18.  
  19. replace "<DPSClient/wraps.h>" with "<AppKit/psopsOpenStep.h>"
  20.  
  21. replace "<DPSClient/dpswraps.h>" with "<AppKit/dpsopsOpenStep.h>"
  22.  
  23. replace "DPSClient/" with "AppKit/"
  24.  
  25. /*********** DPSConversion: simple renaming ***********/
  26.  
  27. replace "DPSDoUserPath" with "PSDoUserPath" 
  28.  
  29. replace "DPSDoUserPathWithMatrix" with "PSDoUserPathWithMatrix" 
  30.  
  31. replace "DPSFlush()" with "PSFlush()"
  32.  
  33.  
  34.  
  35. /****************     DPSTimedEntry declarations     ******************/
  36.  
  37. replace "DPSTimedEntry <t timedEntry>;" with "NSTimer *<t timedEntry>;"
  38.  
  39. replace "DPSTimedEntry <t timedEntry>," with "NSTimer *<t timedEntry>,"
  40.  
  41. replace "(DPSTimedEntry)," with "(NSTimer *)"
  42.  
  43. replace "DPSTimedEntry" with same
  44.     error "DPSConversion: DPSTimedEntry is obsolete. Use NSTimer instead."
  45.     
  46. replace "DPSTimedEntryProc" with same    
  47.     error "DPSConversion: DPSTimedEntryProc is obsolete. DPSTimedEntry has been replaced by NSTimer."
  48.  
  49. /****************     <tag> = DPSAddTimedEntry();     ******************/
  50.  
  51. /* no user info, priority = NX_BASETHRESHOLD */
  52.  
  53. replace "<tag> = DPSAddTimedEntry(<balanced args>)" with same
  54.     error "DPSConversion: <tag> should be converted from a DPSTimedEntry to an NSTimer object"
  55.  
  56. replace "DPSAddTimedEntry(<period>, <handler>, NULL, <priority>)" with "[[NSTimer scheduledTimerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:nil repeats:YES] retain]"
  57.     error "DPSConversion: 'scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, NULL, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer])"
  58.     where "<priority>" isOneOf {
  59.     "NX_BASETHRESHOLD",
  60.     "NSBaseThreshhold",
  61.     "NX_BASETHRESHOLD + 1",
  62.     "NSBaseThreshhold + 1",
  63.     }
  64.     
  65. /* no user info, priority = NX_RUNMODALTHRESHOLD */
  66.  
  67. replace "<tag> = DPSAddTimedEntry(<period>, <handler>, NULL, <priority>);" with "
  68.     {
  69.     <tag> = [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:nil repeats:YES] retain];
  70.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSDefaultRunLoopMode];
  71.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSModalPanelRunLoopMode];
  72.     }"
  73.     error "DPSConversion: 'timerWithTimerInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, NULL, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer])"
  74.     where "<priority>" isOneOf {
  75.     "NX_RUNMODALTHRESHOLD",
  76.     "NSRunModalThreshold",
  77.     "NX_RUNMODALTHRESHOLD + 1",
  78.     "NSRunModalThreshold + 1",
  79.     }
  80.  
  81. /* no user info, priority = NX_MODALRESPTHRESHOLD */
  82.  
  83. replace "<tag> = DPSAddTimedEntry(<period>, <handler>, NULL, <priority>);" with "
  84.     {
  85.     <tag> = [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:nil repeats:YES] retain];
  86.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSDefaultRunLoopMode];
  87.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSModalPanelRunLoopMode];
  88.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSEventTrackingRunLoopMode];
  89.     }"
  90.     error "DPSConversion: 'timerWithTimerInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, NULL, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer])"
  91.     where "<priority>" isOneOf {
  92.     "NX_MODALRESPTHRESHOLD",
  93.     "NSModalResponseThreshold",
  94.     "NX_MODALRESPTHRESHOLD + 1",
  95.     "NSModalResponseThreshold + 1",
  96.     }
  97.     
  98. /* no user info, priority is something else */
  99.  
  100. replace "<tag> = DPSAddTimedEntry(<period>, <handler>, NULL, <priority>);" with "
  101.     {
  102.     <tag> = [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:nil repeats:YES] retain];
  103.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:<priority>];
  104.     }"
  105.     error "DPSConversion: 'timerWithTimerInterval:target:selector:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, NULL, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer]), and <priority> should be converted to an NSRunLoop mode (NSDefaultRunLoopMode, NSModalPanelRunLoopMode, and NSEventTrackingRunLoopMode are predefined)"
  106.     
  107. /* with user info, priority = NX_BASETHRESHOLD */
  108.  
  109. replace "DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>)" with "[[NSTimer scheduledTimerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:YES] retain]"
  110.     error "DPSConversion: 'scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer]).  The argument to userInfo: needs to be converted to an object and can be retrieved with [timer userInfo]."
  111.     where "<priority>" isOneOf {
  112.     "NX_BASETHRESHOLD",
  113.     "NSBaseThreshhold",
  114.     "NX_BASETHRESHOLD + 1",
  115.     "NSBaseThreshhold + 1",
  116.     }
  117.     
  118. /* with user info, priority = NX_RUNMODALTHRESHOLD or NX_MODALRESPTHRESHOLD */
  119.  
  120. replace "<tag> = DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>);" with "
  121.     {
  122.     <tag> = [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:YES] retain];
  123.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSDefaultRunLoopMode];
  124.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSModalPanelRunLoopMode];
  125.     }"
  126.     error "DPSConversion: 'timerWithTimeInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer]).  The argument to userInfo: needs to be converted to an object and can be retrieved with [timer userInfo]."
  127.     where "<priority>" isOneOf {
  128.     "NX_RUNMODALTHRESHOLD",
  129.     "NSRunModalThreshold",
  130.     "NX_RUNMODALTHRESHOLD + 1",
  131.     "NSRunModalThreshold + 1",
  132.     }
  133.  
  134. replace "<tag> = DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>);" with "
  135.     {
  136.     <tag> = [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:YES] retain];
  137.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSDefaultRunLoopMode];
  138.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSModalPanelRunLoopMode];
  139.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:NSEventTrackingRunLoopMode];
  140.     }"
  141.     error "DPSConversion: 'timerWithTimeInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer]).  The argument to userInfo: needs to be converted to an object and can be retrieved with [timer userInfo]."
  142.     where "<priority>" isOneOf {
  143.     "NX_MODALRESPTHRESHOLD",
  144.     "NSModalResponseThreshold",
  145.     "NX_MODALRESPTHRESHOLD + 1",
  146.     "NSModalResponseThreshold + 1",
  147.     }
  148.  
  149. /* with user info, priority is something else */
  150.  
  151. replace "<tag> = DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>);" with "
  152.     {
  153.     <tag> = [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:YES] retain];
  154.     [[NSRunLoop currentRunLoop] addTimer:<tag> forMode:<priority>];
  155.     }"
  156.     error "DPSConversion: 'timerWithTimeInterval:target:selector:userInfo:repeats:' used to be DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>).  <handler> should be converted to a method with one argument (the timer), and <target> should be converted to the implementor of that method ([aTarget aSelector:timer]).  The argument to userInfo: needs to be converted to an object and can be retrieved with [timer userInfo], and <priority> should be converted to an NSRunLoop mode (NSDefaultRunLoopMode, NSModalPanelRunLoopMode, and NSEventTrackingRunLoopMode are predefined)"
  157.  
  158. /* whatever has been left out */
  159.  
  160. replace "DPSAddTimedEntry(<period>, <handler>, <userData>, <priority>)" with same
  161.     error "DPSConversion: DPSAddTimedEntry is obsolete.  Use the NSTimer class instead:  [[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:YES] retain].  <target> should be an objects that implements method ([aTarget <handler>:timer])"
  162.  
  163. /* cleanup, since &proc is often used with DPSAddTimedEntry */
  164. /* target is of type balanced because the rules above insert "<target>" */
  165.  
  166. replace "[NSTimer timerWithTimeInterval:<period> target:<balanced target> selector:&<handler> userInfo:<userData> repeats:<flag>]" with "[NSTimer timerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:<flag>]"
  167. replace "[NSTimer scheduledTimerWithTimeInterval:<period> target:<balanced target> selector:&<handler> userInfo:<userData> repeats:<flag>]" with "[NSTimer scheduledTimerWithTimeInterval:<period> target:<target> selector:<handler> userInfo:<userData> repeats:<flag>]"
  168.  
  169. /****************     DPSRemoveTimedEntry()     ******************/
  170.  
  171. replace "DPSRemoveTimedEntry(<tag>)" with "[<tag> invalidate]; [<tag> release];"
  172.  
  173. /****************     DPSAddPort()     ******************/
  174.  
  175. replace "DPSAddPort(<port>, <handler>, <max>, <userdata>, <priority>)" with "[[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<port>] forMode:NSDefaultRunLoopMode]"
  176.     error "DPSConversion: 'addPort:forMode:' used to be DPSAddPort(<port>, <handler>, <max>, <userdata>, <priority>).  <port> should be retained to avoid loss through deallocation, and the functionality of <handler> should be implemented by a delegate of the NSPort in response to 'handleMachMessage:' or 'handlePortMessage:'."
  177.     where "<priority>" isOneOf {
  178.     "NX_BASETHRESHOLD",
  179.     "NSBaseThreshhold",
  180.     "NX_BASETHRESHOLD + 1",
  181.     "NSBaseThreshhold + 1",
  182.     }
  183.     
  184. replace "DPSAddPort(<port>, <handler>, <max>, <userdata>, <priority>)" with "
  185.     {
  186.     [[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<port>] forMode:NSDefaultRunLoopMode];
  187.     [[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<port>] forMode:NSModalPanelRunLoopMode];
  188.     }"
  189.     error "DPSConversion: 'addPort:forMode:' used to be DPSAddPort(<port>, <handler>, <max>, <userdata>, <priority>).  <port> should be retained to avoid loss through deallocation, and the functionality of <handler> should be implemented by a delegate of the NSPort in response to 'handleMachMessage:' or 'handlePortMessage:'."
  190.     where "<priority>" isOneOf {
  191.     "NX_RUNMODALTHRESHOLD",
  192.     "NSRunModalThreshold",
  193.     "NX_RUNMODALTHRESHOLD + 1",
  194.     "NSRunModalThreshold + 1",
  195.     }
  196.     
  197. replace "DPSAddPort(<port>, <handler>, <max>, <userdata>, <priority>)" with "
  198.     {
  199.     [[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<port>] forMode:NSDefaultRunLoopMode];
  200.     [[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<port>] forMode:NSModalPanelRunLoopMode];
  201.     [[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<port>] forMode:NSEventTrackingRunLoopMode];
  202.     }"
  203.     error "DPSConversion: 'addPort:forMode:' used to be DPSAddPort(<port>, <handler>, <max>, <userdata>, <priority>).  <port> should be retained to avoid loss through deallocation, and the functionality of <handler> should be implemented by a delegate of the NSPort in response to 'handleMachMessage:' or 'handlePortMessage:'."
  204.     where "<priority>" isOneOf {
  205.     "NX_MODALRESPTHRESHOLD",
  206.     "NSModalResponseThreshold",
  207.     "NX_MODALRESPTHRESHOLD + 1",
  208.     "NSModalResponseThreshold + 1",
  209.     }
  210.     
  211. replace "DPSAddPort(<b port>, <b handler>, <b max>, <b userdata>, <b priority>)" with "[[NSRunLoop currentRunLoop] addPort:[NSPort portWithMachPort:<b port>] forMode:<b priority>]"
  212.     error "DPSConversion: 'addPort:forMode:' used to be DPSAddPort(<b port>, <b handler>, <b max>, <b userdata>, <b priority>).  <b port> should be retained to avoid loss through deallocation, the functionality of <b handler> should be implemented by a delegate of the NSPort in response to 'handleMachMessage:' or 'handlePortMessage:',  and <b priority> should be converted to an NSRunLoop mode (NSDefaultRunLoopMode, NSModalPanelRunLoopMode, and NSEventTrackingRunLoopMode are predefined)."
  213.     
  214. /****************     DPSRemovePort()     ******************/
  215.  
  216. replace "DPSRemovePort(<port>)" with "[[NSRunLoop currentRunLoop] removePort:[NSPort portWithMachPort:<port>] forMode:<mode>]"
  217.     warning "DPSConversion: 'removePort:forMode:' used to be DPSRemovePort(<port>).  <port> should be retained to avoid loss through deallocation, and <mode> should be the mode for which the port was added."
  218.  
  219. /****************     DPSAddFD()     ******************/
  220.  
  221. replace "DPSAddFD(<fd>, <handler>, <userdata>, <priority>);" with "
  222.     {
  223.     #warning __fd should really be created before here, since this one gets leaked 
  224.     id __fd = [[NSFileHandle allocWithZone:NULL] initWithFileDescriptor:<fd> closeOnDealloc:NO]
  225.     [[NSNotificationCenter defaultCenter] addObserver:/* handler object goes here */
  226.         selector:@selector(/* handler object's handling selector goes here */)
  227.         name:NSFileHandleReadCompletionNotification
  228.         object:__fd];
  229.     #warning notification handler object should be removed from the notification center at some appropriate time
  230.     [__fd readInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, nil]];
  231.     }"
  232.     error "DPSConversion: 'readInBackgroundAndNotifyForModes:' used to be DPSAddFD(<fd>, <handler>, <userdata>, <priority>).  The functionality of <handler> should be implemented by some object as a method."
  233.     where "<priority>" isOneOf {
  234.     "NX_BASETHRESHOLD",
  235.     "NSBaseThreshhold",
  236.     "NX_BASETHRESHOLD + 1",
  237.     "NSBaseThreshhold + 1",
  238.     }
  239.  
  240. replace "DPSAddFD(<fd>, <handler>, <userdata>, <priority>)" with "
  241.     {
  242.         #warning __fd should really be created before here, since this one gets leaked
  243.         id __fd = [[NSFileHandle allocWithZone:NULL] initWithFileDescriptor:<fd> closeOnDealloc:NO]
  244.         [[NSNotificationCenter defaultCenter] addObserver:/* handler object goes here */
  245.                 selector:@selector(/* handler object's handling selector goes here */)
  246.                 name:NSFileHandleReadCompletionNotification
  247.                 object:__fd];
  248.     #warning notification handler object should be removed from the notification center at some appropriate time
  249.         [__fd readInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, nil]];
  250.         }"
  251.     error "DPSConversion: 'readInBackgroundAndNotifyForModes:' used to be DPSAddFD(<fd>, <handler>, <userdata>, <priority>).  The functionality of <handler> should be implemented by some object as a method."
  252.     where "<priority>" isOneOf {
  253.     "NX_RUNMODALTHRESHOLD",
  254.     "NSRunModalThreshold",
  255.     "NX_RUNMODALTHRESHOLD + 1",
  256.     "NSRunModalThreshold + 1",
  257.     }
  258.  
  259. replace "DPSAddFD(<fd>, <handler>, <userdata>, <priority>)" with "
  260.     {
  261.         #warning __fd should really be created before here, since this one gets leaked
  262.         id __fd = [[NSFileHandle allocWithZone:NULL] initWithFileDescriptor:<fd> closeOnDealloc:NO]
  263.         [[NSNotificationCenter defaultCenter] addObserver:/* handler object goes here */
  264.                 selector:@selector(/* handler object's handling selector goes here */)
  265.                 name:NSFileHandleReadCompletionNotification
  266.                 object:__fd];
  267.     #warning notification handler object should be removed from the notification center at some appropriate time
  268.         [__fd readInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]];
  269.         }"
  270.     error "DPSConversion: 'readInBackgroundAndNotifyForModes:' used to be DPSAddFD(<fd>, <handler>, <userdata>, <priority>).  The functionality of <handler> should be implemented by some object as a method."
  271.     where "<priority>" isOneOf {
  272.     "NX_MODALRESPTHRESHOLD",
  273.     "NSModalResponseThreshold",
  274.     "NX_MODALRESPTHRESHOLD + 1",
  275.     "NSModalResponseThreshold + 1",
  276.     }
  277.  
  278. replace "DPSAddFD(<fd>, <handler>, <userdata>, <priority>)" with "
  279.     {
  280.         #warning __fd should really be created before here, since this one gets leaked
  281.         id __fd = [[NSFileHandle allocWithZone:NULL] initWithFileDescriptor:<fd> closeOnDealloc:NO]
  282.         [[NSNotificationCenter defaultCenter] addObserver:/* handler object goes here */
  283.                 selector:@selector(/* handler object's handling selector goes here */)
  284.                 name:NSFileHandleReadCompletionNotification
  285.                 object:__fd];
  286.     #warning notification handler object should be removed from the notification center at some appropriate time
  287.         [__fd readInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:/* One or more of: NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, or user-defined */ nil]];
  288.         }"
  289.     error "DPSConversion: 'readInBackgroundAndNotifyForModes:' used to be DPSAddFD(<fd>, <handler>, <userdata>, <priority>).  The functionality of <handler> should be implemented by some object as a method.  The <priority> argument needs to be converted to one or more NSRunLoop modes (NSDefaultRunLoopMode, NSModalPanelRunLoopMode, and NSEventTrackingRunLoopMode are predefined)"
  290.  
  291. /****************     DPSRemoveFD()     ******************/
  292.  
  293. replace "DPSRemoveFD(<fd>)" with same
  294.     error "DPSConversion: DPSRemoveFD(<fd>) is obsolete.  When monitoring of a file descriptor should be discontinued, the notification handler should simply not re-start the background operation."
  295.  
  296. /****************     others     ******************/
  297.  
  298. replace "DPSAddNotifyPort(<b args>)" with same
  299.     error "DPSConversion: DPSAddNotifyPort() is obsolete.  Use NSPort and NSRunLoop instead."
  300.     
  301. replace "DPSRemoveNotifyPortProc(<b args>)" with same
  302.     error "DPSConversion: DPSRemoveNotifyPortProc() is obsolete.  Use NSPort and NSRunLoop instead."
  303.  
  304. /*
  305. replace "DPSSetEventFunc()" with ""
  306. *//*********** DPSConversion: creating contexts ***********/
  307.  
  308. replace "DPSCreateContext(<hostName>, <serverName>, <textProc>, <errorProc>)" with "[[[NSDPSServerContext alloc] initWithHostName:[NSString stringWithCString:<hostName>] serverName:[NSString stringWithCString:<serverName>] textProc:<textProc> errorProc:<errorProc> timeout:60 secure:YES encapsulated:NO] DPSContext]"
  309.  
  310. replace "DPSCreateContextWithTimeoutFromZone(<hostName>, <serverName>, <textProc>, <errorProc>, <timeout>, <zone>)" with "[[[NSDPSServerContext allocWithZone:<zone>] initWithHostName:[NSString stringWithCString:<hostName>] serverName:[NSString stringWithCString:<serverName>] textProc:<textProc> errorProc:<errorProc> timeout:<timeout> secure:YES encapsulated:NO] DPSContext]"
  311.  
  312. replace "DPSCreateNonsecureContext(<hostName>, <serverName>, <textProc>, <errorProc>, <timeout>, <zone>)" with "[[[NSDPSServerContext allocWithZone:<zone>] initWithHostName:[NSString stringWithCString:<hostName>] serverName:[NSString stringWithCString:<serverName>] textProc:<textProc> errorProc:<errorProc> timeout:<timeout> secure:NO encapsulated:NO] DPSContext]"
  313.  
  314. replace "DPSCreateStreamContext(<stream>, <debugging>, <progEnc>, <nameEnc>, <errorProc>)" with "[[[NSDPSContext alloc] initWithStream:<stream> forDebugging:<debugging> languageEncoding:<progEnc> nameEncoding:<nameEnc> textProc:NULL errorProc:<errorProc>] DPSContext]"
  315.  
  316. replace "initWithHostName:[NSString stringWithCString:0]" with "initWithHostName:@\"\""
  317. replace "initWithHostName:[NSString stringWithCString:NULL]" with "initWithHostName:@\"\""
  318. replace "serverName:[NSString stringWithCString:0]" with "serverName:@\"\""
  319. replace "serverName:[NSString stringWithCString:NULL]" with "serverName:@\"\""
  320.  
  321. /*********** DPSConversion: wait cursor ***********/
  322.  
  323. replace "DPSStartWaitCursorTimer()" with "[[NSDPSContext currentContext] startWaitCursorTimer]"
  324.  
  325. /*********** DPSConversion: tracing ***********/
  326.  
  327. replace "DPSTraceContext(DPS_ALLCONTEXTS, <flag>)" with "[NSDPSContext setAllContextsOutputTraced:<flag>]"
  328.  
  329. replace "DPSTraceContext(<ctxt>, <flag>)" with "[<ctxt> setOutputTraced:<flag>]"
  330.  
  331. replace "DPSTraceEvents(<ctxt>, <flag>)" with "[NSDPSServerContext setEventsTraced:<flag>]"
  332.  
  333. /*********** DPSConversion: events ***********/
  334.  
  335. replace "DPSGetEvent(<balanced args>)" with same
  336.     error "DPSConversion: DPSGetEvent(...) must be converted by hand.  Watch for return value.  Threshold must become a mode.  Also consider using an NSApplication or NSWindow method."
  337.  
  338. replace "DPSPeekEvent(<balanced args>)" with same
  339.     error "DPSConversion: DPSPeekEvent(...) must be converted by hand.  Watch for return value.  Threshold must become a mode.  Also consider using an NSApplication or NSWindow method."
  340.  
  341. replace "DPSPostEvent(<balanced args>)" with same
  342.     error "DPSConversion: DPSPostEvent(...) must be converted by hand to 'postEvent:' method in NSWindow or NSApplication."
  343.  
  344. replace "DPSDiscardEvents(<balanced args>)" with same
  345.     error "DPSConversion: DPSDiscardEvents(...) must be converted by hand to the 'discardEventsMatchingMask:' method in NSWindow."
  346.  
  347. /*********** DPSConversion: other DPS functions ***********/
  348.  
  349. replace "DPSSendTaggedMsg(<ctxt>, <message>)" with "[<ctxt> sendTaggedMsg:<message>]"
  350.  
  351. replace "DPSSendPort(<ctxt>, <port>, <sendAllRights>)" with "[<ctxt> sendPort:<port> withAllRights:<sendAllRights>]"
  352.  
  353. replace "DPSSendEOF(<ctxt>)" with "[<ctxt> sendEOF]"
  354.  
  355. replace "DPSSetTracking(<flag>)" with "[NSDPSServerContext setEventCoalescingEnabled:<flag>]"
  356.  
  357. replace "DPSSetDeadKeysEnabled(<ctxt>, <flag>)" with "[NSDPSServerContext setDeadKeyProcessingEnabled:<flag>]"
  358.  
  359. replace "DPSAsynchronousWaitContext(<balanced args>)" with same
  360.     error "DPSConversion: DPSAsynchronousWaitContext(...) must be converted to '-notifyObjectWhenFinishedExecuting:'"
  361.  
  362. replace "DPSPrintError(<fp>, <error>)" with same
  363.     error "DPSConversion: DPSPrintError(...)  must be converted to '+stringForDPSError:'.  Maybe use NSLog([NSDPSContext stringForDPSError:<error>])"
  364.  
  365. replace "DPSPrintErrorToStream(<stream>, <error>)" with same
  366.     error "DPSConversion: DPSPrintErrorToStream(...)  must be converted to '+stringForDPSError:'.  Maybe use NSLog([NSDPSContext stringForDPSError:<error>])"
  367.  
  368. replace "DPSSynchronizeContext" with "DPSSetWrapSynchronization"
  369.  
  370. /*********** DPSConversion: PScursor functions *************/
  371.  
  372. replace    "PShidecursor()" with "[NSCursor hide]"
  373.  
  374. replace    "PSshowcursor()" with "[NSCursor unhide]"
  375.  
  376. replace    "PSobscurecursor()" with "[NSCursor setHiddenUntilMouseMoves:YES]"
  377.  
  378. replace    "PSrevealcursor()" with "[NSCursor setHiddenUntilMouseMoves:NO]"
  379.  
  380. /*********** DPSConversion: string conversion cleanup *************/
  381.  
  382. replace "[[NSString stringWithCString:<aString>] cString]" with "<aString>"
  383.  
  384. replace "[[<aString> cString] cString]" with "[<aString> cString]"
  385.  
  386. replace "[NSString stringWithCString:[<aString> cString]]" with "<aString>"
  387.  
  388. replace "[NSString stringWithCString:@<string stringconst>]" with "@<string stringconst>"
  389.  
  390. replace "[NSString stringWithCString:<string stringconst>]" with "@<string stringconst>"
  391.  
  392. replace "[@<string stringconst> cString]" with "<string stringconst>"
  393.  
  394.