Up

module Sys_js

: sig

Javascript specific Sys functions.

Io.

#
val set_channel_flusher : Pervasives.out_channel -> (string -> unit) -> unit

Set a callback to be called when an out_channel flush its buffer. set_channel_flusher chan cb install the callback cb for chan out_channel. cb will be called with the string to flush.

Pseudo filesystem.

#
val register_file : name:string -> content:string -> unit

Register a file to a Pseudo Filesystem. register_file ~name ~content register the file name with content content so it can be be opened with Pervasives.open_in name

#
val register_autoload : path:string -> (string * string -> string option) -> unit

Register a callback to the path to dynamicly load missing files. Whenever a file is missing in path, the callback is used to optionally get the content of the file. register_autoload ~path f register the callback f to the path path. The callback f receives (prefix,suffix) where:

  • prefix is the path the function has been registered to.
  • Filename.contact prefix suffix is the absolute filename .
#
external file_content : string -> string = "caml_fs_file_content"

file_content name returns the content of the file name. Raise Not_found if the file does not exists.

Information.

#
val js_of_ocaml_version : string

js_of_ocaml_version is the version of Js_of_ocaml. It is a string of the form "major.minor[.patchlevel][+additional-info]", where major, minor, and patchlevel are integers, and additional-info is an arbitrary string. The [.patchlevel] and [+additional-info] parts may be absent.

end