<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Ocsigen_stream.html"> <link rel="next" href="Polytables.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Ocsigen_cache" rel="Chapter" href="Ocsigen_cache.html"> <link title="Ocsigen_lib_base" rel="Chapter" href="Ocsigen_lib_base.html"> <link title="Ocsigen_lib" rel="Chapter" href="Ocsigen_lib.html"> <link title="Ocsigen_config" rel="Chapter" href="Ocsigen_config.html"> <link title="Ocsigen_getcommandline" rel="Chapter" href="Ocsigen_getcommandline.html"> <link title="Ocsigen_messages" rel="Chapter" href="Ocsigen_messages.html"> <link title="Ocsigen_stream" rel="Chapter" href="Ocsigen_stream.html"> <link title="Ocsigen_loader" rel="Chapter" href="Ocsigen_loader.html"> <link title="Polytables" rel="Chapter" href="Polytables.html"> <link title="Http_headers" rel="Chapter" href="Http_headers.html"> <link title="Ocsigen_http_frame" rel="Chapter" href="Ocsigen_http_frame.html"> <link title="Ocsigen_headers" rel="Chapter" href="Ocsigen_headers.html"> <link title="Framepp" rel="Chapter" href="Framepp.html"> <link title="Ocsigen_http_com" rel="Chapter" href="Ocsigen_http_com.html"> <link title="Ocsigen_charset_mime" rel="Chapter" href="Ocsigen_charset_mime.html"> <link title="Ocsigen_senders" rel="Chapter" href="Ocsigen_senders.html"> <link title="Ocsigen_cookies" rel="Chapter" href="Ocsigen_cookies.html"> <link title="Ocsigen_extensions" rel="Chapter" href="Ocsigen_extensions.html"> <link title="Ocsigen_parseconfig" rel="Chapter" href="Ocsigen_parseconfig.html"> <link title="Ocsigen_http_client" rel="Chapter" href="Ocsigen_http_client.html"> <link title="Ocsigen_local_files" rel="Chapter" href="Ocsigen_local_files.html"> <link title="Ocsigen_server" rel="Chapter" href="Ocsigen_server.html"> <link title="Ocsigen_comet" rel="Chapter" href="Ocsigen_comet.html"> <link title="Accesscontrol" rel="Chapter" href="Accesscontrol.html"> <link title="Authbasic" rel="Chapter" href="Authbasic.html"> <link title="Ocsipersist" rel="Chapter" href="Ocsipersist.html"><title>Ocsigen_loader</title> </head> <body> <div class="navbar"><a class="pre" href="Ocsigen_stream.html" title="Ocsigen_stream">Previous</a> <a class="up" href="index.html" title="Index">Up</a> <a class="post" href="Polytables.html" title="Polytables">Next</a> </div> <h1>Module <a href="type_Ocsigen_loader.html">Ocsigen_loader</a></h1> <pre><span class="keyword">module</span> Ocsigen_loader: <code class="code">sig</code> <a href="Ocsigen_loader.html">..</a> <code class="code">end</code></pre><div class="info module top"> Module <code class="code">Ocsigen_loader</code>: Dynamic loading for Ocsigen.<br> </div> <hr width="100%"> <br> Notes about Findlib usage:<ul> <li>Findlib is called with predicates "plugin", "mt". Moreover, the predicate "native" or "byte" is added, depending on whether Ocsigen is running in native or bytecode mode.</li> <li>In native mode, .cmx/.cmxa extensions provided by META files are replaced by .cmxs.</li> <li>The OCAMLPATH environment variable is ignored altogether.</li> </ul> <br> <pre><span id="EXCEPTIONDynlink_error"><span class="keyword">exception</span> Dynlink_error</span> <span class="keyword">of</span> <code class="type">string * exn</code></pre> <pre><span id="EXCEPTIONFindlib_error"><span class="keyword">exception</span> Findlib_error</span> <span class="keyword">of</span> <code class="type">string * exn</code></pre> <pre><span id="VALtranslate"><span class="keyword">val</span> translate</span> : <code class="type">string -> string</code></pre><div class="info "> <code class="code">translate filename</code> translate .cmo/.cma extensions to .cmxs in native mode, and .cmxs to .cmo (.cma if it exists) in bytecode mode.<br> </div> <pre><span id="VALset_init_on_load"><span class="keyword">val</span> set_init_on_load</span> : <code class="type">bool -> unit</code></pre><div class="info "> If set to <code class="code">true</code>, the module initialization functions passed to <code class="code">set_module_init_function</code> will be executed directly. Otherwise, they will have to be invoked using <code class="code">init_module</code> at some later stage.<br> </div> <pre><span id="VALloadfile"><span class="keyword">val</span> loadfile</span> : <code class="type">(unit -> unit) -> (unit -> unit) -> bool -> string -> unit</code></pre><div class="info "> <code class="code">loadfile pre post force file</code> (dynamically) loads <code class="code">file</code>. If <code class="code">force</code> is <code class="code">false</code>, remember <code class="code">file</code> so that it isn't loaded twice. If the loading effectively occurs, <code class="code">pre</code> (resp. <code class="code">post</code>) is called before (resp. after) the loading. <code class="code">post</code> will be called even if the loading fails.<br> </div> <pre><span id="VALloadfiles"><span class="keyword">val</span> loadfiles</span> : <code class="type">(unit -> unit) -> (unit -> unit) -> bool -> string list -> unit</code></pre><div class="info "> <code class="code">loadfiles pre post force file</code> loads all the <code class="code">files</code>, using <code class="code">loadfile (fun () -> ()) (fun () -> ()) false</code> for all the files but the last one, and <code class="code">loadfile pre post force</code> for the last one (if any).<br> </div> <pre><span id="VALset_module_init_function"><span class="keyword">val</span> set_module_init_function</span> : <code class="type">string -> (unit -> unit) -> unit</code></pre><div class="info "> <code class="code">set_module_init_function name f</code> registers the function <code class="code">f</code>, which will be used to initialize the module when <code class="code">init_module name</code> is called.<br> </div> <pre><span id="VALinit_module"><span class="keyword">val</span> init_module</span> : <code class="type">(unit -> unit) -> (unit -> unit) -> bool -> string -> unit</code></pre><div class="info "> <code class="code">init_module pre post force name</code> runs the init function for the module <code class="code">name</code>. If <code class="code">force</code> is <code class="code">false</code>, remember <code class="code">name</code> so that the init function isn't executed twice. If the function is executed, <code class="code">pre</code> (resp. <code class="code">post</code>) is called before (resp. after) the loading. <code class="code">post</code> will be called even if the loading fails.<br> </div> <pre><span id="VALget_ocamlpath"><span class="keyword">val</span> get_ocamlpath</span> : <code class="type">unit -> string list</code></pre><div class="info "> Returns the current Findlib library search path.<br> </div> <pre><span id="VALset_ocamlpath"><span class="keyword">val</span> set_ocamlpath</span> : <code class="type">string list -> unit</code></pre><div class="info "> Sets the current Findlib library search path. The OCaml standard library path and some site-specific paths are always implicitly added.<br> </div> <pre><span id="VALadd_ocamlpath"><span class="keyword">val</span> add_ocamlpath</span> : <code class="type">string -> unit</code></pre><div class="info "> Adds a path to the Findlib library search path.<br> </div> <pre><span id="VALfindfiles"><span class="keyword">val</span> findfiles</span> : <code class="type">string -> string list</code></pre><div class="info "> <code class="code">findfiles pkg</code> returns the list of files needed to load Findlib package <code class="code">pkg</code>, including dependencies. The archive files of <code class="code">pkg</code> will appear last in the returned result.<br> </div> </body></html>