2 * Copyright (C) 2010 Red Hat Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 This is essentially the same as a set of strings (see OCaml {!Set}
22 module), but we relax comparisons so that devices with the same
23 canonical name are the same. For example "/dev/sda5" is
24 considered the same as "/dev/vda5". *)
26 module DeviceSet : sig
28 (** The type of the set. *)
31 (** The type of each element of the set. *)
33 val subtract : t -> t -> t
36 [subtract a b] is like a subtraction operation, returning a
37 new set which is constructed by removing all elements of [b]
40 (Note that this is the same operation as {!Set.diff}). *)
42 val iter : (elt -> unit) -> t -> unit
43 (** [iter f set] iterates over the set in increasing order. *)
45 val of_list : elt list -> t
46 (** Construct a new set from the list of elements. *)
48 val of_array : elt array -> t
49 (** Construct a new set from the array of elements. *)
51 val to_string : t -> string
52 (** Make the set into a printable string (just for debugging). *)