Refactoring plugins
[hcoop/domtool2.git] / src / slave.sig
diff --git a/src/slave.sig b/src/slave.sig
new file mode 100644 (file)
index 0000000..24082d4
--- /dev/null
@@ -0,0 +1,42 @@
+(* HCoop Domtool (http://hcoop.sourceforge.net/)
+ * Copyright (c) 2006, Adam Chlipala
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *)
+
+(* Code for receiving and executing configuration files *)
+
+signature SLAVE = sig
+
+    datatype file_action =
+            Add
+          | Delete
+          | Modify
+
+    type file_status = {action : file_action,
+                       domain : string,
+                       file : string}
+
+    val registerFileHandler : (file_status -> unit) -> unit
+    (* Register a function to be called when a result configuration file's
+     * status has changed. Registered handlers are called in the reverse order
+     * from registration order. *)
+
+    val registerPreHandler : (unit -> unit) -> unit
+    val registerPostHandler : (unit -> unit) -> unit
+    (* Register code to run before or after making all changes. *)
+
+    val handleChanges : file_status list -> unit
+end