nsCOMPtr<nsIRDFNode> val = do_QueryElementAt(arguments, loop + 1, &rv); if (!val) return rv;
nsCOMPtr<nsISupports>	aValue = arguments->ElementAt(loop + 1); if (!aSource)	return(NS_ERROR_NULL_POINTER); nsCOMPtr<nsIRDFNode>	val = do_QueryInterface(aValue); if (!val)	return(NS_ERROR_NO_INTERFACE);
nsBookmarksService::getArgumentN(nsISupportsArray *arguments, nsIRDFResource *res,                PRInt32 offset, nsIRDFNode **argValue){    nsresult        rv;    PRUint32        loop, numArguments;    *argValue = nsnull;    if (NS_FAILED(rv = arguments->Count(&numArguments)))    return rv;    // format is argument, value, argument, value, ... [you get the idea]    // multiple arguments can be the same, by the way, thus the "offset"    for (loop = 0; loop < numArguments; loop += 2)    {        nsCOMPtr<nsIRDFResource> src = do_QueryElementAt(arguments, loop, &rv);        if (!src) return rv;                if (src == res)        {            if (offset > 0)            {                --offset;                continue;            }            nsCOMPtr<nsIRDFNode> val = do_QueryElementAt(arguments, loop + 1,                                                         &rv);            if (!val) return rv;            *argValue = val;            NS_ADDREF(*argValue);            return NS_OK;        }    }    return NS_ERROR_INVALID_ARG;}