diff --git a/rdf/Makefile b/rdf/Makefile new file mode 100644 index 000000000000..692129efc9df --- /dev/null +++ b/rdf/Makefile @@ -0,0 +1,9 @@ +#! gmake + +DEPTH = ../.. + +DIRS = include src + +INCLUDE = $(INCLUDE) -I$(DEPTH)/modules/libimg/public + +include $(DEPTH)/config/rules.mk diff --git a/rdf/include/makefile.win b/rdf/include/makefile.win index 7e75fb2cc718..82de13f25950 100644 --- a/rdf/include/makefile.win +++ b/rdf/include/makefile.win @@ -19,7 +19,7 @@ MODULE = rdf -DEPTH = ..\..\.. +DEPTH = ..\.. EXPORTS = rdf.h \ rdfc.h \ diff --git a/rdf/include/nsIRDFService.h b/rdf/include/nsIRDFService.h index f8eeba8b9933..0a90adfa5239 100644 --- a/rdf/include/nsIRDFService.h +++ b/rdf/include/nsIRDFService.h @@ -48,8 +48,6 @@ class nsIRDFDataBase; class nsIRDFService : public nsISupports { public: - NS_IMETHOD Initialize(); - #ifdef RDF_NOT_IMPLEMENTED NS_IMETHOD RegisterHandler(RDF_String url_selector, const nsCID& clsid) = 0; diff --git a/rdf/makefile.win b/rdf/makefile.win new file mode 100644 index 000000000000..d8c2a65e7454 --- /dev/null +++ b/rdf/makefile.win @@ -0,0 +1,9 @@ + +DEPTH=.. + +DIRS=\ + include \ + src \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> diff --git a/rdf/src/comwrap.cpp b/rdf/src/comwrap.cpp index 6d21f94a01e6..2308480bbd08 100644 --- a/rdf/src/comwrap.cpp +++ b/rdf/src/comwrap.cpp @@ -138,7 +138,7 @@ public: rdfCursorWrapper(RDF_Cursor c); virtual ~rdfCursorWrapper(); - /* NS_METHOD HasElements(PRBool& hasElements); */ + NS_METHOD HasElements(PRBool& hasElements); NS_METHOD Next(RDF_NodeStruct& n); @@ -531,6 +531,14 @@ rdfCursorWrapper::~rdfCursorWrapper() RDF_DisposeCursor( mCursor ); } +NS_METHOD +rdfCursorWrapper::HasElements(PRBool& hasElements) +{ + // XXX + PR_ASSERT( PR_FALSE ); + return NS_ERROR_NOT_IMPLEMENTED; +} + NS_METHOD rdfCursorWrapper::Next(RDF_NodeStruct& next) { diff --git a/rdf/src/core.c b/rdf/src/core.c index 93dea2919bca..8a5ea04a1a19 100644 --- a/rdf/src/core.c +++ b/rdf/src/core.c @@ -53,6 +53,10 @@ getTranslator (char* url) ans = MakeColumnStore (url); } else if (startsWith("rdf:ht", url) || startsWith("rdf:scook", url)) { ans = MakeSCookDB(url); +#ifdef XPCOM_XXX + } else if (startsWith("rdf:CookieStore", url)) { + ans = MakeCookieStore(url); +#endif } else if (startsWith("http://", url)) { ans = MakeFileDB(url); } else { diff --git a/rdf/src/makefile.win b/rdf/src/makefile.win index bd183c0a908d..0bf93156f8f9 100644 --- a/rdf/src/makefile.win +++ b/rdf/src/makefile.win @@ -16,14 +16,12 @@ # Reserved. -DEPTH = ..\..\.. -LIBRARY_SUFFIX=$(MOZ_BITS) -MAKE_OBJ_TYPE=DLL -MAKE_OBJ_TYPE = DLL -DLLNAME = rdf -DLL=.\$(OBJDIR)\$(DLLNAME).dll +DEPTH = ..\.. MODULE=rdf -REQUIRES=nspr rdf xpcom netlib + +MAKE_OBJ_TYPE = DLL +DLLNAME=rdf +DLL=.\$(OBJDIR)\$(DLLNAME).dll C_OBJS=.\$(OBJDIR)\vocab.obj \ .\$(OBJDIR)\core.obj \ @@ -32,17 +30,19 @@ C_OBJS=.\$(OBJDIR)\vocab.obj \ .\$(OBJDIR)\rdfparse.obj \ .\$(OBJDIR)\bmk2rdf.obj \ .\$(OBJDIR)\columns.obj \ - .\$(OBJDIR)\ht.obj \ - .\$(OBJDIR)\netglue.obj \ .\$(OBJDIR)\rdfht.obj \ + .\$(OBJDIR)\ht.obj \ $(NULL) CPP_OBJS=\ .\$(OBJDIR)\comwrap.obj \ + .\$(OBJDIR)\netglue.obj \ $(NULL) LLIBS= \ $(DIST)\lib\xpcom32.lib \ + $(DIST)\lib\raptorbase.lib \ + $(DIST)\lib\netlib.lib \ $(DIST)\lib\libplc21.lib \ $(LIBNSPR) diff --git a/rdf/src/netglue.cpp b/rdf/src/netglue.cpp index 5e3663bf5462..6b4773dd6525 100644 --- a/rdf/src/netglue.cpp +++ b/rdf/src/netglue.cpp @@ -34,7 +34,7 @@ public: NS_METHOD GetBindInfo(nsIURL* aURL); - NS_METHOD OnProgress(nsIURL* aURL, PRInt32 Progress, PRInt32 ProgressMax, const nsString &aMsg); + NS_METHOD OnProgress(nsIURL* aURL, PRInt32 Progress, PRInt32 ProgressMax); NS_METHOD OnStatus(nsIURL* aURL, const nsString& aMsg); @@ -51,24 +51,12 @@ private: RDFFile mFile; }; +NS_IMPL_ISUPPORTS( rdfStreamListener, NS_ISTREAMLISTENER_IID ) + rdfStreamListener::rdfStreamListener(RDFFile f) : mFile(f) { } - -// ISupports implementation... -NS_IMPL_ADDREF(rdfStreamListener) -NS_IMPL_RELEASE(rdfStreamListener) - -nsresult rdfStreamListener::QueryInterface(REFNSIID aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) { - return NS_ERROR_NULL_POINTER; - } - return NS_NOINTERFACE; -} - - rdfStreamListener::~rdfStreamListener() { } @@ -82,7 +70,7 @@ rdfStreamListener::GetBindInfo(nsIURL* aURL) NS_METHOD rdfStreamListener::OnProgress(nsIURL* aURL, PRInt32 Progress, - PRInt32 ProgressMax, const nsString &aMsg) + PRInt32 ProgressMax) { return NS_OK; } @@ -101,7 +89,6 @@ rdfStreamListener::OnStartBinding(nsIURL* aURL, return NS_OK; } - NS_METHOD rdfStreamListener::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, @@ -114,9 +101,8 @@ rdfStreamListener::OnDataAvailable(nsIURL* aURL, do { const PRUint32 buffer_size = 80; char buffer[buffer_size]; - PRInt32 err; - len = pIStream->Read(&err, buffer, 0, buffer_size); + nsresult err = pIStream->Read( buffer, 0, buffer_size, &len ); if (err == NS_OK) { (void) parseNextRDFXMLBlobInt(mFile, buffer, len); } // else XXX ? @@ -135,12 +121,12 @@ rdfStreamListener::OnStopBinding(nsIURL* aURL, switch( status ) { case NS_BINDING_SUCCEEDED: - /* finishRDFParse( mFile ); */ + // XXX finishRDFParse( mFile ); break; case NS_BINDING_FAILED: case NS_BINDING_ABORTED: - // abortRDFParse( mFile ); + // XXX abortRDFParse( mFile ); // XXX status code? break; diff --git a/rdf/src/rdf-int.h b/rdf/src/rdf-int.h index 0d5773da6d1a..b4b6d0f6ff35 100644 --- a/rdf/src/rdf-int.h +++ b/rdf/src/rdf-int.h @@ -101,6 +101,8 @@ #define stringEquals(x, y) (strcmp(x, y) ==0) /*#define stringAppend(x, y) XP_AppendStr(x,y) */ +NSPR_BEGIN_EXTERN_C + struct RDF_ResourceStruct { char* url; uint8 type; @@ -455,6 +457,6 @@ extern RDF_WDVocab gWebData; extern RDF_NCVocab gNavCenter; extern RDF_CoreVocab gCoreVocab; - +NSPR_END_EXTERN_C #endif diff --git a/rdf/src/rdfparse.h b/rdf/src/rdfparse.h index 409dc39d8fc3..ca36d441cf59 100644 --- a/rdf/src/rdfparse.h +++ b/rdf/src/rdfparse.h @@ -37,9 +37,8 @@ /* rdfparse.c function prototypes */ -#ifdef __cplusplus -extern "C" { -#endif +NSPR_BEGIN_EXTERN_C + char decodeEntityRef (char* string, int32* stringIndexPtr, int32 len); char * copyStringIgnoreWhiteSpace(char* string); char * getHref(char** attlist); @@ -57,10 +56,6 @@ void outputRDFTreeInt (RDF rdf, PRFileDesc *fp, RDF_Resource node, uint32 depth void outputRDFTree (RDF rdf, PRFileDesc *fp, RDF_Resource node); int parseNextRDFXMLBlobInt(RDFFile f, char* blob, int32 size) ; - -#ifdef __cplusplus -}; -#endif - +NSPR_END_EXTERN_C #endif