PRUint32 theCount; PRUint32 i; nsresult rv; char     **childArray; char     *prefName;
nsAutoVoidArray prefArray;
NS_IMETHODIMP nsPref::EnumerateChildren(const char *parent, PrefEnumerationFunc callback, void *arg) {  PRUint32 theCount;  PRUint32 i;  nsresult rv;  char     **childArray;  char     *prefName;  rv = GetChildList(parent, &theCount, &childArray);  if (NS_SUCCEEDED(rv)) {    // now that we've built up the list, run the callback on all the matching elements    for (i = 0; i < theCount; i++) {      prefName = (char *)childArray[i];      (*callback)((char*)prefName, arg);    }    // now release all the memory    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(theCount, childArray);  }  return NS_OK;}