home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-03-28 | 50.6 KB | 1,086 lines
/* dependencies: before NSNameConversion */ /*********** StringConversion: One parameter converted ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" } where "<sel>" isOneOf { "_selectFaxByName:<str1>", "addEntry:<str1>", "addEntry:<str1>tag:target:action:", "addItem:<str1>", "addItem:<str1>action:keyEquivalent:", "addWindowsItem:title:<str1>filename:", "app:applicationDidLaunch:<str1>", "app:applicationDidTerminate:<str1>", "app:applicationWillLaunch:<str1>", "app:mounted:<str1>", "app:unmounted:<str1>", "app:unmounting:<str1>", "applicationDidLaunch:<str1>", "applicationDidTerminate:<str1>", "applicationWillLaunch:<str1>", "attemptOverwrite:<str1>", "browser:selectCell:<str1>inColumn:", "changeWindowsItem:title:<str1>filename:", "checkInAs:<str1>", "colorListDidChange:colorName:<str1>", "colorNamed:<str1>", "convert:toFace:<str1>", "convert:toFamily:<str1>", "documentSavedAs:<str1>", "documentSavedTo:<str1>", "dragFile:<str1>fromRect:slideBack:event:", "drawTitle:<str1>inRect:ofColumn:", "findColorListNamed:<str1>", "findFont:<str1>traits:weight:size:", "findImageNamed:<str1>", "findText:<str1>ignoreCase:backwards:wrap:", "fontManager:willIncludeFont:<str1>", "findSoundFor:<str1>" "getIconForFile:<str1>", "getInfoForFileSystemAt:<str1>isRemovable:isWritable:isUnmountable:description:type:", "getSize:for:<str1>", "getWidthOf:<str1>", "imageRectForPaper:<str1>", "imageRepForFileType:<str1>", "importFile:<str1>at:", "indexOfItem:<str1>", "initForDirectory:", "initFrame:text:<str1>alignment:", "initFromFile:<str1>", "initFromSection:<str1>", "initForDirectory:<str1>", "initIconCell:<str1>", "initLinkedToFile:<str1>", "initTextCell:<str1>", "initTitle:<str1>", "initWithDelegate:fromFile:<str1>", "initWithName:<str1>", "insertEntry:<str1>at:", "insertEntry:<str1>at:tag:target:action:", "insertItem:<str1>at:", "isEntryAcceptable:<str1>", "isFontAvailable:<str1>", "isInUserDictionary:<str1>caseSensitive:", "launchApplication:<str1>", "launchApplication:<str1>showTile:autolaunch:", "loadFromFile:<str1>", "loadNibFile:<str1>owner:withNames:fromZone:", "loadNibFile:<str1>owner:withNames:", "loadNibFile:<str1>owner:", "loadNibSection:<str1>owner:withNames:fromHeader:fromZone:", "loadNibSection:<str1>owner:withNames:fromHeader:", "loadNibSection:<str1>owner:withNames:fromZone:", "loadNibSection:<str1>owner:withNames:", "loadNibSection:<str1>owner:", "minFrameWidth:<str1>forStyle:buttonMask:", "mounted:<str1>", /*+*/ "newByFilteringData:ofType:<str1>", /*+*/ "newByFilteringFile:<str1>", /*+*/ "newFont:<str1>size:", /*+*/ "newFont:<str1>size:matrix:", /*+*/ "newFont:<str1>size:style:matrix:", /*+*/ "newFont:size:matrix:<str1>", /*+*/ "newForDirectory:<str1>", /*+*/ "newForName:<str1>", /*+*/ "newForType:<str1>", /*+*/ "newFrame:icon:<str1>tag:target:action:key:enabled:", /*+*/ "newFrame:text:<str1>alignment:", /*+*/ "newFrame:title:<str1>tag:target:action:key:enabled:", /*+*/ "newFromFile:<str1>", /*+*/ "newFromSection:<str1>", /*+*/ "newIconCell:<str1>", /*+*/ "newListFromFile:<str1>", /*+*/ "newListFromFile:<str1>zone:", /*+*/ "newListFromSection:<str1>", /*+*/ "newListFromSection:<str1>zone:", /*+*/ "newName:<str1>", /*+*/ "newTextCell:<str1>", /*+*/ "newTitle:<str1>", "noResponderFor:<str1>", "openFile:<str1>", "openFile:<str1>ok:", "openFile:<str1>fromImage:at:inView:", "openSpoolFile:<str1>", "openRTFDFrom:<str1>", "openTempFile:<str1>", "openTempFile:<str1>ok:", "pageSizeForPaper:<str1>", "performRemoteMethod:<str1>", "performRemoteMethod:<str1>with:length:", "readType:<str1>data:length:" "readTypeToStream:<str1>", "registerDirective:<str1>forClass:", "removeColorNamed:<str1>", "removeFrameUsingName:<str1>", "removeItem:<str1>", "removeJobFeature:<str1>", "renewFont:text:<str1>frame:tag:", "renewRuns:text:<str1>frame:tag:", "replaceSel:<str1>", "replaceSel:<str1>length:", "replaceSel:<str1>length:runs:", "saveFrameUsingName:<str1>", "saveLinkIn:<str1>", "saveRTFDTo:<str1>removeBackup:errorHandler:", "saveTo:<str1>", "saveFrameToString:<str1>", "selectorRPC:<str1>paramTypes:" "sendOpenFileMsg:<str1>ok:andDeactivateSelf:", "sendOpenTempFileMsg:<str1>ok:andDeactivateSelf:", "setAltIcon:<str1>", "setAltTitle:<str1>", "setColorNamed:<str1>color:", "setDirectory:<str1>", "setEventStatus:soundStatus:eventStream:soundfile:<str1>", "setFrameAutosaveName:<str1>", "setFrameFromString:<str1>", "setFrameUsingName:<str1>", "setIMPortName:<str1>", "setIcon:<str1>", "setIcon:<str1>at::", "setIcon:<str1>position:", "setKeyEquivalentFont:<str1>size:", "setLanguage:<str1>", "setMiniwindowIcon:<str1>", "setMiniwindowTitle:<str1>", "setName:<str1>", "setOutputFile:<str1>", "setPaperFeed:<str1>", "setPaperType:<str1>andAdjust:", "setPath:<str1>", "setPrompt:<str1>", "setRequiredFileType:<str1>", "setSelFontFamily:<str1>", "setStringValue:<str1>", "setStringValueNoCopy:<str1>", "setStringValueNoCopy:<str1>shouldFree:", "setStringValue:<str1>at:", "setText:<str1>", "setTitle:<str1>", "setTitle:<str1>at:", "setTitle:<str1>at::", "setTitle:<str1>ofColumn:", "setTitleAsFilename:<str1>", "setTitleNoCopy:<str1>", "setWordFieldValue:<str1>", "spellServer:findMisspelledWord:length:inLanguage:<str1>inTextStream:startingAt:wordCount:countOnly:", "spoolFile:<str1>", "statusForTable:<str1>", "typesFilterableTo:<str1>", "unmountAndEjectDeviceAt:<str1>", "unmounted:<str1>", "unmounting:<str1>ok:", "useFont:<str1>", "useFromFile:<str1>", "useFromSection:<str1>", "writeFileContents:<str1>", "writeToFile:<str1>", "writeType:<str1>data:length:", "writeType:<str1>fromStream:" } replacemethod "setTitleNoCopy:" with "setTitle:" replacemethod "setStringValueNoCopy:" with "setStringValue:" replacemethod "setStringValueNoCopy:shouldFree:" with "setStringValue:" /*********** StringConversion: Two parameters converted ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" replace "<str2_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str2_arg>]" replace "<str2_type>" with "(NSString *)" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" replace "<str2_param>" with "[<str2_param> cString]" } where "<sel>" isOneOf { "addSupplement:<str1>inPath:<str2>", "app:openFile:<str1>type:<str2>", "app:openFileWithoutUI:<str1>type:<str2>", "app:openTempFile:<str1>type:<str2>", /*+*/ "attachHelpFile:<str1>markerName:<str2>to:", "beginPage:label:<str1>bBox:fonts:<str2>", "booleanForKey:<str1>inTable:<str2>", "dataForKey:<str1>inTable:<str2>length:", "findString:<str1>inFile:<str2>", "floatForKey:<str1>inTable:<str2>", "getInfoForFile:<str1>application:<str2>type:", "initWithName:<str1>fromFile:<str2>", "intForKey:<str1>inTable:<str2>", "initFrame:icon:<str1>tag:target:action:key:<str2>enabled:", "initFrame:title:<str1>tag:target:action:key:<str2>enabled:", "isKey:<str1>inTable:<str2>", /*+*/ "newForName:<str1>host:<str2>", "openFile:<str1>withApplication:<str2>", "openFile:<str2>withApplication:<str2>andDeactivate:", "panel:compareFilenames:<str1>:<str2>checkCase:", "panel:filterFile:<str1>inDirectory:<str2>", "readFileContentsType:<str1>toFile:<str2>", "rectForKey:<str1>inTable:<str2>", "registerLanguage:<str1>byVendor:<str2>", "renewFont:<str1>size:style:text:<str2>:frame:tag:", "runModalForDirectory:<str1>file:<str2>", "runModalForDirectory:<str1>file:<str2>types:", "selectFile:<str1>inFileViewerRootedAt:<str2>", "setJobFeature:<str1>toValue:<str2>", "showFile:<str1>atMarker:<str2>", "sizeForKey:<str1>inTable:<str2>", "spellServer:didForgetWord:<str1>inLanguage:<str2>", "spellServer:didLearnWord:<str1>inLanguage:<str2>", "spellServer:suggestGuessesForWord:<str1>inLanguage:<str2>", "stringListForKey:<str1>inTable:<str2>" } /*********** StringConversion: Three parameters converted ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" replace "<str2_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str2_arg>]" replace "<str2_type>" with "(NSString *)" replace "<str3_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str3_arg>]" replace "<str3_type>" with "(NSString *)" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" replace "<str2_param>" with "[<str2_param> cString]" } where "<sel>" isOneOf { /*+*/ "newForName:<str1>host:<str2>domain:<str3>includeUnavailable:" } /*********** StringConversion: Five parameters converted ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" replace "<str2_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str2_arg>]" replace "<str2_type>" with "(NSString *)" replace "<str3_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str3_arg>]" replace "<str3_type>" with "(NSString *)" replace "<str4_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str4_arg>]" replace "<str4_type>" with "(NSString *)" replace "<str5_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str5_arg>]" replace "<str5_type>" with "(NSString *)" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" replace "<str2_param>" with "[<str2_param> cString]" replace "<str3_param>" with "[<str3_param> cString]" replace "<str4_param>" with "[<str4_param> cString]" replace "<str5_param>" with "[<str5_param> cString]" } where "<sel>" isOneOf { "performFileOperation:<str1>source:<str2>destination:<str3>files:<str4>options:<str5>" "beginPrologueBBox:creationDate:<str1>createdBy:<str2>fonts:<str3>forWhom:<str4>pages:title:<str5>" } /*********** StringConversion: One paremeter converted; return type converted ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" replace "<rettype>" with "(NSString *)" replace "<call>" with "[<call> cString]" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" replace "return <returnval>;" with "return [NSString stringWithCString:<returnval>];" } where "<sel>" isOneOf { "getFullPathForApplication:<str1>", "localizedNameForColorNamed:<str1>", "localizedNameForTIFFCompressionType:<str1>", "valueForJobFeature:<str1>" } /*********** StringConversion: One paremeter converted then returned ***********/ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSString *)" replace "<call>" with "<str1_arg> = [<call> cString]" replace "<implementation>" with " NSString *<str1_param>; <implementation>" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" replace "return <returnval>;" with "return [NSString stringWithCString:<returnval>];" } where ("<old>", "<new>") isOneOf { ("getPath:<str1>toColumn:<col>", "pathToColumn:<col>"), ("saveFrameToString:<str1>", "stringWithSavedFrame") } /*********** StringConversion: Two paremeters converted; return type converted ***********/ replacemethod "stringForKey:<str1> inTable:<str2>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" replace "<str2_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str2_arg>]" replace "<str2_type>" with "(NSString *)" replace "<rettype>" with "(NSString *)" replace "<call>" with "[<call> cString]" } within ("<implementation>") { replace "<str1_param>" with "[<str1_param> cString]" replace "<str2_param>" with "[<str2_param> cString]" replace "return <returnval>;" with "return [NSString stringWithCString:<returnval>];" } /*********** StringConversion: Return type converted ***********/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSString *)" replace "<call>" with "[<call> cString]" } within ("<implementation>") { replace "return <returnval>;" with "return [NSString stringWithCString:<returnval>];" } where "<sel>" isOneOf { "altIcon", "altTitle", "appListenerPortName", "appName", "browser:titleOfColumn:", "destinationAppName", "destinationFilename", "directory", "displayName", "domain", "familyName", "filename", "findAvailableTypeFrom:num:", "frameAutosaveName", "host", "hostName", "icon", "imCurrentInputMode", "imName", "imPortName", "imReturnSTR", "imVersion", "language", "miniwindowIcon", "miniwindowTitle", "name", "nameOfColorAt:", "note", "outputFile", "paperFeed", "paperType", "portName", "readFileContentsType:toFile:" "requiredFileType", "selectedItem", "sourceAppName", "sourceFilename", "stringValue", "stringValueAt:", "title", "titleAt:", "titleOfColumn:", } /*********** StringConversion: unsigned short to NSString ***********/ replace "[<rec> setKeyEquivalent:0]" with "[<rec> CONVERTsetKeyEquivalent:@\"\"]" replacemethod "<sel>" with same error "StringConversion: key equivalents are now instances of NSString. Change your C string variable to an NSString." where "<sel>" isOneOf { "keyEquivalent" "setKeyEquivalent:" "addItem:action:keyEquivalent:" "userKeyEquivalent" } replace "CONVERTsetKeyEquivalent" with "setKeyEquivalent" replacemethod "setPathSeparator:" with same error "StringConversion: NSBrowser (NXBrowser) now takes an instance of NSString for path separator. Change your C string variable to an NSString." /*********** StringConversion: functions ***********/ replace "NXLocalString" with "NXLocalizedString" replace "NXLocalStringFromTable" with "NXLocalizedStringFromTable" replace "NXLocalStringFromTableInBundle" with "NXLocalizedStringFromTableInBundle" replace "NXLoadLocalStringFromTableInBundle" with "NXLoadLocalizedStringFromTableInBundle" replace "NXColorListName(<b color>)" with "[NXColorListName(<b color>) cString]" replace "NXColorName(<b color>)" with "[NXColorList(<b color>) cString]" replace "NXSetServicesMenuItemEnabled(<b item>, <b rest>)" with "NXSetServicesMenuItemEnabled([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString<b item>], <b rest>)" replace "NXIsServicesMenuItemEnabled(<b item>)" with "NXIsServicesMenuItemEnabled([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString<b item>])" replace "NXRunAlertPanel(<title>, <msg>, <default>, <alt>, <other>, <b rest>)" with "NXRunAlertPanel([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<title>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<msg>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<default>], [NSString stringWithCString:<alt>], [NSString stringWithCString:<other>], <b rest>)" replace "NXRunLocalizedAlertPanel(<table>, <title>, <msg>, <default>, <alt>, <other>, <b rest>)" with "NXRunLocalizedAlertPanel([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<table>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<title>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<msg>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<default>], [NSString stringWithCString:<alt>], [NSString stringWithCString:<other>], <b rest>)" replace "NXGetAlertPanel(<table>, <title>, <msg>, <default>, <alt>, <other>, <b rest>)" with "NXGetAlertPanel([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<title>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<msg>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<default>], [NSString stringWithCString:<alt>], [NSString stringWithCString:<other>], <b rest>)" replace "NXRunAlertPanel(<title>, <msg>, <default>, <alt>, <other>)" with "NXRunAlertPanel([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<title>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<msg>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<default>], [NSString stringWithCString:<alt>], [NSString stringWithCString:<other>])" replace "NXRunLocalizedAlertPanel(<table>, <title>, <msg>, <default>, <alt>, <other>)" with "NXRunLocalizedAlertPanel([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<table>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<title>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<msg>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<default>], [NSString stringWithCString:<alt>], [NSString stringWithCString:<other>])" replace "NXGetAlertPanel(<table>, <title>, <msg>, <default>, <alt>, <other>)" with "NXGetAlertPanel([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<title>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<msg>], [NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<default>], [NSString stringWithCString:<alt>], [NSString stringWithCString:<other>])" replace "NXPerformService(<service>, <b rest>)" with "NXPerformService([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<service>], <b rest>)" replace "NXLogError(<error>)" with "NXLogError([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<error>])" replace "NXLogError(<error>, <b args>)" with "NXLogError([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<error>], <b args>)" replace "NXHomeDirectory()" with "[NXHomeDirectory() cString]" replace "NXUserName()" with "[NXUserName() cString]" replace "NXLocalizedString(<key>, NULL, <any comment>)" with "[NSLocalizedString([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], <comment>) cString]" replace "NXLocalizedStringFromTable(<table>, <key>, NULL, <any comment>)" with "[NSLocalizedStringFromTable([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], [NSString stringWithCString:<table>], <comment>) cString]" replace "NXLocalizedStringFromTableInBundle(<table>, <bundle>, <key>, NULL, <any comment>)" with "[NSLocalizedStringFromTableInBundle([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], [NSString stringWithCString:<table>], <bundle>, <comment>) cString]" replace "NXLoadLocalizedStringFromTableInBundle(<table>, <bundle>, <key>, NULL)" with "[NSLocalizedStringFromTableInBundle([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], [NSString stringWithCString:<table>], <bundle>, <comment>) cString]" replace "NXLocalizedString(<key>, <key>, <any comment>)" with "[NSLocalizedString([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], <comment>) cString]" replace "NXLocalizedStringFromTable(<table>, <key>, <key>, <any comment>)" with "[NSLocalizedStringFromTable([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], [NSString stringWithCString:<table>], <comment>) cString]" replace "NXLocalizedStringFromTableInBundle(<table>, <bundle>, <key>, <key>, <any comment>)" with "[NSLocalizedStringFromTableInBundle([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], [NSString stringWithCString:<table>], <bundle>, <comment>) cString]" replace "NXLoadLocalizedStringFromTableInBundle(<table>, <bundle>, <key>, <key>)" with "[NSLocalizedStringFromTableInBundle([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>], [NSString stringWithCString:<table>], <bundle>, <comment>) cString]" replace "NXLocalizedString(<key>, <value>, <any comment>)" with "[[[NSBundle mainBundle] localizedStringForKey:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>] value:[NSString stringWithCString:<value>] table:nil] cString]" replace "NXLocalizedStringFromTable(<table>, <key>, <value>, <any comment>)" with "[[[NSBundle mainBundle] localizedStringForKey:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>] value:[NSString stringWithCString:<value>] table:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<table>]] cString]" replace "NXLocalizedStringFromTableInBundle(<table>, <bundle>, <key>, <value>, <any comment>)" with "[[<bundle> localizedStringForKey:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>] value:[NSString stringWithCString:<value>] table:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<table>]] cString]" replace "NXLoadLocalizedStringFromTableInBundle(<table>, <bundle>, <key>, <value>)" with "[[<bundle> localizedStringForKey:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<key>] value:[NSString stringWithCString:<value>] table:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<table>]] cString]" replace "NXFindPaperSize(<papername>)" with "NXFindPaperSize([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<papername>])" replace "NXCreateFilenamePboardType(<type>)" with "[NXCreateFilenamePboardType([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>]) cString]" replace "NXCreateFileContentsPboardType(<type>)" with "[NXCreateFileContentsPboardType([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>]) cString]" replace "NXGetFileType(<type>)" with "[NXGetFileType([NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>]) cString]" replace "NXGetFileTypes(<types>)" with same error "StringConversion: NXGetFileTypes() (will be NSGetfileTypes()) receives and returns an NSArray of NSStrings (used to receive and return null terminated const char **); return value is autoreleased. Change your variable declaration." replace "NXPortFromName(<portName>, <hostName>)" with "NXPortFromName([NSString stringWithCString:<portName>], [NSString stringWithCString:<hostName>])" replace "NXPortNameLookup(<portName>, <hostName>)" with "NXPortNameLookup([NSString stringWithCString:<portName>], [NSString stringWithCString:<hostName>])" /*********** StringConversion: ObjC selector to/from name functions ***********/ replace "SELNAME" with "sel_getName" replace "SELUID" with "sel_getUid" replace "sel_getName(<arg>)" with "NSStringFromSelector(<arg>)" warning "StringConversion: NSStringFromSelector return value is an NSString; use [ cString] if needed, otherwise change the target type to an NSString." replace "sel_getUid(<s arg>)" with "NSSelectorFromString(@<arg>)" replace "sel_getUid(<arg>)" with "NSSelectorFromString([NSString stringWithCString:<arg>])" warning "StringConversion: check argument type for NSSelectorFromString()." /*********** StringConversion: NXBundle methods (assuming no subclass) ***********/ replace "<t var> = [<rec> getPath:<path> forResource:<resource> ofType:<type> inDirectory:<directory> withVersion:<version>]" with "<t var> = ((<path> = [<rec> pathForResource:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<resource>] ofType:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>] inDirectory:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<directory>] withVersion:<version>]) != nil)" error "StringConversion: This call to +[NXBundle getPath:forResource:ofType:inDirectory:withVersion:] has been converted to the similar NSBundle method. The conversion has been made assuming that the variable called <path> will be changed into an (NSString *). You must change the type of the variable called <path> by hand." replace "<t var> = [<rec> getPath:<path> forResource:<resource> ofType:<type>]" with "<t var> = ((<path> = [<rec> pathForResource:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<resource>] ofType:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>]]) != nil)" error "StringConversion: This call to -[NXBundle getPath:forResource:ofType:] has been converted to the similar NSBundle method. The conversion has been made assuming that the variable called <path> will be changed into an (NSString *). You must change the type of the variable called <path> by hand." replace "![<rec> getPath:<path> forResource:<resource> ofType:<type> inDirectory:<directory> withVersion:<version>]" with "((<path> = [<rec> pathForResource:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<resource>] ofType:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>] inDirectory:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<directory>] withVersion:<version>]) == nil)" error "StringConversion: This call to +[NXBundle getPath:forResource:ofType:inDirectory:withVersion:] has been converted to the similar NSBundle method. The conversion has been made assuming that the variable called <path> will be changed into an (NSString *). You must change the type of the variable called <path> by hand." replace "![<rec> getPath:<path> forResource:<resource> ofType:<type>]" with "((<path> = [<rec> pathForResource:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<resource>] ofType:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>]]) == nil)" error "StringConversion: This call to -[NXBundle getPath:forResource:ofType:] has been converted to the similar NSBundle method. The conversion has been made assuming that the variable called <path> will be changed into an (NSString *). You must change the type of the variable called <path> by hand." replace "[<rec> getPath:<path> forResource:<resource> ofType:<type> inDirectory:<directory> withVersion:<version>]" with "<path> = [<rec> pathForResource:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<resource>] ofType:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>] inDirectory:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<directory>] withVersion:<version>]" error "StringConversion: This call to +[NXBundle getPath:forResource:ofType:inDirectory:withVersion:] has been converted to the similar NSBundle method. The conversion has been made assuming that the variable called <path> will be changed into an (NSString *). You must change the type of the variable called <path> by hand." replace "[<rec> getPath:<path> forResource:<resource> ofType:<type>]" with "<path> = [<rec> pathForResource:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<resource>] ofType:[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<type>]]" error "StringConversion: This call to -[NXBundle getPath:forResource:ofType:] has been converted to the similar NSBundle method. The conversion has been made assuming that the variable called <path> will be changed into an (NSString *). You must change the type of the variable called <path> by hand." /*********** StringConversion: char * globals ***********/ replace "NXSystemDomainName" with "[NXSystemDomainName cString]" replace "NX_WORKSPACEREQUEST" with "[NX_WORKSPACEREQUEST cString]" replace "NX_WORKSPACEREPLY" with "[NX_WORKSPACEREPLY cString]" /*********** StringConversion: convert one NULL-terminated char ** param to NSArray of NSString ***********/ replace "[<rec> <old>]" with "[<rec> <new>]" where ("<old>", "<new>") isOneOf { ("registerForDraggedTypes:<type> count:1", "CONVERTregisterForDraggedTypes:[NSArray arrayWithObject:[NSString stringWithCString:*<type>]]"), ("initLinkedToSourceSelection:<sel> managedBy:<by> supportingTypes:<type> count:1", "CONVERTinitLinkedToSourceSelection:<sel> managedBy:<by> supportingTypes:[NSArray arrayWithObject:[NSString stringWithCString:*<type>]]"), ("declareTypes:<type> num:1 owner:<owner>", "CONVERTdeclareTypes:[NSArray arrayWithObject:[NSString stringWithCString:*<type>]] owner:<owner>"), ("addTypes:<type> num:1 owner:<owner>", "CONVERTaddTypes:[NSArray arrayWithObject:[NSString stringWithCString:*<type>]] owner:<owner>"), ("findAvailableTypeFrom:<type> num:1", "CONVERTfindAvailableTypeFrom:[NSArray arrayWithObject:[NSString stringWithCString:*<type>]]") } replace "*&" with "" replacemethod "initLinkedToSourceSelection:managedBy:supportingTypes:<str1>count:<count>" with "initLinkedToSourceSelection:managedBy:supportingTypes:<str1>" { replace "<str1_type>" with "(NSArray *)" } within ("<implementation>") { replace "<count_param>" with "[<str1_param> count]" } error "StringConversion: 'supportingTypes' in 'initLinkedToSourceSelection:managedBy:supportingTypes:' (used to be 'initLinkedToSourceSelection:managedBy:supportingTypes:count:') is now an NSArray of NSString (used to use char**). Change your variable declaration." replacemethod "<old>" with "<new>" { replace "<str1_type>" with "(NSArray *)" } error "StringConversion: <typeTypes> are now stored in an NSArray of NSStrings (used to use char**). Change your variable declaration." within ("<implementation>") { replace "<num_param>" with "[<str1_param> count]" } where ("<old>", "<new>" , "<typeTypes>") isOneOf { ("declareTypes:<str1> num:<num>owner:<owner>", "declareTypes:<str1> owner:<owner>", "Pasteboard types"), ("addTypes:<str1>num:<num>owner:<owner>", "addTypes:<str1>owner:<owner>", "Pasteboard types"), ("findAvailableTypeFrom:<str1>num:<num>", "availableTypeFromArray:<str1>", "Pasteboard types"), } replacemethod "<old>" with "<new>" { replace "<str1_type>" with "(NSArray *)" } error "StringConversion: <typeTypes> are now stored in an NSArray of NSStrings (used to use char**). Change your variable declaration." where ("<old>", "<new>" , "<typeTypes>") isOneOf { ("runModalForDirectory:file:types:<str1>", "runModalForDirectory:file:types:<str1>", "Open panel types"), ("runModalForTypes:<str1>", "runModalForTypes:<str1>", "Open panel types"), } replace "CONVERTregisterForDraggedTypes" with "registerForDraggedTypes" replace "CONVERTinitLinkedToSourceSelection" with "initLinkedToSourceSelection" replace "CONVERTdeclareTypes" with "declareTypes" replace "CONVERTaddTypes" with "addTypes" replace "CONVERTfindAvailableTypeFrom" with "availableTypeFromArray" /*********** StringConversion: convert two NULL-terminated char ** params to NSArray of NSString ***********/ replacemethod "<sel>" with same { replace "<str1_type>" with "(NSArray *)" replace "<str2_type>" with "(NSArray *)" } error "StringConversion: Services types are now stored in an NSArray of NSStrings (used to use NULL-terminated char**). Change your variable declaration." where "<sel>" isOneOf { "registerServicesMenuSendTypes:<str1>andReturnTypes:<str2>" } /*********** StringConversion: convert one (non NULL-terminated) char ** param to NSArray of NSString ***********/ replacemethod "<old>" with "<new>" { replace "<str1_type>" with "(NSArray *)" replace "<str2_type>" with "(NSArray *)" } error "StringConversion: Dragged types are now stored in an NSArray of NSStrings (used to use char **). Change your variable declaration." where ("<old>", "<new>") isOneOf { ("registerForDraggedTypes:<str1>count:", "registerForDraggedTypes:<str1>") } /*********** StringConversion: convert return type from char ** param to NSArray of NSString ***********/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSArray *)" } error "StringConversion: <sel> now returns an NSArray of NSStrings (used to return a NULL terminated array of char * strings). Change your variable declaration." where "<sel>" isOneOf { "imageUnfilteredFileTypes", "imageUnfilteredFileTypes", "imageFileTypes", "filenames", /* too generic ??? */ "stringListForKey:inTable:", "printerTypes:custom:" } replacemethod "<old>" with "<new>" { replace "<rettype>" with "(NSArray *)" replace "<call>" with "<str1_arg> = <call>" } error "StringConversion: <new> (used to be <old>) now returns an NSArray of NSStrings (used to return BOOL and take char ** as an argument). Change your variable declaration." where ("<old>" , "<new>") isOneOf { ("getMountedRemovableMedia:<str1>", "getMountedRemovableMedia:<str1>"), ("mountNewRemovableMedia:<str1>", "mountNewRemovableMedia:<str1>") } /*********** StringConversion: Convert to one param to NSString ** ***********/ replacemethod "<sel>" with same { replace "<str1_type>" with "(NSString **)" } error "StringConversion: the soundfile in <sel> is now an NSString ** (used to be char **)" where "<sel>" isOneOf { } /*********** StringConversion: Convert to two params to NSString ** ***********/ replacemethod "<sel>" with same { replace "<str1_type>" with "(NSString **)" replace "<str2_type>" with "(NSString **)" } where "<sel>" isOneOf { "getInfoForFileSystemAt:isRemovable:isWritable:isUnmountable:description:<str1>type:<str2>" } error "StringConversion: the description and type in <sel> are now an NSString ** (used to be char **). Change your variable declarations." /*********** StringConversion: convert return type from NXAtom to NSString * ***********/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSString *)" replace "<call>" with "(CONVERSIONATOM)([<call> cString])" } within ("<implementation>") { replace "return <returnval>;" with "return [NSString stringWithCString:<returnval>];" } where "<sel>" isOneOf { "helpDirectory", "helpFile" } /*********** StringConversion: convert return type from NXAtom * to NSArray * ***********/ replacemethod "<sel>" with same { replace "<rettype>" with "(NSArray *)" } error "StringCoversion: return type of <sel> is now an NSArray of NSStrings (used to be NXAtom *). Change your variable declaration." where "<sel>" isOneOf { "imageUnfilteredPasteboardTypes", "imagePasteboardTypes", "typesFilterableTo:", "types" /* too generic ??? */ } /*********** StringConversion: convert one param from NXAtom to NSString * ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" } within ("<implementation>") { replace "<str1_param> = NXUniqueString(<exp string>)" with "<str1_param> = [NSString stringWithCString:<exp string>]" replace "<str1_param> = NXUniqueStringNoCpoy(<exp string>, <length>)" with "<str1_param> = [NSString stringWithCString:<exp string> length:<length>]" replace "<str1_param> = NXUniqueString(<exp string>)" with "<str1_param> = [NSString stringWithCString:<exp string>]" replace "<str1_param>" with "(CONVERSIONATOM)(<str1_param>)" } where "<sel>" isOneOf { "imageRepForPasteboardType:<str1>", "pasteboard:provideData:<str1>", } /*********** StringConversion: convert one param from NXAtom * to NSArray * ***********/ replacemethod "<sel>" with same { replace "<str1_type>" with "(NSArray *)" } warning "StringConversion: 'types' in 'writeSelectionToPasteboaed:types' is now an NSArray (used to be NXAtom *). Change your variable declaration." where "<sel>" isOneOf { "writeSelectionToPasteboard:types:<str1>" } /*********** StringConversion: convert one param from NXAtom * to NSString ** ***********/ replacemethod "<sel>" with same { replace "<str1_type>" with "(NSString **)" } error "StringConversion: 'type' in 'getInfoForFile:application:type:' is now an NSString ** (used to be NXAtom *). Change your variable declaration." where "<sel>" isOneOf { "getInfoForFile:application:type:<str1>" } /*********** StringConversion: convert two params from NXAtom to NSString * ***********/ replacemethod "<sel>" with same { replace "<str1_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str1_type>" with "(NSString *)" replace "<str2_arg>" with "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<str1_arg>]" replace "<str2_type>" with "(NSString *)" } within ("<implementation>") { replace "<str1_param> = NXUniqueString(<exp string>)" with "<str1_param> = [NSString stringWithCString:<exp string>]" replace "<str1_param> = NXUniqueStringNoCpoy(<exp string>, <length>)" with "<str1_param> = [NSString stringWithCString:<exp string> length:<length>]" replace "<str1_param> = NXUniqueString(<exp string>)" with "<str1_param> = [NSString stringWithCString:<exp string>]" replace "<str2_param> = NXUniqueString(<exp string>)" with "<str1_param> = [NSString stringWithCString:<exp string>]" replace "<str2_param> = NXUniqueStringNoCpoy(<exp string>, <length>)" with "<str1_param> = [NSString stringWithCString:<exp string> length:<length>]" replace "<str2_param> = NXUniqueString(<exp string>)" with "<str1_param> = [NSString stringWithCString:<exp string>]" replace "<str2_param>" with "(CONVERSIONATOM)(<str2_param>)" replace "<str1_param>" with "(CONVERSIONATOM)(<str1_param>)" } where "<sel>" isOneOf { "validRequestorForSendType:<str1>andReturnType:<str2>" } /*********** StringConversion: NXAtom globals ***********/ replace "NXDataLinkPboardType" with "(CONVERSIONATOM)(NXDataLinkPboardType)" replace "NXDataLinkFilenameExtension" with "(CONVERSIONATOM)(NXDataLinkFilenameExtension)" replace "NXSelectionPboardType" with "(CONVERSIONATOM)(NXSelectionPboardType)" replace "NXAsciiPboardType" with "(CONVERSIONATOM)(NXAsciiPboardType)" replace "NXPostScriptPboardType" with "(CONVERSIONATOM)(NXPostScriptPboardType)" replace "NXTIFFPboardType" with "(CONVERSIONATOM)(NXTIFFPboardType)" replace "NXRTFPboardType" with "(CONVERSIONATOM)(NXRTFPboardType)" replace "NXFilenamePboardType" with "(CONVERSIONATOM)(NXFilenamePboardType)" replace "NXTabularTextPboardType" with "(CONVERSIONATOM)(NXTabularTextPboardType)" replace "NXFontPboardType" with "(CONVERSIONATOM)(NXFontPboardType)" replace "NXRulerPboardType" with "(CONVERSIONATOM)(NXRulerPboardType)" replace "NXFileContentsPboardType" with "(CONVERSIONATOM)(NXFileContentsPboardType)" replace "NXColorPboardType" with "(CONVERSIONATOM)(NXColorPboardType)" replace "NXGeneralPboard" with "(CONVERSIONATOM)(NXGeneralPboard)" replace "NXFontPboard" with "(CONVERSIONATOM)(NXFontPboard)" replace "NXRulerPboard" with "(CONVERSIONATOM)(NXRulerPboard)" replace "NXFindPboard" with "(CONVERSIONATOM)(NXFindPboard)" replace "NXDragPboard" with "(CONVERSIONATOM)(NXDragPboard)" replace "NXPlainFileType" with "(CONVERSIONATOM)(NXPlainFileType)" replace "NXDirectoryFileType" with "(CONVERSIONATOM)(NXDirectoryFileType)" replace "NXApplicationFileType" with "(CONVERSIONATOM)(NXApplicationFileType)" replace "NXFilesystemFileType" with "(CONVERSIONATOM)(NXFilesystemFileType)" replace "NXShellCommandFileType" with "(CONVERSIONATOM)(NXShellCommandFileType)" /*********** StringConversion: NXAtom cleanup ***********/ replace "<null> == (CONVERSIONATOM)(<b atom>)" with "NULL == <b atom>" where "<null>" isOneOf {"NULL", "0"} replace "(CONVERSIONATOM)(<b atom>) == <null>" with "<b atom> == NULL" where "<null>" isOneOf {"NULL", "0"} replace "<null> != (CONVERSIONATOM)(<b atom>)" with "NULL != <b atom>" where "<null>" isOneOf {"NULL", "0"} replace "(CONVERSIONATOM)(<b atom>) != <null>" with "<b atom> != NULL" where "<null>" isOneOf {"NULL", "0"} replace "!(CONVERSIONATOM)(<b atom>)" with "!<b atom>" replace "&& <otheratom> == (CONVERSIONATOM)(<b atom>)" with "&& [[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "&& (CONVERSIONATOM)(<b atom>) == <otheratom>" with "&& [[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "&& <otheratom> != (CONVERSIONATOM)(<b atom>)" with "&& ![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "&& (CONVERSIONATOM)(<b atom>) != <otheratom>" with "&& ![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "|| <otheratom> == (CONVERSIONATOM)(<b atom>)" with "|| [[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "|| (CONVERSIONATOM)(<b atom>) == <otheratom>" with "|| [[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "|| <otheratom> != (CONVERSIONATOM)(<b atom>)" with "|| ![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "|| (CONVERSIONATOM)(<b atom>) != <otheratom>" with "|| ![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "(<otheratom> == (CONVERSIONATOM)(<b atom>) &&" with "([[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] &&" replace "((CONVERSIONATOM)(<b atom>) == <otheratom> &&" with "([[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] &&" replace "(<otheratom> != (CONVERSIONATOM)(<b atom>) &&" with "(![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] &&" replace "((CONVERSIONATOM)(<b atom>) != <otheratom> &&" with "(![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] &&" replace "(<otheratom> == (CONVERSIONATOM)(<b atom>) ||" with "([[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] ||" replace "((CONVERSIONATOM)(<b atom>) == <otheratom> ||" with "([[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] ||" replace "(<otheratom> != (CONVERSIONATOM)(<b atom>) ||" with "(![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] ||" replace "((CONVERSIONATOM)(<b atom>) != <otheratom> ||" with "(![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>] ||" replace "(<otheratom> == (CONVERSIONATOM)(<b atom>)" with "([[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "((CONVERSIONATOM)(<b atom>) == <otheratom>" with "([[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "(<otheratom> != (CONVERSIONATOM)(<b atom>)" with "(![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "((CONVERSIONATOM)(<b atom>) != <otheratom>" with "(![[NSString stringWithCString:<otheratom>] isEqualToString:<b atom>]" replace "(CONVERSIONATOM)(<b atom>)" with "[<b atom> cString]" /*********** StringConversion: ANSI str routines and NXCopyStringBuffer ***********/ /******** NOTE: duplicated in StringConversion2.tops *********/ replace "sprintf([<str1> cString], <format>)" with "<str1> = [NSString stringWithCString:<format>]" replace "sprintf([<str1> cString], <format>, <b args>)" with "<str1> = [NSString stringWithFormat:[NSString stringWithCString:<format>], <b args>]" replace "strcat([<str1> cString], <str2>)" with "<str1> = [<str1> stringByAppendingString:[NSString stringWithCString:<str2>]]" replace "strncat([<str1> cString], <str2>, <len>)" with "<str1> = [<str1> stringByAppendingString:[[NSString stringWithCString:<str2>] substringToIndex:<len> - 1]]" replace "strcmp([<str1> cString], <str2>)" with "strcmp([<str1> cString], [[NSString stringWithCString:<str2>] cString])" replace "strcmp(<str1>, [<str2> cString])" with "strcmp([[NSString stringWithCString:<str1>] cString], [<str2> cString])" replace "strcmp([<str1> cString], [<str2> cString]) == 0" with "[<str1> isEqualToString:<str2>]" replace "!strcmp([<str1> cString], [<str2> cString])" with "[<str1> isEqualToString:<str2>]" replace "!(strcmp([<str1> cString], [<str2> cString]))" with "[<str1> isEqualToString:<str2>]" replace "(strcmp([<str1> cString], [<str2> cString]))" with "(![<str1> isEqualToString:<str2>])" replace "strcmp([<str1> cString], [<str2> cString])" with "[<str1> compare:<str2>]" /* strncmp assumes prefix search */ replace "strncmp([<str1> cString], <str2>, <length>)" with "strcmp([<str1> cString], [[NSString stringWithCString:<str2>] cString], <length>)" replace "strncmp(<str1>, [<str2> cString], <length>)" with "strcmp([[NSString stringWithCString:<str1>] cString], [<str2> cString], <length>)" replace "strncmp([<str1> cString], [<str2> cString], <length>) == 0" with "[<str1> hasPrefix:<str2>]" replace "!strncmp([<str1> cString], [<str2> cString], <length>)" with "[<str1> hasPrefix:<str2>]" replace "!(strncmp([<str1> cString], [<str2> cString], <length>))" with "[<str1> hasPrefix:<str2>]" replace "(strncmp([<str1> cString], [<str2> cString], <length>))" with "(![<str1> hasPrefix:<str2>])" replace "strcasecmp([<str1> cString], <str2>)" with "strcasecmp([<str1> cString], [[NSString stringWithCString:<str2>] cString])" replace "strcasecmp(<str1>, [<str2> cString])" with "strcasecmp([[NSString stringWithCString:<str1>] cString], [<str2> cString])" replace "strcasecmp([<str1> cString], [<str2> cString])" with "[<str1> compare:<str2> options:NSCaseInsensitiveSearch]" /* strncasecmp assumes prefix search */ replace "strncasecmp([<str1> cString], <str2>, <length>)" with "strncasecmp([<str1> cString], [[NSString stringWithCString:<str2>] cString], <length>)" replace "strncasecmp(<str1>, [<str2> cString], <length>)" with "strncasecmp([[NSString stringWithCString:<str1>] cString], [<str2> cString], <length>)" replace "strncasecmp([<str1> cString], [<str2> cString], <length>)" with "[<str1> compare:<str2> options:NSCaseInsensitiveSearch range:NSMakeRange(0, <length>)]" replace "strlen([<str1> cString]) == 0" with "[<str1> isEqualToString:@\"\"]" replace "!strlen([<str1> cString])" with "[<str1> isEqualToString:@\"\"]" replace "strlen([<str1> cString])" with "[<str1> length]" replace "strcpy([<str1> cString], [<str2> cString])" with "<str1> = <str2>" warning "StringConversion: This assignment of NSStrings used to be a strcpy(). With NStrings this is usually what you want because they are immutable. However, you may need to replace <str2> with [<str2> copy] or [[<str2> copy] autorelease]." replace "strcpy([<str1> cString], <str2>)" with "<str1> = [NSString stringWithCString:<str2>]" replace "strncpy([<str1> cString], <str2>, <length>)" with "<str1> = [[NSString stringWithCString:<str2>] substringToIndex:<length> - 1]" replace "[<str1> cString] = NXCopyStringBuffer([<str2> cString])" with "<str1> = [<str2> copy]" replace "[<str1> cString] = NXCopyStringBufferFromZone([<str2> cString], <zone>)" with "<str1> = [<str2> copyWithZone:<zone>]" /*********** StringConversion: boolean expressions ***********/ /******** NOTE: duplicated in StringConversion2.tops *********/ /* some of these might not remain valid for deep conversions */ replace "if ([<str1> cString])" with "if (<str1>)" replace "([<str1> cString] &&" with "(<str1> &&" replace "([<str1> cString] ||" with "(<str1> ||" replace "&& [<str1> cString]" with "&& <str1>" replace "|| [<str1> cString]" with "|| <str1>" replace "![<str1> cString]" with "!<str1>" replace "!*[<str1> cString]" with "[<str1> isEqualToString:@\"\"]" replace "*[<str1> cString] == '\0'" with "[<str1> isEqualToString:@\"\"]" replace "*[<str1> cString] != '\0'" with "![<str1> isEqualToString:@\"\"]" replace "*[<str1> cString] == 0" with "[<str1> isEqualToString:@\"\"]" replace "*[<str1> cString] != 0" with "![<str1> isEqualToString:@\"\"]" replace "&& *[<str1> cString]" with "&& ![<str1> isEqualToString:@\"\"]" replace "|| *[<str1> cString]" with "|| ![<str1> isEqualToString:@\"\"]" replace "if (*[<str1> cString]" with "if(![<str1> isEqualToString:@\"\"]" replace "![<str1> isEqualToString:@\"\"] && ![<str1> isEqualToString:@\"\"]" with "![<str1> isEqualToString:@\"\"]" replace "![<str1> isEqualToString:@\"\"] || ![<str1> isEqualToString:@\"\"]" with "![<str1> isEqualToString:@\"\"]" replace "[<str1> isEqualToString:@\"\"] && [<str1> isEqualToString:@\"\"]" with "![<str1> isEqualToString:@\"\"]" replace "[<str1> isEqualToString:@\"\"] || [<str1> isEqualToString:@\"\"]" with "![<str1> isEqualToString:@\"\"]" /*********** StringConversion: Clean up null strings ***********/ replace "[NSString stringWithCString:<null>]" with "nil" where "<null>" isOneOf { "NULL", "nil", "0" } replace "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<null>]" with "@\"\"" where "<null>" isOneOf { "NULL", "nil", "0" } replace "[NSString CONVERSION_NULL_TO_EMPTY_stringWithCString:<arg>]" with "[NSString stringWithCString:<arg>]" replace "[<null> cString]" with "nil" where "<null>" isOneOf { "NULL", "nil", "0" } /*********** StringConversion: shouldn't have happened ***********/ replace ".[<aString> cString]" with ".<aString>" replace ".[NSString stringWithCString:<aString>]" with ".<aString>" replace "->[<aString> cString]" with "-><aString>" replace "->[NSString stringWithCString:<aString>]" with "-><aString>" /*********** StringConversion: cleanup ***********/ /******** NOTE: duplicated in StringConversion.tops *********/ replace "[NSString stringWithCString:<boolexp> ? <iftrue> : <iffalse>]" with "<boolexp> ? [NSString stringWithCString:<iftrue>] : [NSString stringWithCString:<iffalse>]" /* ??? */ replace "[<aString> cString] ?" with "<aString> ?" replace "[<aString> cString] = <anotherString>;" with "<aString> = [NSString stringWithCString:<anotherString>];" replace "[NSString stringWithCString:[NSString stringWithCString:<aString>]]" with "[NSString stringWithCString:<aString>]" replace "[[NSString stringWithCString:<aString>] cString]" with "<aString>" replace "[[<aString> cString] cString]" with "[<aString> cString]" replace "[NSString stringWithCString:[<aString> cString]]" with "<aString>" replace "[NSString stringWithCString:(char *)[<aString> cString]]" with "<aString>" replace "[NSString stringWithCString:(const char *)[<aString> cString]]" with "<aString>" replace "[NSString stringWithCString:@<string stringconst>]" with "@<string stringconst>" replace "[NSString stringWithCString:<string stringconst>]" with "@<string stringconst>" replace "[@<string stringconst> cString]" with "<string stringconst>" replace "[<aString> cString][0] = '\0'" with "<aString> = @\"\"" replace "*[<aString> cString] = '\0'" with "<aString> = @\"\"" replace "extern NXAtom [<aString> cString]" with "extern NSString *<aString>" replace "extern NSString *[<aString> cString]" with "extern NSString *<aString>" replace "extern char *[<aString> cString]" with "extern NSString *<aString>" replace "extern const char *[<aString> cString]" with "extern NSString *<aString>" replace "free([<aString> cString])" with "[<aString> release]" replace "@<string str1><w w><string str2>" with "@<string str1><w w>@<string str2>" /*********** StringConversion: more cleanup ***********/ replace "[sender cString]" with "sender" replace "(NSString *)sender" with "(id)sender" /*********** StringConversion: No nil strings ***********/ replace "[<obj> runModalForDirectory:<dir> file:<NULL>]" with "[<obj> runModalForDirectory:<dir> file:@\"\"]" where "<null>" isOneOf { "NULL", "nil", "0" } replace "[<obj> runModalForDirectory:<NULL> file:<file>]" with "[<obj> runModalForDirectory:@\"\" file:<file>]" where "<null>" isOneOf { "NULL", "nil", "0" } replace "[<obj> runModalForDirectory:<NULL1> file:<NULL2>]" with "[<obj> runModalForDirectory:@\"\" file:@\"\"]" where ("<NULL1>", "<NULL2>") isOneOf { ("NULL", "NULL"), ("nil", "nil"), ("0", "0") } /*********** Catch potential error cases ***********/ replace "[nil isEqual:<e exp>]" with same warning "StringConversion: 'nil' receiver in isEqual:." replace "[nil isEqualToString:<e exp>]" with same warning "StringConversion: 'nil' receiver in isEqualToString:." replace "[<e exp> isEqual:nil]" with same warning "StringConversion: 'nil' argument to isEqual:." replace "[<e exp> isEqualToString:nil]" with same warning "StringConversion: 'nil' argument to isEqualToString:." /*********** StringConversion: replace residence of NXCType.h file ***********/ replace "appkit/NXCType.h" with "objc/NXCType.h"