1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465(* Copyright (C) 2022--2023 Petter A. Urkedal <paurkedal@gmail.com>
*
* This library 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, either version 3 of the License, or (at your
* option) any later version, with the LGPL-3.0 Linking Exception.
*
* This library 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
* and the LGPL-3.0 Linking Exception along with this library. If not, see
* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively.
*)moduletypeDRIVER_FUNCTOR=functor(System:Caqti_platform.System_sig.S)->functor(System_unix:System_sig.Swithtype'afiber:='aSystem.Fiber.tandtypestdenv:=System.stdenv)->Caqti_platform.Driver_loader.DRIVERwithtype'afiber:='aSystem.Fiber.tandtype('a,'err)stream:=('a,'err)System.Stream.tandtypeswitch:=System.Switch.tandtypestdenv:=System.stdenvletdrivers=Hashtbl.create5letregisterschemep=Hashtbl.adddriversschemepmoduleMake(System:Caqti_platform.System_sig.S)(System_unix:System_sig.Swithtype'afiber:='aSystem.Fiber.tandtypestdenv:=System.stdenv)=structmoduleCore_loader=Caqti_platform.Driver_loader.Make(System)moduletypeDRIVER=Core_loader.DRIVERmoduletypeCONNECTION=Core_loader.CONNECTIONletload_driver_unix~urischeme=(matchHashtbl.find_optdriversschemewith|None->letmsg="Driver not found for unix platform."inError(Caqti_error.load_failed~uri(Caqti_error.Msgmsg))|Somemake_driver->letmoduleMake_driver=(valmake_driver:DRIVER_FUNCTOR)inletmoduleDriver=Make_driver(System)(System_unix)inOk(moduleDriver:DRIVER))letload_driver~urischeme=(matchCore_loader.load_driver~urischemewith|Ok_asr->r|Error(`Load_rejected_)asr->r|Error(`Load_failed_)->(matchload_driver_unix~urischemewith|Ok_asr->r|Error(`Load_rejected_)asr->r|Error(`Load_failed_)->letmsg="Driver not found, including among UNIX drivers."inError(Caqti_error.load_failed~uri(Caqti_error.Msgmsg))))end