Initial import
[hcoop/zz_old/domtool.git] / src / domtool.sig
1 (*
2 Domtool (http://hcoop.sf.net/)
3 Copyright (C) 2004 Adam Chlipala
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (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, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *)
19
20 (* Main domtool structure *)
21
22 signature DOMTOOL =
23 sig
24 val dprint : string -> unit
25 (* If Config.debug, then it prints the argument followed by a newline. *)
26 val inputLine : TextIO.instream -> string option
27 (* Like TextIO.inputLine, but skips past lines commented out with #'s. *)
28
29 type map = string StringMap.map
30 type set = StringSet.set
31
32
33 val error : string * string -> unit
34 (* (error (path, msg)) signals an error about path with description msg. *)
35
36 (* Handlers for configuration files *)
37 type handlerData = {path : string, (* Path to the config file *)
38 domain : string, (* Domain in which it lives *)
39 parent : string, (* Parent of that domain *)
40 vars : map, (* Current variable values *)
41 paths : set, (* Authorized filesystem paths *)
42 users : set, (* Authorized UNIX users *)
43 groups : set} (* Authorized UNIX groups *)
44 type mkdomData = {path : string,
45 domain : string}
46 type handler = {init : unit -> unit,
47 file : handlerData -> unit,
48 finish : unit -> unit,
49 publish : unit -> OS.Process.status,
50 mkdom : mkdomData -> OS.Process.status}
51
52 val setVhostHandler : handler -> unit
53 (* Set the handler for virtual host configuration files *)
54 val setHandler : string * handler -> unit
55 (* Set the handler to be used for files with a specific name *)
56
57
58 val read : unit -> OS.Process.status
59 (* Command line domtool entry point *)
60 val publish : unit -> OS.Process.status
61 (* Propagate changes to real daemons *)
62 val mkDom : string * string -> OS.Process.status
63 (* (mkDom (dom, user)) creates a new domain record *)
64 end