qualifier, &params);
qualifier, 0, &params);
static nsresult AppendMethodForParticle(nsIInterfaceInfoSuperManager* iism,                                        nsIGenericInterfaceInfoSet* aSet,                                        nsISchemaParticle* aParticle,                                        const IIDX& iidx,                                        XPTParamDescriptor* defaultResult,                                        nsIGenericInterfaceInfo* aInfo,                                        const nsAString& qualifier){  nsresult rv;  XPTMethodDescriptor methodDesc;  XPTParamDescriptor* pparamDesc;  PRUint16 ignoredIndex;  XPTParamDescriptor* paramArray;  ParamAccumulator params;  PRUint16 i;  // If the particle is itself a moduleGroup, then flatten in its methods.  nsCOMPtr<nsISchemaModelGroup> modelGroup(do_QueryInterface(aParticle));  if (modelGroup) {    return AppendMethodsForModelGroup(iism, aSet, modelGroup, iidx,                                       defaultResult, aInfo, qualifier);  }  // else...  nsCOMPtr<nsISchemaElement> schemaElement(do_QueryInterface(aParticle));  if (!schemaElement) {    // XXX we are considering this an error. (e.g is a nsISchemaAnyParticle).    // XXX need better error tracking!    return NS_ERROR_UNEXPECTED;  }  nsCOMPtr<nsISchemaType> schemaType;  schemaElement->GetType(getter_AddRefs(schemaType));  if (!schemaType) {    // XXX need better error tracking!    return NS_ERROR_UNEXPECTED;  }  nsCAutoString identifierName;  nsAutoString name;  rv = aParticle->GetName(name);  if (NS_FAILED(rv)) {    return rv;  }  WSPFactory::XML2C(name, identifierName);  rv = GetParamDescOfType(iism, aSet, schemaType, iidx, defaultResult,                          qualifier, &params);  if (NS_FAILED(rv)) {    return rv;  }  rv = aSet->AllocateParamArray(params.GetCount(), &paramArray);  if (NS_FAILED(rv)) {    return rv;  }  pparamDesc = params.GetArray();  for (i = 0; i < params.GetCount(); pparamDesc++, i++) {    // handle AString 'out' passing convensions    pparamDesc->flags |=       (pparamDesc->flags | TD_DOMSTRING) ?           (XPT_PD_IN | XPT_PD_DIPPER) : XPT_PD_OUT;    // handle array size_of/length_of.    if (pparamDesc->type.prefix.flags | TD_ARRAY) {      pparamDesc->type.argnum =           pparamDesc->type.argnum2 = i - 1;     }        // handle trailing retval.    if (i+1 == params.GetCount()) {      pparamDesc->flags |= XPT_PD_RETVAL;    }  }  memcpy(paramArray, params.GetArray(),          params.GetCount() * sizeof(XPTParamDescriptor));  // XXX conditionally tack on 'Get' for array getter?  // XXX Deal with intercaps in that case?  methodDesc.flags    = params.GetCount() == 1 ? XPT_MD_GETTER : 0;  methodDesc.name     = (char*) identifierName.get();  methodDesc.params   = paramArray;  methodDesc.result   = defaultResult;  methodDesc.num_args = (PRUint8) params.GetCount();  return aInfo->AppendMethod(&methodDesc, &ignoredIndex);}