1 -- Created on: 1994-08-30
2 -- Created by: J.P. TIRAULT
3 -- Copyright (c) 1994-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 -- SharedLibrary: OSD_SharedLibrary.cdl
19 class SharedLibrary from OSD
21 ---Purpose: Interface to dynamic library loader.
22 -- Provides tools to load a shared library
23 -- and retrieve the address of an entry point.
24 uses LoadMode,Function
27 Create returns SharedLibrary;
28 ---Purpose: Creates a SharedLibrary object with name NULL.
31 Create (aFilename : CString) returns SharedLibrary;
32 ---Purpose: Creates a SharedLibrary object with name aFilename.
35 SetName (me : out ; aName : CString)
36 ---Purpose: Sets a name associated to the shared object.
41 ---Purpose: Returns the name associated to the shared object.
46 DlOpen (me : out ; Mode : LoadMode)
47 ---Purpose: The DlOpen method provides an interface to the
48 -- dynamic library loader to allow shared libraries
49 -- to be loaded and called at runtime. The DlOpen
50 -- function attempts to load Filename, in the address
51 -- space of the process, resolving symbols as appropriate.
52 -- Any libraries that Filename depends upon are also loaded.
53 -- If MODE is RTLD_LAZY, then the runtime loader
54 -- does symbol resolution only as needed.
55 -- Typically, this means that the first call to a function
56 -- in the newly loaded library will cause the resolution of
57 -- the address of that function to occur.
58 -- If Mode is RTLD_NOW, then the runtime loader must do all
59 -- symbol binding during the DlOpen call.
60 -- The DlOpen method returns a handle that is used by DlSym
62 -- If there is an error, Standard_False is returned,
63 -- Standard_True otherwise.
64 -- If a NULL Filename is specified, DlOpen returns a handle
65 -- for the main executable, which allows access to dynamic
66 -- symbols in the running program.
72 DlSymb (me; Name : CString)
73 ---Purpose: The dlsym function returns the address of the
74 -- symbol name found in the shared library.
75 -- If the symbol is not found, a NULL pointer is
83 ---Purpose: Deallocates the address space for the library
84 -- corresponding to the shared object.
85 -- If any user function continues to call a symbol
86 -- resolved in the address space of a library
87 -- that has been since been deallocated by DlClose,
88 -- the results are undefined.
93 ---Purpose: The dlerror function returns a string describing
94 -- the last error that occurred from
95 -- a call to DlOpen, DlClose or DlSym.
100 Destroy (me : in out)
102 ---Purpose: Frees memory allocated.
112 end SharedLibrary from OSD;