home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / rdf / src / mcf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.0 KB  |  85 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef    _RDF_MCF_H_
  20. #define    _RDF_MCF_H_
  21.  
  22.  
  23. #include "rdf-int.h"
  24. #include "prprf.h"
  25. #include "prtime.h"
  26.  
  27.  
  28.  
  29. /* mcf.c data structures and defines */
  30.  
  31. struct RDF_NotificationStruct {
  32.   RDF_Event  theEvent;
  33.   void*      pdata;
  34.   RDF_NotificationProc notifFunction;
  35.   RDF        rdf;
  36.   struct RDF_NotificationStruct* next;
  37. };
  38.  
  39.  
  40. #define ntr(r, n) (*((RDFT*)r->translators + n))
  41. #define callAssert(n, r, u, s, v,type,tv) (ntr(r, n)->assert == NULL ? 0 : (*(ntr(r, n)->assert))(ntr(r, n), u, s, v, type, tv))
  42. #define callUnassert(n, r, u, s, v,type) (ntr(r, n)->unassert == NULL ? 0 : (*(ntr(r, n)->unassert))(ntr(r, n), u, s, v, type))
  43. #define callGetSlotValue(n, r, u, s, type, invp, tv) (ntr(r, n)->getSlotValue == NULL ? 0 : (*(ntr(r, n)->getSlotValue))(ntr(r, n), u, s,  type, invp, tv))
  44. #define callGetSlotValues(n, r, u, s, type,invp, tv) (ntr(r, n)->getSlotValues == NULL ? 0 : (*(ntr(r, n)->getSlotValues))(ntr(r, n), u, s,  type,invp, tv))
  45. #define callHasAssertions(n, r, u, s, v,type,tv) (ntr(r, n)->hasAssertion == NULL ? 0 : (*(ntr(r, n)->hasAssertion))(ntr(r, n), u, s, v, type, tv))
  46. #define callArcLabelsOut(n, r, u) (ntr(r, n)->arcLabelsOut == NULL ? 0 : (*(ntr(r, n)->arcLabelsOut))(ntr(r, n), u))
  47. #define callArcLabelsIn(n, r, u) (ntr(r, n)->arcLabelsIn == NULL ? 0 : (*(ntr(r, n)->arcLabelsIn))(ntr(r, n), u))
  48. #define callDisposeResource(n, r, u) ((ntr(r, n)->disposeResource == NULL) ? 1 : (*(ntr(r, n)->disposeResource))(ntr(r, n), u))
  49. #define callExitRoutine(n, r) ((ntr(r, n)->destroy == NULL) ? 0 : (*(ntr(r, n)->destroy))(ntr(r, n)))
  50.  
  51. #define ID_BUF_SIZE    20
  52.  
  53.  
  54.  
  55. /* mcf.c function prototypes */
  56.  
  57. XP_BEGIN_PROTOS
  58.  
  59. RDFT            getTranslator (char* url);
  60. RDFL            deleteFromRDFList (RDFL xrl, RDF db);
  61. RDF_Error        exitRDF (RDF rdf);
  62. RDF_Resource        addDep (RDF db, RDF_Resource u);
  63. PRBool            rdfassert(RDF rdf, RDF_Resource u, RDF_Resource  s, void* value, RDF_ValueType type,  PRBool tv);
  64. PRBool            containerIDp(char* id);
  65. char *            makeNewID ();
  66. PRBool            iscontainerp (RDF_Resource u);
  67. RDF_BT            resourceTypeFromID (char* id);
  68. RDF_Cursor        getSlotValues (RDF rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PRBool inversep, PRBool tv);
  69. void             disposeResourceInt (RDF rdf, RDF_Resource u);
  70. void            possiblyGCResource (RDF_Resource u);
  71. void            assertNotify (RDF rdf, RDF_Notification not, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv, char* ds);
  72. void            insertNotify (RDF rdf, RDF_Notification not, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv, char* ds);
  73. void            unassertNotify (RDF_Notification not, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, char* ds);
  74. void            sendNotifications1 (RDFL rl, RDF_EventType opType, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv);
  75. void            sendNotifications (RDF rdf, RDF_EventType opType, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv, char* ds);
  76. RDF_Resource        nextFindValue (RDF_Cursor c);
  77. PRBool            itemMatchesFind (RDF r, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type);
  78. PR_PUBLIC_API(RDF_Cursor)RDF_Find (RDF_Resource s, void* v, RDF_ValueType type);
  79. PRIntn            findEnumerator (PLHashEntry *he, PRIntn i, void *arg);
  80. void            disposeAllDBs ();
  81.  
  82. XP_END_PROTOS
  83.  
  84. #endif
  85.