12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849(* Copyright (C) 2017 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 OCaml static compilation 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
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*)openCaqti_prereqletlinear_param_lengthtempl=letrecloop=function|Caqti_request.L_->ident|Caqti_request.P_->succ|Caqti_request.Sfrags->List.foldloopfragsinlooptempl0letnonlinear_param_lengthtempl=letrecloop=function|Caqti_request.L_->ident|Caqti_request.Pn->max(n+1)|Caqti_request.Sfrags->List.foldloopfragsinlooptempl0letlinear_param_ordertempl=leta=Array.make(nonlinear_param_lengthtempl)[]inletrecloop=function|Caqti_request.L_->funj->j|Caqti_request.Pi->funj->a.(i)<-j::a.(i);j+1|Caqti_request.Sfrags->List.foldloopfragsinlet_=looptempl0inArray.to_listaletlinear_query_stringtempl=letbuf=Buffer.create64inletrecloop=function|Caqti_request.Ls->Buffer.add_stringbufs|Caqti_request.P_->Buffer.add_charbuf'?'|Caqti_request.Sfrags->List.iterloopfragsinlooptempl;Buffer.contentsbuf