if (checkMacFileType) { nsCOMPtr<nsILocalFileMac> macFile(do_QueryInterface(dirEntry)); if (!macFile) continue; OSType type, creator; rv = macFile->GetFileType(&type); if (NS_FAILED(rv) || type != 'issp') continue; rv = macFile->GetFileCreator(&creator); if (NS_FAILED(rv) || creator != 'fndf') continue; }
if (checkMacFileType == PR_TRUE) { CInfoPBRec	cInfo; OSErr		err;  err = fileSpec.GetCatInfo(cInfo); if ((err) || (cInfo.hFileInfo.ioFlFndrInfo.fdType != 'issp') || (cInfo.hFileInfo.ioFlFndrInfo.fdCreator != 'fndf')) continue; }
InternetSearchDataSource::GetSearchEngineList(nsIFile *searchDir,              PRBool isSystemSearchFile, PRBool checkMacFileType){        nsresult			rv = NS_OK;    if (!mInner)    {    	return(NS_RDF_NO_VALUE);    }    PRBool hasMore = PR_FALSE;    nsCOMPtr<nsISimpleEnumerator> dirIterator;    rv = searchDir->GetDirectoryEntries(getter_AddRefs(dirIterator));    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIFile> dirEntry;	while ((rv = dirIterator->HasMoreElements(&hasMore)) == NS_OK && hasMore)	{		rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(dirEntry));        if (NS_FAILED(rv))          continue;        // Ignore hidden files/directories        PRBool isHidden;        rv = dirEntry->IsHidden(&isHidden);        if (NS_FAILED(rv) || isHidden)          continue;        PRBool isDirectory;        rv = dirEntry->IsDirectory(&isDirectory);        if (NS_FAILED(rv))          continue;        if (isDirectory)        {          GetSearchEngineList(dirEntry, isSystemSearchFile, checkMacFileType);          continue;        }        // Skip over empty files        // Note: use GetFileSize even on Mac [instead of GetFileSizeWithResFork()]        // as we want the size of ONLY the data fork        PRInt64 fileSize;        rv = dirEntry->GetFileSize(&fileSize);        if (NS_FAILED(rv) || (fileSize == 0))            continue;            nsAutoString uri;        rv = dirEntry->GetPath(uri);        if (NS_FAILED(rv))        continue;		PRInt32		len = uri.Length();		if (len < 5)		{			continue;		}#ifdef	XP_MAC    if (checkMacFileType)		{            nsCOMPtr<nsILocalFileMac> macFile(do_QueryInterface(dirEntry));            if (!macFile)                continue;            OSType type, creator;            rv = macFile->GetFileType(&type);            if (NS_FAILED(rv) || type != 'issp')                continue;            rv = macFile->GetFileCreator(&creator);     // Do we really care about creator?              if (NS_FAILED(rv) || creator != 'fndf')                continue;  		}#endif		// check the extension (must be ".src")		nsAutoString	extension;		if ((uri.Right(extension, 4) != 4) || (!extension.LowerCaseEqualsLiteral(".src")))		{			continue;		}		// check for various icons		PRBool		foundIconFlag = PR_FALSE;		nsAutoString	temp;				nsCOMPtr<nsILocalFile> iconFile, loopFile;                static const char *extensions[] = {                        ".gif",                        ".jpg",                        ".jpeg",                        ".png",                        nsnull,                };                for (int ext_count = 0; extensions[ext_count] != nsnull; ext_count++) {                        temp = Substring(uri, 0, uri.Length()-4);                        temp.Append(NS_ConvertASCIItoUCS2(extensions[ext_count]));                        rv = NS_NewLocalFile(temp, PR_TRUE, getter_AddRefs(loopFile));                        if (NS_FAILED(rv)) return rv;                        rv = loopFile->Exists(&foundIconFlag);                        if (NS_FAILED(rv)) return rv;                        if (!foundIconFlag) continue;                        rv = loopFile->IsFile(&foundIconFlag);                        if (NS_FAILED(rv)) return rv;                        if (foundIconFlag)                         {                                iconFile = loopFile;                                break;                        }                 }				SaveEngineInfoIntoGraph(dirEntry, iconFile, nsnull, nsnull, isSystemSearchFile, checkMacFileType);	}#ifdef MOZ_PHOENIX    if (!gReorderedEngineList)      ReorderEngineList();#endif	return(rv);}