while (next = RDF_NextValue(c)) {
while ((next = RDF_NextValue(c)) != NULL) {
outputRDFTreeInt (RDF rdf, PRFileDesc *fp, RDF_Resource node, uint32 depth, PRBool localOnly) {  RDF_Cursor c = RDF_GetSources(rdf, node, gCoreVocab->RDF_parent, RDF_RESOURCE_TYPE,  true);  RDF_Resource next;  char* buf = getMem(1024);  char* space = getMem((4*depth)+1);  char* url   = resourceID(node);  char* name  = RDF_GetResourceName(rdf, node);  char* hrefid;  if ((buf == NULL) || (space == NULL)) return;  if (depth > 0) memset(space, ' ', depth);    if (!strchr(url, ':') || (depth == 0)) {	  hrefid = "id";  } else {	  hrefid = "rdf:href";  }  if (depth == 0) url="root";  if (containerp(node)) {    if (depth > 0) {      sprintf(buf, "%s<child>\n", space);  	  PR_Write(fp, buf, strlen(buf));     }    sprintf(buf, "%s<Topic %s=\"%s\"\n%s       name=\"%s\">\n", space, hrefid, url, space,   name);  	PR_Write(fp, buf, strlen(buf));        while (next = RDF_NextValue(c)) {          /* if exporting EVERYTHING, need to skip over certain things */      if ((localOnly == PR_FALSE) || ((!startsWith("ftp:",url)) && (!startsWith("file:",url))	    && (!startsWith("IMAP:", url)) && (!startsWith("nes:", url))	    && (!startsWith("mail:", url)) && (!startsWith("cache:", url))	    && (!startsWith("ldap:", url)) &&	    (!urlEquals(resourceID(node), resourceID(gNavCenter->RDF_LocalFiles))) &&	    (!urlEquals(resourceID(node), resourceID(gNavCenter->RDF_History)))))	{		outputRDFTreeInt(rdf, fp, next, depth+1, localOnly);	}    }    sprintf(buf, "%s</Topic>\n", space);	PR_Write(fp, buf, strlen(buf));    if (depth > 0) {      sprintf(buf, "%s</child>\n", space);	  PR_Write(fp, buf, strlen(buf));    }   } else {    sprintf(buf, "%s<child %s=\"%s\"\n%s       name=\"%s\"/>\n", space, hrefid, url, space,   name); 	PR_Write(fp, buf, strlen(buf));  }  RDF_DisposeCursor(c);  freeMem(buf);  freeMem(space);}