From f043461a8156d9ef76c083dcb38964ec1e761b12 Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Tue, 25 Jul 2000 20:21:17 +0000 Subject: [PATCH] add utility to build a chrome registry from the command line. r=waterson a=waterson/hyatt --- chrome/tools/chromereg/regchrome.cpp | 37 ++++++++++++++++++++++++ rdf/chrome/Makefile.in | 2 +- rdf/chrome/tools/Makefile.in | 31 ++++++++++++++++++++ rdf/chrome/tools/chromereg/Makefile.in | 37 ++++++++++++++++++++++++ rdf/chrome/tools/chromereg/regchrome.cpp | 37 ++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 chrome/tools/chromereg/regchrome.cpp create mode 100644 rdf/chrome/tools/Makefile.in create mode 100644 rdf/chrome/tools/chromereg/Makefile.in create mode 100644 rdf/chrome/tools/chromereg/regchrome.cpp diff --git a/chrome/tools/chromereg/regchrome.cpp b/chrome/tools/chromereg/regchrome.cpp new file mode 100644 index 000000000000..5136948c25ff --- /dev/null +++ b/chrome/tools/chromereg/regchrome.cpp @@ -0,0 +1,37 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Christopher Blizzard. + * Portions created by Christopher Blizzard are Copyright (C) + * Christopher Blizzard. All Rights Reserved. + * + * Contributor(s): + * + */ + +#include "nsIServiceManager.h" +#include "nsCOMPtr.h" +#include "nsIChromeRegistry.h" + +int main(int argc, char **argv) +{ + NS_InitXPCOM(nsnull, nsnull); + + nsCOMPtr chromeReg = + do_GetService("component://netscape/chrome/chrome-registry"); + NS_ASSERTION(chromeReg, "chrome check couldn't get the chrome registry"); + chromeReg->CheckForNewChrome(); + // release the chrome registry before we shutdown XPCOM + chromeReg = 0; + NS_ShutdownXPCOM(nsnull); +} diff --git a/rdf/chrome/Makefile.in b/rdf/chrome/Makefile.in index 4b3b329cfc7a..1703b91c66d5 100644 --- a/rdf/chrome/Makefile.in +++ b/rdf/chrome/Makefile.in @@ -26,7 +26,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = public src build +DIRS = public src build tools include $(topsrcdir)/config/rules.mk diff --git a/rdf/chrome/tools/Makefile.in b/rdf/chrome/tools/Makefile.in new file mode 100644 index 000000000000..d0123a3f46c7 --- /dev/null +++ b/rdf/chrome/tools/Makefile.in @@ -0,0 +1,31 @@ +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +DIRS = chromereg + +include $(topsrcdir)/config/rules.mk diff --git a/rdf/chrome/tools/chromereg/Makefile.in b/rdf/chrome/tools/chromereg/Makefile.in new file mode 100644 index 000000000000..e6a7ead54597 --- /dev/null +++ b/rdf/chrome/tools/chromereg/Makefile.in @@ -0,0 +1,37 @@ +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +CPPSRCS = regchrome.cpp + +SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_SUFFIX)) + +LIBS = \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk \ No newline at end of file diff --git a/rdf/chrome/tools/chromereg/regchrome.cpp b/rdf/chrome/tools/chromereg/regchrome.cpp new file mode 100644 index 000000000000..5136948c25ff --- /dev/null +++ b/rdf/chrome/tools/chromereg/regchrome.cpp @@ -0,0 +1,37 @@ +/* + * The contents of this file are subject to the Mozilla Public + * License Version 1.1 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + * implied. See the License for the specific language governing + * rights and limitations under the License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Christopher Blizzard. + * Portions created by Christopher Blizzard are Copyright (C) + * Christopher Blizzard. All Rights Reserved. + * + * Contributor(s): + * + */ + +#include "nsIServiceManager.h" +#include "nsCOMPtr.h" +#include "nsIChromeRegistry.h" + +int main(int argc, char **argv) +{ + NS_InitXPCOM(nsnull, nsnull); + + nsCOMPtr chromeReg = + do_GetService("component://netscape/chrome/chrome-registry"); + NS_ASSERTION(chromeReg, "chrome check couldn't get the chrome registry"); + chromeReg->CheckForNewChrome(); + // release the chrome registry before we shutdown XPCOM + chromeReg = 0; + NS_ShutdownXPCOM(nsnull); +}