~ubuntu-branches/ubuntu/wily/marionnet/wily

« back to all changes in this revision

Viewing changes to disk.mli

  • Committer: Package Import Robot
  • Author(s): Lucas Nussbaum
  • Date: 2013-03-29 15:57:12 UTC
  • Revision ID: package-import@ubuntu.com-20130329155712-o0b9b96w8av68ktq
Tags: upstream-0.90.6+bzr407
Import upstream version 0.90.6+bzr407

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* This file is part of marionnet
 
2
   Copyright (C) 2010  Jean-Vincent Loddo
 
3
   Copyright (C) 2010  Université Paris 13
 
4
 
 
5
   This program is free software: you can redistribute it and/or modify
 
6
   it under the terms of the GNU General Public License as published by
 
7
   the Free Software Foundation, either version 2 of the License, or
 
8
   (at your option) any later version.
 
9
 
 
10
   This program is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
   GNU General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU General Public License
 
16
   along with this program.  If not, see <http://www.gnu.org/licenses/>. *)
 
17
 
 
18
(** Manage files and informations installed on disk(s). *)
 
19
 
 
20
val machine_prefix : string
 
21
val router_prefix : string
 
22
val kernel_prefix : string
 
23
 
 
24
(* `epithet' is almost a phantom type: *)
 
25
type 'a epithet = string
 
26
type variant = string
 
27
type filename = string
 
28
type dirname = string
 
29
type realpath = string
 
30
 
 
31
val root_filesystem_searching_list : dirname list
 
32
val user_filesystem_searching_list : dirname list
 
33
 
 
34
val kernel_searching_list : dirname list
 
35
 
 
36
class terminal_manager :
 
37
 unit ->
 
38
 object
 
39
   method get_choice_list : string list
 
40
   method get_default     : string
 
41
   method is_valid_choice : string -> bool
 
42
   method is_xnest        : string -> bool
 
43
   method is_nox          : string -> bool
 
44
   method is_hostxserver  : string -> bool
 
45
 end
 
46
 
 
47
 
 
48
class ['a] epithet_manager :
 
49
  ?default_epithet:('a epithet) ->
 
50
  ?filter:('a epithet -> bool) ->
 
51
  kind: [> `distrib | `kernel | `variant ] ->
 
52
  directory_searching_list:string list ->
 
53
  prefix:string ->
 
54
  unit ->
 
55
  object
 
56
    (* Constructor's arguments: *)
 
57
 
 
58
    method directory_searching_list : dirname list
 
59
    method prefix : string
 
60
 
 
61
    (* Public interface: *)
 
62
 
 
63
    method get_epithet_list    : 'a epithet list
 
64
    method get_default_epithet : 'a epithet option
 
65
    method epithet_exists      : 'a epithet -> bool
 
66
    method realpath_of_epithet : 'a epithet -> realpath
 
67
 
 
68
    method resolve_epithet_symlink : 'a epithet -> 'a epithet
 
69
 
 
70
    (* Morally private methods: *)
 
71
 
 
72
    method epithets_of_filename : ?no_symlinks:unit ->
 
73
      filename -> ('a epithet) list
 
74
 
 
75
    method epithets_sharing_the_same_realpath_of : ?no_symlinks:unit ->
 
76
      ('a epithet) -> ('a epithet) list
 
77
 
 
78
    method filename_of_epithet : ('a epithet) -> filename
 
79
    method realpath_exists : string -> bool
 
80
 
 
81
    method filter : ('a epithet -> bool) -> unit
 
82
 
 
83
  end
 
84
 
 
85
class virtual_machine_installations :
 
86
  ?user_filesystem_searching_list:string list ->
 
87
  ?root_filesystem_searching_list:string list ->
 
88
  ?kernel_searching_list:string list ->
 
89
  ?kernel_prefix:string ->
 
90
  ?kernel_default_epithet:string ->
 
91
  ?filesystem_default_epithet:string ->
 
92
  prefix:string ->
 
93
  unit ->
 
94
  object
 
95
    (* Constructor's arguments: *)
 
96
 
 
97
    method filesystem_searching_list : dirname list
 
98
    method kernel_searching_list     : dirname list
 
99
    method kernel_prefix : string
 
100
    method prefix : string
 
101
 
 
102
    (* Public interface: *)
 
103
 
 
104
    method filesystems : [`distrib] epithet_manager
 
105
    method kernels     : [`kernel]  epithet_manager
 
106
 
 
107
    method variants_of           : [`distrib] epithet -> [`variant] epithet_manager
 
108
    method supported_kernels_of  : [`distrib] epithet -> ([`kernel] epithet * (string option)) list
 
109
    method get_kernel_console_arguments : [`distrib] epithet -> [`kernel] epithet -> string option
 
110
 
 
111
    method terminal_manager_of   : [`distrib] epithet -> terminal_manager
 
112
 
 
113
    (* filesystem epithet -> dirname *)
 
114
    method root_export_dirname : [`distrib] epithet -> dirname
 
115
    method user_export_dirname : [`distrib] epithet -> dirname
 
116
 
 
117
    (* This method builds warnings if necessary: *)
 
118
    method check_filesystems_MTIME_consistency : unit -> unit
 
119
 
 
120
  end
 
121
 
 
122
(** Final user's machines strictu sensu *)
 
123
val get_machine_installations :
 
124
  ?user_filesystem_searching_list:string list ->
 
125
  ?root_filesystem_searching_list:string list ->
 
126
  ?kernel_searching_list:string list ->
 
127
  ?kernel_prefix:string ->
 
128
  ?kernel_default_epithet:string ->
 
129
  ?filesystem_default_epithet:string ->
 
130
  unit -> virtual_machine_installations
 
131
 
 
132
val get_router_installations :
 
133
  ?user_filesystem_searching_list:string list ->
 
134
  ?root_filesystem_searching_list:string list ->
 
135
  ?kernel_searching_list:string list ->
 
136
  ?kernel_prefix:string ->
 
137
  ?kernel_default_epithet:string ->
 
138
  ?filesystem_default_epithet:string ->
 
139
  unit -> virtual_machine_installations
 
140
 
 
141
val vm_installations_and_epithet_of_prefixed_filesystem :
 
142
  string -> virtual_machine_installations * [`distrib] epithet
 
143
 
 
144
val user_export_dirname_of_prefixed_filesystem : string -> dirname
 
145
val root_export_dirname_of_prefixed_filesystem : string -> dirname
 
146
 
 
147
module Make_and_check_installations :
 
148
  functor (Unit : sig end) ->
 
149
    sig
 
150
      val machines : virtual_machine_installations
 
151
      val routers  : virtual_machine_installations
 
152
    end