123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354(**************************************************************************)(* This file is part of BINSEC. *)(* *)(* Copyright (C) 2016-2026 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* 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, version 2.1. *)(* *)(* It 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. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)letload(filename:string):string=letic=open_infilenameinletn=in_channel_lengthicinlets=Bytes.createninreally_inputics0n;close_inic;Bytes.unsafe_to_stringsletcopy(input:string)(output:string):unit=lets=loadinputinletic=open_outoutputinoutput_stringics;close_outicletreadlines(filename:string):stringlist=letfd=open_infilenameinletlines=ref[]intrywhiletruedoletline=input_linefdinlines:=line::!linesdone;assertfalsewithEnd_of_file->close_infd;List.rev!lineslethas_suffix~suffixesfilename=letrecloop=function|[]->false|sfx::sfxs->Filename.check_suffixfilenamesfx||loopsfxsinloopsuffixes