123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263(* Js_of_ocaml library
* http://www.ocsigen.org/js_of_ocaml/
* Copyright (C) 2014 Hugo Heuzard
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)open!Importexternalcreate_file:name:string->content:string->unit="caml_create_file"externalread_file:name:string->string="caml_read_file_content"letupdate_file~name~content=letoc=open_outnameinoutput_stringoccontent;close_outocexternalset_channel_output':out_channel->(Js.js_stringJs.t->unit)Js.callback->unit="caml_ml_set_channel_output"externalset_channel_input':in_channel->(unit->string)Js.callback->unit="caml_ml_set_channel_refill"letset_channel_flusher(out_channel:out_channel)(f:string->unit)=letf':(Js.js_stringJs.t->unit)Js.callback=Js.wrap_callback(funs->f(Js.to_bytestrings))inset_channel_output'out_channelf'letset_channel_filler(in_channel:in_channel)(f:unit->string)=letf':(unit->string)Js.callback=Js.wrap_callbackfinset_channel_input'in_channelf'externalmount_point:unit->stringlist="caml_list_mount_point"externalmount_autoload:string->(string->string->stringoption)Js.callback->unit="caml_mount_autoload"externalunmount:string->unit="caml_unmount"letmount~pathf=mount_autoloadpath(Js.wrap_callback(funprefixpath->f~prefix~path))letunmount~path=unmountpathletjs_of_ocaml_version=ifString.equalLib_version.git_version""thenLib_version.selseLib_version.s^"+"^Lib_version.git_version