slave: Use slightly modified event_callback.
[guestfs-browser.git] / deviceSet.mli
1 (* Guestfs Browser.
2  * Copyright (C) 2010 Red Hat Inc.
3  *
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.
8  *
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.
13  *
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.
17  *)
18
19 (** Set of devices.
20
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". *)
25
26 module DeviceSet : sig
27   type t
28     (** The type of the set. *)
29
30   type elt = String.t
31     (** The type of each element of the set. *)
32
33   val subtract : t -> t -> t
34     (** Set difference.
35
36         [subtract a b] is like a subtraction operation, returning a
37         new set which is constructed by removing all elements of [b]
38         from [a].
39
40         (Note that this is the same operation as {!Set.diff}). *)
41
42   val iter : (elt -> unit) -> t -> unit
43     (** [iter f set] iterates over the set in increasing order. *)
44
45   val of_list : elt list -> t
46     (** Construct a new set from the list of elements. *)
47
48   val of_array : elt array -> t
49     (** Construct a new set from the array of elements. *)
50
51   val to_string : t -> string
52     (** Make the set into a printable string (just for debugging). *)
53 end