annotate dwt/internal/gtk/runtime/Loader.d @ 11:5f725d09c076

Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
author John Reimer<terminal.node@gmail.com>
date Sat, 05 Jan 2008 15:13:44 -0800
parents
children 8cec8f536af3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
1 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
2
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
3 license:
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
4
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
5 version:
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
6
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
7 Dynamic loader for gtk symbol names
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
8
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
9 History: 2004-12-11 initial version by John Reimer
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
10 2005-02-21 class and symbol names change; versioning modification
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
11 2005-05-05 linux fixes
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
12 2007-12-23 source cleanup
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
13 2007-12-30 merge Paths.d into Loader.d
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
14 2008-01-05 Tango only version using tango.sys.SharedLib
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
15
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
16 Note: Design inspired by Kris Bell's ICU.d, the dynamic loader from
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
17 an early version of mango
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
18
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
19 ******************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
20
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
21 module dwt.internal.gtk.runtime.Loader;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
22
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
23 private import tango.io.Stdout,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
24 tango.sys.SharedLib;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
25
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
26 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
27
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
28 *****************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
29
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
30 enum LIBRARY
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
31 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
32 ATK,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
33 CAIRO,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
34 GDK,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
35 GDKPIXBUF,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
36 GLIB,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
37 GMODULE,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
38 GOBJECT,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
39 GTHREAD,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
40 GTK,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
41 PANGO,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
42 GLGDK,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
43 GLGTK,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
44 GL,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
45 GLU,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
46 GLEXT,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
47 GDA,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
48 GLADE,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
49 GSV,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
50 GSTREAMER,
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
51 GSTINTERFACES
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
52 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
53
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
54 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
55
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
56 *****************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
57
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
58 version (Windows)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
59 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
60 const char[][LIBRARY.max+1] importLibs = [
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
61 LIBRARY.ATK: "libatk-1.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
62 LIBRARY.CAIRO: "libcairo-2.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
63 LIBRARY.GDK: "libgdk-win32-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
64 LIBRARY.GDKPIXBUF: "libgdk_pixbuf-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
65 LIBRARY.GLIB: "libglib-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
66 LIBRARY.GMODULE: "libgmodule-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
67 LIBRARY.GOBJECT: "libgobject-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
68 LIBRARY.GTHREAD: "libgthread-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
69 LIBRARY.GTK: "libgtk-win32-2.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
70 LIBRARY.PANGO: "libpango-1.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
71 LIBRARY.GLGDK: "libgdkglext-win32-1.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
72 LIBRARY.GLGTK: "libgtkglext-win32-1.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
73 LIBRARY.GL: "opengl32.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
74 LIBRARY.GLU: "glu32.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
75 LIBRARY.GDA: "libgda-2.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
76 LIBRARY.GLADE: "libglade-2.0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
77 LIBRARY.GSV: "libgtksourceview-1.0-0.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
78 LIBRARY.GSTREAMER: "libgstreamer-0.10.dll",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
79 LIBRARY.GSTINTERFACES: "libgstinterfaces-0.10.dll"
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
80 ];
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
81 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
82
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
83 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
84
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
85 *****************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
86
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
87 version(linux)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
88 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
89 const char[][LIBRARY.max+1] importLibs = [
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
90 LIBRARY.ATK: "libatk-1.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
91 LIBRARY.CAIRO: "libcairo.so.2",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
92 LIBRARY.GDK: "libgdk-x11-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
93 LIBRARY.GDKPIXBUF: "libgdk_pixbuf-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
94 LIBRARY.GLIB: "libglib-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
95 LIBRARY.GMODULE: "libgmodule-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
96 LIBRARY.GOBJECT: "libgobject-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
97 LIBRARY.GTHREAD: "libgthread-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
98 LIBRARY.GTK: "libgtk-x11-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
99 LIBRARY.PANGO: "libpango-1.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
100 LIBRARY.GLGDK: "libgdkglext-x11-1.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
101 LIBRARY.GLGTK: "libgtkglext-x11-1.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
102 LIBRARY.GL: "libGL.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
103 LIBRARY.GLU: "libGLU.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
104 LIBRARY.GLEXT: "libGL.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
105 LIBRARY.GDA: "libgda-2.so.3",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
106 LIBRARY.GLADE: "libglade-2.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
107 LIBRARY.GSV: "libgtksourceview-1.0.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
108 LIBRARY.GSTREAMER: "libgstreamer-0.10.so",
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
109 LIBRARY.GSTINTERFACES: "libgstinterfaces-0.10.so"
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
110 ];
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
111 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
112
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
113 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
114
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
115 getLibraryPath -- place holder for future expansion
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
116
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
117 ******************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
118
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
119
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
120 version(Windows)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
121 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
122 char[] getLibraryPath()
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
123 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
124 return "\\Program Files\\GTK2-Runtime\\lib\\";
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
125 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
126 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
127
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
128 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
129
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
130 getLibraryPath is empty for linux because default path is known by ld
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
131
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
132 ******************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
133
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
134 version(linux)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
135 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
136 char[] getLibraryPath() { return ""; }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
137 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
138
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
139 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
140
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
141 ProcLink is used to record the library, function, and function name
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
142 that will be loaded by the dynamic loader.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
143
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
144 ******************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
145
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
146 public struct Symbol
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
147 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
148 char[] name;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
149 void** pointer;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
150 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
151
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
152 /*****************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
153
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
154 The Linker class: handles loading of the library and exported functions
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
155
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
156 ******************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
157
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
158 public class Linker
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
159 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
160 static char[][][char[]] loadFailures;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
161
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
162 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
163
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
164 Gets all the failed loads for a specific library. This is filled in
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
165 only if the default onFailure method is used during load.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
166
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
167 returns: an array of the names that failed to load for a specific
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
168 library or null if none was found.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
169
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
170 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
171
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
172 public static char[][] getLoadFailures(char[] libName)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
173 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
174 if ( libName in loadFailures )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
175 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
176 return loadFailures[libName];
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
177 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
178 else
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
179 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
180 return null;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
181 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
182 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
183
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
184 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
185
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
186 Loads all libraries. This is filled in only if the default onFailure
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
187 method is used during load.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
188
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
189 returns: an array of the library names.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
190
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
191 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
192
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
193 public static char[][] getLoadLibraries()
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
194 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
195 return loadFailures.keys;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
196 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
197
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
198 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
199
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
200 isPerfectLoad -- Checks if any symbol failed to load.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
201 Returns: true if ALL symbols loaded.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
202
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
203 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
204
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
205 public static bool isPerfectLoad()
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
206 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
207 return loadFailures.keys.length == 0;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
208 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
209
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
210 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
211
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
212 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
213
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
214 public static void dumpFailedLoads()
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
215 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
216 foreach ( char[] lib ; Linker.getLoadLibraries() )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
217 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
218 foreach ( char[] symbol ; Linker.getLoadFailures(lib) )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
219 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
220 version(Tango)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
221 Stdout.formatln("failed ({}) {}", lib, symbol).newline;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
222 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
223 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
224 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
225
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
226 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
227
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
228 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
229
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
230 private SharedLib primaryLib;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
231 private SharedLib alternateLib;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
232
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
233 private char[] libraryName;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
234 private char[] alternateLibraryName;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
235
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
236 alias void function( char[] libraryName, char[] symbolName, char[] message=null) FailureCallback;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
237
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
238 private FailureCallback onLoadFailure;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
239
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
240 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
241
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
242 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
243
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
244 this( char[] libraryName, char[] alternateLibraryName=null )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
245 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
246 this(libraryName, alternateLibraryName, &(Linker.defaultFail));
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
247 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
248
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
249 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
250
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
251 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
252
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
253 this (char[] libraryName, char[] alternateLibraryName, FailureCallback fn )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
254 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
255 this.libraryName = libraryName;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
256 this.alternateLibraryName = alternateLibraryName;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
257 onLoadFailure = fn;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
258
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
259 SharedLib.throwExceptions = false;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
260
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
261 primaryLib = SharedLib.load( this.libraryName );
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
262
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
263 version(linux)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
264 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
265 if (this.primaryLib is null)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
266 primaryLib = SharedLib.load( this.libraryName ~ ".0\0" );
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
267 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
268
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
269 if ( alternateLibraryName !is null )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
270 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
271 alternateLib = SharedLib.load( this.alternateLibraryName );
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
272 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
273
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
274 if (primaryLib is null)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
275 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
276 throw new Exception("Library load failed: " ~ libraryName);
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
277 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
278 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
279
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
280 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
281
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
282 Default load failure callback. Logs the symbols that failed to load.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
283
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
284 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
285
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
286 static void defaultFail( char[] libraryName, char[] symbolName, char[] message=null )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
287 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
288 if ( !(libraryName in loadFailures) )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
289 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
290 char[][] cc;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
291 loadFailures[libraryName] = cc;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
292 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
293
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
294 loadFailures[libraryName] ~= symbolName.dup;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
295 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
296
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
297 /*************************************************************************
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
298
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
299 Loads all the symbols for this library.
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
300
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
301 **************************************************************************/
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
302
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
303 void link( inout Symbol[] symbols )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
304 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
305 foreach( Symbol link; symbols )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
306 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
307 *link.pointer = primaryLib.getSymbol ( (link.name~"\0").ptr);
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
308
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
309 if (*link.pointer is null)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
310 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
311 if ( alternateLib !is null )
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
312 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
313 *link.pointer = alternateLib.getSymbol( (link.name~"\0").ptr);
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
314 Stdout("Loader.Linker.link trying alternate lib: ", link.name).newline;
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
315 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
316 if (*link.pointer is null)
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
317 {
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
318 onLoadFailure( libraryName, link.name );
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
319 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
320 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
321 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
322 }
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
323
5f725d09c076 Added dynamic loader from gtkd with cleanup and modifications. Tango only support. No OS.d tie-in yet.
John Reimer<terminal.node@gmail.com>
parents:
diff changeset
324 }