From 5bf3f0bc32609cf59f86ab2a6af4bbea1a6d13e3 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Sat, 12 Jun 1999 07:54:05 +0000 Subject: [PATCH] Removing obsoleted files from xpcom/ post xpcom2.0 landing git-svn-id: svn://10.0.0.236/trunk@34992 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/libxpt/Makefile.in | 33 - mozilla/xpcom/libxpt/macbuild/libxpt.Prefix | 26 - mozilla/xpcom/libxpt/macbuild/libxpt.mcp | Bin 86352 -> 0 bytes mozilla/xpcom/libxpt/macbuild/libxptConfig.h | 19 - .../xpcom/libxpt/macbuild/libxptDebug.Prefix | 26 - mozilla/xpcom/libxpt/macbuild/tests.mcp | Bin 87730 -> 0 bytes mozilla/xpcom/libxpt/macbuild/tools.mcp | Bin 90336 -> 0 bytes mozilla/xpcom/libxpt/makefile.win | 24 - mozilla/xpcom/libxpt/public/MANIFEST | 6 - mozilla/xpcom/libxpt/public/Makefile.in | 32 - mozilla/xpcom/libxpt/public/makefile.win | 28 - mozilla/xpcom/libxpt/public/xpt_struct.h | 456 --------- mozilla/xpcom/libxpt/public/xpt_xdr.h | 221 ----- mozilla/xpcom/libxpt/src/Makefile.in | 46 - mozilla/xpcom/libxpt/src/makefile.win | 52 -- mozilla/xpcom/libxpt/src/xpt_struct.c | 788 ---------------- mozilla/xpcom/libxpt/src/xpt_xdr.c | 672 ------------- mozilla/xpcom/libxpt/tests/Makefile.in | 36 - mozilla/xpcom/libxpt/tests/PrimitiveTest.c | 134 --- mozilla/xpcom/libxpt/tests/SimpleTypeLib.c | 164 ---- mozilla/xpcom/libxpt/tests/makefile.win | 66 -- mozilla/xpcom/libxpt/tools/Makefile.in | 42 - mozilla/xpcom/libxpt/tools/makefile.win | 70 -- mozilla/xpcom/libxpt/tools/xpt_dump.c | 882 ------------------ mozilla/xpcom/libxpt/tools/xpt_link.c | 698 -------------- mozilla/xpcom/libxpt/xptcall/Makefile.in | 33 - mozilla/xpcom/libxpt/xptcall/README | 6 - mozilla/xpcom/libxpt/xptcall/makefile.win | 21 - mozilla/xpcom/libxpt/xptcall/porting.html | 13 - mozilla/xpcom/libxpt/xptcall/public/MANIFEST | 7 - .../xpcom/libxpt/xptcall/public/Makefile.in | 33 - .../xpcom/libxpt/xptcall/public/genstubs.pl | 55 -- .../xpcom/libxpt/xptcall/public/makefile.win | 29 - mozilla/xpcom/libxpt/xptcall/public/xptcall.h | 137 --- .../libxpt/xptcall/public/xptcstubsdecl.inc | 276 ------ .../libxpt/xptcall/public/xptcstubsdef.inc | 270 ------ mozilla/xpcom/libxpt/xptcall/src/Makefile.in | 38 - mozilla/xpcom/libxpt/xptcall/src/makefile.win | 65 -- .../xpcom/libxpt/xptcall/src/md/Makefile.in | 31 - .../xptcall/src/md/mac/xptcinvoke_mac.cpp | 129 --- .../xptcall/src/md/mac/xptcinvoke_mac.s | 112 --- .../xptcall/src/md/mac/xptcstubs_.mac.cpp | 41 - .../xptcall/src/md/mac/xptcstubs_mac.cpp | 210 ----- .../libxpt/xptcall/src/md/mac/xptcstubs_mac.s | 74 -- .../xpcom/libxpt/xptcall/src/md/makefile.win | 21 - .../libxpt/xptcall/src/md/test/Makefile.in | 36 - .../xpcom/libxpt/xptcall/src/md/test/README | 6 - .../libxpt/xptcall/src/md/test/clean.bat | 5 - .../xptcall/src/md/test/invoke_test.cpp | 220 ----- .../libxpt/xptcall/src/md/test/mk_invoke.bat | 9 - .../libxpt/xptcall/src/md/test/mk_stub.bat | 9 - .../libxpt/xptcall/src/md/test/stub_test.cpp | 184 ---- .../libxpt/xptcall/src/md/unix/Makefile.in | 62 -- .../md/unix/xptcinvoke_asm_sparc_solaris.s | 68 -- .../src/md/unix/xptcinvoke_sparc_solaris.cpp | 130 --- .../src/md/unix/xptcinvoke_unixish_x86.cpp | 159 ---- .../src/md/unix/xptcinvoke_unsupported.cpp | 29 - .../src/md/unix/xptcstubs_asm_sparc_solaris.s | 58 -- .../src/md/unix/xptcstubs_sparc_solaris.cpp | 126 --- .../src/md/unix/xptcstubs_unixish_x86.cpp | 126 --- .../src/md/unix/xptcstubs_unsupported.cpp | 37 - .../libxpt/xptcall/src/md/win32/makefile.win | 41 - .../xptcall/src/md/win32/xptcinvoke.cpp | 136 --- .../libxpt/xptcall/src/md/win32/xptcstubs.cpp | 146 --- mozilla/xpcom/libxpt/xptcall/src/xptcall.cpp | 21 - .../xpcom/libxpt/xptcall/src/xptcprivate.h | 26 - mozilla/xpcom/libxpt/xptcall/status.html | 13 - .../xpcom/libxpt/xptcall/tests/Makefile.in | 68 -- .../libxpt/xptcall/tests/TestXPTCInvoke.cpp | 191 ---- .../xpcom/libxpt/xptcall/tests/makefile.win | 66 -- mozilla/xpcom/libxpt/xptinfo/Makefile.in | 29 - mozilla/xpcom/libxpt/xptinfo/makefile.win | 22 - mozilla/xpcom/libxpt/xptinfo/public/MANIFEST | 7 - .../xpcom/libxpt/xptinfo/public/Makefile.in | 36 - .../xpcom/libxpt/xptinfo/public/makefile.win | 30 - .../libxpt/xptinfo/public/nsIInterfaceInfo.h | 67 -- .../xptinfo/public/nsIInterfaceInfoManager.h | 53 -- mozilla/xpcom/libxpt/xptinfo/public/xptinfo.h | 212 ----- mozilla/xpcom/libxpt/xptinfo/src/Makefile.in | 39 - mozilla/xpcom/libxpt/xptinfo/src/makefile.win | 71 -- .../libxpt/xptinfo/src/nsInterfaceInfo.cpp | 232 ----- .../libxpt/xptinfo/src/nsInterfaceInfo.h | 83 -- .../xptinfo/src/nsInterfaceInfoManager.cpp | 467 ---------- .../xptinfo/src/nsInterfaceInfoManager.h | 77 -- .../libxpt/xptinfo/src/nsInterfaceRecord.cpp | 108 --- .../libxpt/xptinfo/src/nsInterfaceRecord.h | 55 -- .../libxpt/xptinfo/src/nsTypelibRecord.cpp | 37 - .../libxpt/xptinfo/src/nsTypelibRecord.h | 48 - .../xpcom/libxpt/xptinfo/tests/Makefile.in | 45 - .../xptinfo/tests/TestInterfaceInfo.cpp | 151 --- .../xpcom/libxpt/xptinfo/tests/makefile.win | 68 -- 91 files changed, 10031 deletions(-) delete mode 100644 mozilla/xpcom/libxpt/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/macbuild/libxpt.Prefix delete mode 100644 mozilla/xpcom/libxpt/macbuild/libxpt.mcp delete mode 100644 mozilla/xpcom/libxpt/macbuild/libxptConfig.h delete mode 100644 mozilla/xpcom/libxpt/macbuild/libxptDebug.Prefix delete mode 100644 mozilla/xpcom/libxpt/macbuild/tests.mcp delete mode 100644 mozilla/xpcom/libxpt/macbuild/tools.mcp delete mode 100644 mozilla/xpcom/libxpt/makefile.win delete mode 100644 mozilla/xpcom/libxpt/public/MANIFEST delete mode 100644 mozilla/xpcom/libxpt/public/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/public/makefile.win delete mode 100644 mozilla/xpcom/libxpt/public/xpt_struct.h delete mode 100644 mozilla/xpcom/libxpt/public/xpt_xdr.h delete mode 100644 mozilla/xpcom/libxpt/src/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/src/makefile.win delete mode 100644 mozilla/xpcom/libxpt/src/xpt_struct.c delete mode 100644 mozilla/xpcom/libxpt/src/xpt_xdr.c delete mode 100644 mozilla/xpcom/libxpt/tests/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/tests/PrimitiveTest.c delete mode 100644 mozilla/xpcom/libxpt/tests/SimpleTypeLib.c delete mode 100644 mozilla/xpcom/libxpt/tests/makefile.win delete mode 100644 mozilla/xpcom/libxpt/tools/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/tools/makefile.win delete mode 100644 mozilla/xpcom/libxpt/tools/xpt_dump.c delete mode 100644 mozilla/xpcom/libxpt/tools/xpt_link.c delete mode 100644 mozilla/xpcom/libxpt/xptcall/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/README delete mode 100644 mozilla/xpcom/libxpt/xptcall/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptcall/porting.html delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/MANIFEST delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/genstubs.pl delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/xptcall.h delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/xptcstubsdecl.inc delete mode 100644 mozilla/xpcom/libxpt/xptcall/public/xptcstubsdef.inc delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.s delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_.mac.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.s delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/test/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/test/README delete mode 100755 mozilla/xpcom/libxpt/xptcall/src/md/test/clean.bat delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/test/invoke_test.cpp delete mode 100755 mozilla/xpcom/libxpt/xptcall/src/md/test/mk_invoke.bat delete mode 100755 mozilla/xpcom/libxpt/xptcall/src/md/test/mk_stub.bat delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/test/stub_test.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris.s delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unsupported.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_asm_sparc_solaris.s delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unsupported.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/win32/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcinvoke.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcstubs.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/xptcall.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/src/xptcprivate.h delete mode 100644 mozilla/xpcom/libxpt/xptcall/status.html delete mode 100644 mozilla/xpcom/libxpt/xptcall/tests/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptcall/tests/TestXPTCInvoke.cpp delete mode 100644 mozilla/xpcom/libxpt/xptcall/tests/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptinfo/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptinfo/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptinfo/public/MANIFEST delete mode 100644 mozilla/xpcom/libxpt/xptinfo/public/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptinfo/public/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfo.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfoManager.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/public/xptinfo.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/makefile.win delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.cpp delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.cpp delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.cpp delete mode 100644 mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.h delete mode 100644 mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in delete mode 100644 mozilla/xpcom/libxpt/xptinfo/tests/TestInterfaceInfo.cpp delete mode 100644 mozilla/xpcom/libxpt/xptinfo/tests/makefile.win diff --git a/mozilla/xpcom/libxpt/Makefile.in b/mozilla/xpcom/libxpt/Makefile.in deleted file mode 100644 index 12a95905ad4..00000000000 --- a/mozilla/xpcom/libxpt/Makefile.in +++ /dev/null @@ -1,33 +0,0 @@ -#!gmake -# 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. - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -VPATH = @srcdir@ -srcdir = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = public src - -DIRS += tests - -DIRS += tools - -# Don't recur into xptinfo and xptcall, because they may require xpidl, -# which hasn't been built yet. They'll be called from the xpcom makefile. - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/macbuild/libxpt.Prefix b/mozilla/xpcom/libxpt/macbuild/libxpt.Prefix deleted file mode 100644 index 36b66606097..00000000000 --- a/mozilla/xpcom/libxpt/macbuild/libxpt.Prefix +++ /dev/null @@ -1,26 +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. - */ - -// -// libxpt.Prefix -// -// Global prefix file for the libxpt project. -// - -#include "MacPrefix.h" -#include "libxptConfig.h" diff --git a/mozilla/xpcom/libxpt/macbuild/libxpt.mcp b/mozilla/xpcom/libxpt/macbuild/libxpt.mcp deleted file mode 100644 index 2e42cb157adc8bddff0d41f009aa49c27aede33b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86352 zcmeHQ2Vfk<)!sXG*>aJ)X$PSN6B!o>76fdo*s>){STc5uK|Y<%^4Zeead$E{3BmMc zLJ3J|A*7LBNg=%v2tPHD5JEyiNJ4rckmOJPB>ul|=H1@z?e6I$3$Ueq_P6ibH?y-d zZ{Exn?d?VqiGIT{N(>`#tPyCMZ3LQ^8pebvuHB~S%a0~3IWKn*Ynm<-UTQ-NAw8ZaH00n7wu0keTQ zz+B)U;9%eo;85T&faQj`W8fU9+krc=%Tx5Ouztlqx)SS>$!My(`^0#V>qlKRh zevWnB*kn|oZ1rF5pe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8!Vi=VXsHLWXHwUJ+N?$LEc}7g^Y{s&EWr`702Hjv5;|b9b@&swBkJQa4ck8 z%()1BFRie%9O=am-u|N751Rs;L$svWn8R!1ojeT z54-{X%Z`f|&jK&i`CnQJE#u-7i(xO*_Q!glWnA3R346J+2Tq@4j*DrN;pYJR81fS1 c{b)6grY~Fod!;f5md(xCZ~i>&oTH8Z2V4M##sB~S diff --git a/mozilla/xpcom/libxpt/macbuild/libxptConfig.h b/mozilla/xpcom/libxpt/macbuild/libxptConfig.h deleted file mode 100644 index c19539fb824..00000000000 --- a/mozilla/xpcom/libxpt/macbuild/libxptConfig.h +++ /dev/null @@ -1,19 +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. - */ - -/* Nothing to do here. Add libxpt-specific defines here if necessary */ diff --git a/mozilla/xpcom/libxpt/macbuild/libxptDebug.Prefix b/mozilla/xpcom/libxpt/macbuild/libxptDebug.Prefix deleted file mode 100644 index 53433cb3da4..00000000000 --- a/mozilla/xpcom/libxpt/macbuild/libxptDebug.Prefix +++ /dev/null @@ -1,26 +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. - */ - -// -// libxptDebug.Prefix -// -// Global prefix file for the libxpt project. -// - -#include "MacPrefix_debug.h" -#include "libxptConfig.h" diff --git a/mozilla/xpcom/libxpt/macbuild/tests.mcp b/mozilla/xpcom/libxpt/macbuild/tests.mcp deleted file mode 100644 index c7a012c8d81c05034856dc6de06fb4370c7f81cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87730 zcmeI5349z^eaC0lx_mpfQ{J z$#gc>mrd_W4CV`2lSMv4N8jW)Q`;S9hV)r}w}61*d{GFdrNb7J!9d5jX+JXq^O3 z2B!c9+qn(A7~BKy0z1H~!7?xa&I0#?2f;z`5V#1u3S0jO5hb zM0Pk4+cYLEJ%sdJ(yG3`9utcVT|Miz5AIJ6$-!V-e_tnBwqcX(VfqKN$xOblud}0b zESFD@#x^8wxjCI3$~oTLRfB_xTrSoZ&+jeI8i>>0e5^l_&nHvE<+*E8H%krkk7`;SLk_H5)g-4YnUh`W z=x%?llHHR`?e}d?GWyo64XCYfi1pfv@~d*A*eaD6DO+iC;?_!?8sHGWHk(f6*QADY zU9CQ5Y}k{`<;!YYoy?_Ef!kR-k~k2UvEq^q6|5sURjeb~f!2|XU^{fK?Ip9U&E1=0 zn=<+2X!2H{oyCf=o_K0_EIynlTg~JV6B)w7Yi*Mg+yKeyN)J|OUT=JGQ-91xThLhb z#dCx4kxIj*xfPsnTQap-+%V964_vaM!Wc+Spphk`(8mLr!SpCT=8M>3h9_8y+VVIp zW_UxisP;r>QCk+6W%{Byih2p2LO6Pq9$)k1s0BPai9fGG&u-nyQq&c-o`5TA17fY1 zC;sefuqcBYEIH*37M*{zY%~dY>&zYQHs0d2V}_v>uCEb&xZsEcP&?DpntjY1Dwp2 z>-RKQrqA8V^87wmR={oNvMi5f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efile.win deleted file mode 100644 index 90df92cf5f9..00000000000 --- a/mozilla/xpcom/libxpt/makefile.win +++ /dev/null @@ -1,24 +0,0 @@ -# -# 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. - -DEPTH=..\.. -IGNORE_MANIFEST=1 - -# Don't recur into xptinfo and xptcall, because they may require xpidl, -# which hasn't been built yet. They'll be called from the xpcom makefile. -DIRS=public src tests tools - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/libxpt/public/MANIFEST b/mozilla/xpcom/libxpt/public/MANIFEST deleted file mode 100644 index b92bcab4e72..00000000000 --- a/mozilla/xpcom/libxpt/public/MANIFEST +++ /dev/null @@ -1,6 +0,0 @@ -# -# This is a list of local files which get copied to the mozilla:dist directory -# - -xpt_struct.h -xpt_xdr.h diff --git a/mozilla/xpcom/libxpt/public/Makefile.in b/mozilla/xpcom/libxpt/public/Makefile.in deleted file mode 100644 index ab26f656289..00000000000 --- a/mozilla/xpcom/libxpt/public/Makefile.in +++ /dev/null @@ -1,32 +0,0 @@ -#!gmake -# 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. - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = libxpt - -EXPORTS = xpt_struct.h \ - xpt_xdr.h \ - $(NULL) - -EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/public/makefile.win b/mozilla/xpcom/libxpt/public/makefile.win deleted file mode 100644 index 2c149bdf054..00000000000 --- a/mozilla/xpcom/libxpt/public/makefile.win +++ /dev/null @@ -1,28 +0,0 @@ -#!nmake -# -# 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. - -IGNORE_MANIFEST=1 - -DEPTH=..\..\.. - -EXPORTS = xpt_struct.h \ - xpt_xdr.h \ - $(NULL) - -MODULE = libxpt - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/libxpt/public/xpt_struct.h b/mozilla/xpcom/libxpt/public/xpt_struct.h deleted file mode 100644 index 3d691fcf6b0..00000000000 --- a/mozilla/xpcom/libxpt/public/xpt_struct.h +++ /dev/null @@ -1,456 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* - * Structures matching the in-memory representation of typelib structures. - * http://www.mozilla.org/scriptable/typelib_file.html - */ - -#ifndef __xpt_struct_h__ -#define __xpt_struct_h__ - -#include "prtypes.h" -#include -#include - -/* - * The linkage of XPT API functions differs depending on whether the file is - * used within the XPT library or not. Any source file within the XPT - * library should define EXPORT_XPT_API whereas any client of the library - * should not. - */ -#ifdef EXPORT_XPT_API -#define XPT_PUBLIC_API(t) PR_IMPLEMENT(t) -#define XPT_PUBLIC_DATA(t) PR_IMPLEMENT_DATA(t) -#else -#ifdef _WIN32 -# define XPT_PUBLIC_API(t) _declspec(dllimport) t -# define XPT_PUBLIC_DATA(t) _declspec(dllimport) t -#else -# define XPT_PUBLIC_API(t) PR_IMPLEMENT(t) -# define XPT_PUBLIC_DATA(t) t -#endif -#endif -#define XPT_FRIEND_API(t) XPT_PUBLIC_API(t) -#define XPT_FRIEND_DATA(t) XPT_PUBLIC_DATA(t) - -PR_BEGIN_EXTERN_C - -/* - * Some utility macros. Defined here in lieu of equivalent NSPR - * macros, which require NSPR linkage. - */ -#define XPT_MALLOC(_bytes) (malloc((_bytes))) -#define XPT_NEW(_struct) ((_struct *) malloc(sizeof(_struct))) -#define XPT_REALLOC(_ptr, _size) (realloc((_ptr), (_size))) -#define XPT_CALLOC(_size) (calloc(1, (_size))) -#define XPT_NEWZAP(_struct) ((_struct*)calloc(1, sizeof(_struct))) -#define XPT_DELETE(_ptr) { free(_ptr); (_ptr) = NULL; } -#define XPT_FREEIF(_ptr) if (_ptr) free(_ptr) -#define XPT_FREE(_ptr) free(_ptr) - -#define XPT_ASSERT(_expr) assert(_expr) - - -/* - * Originally, I was going to have structures that exactly matched the on-disk - * representation, but that proved difficult: different compilers can pack - * their structs differently, and that makes overlaying them atop a - * read-from-disk byte buffer troublesome. So now I just have some structures - * that are used in memory, and we're going to write a nice XDR library to - * write them to disk and stuff. It is pure joy. -- shaver - */ - -/* Structures for the typelib components */ - -typedef struct XPTHeader XPTHeader; -typedef struct XPTInterfaceDirectoryEntry XPTInterfaceDirectoryEntry; -typedef struct XPTInterfaceDescriptor XPTInterfaceDescriptor; -typedef struct XPTConstDescriptor XPTConstDescriptor; -typedef struct XPTMethodDescriptor XPTMethodDescriptor; -typedef struct XPTParamDescriptor XPTParamDescriptor; -typedef struct XPTTypeDescriptor XPTTypeDescriptor; -typedef struct XPTTypeDescriptorPrefix XPTTypeDescriptorPrefix; -typedef struct XPTString XPTString; -typedef struct XPTAnnotation XPTAnnotation; -#ifndef nsID_h__ -/* - * We can't include nsID.h, because it's full of C++ goop and we're not doing - * C++ here, so we define our own minimal struct. We protect against multiple - * definitions of this struct, though, and use the same field naming. - */ -struct nsID { - PRUint32 m0; - PRUint16 m1; - PRUint16 m2; - PRUint8 m3[8]; -}; - -typedef struct nsID nsID; -#endif - -#define XPT_COPY_IID(to, from) \ - (to).m0 = (from).m0; \ - (to).m1 = (from).m1; \ - (to).m2 = (from).m2; \ - (to).m3[0] = (from).m3[0]; \ - (to).m3[1] = (from).m3[1]; \ - (to).m3[2] = (from).m3[2]; \ - (to).m3[3] = (from).m3[3]; \ - (to).m3[4] = (from).m3[4]; \ - (to).m3[5] = (from).m3[5]; \ - (to).m3[6] = (from).m3[6]; \ - (to).m3[7] = (from).m3[7]; - - -/* - * Every XPCOM typelib file begins with a header. - */ -struct XPTHeader { - PRUint8 magic[16]; - PRUint8 major_version; - PRUint8 minor_version; - PRUint16 num_interfaces; - PRUint32 file_length; - XPTInterfaceDirectoryEntry *interface_directory; - PRUint32 data_pool; - XPTAnnotation *annotations; -}; - -#define XPT_MAGIC "XPCOM\nTypeLib\r\n\032" -#define XPT_MAJOR_VERSION 0x01 -#define XPT_MINOR_VERSION 0x00 - -extern XPT_PUBLIC_API(XPTHeader *) -XPT_NewHeader(PRUint16 num_interfaces); - -/* size of header and annotations */ -extern XPT_PUBLIC_API(PRUint32) -XPT_SizeOfHeader(XPTHeader *header); - -/* size of header and annotations and InterfaceDirectoryEntries */ -extern XPT_PUBLIC_API(PRUint32) -XPT_SizeOfHeaderBlock(XPTHeader *header); - -/* - * A contiguous array of fixed-size InterfaceDirectoryEntry records begins at - * the byte offset identified by the interface_directory field in the file - * header. The array is used to quickly locate an interface description - * using its IID. No interface should appear more than once in the array. - */ -struct XPTInterfaceDirectoryEntry { - nsID iid; - char *name; - char *name_space; - XPTInterfaceDescriptor *interface_descriptor; - -#if 0 /* not yet */ - /* not stored on disk */ - PRUint32 offset; /* the offset for an ID still to be read */ -#endif -}; - -extern XPT_PUBLIC_API(PRBool) -XPT_FillInterfaceDirectoryEntry(XPTInterfaceDirectoryEntry *ide, - nsID *iid, char *name, char *name_space, - XPTInterfaceDescriptor *descriptor); - -/* - * An InterfaceDescriptor is a variable-size record used to describe a - * single XPCOM interface, including all of its methods. - */ -struct XPTInterfaceDescriptor { - PRUint16 parent_interface; - PRUint16 num_methods; - XPTMethodDescriptor *method_descriptors; - PRUint16 num_constants; - XPTConstDescriptor *const_descriptors; - PRUint8 flags; -}; - -#define XPT_ID_SCRIPTABLE 0x80 -#define XPT_ID_FLAGMASK 0x80 -#define XPT_ID_TAGMASK (~XPT_ID_FLAGMASK) -#define XPT_ID_TAG(id) ((id).flags & XPT_ID_TAGMASK) - -#define XPT_ID_IS_SCRIPTABLE(flags) (flags & XPT_ID_SCRIPTABLE) - -extern XPT_PUBLIC_API(PRBool) -XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block, - PRUint16 num_interfaces, char *name, - PRUint16 *indexp); - -extern XPT_PUBLIC_API(XPTInterfaceDescriptor *) -XPT_NewInterfaceDescriptor(PRUint16 parent_interface, PRUint16 num_methods, - PRUint16 num_constants, PRUint8 flags); - -extern XPT_PUBLIC_API(PRBool) -XPT_InterfaceDescriptorAddMethods(XPTInterfaceDescriptor *id, PRUint16 num); - -extern XPT_PUBLIC_API(PRBool) -XPT_InterfaceDescriptorAddConsts(XPTInterfaceDescriptor *id, PRUint16 num); - -/* - * This is our special string struct with a length value associated with it, - * which means that it can contains embedded NULs. - */ -struct XPTString { - PRUint16 length; - char *bytes; -}; - -extern XPT_PUBLIC_API(XPTString *) -XPT_NewString(PRUint16 length, char *bytes); - -extern XPT_PUBLIC_API(XPTString *) -XPT_NewStringZ(char *bytes); - -/* - * A TypeDescriptor is a variable-size record used to identify the type of a - * method argument or return value. - * - * There are three types of TypeDescriptors: - * - * SimpleTypeDescriptor - * InterfaceTypeDescriptor - * InterfaceIsTypeDescriptor - * - * The tag field in the prefix indicates which of the variant TypeDescriptor - * records is being used, and hence the way any remaining fields should be - * parsed. Values from 0 to 17 refer to SimpleTypeDescriptors. The value 18 - * designates an InterfaceTypeDescriptor, while 19 represents an - * InterfaceIsTypeDescriptor. - */ - -/* XXX why bother with a struct? */ -struct XPTTypeDescriptorPrefix { - PRUint8 flags; -}; - -/* flag bits -- fur and jband were right, I was miserably wrong */ -#define XPT_TDP_POINTER 0x80 -#define XPT_TDP_UNIQUE_POINTER 0x40 -#define XPT_TDP_REFERENCE 0x20 -#define XPT_TDP_FLAGMASK 0xe0 -#define XPT_TDP_TAGMASK (~XPT_TDP_FLAGMASK) -#define XPT_TDP_TAG(tdp) ((tdp).flags & XPT_TDP_TAGMASK) - -#define XPT_TDP_IS_POINTER(flags) (flags & XPT_TDP_POINTER) -#define XPT_TDP_IS_UNIQUE_POINTER(flags) (flags & XPT_TDP_UNIQUE_POINTER) -#define XPT_TDP_IS_REFERENCE(flags) (flags & XPT_TDP_REFERENCE) - -/* - * The following enum maps mnemonic names to the different numeric values - * of XPTTypeDescriptor->tag. - */ -enum XPTTypeDescriptorTags { - TD_INT8 = 0, - TD_INT16 = 1, - TD_INT32 = 2, - TD_INT64 = 3, - TD_UINT8 = 4, - TD_UINT16 = 5, - TD_UINT32 = 6, - TD_UINT64 = 7, - TD_FLOAT = 8, - TD_DOUBLE = 9, - TD_BOOL = 10, - TD_CHAR = 11, - TD_WCHAR = 12, - TD_VOID = 13, - TD_PNSIID = 14, - TD_PBSTR = 15, - TD_PSTRING = 16, - TD_PWSTRING = 17, - TD_INTERFACE_TYPE = 18, - TD_INTERFACE_IS_TYPE = 19 -}; - -struct XPTTypeDescriptor { - XPTTypeDescriptorPrefix prefix; - union { - PRUint16 interface; - PRUint8 argnum; - } type; -}; - -#define XPT_TYPEDESCRIPTOR_SIZE (1 + 2) - -#define XPT_COPY_TYPE(to, from) \ - (to).prefix.flags = (from).prefix.flags; \ - (to).type.interface = (from).type.interface; - -/* - * A ConstDescriptor is a variable-size record that records the name and - * value of a scoped interface constant. - * - * The types of the method parameter are restricted to the following subset - * of TypeDescriptors: - * - * int8, uint8, int16, uint16, int32, uint32, - * int64, uint64, wchar_t, char, string - * - * The type (and thus the size) of the value record is determined by the - * contents of the associated TypeDescriptor record. For instance, if type - * corresponds to int16, then value is a two-byte record consisting of a - * 16-bit signed integer. For a ConstDescriptor type of string, the value - * record is of type String*, i.e. an offset within the data pool to a - * String record containing the constant string. - */ -union XPTConstValue { - PRInt8 i8; - PRUint8 ui8; - PRInt16 i16; - PRUint16 ui16; - PRInt32 i32; - PRUint32 ui32; - PRInt64 i64; - PRUint64 ui64; - float flt; - double dbl; - PRBool bul; - char ch; - PRUint16 wch; - nsID *iid; - XPTString *string; - char *str; - PRUint16 *wstr; -}; /* varies according to type */ - -struct XPTConstDescriptor { - char *name; - XPTTypeDescriptor type; - union XPTConstValue value; -}; - -/* - * A ParamDescriptor is a variable-size record used to describe either a - * single argument to a method or a method's result. - */ -struct XPTParamDescriptor { - PRUint8 flags; - XPTTypeDescriptor type; -}; - -/* flag bits -- jband and fur were right, and I was miserably wrong */ -#define XPT_PD_IN 0x80 -#define XPT_PD_OUT 0x40 -#define XPT_PD_RETVAL 0x20 -#define XPT_PD_SHARED 0x10 -#define XPT_PD_FLAGMASK 0xf0 - -#define XPT_PD_IS_IN(flags) (flags & XPT_PD_IN) -#define XPT_PD_IS_OUT(flags) (flags & XPT_PD_OUT) -#define XPT_PD_IS_RETVAL(flags) (flags & XPT_PD_RETVAL) -#define XPT_PD_IS_SHARED(flags) (flags & XPT_PD_SHARED) - -#define XPT_PARAMDESCRIPTOR_SIZE (XPT_TYPEDESCRIPTOR_SIZE + 1) - -extern XPT_PUBLIC_API(PRBool) -XPT_FillParamDescriptor(XPTParamDescriptor *pd, PRUint8 flags, - XPTTypeDescriptor *type); - -/* - * A MethodDescriptor is a variable-size record used to describe a single - * interface method. - */ -struct XPTMethodDescriptor { - PRUint8 flags; - char *name; - PRUint8 num_args; - XPTParamDescriptor *params; - XPTParamDescriptor *result; -}; - -/* flag bits -- jband and fur were right, and I was miserably wrong */ -#define XPT_MD_GETTER 0x80 -#define XPT_MD_SETTER 0x40 -#define XPT_MD_VARARGS 0x20 -#define XPT_MD_CTOR 0x10 -#define XPT_MD_HIDDEN 0x08 -#define XPT_MD_FLAGMASK 0xf8 - -#define XPT_MD_IS_GETTER(flags) (flags & XPT_MD_GETTER) -#define XPT_MD_IS_SETTER(flags) (flags & XPT_MD_SETTER) -#define XPT_MD_IS_VARARGS(flags) (flags & XPT_MD_VARARGS) -#define XPT_MD_IS_CTOR(flags) (flags & XPT_MD_CTOR) -#define XPT_MD_IS_HIDDEN(flags) (flags & XPT_MD_HIDDEN) - -extern XPT_PUBLIC_API(PRBool) -XPT_FillMethodDescriptor(XPTMethodDescriptor *meth, PRUint8 flags, char *name, - PRUint8 num_args); - -/* - * Annotation records are variable-size records used to store secondary - * information about the typelib, e.g. such as the name of the tool that - * generated the typelib file, the date it was generated, etc. The - * information is stored with very loose format requirements so as to - * allow virtually any private data to be stored in the typelib. - * - * There are two types of Annotations: - * - * EmptyAnnotation - * PrivateAnnotation - * - * The tag field of the prefix discriminates among the variant record - * types for Annotation's. If the tag is 0, this record is an - * EmptyAnnotation. EmptyAnnotation's are ignored - they're only used to - * indicate an array of Annotation's that's completely empty. If the tag - * is 1, the record is a PrivateAnnotation. - */ - -struct XPTAnnotation { - XPTAnnotation *next; - PRUint8 flags; - /* remaining fields are present in typelib iff XPT_ANN_IS_PRIVATE */ - XPTString *creator; - XPTString *private_data; -}; - -#define XPT_ANN_LAST 0x80 -#define XPT_ANN_IS_LAST(flags) (flags & XPT_ANN_LAST) -#define XPT_ANN_PRIVATE 0x40 -#define XPT_ANN_IS_PRIVATE(flags) (flags & XPT_ANN_PRIVATE) - -extern XPT_PUBLIC_API(XPTAnnotation *) -XPT_NewAnnotation(PRUint8 flags, XPTString *creator, XPTString *private_data); - -/***************************************************************************/ -/* -* XXX It's not clear that these should really be exported -*/ - -extern XPT_PUBLIC_API(PRUint32) -XPT_SizeOfTypeDescriptor(XPTTypeDescriptor *td); - -extern XPT_PUBLIC_API(PRUint32) -XPT_SizeOfMethodDescriptor(XPTMethodDescriptor *md); - -extern XPT_PUBLIC_API(PRUint32) -XPT_SizeOfConstDescriptor(XPTConstDescriptor *cd); - -extern XPT_PUBLIC_API(PRUint32) -XPT_SizeOfInterfaceDescriptor(XPTInterfaceDescriptor *id); - -extern XPT_PUBLIC_API(PRBool) -XPT_FillConstDescriptor(XPTConstDescriptor *cd, char *name, - XPTTypeDescriptor type, union XPTConstValue value); - -PR_END_EXTERN_C - -#endif /* __xpt_struct_h__ */ diff --git a/mozilla/xpcom/libxpt/public/xpt_xdr.h b/mozilla/xpcom/libxpt/public/xpt_xdr.h deleted file mode 100644 index d987874d081..00000000000 --- a/mozilla/xpcom/libxpt/public/xpt_xdr.h +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* - * Basic APIs for streaming typelib structures to/from disk. - */ - -#ifndef __xpt_xdr_h__ -#define __xpt_xdr_h__ - -#include -#include -#include -#include "xpt_struct.h" - -PR_BEGIN_EXTERN_C - -typedef struct XPTState XPTState; -typedef struct XPTDatapool XPTDatapool; -typedef struct XPTCursor XPTCursor; - -/* Opaque type, for internal use */ -typedef struct XPTHashTable XPTHashTable; - -extern XPT_PUBLIC_API(PRBool) -XPT_DoString(XPTCursor *cursor, XPTString **strp); - -extern XPT_PUBLIC_API(PRBool) -XPT_DoStringInline(XPTCursor *cursor, XPTString **strp); - -extern XPT_PUBLIC_API(PRBool) -XPT_DoCString(XPTCursor *cursor, char **strp); - -extern XPT_PUBLIC_API(PRBool) -XPT_DoIdentifier(XPTCursor *cursor, char **identp); - -extern XPT_PUBLIC_API(PRBool) -XPT_DoIID(XPTCursor *cursor, nsID *iidp); - -extern XPT_PUBLIC_API(PRBool) -XPT_Do64(XPTCursor *cursor, PRInt64 *u64p); - -extern XPT_PUBLIC_API(PRBool) -XPT_Do32(XPTCursor *cursor, PRUint32 *u32p); - -extern XPT_PUBLIC_API(PRBool) -XPT_Do16(XPTCursor *cursor, PRUint16 *u16p); - -extern XPT_PUBLIC_API(PRBool) -XPT_Do8(XPTCursor *cursor, PRUint8 *u8p); - -/* - * When working with bitfields, use the DoBits call with a uint8. - * Only the appropriate number of bits are manipulated, so when - * you're decoding you probably want to ensure that the uint8 is pre-zeroed. - * When you're done sending bits along, use - * XPT_FlushBits to make sure that you don't eat a leading bit from the - * next structure. (You should probably be writing full bytes' worth of bits - * anyway, and zeroing out the bits you don't use, but just to be sure...) - */ - -extern XPT_PUBLIC_API(PRBool) -XPT_DoBits(XPTCursor *cursor, PRUint8 *u8p, int nbits); - -#define XPT_DO_BITS(curs, field, width, scr) (PR_TRUE) - -/* returns the number of bits skipped, which should be 0-7 */ -extern XPT_PUBLIC_API(int) -XPT_FlushBits(XPTCursor *cursor); - -extern XPT_PUBLIC_API(PRBool) -XPT_DoHeader(XPTCursor *cursor, XPTHeader **headerp); - -typedef enum { - XPT_ENCODE, - XPT_DECODE -} XPTMode; - -typedef enum { - XPT_HEADER = 0, - XPT_DATA = 1 -} XPTPool; - -struct XPTState { - XPTMode mode; - PRUint32 data_offset; - PRUint32 next_cursor[2]; - XPTDatapool *pool; -}; - -struct XPTDatapool { - XPTHashTable *offset_map; - char *data; - PRUint32 count; - PRUint32 allocated; -}; - -struct XPTCursor { - XPTState *state; - XPTPool pool; - PRUint32 offset; - PRUint8 bits; -}; - -extern XPT_PUBLIC_API(XPTState *) -XPT_NewXDRState(XPTMode mode, char *data, PRUint32 len); - -extern XPT_PUBLIC_API(PRBool) -XPT_MakeCursor(XPTState *state, XPTPool pool, PRUint32 len, XPTCursor *cursor); - -extern XPT_PUBLIC_API(PRBool) -XPT_SeekTo(XPTCursor *cursor, PRUint32 offset); - -extern XPT_PUBLIC_API(void) -XPT_DestroyXDRState(XPTState *state); - -/* Set file_length based on the data used in the state. (Only ENCODE.) */ -extern XPT_PUBLIC_API(PRBool) -XPT_UpdateFileLength(XPTState *state); - -extern XPT_PUBLIC_API(void) -XPT_GetXDRData(XPTState *state, XPTPool pool, char **data, PRUint32 *len); - -/* set or get the data offset for the state, depending on mode */ -extern XPT_PUBLIC_API(void) -XPT_DataOffset(XPTState *state, PRUint32 *data_offsetp); - -extern XPT_PUBLIC_API(void) -XPT_SetDataOffset(XPTState *state, PRUint32 data_offset); - -extern XPT_PUBLIC_API(PRUint32) -XPT_GetOffsetForAddr(XPTCursor *cursor, void *addr); - -extern XPT_PUBLIC_API(PRBool) -XPT_SetOffsetForAddr(XPTCursor *cursor, void *addr, PRUint32 offset); - -extern XPT_PUBLIC_API(PRBool) -XPT_SetAddrForOffset(XPTCursor *cursor, PRUint32 offset, void *addr); - -extern XPT_PUBLIC_API(void *) -XPT_GetAddrForOffset(XPTCursor *cursor, PRUint32 offset); - -/* all data structures are big-endian */ - -#if defined IS_BIG_ENDIAN -# define XPT_SWAB32(x) x -# define XPT_SWAB16(x) x -#elif defined IS_LITTLE_ENDIAN -# define XPT_SWAB32(x) (((x) >> 24) | \ - (((x) >> 8) & 0xff00) | \ - (((x) << 8) & 0xff0000) | \ - ((x) << 24)) -# define XPT_SWAB16(x) (((x) >> 8) | ((x) << 8)) -#else -# error "unknown byte order" -#endif - -/* - * If we're decoding, we want to read the offset before we check - * for already-decoded values. - * - * Then we check for repetition: CheckForRepeat will see if we've already - * encoded/decoded this value, and if so will set offset/addr correctly - * and make already be true. If not, it will set up the cursor for - * encoding (reserve space) or decoding (seek to correct location) as - * appropriate. In the encode case, it will also set the addr->offset - * mapping. - */ - -#define XPT_PREAMBLE_(cursor, addrp, pool, size, new_curs, already) \ - XPTMode mode = cursor->state->mode; \ - if (!(mode == XPT_ENCODE || XPT_Do32(cursor, &new_curs.offset)) || \ - !CheckForRepeat(cursor, (void **)addrp, pool, \ - mode == XPT_ENCODE ? size : 0, &new_curs, \ - &already) || \ - !(mode == XPT_DECODE || XPT_Do32(cursor, &new_curs.offset))) \ - return PR_FALSE; \ - if (already) \ - return PR_TRUE; \ - -/* XXXmccabe currently not used! */ -/* also, XPT_ALLOC isn't defined. */ -#if 0 -#define XPT_PREAMBLE(cursor, addrp, pool, size, new_curs, already, \ - XPTType, localp) \ - { \ - XPT_PREAMBLE_(cursor, addrp, pool, size, new_curs, already); \ - XPT_ALLOC(addrp, new_curs, XPTType, localp) \ - } -#endif - -#define XPT_PREAMBLE_NO_ALLOC(cursor, addrp, pool, size, new_curs, already) \ - { \ - XPT_PREAMBLE_(cursor, addrp, pool, size, new_curs, already) \ - } - -#define XPT_ERROR_HANDLE(free_it) \ - error: \ - if (cursor->state->mode == XPT_DECODE) \ - XPT_FREEIF(free_it); \ - return PR_FALSE; - - -PR_END_EXTERN_C - -#endif /* __xpt_xdr_h__ */ diff --git a/mozilla/xpcom/libxpt/src/Makefile.in b/mozilla/xpcom/libxpt/src/Makefile.in deleted file mode 100644 index 46499e3ff55..00000000000 --- a/mozilla/xpcom/libxpt/src/Makefile.in +++ /dev/null @@ -1,46 +0,0 @@ -# -# 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. -# - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = libxpt -LIBRARY_NAME = xpt - -LIB_IS_C_ONLY = 1 - -CSRCS = xpt_struct.c \ - xpt_xdr.c \ - $(NULL) - -REQUIRES = $(MODULE) - -# build libxpt (but not xptinfo, xptcall subdirs) early so that it'll be -# available to xpidl, which also must be built early. -export:: libs - -# -# Because ../tools/Makefile.in requires libxpt.a, we have to force the -# static lib to be built, even if NO_STATIC_LIB is defined. -# -override NO_STATIC_LIB= - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/src/makefile.win b/mozilla/xpcom/libxpt/src/makefile.win deleted file mode 100644 index b040768d0a8..00000000000 --- a/mozilla/xpcom/libxpt/src/makefile.win +++ /dev/null @@ -1,52 +0,0 @@ -#!nmake -# -# 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. - -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = DLL - -DEPTH=..\..\.. - -LIBNAME = .\$(OBJDIR)\libxpt$(MOZ_BITS) -DLL = $(LIBNAME).dll - -LCFLAGS = -DEXPORT_XPT_API -DWIN32_LEAN_AND_MEAN - -LINCS = \ - -I$(PUBLIC)\libxpt \ - $(NULL) - -LLIBS = \ - $(NULL) - -CSRCS = \ - xpt_struct.c \ - xpt_xdr.c \ - $(NULL) - -C_OBJS = \ - .\$(OBJDIR)\xpt_struct.obj \ - .\$(OBJDIR)\xpt_xdr.obj \ - $(NULL) - -MODULE = libxpt - -include <$(DEPTH)\config\rules.mak> - -export:: $(DLL) - $(MAKE_INSTALL) $(LIBNAME).$(DLL_SUFFIX) $(DIST)\bin - $(MAKE_INSTALL) $(LIBNAME).$(LIB_SUFFIX) $(DIST)\lib diff --git a/mozilla/xpcom/libxpt/src/xpt_struct.c b/mozilla/xpcom/libxpt/src/xpt_struct.c deleted file mode 100644 index 51ac1e26979..00000000000 --- a/mozilla/xpcom/libxpt/src/xpt_struct.c +++ /dev/null @@ -1,788 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* Implementation of XDR routines for typelib structures. */ - -#include "xpt_xdr.h" -#include "xpt_struct.h" -#include - -#ifdef XP_MAC -static char *strdup(const char *c) -{ - char *newStr = malloc(strlen(c) + 1); - if (newStr) - { - strcpy(newStr, c); - } - return newStr; -} -#endif - -static PRBool -DoInterfaceDirectoryEntry(XPTCursor *cursor, - XPTInterfaceDirectoryEntry *ide, PRUint16 index); - -#if 0 -/* currently unused */ -static PRBool -DoInterfaceDirectoryEntryIndex(XPTCursor *cursor, - XPTInterfaceDirectoryEntry **idep); -#endif - -static PRBool -DoConstDescriptor(XPTCursor *cursor, XPTConstDescriptor *cd); - -static PRBool -DoMethodDescriptor(XPTCursor *cursor, XPTMethodDescriptor *md); - -static PRBool -DoAnnotation(XPTCursor *cursor, XPTAnnotation **annp); - -static PRBool -DoInterfaceDescriptor(XPTCursor *outer, XPTInterfaceDescriptor **idp); - -static PRBool -DoTypeDescriptorPrefix(XPTCursor *cursor, XPTTypeDescriptorPrefix *tdp); - -static PRBool -DoTypeDescriptor(XPTCursor *cursor, XPTTypeDescriptor *td); - -static PRBool -DoParamDescriptor(XPTCursor *cursor, XPTParamDescriptor *pd); - - -#define CURS_POOL_OFFSET_RAW(cursor) \ - ((cursor)->pool == XPT_HEADER \ - ? (cursor)->offset \ - : (XPT_ASSERT((cursor)->state->data_offset), \ - (cursor)->offset + (cursor)->state->data_offset)) - -#define CURS_POOL_OFFSET(cursor) \ - (CURS_POOL_OFFSET_RAW(cursor) - 1) - -XPT_PUBLIC_API(PRUint32) -XPT_SizeOfHeader(XPTHeader *header) -{ - XPTAnnotation *ann, *last; - PRUint32 size = 16 /* magic */ + - 1 /* major */ + 1 /* minor */ + - 2 /* num_interfaces */ + 4 /* file_length */ + - 4 /* interface_directory */ + 4 /* data_pool */; - - ann = header->annotations; - do { - size += 1; /* Annotation prefix */ - if (XPT_ANN_IS_PRIVATE(ann->flags)) - size += 2 + ann->creator->length + 2 + ann->private_data->length; - last = ann; - ann = ann->next; - } while (!XPT_ANN_IS_LAST(last->flags)); - - return size; -} - -XPT_PUBLIC_API(PRUint32) -XPT_SizeOfHeaderBlock(XPTHeader *header) -{ - PRUint32 size = XPT_SizeOfHeader(header); - - size += header->num_interfaces * sizeof (XPTInterfaceDirectoryEntry); - - return size; -} - -XPT_PUBLIC_API(XPTHeader *) -XPT_NewHeader(PRUint16 num_interfaces) -{ - XPTHeader *header = XPT_NEWZAP(XPTHeader); - if (!header) - return NULL; - memcpy(header->magic, XPT_MAGIC, 16); - header->major_version = XPT_MAJOR_VERSION; - header->minor_version = XPT_MINOR_VERSION; - header->num_interfaces = num_interfaces; - if (num_interfaces) { - header->interface_directory = XPT_CALLOC(num_interfaces * - sizeof(XPTInterfaceDirectoryEntry)); - if (!header->interface_directory) { - XPT_DELETE(header); - return NULL; - } - } - header->data_pool = 0; /* XXX do we even need this struct any more? */ - - return header; -} - -XPT_PUBLIC_API(PRBool) -XPT_DoHeader(XPTCursor *cursor, XPTHeader **headerp) -{ - XPTMode mode = cursor->state->mode; - XPTHeader *header; - PRUint32 ide_offset; - int i; - if (mode == XPT_DECODE) { - header = XPT_NEWZAP(XPTHeader); - if (!header) - return PR_FALSE; - *headerp = header; - } else { - header = *headerp; - } - - if (mode == XPT_ENCODE) { - /* IDEs appear after header, including annotations */ - ide_offset = XPT_SizeOfHeader(*headerp) + 1; /* one-based offset */ - header->data_pool = XPT_SizeOfHeaderBlock(*headerp); - XPT_SetDataOffset(cursor->state, header->data_pool); - } - - for (i = 0; i < 16; i++) { - if (!XPT_Do8(cursor, &header->magic[i])) - goto error; - } - - if(!XPT_Do8(cursor, &header->major_version) || - !XPT_Do8(cursor, &header->minor_version) || - /* XXX check major for compat! */ - !XPT_Do16(cursor, &header->num_interfaces) || - !XPT_Do32(cursor, &header->file_length) || - !XPT_Do32(cursor, &ide_offset)) { - goto error; - } - - if (mode == XPT_ENCODE) - XPT_DataOffset(cursor->state, &header->data_pool); - if (!XPT_Do32(cursor, &header->data_pool)) - goto error; - if (mode == XPT_DECODE) - XPT_DataOffset(cursor->state, &header->data_pool); - - if (mode == XPT_DECODE && header->num_interfaces) { - header->interface_directory = - XPT_CALLOC(header->num_interfaces * - sizeof(XPTInterfaceDirectoryEntry)); - if (!header->interface_directory) - goto error; - } - - if (!DoAnnotation(cursor, &header->annotations)) - goto error; - - /* shouldn't be necessary now, but maybe later */ - XPT_SeekTo(cursor, ide_offset); - - for (i = 0; i < header->num_interfaces; i++) { - if (!DoInterfaceDirectoryEntry(cursor, - &header->interface_directory[i], - (PRUint16)(i + 1))) - goto error; - } - - return PR_TRUE; - - /* XXX need to free child data sometimes! */ - XPT_ERROR_HANDLE(header); -} - -XPT_PUBLIC_API(PRBool) -XPT_FillInterfaceDirectoryEntry(XPTInterfaceDirectoryEntry *ide, - nsID *iid, char *name, char *name_space, - XPTInterfaceDescriptor *descriptor) -{ - XPT_COPY_IID(ide->iid, *iid); - ide->name = name ? strdup(name) : NULL; /* what good is it w/o a name? */ - ide->name_space = name_space ? strdup(name_space) : NULL; - ide->interface_descriptor = descriptor; - return PR_TRUE; -} - -/* InterfaceDirectoryEntry records go in the header */ -PRBool -DoInterfaceDirectoryEntry(XPTCursor *cursor, - XPTInterfaceDirectoryEntry *ide, PRUint16 index) -{ - XPTMode mode = cursor->state->mode; - - /* write the IID in our cursor space */ - if (!XPT_DoIID(cursor, &(ide->iid)) || - - /* write the name string in the data pool, and the offset in our - cursor space */ - !XPT_DoCString(cursor, &(ide->name)) || - - /* write the name_space string in the data pool, and the offset in our - cursor space */ - !XPT_DoCString(cursor, &(ide->name_space)) || - - /* do InterfaceDescriptors -- later, only on encode (see below) */ - !DoInterfaceDescriptor(cursor, &ide->interface_descriptor)) { - goto error; - } - - if (mode == XPT_DECODE) - XPT_SetOffsetForAddr(cursor, ide, index); - -#if 0 /* not yet -- we eagerly load for now */ - /* write the InterfaceDescriptor in the data pool, and the offset - in our cursor space, but only if we're encoding. */ - if (mode == XPT_ENCODE) { - if (!DoInterfaceDescriptor(cursor, - &ide->interface_descriptor)) { - goto error; - } - } -#endif - - return PR_TRUE; - - XPT_ERROR_HANDLE(ide); -} - -#if 0 -/* - * Decode: Get the interface directory entry for the on-disk index. - * Encode: Write the index. - */ -PRBool -DoInterfaceDirectoryEntryIndex(XPTCursor *cursor, - XPTInterfaceDirectoryEntry **idep) -{ - XPTMode mode = cursor->state->mode; - PRUint16 index; - - if (mode == XPT_ENCODE) { - /* XXX index zero is legal, so how do I detect an error? */ - if (*idep) { - index = (PRUint16) XPT_GetOffsetForAddr(cursor, *idep); - if (!index) - return PR_FALSE; - } else { - index = 0; /* no interface */ - } - } - - if (!XPT_Do16(cursor, &index)) - return PR_FALSE; - - if (mode == XPT_DECODE) { - if (index) { - *idep = XPT_GetAddrForOffset(cursor, index); - if (!*idep) - return PR_FALSE; - } else { - *idep = NULL; - } - } - - return PR_TRUE; -} -#endif - -XPT_PUBLIC_API(XPTInterfaceDescriptor *) -XPT_NewInterfaceDescriptor(PRUint16 parent_interface, PRUint16 num_methods, - PRUint16 num_constants, PRUint8 flags) -{ - - XPTInterfaceDescriptor *id = XPT_NEWZAP(XPTInterfaceDescriptor); - if (!id) - return NULL; - - if (num_methods) { - id->method_descriptors = XPT_CALLOC(num_methods * - sizeof(XPTMethodDescriptor)); - if (!id->method_descriptors) - goto free_id; - id->num_methods = num_methods; - } - - if (num_constants) { - id->const_descriptors = XPT_CALLOC(num_constants * - sizeof(XPTConstDescriptor)); - if (!id->const_descriptors) - goto free_meth; - id->num_constants = num_constants; - } - - if (parent_interface) { - id->parent_interface = parent_interface; - } else { - id->parent_interface = 0; - } - - id->flags = flags; - - return id; - - free_meth: - XPT_FREEIF(id->method_descriptors); - free_id: - XPT_DELETE(id); - return NULL; -} - -XPT_PUBLIC_API(PRBool) -XPT_InterfaceDescriptorAddMethods(XPTInterfaceDescriptor *id, PRUint16 num) -{ - XPTMethodDescriptor *old = id->method_descriptors, *new; - - /* XXX should grow in chunks to minimize realloc overhead */ - new = XPT_REALLOC(old, - (id->num_methods + num) * sizeof(XPTMethodDescriptor)); - if (!new) - return PR_FALSE; - - memset(new + id->num_methods, 0, sizeof(XPTMethodDescriptor) * num); - id->method_descriptors = new; - id->num_methods += num; - return PR_TRUE; -} - -XPT_PUBLIC_API(PRBool) -XPT_InterfaceDescriptorAddConsts(XPTInterfaceDescriptor *id, PRUint16 num) -{ - XPTConstDescriptor *old = id->const_descriptors, *new; - - /* XXX should grow in chunks to minimize realloc overhead */ - new = XPT_REALLOC(old, - (id->num_constants + num) * sizeof(XPTConstDescriptor)); - if (!new) - return PR_FALSE; - - memset(new + id->num_constants, 0, sizeof(XPTConstDescriptor) * num); - id->const_descriptors = new; - id->num_constants += num; - return PR_TRUE; -} - -XPT_PUBLIC_API(PRUint32) -XPT_SizeOfTypeDescriptor(XPTTypeDescriptor *td) -{ - PRUint32 size = 1; /* prefix */ - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_TYPE) - size += 2; /* interface_index */ - else if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_IS_TYPE) - size += 1; /* arg_num */ - return size; -} - -XPT_PUBLIC_API(PRUint32) -XPT_SizeOfMethodDescriptor(XPTMethodDescriptor *md) -{ - PRUint32 i, size = 1 /* flags */ + 4 /* name */ + 1 /* num_args */; - - for (i = 0; i < md->num_args; i++) - size += 1 + XPT_SizeOfTypeDescriptor(&md->params[i].type); - - size += 1 + XPT_SizeOfTypeDescriptor(&md->result->type); - return size; -} - -XPT_PUBLIC_API(PRUint32) -XPT_SizeOfConstDescriptor(XPTConstDescriptor *cd) -{ - PRUint32 size = 4 /* name */ + XPT_SizeOfTypeDescriptor(&cd->type); - - switch (XPT_TDP_TAG(cd->type.prefix)) { - case TD_INT8: - case TD_UINT8: - case TD_CHAR: - size ++; - break; - case TD_INT16: - case TD_UINT16: - case TD_WCHAR: - size += 2; - break; - case TD_INT32: - case TD_UINT32: - case TD_PBSTR: /* XXX check for pointer! */ - case TD_PSTRING: - size += 4; - break; - case TD_INT64: - case TD_UINT64: - size += 8; - break; - default: - fprintf(stderr, "libxpt: illegal type in ConstDescriptor: 0x%02x\n", - XPT_TDP_TAG(cd->type.prefix)); - return 0; - } - - return size; -} - -XPT_PUBLIC_API(PRUint32) -XPT_SizeOfInterfaceDescriptor(XPTInterfaceDescriptor *id) -{ - PRUint32 size = 2 /* parent interface */ + 2 /* num_methods */ - + 2 /* num_constants */ + 1 /* flags */, i; - for (i = 0; i < id->num_methods; i++) - size += XPT_SizeOfMethodDescriptor(&id->method_descriptors[i]); - for (i = 0; i < id->num_constants; i++) - size += XPT_SizeOfConstDescriptor(&id->const_descriptors[i]); - return size; -} - -PRBool -DoInterfaceDescriptor(XPTCursor *outer, XPTInterfaceDescriptor **idp) -{ - XPTMode mode = outer->state->mode; - XPTInterfaceDescriptor *id; - XPTCursor curs, *cursor = &curs; - PRUint32 i, id_sz = 0; - - if (mode == XPT_DECODE) { - id = XPT_NEWZAP(XPTInterfaceDescriptor); - if (!id) - return PR_FALSE; - *idp = id; - } else { - id = *idp; - if (!id) { - id_sz = 0; - return XPT_Do32(outer, &id_sz); - } - id_sz = XPT_SizeOfInterfaceDescriptor(id); - } - - if (!XPT_MakeCursor(outer->state, XPT_DATA, id_sz, cursor)) - goto error; - - if (!XPT_Do32(outer, &cursor->offset)) - goto error; - if (mode == XPT_DECODE && !cursor->offset) { - *idp = NULL; - return PR_TRUE; - } - if(!XPT_Do16(cursor, &id->parent_interface) || - !XPT_Do16(cursor, &id->num_methods)) { - goto error; - } - - if (mode == XPT_DECODE && id->num_methods) { - id->method_descriptors = XPT_CALLOC(id->num_methods * - sizeof(XPTMethodDescriptor)); - if (!id->method_descriptors) - goto error; - } - - for (i = 0; i < id->num_methods; i++) { - if (!DoMethodDescriptor(cursor, &id->method_descriptors[i])) - goto error; - } - - if (!XPT_Do16(cursor, &id->num_constants)) { - goto error; - } - - if (mode == XPT_DECODE && id->num_constants) { - id->const_descriptors = XPT_CALLOC(id->num_constants * - sizeof(XPTConstDescriptor)); - if (!id->const_descriptors) - goto error; - } - - for (i = 0; i < id->num_constants; i++) { - if (!DoConstDescriptor(cursor, &id->const_descriptors[i])) { - goto error; - } - } - - if (!XPT_Do8(cursor, &id->flags)) { - goto error; - } - - return PR_TRUE; - - XPT_ERROR_HANDLE(id); -} - -XPT_PUBLIC_API(PRBool) -XPT_FillConstDescriptor(XPTConstDescriptor *cd, char *name, - XPTTypeDescriptor type, union XPTConstValue value) -{ - cd->name = strdup(name); - if (!cd->name) - return PR_FALSE; - XPT_COPY_TYPE(cd->type, type); - /* XXX copy value */ - return PR_TRUE; -} - -PRBool -DoConstDescriptor(XPTCursor *cursor, XPTConstDescriptor *cd) -{ - PRBool ok = PR_FALSE; - - if (!XPT_DoCString(cursor, &cd->name) || - !DoTypeDescriptor(cursor, &cd->type)) { - - return PR_FALSE; - } - - switch(XPT_TDP_TAG(cd->type.prefix)) { - case TD_INT8: - ok = XPT_Do8(cursor, (PRUint8*) &cd->value.i8); - break; - case TD_INT16: - ok = XPT_Do16(cursor, (PRUint16*) &cd->value.i16); - break; - case TD_INT32: - ok = XPT_Do32(cursor, (PRUint32*) &cd->value.i32); - break; - case TD_INT64: - ok = XPT_Do64(cursor, &cd->value.i64); - break; - case TD_UINT8: - ok = XPT_Do8(cursor, &cd->value.ui8); - break; - case TD_UINT16: - ok = XPT_Do16(cursor, &cd->value.ui16); - break; - case TD_UINT32: - ok = XPT_Do32(cursor, &cd->value.ui32); - break; - case TD_UINT64: - ok = XPT_Do64(cursor, &cd->value.ui64); - break; - case TD_CHAR: - ok = XPT_Do8(cursor, (PRUint8*) &cd->value.ch); - break; - case TD_WCHAR: - ok = XPT_Do16(cursor, &cd->value.wch); - break; - case TD_PBSTR: - if (cd->type.prefix.flags & XPT_TDP_POINTER) { - ok = XPT_DoString(cursor, &cd->value.string); - break; - } - /* fall-through */ - default: - fprintf(stderr, "illegal type!\n"); - break; - } - - return ok; - -} - -XPT_PUBLIC_API(PRBool) -XPT_FillMethodDescriptor(XPTMethodDescriptor *meth, PRUint8 flags, char *name, - PRUint8 num_args) -{ - meth->flags = flags & XPT_MD_FLAGMASK; - meth->name = strdup(name); - if (!name) - return PR_FALSE; - meth->num_args = num_args; - if (num_args) { - meth->params = XPT_CALLOC(num_args * sizeof(XPTParamDescriptor)); - if (!meth->params) - goto free_name; - } else { - meth->params = NULL; - } - meth->result = XPT_NEWZAP(XPTParamDescriptor); - if (!meth->result) - goto free_params; - return PR_TRUE; - - free_params: - XPT_DELETE(meth->params); - free_name: - XPT_DELETE(meth->name); - return PR_FALSE; -} - -PRBool -DoMethodDescriptor(XPTCursor *cursor, XPTMethodDescriptor *md) -{ - XPTMode mode = cursor->state->mode; - int i; - - if (!XPT_Do8(cursor, &md->flags) || - !XPT_DoCString(cursor, &md->name) || - !XPT_Do8(cursor, &md->num_args)) - return PR_FALSE; - - if (mode == XPT_DECODE && md->num_args) { - md->params = XPT_CALLOC(md->num_args * sizeof(XPTParamDescriptor)); - if (!md->params) - return PR_FALSE; - } - - for(i = 0; i < md->num_args; i++) { - if (!DoParamDescriptor(cursor, &md->params[i])) - goto error; - } - - if (mode == XPT_DECODE) { - md->result = XPT_NEWZAP(XPTParamDescriptor); - if (!md->result) - return PR_FALSE; - } - - if (!md->result || - !DoParamDescriptor(cursor, md->result)) - goto error; - - return PR_TRUE; - - XPT_ERROR_HANDLE(md->params); -} - -XPT_PUBLIC_API(PRBool) -XPT_FillParamDescriptor(XPTParamDescriptor *pd, PRUint8 flags, - XPTTypeDescriptor *type) -{ - pd->flags = flags & XPT_PD_FLAGMASK; - XPT_COPY_TYPE(pd->type, *type); - return PR_TRUE; -} - -PRBool -DoParamDescriptor(XPTCursor *cursor, XPTParamDescriptor *pd) -{ - if (!XPT_Do8(cursor, &pd->flags) || - !DoTypeDescriptor(cursor, &pd->type)) - return PR_FALSE; - - return PR_TRUE; -} - -/* XXX when we lose the useless TDP wrapper struct, #define this to Do8 */ -PRBool -DoTypeDescriptorPrefix(XPTCursor *cursor, XPTTypeDescriptorPrefix *tdp) -{ - return XPT_Do8(cursor, &tdp->flags); -} - -PRBool -DoTypeDescriptor(XPTCursor *cursor, XPTTypeDescriptor *td) -{ - if (!DoTypeDescriptorPrefix(cursor, &td->prefix)) { - goto error; - } - - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_TYPE) { - if (!XPT_Do16(cursor, &td->type.interface)) - goto error; - } else { - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_IS_TYPE) { - if (!XPT_Do8(cursor, &td->type.argnum)) - goto error; - } - } - - return PR_TRUE; - - XPT_ERROR_HANDLE(td); -} - -XPT_PUBLIC_API(XPTAnnotation *) -XPT_NewAnnotation(PRUint8 flags, XPTString *creator, XPTString *private_data) -{ - XPTAnnotation *ann = XPT_NEWZAP(XPTAnnotation); - if (!ann) - return NULL; - ann->flags = flags; - if (XPT_ANN_IS_PRIVATE(flags)) { - ann->creator = creator; - ann->private_data = private_data; - } - return ann; -} - -PRBool -DoAnnotation(XPTCursor *cursor, XPTAnnotation **annp) -{ - XPTMode mode = cursor->state->mode; - XPTAnnotation *ann; - - if (mode == XPT_DECODE) { - ann = XPT_NEWZAP(XPTAnnotation); - if (!ann) - return PR_FALSE; - *annp = ann; - } else { - ann = *annp; - } - - if (!XPT_Do8(cursor, &ann->flags)) - goto error; - - if (XPT_ANN_IS_PRIVATE(ann->flags)) { - if (!XPT_DoStringInline(cursor, &ann->creator) || - !XPT_DoStringInline(cursor, &ann->private_data)) - goto error_2; - } - - /* - * If a subsequent Annotation fails, what to do? - * - free all annotations, return PR_FALSE? (current behaviour) - * - free failed annotation only, return PR_FALSE (caller can check for - * non-NULL *annp on PR_FALSE return to detect partial annotation - * decoding)? - */ - if (!XPT_ANN_IS_LAST(ann->flags) && - !DoAnnotation(cursor, &ann->next)) - goto error_2; - - return PR_TRUE; - - error_2: - if (ann && XPT_ANN_IS_PRIVATE(ann->flags)) { - XPT_FREEIF(ann->creator); - XPT_FREEIF(ann->private_data); - } - XPT_ERROR_HANDLE(ann); -} - -PRBool -XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block, - PRUint16 num_interfaces, char *name, - PRUint16 *indexp) -{ - int i; - - for (i=1; i<=num_interfaces; i++) { - fprintf(stderr, "%s == %s ?\n", ide_block[i].name, name); - if (strcmp(ide_block[i].name, name) == 0) { - *indexp = i; - return PR_TRUE; - } - } - indexp = 0; - return PR_FALSE; -} - -#if 0 /* need hashtables and stuff */ -XPT_PUBLIC_API(XPTInterfaceDescriptor *) -XPT_GetDescriptorByIndex(XPTCursor *cursor, XPTHeader *header, PRUint16 index) -{ - XPTInterfaceDescriptor *id = header->interface_directory + index; - if (id) - return id; /* XXX refcnt? */ - /* XXX lazily load and allocate later, for now we always read them all - in */ - return id; -} -#endif diff --git a/mozilla/xpcom/libxpt/src/xpt_xdr.c b/mozilla/xpcom/libxpt/src/xpt_xdr.c deleted file mode 100644 index 87bfa692fa2..00000000000 --- a/mozilla/xpcom/libxpt/src/xpt_xdr.c +++ /dev/null @@ -1,672 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* Implementation of XDR primitives. */ - -#include "xpt_xdr.h" -#include -#include /* strchr */ - -static PRBool -CheckForRepeat(XPTCursor *cursor, void **addrp, XPTPool pool, int len, - XPTCursor *new_cursor, PRBool *already); - - -#define ENCODING(cursor) \ - ((cursor)->state->mode == XPT_ENCODE) - -#define CURS_POOL_OFFSET_RAW(cursor) \ - ((cursor)->pool == XPT_HEADER \ - ? (cursor)->offset \ - : (XPT_ASSERT((cursor)->state->data_offset), \ - (cursor)->offset + (cursor)->state->data_offset)) - -#define CURS_POOL_OFFSET(cursor) \ - (CURS_POOL_OFFSET_RAW(cursor) - 1) - -/* can be used as lvalue */ -#define CURS_POINT(cursor) \ - ((cursor)->state->pool->data[CURS_POOL_OFFSET(cursor)]) - -#ifdef DEBUG_shaver -#define DBG(x) printf##x -#else -#define DBG(x) (0) -#endif - -/* XXX fail if XPT_DATA and !state->data_offset */ -#define CHECK_COUNT_(cursor, space) \ - /* if we're in the header, then exceeding the data_offset is illegal */ \ -((cursor)->pool == XPT_HEADER ? \ - (ENCODING(cursor) && \ - ((cursor)->state->data_offset && \ - ((cursor)->offset - 1 + (space) > (cursor)->state->data_offset)) \ - ? (DBG(("no space left in HEADER %d + %d > %d\n", (cursor)->offset, \ - (space), (cursor)->state->data_offset)) && PR_FALSE) \ - : PR_TRUE) : \ - /* if we're in the data area and we're about to exceed the allocation */ \ - (CURS_POOL_OFFSET(cursor) + (space) > (cursor)->state->pool->allocated ? \ - /* then grow if we're in ENCODE mode */ \ - (ENCODING(cursor) ? GrowPool((cursor)->state->pool) \ - /* and fail if we're in DECODE mode */ \ - : (DBG(("can't extend in DECODE")) && PR_FALSE)) \ - /* otherwise we're OK */ \ - : PR_TRUE)) - -#define CHECK_COUNT(cursor, space) \ - (CHECK_COUNT_(cursor, space) \ - ? PR_TRUE \ - : (XPT_ASSERT(0), \ - fprintf(stderr, "FATAL: can't no room for %d in cursor\n", space), \ - PR_FALSE)) - -/* increase the data allocation for the pool by XPT_GROW_CHUNK */ -#define XPT_GROW_CHUNK 8192 - -/* - * quick and dirty hardcoded hashtable, to avoid dependence on nspr or glib. - * XXXmccabe it might turn out that we could use a simpler data structure here. - */ -typedef struct XPTHashRecord { - void *key; - void *value; - struct XPTHashRecord *next; -} XPTHashRecord; - -#define XPT_HASHSIZE 32 - -struct XPTHashTable { /* it's already typedef'ed from before. */ - XPTHashRecord *buckets[XPT_HASHSIZE]; -}; - -static XPTHashTable * -XPT_NewHashTable() { - XPTHashTable *table; - table = XPT_NEWZAP(XPTHashTable); - return table; -} - -static void trimrecord(XPTHashRecord *record) { - if (record == NULL) - return; - trimrecord(record->next); - XPT_DELETE(record); -} - -static void -XPT_HashTableDestroy(XPTHashTable *table) { - int i; - for (i = 0; i < XPT_HASHSIZE; i++) - trimrecord(table->buckets[i]); - XPT_FREE(table); -} - -static void * -XPT_HashTableAdd(XPTHashTable *table, void *key, void *value) { - XPTHashRecord **bucketloc = table->buckets + (((PRInt32)key) % XPT_HASHSIZE); - XPTHashRecord *bucket; - - while (*bucketloc != NULL) - bucketloc = &((*bucketloc)->next); - - bucket = XPT_NEW(XPTHashRecord); - bucket->key = key; - bucket->value = value; - bucket->next = NULL; - *bucketloc = bucket; - return value; -} - -static void * -XPT_HashTableLookup(XPTHashTable *table, void *key) { - XPTHashRecord *bucket = table->buckets[(PRInt32)key % XPT_HASHSIZE]; - while (bucket != NULL) { - if (bucket->key == key) - return bucket->value; - bucket = bucket->next; - } - return NULL; -} - -XPT_PUBLIC_API(XPTState *) -XPT_NewXDRState(XPTMode mode, char *data, PRUint32 len) -{ - XPTState *state; - - state = XPT_NEWZAP(XPTState); - - if (!state) - return NULL; - - state->mode = mode; - state->pool = XPT_NEW(XPTDatapool); - state->next_cursor[0] = state->next_cursor[1] = 1; - if (!state->pool) - goto err_free_state; - - state->pool->count = 0; - state->pool->offset_map = XPT_NewHashTable(); -/* state->pool->offset_map = PL_NewHashTable(32, null_hash, PL_CompareValues, */ -/* PL_CompareValues, NULL, NULL); */ - - if (!state->pool->offset_map) - goto err_free_pool; - if (mode == XPT_DECODE) { - state->pool->data = data; - state->pool->allocated = len; - } else { - state->pool->data = XPT_MALLOC(XPT_GROW_CHUNK); - if (!state->pool->data) - goto err_free_hash; - state->pool->allocated = XPT_GROW_CHUNK; - } - - return state; - - err_free_hash: - XPT_HashTableDestroy(state->pool->offset_map); -/* PL_HashTableDestroy(state->pool->offset_map); */ - err_free_pool: - XPT_DELETE(state->pool); - err_free_state: - XPT_DELETE(state); - return NULL; -} - -XPT_PUBLIC_API(void) -XPT_DestroyXDRState(XPTState *state) -{ - if (state->pool->offset_map) - XPT_HashTableDestroy(state->pool->offset_map); - if (state->mode == XPT_ENCODE) - XPT_DELETE(state->pool->data); - XPT_DELETE(state->pool); - XPT_DELETE(state); -} - -XPT_PUBLIC_API(void) -XPT_GetXDRData(XPTState *state, XPTPool pool, char **data, PRUint32 *len) -{ - if (pool == XPT_HEADER) { - *data = state->pool->data; - } else { - *data = state->pool->data + state->data_offset; - } - *len = state->next_cursor[pool] - 1; -} - -/* All offsets are 1-based */ -XPT_PUBLIC_API(void) -XPT_DataOffset(XPTState *state, PRUint32 *data_offsetp) -{ - if (state->mode == XPT_DECODE) - XPT_SetDataOffset(state, *data_offsetp); - else - *data_offsetp = state->data_offset; -} - -XPT_PUBLIC_API(void) -XPT_SetDataOffset(XPTState *state, PRUint32 data_offset) -{ - state->data_offset = data_offset; -} - -static PRBool -GrowPool(XPTDatapool *pool) -{ - char *newdata = realloc(pool->data, pool->allocated + XPT_GROW_CHUNK); - if (!newdata) - return PR_FALSE; - pool->data = newdata; - pool->allocated += XPT_GROW_CHUNK; - return PR_TRUE; -} - -XPT_PUBLIC_API(PRBool) -XPT_MakeCursor(XPTState *state, XPTPool pool, PRUint32 len, XPTCursor *cursor) -{ - cursor->state = state; - cursor->pool = pool; - cursor->bits = 0; - cursor->offset = state->next_cursor[pool]; - - if (!CHECK_COUNT(cursor, len)) - return PR_FALSE; - - /* this check should be in CHECK_CURSOR */ - if (pool == XPT_DATA && !state->data_offset) { - fprintf(stderr, "no data offset for XPT_DATA cursor!\n"); - return PR_FALSE; - } - - state->next_cursor[pool] += len; - - return PR_TRUE; -} - -XPT_PUBLIC_API(PRBool) -XPT_SeekTo(XPTCursor *cursor, PRUint32 offset) -{ - /* XXX do some real checking and update len and stuff */ - cursor->offset = offset; - return PR_TRUE; -} - -XPT_PUBLIC_API(XPTString *) -XPT_NewString(PRUint16 length, char *bytes) -{ - XPTString *str = XPT_NEW(XPTString); - if (!str) - return NULL; - str->length = length; - /* Alloc one extra to store the trailing nul. */ - str->bytes = malloc(length + 1); - if (!str->bytes) { - XPT_DELETE(str); - return NULL; - } - memcpy(str->bytes, bytes, length); - /* nul-terminate it. */ - str->bytes[length] = '\0'; - return str; -} - -XPT_PUBLIC_API(XPTString *) -XPT_NewStringZ(char *bytes) -{ - PRUint32 length = strlen(bytes); - if (length > 0xffff) - return NULL; /* too long */ - return XPT_NewString((PRUint16)length, bytes); -} - -XPT_PUBLIC_API(PRBool) -XPT_DoStringInline(XPTCursor *cursor, XPTString **strp) -{ - XPTString *str = *strp; - XPTMode mode = cursor->state->mode; - int i; - - if (mode == XPT_DECODE) { - str = XPT_NEWZAP(XPTString); - if (!str) - return PR_FALSE; - *strp = str; - } - - if (!XPT_Do16(cursor, &str->length)) - goto error; - - if (mode == XPT_DECODE) - if (!(str->bytes = malloc(str->length + 1))) - goto error; - - for (i = 0; i < str->length; i++) - if (!XPT_Do8(cursor, (PRUint8 *)&str->bytes[i])) - goto error_2; - - if (mode == XPT_DECODE) - str->bytes[str->length] = 0; - - return PR_TRUE; - error_2: - XPT_DELETE(str->bytes); - error: - XPT_DELETE(str); - return PR_FALSE; -} - -XPT_PUBLIC_API(PRBool) -XPT_DoString(XPTCursor *cursor, XPTString **strp) -{ - XPTCursor my_cursor; - XPTString *str = *strp; - PRBool already; - - XPT_PREAMBLE_NO_ALLOC(cursor, strp, XPT_DATA, str->length + 2, my_cursor, - already); - - return XPT_DoStringInline(&my_cursor, strp); -} - -XPT_PUBLIC_API(PRBool) -XPT_DoCString(XPTCursor *cursor, char **identp) -{ - XPTCursor my_cursor; - char *ident = *identp; - PRUint32 offset = 0; - - XPTMode mode = cursor->state->mode; - - if (mode == XPT_DECODE) { - char *start, *end; - int len; - - if (!XPT_Do32(cursor, &offset)) - return PR_FALSE; - - if (!offset) { - *identp = NULL; - return PR_TRUE; - } - - my_cursor.pool = XPT_DATA; - my_cursor.offset = offset; - my_cursor.state = cursor->state; - start = &CURS_POINT(&my_cursor); - - end = strchr(start, 0); /* find the end of the string */ - if (!end) { - fprintf(stderr, "didn't find end of string on decode!\n"); - return PR_FALSE; - } - len = end - start; - - ident = XPT_MALLOC(len + 1); - if (!ident) - return PR_FALSE; - - memcpy(ident, start, len); - ident[len] = 0; - *identp = ident; - - } else { - - if (!ident) { - offset = 0; - if (!XPT_Do32(cursor, &offset)) - return PR_FALSE; - return PR_TRUE; - } - - if (!XPT_MakeCursor(cursor->state, XPT_DATA, strlen(ident) + 1, - &my_cursor) || - !XPT_Do32(cursor, &my_cursor.offset)) - return PR_FALSE; - - while(*ident) - if (!XPT_Do8(&my_cursor, (PRUint8 *)ident++)) - return PR_FALSE; - if (!XPT_Do8(&my_cursor, (PRUint8 *)ident)) /* write trailing zero */ - return PR_FALSE; - } - - return PR_TRUE; -} - -XPT_PUBLIC_API(PRUint32) -XPT_GetOffsetForAddr(XPTCursor *cursor, void *addr) -{ - return (PRUint32)XPT_HashTableLookup(cursor->state->pool->offset_map, addr); -/* return (PRUint32)PL_HashTableLookup(cursor->state->pool->offset_map, addr); */ -} - -XPT_PUBLIC_API(PRBool) -XPT_SetOffsetForAddr(XPTCursor *cursor, void *addr, PRUint32 offset) -{ - return XPT_HashTableAdd(cursor->state->pool->offset_map, - addr, (void *)offset) != NULL; -/* return PL_HashTableAdd(cursor->state->pool->offset_map, */ -/* addr, (void *)offset) != NULL; */ -} - -XPT_PUBLIC_API(PRBool) -XPT_SetAddrForOffset(XPTCursor *cursor, PRUint32 offset, void *addr) -{ - return XPT_HashTableAdd(cursor->state->pool->offset_map, - (void *)offset, addr) != NULL; -/* return PL_HashTableAdd(cursor->state->pool->offset_map, */ -/* addr, (void *)offset) != NULL; */ -} - -XPT_PUBLIC_API(void *) -XPT_GetAddrForOffset(XPTCursor *cursor, PRUint32 offset) -{ - return XPT_HashTableLookup(cursor->state->pool->offset_map, (void *)offset); -/* return PL_HashTableLookup(cursor->state->pool->offset_map, (void *)offset); */ -} - -static PRBool -CheckForRepeat(XPTCursor *cursor, void **addrp, XPTPool pool, int len, - XPTCursor *new_cursor, PRBool *already) -{ - void *last = *addrp; - - *already = PR_FALSE; - new_cursor->state = cursor->state; - new_cursor->pool = pool; - new_cursor->bits = 0; - - if (cursor->state->mode == XPT_DECODE) { - - last = XPT_GetAddrForOffset(new_cursor, new_cursor->offset); - - if (last) { - *already = PR_TRUE; - *addrp = last; - } - - } else { - - new_cursor->offset = XPT_GetOffsetForAddr(new_cursor, last); - if (new_cursor->offset) { - *already = PR_TRUE; - return PR_TRUE; - } - - /* haven't already found it, so allocate room for it. */ - if (!XPT_MakeCursor(cursor->state, pool, len, new_cursor) || - !XPT_SetOffsetForAddr(new_cursor, *addrp, new_cursor->offset)) - return PR_FALSE; - } - return PR_TRUE; -} - - -/* - * IIDs are written in struct order, in the usual big-endian way. From the - * typelib file spec: - * - * "For example, this IID: - * {00112233-4455-6677-8899-aabbccddeeff} - * is converted to the 128-bit value - * 0x00112233445566778899aabbccddeeff - * Note that the byte storage order corresponds to the layout of the nsIID - * C-struct on a big-endian architecture." - * - * (http://www.mozilla.org/scriptable/typelib_file.html#iid) - */ -XPT_PUBLIC_API(PRBool) -XPT_DoIID(XPTCursor *cursor, nsID *iidp) -{ - int i; - - if (!XPT_Do32(cursor, &iidp->m0) || - !XPT_Do16(cursor, &iidp->m1) || - !XPT_Do16(cursor, &iidp->m2)) - return PR_FALSE; - - for (i = 0; i < 8; i++) - if (!XPT_Do8(cursor, (PRUint8 *)&iidp->m3[i])) - return PR_FALSE; - - return PR_TRUE; -} - -XPT_PUBLIC_API(PRBool) -XPT_Do64(XPTCursor *cursor, PRInt64 *u64p) -{ - return XPT_Do32(cursor, (PRUint32 *)u64p) && - XPT_Do32(cursor, ((PRUint32 *)u64p) + 1); -} - -/* - * When we're writing 32- or 16-bit quantities, we write a byte at a time to - * avoid alignment issues. Someone could come and optimize this to detect - * well-aligned cases and do a single store, if they cared. I might care - * later. - */ -XPT_PUBLIC_API(PRBool) -XPT_Do32(XPTCursor *cursor, PRUint32 *u32p) -{ - union { - PRUint8 b8[4]; - PRUint32 b32; - } u; - - if (!CHECK_COUNT(cursor, 4)) - return PR_FALSE; - - if (ENCODING(cursor)) { - u.b32 = XPT_SWAB32(*u32p); - CURS_POINT(cursor) = u.b8[0]; - cursor->offset++; - CURS_POINT(cursor) = u.b8[1]; - cursor->offset++; - CURS_POINT(cursor) = u.b8[2]; - cursor->offset++; - CURS_POINT(cursor) = u.b8[3]; - } else { - u.b8[0] = CURS_POINT(cursor); - cursor->offset++; - u.b8[1] = CURS_POINT(cursor); - cursor->offset++; - u.b8[2] = CURS_POINT(cursor); - cursor->offset++; - u.b8[3] = CURS_POINT(cursor); - *u32p = XPT_SWAB32(u.b32); - } - cursor->offset++; - return PR_TRUE; -} - -XPT_PUBLIC_API(PRBool) -XPT_Do16(XPTCursor *cursor, PRUint16 *u16p) -{ - union { - PRUint8 b8[2]; - PRUint16 b16; - } u; - - if (!CHECK_COUNT(cursor, 2)) - return PR_FALSE; - - if (ENCODING(cursor)) { - u.b16 = XPT_SWAB16(*u16p); - CURS_POINT(cursor) = u.b8[0]; - cursor->offset++; - CURS_POINT(cursor) = u.b8[1]; - } else { - u.b8[0] = CURS_POINT(cursor); - cursor->offset++; - u.b8[1] = CURS_POINT(cursor); - *u16p = XPT_SWAB16(u.b16); - } - cursor->offset++; - - return PR_TRUE; -} - -XPT_PUBLIC_API(PRBool) -XPT_Do8(XPTCursor *cursor, PRUint8 *u8p) -{ - if (!CHECK_COUNT(cursor, 1)) - return PR_FALSE; - if (cursor->state->mode == XPT_ENCODE) - CURS_POINT(cursor) = *u8p; - else - *u8p = CURS_POINT(cursor); - - cursor->offset++; - - return PR_TRUE; -} - -static PRBool -do_bit(XPTCursor *cursor, PRUint8 *u8p, int bitno) -{ - return PR_FALSE; -#if 0 - int bit_value, delta, new_value; - XPTDatapool *pool = cursor->pool; - - if (cursor->state->mode == XPT_ENCODE) { - bit_value = (*u8p & 1) << (bitno); /* 7 = 0100 0000, 6 = 0010 0000 */ - if (bit_value) { - delta = pool->bit + (bitno) - 7; - new_value = delta >= 0 ? bit_value >> delta : bit_value << -delta; - pool->data[pool->count] |= new_value; - } - } else { - bit_value = pool->data[pool->count] & (1 << (7 - pool->bit)); - *u8p = bit_value >> (7 - pool->bit); - } - if (++pool->bit == 8) { - pool->count++; - pool->bit = 0; - } - - return CHECK_COUNT(cursor); -#endif -} - -XPT_PUBLIC_API(PRBool) -XPT_DoBits(XPTCursor *cursor, PRUint8 *u8p, int nbits) -{ - -#define DO_BIT(cursor, u8p, nbits) \ - if (!do_bit(cursor, u8p, nbits)) \ - return PR_FALSE; - - switch(nbits) { - case 7: - DO_BIT(cursor, u8p, 7); - case 6: - DO_BIT(cursor, u8p, 6); - case 5: - DO_BIT(cursor, u8p, 5); - case 4: - DO_BIT(cursor, u8p, 4); - case 3: - DO_BIT(cursor, u8p, 3); - case 2: - DO_BIT(cursor, u8p, 2); - case 1: - DO_BIT(cursor, u8p, 1); - default:; - }; - -#undef DO_BIT - - return PR_TRUE; -} - -XPT_PUBLIC_API(int) -XPT_FlushBits(XPTCursor *cursor) -{ - return 0; -#if 0 - cursor->bits = 0; - cursor->offset++; - - if (!CHECK_COUNT(cursor)) - return -1; - - return skipped == 8 ? 0 : skipped; -#endif -} diff --git a/mozilla/xpcom/libxpt/tests/Makefile.in b/mozilla/xpcom/libxpt/tests/Makefile.in deleted file mode 100644 index 687928c9fcd..00000000000 --- a/mozilla/xpcom/libxpt/tests/Makefile.in +++ /dev/null @@ -1,36 +0,0 @@ -# -# 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. - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = libxpt - -SIMPLE_PROGRAMS = PrimitiveTest SimpleTypeLib - -CSRCS = PrimitiveTest.c SimpleTypeLib.c - -LIBS = \ - -L$(DIST)/bin \ - -lxpt \ - $(NULL) - -include $(topsrcdir)/config/rules.mk - diff --git a/mozilla/xpcom/libxpt/tests/PrimitiveTest.c b/mozilla/xpcom/libxpt/tests/PrimitiveTest.c deleted file mode 100644 index d1cebb67232..00000000000 --- a/mozilla/xpcom/libxpt/tests/PrimitiveTest.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* Test the xdr primitives from xpt_xdr.c */ - -#include "xpt_xdr.h" -#include -#include /* for memcpy */ - -#define PASS(msg) \ - fprintf(stderr, "PASSED : %s\n", msg); - -#define FAIL(msg) \ - fprintf(stderr, "FAILURE: %s\n", msg); - -#define TRY_(msg, cond, silent) \ - if ((cond) && !silent) { \ - PASS(msg); \ - } else { \ - FAIL(msg); \ - return 1; \ - } - -#define TRY(msg, cond) TRY_(msg, cond, 0) -#define TRY_Q(msg, cond) TRY_(msg, cond, 1); - -XPTString in_str = { 4, "bazz" }; - -struct TestData { - uint32 bit32; - uint16 bit16; - uint8 bit8[2]; - char *cstr; - XPTString *str; -} input = { 0xdeadbeef, 0xcafe, {0xba, 0xbe}, "foobar", &in_str}, - output = {0, 0, {0, 0}, NULL, NULL }; - -void -dump_struct(char *label, struct TestData *str) -{ - fprintf(stderr, "%s: {%#08x, %#04x, {%#02x, %#02x}, %s, %d/%s}\n", - label, str->bit32, str->bit16, str->bit8[0], str->bit8[1], - str->cstr, str->str->length, str->str->bytes); -} - -PRBool -XDR(XPTCursor *cursor, struct TestData *str) -{ - TRY("Do32", XPT_Do32(cursor, &str->bit32)); - TRY("Do16", XPT_Do16(cursor, &str->bit16)); - TRY("Do8", XPT_Do8 (cursor, &str->bit8[0])); - TRY("Do8", XPT_Do8 (cursor, &str->bit8[1])); - TRY("DoCString", XPT_DoCString(cursor, &str->cstr)); - TRY("DoString", XPT_DoString(cursor, &str->str)); - return 0; -} - -int -main(int argc, char **argv) -{ - XPTState *state; - XPTCursor curs, *cursor = &curs; - char *header, *data, *whole; - uint32 hlen, dlen, i; - - TRY("NewState (ENCODE)", (state = XPT_NewXDRState(XPT_ENCODE, NULL, 0))); - - XPT_SetDataOffset(state, sizeof input); - - TRY("MakeCursor", XPT_MakeCursor(state, XPT_HEADER, sizeof input, cursor)); - - dump_struct("before", &input); - - if (XDR(cursor, &input)) - return 1; - - fprintf(stderr, "ENCODE successful\n"); - XPT_GetXDRData(state, XPT_HEADER, &header, &hlen); - fprintf(stderr, "XDR header %d bytes at %p:", - hlen, header); - for (i = 0; i < hlen; i++) - fprintf(stderr, "%c%02x", i ? ',' : ' ', (uint8)header[i]); - fprintf(stderr, "\n"); - - XPT_GetXDRData(state, XPT_DATA, &data, &dlen); - - fprintf(stderr, "XDR data %d bytes at %p:", - dlen, data); - for (i = 0; i < dlen; i++) - fprintf(stderr, "%c%02x/%c", i ? ',' : ' ', (uint8)data[i], - (uint8)data[i]); - fprintf(stderr, "\n"); - - whole = malloc(dlen + hlen); - if (!whole) { - fprintf(stderr, "malloc %d failed!\n", dlen + hlen); - return 1; - } - - /* TRY_Q("malloc", (data2 = malloc(len))); */ - memcpy(whole, header, hlen); - memcpy(whole + hlen, data, dlen); - XPT_DestroyXDRState(state); - - TRY("NewState (DECODE)", (state = XPT_NewXDRState(XPT_DECODE, whole, - hlen + dlen))); - - TRY("MakeCursor", XPT_MakeCursor(state, XPT_HEADER, sizeof input, cursor)); - XPT_SetDataOffset(state, sizeof input); - - if (XDR(cursor, &output)) - return 1; - - dump_struct("after", &output); - XPT_DestroyXDRState(state); - free(whole); - - return 0; -} diff --git a/mozilla/xpcom/libxpt/tests/SimpleTypeLib.c b/mozilla/xpcom/libxpt/tests/SimpleTypeLib.c deleted file mode 100644 index 1f02b2c70a4..00000000000 --- a/mozilla/xpcom/libxpt/tests/SimpleTypeLib.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* Test the structure creation and serialization APIs from xpt_struct.c */ - -#include "xpt_xdr.h" -#include "xpt_struct.h" - -#define PASS(msg) \ - fprintf(stderr, "PASSED : %s\n", msg); - -#define FAIL(msg) \ - fprintf(stderr, "FAILURE: %s\n", msg); - -#define TRY_(msg, cond, silent) \ - if ((cond) && !silent) { \ - PASS(msg); \ - } else { \ - FAIL(msg); \ - return 1; \ - } - -#define TRY(msg, cond) TRY_(msg, cond, 0) -#define TRY_Q(msg, cond) TRY_(msg, cond, 1); - -struct nsID iid = { - 0x00112233, - 0x4455, - 0x6677, - {0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff} -}; - -XPTTypeDescriptor td_void = {0}; - -int -main(int argc, char **argv) -{ - XPTHeader *header; - XPTAnnotation *ann; - XPTInterfaceDescriptor *id; - XPTMethodDescriptor *meth; - - XPTState *state; - XPTCursor curs, *cursor = &curs; - char *data, *head; - FILE *out; - uint32 len, header_sz; - - PRBool ok; - - td_void.prefix.flags = TD_VOID; - -#ifdef XP_MAC - if (argc == 0) { - static char* args[] = { "SimpleTypeLib", "simple.xpt", NULL }; - argc = 2; - argv = args; - } -#endif - - if (argc != 2) { - fprintf(stderr, "Usage: %s \n" - " Creates a simple typelib file.\n", argv[0]); - - return 1; - } - - /* construct a header */ - header = XPT_NewHeader(1); - TRY("NewHeader", header); - - - ann = XPT_NewAnnotation(XPT_ANN_LAST | XPT_ANN_PRIVATE, - XPT_NewStringZ("SimpleTypeLib 1.0"), - XPT_NewStringZ("See You In Rome")); - TRY("NewAnnotation", ann); - header->annotations = ann; - - header_sz = XPT_SizeOfHeaderBlock(header); - - id = XPT_NewInterfaceDescriptor(0, 2, 2, 0); - TRY("NewInterfaceDescriptor", id); - - ok = XPT_FillInterfaceDirectoryEntry(header->interface_directory, &iid, - "Interface", "NS", id); - TRY("FillInterfaceDirectoryEntry", ok); - - /* void method1(void) */ - meth = &id->method_descriptors[0]; - ok = XPT_FillMethodDescriptor(meth, 0, "method1", 0); - TRY("FillMethodDescriptor", ok); - meth->result->flags = 0; - meth->result->type.prefix.flags = TD_VOID; - - /* wstring method2(in uint32, in bool) */ - meth = &id->method_descriptors[1]; - ok = XPT_FillMethodDescriptor(meth, 0, "method2", 2); - TRY("FillMethodDescriptor", ok); - - meth->result->flags = 0; - meth->result->type.prefix.flags = TD_PBSTR | XPT_TDP_POINTER; - meth->params[0].type.prefix.flags = TD_UINT32; - meth->params[0].flags = XPT_PD_IN; - meth->params[1].type.prefix.flags = TD_BOOL; - meth->params[1].flags = XPT_PD_IN; - - /* const one = 1; */ - id->const_descriptors[0].name = "one"; - id->const_descriptors[0].type.prefix.flags = TD_UINT16; - id->const_descriptors[0].value.ui16 = 1; - - /* const squeamish = "ossifrage"; */ - id->const_descriptors[1].name = "squeamish"; - id->const_descriptors[1].type.prefix.flags = TD_PBSTR | XPT_TDP_POINTER; - id->const_descriptors[1].value.string = XPT_NewStringZ("ossifrage"); - - /* serialize it */ - state = XPT_NewXDRState(XPT_ENCODE, NULL, 0); - TRY("NewState (ENCODE)", state); - - ok = XPT_MakeCursor(state, XPT_HEADER, header_sz, cursor); - TRY("MakeCursor", ok); - - ok = XPT_DoHeader(cursor, &header); - TRY("DoHeader", ok); - - out = fopen(argv[1], "wb"); - if (!out) { - perror("FAILED: fopen"); - return 1; - } - - XPT_GetXDRData(state, XPT_HEADER, &head, &len); - fwrite(head, len, 1, out); - - XPT_GetXDRData(state, XPT_DATA, &data, &len); - fwrite(data, len, 1, out); - - if (ferror(out) != 0 || fclose(out) != 0) { - fprintf(stderr, "\nError writing file: %s\n\n", argv[1]); - } else { - fprintf(stderr, "\nFile written: %s\n\n", argv[1]); - } - XPT_DestroyXDRState(state); - - /* XXX DestroyHeader */ - return 0; -} - diff --git a/mozilla/xpcom/libxpt/tests/makefile.win b/mozilla/xpcom/libxpt/tests/makefile.win deleted file mode 100644 index 7ba28d49c1b..00000000000 --- a/mozilla/xpcom/libxpt/tests/makefile.win +++ /dev/null @@ -1,66 +0,0 @@ -#!nmake -# -# 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. - -DEPTH=..\..\.. - -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = EXE -PROG1 = .\$(OBJDIR)\PrimitiveTest.exe -PROG2 = .\$(OBJDIR)\SimpleTypeLib.exe -PROGRAMS = $(PROG1) $(PROG2) - -LCFLAGS=-DUSE_NSREG - -DEFINES=-DWIN32_LEAN_AND_MEAN - -REQUIRES=xpcom libxpt - -LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\libxpt - -LLIBS= \ - $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\libxpt32.lib \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAMS) - -for %p in ($(PROGRAMS)) do $(MAKE_INSTALL) %p $(DIST)\bin - -for %p in ($(TESTCASES)) do $(MAKE_INSTALL) %p $(DIST)\bin - -# Move this into config/obj.inc when it's allowed -.c{.\$(OBJDIR)\}.exe: - $(CC) @<<$(CFGFILE) - $(CFLAGS) - $(LCFLAGS) - $(LINCS) - $(LINCS_1) - $(INCS) - $(LLIBS) - $(OS_LIBS) - -Fd$(PDBFILE) - -Fe.\$(OBJDIR)\ - -Fo.\$(OBJDIR)\ - $(CURDIR)$(*B).c -< - -# build these xpt tools early so that it'll be -# available along with xpidl, which also must be built early. -export:: $(PROGRAMS) - -for %p in ($(PROGRAMS)) do $(MAKE_INSTALL) %p $(DIST)\bin - -# Move this into config/obj.inc when it's allowed -.c{.\$(OBJDIR)\}.exe: - $(CC) @<<$(CFGFILE) - $(CFLAGS) - $(LCFLAGS) - $(LINCS) - $(LINCS_1) - $(INCS) - $(LLIBS) - $(OS_LIBS) - -Fd$(PDBFILE) - -Fe.\$(OBJDIR)\ - -Fo.\$(OBJDIR)\ - $(CURDIR)$(*B).c -< -#ifdef XP_MAC -#include -#include -#include "FullPath.h" -#else -#include -#endif -#include -#include -#include "prprf.h" - -#define BASE_INDENT 3 - -static char *type_array[18] = {"int8", "int16", "int32", "int64", - "uint8", "uint16", "uint32", "uint64", - "float", "double", "boolean", "char", - "wchar_t", "void", "reserved", "reserved", - "reserved", "reserved"}; - -static char *ptype_array[20] = {"int8 *", "int16 *", "int32 *", "int64 *", - "uint8 *", "uint16 *", "uint32 *", "uint64 *", - "float *", "double *", "boolean *", "char *", - "wchar_t *", "void *", "nsIID *", "bstr", - "string", "wstring", "Interface *", - "InterfaceIs *"}; - -static char *rtype_array[20] = {"int8 &", "int16 &", "int32 &", "int64 &", - "uint8 &", "uint16 &", "uint32 &", "uint64 &", - "float &", "double &", "boolean &", "char &", - "wchar_t &", "void &", "nsIID &", "bstr", - "string", "wstring", "Interface &", - "InterfaceIs &"}; - - -PRBool param_problems = PR_FALSE; - -PRBool -XPT_DumpHeader(XPTCursor *cursor, XPTHeader *header, - const int indent, PRBool verbose_mode); - -PRBool -XPT_DumpAnnotations(XPTAnnotation *ann, const int indent, PRBool verbose_mode); - -PRBool -XPT_DumpInterfaceDirectoryEntry(XPTCursor *cursor, - XPTInterfaceDirectoryEntry *ide, - XPTHeader *header, const int indent, - PRBool verbose_mode); - -PRBool -XPT_DumpInterfaceDescriptor(XPTCursor *cursor, XPTInterfaceDescriptor *id, - XPTHeader *header, const int indent, - PRBool verbose_mode); - -PRBool -XPT_DumpMethodDescriptor(XPTHeader *header, XPTMethodDescriptor *md, - const int indent, PRBool verbose_mode); -PRBool -XPT_GetStringForType(XPTHeader *header, XPTTypeDescriptor *td, - char **type_string); - -PRBool -XPT_DumpXPTString(XPTString *str); - -PRBool -XPT_DumpParamDescriptor(XPTHeader *header, XPTParamDescriptor *pd, - const int indent, PRBool verbose_mode, - PRBool is_result); - -PRBool -XPT_DumpTypeDescriptor(XPTTypeDescriptor *td, int indent, - PRBool verbose_mode); - -PRBool -XPT_DumpConstDescriptor(XPTHeader *header, XPTConstDescriptor *cd, - const int indent, PRBool verbose_mode); - -static void -xpt_dump_usage(char *argv[]) { - fprintf(stdout, "Usage: %s [-v] \n" - " -v verbose mode\n", argv[0]); -} - -#ifdef XP_MAC - -static int mac_get_args(char*** argv) -{ - static char* args[] = { "xpt_dump", NULL, NULL }; - static StandardFileReply reply; - - *argv = args; - - printf("choose an .xpt file to dump.\n"); - - StandardGetFile(NULL, 0, NULL, &reply); - if (reply.sfGood && !reply.sfIsFolder) { - short len = 0; - Handle fullPath = NULL; - if (FSpGetFullPath(&reply.sfFile, &len, &fullPath) == noErr && fullPath != NULL) { - char* path = args[1] = XPT_MALLOC(1 + len); - BlockMoveData(*fullPath, path, len); - path[len] = '\0'; - DisposeHandle(fullPath); - return 2; - } - } - - return 1; -} - -#ifdef XPIDL_PLUGIN -#define main xptdump_main -int xptdump_main(int argc, char *argv[]); -#endif - -#endif - - -#if defined(XP_MAC) && defined(XPIDL_PLUGIN) - -#define get_file_length mac_get_file_length -extern size_t mac_get_file_length(const char* filename); - -#else /* !(XP_MAC && XPIDL_PLUGIN) */ - -static size_t get_file_length(const char* filename) -{ - struct stat file_stat; - if (stat(filename, &file_stat) != 0) { - perror("FAILED: get_file_length"); - exit(1); - } - return file_stat.st_size; -} - -#endif /* !(XP_MAC && XPIDL_PLUGIN) */ - -int -main(int argc, char **argv) -{ - PRBool verbose_mode = PR_FALSE; - XPTState *state; - XPTCursor curs, *cursor = &curs; - XPTHeader *header; - size_t flen; - char *whole; - FILE *in; - -#ifdef XP_MAC - if (argc == 0 || argv == NULL) - argc = mac_get_args(&argv); -#endif - - switch (argc) { - case 2: - if (argv[1][0] == '-') { - xpt_dump_usage(argv); - return 1; - } - flen = get_file_length(argv[1]); - in = fopen(argv[1], "rb"); - break; - case 3: - verbose_mode = PR_TRUE; - if (argv[1][0] != '-' || argv[1][1] != 'v') { - xpt_dump_usage(argv); - return 1; - } - flen = get_file_length(argv[2]); - in = fopen(argv[2], "rb"); - break; - default: - xpt_dump_usage(argv); - return 1; - } - - if (!in) { - perror("FAILED: fopen"); - return 1; - } - - whole = malloc(flen); - if (!whole) { - perror("FAILED: malloc for whole"); - return 1; - } - - if (flen > 0) { - size_t rv = fread(whole, 1, flen, in); - if (rv < 0) { - perror("FAILED: reading typelib file"); - return 1; - } - if (rv < flen) { - fprintf(stderr, "short read (%d vs %d)! ouch!\n", rv, flen); - return 1; - } - if (ferror(in) != 0 || fclose(in) != 0) - perror("FAILED: Unable to read typelib file.\n"); - - state = XPT_NewXDRState(XPT_DECODE, whole, flen); - if (!XPT_MakeCursor(state, XPT_HEADER, 0, cursor)) { - fprintf(stdout, "MakeCursor failed\n"); - return 1; - } - if (!XPT_DoHeader(cursor, &header)) { - fprintf(stdout, "DoHeader failed\n"); - return 1; - } - - if (!XPT_DumpHeader(cursor, header, BASE_INDENT, verbose_mode)) { - perror("FAILED: XPT_DumpHeader"); - return 1; - } - - if (param_problems) { - fprintf(stdout, "\nWARNING: ParamDescriptors are present with " - "bad in/out/retval flag information.\nThese have been marked " - "with 'XXX'.\nRemember, retval params should always be marked as out!\n"); - } - - XPT_DestroyXDRState(state); - free(whole); - - } else { - fclose(in); - perror("FAILED: file length <= 0"); - return 1; - } - - return 0; -} - -PRBool -XPT_DumpHeader(XPTCursor *cursor, XPTHeader *header, - const int indent, PRBool verbose_mode) -{ - int i; - - fprintf(stdout, "Header:\n"); - - if (verbose_mode) { - fprintf(stdout, "%*sMagic beans: ", indent, " "); - for (i=0; i<16; i++) { - fprintf(stdout, "%02x", header->magic[i]); - } - fprintf(stdout, "\n"); - if (strncmp((const char*)header->magic, XPT_MAGIC, 16) == 0) - fprintf(stdout, "%*s PASSED\n", indent, " "); - else - fprintf(stdout, "%*s FAILED\n", indent, " "); - } - fprintf(stdout, "%*sMajor version: %d\n", indent, " ", - header->major_version); - fprintf(stdout, "%*sMinor version: %d\n", indent, " ", - header->minor_version); - fprintf(stdout, "%*sNumber of interfaces: %d\n", indent, " ", - header->num_interfaces); - - if (verbose_mode) { - fprintf(stdout, "%*sFile length: %d\n", indent, " ", - header->file_length); - fprintf(stdout, "%*sData pool offset: %d\n\n", indent, " ", - header->data_pool); - } - - fprintf(stdout, "%*sAnnotations:\n", indent, " "); - if (!XPT_DumpAnnotations(header->annotations, indent*2, verbose_mode)) - return PR_FALSE; - - fprintf(stdout, "\nInterface Directory:\n"); - for (i=0; inum_interfaces; i++) { - if (verbose_mode) { - fprintf(stdout, "%*sInterface #%d:\n", indent, " ", i); - if (!XPT_DumpInterfaceDirectoryEntry(cursor, - &header->interface_directory[i], - header, indent*2, - verbose_mode)) { - return PR_FALSE; - } - } else { - if (!XPT_DumpInterfaceDirectoryEntry(cursor, - &header->interface_directory[i], - header, indent, - verbose_mode)) { - return PR_FALSE; - } - } - } - - return PR_TRUE; -} - -PRBool -XPT_DumpAnnotations(XPTAnnotation *ann, const int indent, PRBool verbose_mode) -{ - int i = -1; - XPTAnnotation *last; - int new_indent = indent + BASE_INDENT; - - do { - i++; - if (XPT_ANN_IS_PRIVATE(ann->flags)) { - if (verbose_mode) { - fprintf(stdout, "%*sAnnotation #%d is private.\n", - indent, " ", i); - } else { - fprintf(stdout, "%*sAnnotation #%d:\n", - indent, " ", i); - } - fprintf(stdout, "%*sCreator: ", new_indent, " "); - if (!XPT_DumpXPTString(ann->creator)) - return PR_FALSE; - fprintf(stdout, "\n"); - fprintf(stdout, "%*sPrivate Data: ", new_indent, " "); - if (!XPT_DumpXPTString(ann->private_data)) - return PR_FALSE; - fprintf(stdout, "\n"); - } else { - fprintf(stdout, "%*sAnnotation #%d is empty.\n", - indent, " ", i); - } - last = ann; - ann = ann->next; - } while (!XPT_ANN_IS_LAST(last->flags)); - - if (verbose_mode) { - fprintf(stdout, "%*sAnnotation #%d is the last annotation.\n", - indent, " ", i); - } - - return PR_TRUE; -} - -static void -print_IID(struct nsID *iid, FILE *file) -{ - fprintf(file, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - (PRUint32) iid->m0, (PRUint32) iid->m1,(PRUint32) iid->m2, - (PRUint32) iid->m3[0], (PRUint32) iid->m3[1], - (PRUint32) iid->m3[2], (PRUint32) iid->m3[3], - (PRUint32) iid->m3[4], (PRUint32) iid->m3[5], - (PRUint32) iid->m3[6], (PRUint32) iid->m3[7]); - -} - -PRBool -XPT_DumpInterfaceDirectoryEntry(XPTCursor *cursor, - XPTInterfaceDirectoryEntry *ide, - XPTHeader *header, const int indent, - PRBool verbose_mode) -{ - int new_indent = indent + BASE_INDENT; - - if (verbose_mode) { - fprintf(stdout, "%*sIID: ", indent, " "); - print_IID(&ide->iid, stdout); - fprintf(stdout, "\n"); - - fprintf(stdout, "%*sName: %s\n", - indent, " ", ide->name); - fprintf(stdout, "%*sNamespace: %s\n", - indent, " ", ide->name_space ? ide->name_space : "none"); - fprintf(stdout, "%*sAddress of interface descriptor: %p\n", - indent, " ", ide->interface_descriptor); - - fprintf(stdout, "%*sDescriptor:\n", indent, " "); - - if (!XPT_DumpInterfaceDescriptor(cursor, ide->interface_descriptor, - header, new_indent, verbose_mode)) { - return PR_FALSE; - } - } else { - fprintf(stdout, "%*s- %s::%s (", indent, " ", - ide->name_space ? ide->name_space : "", ide->name); - print_IID(&ide->iid, stdout); - fprintf(stdout, "):\n"); - if (!XPT_DumpInterfaceDescriptor(cursor, ide->interface_descriptor, - header, new_indent, verbose_mode)) { - return PR_FALSE; - } - } - - return PR_TRUE; -} - -PRBool -XPT_DumpInterfaceDescriptor(XPTCursor *cursor, XPTInterfaceDescriptor *id, - XPTHeader *header, const int indent, - PRBool verbose_mode) -{ - XPTInterfaceDirectoryEntry *parent_ide; - int i; - int new_indent = indent + BASE_INDENT; - int more_indent = new_indent + BASE_INDENT; - - if (!id) { - fprintf(stdout, "%*s[Unresolved]\n", indent, " "); - return PR_TRUE; - } - - if (id->parent_interface) { - - parent_ide = &header->interface_directory[id->parent_interface - 1]; - - fprintf(stdout, "%*sParent: %s::%s\n", indent, " ", - parent_ide->name_space ? - parent_ide->name_space : "", - parent_ide->name); - } - - fprintf(stdout, "%*sFlags:\n", indent, " "); - - fprintf(stdout, "%*sScriptable: %s\n", new_indent, " ", - XPT_ID_IS_SCRIPTABLE(id->flags) ? "TRUE" : "FALSE"); - - if (verbose_mode) { - if (id->parent_interface) { - fprintf(stdout, - "%*sIndex of parent interface (in data pool): %d\n", - indent, " ", id->parent_interface); - - } - } else { - } - - if (id->num_methods > 0) { - if (verbose_mode) { - fprintf(stdout, - "%*s# of Method Descriptors: %d\n", - indent, " ", id->num_methods); - } else { - fprintf(stdout, "%*sMethods:\n", indent, " "); - } - - for (i=0; inum_methods; i++) { - if (verbose_mode) { - fprintf(stdout, "%*sMethod #%d:\n", new_indent, " ", i); - if (!XPT_DumpMethodDescriptor(header, - &id->method_descriptors[i], - more_indent, verbose_mode)) { - return PR_FALSE; - } - } else { - if (!XPT_DumpMethodDescriptor(header, - &id->method_descriptors[i], - new_indent, verbose_mode)) { - return PR_FALSE; - } - } - } - } else { - fprintf(stdout, "%*sMethods:\n", indent, " "); - fprintf(stdout, "%*sNo Methods\n", new_indent, " "); - } - - if (id->num_constants > 0) { - if (verbose_mode) { - fprintf(stdout, - "%*s# of Constant Descriptors: %d\n", - indent, " ", id->num_constants); - } else { - fprintf(stdout, "%*sConstants:\n", indent, " "); - } - - for (i=0; inum_constants; i++) { - if (verbose_mode) { - fprintf(stdout, "%*sConstant #%d:\n", new_indent, " ", i); - if (!XPT_DumpConstDescriptor(header, - &id->const_descriptors[i], - more_indent, verbose_mode)) - return PR_FALSE; - } else { - if (!XPT_DumpConstDescriptor(header, - &id->const_descriptors[i], - new_indent, verbose_mode)) { - return PR_FALSE; - } - } - } - } else { - fprintf(stdout, "%*sConstants:\n", indent, " "); - fprintf(stdout, "%*sNo Constants\n", new_indent, " "); - } - - return PR_TRUE; -} - -PRBool -XPT_DumpMethodDescriptor(XPTHeader *header, XPTMethodDescriptor *md, - const int indent, PRBool verbose_mode) -{ - int i; - int new_indent = indent + BASE_INDENT; - int more_indent = new_indent + BASE_INDENT; - - if (verbose_mode) { - fprintf(stdout, "%*sName: %s\n", indent, " ", md->name); - fprintf(stdout, "%*sIs Getter? ", indent, " "); - if (XPT_MD_IS_GETTER(md->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sIs Setter? ", indent, " "); - if (XPT_MD_IS_SETTER(md->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sIs Varargs? ", indent, " "); - if (XPT_MD_IS_VARARGS(md->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sIs Constructor? ", indent, " "); - if (XPT_MD_IS_CTOR(md->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sIs Hidden? ", indent, " "); - if (XPT_MD_IS_HIDDEN(md->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*s# of arguments: %d\n", indent, " ", md->num_args); - fprintf(stdout, "%*sParameter Descriptors:\n", indent, " "); - - for (i=0; inum_args; i++) { - fprintf(stdout, "%*sParameter #%d:\n", new_indent, " ", i); - - if (!XPT_DumpParamDescriptor(header, &md->params[i], more_indent, - verbose_mode, PR_FALSE)) - return PR_FALSE; - } - - fprintf(stdout, "%*sResult:\n", indent, " "); - if (!XPT_DumpParamDescriptor(header, md->result, new_indent, - verbose_mode, PR_TRUE)) { - return PR_FALSE; - } - } else { - char *param_type; - XPTParamDescriptor *pd; - - if (!XPT_GetStringForType(header, &md->result->type, ¶m_type)) { - return PR_FALSE; - } - fprintf(stdout, "%*s%c%c%c%c%c %s %s(", indent - 6, " ", - XPT_MD_IS_GETTER(md->flags) ? 'G' : ' ', - XPT_MD_IS_SETTER(md->flags) ? 'S' : ' ', - XPT_MD_IS_HIDDEN(md->flags) ? 'H' : ' ', - XPT_MD_IS_VARARGS(md->flags) ? 'V' : ' ', - XPT_MD_IS_CTOR(md->flags) ? 'C' : ' ', - param_type, md->name); - for (i=0; inum_args; i++) { - if (i!=0) { - fprintf(stdout, ", "); - } - pd = &md->params[i]; - if (XPT_PD_IS_IN(pd->flags)) { - fprintf(stdout, "in"); - if (XPT_PD_IS_OUT(pd->flags)) { - fprintf(stdout, "/out "); - if (XPT_PD_IS_RETVAL(pd->flags)) { - fprintf(stdout, "retval "); - } - if (XPT_PD_IS_SHARED(pd->flags)) { - fprintf(stdout, "shared "); - } - } else { - fprintf(stdout, " "); - } - } else { - if (XPT_PD_IS_OUT(pd->flags)) { - fprintf(stdout, "out "); - if (XPT_PD_IS_RETVAL(pd->flags)) { - fprintf(stdout, "retval "); - } - if (XPT_PD_IS_SHARED(pd->flags)) { - fprintf(stdout, "shared "); - } - } else { - param_problems = PR_TRUE; - fprintf(stdout, "XXX "); - } - } - if (!XPT_GetStringForType(header, &pd->type, ¶m_type)) { - return PR_FALSE; - } - fprintf(stdout, "%s", param_type); - } - fprintf(stdout, ");\n"); - } - return PR_TRUE; -} - -PRBool -XPT_GetStringForType(XPTHeader *header, XPTTypeDescriptor *td, - char **type_string) -{ - int tag = XPT_TDP_TAG(td->prefix); - - if (tag == TD_INTERFACE_TYPE) { - int index = td->type.interface; - if (!index || index > header->num_interfaces) - *type_string = "UNKNOWN_INTERFACE"; - else - *type_string = header->interface_directory[index-1].name; - } else if (XPT_TDP_IS_POINTER(td->prefix.flags)) { - if (XPT_TDP_IS_REFERENCE(td->prefix.flags)) - *type_string = rtype_array[tag]; - else - *type_string = ptype_array[tag]; - } else { - *type_string = type_array[tag]; - } - - return PR_TRUE; -} - -PRBool -XPT_DumpXPTString(XPTString *str) -{ - int i; - for (i=0; ilength; i++) { - fprintf(stdout, "%c", str->bytes[i]); - } - return PR_TRUE; -} - -PRBool -XPT_DumpParamDescriptor(XPTHeader *header, XPTParamDescriptor *pd, - const int indent, PRBool verbose_mode, - PRBool is_result) -{ - int new_indent = indent + BASE_INDENT; - - if (!XPT_PD_IS_IN(pd->flags) && - !XPT_PD_IS_OUT(pd->flags) && - (XPT_PD_IS_RETVAL(pd->flags) || - XPT_PD_IS_SHARED(pd->flags))) { - param_problems = PR_TRUE; - fprintf(stdout, "XXX\n"); - } else { - if (!XPT_PD_IS_IN(pd->flags) && !XPT_PD_IS_OUT(pd->flags)) { - if (is_result) { - if (XPT_TDP_TAG(pd->type.prefix) != TD_UINT32 && - XPT_TDP_TAG(pd->type.prefix) != TD_VOID) { - param_problems = PR_TRUE; - fprintf(stdout, "XXX\n"); - } - } else { - param_problems = PR_TRUE; - fprintf(stdout, "XXX\n"); - } - } - } - - fprintf(stdout, "%*sIn Param? ", indent, " "); - if (XPT_PD_IS_IN(pd->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sOut Param? ", indent, " "); - if (XPT_PD_IS_OUT(pd->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sRetval? ", indent, " "); - if (XPT_PD_IS_RETVAL(pd->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sShared? ", indent, " "); - if (XPT_PD_IS_SHARED(pd->flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sType Descriptor:\n", indent, " "); - if (!XPT_DumpTypeDescriptor(&pd->type, new_indent, verbose_mode)) - return PR_FALSE; - - return PR_TRUE; -} - -PRBool -XPT_DumpTypeDescriptor(XPTTypeDescriptor *td, int indent, PRBool verbose_mode) -{ - int new_indent = indent + BASE_INDENT; - - fprintf(stdout, "%*sIs Pointer? ", indent, " "); - if (XPT_TDP_IS_POINTER(td->prefix.flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sIs Unique Pointer? ", indent, " "); - if (XPT_TDP_IS_UNIQUE_POINTER(td->prefix.flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sIs Reference? ", indent, " "); - if (XPT_TDP_IS_REFERENCE(td->prefix.flags)) - fprintf(stdout, "TRUE\n"); - else - fprintf(stdout, "FALSE\n"); - - fprintf(stdout, "%*sTag: %d\n", indent, " ", - XPT_TDP_TAG(td->prefix)); - - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_TYPE) { - fprintf(stdout, "%*sInterfaceTypeDescriptor:\n", indent, " "); - fprintf(stdout, "%*sIndex of IDE: %d\n", new_indent, " ", - td->type.interface); - } - - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_IS_TYPE) { - fprintf(stdout, "%*sInterfaceTypeDescriptor:\n", indent, " "); - fprintf(stdout, "%*sIndex of Method Argument: %d\n", new_indent, " ", - td->type.argnum); - } - - return PR_TRUE; -} - -PRBool -XPT_DumpConstDescriptor(XPTHeader *header, XPTConstDescriptor *cd, - const int indent, PRBool verbose_mode) -{ - int new_indent = indent + BASE_INDENT; - char *const_type; -/* char *out; */ - PRUint32 uintout; - PRInt32 intout; - - if (verbose_mode) { - fprintf(stdout, "%*sName: %s\n", indent, " ", cd->name); - fprintf(stdout, "%*sType Descriptor: \n", indent, " "); - if (!XPT_DumpTypeDescriptor(&cd->type, new_indent, verbose_mode)) - return PR_FALSE; - fprintf(stdout, "%*sValue: ", indent, " "); - } else { - if (!XPT_GetStringForType(header, &cd->type, &const_type)) { - return PR_FALSE; - } - fprintf(stdout, "%*s%s %s = ", indent, " ", const_type, cd->name); - } - - switch(XPT_TDP_TAG(cd->type.prefix)) { - case TD_INT8: - fprintf(stdout, "%d", cd->value.i8); - break; - case TD_INT16: - fprintf(stdout, "%d", cd->value.i16); - break; - case TD_INT64: - /* XXX punt for now to remove NSPR linkage... - * borrow from mozilla/nsprpub/pr/src/io/prprf.c::cvt_ll? */ - -/* out = PR_smprintf("%lld", cd->value.i64); */ -/* fputs(out, stdout); */ -/* PR_smprintf_free(out); */ - LL_L2I(intout, cd->value.i64); - fprintf(stdout, "%d", intout); - break; - case TD_INT32: - fprintf(stdout, "%d", cd->value.i32); - break; - case TD_UINT8: - fprintf(stdout, "%d", cd->value.ui8); - break; - case TD_UINT16: - fprintf(stdout, "%d", cd->value.ui16); - break; - case TD_UINT64: -/* out = PR_smprintf("%lld", cd->value.ui64); */ -/* fputs(out, stdout); */ -/* PR_smprintf_free(out); */ - /* XXX punt for now to remove NSPR linkage. */ - LL_L2UI(uintout, cd->value.ui64); - fprintf(stdout, "%d", uintout); - break; - case TD_UINT32: - fprintf(stdout, "%d", cd->value.ui32); - break; - case TD_FLOAT: - fprintf(stdout, "%f", cd->value.flt); - break; - case TD_DOUBLE: - fprintf(stdout, "%g", cd->value.dbl); - break; - case TD_BOOL: - if (cd->value.bul) - fprintf(stdout, "TRUE"); - else - fprintf(stdout, "FALSE"); - break; - case TD_CHAR: - fprintf(stdout, "%c", cd->value.ch); - break; - case TD_WCHAR: - fprintf(stdout, "%c", cd->value.wch & 0xff); - break; - case TD_VOID: - fprintf(stdout, "VOID"); - break; - case TD_PNSIID: - if (XPT_TDP_IS_POINTER(cd->type.prefix.flags)) { - print_IID(cd->value.iid, stdout); - } else - return PR_FALSE; - break; - case TD_PBSTR: - if (XPT_TDP_IS_POINTER(cd->type.prefix.flags)) { - if (!XPT_DumpXPTString(cd->value.string)) - return PR_FALSE; - } else - return PR_FALSE; - break; - case TD_PSTRING: - if (XPT_TDP_IS_POINTER(cd->type.prefix.flags)) { - fprintf(stdout, "%s", cd->value.str); - } else - return PR_FALSE; - break; - case TD_PWSTRING: - if (XPT_TDP_IS_POINTER(cd->type.prefix.flags)) { - PRUint16 *ch = cd->value.wstr; - while (*ch) { - fprintf(stdout, "%c", *ch & 0xff); - ch++; - } - } else - return PR_FALSE; - break; - default: - perror("Unrecognized type"); - return PR_FALSE; - break; - } - - if (verbose_mode) { - fprintf(stdout, "\n"); - } else { - fprintf(stdout, ";\n"); - } - - return PR_TRUE; -} diff --git a/mozilla/xpcom/libxpt/tools/xpt_link.c b/mozilla/xpcom/libxpt/tools/xpt_link.c deleted file mode 100644 index 46a801e0425..00000000000 --- a/mozilla/xpcom/libxpt/tools/xpt_link.c +++ /dev/null @@ -1,698 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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. - */ - -/* - * A utility for linking multiple typelib files. - */ - -#include "xpt_xdr.h" -#include -#ifdef XP_MAC -#include -#else -#include -#endif -#include -#include -#include "prlong.h" - -#ifndef NULL -#define NULL (void *) 0 -#endif - -/* Forward declarations. */ -typedef struct fixElement fixElement; -static int compare_IDEs_by_IID(const void *ap, const void *bp); -static int compare_IDE_with_zero(const void *ap); -static int compare_IDEs_by_name(const void *ap, const void *bp); -static int compare_IDEs_by_name_space(const void *ap, const void *bp); -static int compare_strings(const void *ap, const void *bp); -static int compare_fixElements_by_IID(const void *ap, const void *bp); -static int compare_fixElements_by_name(const void *ap, const void *bp); -static int compare_IIDs(const void *ap, const void *bp); -PRBool shrink_IDE_array(XPTInterfaceDirectoryEntry *ide, - int element_to_delete, int num_interfaces); -PRBool update_fix_array(fixElement *fix, int element_to_delete, - int num_interfaces, int replacement); -static int get_new_index(const fixElement *fix, int num_elements, - int target_file, int target_interface); -PRBool copy_IDE(XPTInterfaceDirectoryEntry *from, - XPTInterfaceDirectoryEntry *to); -PRBool copy_fixElement(fixElement *from, fixElement *to); -static void print_IID(struct nsID *iid, FILE *file); -static void xpt_link_usage(char *argv[]); - -struct fixElement { - nsID iid; - char* name; - int file_num; - int interface_num; - PRBool is_deleted; - /* These next two variables will point you to the substitute interface - * if this one has been deleted. - */ - int maps_to_file_num; - int maps_to_interface_num; -}; - -/* Global variables. */ -int trueNumberOfInterfaces = 0; -int totalNumberOfInterfaces = 0; - -#if defined(XP_MAC) && defined(XPIDL_PLUGIN) - -#define main xptlink_main -int xptlink_main(int argc, char *argv[]); -extern size_t mac_get_file_length(const char* filename); -#define get_file_length mac_get_file_length - -#else - -static size_t get_file_length(const char* filename) -{ - struct stat file_stat; - if (stat(filename, &file_stat) != 0) { - perror("FAILED: get_file_length"); - exit(1); - } - return file_stat.st_size; -} - -#endif /* XP_MAC && XPIDL_PLUGIN */ - -int -main(int argc, char **argv) -{ - XPTState *state; - XPTCursor curs, *cursor = &curs; - XPTHeader *header; - XPTInterfaceDirectoryEntry *newIDE, *IDE_array; - XPTInterfaceDescriptor *id; - XPTTypeDescriptor *td; - XPTAnnotation *ann, *first_ann; - PRUint32 header_sz, len; - size_t flen = 0; - char *head, *data, *whole; - FILE *in, *out; - fixElement *newFix, *fix_array; - int i,j; - int k = 0; - - if (argc < 3) { - xpt_link_usage(argv); - return 1; - } - - /* We're going to keep annotations now, so we'll start off with one - * that will let people know that the resultant type library file - * was generated by this tool (xpt_link). - */ - first_ann = XPT_NewAnnotation(XPT_ANN_LAST | XPT_ANN_PRIVATE, - XPT_NewStringZ("xpt_link"), - XPT_NewStringZ("This is a linked type library file created by xpt_link.")); - - - for (i=2; i 0) { - size_t rv = fread(whole, 1, flen, in); - if (rv < 0) { - perror("FAILED: reading typelib file"); - return 1; - } - if (rv < flen) { - fprintf(stderr, "short read (%d vs %d)! ouch!\n", rv, flen); - return 1; - } - if (ferror(in) != 0 || fclose(in) != 0) { - perror("FAILED: Unable to read typelib file.\n"); - return 1; - } - - state = XPT_NewXDRState(XPT_DECODE, whole, flen); - if (!XPT_MakeCursor(state, XPT_HEADER, 0, cursor)) { - perror("FAILED: XPT_MakeCursor"); - return 1; - } - if (!XPT_DoHeader(cursor, &header)) { - perror("FAILED: XPT_DoHeader"); - return 1; - } - - totalNumberOfInterfaces += header->num_interfaces; - if (k == 0) { - IDE_array = XPT_CALLOC(totalNumberOfInterfaces * sizeof(XPTInterfaceDirectoryEntry)); - fix_array = XPT_CALLOC(totalNumberOfInterfaces * sizeof(fixElement)); - } else { - newIDE = XPT_REALLOC(IDE_array, totalNumberOfInterfaces * sizeof(XPTInterfaceDirectoryEntry)); - newFix = XPT_REALLOC(fix_array, totalNumberOfInterfaces * sizeof(fixElement)); - - if (!newIDE) { - perror("FAILED: XPT_REALLOC of IDE_array"); - return 1; - } - if (!newFix) { - perror("FAILED: XPT_REALLOC of newFix"); - return 1; - } - IDE_array = newIDE; - fix_array = newFix; - } - - for (j=0; jnum_interfaces; j++) { - if (!copy_IDE(&header->interface_directory[j], - &IDE_array[k])) { - perror("FAILED: 1st copying of IDE"); - return 1; - } - fix_array[k].iid = IDE_array[k].iid; - fix_array[k].name = IDE_array[k].name; - fix_array[k].file_num = i-2; - fix_array[k].interface_num = j+1; - fix_array[k].is_deleted = PR_FALSE; - fix_array[k].maps_to_file_num = i-2; - fix_array[k].maps_to_interface_num = j+1; - - k++; - } - - /* Copy the annotations. - */ - ann = first_ann; - while (ann->next != NULL) { - ann = ann->next; - } - if (header->annotations != NULL) { - ann->next = header->annotations; - } - - XPT_FREEIF(header); - if (state) - XPT_DestroyXDRState(state); - free(whole); - flen = 0; - - } else { - fclose(in); - perror("FAILED: file length <= 0"); - return 1; - } - } - - /* Make sure the last annotation is the only one marked as XP_ANN_LAST. - */ - ann = first_ann; - while (ann->next != NULL) { - ann->flags &= ~XPT_ANN_LAST; - ann = ann->next; - } - ann->flags |= XPT_ANN_LAST; - - /* Sort both IDE_array and fix_array by name so we can check for - * name_space::name collisions. - */ - qsort(IDE_array, - totalNumberOfInterfaces, - sizeof(XPTInterfaceDirectoryEntry), - compare_IDEs_by_name); - - qsort(fix_array, - totalNumberOfInterfaces, - sizeof(fixElement), - compare_fixElements_by_name); - - /* trueNumberOfInterfaces == number of interfaces left after deletions - * are made. Initialize it here to be the same as the total number of - * interfaces we'ce encountered thus far. - */ - trueNumberOfInterfaces = totalNumberOfInterfaces; - - /* Iterate through the sorted interfaces. Start at one so we don't - * accidentally walk off the end of the array. - */ - i = 1; - while (i != trueNumberOfInterfaces) { - - /* Check for name_space::name collision. - */ - if (compare_IDEs_by_name(&IDE_array[i-1], &IDE_array[i]) == 0 && - compare_IDEs_by_name_space(&IDE_array[i-1], &IDE_array[i]) == 0) { - - /* If one of the interfaces is unresolved, delete that one - * preferentailly. - */ - if (!IDE_array[i-1].interface_descriptor) { - /* Shrink the IDE_array to delete the duplicate interface. - */ - if (!shrink_IDE_array(IDE_array, - i-1, - trueNumberOfInterfaces)) { - perror("FAILED: shrink_IDE_array"); - return 1; - } - /* Update the fix array. This involves moving the deleted - * entry to the end of the array (rather than deleting it) - * and mapping it to the "replacement" element so we can - * update interface indices appropriately later. - */ - update_fix_array(fix_array, i-1, totalNumberOfInterfaces, i); - /* Decrement the true number of interfaces since we just - * deleted one. There's more than one way to get out of - * this loop. - */ - trueNumberOfInterfaces--; - } else { - if (!IDE_array[i].interface_descriptor || - (compare_IIDs(&IDE_array[i-1].iid, &IDE_array[i].iid) == 0)) { - /* Shrink the IDE_array to delete the duplicate interface. - */ - if (!shrink_IDE_array(IDE_array, - i, - trueNumberOfInterfaces)) { - perror("FAILED: shrink_IDE_array"); - return 1; - } - /* Update the fix array. This involves moving the deleted - * entry to the end of the array (rather than deleting it) - * and mapping it to the "replacement" element so we can - * update interface indices appropriately later. - */ - update_fix_array(fix_array, i, - totalNumberOfInterfaces, i-1); - /* Decrement the true number of interfaces since we just - * deleted one. There's more than one way to get out of - * this loop. - */ - trueNumberOfInterfaces--; - } - } - - } else { - /* Only increment if there was no name_space::name collision. - */ - i++; - } - } - - /* Sort the IDE_array (put them in their final order) so that updating - * of indices will be meaningful. - */ - qsort(IDE_array, - trueNumberOfInterfaces, - sizeof(XPTInterfaceDirectoryEntry), - compare_IDEs_by_IID); - - /* Sort the fix_array to match the IDE_array. - */ - qsort(fix_array, - trueNumberOfInterfaces, - sizeof(fixElement), - compare_fixElements_by_IID); - - /* Iterate through the remaining interfaces (those not deleted) - * looking for references to interfaces (such as id->parent_interface) - * which need an updated index number. - */ - for (i=0; iparent_interface && id->parent_interface != 0) { - id->parent_interface = - get_new_index(fix_array, totalNumberOfInterfaces, - fix_array[i].file_num, id->parent_interface); - } - /* Iterate through the method descriptors looking for params of - * type TD_INTERFACE_TYPE. - */ - for (j=0; jnum_methods; j++) { - /* Cycle through the params first. - */ - for (k=0; kmethod_descriptors[j].num_args; k++) { - /* Define td to save some keystrokes. - */ - td = &id->method_descriptors[j].params[k].type; - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_TYPE) { - td->type.interface = - get_new_index(fix_array, - totalNumberOfInterfaces, - fix_array[i].file_num, - td->type.interface); - } - } - - /* Check the result param too. Define td again to save - * some keystrokes. - */ - td = &id->method_descriptors[j].result->type; - if (XPT_TDP_TAG(td->prefix) == TD_INTERFACE_TYPE) { - td->type.interface = - get_new_index(fix_array, totalNumberOfInterfaces, - fix_array[i].file_num, - td->type.interface); - } - } - } - } - - /* Iterate through the array quickly looking for duplicate IIDS. - * This shouldn't happen, i.e. is a failure condition, so bail - * if we find a duplicate. If we have more than one entry, start - * at one so we don't accidentally grep the ether. - */ - if (trueNumberOfInterfaces>1) { - for (i=1; iannotations = first_ann; - for (i=0; iinterface_directory[i])) { - perror("FAILED: 2nd copying of IDE"); - return 1; - } - } - - header_sz = XPT_SizeOfHeaderBlock(header); - - state = XPT_NewXDRState(XPT_ENCODE, NULL, 0); - if (!state) { - perror("FAILED: error creating XDRState"); - return 1; - } - - XPT_SetDataOffset(state, header_sz); - - if (!XPT_MakeCursor(state, XPT_HEADER, header_sz, cursor)) { - perror("FAILED: error making cursor"); - return 1; - } - - if (!XPT_DoHeader(cursor, &header)) { - perror("FAILED: error doing Header"); - return 1; - } - - out = fopen(argv[1], "wb"); - if (!out) { - perror("FAILED: fopen"); - return 1; - } - - XPT_GetXDRData(state, XPT_HEADER, &head, &len); - fwrite(head, len, 1, out); - - XPT_GetXDRData(state, XPT_DATA, &data, &len); - fwrite(data, len, 1, out); - - if (ferror(out) != 0 || fclose(out) != 0) { - fprintf(stderr, "Error writing file: %s\n", argv[1]); - } else { -/* fprintf(stderr, "File written: %s\n", argv[1]); */ - } - - if (state) - XPT_DestroyXDRState(state); - - return 0; -} - -static int -compare_IDEs_by_IID(const void *ap, - const void *bp) -{ - const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp; - - return compare_IIDs(&ide1->iid, &ide2->iid); -} - -/* For detecting unresolved interfaces. */ -const nsID iid_zero = { 0x0, 0x0, 0x0, - { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }; - -static int -compare_IDE_with_zero(const void *ap) -{ - const XPTInterfaceDirectoryEntry *ide1 = ap; - - return compare_IIDs(&ide1->iid, &iid_zero); -} - -static int -compare_fixElements_by_IID(const void *ap, - const void *bp) -{ - const fixElement *fix1 = ap, *fix2 = bp; - - return compare_IIDs(&fix1->iid, &fix2->iid); -} - -static int -compare_IDEs_by_name(const void *ap, - const void *bp) -{ - const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp; - - return compare_strings(ide1->name, ide2->name); -} - -static int -compare_IDEs_by_name_space(const void *ap, - const void *bp) -{ - const XPTInterfaceDirectoryEntry *ide1 = ap, *ide2 = bp; - - return compare_strings(ide1->name_space, ide2->name_space); -} - -static int -compare_strings(const void *ap, const void *bp) -{ - const char *string1 = ap, *string2 = bp; - - if (!string1 && !string2) - return 0; - if (!string1) - return -1; - if (!string2) - return 1; - - return strcmp(string1, string2); -} - -static int -compare_fixElements_by_name(const void *ap, - const void *bp) -{ - const fixElement *fix1 = ap, *fix2 = bp; - - return compare_strings(fix1->name, fix2->name); -} - -static int -compare_IIDs(const void *ap, const void *bp) -{ - const nsID *a = ap, *b = bp; - int i; -#define COMPARE(field) if (a->field > b->field) return 1; \ - if (b->field > a->field) return -1; - COMPARE(m0); - COMPARE(m1); - COMPARE(m2); - for (i = 0; i < 8; i++) { - COMPARE(m3[i]); - } - return 0; -#undef COMPARE -} - -PRBool -shrink_IDE_array(XPTInterfaceDirectoryEntry *ide, int element_to_delete, - int num_interfaces) -{ - int i; - - if (element_to_delete >= num_interfaces) { - return PR_FALSE; - } - - for (i=element_to_delete+1; i= num_interfaces) { - return PR_FALSE; - } - - deleted = XPT_CALLOC(sizeof(fixElement)); - if (!copy_fixElement(&fix[element_to_delete], deleted)) { - return PR_FALSE; - } - deleted->is_deleted = PR_TRUE; - deleted->maps_to_file_num = fix[replacement].file_num; - deleted->maps_to_interface_num = fix[replacement].interface_num; - - for (i=element_to_delete+1; iiid = from->iid; - to->name = from->name; - to->name_space = from->name_space; - to->interface_descriptor = from->interface_descriptor; - return PR_TRUE; -} - -PRBool -copy_fixElement(fixElement *from, fixElement *to) -{ - if (!from || !to) { - return PR_FALSE; - } - - to->iid = from->iid; - to->name = from->name; - to->file_num = from->file_num; - to->interface_num = from->interface_num; - to->is_deleted = from->is_deleted; - to->maps_to_file_num = from->maps_to_file_num; - to->maps_to_interface_num = from->maps_to_interface_num; - - return PR_TRUE; -} - -static void -print_IID(struct nsID *iid, FILE *file) -{ - fprintf(file, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - (PRUint32) iid->m0, (PRUint32) iid->m1,(PRUint32) iid->m2, - (PRUint32) iid->m3[0], (PRUint32) iid->m3[1], - (PRUint32) iid->m3[2], (PRUint32) iid->m3[3], - (PRUint32) iid->m3[4], (PRUint32) iid->m3[5], - (PRUint32) iid->m3[6], (PRUint32) iid->m3[7]); -} - -static void -xpt_link_usage(char *argv[]) -{ - fprintf(stdout, "Usage: %s outfile file1.xpt file2.xpt ...\n" - " Links multiple typelib files into one outfile\n", argv[0]); -} - diff --git a/mozilla/xpcom/libxpt/xptcall/Makefile.in b/mozilla/xpcom/libxpt/xptcall/Makefile.in deleted file mode 100644 index 8bda381605e..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/Makefile.in +++ /dev/null @@ -1,33 +0,0 @@ -# -# 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. -# - -DEPTH = ../../.. - -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk -include $(topsrcdir)/config/config.mk - -DIRS = public src - -ifdef ENABLE_TESTS -DIRS += tests -endif - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptcall/README b/mozilla/xpcom/libxpt/xptcall/README deleted file mode 100644 index 1236e8966ae..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/README +++ /dev/null @@ -1,6 +0,0 @@ -see: - -http://www.mozilla.org/scriptable/xptcall-faq.html -and -http://lxr.mozilla.org/mozilla/source/xpcom/libxpt/xptcall/porting.html - diff --git a/mozilla/xpcom/libxpt/xptcall/makefile.win b/mozilla/xpcom/libxpt/xptcall/makefile.win deleted file mode 100644 index 7888e8b8312..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/makefile.win +++ /dev/null @@ -1,21 +0,0 @@ -# -# 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. - -DEPTH=..\..\.. -IGNORE_MANIFEST=1 -DIRS=public src tests - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/libxpt/xptcall/porting.html b/mozilla/xpcom/libxpt/xptcall/porting.html deleted file mode 100644 index 38cadb40289..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/porting.html +++ /dev/null @@ -1,13 +0,0 @@ - - -Document Moved! - - -
The xptcall porting document has been moved to: -

-http://lxr.mozilla.org/mozilla/source/xpcom/reflect/xptcall/porting.html -

-Please update your links. -

- - \ No newline at end of file diff --git a/mozilla/xpcom/libxpt/xptcall/public/MANIFEST b/mozilla/xpcom/libxpt/xptcall/public/MANIFEST deleted file mode 100644 index a0fcadac587..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/MANIFEST +++ /dev/null @@ -1,7 +0,0 @@ -# -# This is a list of local files which get copied to the mozilla:dist directory -# - -xptcall.h -xptcstubsdecl.inc -xptcstubsdef.inc diff --git a/mozilla/xpcom/libxpt/xptcall/public/Makefile.in b/mozilla/xpcom/libxpt/xptcall/public/Makefile.in deleted file mode 100644 index e9205e5357b..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/Makefile.in +++ /dev/null @@ -1,33 +0,0 @@ -#!gmake -# 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. - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = xptcall - -EXPORTS = xptcall.h \ - xptcstubsdecl.inc \ - xptcstubsdef.inc \ - $(NULL) - -EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptcall/public/genstubs.pl b/mozilla/xpcom/libxpt/xptcall/public/genstubs.pl deleted file mode 100644 index 417ec6b611d..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/genstubs.pl +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/local/bin/perl - -# This is used to generate stub entry points. We generate a file to -# be included in the declaraion and a file to be used for expanding macros -# to represent the implementation of the stubs. - -$entry_count = 256; -$sentinel_count = 10; - -$decl_name = "xptcstubsdecl.inc"; -$def_name = "xptcstubsdef.inc"; - -## -## Write the declarations include file -## - -die "Can't open $decl_name" if !open(OUTFILE, ">$decl_name"); - -print OUTFILE "// generated file - DO NOT EDIT \n\n"; -print OUTFILE "// includes ",$entry_count," stub entries, and ", - $sentinel_count," sentinel entries\n\n"; -print OUTFILE "// declarations of normal stubs...\n"; -print OUTFILE "// 0 is QueryInterface\n"; -print OUTFILE "// 1 is AddRef\n"; -print OUTFILE "// 2 is Release\n"; -for($i = 0; $i < $entry_count; $i++) { - print OUTFILE "XPTC_EXPORT NS_IMETHOD Stub",$i+3,"();\n"; -} - -print OUTFILE "\n// declarations of sentinel stubs\n"; - -for($i = 0; $i < $sentinel_count; $i++) { - print OUTFILE "XPTC_EXPORT NS_IMETHOD Sentinel",$i,"();\n"; -} -close(OUTFILE); - - -## -## Write the definitions include file. This assumes a macro will be used to -## expand the entries written... -## - -die "Can't open $def_name" if !open(OUTFILE, ">$def_name"); - -print OUTFILE "// generated file - DO NOT EDIT \n\n"; -print OUTFILE "// includes ",$entry_count," stub entries, and ", - $sentinel_count," sentinel entries\n\n"; - -for($i = 0; $i < $entry_count; $i++) { - print OUTFILE "STUB_ENTRY(",$i+3,")\n"; -} - -for($i = 0; $i < $sentinel_count; $i++) { - print OUTFILE "SENTINEL_ENTRY(",$i,")\n"; -} diff --git a/mozilla/xpcom/libxpt/xptcall/public/makefile.win b/mozilla/xpcom/libxpt/xptcall/public/makefile.win deleted file mode 100644 index 25d3c1e475c..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/makefile.win +++ /dev/null @@ -1,29 +0,0 @@ -#!nmake -# -# 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. - -IGNORE_MANIFEST=1 - -DEPTH=..\..\..\.. - -EXPORTS = xptcall.h \ - xptcstubsdecl.inc \ - xptcstubsdef.inc \ - $(NULL) - -MODULE = xptcall - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/libxpt/xptcall/public/xptcall.h b/mozilla/xpcom/libxpt/xptcall/public/xptcall.h deleted file mode 100644 index 02271d07462..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/xptcall.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Public declarations for xptcall. */ - -#ifndef xptcall_h___ -#define xptcall_h___ - -#include "prtypes.h" -#include "nscore.h" -#include "nsISupports.h" -#include "xpt_struct.h" -#include "xptinfo.h" -#include "nsIInterfaceInfo.h" - -/***************************************************************************/ -/* - * The linkage of XPTC API functions differs depending on whether the file is - * used within the XPTC library or not. Any source file within the XPTC - * library should define EXPORT_XPTC_API whereas any client of the library - * should not. - */ -#ifdef EXPORT_XPTC_API -#define XPTC_PUBLIC_API(t) PR_IMPLEMENT(t) -#define XPTC_PUBLIC_DATA(t) PR_IMPLEMENT_DATA(t) -#ifdef _WIN32 -# define XPTC_EXPORT _declspec(dllexport) -#else -# define XPTC_EXPORT -#endif -#else -#ifdef _WIN32 -# define XPTC_PUBLIC_API(t) _declspec(dllimport) t -# define XPTC_PUBLIC_DATA(t) _declspec(dllimport) t -# define XPTC_EXPORT _declspec(dllimport) -#else -# define XPTC_PUBLIC_API(t) PR_IMPLEMENT(t) -# define XPTC_PUBLIC_DATA(t) t -# define XPTC_EXPORT -#endif -#endif -#define XPTC_FRIEND_API(t) XPTC_PUBLIC_API(t) -#define XPTC_FRIEND_DATA(t) XPTC_PUBLIC_DATA(t) -/***************************************************************************/ - -struct nsXPTCMiniVariant -{ -// No ctors or dtors so that we can use arrays of these on the stack -// with no penalty. - union - { - PRInt8 i8; - PRInt16 i16; - PRInt32 i32; - PRInt64 i64; - PRUint8 u8; - PRUint16 u16; - PRUint32 u32; - PRUint64 u64; - float f; - double d; - PRBool b; - char c; - PRUnichar wc; - void* p; - } val; -}; - -struct nsXPTCVariant : public nsXPTCMiniVariant -{ -// No ctors or dtors so that we can use arrays of these on the stack -// with no penalty. - - // inherits 'val' here - void* ptr; - nsXPTType type; - PRUint8 flags; - - enum - { - // these are bitflags! - PTR_IS_DATA = 0x1, // ptr points to 'real' data in val - VAL_IS_OWNED = 0x2, // val.p holds alloc'd ptr that must be freed - VAL_IS_IFACE = 0x4 // val.p holds interface ptr that must be released - }; - - PRBool IsPtrData() const {return (PRBool) (flags & PTR_IS_DATA);} - PRBool IsValOwned() const {return (PRBool) (flags & VAL_IS_OWNED);} - PRBool IsValInterface() const {return (PRBool) (flags & VAL_IS_IFACE);} -}; - -/***************************************************************************/ - -class nsXPTCStubBase : public nsISupports -{ -public: - // Include generated vtbl stub declarations. - // These are virtual and *also* implemented by this class.. -#include "xptcstubsdecl.inc" - - // The following methods must be provided by inheritor of this class. - - // return a refcounted pointer to the InterfaceInfo for this object - // NOTE: on some platforms this MUST not fail or we crash! - NS_IMETHOD GetInterfaceInfo(nsIInterfaceInfo** info) = 0; - - // call this method and return result - NS_IMETHOD CallMethod(PRUint16 methodIndex, - const nsXPTMethodInfo* info, - nsXPTCMiniVariant* params) = 0; -}; - - -PR_BEGIN_EXTERN_C - -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params); - -PR_END_EXTERN_C - -#endif /* xptcall_h___ */ diff --git a/mozilla/xpcom/libxpt/xptcall/public/xptcstubsdecl.inc b/mozilla/xpcom/libxpt/xptcall/public/xptcstubsdecl.inc deleted file mode 100644 index 276162daeee..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/xptcstubsdecl.inc +++ /dev/null @@ -1,276 +0,0 @@ -// generated file - DO NOT EDIT - -// includes 256 stub entries, and 10 sentinel entries - -// declarations of normal stubs... -// 0 is QueryInterface -// 1 is AddRef -// 2 is Release -XPTC_EXPORT NS_IMETHOD Stub3(); -XPTC_EXPORT NS_IMETHOD Stub4(); -XPTC_EXPORT NS_IMETHOD Stub5(); -XPTC_EXPORT NS_IMETHOD Stub6(); -XPTC_EXPORT NS_IMETHOD Stub7(); -XPTC_EXPORT NS_IMETHOD Stub8(); -XPTC_EXPORT NS_IMETHOD Stub9(); -XPTC_EXPORT NS_IMETHOD Stub10(); -XPTC_EXPORT NS_IMETHOD Stub11(); -XPTC_EXPORT NS_IMETHOD Stub12(); -XPTC_EXPORT NS_IMETHOD Stub13(); -XPTC_EXPORT NS_IMETHOD Stub14(); -XPTC_EXPORT NS_IMETHOD Stub15(); -XPTC_EXPORT NS_IMETHOD Stub16(); -XPTC_EXPORT NS_IMETHOD Stub17(); -XPTC_EXPORT NS_IMETHOD Stub18(); -XPTC_EXPORT NS_IMETHOD Stub19(); -XPTC_EXPORT NS_IMETHOD Stub20(); -XPTC_EXPORT NS_IMETHOD Stub21(); -XPTC_EXPORT NS_IMETHOD Stub22(); -XPTC_EXPORT NS_IMETHOD Stub23(); -XPTC_EXPORT NS_IMETHOD Stub24(); -XPTC_EXPORT NS_IMETHOD Stub25(); -XPTC_EXPORT NS_IMETHOD Stub26(); -XPTC_EXPORT NS_IMETHOD Stub27(); -XPTC_EXPORT NS_IMETHOD Stub28(); -XPTC_EXPORT NS_IMETHOD Stub29(); -XPTC_EXPORT NS_IMETHOD Stub30(); -XPTC_EXPORT NS_IMETHOD Stub31(); -XPTC_EXPORT NS_IMETHOD Stub32(); -XPTC_EXPORT NS_IMETHOD Stub33(); -XPTC_EXPORT NS_IMETHOD Stub34(); -XPTC_EXPORT NS_IMETHOD Stub35(); -XPTC_EXPORT NS_IMETHOD Stub36(); -XPTC_EXPORT NS_IMETHOD Stub37(); -XPTC_EXPORT NS_IMETHOD Stub38(); -XPTC_EXPORT NS_IMETHOD Stub39(); -XPTC_EXPORT NS_IMETHOD Stub40(); -XPTC_EXPORT NS_IMETHOD Stub41(); -XPTC_EXPORT NS_IMETHOD Stub42(); -XPTC_EXPORT NS_IMETHOD Stub43(); -XPTC_EXPORT NS_IMETHOD Stub44(); -XPTC_EXPORT NS_IMETHOD Stub45(); -XPTC_EXPORT NS_IMETHOD Stub46(); -XPTC_EXPORT NS_IMETHOD Stub47(); -XPTC_EXPORT NS_IMETHOD Stub48(); -XPTC_EXPORT NS_IMETHOD Stub49(); -XPTC_EXPORT NS_IMETHOD Stub50(); -XPTC_EXPORT NS_IMETHOD Stub51(); -XPTC_EXPORT NS_IMETHOD Stub52(); -XPTC_EXPORT NS_IMETHOD Stub53(); -XPTC_EXPORT NS_IMETHOD Stub54(); -XPTC_EXPORT NS_IMETHOD Stub55(); -XPTC_EXPORT NS_IMETHOD Stub56(); -XPTC_EXPORT NS_IMETHOD Stub57(); -XPTC_EXPORT NS_IMETHOD Stub58(); -XPTC_EXPORT NS_IMETHOD Stub59(); -XPTC_EXPORT NS_IMETHOD Stub60(); -XPTC_EXPORT NS_IMETHOD Stub61(); -XPTC_EXPORT NS_IMETHOD Stub62(); -XPTC_EXPORT NS_IMETHOD Stub63(); -XPTC_EXPORT NS_IMETHOD Stub64(); -XPTC_EXPORT NS_IMETHOD Stub65(); -XPTC_EXPORT NS_IMETHOD Stub66(); -XPTC_EXPORT NS_IMETHOD Stub67(); -XPTC_EXPORT NS_IMETHOD Stub68(); -XPTC_EXPORT NS_IMETHOD Stub69(); -XPTC_EXPORT NS_IMETHOD Stub70(); -XPTC_EXPORT NS_IMETHOD Stub71(); -XPTC_EXPORT NS_IMETHOD Stub72(); -XPTC_EXPORT NS_IMETHOD Stub73(); -XPTC_EXPORT NS_IMETHOD Stub74(); -XPTC_EXPORT NS_IMETHOD Stub75(); -XPTC_EXPORT NS_IMETHOD Stub76(); -XPTC_EXPORT NS_IMETHOD Stub77(); -XPTC_EXPORT NS_IMETHOD Stub78(); -XPTC_EXPORT NS_IMETHOD Stub79(); -XPTC_EXPORT NS_IMETHOD Stub80(); -XPTC_EXPORT NS_IMETHOD Stub81(); -XPTC_EXPORT NS_IMETHOD Stub82(); -XPTC_EXPORT NS_IMETHOD Stub83(); -XPTC_EXPORT NS_IMETHOD Stub84(); -XPTC_EXPORT NS_IMETHOD Stub85(); -XPTC_EXPORT NS_IMETHOD Stub86(); -XPTC_EXPORT NS_IMETHOD Stub87(); -XPTC_EXPORT NS_IMETHOD Stub88(); -XPTC_EXPORT NS_IMETHOD Stub89(); -XPTC_EXPORT NS_IMETHOD Stub90(); -XPTC_EXPORT NS_IMETHOD Stub91(); -XPTC_EXPORT NS_IMETHOD Stub92(); -XPTC_EXPORT NS_IMETHOD Stub93(); -XPTC_EXPORT NS_IMETHOD Stub94(); -XPTC_EXPORT NS_IMETHOD Stub95(); -XPTC_EXPORT NS_IMETHOD Stub96(); -XPTC_EXPORT NS_IMETHOD Stub97(); -XPTC_EXPORT NS_IMETHOD Stub98(); -XPTC_EXPORT NS_IMETHOD Stub99(); -XPTC_EXPORT NS_IMETHOD Stub100(); -XPTC_EXPORT NS_IMETHOD Stub101(); -XPTC_EXPORT NS_IMETHOD Stub102(); -XPTC_EXPORT NS_IMETHOD Stub103(); -XPTC_EXPORT NS_IMETHOD Stub104(); -XPTC_EXPORT NS_IMETHOD Stub105(); -XPTC_EXPORT NS_IMETHOD Stub106(); -XPTC_EXPORT NS_IMETHOD Stub107(); -XPTC_EXPORT NS_IMETHOD Stub108(); -XPTC_EXPORT NS_IMETHOD Stub109(); -XPTC_EXPORT NS_IMETHOD Stub110(); -XPTC_EXPORT NS_IMETHOD Stub111(); -XPTC_EXPORT NS_IMETHOD Stub112(); -XPTC_EXPORT NS_IMETHOD Stub113(); -XPTC_EXPORT NS_IMETHOD Stub114(); -XPTC_EXPORT NS_IMETHOD Stub115(); -XPTC_EXPORT NS_IMETHOD Stub116(); -XPTC_EXPORT NS_IMETHOD Stub117(); -XPTC_EXPORT NS_IMETHOD Stub118(); -XPTC_EXPORT NS_IMETHOD Stub119(); -XPTC_EXPORT NS_IMETHOD Stub120(); -XPTC_EXPORT NS_IMETHOD Stub121(); -XPTC_EXPORT NS_IMETHOD Stub122(); -XPTC_EXPORT NS_IMETHOD Stub123(); -XPTC_EXPORT NS_IMETHOD Stub124(); -XPTC_EXPORT NS_IMETHOD Stub125(); -XPTC_EXPORT NS_IMETHOD Stub126(); -XPTC_EXPORT NS_IMETHOD Stub127(); -XPTC_EXPORT NS_IMETHOD Stub128(); -XPTC_EXPORT NS_IMETHOD Stub129(); -XPTC_EXPORT NS_IMETHOD Stub130(); -XPTC_EXPORT NS_IMETHOD Stub131(); -XPTC_EXPORT NS_IMETHOD Stub132(); -XPTC_EXPORT NS_IMETHOD Stub133(); -XPTC_EXPORT NS_IMETHOD Stub134(); -XPTC_EXPORT NS_IMETHOD Stub135(); -XPTC_EXPORT NS_IMETHOD Stub136(); -XPTC_EXPORT NS_IMETHOD Stub137(); -XPTC_EXPORT NS_IMETHOD Stub138(); -XPTC_EXPORT NS_IMETHOD Stub139(); -XPTC_EXPORT NS_IMETHOD Stub140(); -XPTC_EXPORT NS_IMETHOD Stub141(); -XPTC_EXPORT NS_IMETHOD Stub142(); -XPTC_EXPORT NS_IMETHOD Stub143(); -XPTC_EXPORT NS_IMETHOD Stub144(); -XPTC_EXPORT NS_IMETHOD Stub145(); -XPTC_EXPORT NS_IMETHOD Stub146(); -XPTC_EXPORT NS_IMETHOD Stub147(); -XPTC_EXPORT NS_IMETHOD Stub148(); -XPTC_EXPORT NS_IMETHOD Stub149(); -XPTC_EXPORT NS_IMETHOD Stub150(); -XPTC_EXPORT NS_IMETHOD Stub151(); -XPTC_EXPORT NS_IMETHOD Stub152(); -XPTC_EXPORT NS_IMETHOD Stub153(); -XPTC_EXPORT NS_IMETHOD Stub154(); -XPTC_EXPORT NS_IMETHOD Stub155(); -XPTC_EXPORT NS_IMETHOD Stub156(); -XPTC_EXPORT NS_IMETHOD Stub157(); -XPTC_EXPORT NS_IMETHOD Stub158(); -XPTC_EXPORT NS_IMETHOD Stub159(); -XPTC_EXPORT NS_IMETHOD Stub160(); -XPTC_EXPORT NS_IMETHOD Stub161(); -XPTC_EXPORT NS_IMETHOD Stub162(); -XPTC_EXPORT NS_IMETHOD Stub163(); -XPTC_EXPORT NS_IMETHOD Stub164(); -XPTC_EXPORT NS_IMETHOD Stub165(); -XPTC_EXPORT NS_IMETHOD Stub166(); -XPTC_EXPORT NS_IMETHOD Stub167(); -XPTC_EXPORT NS_IMETHOD Stub168(); -XPTC_EXPORT NS_IMETHOD Stub169(); -XPTC_EXPORT NS_IMETHOD Stub170(); -XPTC_EXPORT NS_IMETHOD Stub171(); -XPTC_EXPORT NS_IMETHOD Stub172(); -XPTC_EXPORT NS_IMETHOD Stub173(); -XPTC_EXPORT NS_IMETHOD Stub174(); -XPTC_EXPORT NS_IMETHOD Stub175(); -XPTC_EXPORT NS_IMETHOD Stub176(); -XPTC_EXPORT NS_IMETHOD Stub177(); -XPTC_EXPORT NS_IMETHOD Stub178(); -XPTC_EXPORT NS_IMETHOD Stub179(); -XPTC_EXPORT NS_IMETHOD Stub180(); -XPTC_EXPORT NS_IMETHOD Stub181(); -XPTC_EXPORT NS_IMETHOD Stub182(); -XPTC_EXPORT NS_IMETHOD Stub183(); -XPTC_EXPORT NS_IMETHOD Stub184(); -XPTC_EXPORT NS_IMETHOD Stub185(); -XPTC_EXPORT NS_IMETHOD Stub186(); -XPTC_EXPORT NS_IMETHOD Stub187(); -XPTC_EXPORT NS_IMETHOD Stub188(); -XPTC_EXPORT NS_IMETHOD Stub189(); -XPTC_EXPORT NS_IMETHOD Stub190(); -XPTC_EXPORT NS_IMETHOD Stub191(); -XPTC_EXPORT NS_IMETHOD Stub192(); -XPTC_EXPORT NS_IMETHOD Stub193(); -XPTC_EXPORT NS_IMETHOD Stub194(); -XPTC_EXPORT NS_IMETHOD Stub195(); -XPTC_EXPORT NS_IMETHOD Stub196(); -XPTC_EXPORT NS_IMETHOD Stub197(); -XPTC_EXPORT NS_IMETHOD Stub198(); -XPTC_EXPORT NS_IMETHOD Stub199(); -XPTC_EXPORT NS_IMETHOD Stub200(); -XPTC_EXPORT NS_IMETHOD Stub201(); -XPTC_EXPORT NS_IMETHOD Stub202(); -XPTC_EXPORT NS_IMETHOD Stub203(); -XPTC_EXPORT NS_IMETHOD Stub204(); -XPTC_EXPORT NS_IMETHOD Stub205(); -XPTC_EXPORT NS_IMETHOD Stub206(); -XPTC_EXPORT NS_IMETHOD Stub207(); -XPTC_EXPORT NS_IMETHOD Stub208(); -XPTC_EXPORT NS_IMETHOD Stub209(); -XPTC_EXPORT NS_IMETHOD Stub210(); -XPTC_EXPORT NS_IMETHOD Stub211(); -XPTC_EXPORT NS_IMETHOD Stub212(); -XPTC_EXPORT NS_IMETHOD Stub213(); -XPTC_EXPORT NS_IMETHOD Stub214(); -XPTC_EXPORT NS_IMETHOD Stub215(); -XPTC_EXPORT NS_IMETHOD Stub216(); -XPTC_EXPORT NS_IMETHOD Stub217(); -XPTC_EXPORT NS_IMETHOD Stub218(); -XPTC_EXPORT NS_IMETHOD Stub219(); -XPTC_EXPORT NS_IMETHOD Stub220(); -XPTC_EXPORT NS_IMETHOD Stub221(); -XPTC_EXPORT NS_IMETHOD Stub222(); -XPTC_EXPORT NS_IMETHOD Stub223(); -XPTC_EXPORT NS_IMETHOD Stub224(); -XPTC_EXPORT NS_IMETHOD Stub225(); -XPTC_EXPORT NS_IMETHOD Stub226(); -XPTC_EXPORT NS_IMETHOD Stub227(); -XPTC_EXPORT NS_IMETHOD Stub228(); -XPTC_EXPORT NS_IMETHOD Stub229(); -XPTC_EXPORT NS_IMETHOD Stub230(); -XPTC_EXPORT NS_IMETHOD Stub231(); -XPTC_EXPORT NS_IMETHOD Stub232(); -XPTC_EXPORT NS_IMETHOD Stub233(); -XPTC_EXPORT NS_IMETHOD Stub234(); -XPTC_EXPORT NS_IMETHOD Stub235(); -XPTC_EXPORT NS_IMETHOD Stub236(); -XPTC_EXPORT NS_IMETHOD Stub237(); -XPTC_EXPORT NS_IMETHOD Stub238(); -XPTC_EXPORT NS_IMETHOD Stub239(); -XPTC_EXPORT NS_IMETHOD Stub240(); -XPTC_EXPORT NS_IMETHOD Stub241(); -XPTC_EXPORT NS_IMETHOD Stub242(); -XPTC_EXPORT NS_IMETHOD Stub243(); -XPTC_EXPORT NS_IMETHOD Stub244(); -XPTC_EXPORT NS_IMETHOD Stub245(); -XPTC_EXPORT NS_IMETHOD Stub246(); -XPTC_EXPORT NS_IMETHOD Stub247(); -XPTC_EXPORT NS_IMETHOD Stub248(); -XPTC_EXPORT NS_IMETHOD Stub249(); -XPTC_EXPORT NS_IMETHOD Stub250(); -XPTC_EXPORT NS_IMETHOD Stub251(); -XPTC_EXPORT NS_IMETHOD Stub252(); -XPTC_EXPORT NS_IMETHOD Stub253(); -XPTC_EXPORT NS_IMETHOD Stub254(); -XPTC_EXPORT NS_IMETHOD Stub255(); -XPTC_EXPORT NS_IMETHOD Stub256(); -XPTC_EXPORT NS_IMETHOD Stub257(); -XPTC_EXPORT NS_IMETHOD Stub258(); - -// declarations of sentinel stubs -XPTC_EXPORT NS_IMETHOD Sentinel0(); -XPTC_EXPORT NS_IMETHOD Sentinel1(); -XPTC_EXPORT NS_IMETHOD Sentinel2(); -XPTC_EXPORT NS_IMETHOD Sentinel3(); -XPTC_EXPORT NS_IMETHOD Sentinel4(); -XPTC_EXPORT NS_IMETHOD Sentinel5(); -XPTC_EXPORT NS_IMETHOD Sentinel6(); -XPTC_EXPORT NS_IMETHOD Sentinel7(); -XPTC_EXPORT NS_IMETHOD Sentinel8(); -XPTC_EXPORT NS_IMETHOD Sentinel9(); diff --git a/mozilla/xpcom/libxpt/xptcall/public/xptcstubsdef.inc b/mozilla/xpcom/libxpt/xptcall/public/xptcstubsdef.inc deleted file mode 100644 index 0f71610fe70..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/public/xptcstubsdef.inc +++ /dev/null @@ -1,270 +0,0 @@ -// generated file - DO NOT EDIT - -// includes 256 stub entries, and 10 sentinel entries - -STUB_ENTRY(3) -STUB_ENTRY(4) -STUB_ENTRY(5) -STUB_ENTRY(6) -STUB_ENTRY(7) -STUB_ENTRY(8) -STUB_ENTRY(9) -STUB_ENTRY(10) -STUB_ENTRY(11) -STUB_ENTRY(12) -STUB_ENTRY(13) -STUB_ENTRY(14) -STUB_ENTRY(15) -STUB_ENTRY(16) -STUB_ENTRY(17) -STUB_ENTRY(18) -STUB_ENTRY(19) -STUB_ENTRY(20) -STUB_ENTRY(21) -STUB_ENTRY(22) -STUB_ENTRY(23) -STUB_ENTRY(24) -STUB_ENTRY(25) -STUB_ENTRY(26) -STUB_ENTRY(27) -STUB_ENTRY(28) -STUB_ENTRY(29) -STUB_ENTRY(30) -STUB_ENTRY(31) -STUB_ENTRY(32) -STUB_ENTRY(33) -STUB_ENTRY(34) -STUB_ENTRY(35) -STUB_ENTRY(36) -STUB_ENTRY(37) -STUB_ENTRY(38) -STUB_ENTRY(39) -STUB_ENTRY(40) -STUB_ENTRY(41) -STUB_ENTRY(42) -STUB_ENTRY(43) -STUB_ENTRY(44) -STUB_ENTRY(45) -STUB_ENTRY(46) -STUB_ENTRY(47) -STUB_ENTRY(48) -STUB_ENTRY(49) -STUB_ENTRY(50) -STUB_ENTRY(51) -STUB_ENTRY(52) -STUB_ENTRY(53) -STUB_ENTRY(54) -STUB_ENTRY(55) -STUB_ENTRY(56) -STUB_ENTRY(57) -STUB_ENTRY(58) -STUB_ENTRY(59) -STUB_ENTRY(60) -STUB_ENTRY(61) -STUB_ENTRY(62) -STUB_ENTRY(63) -STUB_ENTRY(64) -STUB_ENTRY(65) -STUB_ENTRY(66) -STUB_ENTRY(67) -STUB_ENTRY(68) -STUB_ENTRY(69) -STUB_ENTRY(70) -STUB_ENTRY(71) -STUB_ENTRY(72) -STUB_ENTRY(73) -STUB_ENTRY(74) -STUB_ENTRY(75) -STUB_ENTRY(76) -STUB_ENTRY(77) -STUB_ENTRY(78) -STUB_ENTRY(79) -STUB_ENTRY(80) -STUB_ENTRY(81) -STUB_ENTRY(82) -STUB_ENTRY(83) -STUB_ENTRY(84) -STUB_ENTRY(85) -STUB_ENTRY(86) -STUB_ENTRY(87) -STUB_ENTRY(88) -STUB_ENTRY(89) -STUB_ENTRY(90) -STUB_ENTRY(91) -STUB_ENTRY(92) -STUB_ENTRY(93) -STUB_ENTRY(94) -STUB_ENTRY(95) -STUB_ENTRY(96) -STUB_ENTRY(97) -STUB_ENTRY(98) -STUB_ENTRY(99) -STUB_ENTRY(100) -STUB_ENTRY(101) -STUB_ENTRY(102) -STUB_ENTRY(103) -STUB_ENTRY(104) -STUB_ENTRY(105) -STUB_ENTRY(106) -STUB_ENTRY(107) -STUB_ENTRY(108) -STUB_ENTRY(109) -STUB_ENTRY(110) -STUB_ENTRY(111) -STUB_ENTRY(112) -STUB_ENTRY(113) -STUB_ENTRY(114) -STUB_ENTRY(115) -STUB_ENTRY(116) -STUB_ENTRY(117) -STUB_ENTRY(118) -STUB_ENTRY(119) -STUB_ENTRY(120) -STUB_ENTRY(121) -STUB_ENTRY(122) -STUB_ENTRY(123) -STUB_ENTRY(124) -STUB_ENTRY(125) -STUB_ENTRY(126) -STUB_ENTRY(127) -STUB_ENTRY(128) -STUB_ENTRY(129) -STUB_ENTRY(130) -STUB_ENTRY(131) -STUB_ENTRY(132) -STUB_ENTRY(133) -STUB_ENTRY(134) -STUB_ENTRY(135) -STUB_ENTRY(136) -STUB_ENTRY(137) -STUB_ENTRY(138) -STUB_ENTRY(139) -STUB_ENTRY(140) -STUB_ENTRY(141) -STUB_ENTRY(142) -STUB_ENTRY(143) -STUB_ENTRY(144) -STUB_ENTRY(145) -STUB_ENTRY(146) -STUB_ENTRY(147) -STUB_ENTRY(148) -STUB_ENTRY(149) -STUB_ENTRY(150) -STUB_ENTRY(151) -STUB_ENTRY(152) -STUB_ENTRY(153) -STUB_ENTRY(154) -STUB_ENTRY(155) -STUB_ENTRY(156) -STUB_ENTRY(157) -STUB_ENTRY(158) -STUB_ENTRY(159) -STUB_ENTRY(160) -STUB_ENTRY(161) -STUB_ENTRY(162) -STUB_ENTRY(163) -STUB_ENTRY(164) -STUB_ENTRY(165) -STUB_ENTRY(166) -STUB_ENTRY(167) -STUB_ENTRY(168) -STUB_ENTRY(169) -STUB_ENTRY(170) -STUB_ENTRY(171) -STUB_ENTRY(172) -STUB_ENTRY(173) -STUB_ENTRY(174) -STUB_ENTRY(175) -STUB_ENTRY(176) -STUB_ENTRY(177) -STUB_ENTRY(178) -STUB_ENTRY(179) -STUB_ENTRY(180) -STUB_ENTRY(181) -STUB_ENTRY(182) -STUB_ENTRY(183) -STUB_ENTRY(184) -STUB_ENTRY(185) -STUB_ENTRY(186) -STUB_ENTRY(187) -STUB_ENTRY(188) -STUB_ENTRY(189) -STUB_ENTRY(190) -STUB_ENTRY(191) -STUB_ENTRY(192) -STUB_ENTRY(193) -STUB_ENTRY(194) -STUB_ENTRY(195) -STUB_ENTRY(196) -STUB_ENTRY(197) -STUB_ENTRY(198) -STUB_ENTRY(199) -STUB_ENTRY(200) -STUB_ENTRY(201) -STUB_ENTRY(202) -STUB_ENTRY(203) -STUB_ENTRY(204) -STUB_ENTRY(205) -STUB_ENTRY(206) -STUB_ENTRY(207) -STUB_ENTRY(208) -STUB_ENTRY(209) -STUB_ENTRY(210) -STUB_ENTRY(211) -STUB_ENTRY(212) -STUB_ENTRY(213) -STUB_ENTRY(214) -STUB_ENTRY(215) -STUB_ENTRY(216) -STUB_ENTRY(217) -STUB_ENTRY(218) -STUB_ENTRY(219) -STUB_ENTRY(220) -STUB_ENTRY(221) -STUB_ENTRY(222) -STUB_ENTRY(223) -STUB_ENTRY(224) -STUB_ENTRY(225) -STUB_ENTRY(226) -STUB_ENTRY(227) -STUB_ENTRY(228) -STUB_ENTRY(229) -STUB_ENTRY(230) -STUB_ENTRY(231) -STUB_ENTRY(232) -STUB_ENTRY(233) -STUB_ENTRY(234) -STUB_ENTRY(235) -STUB_ENTRY(236) -STUB_ENTRY(237) -STUB_ENTRY(238) -STUB_ENTRY(239) -STUB_ENTRY(240) -STUB_ENTRY(241) -STUB_ENTRY(242) -STUB_ENTRY(243) -STUB_ENTRY(244) -STUB_ENTRY(245) -STUB_ENTRY(246) -STUB_ENTRY(247) -STUB_ENTRY(248) -STUB_ENTRY(249) -STUB_ENTRY(250) -STUB_ENTRY(251) -STUB_ENTRY(252) -STUB_ENTRY(253) -STUB_ENTRY(254) -STUB_ENTRY(255) -STUB_ENTRY(256) -STUB_ENTRY(257) -STUB_ENTRY(258) -SENTINEL_ENTRY(0) -SENTINEL_ENTRY(1) -SENTINEL_ENTRY(2) -SENTINEL_ENTRY(3) -SENTINEL_ENTRY(4) -SENTINEL_ENTRY(5) -SENTINEL_ENTRY(6) -SENTINEL_ENTRY(7) -SENTINEL_ENTRY(8) -SENTINEL_ENTRY(9) diff --git a/mozilla/xpcom/libxpt/xptcall/src/Makefile.in b/mozilla/xpcom/libxpt/xptcall/src/Makefile.in deleted file mode 100644 index 40b11f18dd2..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/Makefile.in +++ /dev/null @@ -1,38 +0,0 @@ -#!gmake -# 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. - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = xptcall -LIBRARY_NAME = xptcall - -DIRS = md - -CFLAGS += -DEXPORT_XPTC_API - -CPPSRCS = xptcall.cpp \ - $(NULL) - -REQUIRES = $(MODULE) - -# export:: libs - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptcall/src/makefile.win b/mozilla/xpcom/libxpt/xptcall/src/makefile.win deleted file mode 100644 index c7eeafb73f7..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/makefile.win +++ /dev/null @@ -1,65 +0,0 @@ -#!nmake -# -# 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. - -DEPTH=..\..\..\.. -IGNORE_MANIFEST=1 - -DIRS=md - -MAKE_OBJ_TYPE = DLL -DLLNAME = xptcall$(MOZ_BITS) -#PDBFILE = $(DLLNAME).pdb -#MAPFILE = $(DLLNAME).map -DLL =.\$(OBJDIR)\$(DLLNAME).dll - -MODULE=xptcall -REQUIRES=xpcom libxpt xptinfo - -DEFINES=-DWIN32_LEAN_AND_MEAN -DEXPORT_XPTC_API - -OBJS= \ - .\$(OBJDIR)\xptcall.obj \ - .\md\win32\$(OBJDIR)\xptcinvoke.obj \ - .\md\win32\$(OBJDIR)\xptcstubs.obj \ - $(NULL) - -EXPORTS = \ - $(NULL) - -LINCS=-I$(PUBLIC)\xptcall -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -LLIBS= $(LIBNSPR) \ - $(DIST)\lib\xpcom$(MOZ_BITS).lib \ - $(DIST)\lib\xptinfo$(MOZ_BITS).lib \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib - - -clobber:: - rm -f $(DIST)\lib\$(DLLNAME).lib - rm -f $(DIST)\bin\$(DLLNAME).dll diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/Makefile.in b/mozilla/xpcom/libxpt/xptcall/src/md/Makefile.in deleted file mode 100644 index 13cb4de9485..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/Makefile.in +++ /dev/null @@ -1,31 +0,0 @@ -#!gmake -# -# 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. -# - -DEPTH=../../../../.. - -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/config.mk - -DIRS = unix - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.cpp deleted file mode 100644 index 04877ba5d9f..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Platform specific code to invoke XPCOM methods on native objects */ - -#include "xptcprivate.h" - -#ifndef XP_MAC -#error "This code is for Macintosh only" -#endif - -extern "C" uint32 -invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) -{ - PRUint32 result = 0; - for(PRUint32 i = 0; i < paramCount; i++, s++) - { - if(s->IsPtrData()) - { - result++; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : - case nsXPTType::T_I16 : - case nsXPTType::T_I32 : - result++; - break; - case nsXPTType::T_I64 : - result+=2; - break; - case nsXPTType::T_U8 : - case nsXPTType::T_U16 : - case nsXPTType::T_U32 : - result++; - break; - case nsXPTType::T_U64 : - result+=2; - break; - case nsXPTType::T_FLOAT : - result++; - break; - case nsXPTType::T_DOUBLE : - result+=2; - break; - case nsXPTType::T_BOOL : - case nsXPTType::T_CHAR : - case nsXPTType::T_WCHAR : - result++; - break; - default: - // all the others are plain pointer types - result++; - break; - } - } - return result; -} - -extern "C" void -invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s, double *fprData) -{ - PRUint32 fpCount = 0; - for(PRUint32 i = 0; i < paramCount; i++, d++, s++) - { - if(s->IsPtrData()) - { - *((void**)d) = s->ptr; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : *((PRInt32*) d) = s->val.i8; break; - case nsXPTType::T_I16 : *((PRInt32*) d) = s->val.i16; break; - case nsXPTType::T_I32 : *((PRInt32*) d) = s->val.i32; break; - case nsXPTType::T_I64 : *((PRInt64*) d) = s->val.i64; d++; break; - case nsXPTType::T_U8 : *((PRUint32*) d) = s->val.u8; break; - case nsXPTType::T_U16 : *((PRUint32*)d) = s->val.u16; break; - case nsXPTType::T_U32 : *((PRUint32*)d) = s->val.u32; break; - case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break; - case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; - if (fpCount < 13) - fprData[fpCount++] = s->val.f; - break; - case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; - if (fpCount < 13) - fprData[fpCount++] = s->val.d; - break; - case nsXPTType::T_BOOL : *((PRBool*) d) = s->val.b; break; - case nsXPTType::T_CHAR : *((PRInt32*) d) = s->val.c; break; - case nsXPTType::T_WCHAR : *((PRUint32*) d) = s->val.wc; break; - default: - // all the others are plain pointer types - *((void**)d) = s->val.p; - break; - } - } -} - -#pragma export on - -extern "C" nsresult _XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params); - -extern "C" -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params) -{ - return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params); -} - -#pragma export off diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.s b/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.s deleted file mode 100644 index ccc2b40adf0..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcinvoke_mac.s +++ /dev/null @@ -1,112 +0,0 @@ - # - # -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - # - # 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) 1999 Netscape Communications Corporation. All Rights - # Reserved. - # - - csect CODE{PR} -# -# XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, -# PRUint32 paramCount, nsXPTCVariant* params) -# - - import .invoke_count_words - import .invoke_copy_to_stack - import .__ptr_glue - -._XPTC_InvokeByIndex: - mflr r0 - stw r31,-4(sp) -# -# save off the incoming values in the caller's parameter area -# - stw r3,24(sp) # that - stw r4,28(sp) # methodIndex - stw r5,32(sp) # paramCount - stw r6,36(sp) # params - stw r0,8(sp) - stwu sp,-136(sp) # = 24 for linkage area, 8 * 13 for fprData area, 8 for saved registers - -# set up for and call 'invoke_count_words' to get new stack size -# - mr r3,r5 - mr r4,r6 - bl .invoke_count_words - nop - -# prepare args for 'invoke_copy_to_stack' call -# - lwz r4,168(sp) # paramCount - lwz r5,172(sp) # params -# addi r6,sp,128 # fprData - mr r6,sp # fprData - slwi r3,r3,2 # number of bytes of stack required - addi r3,r3,28 # linkage area - mr r31,sp # save original stack top - sub sp,sp,r3 # bump the stack - addi r3,sp,28 # parameter pointer excludes linkage area size + 'this' - - bl .invoke_copy_to_stack - nop - - lfd f1,0(r31) - lfd f2,8(r31) - lfd f3,16(r31) - lfd f4,24(r31) - lfd f5,32(r31) - lfd f6,40(r31) - lfd f7,48(r31) - lfd f8,56(r31) - lfd f9,64(r31) - lfd f10,72(r31) - lfd f11,80(r31) - lfd f12,88(r31) - lfd f13,96(r31) - - lwz r3,160(r31) # that - lwz r4,0(r3) # get vTable from 'that' - lwz r5,164(r31) # methodIndex - slwi r5,r5,2 # methodIndex * 4 - addi r5,r5,4 # step over junk at start of vTable ! - lwzx r12,r5,r4 # get function pointer - - lwz r4,28(sp) - lwz r5,32(sp) - lwz r6,36(sp) - lwz r7,40(sp) - lwz r8,44(sp) - lwz r9,48(sp) - lwz r10,52(sp) - - bl .__ptr_glue - nop - - - mr sp,r31 - lwz r0,144(sp) - addi sp,sp,136 - mtlr r0 - lwz r31,-4(sp) - blr - - - csect DATA - import TOC - export ._XPTC_InvokeByIndex - - dc.l ._XPTC_InvokeByIndex - dc.l TOC - \ No newline at end of file diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_.mac.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_.mac.cpp deleted file mode 100644 index 4fdb0fbc212..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_.mac.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implement shared vtbl methods. */ - -#pragma export on - -#include "xptcprivate.h" - -#define STUB_ENTRY(n) \ -nsresult nsXPTCStubBase::Stub##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Stub called on unsupported platform"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#define SENTINEL_ENTRY(n) \ -nsresult nsXPTCStubBase::Sentinel##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#include "xptcstubsdef.inc" - -#pragma export off diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.cpp deleted file mode 100644 index 8917e49233b..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implement shared vtbl methods. */ - -#pragma export on - -#include "xptcprivate.h" - -#if defined(XP_MAC) - -/* - For mac, the first 8 integral and the first 13 f.p. parameters arrive - in a separate chunk of data that has been loaded from the registers. The - args pointer has been set to the start of the parameters BEYOND the ones - arriving in registers -*/ -extern "C" nsresult -PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args, PRUint32 *gprData, double *fprData) -{ -#define PARAM_BUFFER_COUNT 16 -#define PARAM_GPR_COUNT 7 - - nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; - nsXPTCMiniVariant* dispatchParams = NULL; - nsIInterfaceInfo* iface_info = NULL; - const nsXPTMethodInfo* info; - PRUint8 paramCount; - PRUint8 i; - nsresult result = NS_ERROR_FAILURE; - - NS_ASSERTION(self,"no self"); - - self->GetInterfaceInfo(&iface_info); - NS_ASSERTION(iface_info,"no interface info"); - - iface_info->GetMethodInfo(PRUint16(methodIndex), &info); - NS_ASSERTION(info,"no interface info"); - - paramCount = info->GetParamCount(); - - // setup variant array pointer - if(paramCount > PARAM_BUFFER_COUNT) - dispatchParams = new nsXPTCMiniVariant[paramCount]; - else - dispatchParams = paramBuffer; - NS_ASSERTION(dispatchParams,"no place for params"); - - PRUint32* ap = args; - PRUint32 iCount = 0; - PRUint32 fpCount = 0; - for(i = 0; i < paramCount; i++) - { - const nsXPTParamInfo& param = info->GetParam(i); - const nsXPTType& type = param.GetType(); - nsXPTCMiniVariant* dp = &dispatchParams[i]; - - if(param.IsOut() || !type.IsArithmetic()) - { - if (iCount < PARAM_GPR_COUNT) - dp->val.p = (void*) gprData[iCount++]; - else - dp->val.p = (void*) *ap++; - continue; - } - // else - switch(type) - { - case nsXPTType::T_I8 : if (iCount < PARAM_GPR_COUNT) - dp->val.i8 = (PRInt8) gprData[iCount++]; - else - dp->val.i8 = (PRInt8) *ap++; - break; - case nsXPTType::T_I16 : if (iCount < PARAM_GPR_COUNT) - dp->val.i16 = (PRInt16) gprData[iCount++]; - else - dp->val.i16 = (PRInt16) *ap++; - break; - case nsXPTType::T_I32 : if (iCount < PARAM_GPR_COUNT) - dp->val.i32 = (PRInt32) gprData[iCount++]; - else - dp->val.i32 = (PRInt32) *ap++; - break; - case nsXPTType::T_I64 : if (iCount < PARAM_GPR_COUNT) - dp->val.i64.hi = (PRInt32) gprData[iCount++]; - else - dp->val.i64.hi = (PRInt32) *ap++; - if (iCount < PARAM_GPR_COUNT) - dp->val.i64.lo = (PRUint32) gprData[iCount++]; - else - dp->val.i64.lo = (PRUint32) *ap++; - break; - case nsXPTType::T_U8 : if (iCount < PARAM_GPR_COUNT) - dp->val.i8 = (PRUint8) gprData[iCount++]; - else - dp->val.i8 = (PRUint8) *ap++; - break; - case nsXPTType::T_U16 : if (iCount < PARAM_GPR_COUNT) - dp->val.i16 = (PRUint16) gprData[iCount++]; - else - dp->val.i16 = (PRUint16) *ap++; - break; - case nsXPTType::T_U32 : if (iCount < PARAM_GPR_COUNT) - dp->val.i32 = (PRUint32) gprData[iCount++]; - else - dp->val.i32 = (PRUint32) *ap++; - break; - case nsXPTType::T_U64 : if (iCount < PARAM_GPR_COUNT) - dp->val.i64.hi = (PRUint32) gprData[iCount++]; - else - dp->val.i64.hi = (PRUint32) *ap++; - if (iCount < PARAM_GPR_COUNT) - dp->val.i64.lo = (PRUint32) gprData[iCount++]; - else - dp->val.i64.lo = (PRUint32) *ap++; - break; - case nsXPTType::T_FLOAT : if (fpCount < 13) { - dp->val.f = (float) fprData[fpCount++]; - if (iCount < PARAM_GPR_COUNT) - ++iCount; - else - ++ap; - } - else - dp->val.f = *((float*) ap++); - break; - case nsXPTType::T_DOUBLE : if (fpCount < 13) { - dp->val.d = (double) fprData[fpCount++]; - if (iCount < PARAM_GPR_COUNT) - ++iCount; - else - ++ap; - if (iCount < PARAM_GPR_COUNT) - ++iCount; - else - ++ap; - } - else { - dp->val.f = *((double*) ap); - ap += 2; - } - break; - case nsXPTType::T_BOOL : if (iCount < PARAM_GPR_COUNT) - dp->val.b = (PRBool) gprData[iCount++]; - else - dp->val.b = (PRBool) *ap++; - break; - case nsXPTType::T_CHAR : if (iCount < PARAM_GPR_COUNT) - dp->val.c = (char) gprData[iCount++]; - else - dp->val.c = (char) *ap++; - break; - case nsXPTType::T_WCHAR : if (iCount < PARAM_GPR_COUNT) - dp->val.wc = (wchar_t) gprData[iCount++]; - else - dp->val.wc = (wchar_t) *ap++; - break; - default: - NS_ASSERTION(0, "bad type"); - break; - } - } - - result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); - - NS_RELEASE(iface_info); - - if(dispatchParams != paramBuffer) - delete [] dispatchParams; - - return result; -} - -extern "C" void SharedStub(); - -#define STUB_ENTRY(n) \ -asm nsresult nsXPTCStubBase::Stub##n() \ -{ \ - addi r12,r0,n; \ - b SharedStub \ -} - -#define SENTINEL_ENTRY(n) \ -nsresult nsXPTCStubBase::Sentinel##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - - -#include "xptcstubsdef.inc" - -#pragma export off - -#endif diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.s b/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.s deleted file mode 100644 index 76f848d324c..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/mac/xptcstubs_mac.s +++ /dev/null @@ -1,74 +0,0 @@ - # - # -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - # - # 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) 1999 Netscape Communications Corporation. All Rights - # Reserved. - # - - csect CODE{PR} -# -# on entry SharedStub has the method selector in r12, the rest of the original -# parameters are in r3 thru r10 and f1 thru f13 -# - import .PrepareAndDispatch - -.SharedStub: - mflr r0 - stw r0,8(sp) - - stwu sp,-176(sp) # room for linkage (24), fprData (104), gprData(28) - # outgoing params to PrepareAndDispatch (20) - - stw r4,44(sp) - stw r5,48(sp) - stw r6,52(sp) - stw r7,56(sp) - stw r8,60(sp) - stw r9,64(sp) - stw r10,68(sp) - stfd f1,72(sp) - stfd f2,80(sp) - stfd f3,88(sp) - stfd f4,96(sp) - stfd f5,104(sp) - stfd f6,112(sp) - stfd f7,120(sp) - stfd f8,128(sp) - stfd f9,136(sp) - stfd f10,144(sp) - stfd f11,152(sp) - stfd f12,156(sp) - stfd f13,164(sp) - - addi r6,sp,44 # gprData - addi r7,sp,72 # fprData - # r3 has the 'self' pointer already - mr r4,r12 # methodIndex selector - addi r5,sp,232 # pointer to callers args area, beyond r3-r10 mapped range - - bl .PrepareAndDispatch - nop - - lwz r0,184(sp) - addi sp,sp,176 - mtlr r0 - blr - - csect DATA - import TOC - export .SharedStub - - dc.l .SharedStub - dc.l TOC diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/makefile.win b/mozilla/xpcom/libxpt/xptcall/src/md/makefile.win deleted file mode 100644 index 6fb56322f43..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/makefile.win +++ /dev/null @@ -1,21 +0,0 @@ -# -# 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. - -DEPTH=..\..\..\..\.. -IGNORE_MANIFEST=1 -DIRS=win32 - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/Makefile.in b/mozilla/xpcom/libxpt/xptcall/src/md/test/Makefile.in deleted file mode 100644 index 6212ab0e16e..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/Makefile.in +++ /dev/null @@ -1,36 +0,0 @@ -#!gmake -# -# 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. -# - -DEPTH=../../../../../.. - -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/config.mk - - -SIMPLE_PROGRAMS = invoke_test - -CPPSRCS = \ - invoke_test.cpp \ - $(NULL) - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/README b/mozilla/xpcom/libxpt/xptcall/src/md/test/README deleted file mode 100644 index 04850b2e01a..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/README +++ /dev/null @@ -1,6 +0,0 @@ -These are just simple test programs in which stripped down versions of the -XPConnect invoke and stubs code can be built and tested as the code is brought -up on various platforms. These probrams do not test the param sizing and copying -functionality of the routines. However, they do supply a place where the lowest -level assembly language code can be developed and debugged in the simplest of -contexts before it is moved into the real routines. \ No newline at end of file diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/clean.bat b/mozilla/xpcom/libxpt/xptcall/src/md/test/clean.bat deleted file mode 100755 index f320e222c90..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/clean.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -echo deleting intermediate files -if exist *.obj del *.obj > NUL -if exist *.ilk del *.ilk > NUL -if exist *.pdb del *.pdb > NUL \ No newline at end of file diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/invoke_test.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/test/invoke_test.cpp deleted file mode 100644 index 36513fae055..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/invoke_test.cpp +++ /dev/null @@ -1,220 +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. - */ - -#include - -typedef unsigned nsresult; -typedef unsigned PRUint32; -typedef unsigned nsXPCVariant; - - -#if defined(WIN32) -#define NS_IMETHOD virtual nsresult __stdcall -#define NS_IMETHODIMP nsresult __stdcall -#else -#define NS_IMETHOD virtual nsresult -#define NS_IMETHODIMP nsresult -#endif - - -class base{ -public: - NS_IMETHOD ignored() = 0; -}; - -class foo : public base { -public: - NS_IMETHOD callme1(int i, int j) = 0; - NS_IMETHOD callme2(int i, int j) = 0; - NS_IMETHOD callme3(int i, int j) = 0; -}; - -class bar : public foo{ -public: - NS_IMETHOD ignored(); - NS_IMETHOD callme1(int i, int j); - NS_IMETHOD callme2(int i, int j); - NS_IMETHOD callme3(int i, int j); -}; - -/* -class baz : public base { -public: - NS_IMETHOD ignored(); - NS_IMETHOD callme1(); - NS_IMETHOD callme2(); - NS_IMETHOD callme3(); - void setfoo(foo* f) {other = f;} - - foo* other; -}; -NS_IMETHODIMP baz::ignored(){return 0;} -*/ - -NS_IMETHODIMP bar::ignored(){return 0;} - -NS_IMETHODIMP bar::callme1(int i, int j) -{ - printf("called bar::callme1 with: %d %d\n", i, j); - return 5; -} - -NS_IMETHODIMP bar::callme2(int i, int j) -{ - printf("called bar::callme2 with: %d %d\n", i, j); - return 5; -} - -NS_IMETHODIMP bar::callme3(int i, int j) -{ - printf("called bar::callme3 with: %d %d\n", i, j); - return 5; -} - -void docall(foo* f, int i, int j){ - f->callme1(i, j); -} - -/***************************************************************************/ -#if defined(WIN32) - -static PRUint32 __stdcall -invoke_count_words(PRUint32 paramCount, nsXPCVariant* s) -{ - return paramCount; -} - -static void __stdcall -invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPCVariant* s) -{ - for(PRUint32 i = 0; i < paramCount; i++, d++, s++) - { - *((PRUint32*)d) = *((PRUint32*)s); - } -} - -static nsresult __stdcall -DoInvoke(void* that, PRUint32 index, - PRUint32 paramCount, nsXPCVariant* params) -{ - __asm { - push params - push paramCount - call invoke_count_words // stdcall, result in eax - shl eax,2 // *= 4 - sub esp,eax // make space for params - mov edx,esp - push params - push paramCount - push edx - call invoke_copy_to_stack // stdcall - mov ecx,that // instance in ecx - push ecx // push this - mov edx,[ecx] // vtable in edx - mov eax,index - shl eax,2 // *= 4 - add edx,eax - call [edx] // stdcall, i.e. callee cleans up stack. - } -} - -#else -/***************************************************************************/ -// just Linux_x86 now. Add other later... - -static PRUint32 -invoke_count_words(PRUint32 paramCount, nsXPCVariant* s) -{ - return paramCount; -} - -static void -invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPCVariant* s) -{ - for(PRUint32 i = 0; i < paramCount; i++, d++, s++) - { - *((PRUint32*)d) = *((PRUint32*)s); - } -} - -static nsresult -DoInvoke(void* that, PRUint32 index, - PRUint32 paramCount, nsXPCVariant* params) -{ - PRUint32 result; - void* fn_count = invoke_count_words; - void* fn_copy = invoke_copy_to_stack; - - __asm__ __volatile__( - "pushl %4\n\t" - "pushl %3\n\t" - "movl %5, %%eax\n\t" - "call *%%eax\n\t" /* count words */ - "addl $0x8, %%esp\n\t" - "shl $2, %%eax\n\t" /* *= 4 */ - "subl %%eax, %%esp\n\t" /* make room for params */ - "movl %%esp, %%edx\n\t" - "pushl %4\n\t" - "pushl %3\n\t" - "pushl %%edx\n\t" - "movl %6, %%eax\n\t" - "call *%%eax\n\t" /* copy params */ - "addl $0xc, %%esp\n\t" - "movl %1, %%ecx\n\t" - "pushl %%ecx\n\t" - "movl (%%ecx), %%edx\n\t" - "movl %2, %%eax\n\t" /* function index */ - "shl $2, %%eax\n\t" /* *= 4 */ - "addl $8, %%eax\n\t" /* += 8 */ - "addl %%eax, %%edx\n\t" - "call *(%%edx)\n\t" /* safe to not cleanup esp */ - "movl %%eax, %0" - : "=g" (result) /* %0 */ - : "g" (that), /* %1 */ - "g" (index), /* %2 */ - "g" (paramCount), /* %3 */ - "g" (params), /* %4 */ - "g" (fn_count), /* %5 */ - "g" (fn_copy) /* %6 */ - : "ax", "cx", "dx", "memory" - ); - - return result; -} - -#endif -/***************************************************************************/ - -int main() -{ - nsXPCVariant params1[2] = {1,2}; - nsXPCVariant params2[2] = {2,4}; - nsXPCVariant params3[2] = {3,6}; - - foo* a = new bar(); - -// printf("calling via C++...\n"); -// docall(a, 12, 24); - - printf("calling via ASM...\n"); - DoInvoke(a, 1, 2, params1); - DoInvoke(a, 2, 2, params2); - DoInvoke(a, 3, 2, params3); - - return 0; -} diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/mk_invoke.bat b/mozilla/xpcom/libxpt/xptcall/src/md/test/mk_invoke.bat deleted file mode 100755 index 10a9be51de6..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/mk_invoke.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -@echo deleing old output -if exist invoke_test.obj del invoke_test.obj > NUL -if exist invoke_test.ilk del invoke_test.ilk > NUL -if exist *.pdb del *.pdb > NUL -if exist invoke_test.exe del invoke_test.exe > NUL - -@echo building... -cl /nologo -Zi -DWIN32 invoke_test.cpp \ No newline at end of file diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/mk_stub.bat b/mozilla/xpcom/libxpt/xptcall/src/md/test/mk_stub.bat deleted file mode 100755 index f9af17affe4..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/mk_stub.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -@echo deleing old output -if exist stub_test.obj del stub_test.obj > NUL -if exist stub_test.ilk del stub_test.ilk > NUL -if exist *.pdb del *.pdb > NUL -if exist stub_test.exe del stub_test.exe > NUL - -@echo building... -cl /nologo -Zi -DWIN32 stub_test.cpp \ No newline at end of file diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/test/stub_test.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/test/stub_test.cpp deleted file mode 100644 index e90dda85cbf..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/test/stub_test.cpp +++ /dev/null @@ -1,184 +0,0 @@ - -#include - -typedef unsigned nsresult; -typedef unsigned PRUint32; -typedef unsigned nsXPCVariant; - - -#if defined(WIN32) -#define NS_IMETHOD virtual nsresult __stdcall -#define NS_IMETHODIMP nsresult __stdcall -#else -#define NS_IMETHOD virtual nsresult -#define NS_IMETHODIMP nsresult -#endif - - -class base{ -public: - NS_IMETHOD ignored() = 0; -}; - -class foo : public base { -public: - NS_IMETHOD callme1(int i, int j) = 0; - NS_IMETHOD callme2(int i, int j) = 0; - NS_IMETHOD callme3(int i, int j) = 0; -}; - -class bar : public foo{ -public: - NS_IMETHOD ignored(); - NS_IMETHOD callme1(int i, int j); - NS_IMETHOD callme2(int i, int j); - NS_IMETHOD callme3(int i, int j); -}; - -class baz : public base { -public: - NS_IMETHOD ignored(); - NS_IMETHOD callme1(); - NS_IMETHOD callme2(); - NS_IMETHOD callme3(); - void setfoo(foo* f) {other = f;} - - foo* other; -}; -NS_IMETHODIMP baz::ignored(){return 0;} - -NS_IMETHODIMP bar::ignored(){return 0;} - -NS_IMETHODIMP bar::callme1(int i, int j) -{ - printf("called bar::callme1 with: %d %d\n", i, j); - return 5; -} - -NS_IMETHODIMP bar::callme2(int i, int j) -{ - printf("called bar::callme2 with: %d %d\n", i, j); - return 5; -} - -NS_IMETHODIMP bar::callme3(int i, int j) -{ - printf("called bar::callme3 with: %d %d\n", i, j); - return 5; -} - -void docall(foo* f, int i, int j){ - f->callme1(i, j); -} - -/***************************************************************************/ -#if defined(WIN32) - -static int __stdcall -PrepareAndDispatch(baz* self, PRUint32 methodIndex, - PRUint32* args, PRUint32* stackBytesToPop) -{ - foo* a = self->other; - int p1 = (int) *args; - int p2 = (int) *(args+1); - switch(methodIndex) - { - case 1: a->callme1(p1, p2); break; - case 2: a->callme2(p1, p2); break; - case 3: a->callme3(p1, p2); break; - } - *stackBytesToPop = 2*4; - return 1; -} - -static __declspec(naked) void SharedStub(void) -{ - __asm { - push ebp // set up simple stack frame - mov ebp, esp // stack has: ebp/vtbl_index/retaddr/this/args - push ecx // make room for a ptr - lea eax, [ebp-4] // pointer to stackBytesToPop - push eax - lea ecx, [ebp+16] // pointer to args - push ecx - mov edx, [ebp+4] // vtbl_index - push edx - mov eax, [ebp+12] // this - push eax - call PrepareAndDispatch - mov edx, [ebp+8] // return address - mov ecx, [ebp-4] // stackBytesToPop - add ecx, 12 // for this, the index, and ret address - mov esp, ebp - pop ebp - add esp, ecx // fix up stack pointer - jmp edx // simulate __stdcall return - } -} - -// these macros get expanded (many times) in the file #included below -#define STUB_ENTRY(n) \ -__declspec(naked) nsresult __stdcall baz::callme##n() \ -{ __asm push n __asm jmp SharedStub } - - -#else -/***************************************************************************/ -// just Linux_x86 now. Add other later... - -static int -PrepareAndDispatch(baz* self, PRUint32 methodIndex, PRUint32* args) -{ - foo* a = self->other; - int p1 = (int) *args; - int p2 = (int) *(args+1); - switch(methodIndex) - { - case 1: a->callme1(p1, p2); break; - case 2: a->callme2(p1, p2); break; - case 3: a->callme3(p1, p2); break; - } - return 1; -} - -//nsresult nsXPCWrappedJS::Stub##n() \ - -#define STUB_ENTRY(n) \ -nsresult baz::callme##n() \ -{ \ - register void* method = PrepareAndDispatch; \ - register nsresult result; \ - __asm__ __volatile__( \ - "leal 0x0c(%%ebp), %%ecx\n\t" /* args */ \ - "pushl %%ecx\n\t" \ - "pushl $"#n"\n\t" /* method index */ \ - "movl 0x08(%%ebp), %%ecx\n\t" /* this */ \ - "pushl %%ecx\n\t" \ - "call *%%edx" /* PrepareAndDispatch */ \ - : "=a" (result) /* %0 */ \ - : "d" (method) /* %1 */ \ - : "ax", "dx", "cx", "memory" ); \ - return result; \ -} - -#endif -/***************************************************************************/ - -STUB_ENTRY(1) -STUB_ENTRY(2) -STUB_ENTRY(3) - -int main() -{ - foo* a = new bar(); - baz* b = new baz(); - - foo* c = (foo*)b; - - b->setfoo(a); - c->callme1(1,2); - c->callme2(2,4); - c->callme3(3,6); - - return 0; -} diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/Makefile.in b/mozilla/xpcom/libxpt/xptcall/src/md/unix/Makefile.in deleted file mode 100644 index 29aa04654bb..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/Makefile.in +++ /dev/null @@ -1,62 +0,0 @@ -# -# 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. -# - -DEPTH = ../../../../../.. -topsrcdir = @top_srcdir@ -VPATH = @srcdir@ -srcdir = @srcdir@ - -include $(DEPTH)/config/autoconf.mk -include $(topsrcdir)/config/config.mk - -CFLAGS += -DEXPORT_XPTC_API - -LIBRARY_NAME = xptcmd -MODULE = xptcall - -CPPSRCS = \ - xptcinvoke_unsupported.cpp \ - xptcstubs_unsupported.cpp \ - $(NULL) - -# SunOS i86pc should use the intel code too. -ifneq (,$(filter SunOS Linux FreeBSD NetBSD OpenBSD BSD_OS,$(OS_ARCH))) -ifeq (86,$(findstring 86,$(OS_TEST))) -CPPSRCS = \ - xptcinvoke_unixish_x86.cpp \ - xptcstubs_unixish_x86.cpp \ - $(NULL) -endif -endif - -# Solaris/sparc -ifneq (,$(filter SunOS,$(OS_ARCH))) -ifneq (86,$(findstring 86,$(OS_TEST))) -CPPSRCS = \ - xptcinvoke_sparc_solaris.cpp \ - xptcstubs_sparc_solaris.cpp \ - $(NULL) -ASFILES = \ - xptcinvoke_asm_sparc_solaris.s \ - xptcstubs_asm_sparc_solaris.s \ - $(NULL) -endif -endif - -include $(topsrcdir)/config/rules.mk - -INCLUDES += -I$(srcdir)/../.. diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris.s b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris.s deleted file mode 100644 index 5f66d794a0f..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris.s +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Platform specific code to invoke XPCOM methods on native objects */ - - .global XPTC_InvokeByIndex -/* - XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params); - -*/ -XPTC_InvokeByIndex: - save %sp,-(64 + 16),%sp ! room for the register window and - ! struct pointer, rounded up to 0 % 16 - mov %i2,%o0 ! paramCount - call invoke_count_words ! returns the required stack size in %o0 - mov %i3,%o1 ! delay slot: params - - sll %o0,2,%l0 ! number of bytes - sub %sp,%l0,%sp ! create the additional stack space - - add %sp,72,%o0 ! pointer for copied args, + register win - ! + result ptr + 'this' slot - - mov %i2,%o1 ! paramCount - call invoke_copy_to_stack - mov %i3,%o2 ! delay slot: params - -! -! calculate the target address from the vtable -! instructions reordered to lessen stalling. -! - ld [%i0],%l1 ! *that --> address of vtable - sll %i1,3,%l0 ! index *= 8 - add %l0,12,%l0 ! += 12 (there's 1 extra entry in the vTable - ld [%l0 + %l1],%l0 ! that->vtable[index * 8 + 12] --> - ! target address - -! -! set 'that' as the 'this' pointer and then load the next arguments -! into the outgoing registers -! - mov %i0,%o0 - ld [%sp + 72],%o1 - ld [%sp + 76],%o2 - ld [%sp + 80],%o3 - ld [%sp + 84],%o4 - jmpl %l0,%o7 ! call the routine - ld [%sp + 88],%o5 ! delay slot: last argument - - mov %o0,%i0 ! propagate return value - ret - restore diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp deleted file mode 100644 index a78b20d09ad..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Platform specific code to invoke XPCOM methods on native objects */ - -#include "xptcprivate.h" - -#ifndef sparc -#error "This code is for Sparc only" -#endif - -typedef unsigned nsXPCVariant; - -extern "C" PRUint32 -invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) -{ - PRUint32 result = 0; - for(PRUint32 i = 0; i < paramCount; i++, s++) - { - if(s->IsPtrData()) - { - result++; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : - case nsXPTType::T_I16 : - case nsXPTType::T_I32 : - result++; - break; - case nsXPTType::T_I64 : - result+=2; - break; - case nsXPTType::T_U8 : - case nsXPTType::T_U16 : - case nsXPTType::T_U32 : - result++; - break; - case nsXPTType::T_U64 : - result+=2; - break; - case nsXPTType::T_FLOAT : - result++; - break; - case nsXPTType::T_DOUBLE : - result+=2; - break; - case nsXPTType::T_BOOL : - case nsXPTType::T_CHAR : - case nsXPTType::T_WCHAR : - result++; - break; - default: - // all the others are plain pointer types - result++; - break; - } - } - // nuts, I know there's a cooler way of doing this, but it's late - // now and it'll probably come to me in the morning. - if (result & 0x3) result += 4 - (result & 0x3); // ensure q-word alignment - return result; -} - -extern "C" void -invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s) -{ -/* - We need to copy the parameters for this function to locals and use them - from there since the parameters occupy the same stack space as the stack - we're trying to populate. -*/ - uint32 *l_d = d; - nsXPTCVariant *l_s = s; - uint32 l_paramCount = paramCount; - - typedef struct { - uint32 hi; - uint32 lo; - } DU; // have to move 64 bit entities as 32 bit halves since - // stack slots are not guaranteed 16 byte aligned - - for(uint32 i = 0; i < l_paramCount; i++, l_d++, l_s++) - { - if(l_s->IsPtrData()) - { - *((void**)l_d) = l_s->ptr; - continue; - } - switch(l_s->type) - { - case nsXPTType::T_I8 : *((int32*) l_d) = l_s->val.i8; break; - case nsXPTType::T_I16 : *((int32*) l_d) = l_s->val.i16; break; - case nsXPTType::T_I32 : *((int32*) l_d) = l_s->val.i32; break; - case nsXPTType::T_I64 : - case nsXPTType::T_U64 : - case nsXPTType::T_DOUBLE : *((uint32*) l_d++) = ((DU *)l_s)->hi; - *((uint32*) l_d) = ((DU *)l_s)->lo; - break; - case nsXPTType::T_U8 : *((uint32*) l_d) = l_s->val.u8; break; - case nsXPTType::T_U16 : *((uint32*) l_d) = l_s->val.u16; break; - case nsXPTType::T_U32 : *((uint32*) l_d) = l_s->val.u32; break; - case nsXPTType::T_FLOAT : *((float*) l_d) = l_s->val.f; break; - case nsXPTType::T_BOOL : *((PRBool*) l_d) = l_s->val.b; break; - case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; - case nsXPTType::T_WCHAR : *((int32*)l_d) = l_s->val.wc; break; - default: - // all the others are plain pointer types - *((void**)l_d) = l_s->val.p; - break; - } - } -} - diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp deleted file mode 100644 index 8ec6cba58e0..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Platform specific code to invoke XPCOM methods on native objects */ - -#include "xptcprivate.h" - -// Remember that these 'words' are 32bit DWORDS - -#if defined(LINUX) || defined(__FreeBSD__) || defined(__NetBSD__) - -static PRUint32 -invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) -{ - PRUint32 result = 0; - for(PRUint32 i = 0; i < paramCount; i++, s++) - { - if(s->IsPtrData()) - { - result++; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : - case nsXPTType::T_I16 : - case nsXPTType::T_I32 : - result++; - break; - case nsXPTType::T_I64 : - result+=2; - break; - case nsXPTType::T_U8 : - case nsXPTType::T_U16 : - case nsXPTType::T_U32 : - result++; - break; - case nsXPTType::T_U64 : - result+=2; - break; - case nsXPTType::T_FLOAT : - result++; - break; - case nsXPTType::T_DOUBLE : - result+=2; - break; - case nsXPTType::T_BOOL : - case nsXPTType::T_CHAR : - case nsXPTType::T_WCHAR : - result++; - break; - default: - // all the others are plain pointer types - result++; - break; - } - } - return result; -} - -static void -invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s) -{ - for(PRUint32 i = 0; i < paramCount; i++, d++, s++) - { - if(s->IsPtrData()) - { - *((void**)d) = s->ptr; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : *((PRInt8*) d) = s->val.i8; break; - case nsXPTType::T_I16 : *((PRInt16*) d) = s->val.i16; break; - case nsXPTType::T_I32 : *((PRInt32*) d) = s->val.i32; break; - case nsXPTType::T_I64 : *((PRInt64*) d) = s->val.i64; d++; break; - case nsXPTType::T_U8 : *((PRUint8*) d) = s->val.u8; break; - case nsXPTType::T_U16 : *((PRUint16*)d) = s->val.u16; break; - case nsXPTType::T_U32 : *((PRUint32*)d) = s->val.u32; break; - case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break; - case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break; - case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break; - case nsXPTType::T_BOOL : *((PRBool*) d) = s->val.b; break; - case nsXPTType::T_CHAR : *((char*) d) = s->val.c; break; - case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break; - default: - // all the others are plain pointer types - *((void**)d) = s->val.p; - break; - } - } -} - -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params) -{ - PRUint32 result; - void* fn_count = invoke_count_words; - void* fn_copy = invoke_copy_to_stack; - - __asm__ __volatile__( - "pushl %4\n\t" - "pushl %3\n\t" - "movl %5, %%eax\n\t" - "call *%%eax\n\t" /* count words */ - "addl $0x8, %%esp\n\t" - "shl $2, %%eax\n\t" /* *= 4 */ - "subl %%eax, %%esp\n\t" /* make room for params */ - "movl %%esp, %%edx\n\t" - "pushl %4\n\t" - "pushl %3\n\t" - "pushl %%edx\n\t" - "movl %6, %%eax\n\t" - "call *%%eax\n\t" /* copy params */ - "addl $0xc, %%esp\n\t" - "movl %1, %%ecx\n\t" - "pushl %%ecx\n\t" - "movl (%%ecx), %%edx\n\t" - "movl %2, %%eax\n\t" /* function index */ -#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 7) - "shl $3, %%eax\n\t" /* *= 8 */ - "addl $0x0c, %%eax\n\t" /* += 12 */ -#else - "shl $2, %%eax\n\t" /* *= 4 */ - "addl $8, %%eax\n\t" /* += 8 */ -#endif - "addl %%eax, %%edx\n\t" - "call *(%%edx)\n\t" /* safe to not cleanup esp */ - "movl %%eax, %0" - : "=g" (result) /* %0 */ - : "g" (that), /* %1 */ - "g" (methodIndex), /* %2 */ - "g" (paramCount), /* %3 */ - "g" (params), /* %4 */ - "g" (fn_count), /* %5 */ - "g" (fn_copy) /* %6 */ - : "ax", "cx", "dx", "memory" - ); - - return result; -} - -#endif diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unsupported.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unsupported.cpp deleted file mode 100644 index f39013af61a..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcinvoke_unsupported.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Platform specific code to invoke XPCOM methods on native objects */ - -#include "xptcprivate.h" - -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params) -{ - NS_ASSERTION(0,"XPTC_InvokeByIndex called on unsupported platform"); - return NS_ERROR_NOT_IMPLEMENTED; -} diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_asm_sparc_solaris.s b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_asm_sparc_solaris.s deleted file mode 100644 index 647eba1beb4..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_asm_sparc_solaris.s +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - - .global SharedStub - -/* - in the frame for the function that called SharedStub are the - rest of the parameters we need - -*/ - -SharedStub: -! we don't create a new frame yet, but work within the frame of the calling -! function to give ourselves the other parameters we want - - mov %o0, %o1 ! shuffle the index up to 2nd place - mov %i0, %o0 ! the original 'this' - add %fp, 72, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this') -! save off the original incoming parameters that arrived in -! registers, the ABI guarantees the space for us to do this - st %i1, [%fp + 72] - st %i2, [%fp + 76] - st %i3, [%fp + 80] - st %i4, [%fp + 84] - st %i5, [%fp + 88] -! now we can build our own stack frame - save %sp,-(64 + 16),%sp ! room for the register window and - ! struct pointer, rounded up to 0 % 16 -! our function now appears to have been called -! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args) -! so we can just copy these through - - mov %i0, %o0 - mov %i1, %o1 - mov %i2, %o2 - call PrepareAndDispatch - nop - mov %o0,%i0 ! propogate return value - b .LL1 - nop -.LL1: - ret - restore diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp deleted file mode 100644 index b54bf584c03..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implement shared vtbl methods. */ - -#include "xptcprivate.h" - -#ifdef sparc - -extern "C" nsresult -PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args) -{ - - typedef struct { - uint32 hi; - uint32 lo; - } DU; // have to move 64 bit entities as 32 bit halves since - // stack slots are not guaranteed 16 byte aligned - -#define PARAM_BUFFER_COUNT 16 - - nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; - nsXPTCMiniVariant* dispatchParams = NULL; - nsIInterfaceInfo* iface_info = NULL; - const nsXPTMethodInfo* info; - PRUint8 paramCount; - PRUint8 i; - nsresult result = NS_ERROR_FAILURE; - - NS_ASSERTION(self,"no self"); - - self->GetInterfaceInfo(&iface_info); - NS_ASSERTION(iface_info,"no interface info"); - - iface_info->GetMethodInfo(PRUint16(methodIndex), &info); - NS_ASSERTION(info,"no interface info"); - - paramCount = info->GetParamCount(); - - // setup variant array pointer - if(paramCount > PARAM_BUFFER_COUNT) - dispatchParams = new nsXPTCMiniVariant[paramCount]; - else - dispatchParams = paramBuffer; - NS_ASSERTION(dispatchParams,"no place for params"); - - PRUint32* ap = args; - for(i = 0; i < paramCount; i++, ap++) - { - const nsXPTParamInfo& param = info->GetParam(i); - const nsXPTType& type = param.GetType(); - nsXPTCMiniVariant* dp = &dispatchParams[i]; - - if(param.IsOut() || !type.IsArithmetic()) - { - dp->val.p = (void*) *ap; - continue; - } - // else - switch(type) - { - case nsXPTType::T_I8 : dp->val.i8 = *((PRInt32*) ap); break; - case nsXPTType::T_I16 : dp->val.i16 = *((PRInt32*) ap); break; - case nsXPTType::T_I32 : dp->val.i32 = *((PRInt32*) ap); break; - case nsXPTType::T_DOUBLE : - case nsXPTType::T_U64 : - case nsXPTType::T_I64 : ((DU *)dp)->hi = ((DU *)ap)->hi; - ((DU *)dp)->lo = ((DU *)ap)->lo; - ap++; - break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) ap); break; - case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*)ap); break; - case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; - case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_BOOL : dp->val.b = *((PRBool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) ap); break; - case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) ap); break; - default: - NS_ASSERTION(0, "bad type"); - break; - } - } - - result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); - - NS_RELEASE(iface_info); - - if(dispatchParams != paramBuffer) - delete [] dispatchParams; - - return result; -} - -extern "C" int SharedStub(int); - -#define STUB_ENTRY(n) \ -nsresult nsXPTCStubBase::Stub##n() \ -{ \ - return SharedStub(n); \ -} \ - -#define SENTINEL_ENTRY(n) \ -nsresult nsXPTCStubBase::Sentinel##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#include "xptcstubsdef.inc" - -#endif diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp deleted file mode 100644 index c2d5372958d..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implement shared vtbl methods. */ - -#include "xptcprivate.h" - -#if defined(LINUX) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) - -static nsresult -PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args) -{ -#define PARAM_BUFFER_COUNT 16 - - nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; - nsXPTCMiniVariant* dispatchParams = NULL; - nsIInterfaceInfo* iface_info = NULL; - const nsXPTMethodInfo* info; - PRUint8 paramCount; - PRUint8 i; - nsresult result = NS_ERROR_FAILURE; - - NS_ASSERTION(self,"no self"); - - self->GetInterfaceInfo(&iface_info); - NS_ASSERTION(iface_info,"no interface info"); - - iface_info->GetMethodInfo(PRUint16(methodIndex), &info); - NS_ASSERTION(info,"no interface info"); - - paramCount = info->GetParamCount(); - - // setup variant array pointer - if(paramCount > PARAM_BUFFER_COUNT) - dispatchParams = new nsXPTCMiniVariant[paramCount]; - else - dispatchParams = paramBuffer; - NS_ASSERTION(dispatchParams,"no place for params"); - - PRUint32* ap = args; - for(i = 0; i < paramCount; i++, ap++) - { - const nsXPTParamInfo& param = info->GetParam(i); - const nsXPTType& type = param.GetType(); - nsXPTCMiniVariant* dp = &dispatchParams[i]; - - if(param.IsOut() || !type.IsArithmetic()) - { - dp->val.p = (void*) *ap; - continue; - } - // else - switch(type) - { - case nsXPTType::T_I8 : dp->val.i8 = *((PRInt8*) ap); break; - case nsXPTType::T_I16 : dp->val.i16 = *((PRInt16*) ap); break; - case nsXPTType::T_I32 : dp->val.i32 = *((PRInt32*) ap); break; - case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); ap++; break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint8*) ap); break; - case nsXPTType::T_U16 : dp->val.u16 = *((PRUint16*)ap); break; - case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; - case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*)ap); ap++; break; - case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break; - case nsXPTType::T_BOOL : dp->val.b = *((PRBool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((char*) ap); break; - case nsXPTType::T_WCHAR : dp->val.wc = *((wchar_t*) ap); break; - default: - NS_ASSERTION(0, "bad type"); - break; - } - } - - result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); - - NS_RELEASE(iface_info); - - if(dispatchParams != paramBuffer) - delete [] dispatchParams; - - return result; -} - -#define STUB_ENTRY(n) \ -nsresult nsXPTCStubBase::Stub##n() \ -{ \ - register void* method = PrepareAndDispatch; \ - register nsresult result; \ - __asm__ __volatile__( \ - "leal 0x0c(%%ebp), %%ecx\n\t" /* args */ \ - "pushl %%ecx\n\t" \ - "pushl $"#n"\n\t" /* method index */ \ - "movl 0x08(%%ebp), %%ecx\n\t" /* this */ \ - "pushl %%ecx\n\t" \ - "call *%%edx" /* PrepareAndDispatch */ \ - : "=a" (result) /* %0 */ \ - : "d" (method) /* %1 */ \ - : "ax", "dx", "cx", "memory" ); \ - return result; \ -} - -#define SENTINEL_ENTRY(n) \ -nsresult nsXPTCStubBase::Sentinel##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#include "xptcstubsdef.inc" - -#endif diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unsupported.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unsupported.cpp deleted file mode 100644 index 01a3f30653b..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/unix/xptcstubs_unsupported.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implement shared vtbl methods. */ - -#include "xptcprivate.h" - -#define STUB_ENTRY(n) \ -nsresult nsXPTCStubBase::Stub##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Stub called on unsupported platform"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#define SENTINEL_ENTRY(n) \ -nsresult nsXPTCStubBase::Sentinel##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#include "xptcstubsdef.inc" diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/win32/makefile.win b/mozilla/xpcom/libxpt/xptcall/src/md/win32/makefile.win deleted file mode 100644 index fca0aedf844..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/win32/makefile.win +++ /dev/null @@ -1,41 +0,0 @@ -#!nmake -# -# 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. - -DEPTH=..\..\..\..\..\.. -IGNORE_MANIFEST=1 -include <$(DEPTH)\config\config.mak> - -DEFINES=-DWIN32_LEAN_AND_MEAN -DEXPORT_XPTC_API - -LINCS=-I..\.. -I$(PUBLIC)\xptcall -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo - -LCFLAGS = \ - $(LCFLAGS) \ - $(DEFINES) \ - $(NULL) - -LIBRARY_NAME = xptcmd - -OBJS= \ - .\$(OBJDIR)\xptcinvoke.obj \ - .\$(OBJDIR)\xptcstubs.obj \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -install:: $(LIBRARY) diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcinvoke.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcinvoke.cpp deleted file mode 100644 index 166d9f5f3b5..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcinvoke.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Platform specific code to invoke XPCOM methods on native objects */ - -#include "xptcprivate.h" - -#ifndef WIN32 -#error "This code is for Win32 only" -#endif - -// Remember that on Win32 these 'words' are 32bit DWORDS - -static uint32 __stdcall -invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) -{ - PRUint32 result = 0; - for(PRUint32 i = 0; i < paramCount; i++, s++) - { - if(s->IsPtrData()) - { - result++; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : - case nsXPTType::T_I16 : - case nsXPTType::T_I32 : - result++; - break; - case nsXPTType::T_I64 : - result+=2; - break; - case nsXPTType::T_U8 : - case nsXPTType::T_U16 : - case nsXPTType::T_U32 : - result++; - break; - case nsXPTType::T_U64 : - result+=2; - break; - case nsXPTType::T_FLOAT : - result++; - break; - case nsXPTType::T_DOUBLE : - result+=2; - break; - case nsXPTType::T_BOOL : - case nsXPTType::T_CHAR : - case nsXPTType::T_WCHAR : - result++; - break; - default: - // all the others are plain pointer types - result++; - break; - } - } - return result; -} - -static void __stdcall -invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s) -{ - for(PRUint32 i = 0; i < paramCount; i++, d++, s++) - { - if(s->IsPtrData()) - { - *((void**)d) = s->ptr; - continue; - } - switch(s->type) - { - case nsXPTType::T_I8 : *((PRInt8*) d) = s->val.i8; break; - case nsXPTType::T_I16 : *((PRInt16*) d) = s->val.i16; break; - case nsXPTType::T_I32 : *((PRInt32*) d) = s->val.i32; break; - case nsXPTType::T_I64 : *((PRInt64*) d) = s->val.i64; d++; break; - case nsXPTType::T_U8 : *((PRUint8*) d) = s->val.u8; break; - case nsXPTType::T_U16 : *((PRUint16*)d) = s->val.u16; break; - case nsXPTType::T_U32 : *((PRUint32*)d) = s->val.u32; break; - case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break; - case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break; - case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break; - case nsXPTType::T_BOOL : *((PRBool*) d) = s->val.b; break; - case nsXPTType::T_CHAR : *((char*) d) = s->val.c; break; - case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break; - default: - // all the others are plain pointer types - *((void**)d) = s->val.p; - break; - } - } -} - -#pragma warning(disable : 4035) // OK to have no return value -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, - PRUint32 paramCount, nsXPTCVariant* params) -{ - __asm { - push params - push paramCount - call invoke_count_words // stdcall, result in eax - shl eax,2 // *= 4 - sub esp,eax // make space for params - mov edx,esp - push params - push paramCount - push edx - call invoke_copy_to_stack // stdcall - mov ecx,that // instance in ecx - push ecx // push this - mov edx,[ecx] // vtable in edx - mov eax,methodIndex - shl eax,2 // *= 4 - add edx,eax - call [edx] // stdcall, i.e. callee cleans up stack. - } -} -#pragma warning(default : 4035) // restore default diff --git a/mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcstubs.cpp b/mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcstubs.cpp deleted file mode 100644 index 068f4c7b54e..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/md/win32/xptcstubs.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implement shared vtbl methods. */ - -#include "xptcprivate.h" - -#ifndef WIN32 -#error "This code is for Win32 only" -#endif - -static nsresult __stdcall -PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, - PRUint32* args, PRUint32* stackBytesToPop) -{ -#define PARAM_BUFFER_COUNT 16 - - nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; - nsXPTCMiniVariant* dispatchParams = NULL; - nsIInterfaceInfo* iface_info = NULL; - const nsXPTMethodInfo* info; - PRUint8 paramCount; - PRUint8 i; - nsresult result = NS_ERROR_FAILURE; - - // If anything fails before stackBytesToPop can be set then - // the failure is completely catastrophic! - - NS_ASSERTION(self,"no self"); - - self->GetInterfaceInfo(&iface_info); - NS_ASSERTION(iface_info,"no interface info"); - - iface_info->GetMethodInfo(PRUint16(methodIndex), &info); - NS_ASSERTION(info,"no interface info"); - - paramCount = info->GetParamCount(); - - // setup variant array pointer - if(paramCount > PARAM_BUFFER_COUNT) - dispatchParams = new nsXPTCMiniVariant[paramCount]; - else - dispatchParams = paramBuffer; - NS_ASSERTION(dispatchParams,"no place for params"); - - PRUint32* ap = args; - for(i = 0; i < paramCount; i++, ap++) - { - const nsXPTParamInfo& param = info->GetParam(i); - const nsXPTType& type = param.GetType(); - nsXPTCMiniVariant* dp = &dispatchParams[i]; - - if(param.IsOut() || !type.IsArithmetic()) - { - dp->val.p = (void*) *ap; - continue; - } - // else - switch(type) - { - case nsXPTType::T_I8 : dp->val.i8 = *((PRInt8*) ap); break; - case nsXPTType::T_I16 : dp->val.i16 = *((PRInt16*) ap); break; - case nsXPTType::T_I32 : dp->val.i32 = *((PRInt32*) ap); break; - case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); ap++; break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint8*) ap); break; - case nsXPTType::T_U16 : dp->val.u16 = *((PRUint16*)ap); break; - case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; - case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*)ap); ap++; break; - case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break; - case nsXPTType::T_BOOL : dp->val.b = *((PRBool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((char*) ap); break; - case nsXPTType::T_WCHAR : dp->val.wc = *((wchar_t*) ap); break; - default: - NS_ASSERTION(0, "bad type"); - break; - } - } - *stackBytesToPop = ((PRUint32)ap) - ((PRUint32)args); - - result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); - - NS_RELEASE(iface_info); - - if(dispatchParams != paramBuffer) - delete [] dispatchParams; - - return result; -} - -static __declspec(naked) void SharedStub(void) -{ - __asm { - push ebp // set up simple stack frame - mov ebp, esp // stack has: ebp/vtbl_index/retaddr/this/args - push ecx // make room for a ptr - lea eax, [ebp-4] // pointer to stackBytesToPop - push eax - lea ecx, [ebp+16] // pointer to args - push ecx - mov edx, [ebp+4] // vtbl_index - push edx - mov eax, [ebp+12] // this - push eax - call PrepareAndDispatch - mov edx, [ebp+8] // return address - mov ecx, [ebp-4] // stackBytesToPop - add ecx, 12 // for this, the index, and ret address - mov esp, ebp - pop ebp - add esp, ecx // fix up stack pointer - jmp edx // simulate __stdcall return - } -} - -// these macros get expanded (many times) in the file #included below -#define STUB_ENTRY(n) \ -__declspec(naked) nsresult __stdcall nsXPTCStubBase::Stub##n() \ -{ __asm push n __asm jmp SharedStub } - -#define SENTINEL_ENTRY(n) \ -nsresult __stdcall nsXPTCStubBase::Sentinel##n() \ -{ \ - NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ - return NS_ERROR_NOT_IMPLEMENTED; \ -} - -#pragma warning(disable : 4035) // OK to have no return value -#include "xptcstubsdef.inc" -#pragma warning(default : 4035) // restore default - diff --git a/mozilla/xpcom/libxpt/xptcall/src/xptcall.cpp b/mozilla/xpcom/libxpt/xptcall/src/xptcall.cpp deleted file mode 100644 index e084694b03e..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/xptcall.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* entry point wrappers. */ - -#include "xptcprivate.h" diff --git a/mozilla/xpcom/libxpt/xptcall/src/xptcprivate.h b/mozilla/xpcom/libxpt/xptcall/src/xptcprivate.h deleted file mode 100644 index d30e566c9cf..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/src/xptcprivate.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* All the xptcall private declarations - only include locally. */ - -#ifndef xptcprivate_h___ -#define xptcprivate_h___ - -#include "xptcall.h" - -#endif /* xptcprivate_h___ */ diff --git a/mozilla/xpcom/libxpt/xptcall/status.html b/mozilla/xpcom/libxpt/xptcall/status.html deleted file mode 100644 index 22532119c56..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/status.html +++ /dev/null @@ -1,13 +0,0 @@ - - -Document Moved! - - -
The xptcall status document has been moved to: -

-http://lxr.mozilla.org/mozilla/source/xpcom/reflect/xptcall/status.html -

-Please update your links. -

- - diff --git a/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in b/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in deleted file mode 100644 index b86a8cc0f5d..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/tests/Makefile.in +++ /dev/null @@ -1,68 +0,0 @@ -#!gmake -# -# 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. - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -VPATH = @srcdir@ -srcdir = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = TestXPTC - -SIMPLE_PROGRAMS = TestXPTCInvoke - -CPPSRCS = \ - TestXPTCInvoke.cpp \ - $(NULL) - -include $(topsrcdir)/config/config.mk - -CFLAGS += -DJS_THREADSAFE - -LIBS = \ - -L$(DIST)/bin \ - -lxpcom \ - -lxpt \ - -lxptcmd \ - -lxptinfo \ - -lreg \ - -lraptorbase \ - -l$(MOZ_LIB_UTIL_PREFIX)util \ - $(NSPR_LIBS) \ - $(NULL) - - -# PROGS = $(OBJDIR)/TestXPTCInvoke - -# TARGETS= $(PROGS) - -include $(topsrcdir)/config/rules.mk - -# INCLUDES += -I$(PUBLIC)/xpcom -I$(PUBLIC)/js -I$(PUBLIC)/xptcall \ -# -I$(PUBLIC)/xptinfo -I$(PUBLIC)/libxpt -I$(PUBLIC)/raptor - -#$(PROGS): $(OBJS) -# @$(MAKE_OBJDIR) -# $(CC) -o $@ $(OBJS) $(LD_FLAGS) -L$(DIST)/lib $(LIBS) $(OS_LIBS) - -# export:: $(TARGETS) -# $(INSTALL) $(PROGS) $(DIST)/bin - -# clobber:: -# rm -f $(DIST)/bin/TestXPTCInvoke -# rm -f $(PROGS) $(OBJS) diff --git a/mozilla/xpcom/libxpt/xptcall/tests/TestXPTCInvoke.cpp b/mozilla/xpcom/libxpt/xptcall/tests/TestXPTCInvoke.cpp deleted file mode 100644 index 2ba30d5eab8..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/tests/TestXPTCInvoke.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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. - */ - -/* Invoke tests xptcall. */ - -#include -#include "xptcall.h" -#include "prlong.h" - -// {AAC1FB90-E099-11d2-984E-006008962422} -#define INVOKETESTTARGET_IID \ -{ 0xaac1fb90, 0xe099, 0x11d2, \ - { 0x98, 0x4e, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } } - - -class InvokeTestTargetInterface : public nsISupports -{ -public: - NS_IMETHOD AddTwoInts(PRInt32 p1, PRInt32 p2, PRInt32* retval) = 0; - NS_IMETHOD MultTwoInts(PRInt32 p1, PRInt32 p2, PRInt32* retval) = 0; - NS_IMETHOD AddTwoLLs(PRInt64 p1, PRInt64 p2, PRInt64* retval) = 0; - NS_IMETHOD MultTwoLLs(PRInt64 p1, PRInt64 p2, PRInt64* retval) = 0; -}; - -class InvokeTestTarget : public InvokeTestTargetInterface -{ -public: - NS_DECL_ISUPPORTS - NS_IMETHOD AddTwoInts(PRInt32 p1, PRInt32 p2, PRInt32* retval); - NS_IMETHOD MultTwoInts(PRInt32 p1, PRInt32 p2, PRInt32* retval); - NS_IMETHOD AddTwoLLs(PRInt64 p1, PRInt64 p2, PRInt64* retval); - NS_IMETHOD MultTwoLLs(PRInt64 p1, PRInt64 p2, PRInt64* retval); - - InvokeTestTarget(); -}; - -static NS_DEFINE_IID(kInvokeTestTargetIID, INVOKETESTTARGET_IID); -NS_IMPL_ISUPPORTS(InvokeTestTarget, kInvokeTestTargetIID); - -InvokeTestTarget::InvokeTestTarget() -{ - NS_INIT_REFCNT(); - NS_ADDREF_THIS(); -} - -NS_IMETHODIMP -InvokeTestTarget::AddTwoInts(PRInt32 p1, PRInt32 p2, PRInt32* retval) -{ - *retval = p1 + p2; - return NS_OK; -} - -NS_IMETHODIMP -InvokeTestTarget::MultTwoInts(PRInt32 p1, PRInt32 p2, PRInt32* retval) -{ - *retval = p1 * p2; - return NS_OK; -} - -NS_IMETHODIMP -InvokeTestTarget::AddTwoLLs(PRInt64 p1, PRInt64 p2, PRInt64* retval) -{ - *retval = p1 + p2; - return NS_OK; -} - -NS_IMETHODIMP -InvokeTestTarget::MultTwoLLs(PRInt64 p1, PRInt64 p2, PRInt64* retval) -{ - *retval = p1 * p2; - return NS_OK; -} - -int main() -{ - InvokeTestTarget *test = new InvokeTestTarget(); - - PRInt32 out; - PRInt64 out64; - printf("calling direct:\n"); - if(NS_SUCCEEDED(test->AddTwoInts(1,1,&out))) - printf("\t1 + 1 = %d\n", out); - else - printf("\tFAILED"); - if(NS_SUCCEEDED(test->AddTwoLLs(LL_INIT(0,1),LL_INIT(0,1),&out64))) - printf("\t1L + 1L = %d\n", (int)out64); - else - printf("\tFAILED"); - if(NS_SUCCEEDED(test->MultTwoInts(2,2,&out))) - printf("\t2 * 2 = %d\n", out); - else - printf("\tFAILED"); - if(NS_SUCCEEDED(test->MultTwoLLs(LL_INIT(0,2),LL_INIT(0,2),&out64))) - printf("\t2L * 2L = %d\n", (int)out64); - else - printf("\tFAILED"); - - nsXPTCVariant var[3]; - - printf("calling via invoke:\n"); - - var[0].val.i32 = 1; - var[0].type = nsXPTType::T_I32; - var[0].flags = 0; - - var[1].val.i32 = 1; - var[1].type = nsXPTType::T_I32; - var[1].flags = 0; - - var[2].val.i32 = 0; - var[2].type = nsXPTType::T_I32; - var[2].flags = nsXPTCVariant::PTR_IS_DATA; - var[2].ptr = &var[2].val.i32; - - if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 3, 3, var))) - printf("\t1 + 1 = %d\n", var[2].val.i32); - else - printf("\tFAILED"); - - LL_I2L(var[0].val.i64, 1); - var[0].type = nsXPTType::T_I64; - var[0].flags = 0; - - LL_I2L(var[1].val.i64, 1); - var[1].type = nsXPTType::T_I64; - var[1].flags = 0; - - LL_I2L(var[2].val.i64, 0); - var[2].type = nsXPTType::T_I64; - var[2].flags = nsXPTCVariant::PTR_IS_DATA; - var[2].ptr = &var[2].val.i64; - - if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 5, 3, var))) - printf("\t1L + 1L = %d\n", (int)var[2].val.i64); - else - printf("\tFAILED"); - - var[0].val.i32 = 2; - var[0].type = nsXPTType::T_I32; - var[0].flags = 0; - - var[1].val.i32 = 2; - var[1].type = nsXPTType::T_I32; - var[1].flags = 0; - - var[2].val.i32 = 0; - var[2].type = nsXPTType::T_I32; - var[2].flags = nsXPTCVariant::PTR_IS_DATA; - var[2].ptr = &var[2].val.i32; - - if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 4, 3, var))) - printf("\t2 * 2 = %d\n", var[2].val.i32); - else - printf("\tFAILED"); - - LL_I2L(var[0].val.i64,2); - var[0].type = nsXPTType::T_I64; - var[0].flags = 0; - - LL_I2L(var[1].val.i64,2); - var[1].type = nsXPTType::T_I64; - var[1].flags = 0; - - LL_I2L(var[2].val.i64,0); - var[2].type = nsXPTType::T_I64; - var[2].flags = nsXPTCVariant::PTR_IS_DATA; - var[2].ptr = &var[2].val.i64; - - if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var))) - printf("\t2L * 2L = %d\n", (int)var[2].val.i64); - else - printf("\tFAILED"); - - return 0; -} - diff --git a/mozilla/xpcom/libxpt/xptcall/tests/makefile.win b/mozilla/xpcom/libxpt/xptcall/tests/makefile.win deleted file mode 100644 index f1a1be4f3a8..00000000000 --- a/mozilla/xpcom/libxpt/xptcall/tests/makefile.win +++ /dev/null @@ -1,66 +0,0 @@ -#!nmake -# -# 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. - -DEPTH=..\..\..\.. - -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = EXE -PROG1 = .\$(OBJDIR)\TestXPTCInvoke.exe -PROGRAMS = $(PROG1) - -LCFLAGS=-DUSE_NSREG - -DEFINES=-DWIN32_LEAN_AND_MEAN - -REQUIRES=xpcom xptcall - -LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\xptcall \ - -I$(PUBLIC)\raptor -I$(PUBLIC)\xptinfo -I$(PUBLIC)\libxpt - -LLIBS= \ - $(DIST)\lib\xptcall32.lib \ - $(DIST)\lib\xpcom.lib \ - $(LIBNSPR) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAMS) - -for %p in ($(PROGRAMS)) do $(MAKE_INSTALL) %p $(DIST)\bin - -for %p in ($(TESTCASES)) do $(MAKE_INSTALL) %p $(DIST)\bin - -clobber:: - -for %p in ($(PROGRAMS)) do $(RM) %p $(DIST)\bin\%p - -# Move this into config/obj.inc when it's allowed -.cpp{.\$(OBJDIR)\}.exe: - $(CC) @<<$(CFGFILE) - $(CFLAGS) - $(LCFLAGS) - $(LINCS) - $(LINCS_1) - $(INCS) - $(LLIBS) - $(OS_LIBS) - -Fd$(PDBFILE) - -Fe.\$(OBJDIR)\ - -Fo.\$(OBJDIR)\ - $(CURDIR)$(*B).cpp -< diff --git a/mozilla/xpcom/libxpt/xptinfo/public/MANIFEST b/mozilla/xpcom/libxpt/xptinfo/public/MANIFEST deleted file mode 100644 index 40064a19058..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/public/MANIFEST +++ /dev/null @@ -1,7 +0,0 @@ -# -# This is a list of local files which get copied to the mozilla:dist directory -# - -xptinfo.h -nsIInterfaceInfoManager.h -nsIInterfaceInfo.h diff --git a/mozilla/xpcom/libxpt/xptinfo/public/Makefile.in b/mozilla/xpcom/libxpt/xptinfo/public/Makefile.in deleted file mode 100644 index 9a150a50bda..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/public/Makefile.in +++ /dev/null @@ -1,36 +0,0 @@ -#!gmake -# 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) 1999 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = xptinfo - -CFLAGS += -DEXPORT_XPCI_API - -EXPORTS = \ - xptinfo.h \ - nsIInterfaceInfoManager.h \ - nsIInterfaceInfo.h \ - $(NULL) - -EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptinfo/public/makefile.win b/mozilla/xpcom/libxpt/xptinfo/public/makefile.win deleted file mode 100644 index e24dd1b99dd..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/public/makefile.win +++ /dev/null @@ -1,30 +0,0 @@ -#!nmake -# -# 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) 1999 Netscape Communications Corporation. All Rights -# Reserved. - -IGNORE_MANIFEST=1 - -DEPTH=..\..\..\.. - -EXPORTS = \ - xptinfo.h \ - nsIInterfaceInfoManager.h \ - nsIInterfaceInfo.h \ - $(NULL) - -MODULE = xptinfo - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfo.h b/mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfo.h deleted file mode 100644 index 52a352be954..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfo.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* The nsIInterfaceInfo xpcom public declaration. */ - -#ifndef nsIInterfaceInfo_h___ -#define nsIInterfaceInfo_h___ - -#include "nsISupports.h" - -// forward declaration of non-XPCOM types -class nsXPTMethodInfo; -class nsXPTConstant; -class nsXPTParamInfo; - -// {215DBE04-94A7-11d2-BA58-00805F8A5DD7} -#define NS_IINTERFACEINFO_IID \ -{ 0x215dbe04, 0x94a7, 0x11d2, \ - { 0xba, 0x58, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } } - -class nsIInterfaceInfo : public nsISupports -{ -public: - NS_DEFINE_STATIC_IID_ACCESSOR(NS_IINTERFACEINFO_IID) - - NS_IMETHOD GetName(char** name) = 0; // returns IAllocatator alloc'd copy - NS_IMETHOD GetIID(nsIID** iid) = 0; // returns IAllocatator alloc'd copy - - NS_IMETHOD IsScriptable(PRBool* result) = 0; - - NS_IMETHOD GetParent(nsIInterfaceInfo** parent) = 0; - - // these include counts of parents - NS_IMETHOD GetMethodCount(uint16* count) = 0; - NS_IMETHOD GetConstantCount(uint16* count) = 0; - - // These include methods and constants of parents. - // There do *not* make copies ***explicit bending of XPCOM rules*** - NS_IMETHOD GetMethodInfo(uint16 index, const nsXPTMethodInfo** info) = 0; - NS_IMETHOD GetMethodInfoForName(const char* methodName, uint16 *index, - const nsXPTMethodInfo** info) = 0; - NS_IMETHOD GetConstant(uint16 index, const nsXPTConstant** constant) = 0; - - // Get the interface information or iid associated with a param of some - // method in this interface. - NS_IMETHOD GetInfoForParam(const nsXPTParamInfo* param, - nsIInterfaceInfo** info) = 0; - // returns IAllocatator alloc'd copy - NS_IMETHOD GetIIDForParam(const nsXPTParamInfo* param, nsIID** iid) = 0; -}; - -#endif /* nsIInterfaceInfo_h___ */ diff --git a/mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfoManager.h b/mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfoManager.h deleted file mode 100644 index 44a03cf779f..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/public/nsIInterfaceInfoManager.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* The nsIInterfaceInfoManager xpcom public declaration. */ - -#ifndef nsIInterfaceInfoManager_h___ -#define nsIInterfaceInfoManager_h___ - -#include "nsIInterfaceInfo.h" - -// This should be implemented as a Service - -// {8B161900-BE2B-11d2-9831-006008962422} -#define NS_IINTERFACEINFO_MANAGER_IID \ -{ 0x8b161900, 0xbe2b, 0x11d2, \ - { 0x98, 0x31, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } } - -class nsIInterfaceInfoManager : public nsISupports -{ -public: - NS_DEFINE_STATIC_IID_ACCESSOR(NS_IINTERFACEINFO_MANAGER_IID) - - // nsIInformationInfo management services - NS_IMETHOD GetInfoForIID(const nsIID* iid, nsIInterfaceInfo** info) = 0; - NS_IMETHOD GetInfoForName(const char* name, nsIInterfaceInfo** info) = 0; - - // name <-> IID mapping services - // NOTE: these return IAllocatator alloc'd copies of the data - NS_IMETHOD GetIIDForName(const char* name, nsIID** iid) = 0; - NS_IMETHOD GetNameForIID(const nsIID* iid, char** name) = 0; - - // XXX other methods? - -}; - -#endif /* nsIInterfaceInfoManager_h___ */ - - diff --git a/mozilla/xpcom/libxpt/xptinfo/public/xptinfo.h b/mozilla/xpcom/libxpt/xptinfo/public/xptinfo.h deleted file mode 100644 index ceb5bd4d413..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/public/xptinfo.h +++ /dev/null @@ -1,212 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* XPTI_PUBLIC_API and XPTI_GetInterfaceInfoManager declarations. */ - -#ifndef xptiinfo_h___ -#define xptiinfo_h___ - -#include "prtypes.h" -#include "xpt_struct.h" - -/* - * The linkage of XPTI API functions differs depending on whether the file is - * used within the XPTI library or not. Any source file within the XPTI - * library should define EXPORT_XPTI_API whereas any client of the library - * should not. - */ -#ifdef EXPORT_XPTI_API -#define XPTI_PUBLIC_API(t) PR_IMPLEMENT(t) -#define XPTI_PUBLIC_DATA(t) PR_IMPLEMENT_DATA(t) -#ifdef _WIN32 -# define XPTI_EXPORT _declspec(dllexport) -#else -# define XPTI_EXPORT -#endif -#else -#ifdef _WIN32 -# define XPTI_PUBLIC_API(t) _declspec(dllimport) t -# define XPTI_PUBLIC_DATA(t) _declspec(dllimport) t -# define XPTI_EXPORT _declspec(dllimport) -#else -# define XPTI_PUBLIC_API(t) PR_IMPLEMENT(t) -# define XPTI_PUBLIC_DATA(t) t -# define XPTI_EXPORT -#endif -#endif -#define XPTI_FRIEND_API(t) XPTI_PUBLIC_API(t) -#define XPTI_FRIEND_DATA(t) XPTI_PUBLIC_DATA(t) - -class nsIInterfaceInfoManager; -PR_BEGIN_EXTERN_C -// Even if this is a service, it is cool to provide a direct accessor -XPTI_PUBLIC_API(nsIInterfaceInfoManager*) -XPTI_GetInterfaceInfoManager(); -PR_END_EXTERN_C - - - -// Flyweight wrapper classes for xpt_struct.h structs. -// Everything here is dependent upon - and sensitive to changes in - -// xpcom/libxpt/xpt_struct.h! - -class nsXPTType : public XPTTypeDescriptorPrefix -{ -// NO DATA - this a flyweight wrapper -public: - nsXPTType() - {} // random contents - nsXPTType(const XPTTypeDescriptorPrefix& prefix) - {*(XPTTypeDescriptorPrefix*)this = prefix;} - - nsXPTType(const uint8& prefix) - {*(uint8*)this = prefix;} - - nsXPTType& operator=(uint8 val) - {flags = val; return *this;} - - nsXPTType& operator=(const nsXPTType& other) - {flags = other.flags; return *this;} - - operator uint8() const - {return flags;} - - PRBool IsPointer() const - {return (PRBool) (XPT_TDP_IS_POINTER(flags));} - - PRBool IsUniquePointer() const - {return (PRBool) (XPT_TDP_IS_UNIQUE_POINTER(flags));} - - PRBool IsReference() const - {return (PRBool) (XPT_TDP_IS_REFERENCE(flags));} - - PRBool IsArithmetic() const // terminology from Harbison/Steele - {return flags <= T_WCHAR;} - - PRBool IsInterfacePointer() const - {return (PRBool) (TagPart() == T_INTERFACE || - TagPart() == T_INTERFACE_IS);} - - uint8 TagPart() const - {return (uint8) (flags & XPT_TDP_TAGMASK);} - - enum - { - T_I8 = TD_INT8 , - T_I16 = TD_INT16 , - T_I32 = TD_INT32 , - T_I64 = TD_INT64 , - T_U8 = TD_UINT8 , - T_U16 = TD_UINT16 , - T_U32 = TD_UINT32 , - T_U64 = TD_UINT64 , - T_FLOAT = TD_FLOAT , - T_DOUBLE = TD_DOUBLE , - T_BOOL = TD_BOOL , - T_CHAR = TD_CHAR , - T_WCHAR = TD_WCHAR , - T_VOID = TD_VOID , - T_IID = TD_PNSIID , - T_BSTR = TD_PBSTR , - T_CHAR_STR = TD_PSTRING , - T_WCHAR_STR = TD_PWSTRING , - T_INTERFACE = TD_INTERFACE_TYPE , - T_INTERFACE_IS = TD_INTERFACE_IS_TYPE - }; -// NO DATA - this a flyweight wrapper -}; - -class nsXPTParamInfo : public XPTParamDescriptor -{ -// NO DATA - this a flyweight wrapper -public: - nsXPTParamInfo(const XPTParamDescriptor& desc) - {*(XPTParamDescriptor*)this = desc;} - - - PRBool IsIn() const {return (PRBool) (XPT_PD_IS_IN(flags));} - PRBool IsOut() const {return (PRBool) (XPT_PD_IS_OUT(flags));} - PRBool IsRetval() const {return (PRBool) (XPT_PD_IS_RETVAL(flags));} - PRBool IsShared() const {return (PRBool) (XPT_PD_IS_SHARED(flags));} - const nsXPTType GetType() const {return type.prefix;} - - uint8 GetInterfaceIsArgNumber() const - { - NS_PRECONDITION(GetType().TagPart() == nsXPTType::T_INTERFACE_IS,"not an interface_is"); - return type.type.argnum; - } - // NOTE: gettting the interface or interface iid is done via methods on - // nsIInterfaceInfo - -private: - nsXPTParamInfo(); // no implementation -// NO DATA - this a flyweight wrapper -}; - -class nsXPTMethodInfo : public XPTMethodDescriptor -{ -// NO DATA - this a flyweight wrapper -public: - nsXPTMethodInfo(const XPTMethodDescriptor& desc) - {*(XPTMethodDescriptor*)this = desc;} - - PRBool IsGetter() const {return (PRBool) (XPT_MD_IS_GETTER(flags) );} - PRBool IsSetter() const {return (PRBool) (XPT_MD_IS_SETTER(flags) );} - PRBool IsVarArgs() const {return (PRBool) (XPT_MD_IS_VARARGS(flags));} - PRBool IsConstructor() const {return (PRBool) (XPT_MD_IS_CTOR(flags) );} - PRBool IsHidden() const {return (PRBool) (XPT_MD_IS_HIDDEN(flags) );} - const char* GetName() const {return name;} - uint8 GetParamCount() const {return num_args;} - const nsXPTParamInfo GetParam(uint8 index) const - { - NS_PRECONDITION(index < GetParamCount(),"bad arg"); - return params[index]; - } - const nsXPTParamInfo GetResult() const - {return *result;} -private: - nsXPTMethodInfo(); // no implementation -// NO DATA - this a flyweight wrapper -}; - - -// forward declaration -struct nsXPTCMiniVariant; - -class nsXPTConstant : public XPTConstDescriptor -{ -// NO DATA - this a flyweight wrapper -public: - nsXPTConstant(const XPTConstDescriptor& desc) - {*(XPTConstDescriptor*)this = desc;} - - const char* GetName() const - {return name;} - - const nsXPTType GetType() const - {return type.prefix;} - - // XXX this is ugly - const nsXPTCMiniVariant* GetValue() const - {return (nsXPTCMiniVariant*) &value;} -private: - nsXPTConstant(); // no implementation -// NO DATA - this a flyweight wrapper -}; - -#endif /* xptiinfo_h___ */ diff --git a/mozilla/xpcom/libxpt/xptinfo/src/Makefile.in b/mozilla/xpcom/libxpt/xptinfo/src/Makefile.in deleted file mode 100644 index a4b9c3e904a..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/Makefile.in +++ /dev/null @@ -1,39 +0,0 @@ -#!gmake -# 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. - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = xptinfo -LIBRARY_NAME = xptinfo - -CSRCS = $(NULL) - -CPPSRCS = nsInterfaceInfo.cpp \ - nsInterfaceInfoManager.cpp \ - nsTypelibRecord.cpp \ - nsInterfaceRecord.cpp \ - $(NULL) - -REQUIRES = $(MODULE) - -# export:: libs - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/xpcom/libxpt/xptinfo/src/makefile.win b/mozilla/xpcom/libxpt/xptinfo/src/makefile.win deleted file mode 100644 index eb5b7ac84f7..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/makefile.win +++ /dev/null @@ -1,71 +0,0 @@ -#!nmake -# -# 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) 1999 Netscape Communications Corporation. All Rights -# Reserved. - -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = DLL - -DEPTH=..\..\..\.. - -DLLNAME = xptinfo$(MOZ_BITS) -DLL =.\$(OBJDIR)\$(DLLNAME).dll - -LCFLAGS = -DEXPORT_XPTI_API -DWIN32_LEAN_AND_MEAN - -LINCS = \ - -I$(PUBLIC)\xpcom \ - -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\libxpt \ - -I$(PUBLIC)\xptinfo \ - $(NULL) - -LLIBS = \ - $(DIST)\lib\libxpt$(MOZ_BITS).lib \ - $(DIST)\lib\xpcom$(MOZ_BITS).lib \ - $(DIST)\lib\raptorbase.lib \ - $(LIBNSPR) \ - $(DIST)\lib\plc3.lib \ - $(NULL) - -CSRCS = \ - $(NULL) - -C_OBJS = \ - $(NULL) - -CPPSRCS = \ - nsInterfaceInfoManager.cpp \ - nsInterfaceInfo.cpp \ - nsInterfaceRecord.cpp \ - nsTypelibRecord.cpp \ - $(NULL) - - -CPP_OBJS = \ - .\$(OBJDIR)\nsInterfaceInfoManager.obj \ - .\$(OBJDIR)\nsInterfaceInfo.obj \ - .\$(OBJDIR)\nsInterfaceRecord.obj \ - .\$(OBJDIR)\nsTypelibRecord.obj \ - $(NULL) - -MODULE = xptinfo - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.cpp b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.cpp deleted file mode 100644 index d264fef1aa7..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implementation of nsIInterfaceInfoManager. */ - -#include "nscore.h" - -#include "nsISupports.h" -#include "nsIInterfaceInfo.h" -#include "nsIInterfaceInfoManager.h" -#include "nsIAllocator.h" - -#include "nsInterfaceInfo.h" -#include "nsInterfaceInfoManager.h" -#include "xptinfo.h" - -static NS_DEFINE_IID(kIInterfaceInfoIID, NS_IINTERFACEINFO_IID); -NS_IMPL_ISUPPORTS(nsInterfaceInfo, kIInterfaceInfoIID); - -nsInterfaceInfo::nsInterfaceInfo(nsInterfaceRecord *record, - nsInterfaceInfo *parent) - : mInterfaceRecord(record), - mParent(parent) -{ - NS_INIT_REFCNT(); - NS_ADDREF_THIS(); - - if(mParent != NULL) { - NS_ADDREF(mParent); - mMethodBaseIndex = - mParent->mMethodBaseIndex + mParent->mMethodCount; - mConstantBaseIndex = - mParent->mConstantBaseIndex + mParent->mConstantCount; - } else { - mMethodBaseIndex = mConstantBaseIndex = 0; - } - - mMethodCount = - mInterfaceRecord->interfaceDescriptor->num_methods; - mConstantCount = - mInterfaceRecord->interfaceDescriptor->num_constants; -} - -nsInterfaceInfo::~nsInterfaceInfo() -{ - if (this->mParent != NULL) - NS_RELEASE(mParent); - - // remove interface record's notion of my existence - mInterfaceRecord->info = NULL; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetName(char **name) -{ - return this->mInterfaceRecord->GetName(name); -} - -NS_IMETHODIMP -nsInterfaceInfo::GetIID(nsIID **iid) -{ - return this->mInterfaceRecord->GetIID(iid); -} - -NS_IMETHODIMP -nsInterfaceInfo::IsScriptable(PRBool* result) -{ - if(!result) - return NS_ERROR_NULL_POINTER; - *result = XPT_ID_IS_SCRIPTABLE(this->mInterfaceRecord-> - interfaceDescriptor->flags); - return NS_OK; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetParent(nsIInterfaceInfo** parent) -{ - NS_PRECONDITION(parent, "bad param"); - if(mParent) { - NS_ADDREF(mParent); - *parent = mParent; - return NS_OK; - } - *parent = NULL; - return NS_ERROR_FAILURE; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetMethodCount(uint16* count) -{ - NS_PRECONDITION(count, "bad param"); - - *count = mMethodBaseIndex + mMethodCount; - return NS_OK; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetConstantCount(uint16* count) -{ - NS_PRECONDITION(count, "bad param"); - *count = mConstantBaseIndex + mConstantCount; - return NS_OK; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetMethodInfo(uint16 index, const nsXPTMethodInfo** info) -{ - NS_PRECONDITION(info, "bad param"); - if (index < mMethodBaseIndex) - return mParent->GetMethodInfo(index, info); - - if (index >= mMethodBaseIndex + mMethodCount) { - NS_PRECONDITION(0, "bad param"); - *info = NULL; - return NS_ERROR_INVALID_ARG; - } - - // else... - *info = NS_REINTERPRET_CAST(nsXPTMethodInfo*, - &mInterfaceRecord->interfaceDescriptor-> - method_descriptors[index - mMethodBaseIndex]); - return NS_OK; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetMethodInfoForName(const char* methodName, uint16 *index, - const nsXPTMethodInfo** result) -{ - // XXX probably want to speed this up with a hashtable, or by at least interning - // the names to avoid the strcmp - for (uint16 i = mMethodBaseIndex; i < mMethodCount; i++) { - const nsXPTMethodInfo* info; - info = NS_REINTERPRET_CAST(nsXPTMethodInfo*, - &mInterfaceRecord->interfaceDescriptor-> - method_descriptors[i - mMethodBaseIndex]); - if (PL_strcmp(methodName, info->name) == 0) { -#ifdef NS_DEBUG - // make sure there aren't duplicate names - for (; i < mMethodCount; i++) { - const nsXPTMethodInfo* info2; - info2 = NS_REINTERPRET_CAST(nsXPTMethodInfo*, - &mInterfaceRecord->interfaceDescriptor-> - method_descriptors[i - mMethodBaseIndex]); - NS_ASSERTION(PL_strcmp(methodName, info2->name)!= 0, "duplicate names"); - } -#endif - *result = info; - return NS_OK; - } - } - return NS_ERROR_INVALID_ARG; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetConstant(uint16 index, const nsXPTConstant** constant) -{ - NS_PRECONDITION(constant, "bad param"); - if (index < mConstantBaseIndex) - return mParent->GetConstant(index, constant); - - if (index >= mConstantBaseIndex + mConstantCount) { - NS_PRECONDITION(0, "bad param"); - *constant = NULL; - return NS_ERROR_INVALID_ARG; - } - - // else... - *constant = - NS_REINTERPRET_CAST(nsXPTConstant*, - &mInterfaceRecord->interfaceDescriptor-> - const_descriptors[index-mConstantBaseIndex]); - return NS_OK; -} - -NS_IMETHODIMP -nsInterfaceInfo::GetInfoForParam(const nsXPTParamInfo *param, - nsIInterfaceInfo** info) -{ - // XXX should be a soft failure? - NS_PRECONDITION(param->GetType().TagPart() == nsXPTType::T_INTERFACE, - "not an interface"); - - nsInterfaceRecord *paramRecord = - *(this->mInterfaceRecord->typelibRecord-> - interfaceRecords + (param->type.type.interface - 1)); - - return paramRecord->GetInfo((nsInterfaceInfo **)info); -} - -NS_IMETHODIMP -nsInterfaceInfo::GetIIDForParam(const nsXPTParamInfo* param, nsIID** iid) -{ - NS_PRECONDITION(param->GetType().TagPart() == nsXPTType::T_INTERFACE, - "not an interface"); - - nsInterfaceRecord *paramRecord = - *(this->mInterfaceRecord->typelibRecord-> - interfaceRecords + (param->type.type.interface - 1)); - - return paramRecord->GetIID(iid); -} - -#ifdef DEBUG -#include -void -nsInterfaceInfo::print(FILE *fd) -{ - fprintf(fd, "iid: %s name: %s name_space: %s\n", - this->mInterfaceRecord->iid.ToString(), - this->mInterfaceRecord->name, - this->mInterfaceRecord->name_space); - if (mParent != NULL) { - fprintf(fd, "parent:\n\t"); - this->mParent->print(fd); - } -} -#endif diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.h b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.h deleted file mode 100644 index 1aa1b4a494e..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfo.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Library-private header for nsInterfaceInfo implementation. */ - -#ifndef nsInterfaceInfo_h___ -#define nsInterfaceInfo_h___ - -#include "nsIInterfaceInfo.h" -#include "xpt_struct.h" - -#include "nsInterfaceRecord.h" -#include "nsInterfaceInfoManager.h" - -#ifdef DEBUG -#include -#endif - -class nsInterfaceInfo : public nsIInterfaceInfo -{ - NS_DECL_ISUPPORTS - - NS_IMETHOD GetName(char** name); // returns IAllocatator alloc'd copy - NS_IMETHOD GetIID(nsIID** iid); // returns IAllocatator alloc'd copy - - NS_IMETHOD IsScriptable(PRBool* result); - - NS_IMETHOD GetParent(nsIInterfaceInfo** parent); - - // these include counts of parents - NS_IMETHOD GetMethodCount(uint16* count); - NS_IMETHOD GetConstantCount(uint16* count); - - // These include methods and constants of parents. - // There do *not* make copies ***explicit bending of XPCOM rules*** - NS_IMETHOD GetMethodInfo(uint16 index, const nsXPTMethodInfo** info); - NS_IMETHOD GetMethodInfoForName(const char* methodName, uint16 *index, - const nsXPTMethodInfo** info); - NS_IMETHOD GetConstant(uint16 index, const nsXPTConstant** constant); - - // Get the interface information or iid associated with a param of some - // method in this interface. - NS_IMETHOD GetInfoForParam(const nsXPTParamInfo* param, - nsIInterfaceInfo** info); - // returns IAllocatator alloc'd copy - NS_IMETHOD GetIIDForParam(const nsXPTParamInfo* param, nsIID** iid); - -public: - virtual ~nsInterfaceInfo(); - -#ifdef DEBUG - void NS_EXPORT print(FILE *fd); -#endif - -private: - friend class nsInterfaceRecord; - - nsInterfaceInfo(nsInterfaceRecord *record, nsInterfaceInfo *parent); - nsInterfaceRecord *mInterfaceRecord; - nsInterfaceInfo* mParent; - - uint16 mMethodBaseIndex; - uint16 mMethodCount; - uint16 mConstantBaseIndex; - uint16 mConstantCount; -}; - -#endif /* nsInterfaceInfo_h___ */ diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp deleted file mode 100644 index 58a1d57bb51..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Implementation of nsIInterfaceInfo. */ - -#ifdef XP_MAC -#include -#else -#include -#endif -#include "nscore.h" - -#include "nsSpecialSystemDirectory.h" - -#include "nsISupports.h" -#include "nsIInterfaceInfoManager.h" -#include "nsIInterfaceInfo.h" -#include "nsIServiceManager.h" -#include "nsIAllocator.h" - -#include "nsInterfaceInfoManager.h" -#include "nsInterfaceInfo.h" -#include "xptinfo.h" - -#include "prio.h" -#include "plstr.h" -#include "prenv.h" - -// this after nsISupports, to pick up IID -// so that xpt stuff doesn't try to define it itself... -#include "xpt_xdr.h" - -#ifdef DEBUG_mccabe -#define TRACE(x) fprintf x -#else -#define TRACE(x) -#endif - - -static NS_DEFINE_IID(kIIIManagerIID, NS_IINTERFACEINFO_MANAGER_IID); -NS_IMPL_ISUPPORTS(nsInterfaceInfoManager, kIIIManagerIID); - -// static -nsInterfaceInfoManager* -nsInterfaceInfoManager::GetInterfaceInfoManager() -{ - static nsInterfaceInfoManager* impl = NULL; - if(!impl) - { - impl = new nsInterfaceInfoManager(); - if(!impl->ctor_succeeded) - NS_RELEASE(impl); - } - if(impl) - NS_ADDREF(impl); - return impl; -} - -// static -nsIAllocator* -nsInterfaceInfoManager::GetAllocator(nsInterfaceInfoManager* iim /*= NULL*/) -{ - nsIAllocator* al; - nsInterfaceInfoManager* iiml = iim; - - if(!iiml && !(iiml = GetInterfaceInfoManager())) - return NULL; - if(NULL != (al = iiml->allocator)) - NS_ADDREF(al); - if(!iim) - NS_RELEASE(iiml); - return al; -} - -static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID); -static NS_DEFINE_IID(kIAllocatorIID, NS_IALLOCATOR_IID); - -nsInterfaceInfoManager::nsInterfaceInfoManager() - : allocator(NULL), typelibRecords(NULL), ctor_succeeded(PR_FALSE) -{ - NS_INIT_REFCNT(); - NS_ADDREF_THIS(); - - nsServiceManager::GetService(kAllocatorCID, - kIAllocatorIID, - (nsISupports **)&this->allocator); - - PR_ASSERT(this->allocator != NULL); - - if(NS_SUCCEEDED(this->initInterfaceTables())) - ctor_succeeded = PR_TRUE; -} - -static -XPTHeader *getHeader(const char *filename, nsIAllocator *al) { - XPTState *state = NULL; - XPTCursor curs, *cursor = &curs; - XPTHeader *header = NULL; - PRFileInfo fileinfo; - PRUint32 flen; - char *whole = NULL; - PRFileDesc *in = NULL; - - if (PR_GetFileInfo(filename, &fileinfo) != PR_SUCCESS) { - NS_ERROR("PR_GetFileInfo failed"); - return NULL; - } - flen = fileinfo.size; - - whole = (char *)al->Alloc(flen); - if (!whole) { - NS_ERROR("FAILED: allocation for whole"); - return NULL; - } - - in = PR_Open(filename, PR_RDONLY, 0); - if (!in) { - NS_ERROR("FAILED: fopen"); - goto out; - } - - if (flen > 0) { - PRInt32 howmany = PR_Read(in, whole, flen); - if (howmany < 0) { - NS_ERROR("FAILED: reading typelib file"); - goto out; - } - -#ifdef XP_MAC - // Mac can lie about the filesize, because it includes the resource fork - // (where our CVS information lives). So we'll just believe it if it read - // less than flen bytes. - flen = howmany; -#else - if (howmany < flen) { - NS_ERROR("typelib short read"); - goto out; - } -#endif - - state = XPT_NewXDRState(XPT_DECODE, whole, flen); - if (!XPT_MakeCursor(state, XPT_HEADER, 0, cursor)) { - NS_ERROR("MakeCursor failed\n"); - goto out; - } - if (!XPT_DoHeader(cursor, &header)) { - NS_ERROR("DoHeader failed\n"); - goto out; - } - } - - out: - if (state != NULL) - XPT_DestroyXDRState(state); - if (whole != NULL) - al->Free(whole); - if (in != NULL) - PR_Close(in); - return header; -} - -nsresult -nsInterfaceInfoManager::indexify_file(const char *filename) -{ - XPTHeader *header = getHeader(filename, this->allocator); - if (header == NULL) { - // XXX glean something more meaningful from getHeader? - return NS_ERROR_FAILURE; - } - - int limit = header->num_interfaces; - nsTypelibRecord *tlrecord = new nsTypelibRecord(limit, this->typelibRecords, - header, this->allocator); - this->typelibRecords = tlrecord; // add it to the list of typelibs - - for (int i = 0; i < limit; i++) { - XPTInterfaceDirectoryEntry *current = header->interface_directory + i; - - // find or create an interface record, and set the appropriate - // slot in the nsTypelibRecord array. - nsID zero = - { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }; - nsInterfaceRecord *record = NULL; - - PRBool iidIsZero = current->iid.Equals(zero); - - // XXX fix bogus repetitive logic. - PRBool foundInIIDTable = PR_FALSE; - - if (iidIsZero == PR_FALSE) { - // prefer the iid. - nsIDKey idKey(current->iid); - record = (nsInterfaceRecord *)this->IIDTable->Get(&idKey); - } else { - foundInIIDTable = PR_TRUE; - // resort to using the name. Warn? - record = (nsInterfaceRecord *)PL_HashTableLookup(this->nameTable, - current->name); - } - - // if none was found, create one and tuck it into the appropriate places. - if (record == NULL) { - record = new nsInterfaceRecord(); - record->typelibRecord = NULL; - record->interfaceDescriptor = NULL; - record->info = NULL; - - // XXX copy these values? - record->name = current->name; - record->name_space = current->name_space; - - // add it to the name->interfaceRecord table - // XXX check that result (PLHashEntry *) isn't NULL - PL_HashTableAdd(this->nameTable, current->name, record); - - if (iidIsZero == PR_FALSE) { - // Add it to the iid table too, if we have an iid. - // don't check against old value, b/c we shouldn't have one. - foundInIIDTable = PR_TRUE; - nsIDKey idKey(current->iid); - this->IIDTable->Put(&idKey, record); - } - } - - // Is the entry we're looking at resolved? - if (current->interface_descriptor != NULL) { - if (record->interfaceDescriptor != NULL) { - char *warnstr = PR_smprintf - ("interface %s in typelib %s overrides previous definition", - current->name, filename); - NS_WARNING(warnstr); - PR_smprintf_free(warnstr); - } - record->interfaceDescriptor = current->interface_descriptor; - record->typelibRecord = tlrecord; - record->iid = current->iid; - - if (foundInIIDTable == PR_FALSE) { - nsIDKey idKey(current->iid); - this->IIDTable->Put(&idKey, record); - } - } - - // all fixed up? Put a pointer to the interfaceRecord we - // found/made into the appropriate place. - *(tlrecord->interfaceRecords + i) = record; - } - return NS_OK; -} - -// as many InterfaceDirectoryEntries as we expect to see. -#define XPT_HASHSIZE 64 - -#ifdef DEBUG -PRIntn check_nametable_enumerator(PLHashEntry *he, PRIntn index, void *arg) { - char *key = (char *)he->key; - nsInterfaceRecord *value = (nsInterfaceRecord *)he->value; - nsHashtable *iidtable = (nsHashtable *)arg; - - TRACE((stderr, "name table has %s\n", key)); - - if (value->interfaceDescriptor == NULL) { - TRACE((stderr, "unresolved interface %s\n", key)); - } else { - nsIDKey idKey(value->iid); - char *name_from_iid = (char *)iidtable->Get(&idKey); - NS_ASSERTION(name_from_iid != NULL, - "no name assoc'd with iid for entry for name?"); - - // XXX note that below is only ncc'ly the case if xdr doesn't give us - // duplicated strings. -// NS_ASSERTION(name_from_iid == key, -// "key and iid name xpected to be same"); - } - return HT_ENUMERATE_NEXT; -} - -PRBool check_iidtable_enumerator(nsHashKey *aKey, void *aData, void *closure) { -// PLHashTable *nameTable = (PLHashTable *)closure; - nsInterfaceRecord *record = (nsInterfaceRecord *)aData; - // can I do anything with the key? - TRACE((stderr, "record has name %s, iid %s\n", - record->name, record->iid.ToString())); - return PR_TRUE; -} - -#endif - -nsresult -nsInterfaceInfoManager::initInterfaceTables() -{ - // make a hashtable to map names to interface records. - this->nameTable = PL_NewHashTable(XPT_HASHSIZE, - PL_HashString, // hash keys - PL_CompareStrings, // compare keys - PL_CompareValues, // comp values - NULL, NULL); - if (this->nameTable == NULL) - return NS_ERROR_FAILURE; - - // make a hashtable to map iids to interface records. - this->IIDTable = new nsHashtable(XPT_HASHSIZE); - if (this->IIDTable == NULL) { - PL_HashTableDestroy(this->nameTable); - return NS_ERROR_FAILURE; - } - - // this code stolen from SetupRegistry; it might bear further - // examination, as the code there doesn't look quite done. - nsSpecialSystemDirectory sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); - sysdir += "components"; -// const char *xptdirname = sysdir.GetCString(); // native path - -#ifdef XP_MAC - PRBool wasAlias; - sysdir.ResolveAlias(wasAlias); -#endif - -#ifdef DEBUG - int which = 0; -#endif - - for (nsDirectoryIterator i(sysdir); i.Exists(); i++) { - // XXX need to copy? - nsFileSpec spec = i.Spec(); - -#ifdef XP_MAC - spec.ResolveAlias(wasAlias); -#endif - - if (! spec.IsFile()) - continue; - - // XXX this assumes ASCII strings are returned from nsFileSpec. Is this valid? - nsNSPRPath path(spec); - const char* fullname = path; // path needs to stay in scope, beacuse fullname refers to an internal member - int flen = PL_strlen(fullname); - if (flen < 4 || PL_strcasecmp(&(fullname[flen - 4]), ".xpt")) - continue; - - // it's a valid file, read it in. -#ifdef DEBUG - which++; - TRACE((stderr, "%d %s\n", which, fullname)); -#endif - - nsresult nsr = this->indexify_file(fullname); - if (NS_IS_ERROR(nsr)) { - char *warnstr = PR_smprintf("failed to process typelib file %s", - fullname); - NS_WARNING(warnstr); - PR_smprintf_free(warnstr); - } - } - -#ifdef DEBUG - TRACE((stderr, "\nchecking name table for unresolved entries...\n")); - // scan here to confirm that all interfaces are resolved. - PL_HashTableEnumerateEntries(this->nameTable, - check_nametable_enumerator, - this->IIDTable); - - TRACE((stderr, "\nchecking iid table for unresolved entries...\n")); - IIDTable->Enumerate(check_iidtable_enumerator, this->nameTable); - -#endif - return NS_OK; -} - -nsInterfaceInfoManager::~nsInterfaceInfoManager() -{ - // let the singleton leak -} - -NS_IMETHODIMP -nsInterfaceInfoManager::GetInfoForIID(const nsIID* iid, - nsIInterfaceInfo **info) -{ - nsIDKey idKey(*iid); - nsInterfaceRecord *record = - (nsInterfaceRecord *)this->IIDTable->Get(&idKey); - if (record == NULL) { - *info = NULL; - return NS_ERROR_FAILURE; - } - - return record->GetInfo((nsInterfaceInfo **)info); -} - -NS_IMETHODIMP -nsInterfaceInfoManager::GetInfoForName(const char* name, - nsIInterfaceInfo **info) -{ - nsInterfaceRecord *record = - (nsInterfaceRecord *)PL_HashTableLookup(this->nameTable, name); - if (record == NULL) { - *info = NULL; - return NS_ERROR_FAILURE; - } - - return record->GetInfo((nsInterfaceInfo **)info); -} - -NS_IMETHODIMP -nsInterfaceInfoManager::GetIIDForName(const char* name, nsIID** iid) -{ - nsInterfaceRecord *record = - (nsInterfaceRecord *)PL_HashTableLookup(this->nameTable, name); - if (record == NULL) { - *iid = NULL; - return NS_ERROR_FAILURE; - } - - return record->GetIID(iid); -} - -NS_IMETHODIMP -nsInterfaceInfoManager::GetNameForIID(const nsIID* iid, char** name) -{ - nsIDKey idKey(*iid); - nsInterfaceRecord *record = - (nsInterfaceRecord *)this->IIDTable->Get(&idKey); - if (record == NULL) { - *name = NULL; - return NS_ERROR_FAILURE; - } - -#ifdef DEBUG - // Note that this might fail for same-name, different-iid interfaces! - nsIID *newid; - nsresult isok = GetIIDForName(record->name, &newid); - PR_ASSERT(!(NS_IS_ERROR(isok))); - PR_ASSERT(newid->Equals(*newid)); -#endif - PR_ASSERT(record->name != NULL); - - char *p; - int len = strlen(record->name) + 1; - if((p = (char *)this->allocator->Alloc(len)) == NULL) { - *name = NULL; - return NS_ERROR_FAILURE; - } - memcpy(p, record->name, len); - *name = p; - return NS_OK; -} - -XPTI_PUBLIC_API(nsIInterfaceInfoManager*) -XPTI_GetInterfaceInfoManager() -{ - return nsInterfaceInfoManager::GetInterfaceInfoManager(); -} diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.h b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.h deleted file mode 100644 index a256eeb5190..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceInfoManager.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Library-private header for nsInterfaceInfoManager implementation. */ - -#ifndef nsInterfaceInfoManager_h___ -#define nsInterfaceInfoManager_h___ - -#include "plhash.h" -#include "nsIAllocator.h" -#include "nsIInterfaceInfo.h" -#include "nsIInterfaceInfoManager.h" -#include "nsHashtable.h" - -#include "xpt_struct.h" -#include "nsInterfaceInfo.h" - -#include "nsInterfaceRecord.h" -#include "nsTypelibRecord.h" - - -class nsInterfaceInfoManager : public nsIInterfaceInfoManager -{ - NS_DECL_ISUPPORTS - - // nsIInformationInfo management services - NS_IMETHOD GetInfoForIID(const nsIID* iid, nsIInterfaceInfo** info); - NS_IMETHOD GetInfoForName(const char* name, nsIInterfaceInfo** info); - - // name <-> IID mapping services - NS_IMETHOD GetIIDForName(const char* name, nsIID** iid); - NS_IMETHOD GetNameForIID(const nsIID* iid, char** name); - -public: - virtual ~nsInterfaceInfoManager(); - static nsInterfaceInfoManager* GetInterfaceInfoManager(); - static nsIAllocator* GetAllocator(nsInterfaceInfoManager* iim = NULL); - -private: - nsInterfaceInfoManager(); - nsresult initInterfaceTables(); - - // Should this be public? - nsresult indexify_file(const char *filename); - - // list of typelib records for enumeration. (freeing?) - nsTypelibRecord *typelibRecords; - - // mapping between names and records - PLHashTable *nameTable; - - // mapping between IIDs and records. - nsHashtable *IIDTable; - - nsIAllocator *allocator; - PRBool ctor_succeeded; -}; - -#endif /* nsInterfaceInfoManager_h___ */ - - - diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.cpp b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.cpp deleted file mode 100644 index 8f3acfc028b..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Persistent interface records, shared between typelib records. */ - -#include "nsInterfaceRecord.h" -#include "nsInterfaceInfo.h" - -// Follow XPCOM pattern for these functions to allow forwarding -// through xpcom interfaces. - -nsresult -nsInterfaceRecord::GetInfo(nsInterfaceInfo **result) -{ - if (this->info != NULL) { - // XXX should add ref here? (not xposed in public api...) - NS_ADDREF(this->info); - *result = this->info; - return NS_OK; - } - - if (this->interfaceDescriptor == NULL || this->typelibRecord == NULL) { - *result = NULL; - return NS_ERROR_FAILURE; - } - - // time to make one. First, find a parent. - nsIInterfaceInfo *parent; - uint16 parent_index = this->interfaceDescriptor->parent_interface; - if (parent_index == 0) { // is it nsISupports? - parent = NULL; - } else { - nsInterfaceRecord *parent_record = - this->typelibRecord->interfaceRecords[parent_index - 1]; - nsresult nsr = parent_record->GetInfo((nsInterfaceInfo **)&parent); - if (NS_IS_ERROR(nsr)) { - *result = NULL; - return nsr; // ? ... or NS_ERROR_FAILURE - } - } - - // got a parent for it, now build the object itself - *result = new nsInterfaceInfo(this, (nsInterfaceInfo *)parent); - if (*result == NULL) { - NS_RELEASE(parent); - } else { - NS_ADDREF(*result); - this->info = *result; - } - return NS_OK; -} - -nsresult -nsInterfaceRecord::GetIID(nsIID **iid) { - NS_PRECONDITION(iid, "bad param"); - - nsIAllocator* allocator; - if(this->interfaceDescriptor != NULL && - NULL != (allocator = nsInterfaceInfoManager::GetAllocator())) - { - nsIID* p = (nsIID*)allocator->Alloc(sizeof(nsIID)); - NS_RELEASE(allocator); - if(p) { - memcpy(p, &(this->iid), sizeof(nsIID)); - *iid = p; - return NS_OK; - } - } - - *iid = NULL; - return NS_ERROR_FAILURE; -} - -nsresult -nsInterfaceRecord::GetName(char **name) -{ - NS_PRECONDITION(name, "bad param"); - - nsIAllocator* allocator; - if(NULL != (allocator = nsInterfaceInfoManager::GetAllocator())) { - int len = strlen(this->name)+1; - char* p = (char*)allocator->Alloc(len); - NS_RELEASE(allocator); - if(p) { - memcpy(p, this->name, len); - *name = p; - return NS_OK; - } - } - - *name = NULL; - return NS_ERROR_FAILURE; -} diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.h b/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.h deleted file mode 100644 index 8a240b5bbb9..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsInterfaceRecord.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* For keeping track of interface directory entries. */ - -#ifndef nsInterfaceRecord_h___ -#define nsInterfaceRecord_h___ - -#include "nsInterfaceInfo.h" -#include "xpt_struct.h" - -// resolve circular ref... -class nsInterfaceInfo; -class nsTypelibRecord; - -// For references in the IIDTable, nameTable hashtables in the -// nsInterfaceInfoManager. -class nsInterfaceRecord { -public: - // Accessors for these? - - nsID iid; - char *name; - char *name_space; - - nsTypelibRecord *typelibRecord; - XPTInterfaceDescriptor *interfaceDescriptor; - - // adds ref - nsresult GetInfo(nsInterfaceInfo **result); - - // makes allocator alloc'd copy. - nsresult GetIID(nsIID **iid); - nsresult GetName(char **name); - - // so that nsInterfaceInfo destructor can null it out. - nsInterfaceInfo *info; -}; - -#endif /* nsInterfaceRecord_h___ */ diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.cpp b/mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.cpp deleted file mode 100644 index 0e34c1d51f9..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -// XXX fold this (and the .h file) into nsInterfaceInfoManager.cpp? - -#include "nsTypelibRecord.h" -#include "nsInterfaceRecord.h" -#include "xpt_struct.h" - -nsTypelibRecord::nsTypelibRecord(int size, nsTypelibRecord *next, - XPTHeader *header, nsIAllocator *allocator) - : next(next), - header(header) -{ - this->interfaceRecords = (nsInterfaceRecord **) - allocator->Alloc((size + 1) * (sizeof (nsInterfaceRecord *))); - // XXX how to account for failure in a constructor? Can we return null? - - // NULL-terminate it. The rest will get filled in. - this->interfaceRecords[size] = NULL; -} - diff --git a/mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.h b/mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.h deleted file mode 100644 index a227e6d8145..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/src/nsTypelibRecord.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* For keeping track of typelibs and their interface directory tables. */ - -#ifndef nsTypelibRecord_h___ -#define nsTypelibRecord_h___ - -/* class nsInterfaceInfoManager; */ - - -struct XPTHeader; -class nsIAllocator; -class nsInterfaceInfoManager; -class nsInterfaceRecord; - -class nsTypelibRecord { - // XXX accessors? Could conceal 1-based offset here. -public: - friend class nsInterfaceInfoManager; - - nsTypelibRecord(int size, nsTypelibRecord *next, XPTHeader *header, - nsIAllocator *allocator); - - // array of pointers to (potentially shared) interface records, - // NULL terminated. - nsInterfaceRecord **interfaceRecords; - nsTypelibRecord *next; - XPTHeader *header; -}; - -#endif /* nsTypelibRecord_h___ */ - diff --git a/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in b/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in deleted file mode 100644 index 6c9234370bd..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/tests/Makefile.in +++ /dev/null @@ -1,45 +0,0 @@ -# -# 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. - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = libxpt - -SIMPLE_PROGRAMS = TestInterfaceInfo - -CSRCS = - -CPPSRCS = \ - TestInterfaceInfo.cpp \ - $(NULL) - -LIBS = \ - -L$(DIST)/bin \ - -lxptinfo \ - -lxpt \ - -lxpcom \ - -lreg \ - -lraptorbase \ - $(NSPR_LIBS) \ - $(NULL) - -include $(topsrcdir)/config/rules.mk - diff --git a/mozilla/xpcom/libxpt/xptinfo/tests/TestInterfaceInfo.cpp b/mozilla/xpcom/libxpt/xptinfo/tests/TestInterfaceInfo.cpp deleted file mode 100644 index 47ff927b3da..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/tests/TestInterfaceInfo.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * 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) 1999 Netscape Communications Corporation. All Rights - * Reserved. - */ - -/* Some simple smoke tests of the typelib loader. */ - -#include "nscore.h" - -#include "nsISupports.h" -#include "nsIInterfaceInfo.h" -#include "nsIInterfaceInfoManager.h" -#include "xptinfo.h" - -#include - -#include "../src/nsInterfaceInfo.h" - -static void RegAllocator(); - -// This file expects the nsInterfaceInfoManager to be able to discover -// .xpt files corresponding to those in xpcom/idl. Currently this -// means setting XPTDIR in the environment to some directory -// containing these files. - -int main (int argc, char **argv) { - int i; - nsIID *iid1, *iid2, *iid3, *iid4, *iid5, *iid6; - char *name1, *name2, *name3, *name4, *name5, *name6; - nsIInterfaceInfo *info1, *info2, *info3, *info4, *info5, *info6;; - - RegAllocator(); - - nsIInterfaceInfoManager *iim = XPTI_GetInterfaceInfoManager(); - - fprintf(stderr, "\ngetting iid for 'nsISupports'\n"); - iim->GetIIDForName("nsISupports", &iid1); - iim->GetNameForIID(iid1, &name1); - fprintf(stderr, "%s iid %s\n", name1, iid1->ToString()); - - fprintf(stderr, "\ngetting iid for 'nsIBaseStream'\n"); - iim->GetIIDForName("nsIBaseStream", &iid2); - iim->GetNameForIID(iid2, &name2); - fprintf(stderr, "%s iid %s\n", name2, iid2->ToString()); - - fprintf(stderr, "iid: %s, name: %s\n", iid1->ToString(), name1); - fprintf(stderr, "iid: %s, name: %s\n", iid2->ToString(), name2); - - fprintf(stderr, "\ngetting info for iid2 from above\n"); - iim->GetInfoForIID(iid2, &info2); -#ifdef DEBUG - ((nsInterfaceInfo *)info2)->print(stderr); -#endif - - fprintf(stderr, "\ngetting iid for 'nsIInputStream'\n"); - iim->GetIIDForName("nsIInputStream", &iid3); - iim->GetNameForIID(iid3, &name3); - fprintf(stderr, "%s iid %s\n", name3, iid2->ToString()); - iim->GetInfoForIID(iid3, &info3); -#ifdef DEBUG - ((nsInterfaceInfo *)info3)->print(stderr); -#endif - - fprintf(stderr, "\ngetting info for name 'nsIBidirectionalEnumerator'\n"); - iim->GetInfoForName("nsIBidirectionalEnumerator", &info4); -#ifdef DEBUG - ((nsInterfaceInfo *)info4)->print(stderr); -#endif - - fprintf(stderr, "\nparams work?\n"); - fprintf(stderr, "\ngetting info for name 'nsIServiceManager'\n"); - iim->GetInfoForName("nsIServiceManager", &info5); -#ifdef DEBUG - ((nsInterfaceInfo *)info5)->print(stderr); -#endif - - uint16 methodcount; - info5->GetMethodCount(&methodcount); - const nsXPTMethodInfo *mi; - for (i = 0; i < methodcount; i++) { - info5->GetMethodInfo(i, &mi); - char *methodname; - fprintf(stderr, "method %d, name %s\n", i, mi->GetName()); - } - - // 7 is GetServiceWithListener, which has juicy params. - info5->GetMethodInfo(7, &mi); - uint8 paramcount = mi->GetParamCount(); - - nsXPTParamInfo param2 = mi->GetParam(2); - // should be IID for nsIShutdownListener - nsIID *nsISL; - info5->GetIIDForParam(¶m2, &nsISL); -// const nsIID *nsISL = param2.GetInterfaceIID(info5); - fprintf(stderr, "iid assoc'd with param 2 of method 7 of GetServiceWithListener - %s\n", nsISL->ToString()); - // if we look up the name? - char *nsISLname; - iim->GetNameForIID(nsISL, &nsISLname); - fprintf(stderr, "which is called %s\n", nsISLname); - - fprintf(stderr, "\nhow about one defined in a different typelib\n"); - nsXPTParamInfo param3 = mi->GetParam(3); - // should be IID for nsIShutdownListener - nsIID *nsISS; - info5->GetIIDForParam(¶m3, &nsISS); -// const nsIID *nsISS = param3.GetInterfaceIID(info5); - fprintf(stderr, "iid assoc'd with param 3 of method 7 of GetServiceWithListener - %s\n", nsISS->ToString()); - // if we look up the name? - char *nsISSname; - iim->GetNameForIID(nsISS, &nsISSname); - fprintf(stderr, "which is called %s\n", nsISSname); - - return 0; -} - - -// XXX remove following code when allocator autoregisters. -#include "nsRepository.h" -#include "nsIAllocator.h" - -static NS_DEFINE_IID(kIAllocatorIID, NS_IALLOCATOR_IID); -static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID); - -#ifdef XP_PC -#define XPCOM_DLL "xpcom32.dll" -#else -#ifdef XP_MAC -#define XPCOM_DLL "XPCOM_DLL" -#else -#define XPCOM_DLL "libxpcom.so" -#endif -#endif - -static void RegAllocator() -{ - nsRepository::RegisterComponent(kAllocatorCID, NULL, NULL, XPCOM_DLL, - PR_FALSE, PR_FALSE); -} diff --git a/mozilla/xpcom/libxpt/xptinfo/tests/makefile.win b/mozilla/xpcom/libxpt/xptinfo/tests/makefile.win deleted file mode 100644 index cfddb93b2a5..00000000000 --- a/mozilla/xpcom/libxpt/xptinfo/tests/makefile.win +++ /dev/null @@ -1,68 +0,0 @@ -#!nmake -# -# 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) 1999 Netscape Communications Corporation. All Rights -# Reserved. - -DEPTH=..\..\..\.. - -IGNORE_MANIFEST=1 - -MAKE_OBJ_TYPE = EXE -PROG1 = .\$(OBJDIR)\TestInterfaceInfo.exe -PROGRAMS = $(PROG1) - -LCFLAGS=-DUSE_NSREG - -DEFINES=-DWIN32_LEAN_AND_MEAN - -REQUIRES=xpcom libxpt xptinfo - -LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ - -I$(PUBLIC)\libxpt -I$(PUBLIC)\xptinfo - -LLIBS= \ - $(DIST)\lib\xpcom.lib \ - $(DIST)\lib\libxpt32.lib \ - $(DIST)\lib\xptinfo32.lib \ - $(LIBNSPR) \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -install:: $(PROGRAMS) - -for %p in ($(PROGRAMS)) do $(MAKE_INSTALL) %p $(DIST)\bin - -for %p in ($(TESTCASES)) do $(MAKE_INSTALL) %p $(DIST)\bin - -# Move this into config/obj.inc when it's allowed -.cpp{.\$(OBJDIR)\}.exe: - $(CC) @<<$(CFGFILE) - $(CFLAGS) - $(LCFLAGS) - $(LINCS) - $(LINCS_1) - $(INCS) - $(LLIBS) - $(OS_LIBS) - -Fd$(PDBFILE) - -Fe.\$(OBJDIR)\ - -Fo.\$(OBJDIR)\ - $(CURDIR)$(*B).cpp -<