12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364(*
* Copyright (C) Citrix Systems Inc.
*
* 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; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* 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.
*)moduleStringSet=Set.Make(structtypet=stringletcompare=compareend)type'at={client:'a;tid:int32(* transaction id in use (0 means no transaction) *);mutableaccessed_paths:StringSet.toption(* paths read or written to *);mutablewatched_paths:StringSet.t(* paths being watched *)}letmakeclient={client;tid=0l;(* no transaction *)accessed_paths=None;(* not recording accesses *)watched_paths=StringSet.empty(* no paths watched *)}letget_tidh=h.tidletget_clienth=h.clientletno_transactionclient=makeclientlettransactionclienttid={(makeclient)withtid}letwatchingclient={(makeclient)withaccessed_paths=SomeStringSet.empty}letaccessed_pathhpath=matchh.accessed_pathswith|None->h|Someps->h.accessed_paths<-Some(StringSet.addpathps);hletget_accessed_pathsh=matchh.accessed_pathswithNone->StringSet.empty|Somexs->xsletwatchhpath=h.watched_paths<-StringSet.addpathh.watched_paths;hletunwatchhpath=h.watched_paths<-StringSet.removepathh.watched_paths;hletget_watched_pathsh=h.watched_paths