\n", (name) ? name:"");
- }
- while ((next = RDF_NextValue(c)) != NULL) {
-
- url = resourceID(next);
- if (containerp(next) && (!startsWith("ftp:",url)) && (!startsWith("file:",url))
- && (!startsWith("IMAP:", url)) && (!startsWith("nes:", url))
- && (!startsWith("mail:", url)) && (!startsWith("cache:", url))
- && (!startsWith("ldap:", url))) {
- for (loop=0; loop", (date) ? date:"");
- if (date) freeMem(date);
- name = RDF_GetResourceName(rdf, next);
- ht_rjcprintf(fp, "%s
\n", name);
-
- for (loop=0; loop\n", NULL);
- HT_WriteOutAsBookmarks1(rdf, fp, next, top, indent+1);
-
- for (loop=0; loop\n", NULL);
- }
- else if (isSeparator(next)) {
- for (loop=0; loop\n", NULL);
- }
- else {
- char* bkAddDate = (char*)RDF_GetSlotValue(rdf, next,
- gNavCenter->RDF_bookmarkAddDate,
- RDF_STRING_TYPE, false, true);
-
- for (loop=0; loop", resourceLastModifiedDate(rdf, next));
- ht_rjcprintf(fp, "%s\n", RDF_GetResourceName(rdf, next));
-
- if (resourceDescription(rdf, next) != NULL) {
- ht_rjcprintf(fp, "- %s\n", resourceDescription(rdf, next));
- }
- }
- }
- RDF_DisposeCursor(c);
- if (u == top) {
- ht_rjcprintf(fp, "
\n", NULL);
- }
-}
-
-
-
-PR_PUBLIC_API(void)
-HT_WriteOutAsBookmarks (RDF r, PRFileDesc *fp, RDF_Resource u)
-{
- HT_WriteOutAsBookmarks1 (r, fp, u, u, 1);
-}
-
-
-
-void
-flushBookmarks()
-{
- PRFileDesc *bkfp;
-
- if (gBookmarkURL != NULL)
- {
- /*
- delete bookmark.htm as PROpen() with PR_TRUNCATE appears broken (at least on Mac)
- */
- CallPRDeleteFileUsingFileURL(gBookmarkURL);
-
- if ((bkfp = CallPROpenUsingFileURL(gBookmarkURL, (PR_WRONLY|PR_CREATE_FILE|PR_TRUNCATE),
- 0644)) != NULL)
- {
- HT_WriteOutAsBookmarks(gNCDB, bkfp, gNavCenter->RDF_BookmarkFolderCategory);
- PR_Close(bkfp);
- }
- }
-}
-
-
-PRBool
-ResourceBelongsToBookmarksp (RDF_Resource r, int32 depth) {
- if (depth > 20) {
- return false;
- } else if (r == gNavCenter->RDF_BookmarkFolderCategory) {
- return 1;
- } else if (containerp(r)) {
- Assertion as = r->rarg1;
- while (as) {
- if ((as->db == gBMKStore) &&
- (as->s == gCoreVocab->RDF_parent) &&
- (as->tv == 1) &&
- (ResourceBelongsToBookmarksp((RDF_Resource)as->value, depth+1))) return 1;
- as = as->next;
- }
- return 0;
- } else return 0;
-}
-
-
-
-PRBool remoteAssert3 (RDFFile fi, RDFT mcf, RDF_Resource u, RDF_Resource s, void* v,
- RDF_ValueType type, PRBool tv);
-PRBool remoteUnassert3 (RDFFile fi, RDFT mcf, RDF_Resource u, RDF_Resource s, void* v,
- RDF_ValueType type);
-
-
-PRBool
-bmkUnassert (RDFT mcf, RDF_Resource u, RDF_Resource s,
- void* v, RDF_ValueType type) {
- if (ResourceBelongsToBookmarksp(u, 0)) {
- return (remoteStoreRemove(mcf, u, s, v, type) != NULL);
- } else return 0;
-}
-
-
-PRBool
-bmkAssert (RDFT mcf, RDF_Resource u, RDF_Resource s, void* v,
- RDF_ValueType type, PRBool tv) {
- if (ResourceBelongsToBookmarksp(u, 0)) {
- return (remoteStoreAdd(mcf, u, s, v, type, tv) != NULL);
- } else return 0;
-}
-
-extern RDF_Resource gPTFolder;
-void
-readInBookmarks()
-{
- /* RDF_Resource ptFolder; */
-
- /* XXX use rdf:bookmarks to get the demo up and running. I have no
- clue what the difference is. */
-
- /* RDF_Resource bmk = RDF_GetResource(NULL, "NC:Bookmarks", true); */
- RDF_Resource bmk = RDF_GetResource(NULL, "rdf:bookmarks", true);
- RDFFile f = makeRDFFile(gBookmarkURL, bmk, true);
- PRFileDesc *fp;
- int32 len;
- char buf[512];
- f->fileType = RDF_BOOKMARKS;
- f->db = gBMKStore;
- f->assert = remoteAssert3;
-
- fp = CallPROpenUsingFileURL(f->url, PR_RDONLY|PR_CREATE_FILE, 0644);
- if (fp == NULL) return;
- while((len=PR_Read(fp, buf, sizeof(buf))) >0) {
- parseNextBkBlob(f, buf, len);
- }
-
- gPTFolder = remoteStoreGetSlotValue(f->db,
- gNavCenter->RDF_PersonalToolbarFolderCategory,
- gCoreVocab->RDF_instanceOf, RDF_RESOURCE_TYPE, true, true);
-
- if (gPTFolder == NULL) {
- if ((gPTFolder = createContainer("personaltoolbar.rdf")) != NULL) {
- addSlotValue(f, gPTFolder, gCoreVocab->RDF_instanceOf,
- gNavCenter->RDF_PersonalToolbarFolderCategory,
- RDF_RESOURCE_TYPE, "true");
- addSlotValue(f, gPTFolder, gCoreVocab->RDF_name,
- copyString("Personal Toolbar"),
- RDF_STRING_TYPE, "true");
- RDFUtil_SetPTFolder(gPTFolder);
- }
- }
-
- PR_Close(fp);
- freeMem(f->line);
- freeMem(f->currentSlot);
- freeMem(f->holdOver);
-}
-
-
-RDFT
-MakeBMKStore (char* url)
-{
- if (startsWith("rdf:bookmarks", url)) {
- if (gBMKStore == 0) {
- RDFT ntr = gBMKStore = NewRemoteStore(url);
- ntr->assert = bmkAssert;
- ntr->unassert = bmkUnassert;
- readInBookmarks();
- return ntr;
- } else return gBMKStore;
- } else return NULL;
-}
-
-
-#endif
diff --git a/mozilla/rdf/src/bmk2rdf.h b/mozilla/rdf/src/bmk2rdf.h
deleted file mode 100644
index 6abe8ffef97..00000000000
--- a/mozilla/rdf/src/bmk2rdf.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * The contents of this file are subject to the Netscape Public License
- * Version 1.0 (the "NPL"); you may not use this file except in
- * compliance with the NPL. You may obtain a copy of the NPL at
- * http://www.mozilla.org/NPL/
- *
- * Software distributed under the NPL is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
- * for the specific language governing rights and limitations under the
- * NPL.
- *
- * The Initial Developer of this code under the NPL is Netscape
- * Communications Corporation. Portions created by Netscape are
- * Copyright (C) 1998 Netscape Communications Corporation. All Rights
- * Reserved.
- */
-
-#ifndef _RDF_BMK2MCF_H_
-#define _RDF_BMK2MCF_H_
-
-
-#include "rdf.h"
-#include "rdf-int.h"
-#include "vocab.h"
-#include "utils.h"
-#include "glue.h"
-#include "time.h"
-#include "stdio.h"
-#include "ctype.h"
-
-
-/* bmk2mcf.c data structures and defines */
-
-#define OPEN_TITLE_STRING "