annotate dwt/internal/mozilla.old/prlink.d @ 288:4ee8c4237614

old branches... commit by mistake
author John Reimer<terminal.node@gmail.com>
date Tue, 05 Aug 2008 18:00:50 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
288
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
1 module dwt.internal.mozilla.prlink;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
2 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
3 /* ***** BEGIN LICENSE BLOCK *****
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
5 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
6 * The contents of this file are subject to the Mozilla Public License Version
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
7 * 1.1 (the "License"); you may not use this file except in compliance with
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
8 * the License. You may obtain a copy of the License at
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
9 * http://www.mozilla.org/MPL/
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
10 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
11 * Software distributed under the License is distributed on an "AS IS" basis,
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
13 * for the specific language governing rights and limitations under the
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
14 * License.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
15 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
16 * The Original Code is the Netscape Portable Runtime (NSPR).
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
17 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
18 * The Initial Developer of the Original Code is
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
19 * Netscape Communications Corporation.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
20 * Portions created by the Initial Developer are Copyright (C) 1998-2000
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
21 * the Initial Developer. All Rights Reserved.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
22 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
23 * Contributor(s):
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
24 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
25 * Alternatively, the contents of this file may be used under the terms of
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
28 * in which case the provisions of the GPL or the LGPL are applicable instead
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
29 * of those above. If you wish to allow use of your version of this file only
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
30 * under the terms of either the GPL or the LGPL, and not to allow others to
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
31 * use your version of this file under the terms of the MPL, indicate your
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
32 * decision by deleting the provisions above and replace them with the notice
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
33 * and other provisions required by the GPL or the LGPL. If you do not delete
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
34 * the provisions above, a recipient may use your version of this file under
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
35 * the terms of any one of the MPL, the GPL or the LGPL.
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
36 *
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
37 * ***** END LICENSE BLOCK ***** */
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
38
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
39 import dwt.internal.mozilla.Common;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
40
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
41 struct PRStaticLinkTable
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
42 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
43 char *name;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
44 void function()fp;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
45 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
46
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
47 extern (System):
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
48
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
49 PRStatus PR_SetLibraryPath(char *path);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
50
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
51 char * PR_GetLibraryPath();
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
52 char * PR_GetLibraryName(char *dir, char *lib);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
53 void PR_FreeLibraryName(char *mem);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
54
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
55 alias void PRLibrary;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
56
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
57 PRLibrary * PR_LoadLibrary(char *name);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
58
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
59 enum PRLibSpecType
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
60 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
61 PR_LibSpec_Pathname,
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
62 PR_LibSpec_MacNamedFragment,
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
63 PR_LibSpec_MacIndexedFragment,
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
64 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
65
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
66 alias void FSSpec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
67
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
68 struct _N3
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
69 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
70 FSSpec *fsspec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
71 char *name;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
72 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
73
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
74 struct _N4
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
75 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
76 FSSpec *fsspec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
77 PRUint32 index;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
78 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
79
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
80 union _N2
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
81 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
82 char *pathname;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
83 struct _N3
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
84 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
85 FSSpec *fsspec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
86 char *name;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
87 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
88 _N3 mac_named_fragment;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
89 struct _N4
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
90 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
91 FSSpec *fsspec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
92 PRUint32 index;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
93 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
94 _N4 mac_indexed_fragment;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
95 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
96
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
97 struct PRLibSpec
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
98 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
99 int type;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
100 union _N2
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
101 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
102 char *pathname;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
103 struct _N3
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
104 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
105 FSSpec *fsspec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
106 char *name;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
107 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
108 _N3 mac_named_fragment;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
109 struct _N4
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
110 {
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
111 FSSpec *fsspec;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
112 PRUint32 index;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
113 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
114 _N4 mac_indexed_fragment;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
115 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
116 _N2 value;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
117 }
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
118
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
119 const PR_LD_LAZY = 0x1;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
120 const PR_LD_NOW = 0x2;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
121 const PR_LD_GLOBAL = 0x4;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
122 const PR_LD_LOCAL = 0x8;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
123
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
124 PRLibrary * PR_LoadLibraryWithFlags(PRLibSpec libSpec, PRIntn flags);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
125 PRStatus PR_UnloadLibrary(PRLibrary *lib);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
126 void * PR_FindSymbol(PRLibrary *lib, char *name);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
127
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
128 alias void function()PRFuncPtr;
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
129
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
130 PRFuncPtr PR_FindFunctionSymbol(PRLibrary *lib, char *name);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
131 void * PR_FindSymbolAndLibrary(char *name, PRLibrary **lib);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
132 PRFuncPtr PR_FindFunctionSymbolAndLibrary(char *name, PRLibrary **lib);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
133 PRLibrary * PR_LoadStaticLibrary(char *name, PRStaticLinkTable *table);
4ee8c4237614 old branches... commit by mistake
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
134 char * PR_GetLibraryFilePathname(char *name, PRFuncPtr addr);