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