nsFileSpec	engineSpec(baseFilename); rv = ReadFileContents(engineSpec, data);
nsFileSpec	engineSpec(baseFilename); nsString	data; rv = ReadFileContents(engineSpec, data);
InternetSearchDataSource::FindData(nsIRDFResource *engine, nsString &data){	data.Truncate();	if (!engine)	return(NS_ERROR_NULL_POINTER);	if (!mInner)	return(NS_RDF_NO_VALUE);	nsresult		rv;	nsCOMPtr<nsIRDFNode>	dataTarget = nsnull;	if (NS_SUCCEEDED((rv = mInner->GetTarget(engine, kNC_Data, PR_TRUE,		getter_AddRefs(dataTarget)))) && (dataTarget))	{		nsCOMPtr<nsIRDFLiteral>	dataLiteral = do_QueryInterface(dataTarget);		if (!dataLiteral)			return(rv);		const PRUnichar	*dataUni;		if (NS_FAILED(rv = dataLiteral->GetValueConst(&dataUni)))			return(rv);		data = dataUni;	}	else	{		const char	*engineURI = nsnull;		if (NS_FAILED(rv = engine->GetValueConst(&engineURI)))			return(rv);		nsAutoString	engineStr; engineStr.AssignWithConversion(engineURI);		if (engineStr.Find(kEngineProtocol) != 0)			return(rv);		engineStr.Cut(0, sizeof(kEngineProtocol) - 1);		char	*baseFilename = engineStr.ToNewCString();		if (!baseFilename)			return(rv);		baseFilename = nsUnescape(baseFilename);		if (!baseFilename)			return(rv);#ifdef	DEBUG_SEARCH_OUTPUT		printf("InternetSearchDataSource::FindData - reading in '%s'\n", baseFilename);#endif		nsFileSpec	engineSpec(baseFilename);		rv = ReadFileContents(engineSpec, data);		nsCRT::free(baseFilename);		baseFilename = nsnull;		if (NS_FAILED(rv))		{			return(rv);		}		// save file contents		nsCOMPtr<nsIRDFLiteral>	dataLiteral;		if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(data.GetUnicode(), getter_AddRefs(dataLiteral))))		{			if (mInner)			{				mInner->Assert(engine, kNC_Data, dataLiteral, PR_TRUE);			}		}		// save name of search engine (as specified in file)		nsAutoString	nameValue;		if (NS_SUCCEEDED(rv = GetData(data, "search", 0, "name", nameValue)))		{			nsCOMPtr<nsIRDFLiteral>	nameLiteral;			if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(nameValue.GetUnicode(),					getter_AddRefs(nameLiteral))))			{				mInner->Assert(engine, kNC_Name, nameLiteral, PR_TRUE);			}		}		// save description of search engine (if specified)		nsAutoString	descValue;		if (NS_SUCCEEDED(rv = GetData(data, "search", 0, "description", descValue)))		{			nsCOMPtr<nsIRDFLiteral>	descLiteral;			if (NS_SUCCEEDED(rv = gRDFService->GetLiteral(descValue.GetUnicode(),					getter_AddRefs(descLiteral))))			{				mInner->Assert(engine, kNC_Description, descLiteral, PR_TRUE);			}		}	}	return(rv);}