VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/public/genstubs.pl@ 86260

Last change on this file since 86260 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1#!/usr/local/bin/perl
2
3# This is used to generate stub entry points. We generate a file to
4# be included in the declaraion and a file to be used for expanding macros
5# to represent the implementation of the stubs.
6
7#
8# if "$entry_count" is ever changed and the .inc files regenerated then
9# the following issues need to be addressed:
10#
11# 1) Alpha NT has a .def file that lists exports by symbol. It will need
12# updating.
13# 2) The current Linux ARM code has a limitation of only having 256-3 stubs
14#
15# more dependencies???
16#
17
18# 3 entries are already 'used' by the 3 methods of nsISupports.
19# 3+247+5=255 This should get us in under the Linux ARM limitation
20$entry_count = 247;
21$sentinel_count = 5;
22
23$decl_name = "xptcstubsdecl.inc";
24$def_name = "xptcstubsdef.inc";
25
26##
27## Write the declarations include file
28##
29
30die "Can't open $decl_name" if !open(OUTFILE, ">$decl_name");
31
32print OUTFILE "/* generated file - DO NOT EDIT */\n\n";
33print OUTFILE "/* includes ",$entry_count," stub entries, and ",
34 $sentinel_count," sentinel entries */\n\n";
35print OUTFILE "/*\n";
36print OUTFILE "* declarations of normal stubs...\n";
37print OUTFILE "* 0 is QueryInterface\n";
38print OUTFILE "* 1 is AddRef\n";
39print OUTFILE "* 2 is Release\n";
40print OUTFILE "*/\n";
41print OUTFILE "#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))\n";
42for($i = 0; $i < $entry_count; $i++) {
43 print OUTFILE "NS_IMETHOD Stub",$i+3,"();\n";
44}
45print OUTFILE "#else\n";
46for($i = 0; $i < $entry_count; $i++) {
47 print OUTFILE "NS_IMETHOD Stub",$i+3,"(PRUint64,\n";
48 print OUTFILE " PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64);\n";
49
50}
51print OUTFILE "#endif\n";
52
53print OUTFILE "\n/* declarations of sentinel stubs */\n";
54
55for($i = 0; $i < $sentinel_count; $i++) {
56 print OUTFILE "NS_IMETHOD Sentinel",$i,"();\n";
57}
58close(OUTFILE);
59
60
61##
62## Write the definitions include file. This assumes a macro will be used to
63## expand the entries written...
64##
65
66die "Can't open $def_name" if !open(OUTFILE, ">$def_name");
67
68print OUTFILE "/* generated file - DO NOT EDIT */\n\n";
69print OUTFILE "/* includes ",$entry_count," stub entries, and ",
70 $sentinel_count," sentinel entries */\n\n";
71
72for($i = 0; $i < $entry_count; $i++) {
73 print OUTFILE "STUB_ENTRY(",$i+3,")\n";
74}
75
76for($i = 0; $i < $sentinel_count; $i++) {
77 print OUTFILE "SENTINEL_ENTRY(",$i,")\n";
78}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette