Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (51 sloc) 2.6 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 (**
20 Dynamic loading of bypass plugin files.
21
22 Bypass plugins are used to introduce custom primitives in an opa code.
23 For the compiler {b opa.exe}, like types, implementation, etc..
24
25 Bypass plugins are built with the application {b bslregister},
26 and then used by any of the following applications :
27 + bslregister (to link a plugin with a previous one)
28 + bslbrowser (to browse the primitives of a plugin)
29 + qmlcompilers (to link a qml file with some custom primitives)
30 + opa.exe (to link a opa file with some custom primitives)
31
32 @author Mathieu Barbin
33 *)
34
35 (** {6 Types for manipulating bypass plugins} *)
36
37 (** A bypass plugin file can be a shared object (cmo, cmxs) or a marshal structure (.bypass) *)
38 type bypass_plugin_file =
39 | SharedObject of string (** the filename of an ocaml shared object *)
40 | MarshalPlugin of string (** the filename of a marshaled structure *)
41
42 (** A sugar to get the filename from a bypass_plugin_file value *)
43 val file : bypass_plugin_file -> string
44
45 (** {6 Dynamic loading of bypass plugins} *)
46
47 (** This function does a side effect on the BslPluginTable,
48 by registering all definitions of bypass of the given plugin.
49 @raise Error if an error happens during loading *)
50 val load_bypass_plugin : bypass_plugin_file -> unit
51
52 (** an alias for [!BslDynlink.load_bypass_plugin] for being as close as possible of the function
53 [Dynlink.load_bypass_plugin] from ocaml standard library
54 @see "Dynlink" from ocaml standard library for more details *)
55 val loadfile_private : bypass_plugin_file -> unit
56
57 (**
58 Same than [loadfile_private] but does nothing if the bypass_plugin_fille was already loaded.
59 This is used for avoiding to reload, or to re deserialize plugins several times, for
60 optimizing the time taken by the pass BslLoading
61 *)
62 val load_bypass_plugin_cache : bypass_plugin_file -> unit
63
64 (** {6 Error reporting} *)
65
66 (**
67 This module uses [OManager] for its errrors.
68 *)
Something went wrong with that request. Please try again.