int			loop;
LocalSearchDataSource::parseFindURL(nsIRDFResource *u, nsISupportsArray *array){	findTokenStruct		tokens[5];	nsresult		rv;	int			loop;	/* build up a token list */	tokens[0].token = "datasource";		tokens[0].value = NULL;	tokens[1].token = "match";		tokens[1].value = NULL;	tokens[2].token = "method";		tokens[2].value = NULL;	tokens[3].token = "text";		tokens[3].value = NULL;	tokens[4].token = NULL;			tokens[4].value = NULL;	// parse find URI, get parameters, search in appropriate datasource(s), return results	if (NS_SUCCEEDED(rv = parseResourceIntoFindTokens(u, tokens)))	{		nsIRDFDataSource	*datasource;		if (NS_SUCCEEDED(rv = gRDFService->GetDataSource(tokens[0].value, &datasource)))		{			nsISimpleEnumerator	*cursor = nsnull;			if (NS_SUCCEEDED(rv = datasource->GetAllResources(&cursor)))			{				while (1) 				{					PRBool hasMore;					rv = cursor->HasMoreElements(&hasMore);					if (NS_FAILED(rv))						break;					if (! hasMore)						break;					nsCOMPtr<nsISupports> isupports;					rv = cursor->GetNext(getter_AddRefs(isupports));					if (NS_SUCCEEDED(rv))					{						nsIRDFResource	*source = nsnull;						if (NS_SUCCEEDED(rv = isupports->QueryInterface(NS_GET_IID(nsIRDFResource), (void **)&source)))						{							const char	*uri = nsnull;							source->GetValueConst(&uri);							// never match against a "find:" URI							if ((uri) && (PL_strncmp(uri, kFindProtocol, sizeof(kFindProtocol) - 1)))							{								nsIRDFResource	*property = nsnull;								if (NS_SUCCEEDED(rv = gRDFService->GetResource(tokens[1].value, &property)) &&									(rv != NS_RDF_NO_VALUE) && (nsnull != property))								{									nsIRDFNode	*value = nsnull;									if (NS_SUCCEEDED(rv = datasource->GetTarget(source, property, PR_TRUE, &value)) &&										(rv != NS_RDF_NO_VALUE) && (nsnull != value))									{										nsIRDFLiteral	*literal = nsnull;										if (NS_SUCCEEDED(rv = value->QueryInterface(NS_GET_IID(nsIRDFLiteral), (void **)&literal)) &&											(rv != NS_RDF_NO_VALUE) && (nsnull != literal))										{											if (PR_TRUE == doMatch(literal, tokens[2].value, tokens[3].value))											{												array->AppendElement(source);											}											NS_RELEASE(literal);										}									}									NS_RELEASE(property);								}							}							NS_RELEASE(source);						}					}				}				if (rv == NS_RDF_CURSOR_EMPTY)				{					rv = NS_OK;				}				NS_RELEASE(cursor);			}			NS_RELEASE(datasource);		}	}	/* free values in token list */	for (loop=0; tokens[loop].token != NULL; loop++)	{		if (tokens[loop].value != NULL)		{			PL_strfree(tokens[loop].value);			tokens[loop].value = NULL;		}	}	return(rv);}