Beispiel #1
0
void *
gRDFMWContext()
{
	void		*cx;

	cx = (void *)FE_GetRDFContext();
	return(cx);
}
Beispiel #2
0
void *
gRDFMWContext(RDFT db)
{
#ifndef MOZILLA_CLIENT
   return NULL;
#else
	void		*cx;
        RDFL            rdf = NULL;
        
        if (db) rdf = db->rdf;
        
        while (rdf) {
          if (rdf->rdf->context) return (rdf->rdf->context);
          rdf = rdf->next;
        }

	cx = (void *)FE_GetRDFContext();
	return(cx);
#endif
}
Beispiel #3
0
void
rdf_complete(NET_StreamClass *stream)
{
  RDFFile f = (RDFFile)stream->data_object;
  if (strcmp(f->url, gNavCntrUrl) == 0) {
    if (f->resourceCount == 0) {
      parseNextRDFXMLBlob(stream, gDefaultNavcntr, strlen(gDefaultNavcntr));
    } else {
      RDF_Resource browser = RDF_GetResource(NULL, "netscape:browser", 1);

      RDF_Resource updateID = RDF_GetResource(NULL, "updateID", 1);
      char* id = RDF_GetSlotValue(gNCDB, browser, updateID,
                                  RDF_STRING_TYPE, false, true);

      RDF_Resource updateFrom = RDF_GetResource(NULL, "updateURL", 1);
      char* uf = RDF_GetSlotValue(gNCDB, browser, updateFrom,
                                  RDF_STRING_TYPE, false, true);

      RDF_Resource fileSize = RDF_GetResource(NULL, "fileSize", 1);
      char* fs = RDF_GetSlotValue(gNCDB, browser, fileSize,
                                  RDF_STRING_TYPE, false, true);
      uint32 fSize;
      if (fs == NULL) {
        fSize = 3000;
      } else {
        sscanf("%lu", fs, &fSize);
        freeMem(fs);
      }
      if ((uf != NULL) && (id != NULL)) {
#ifdef MOZ_SMARTUPDATE
        AutoUpdateConnnection autoupdt;
        autoupdt = AutoUpdate_Setup(FE_GetRDFContext(), 
                                    id, uf, fSize, 
                                    "http://warp/u/raman/docs/js/download.html");
        autoupdate_Resume(autoupdt);
#endif /* MOZ_SMARTUPDATE */
        freeMem(uf);
        freeMem(id);
      } 

      /* A temporary hack to demo AutoUpdate on windows */
#ifndef MOZ_SMARTUPDATE
#ifndef XP_MAC
      /*
      {
        AutoUpdate_LoadMainScript(FE_GetRDFContext(),
                                  "http://warp/u/raman/docs/js/download.html");
      }
      */
#endif /* !XP_MAC */
#endif /* MOZ_SMARTUPDATE */

    } 
  }
  if (f) {
    freeMem(f->line);
    freeMem(f->currentSlot);
    freeMem(f->holdOver);
    freeNamespaces(f) ;
	f->line = NULL;
	f->currentSlot = NULL;
	f->holdOver = NULL;
  }
}