Add before, after, and exn config directives
[bpt/mlt.git] / src / lib / web.sml
index 6d81d5b..a446e62 100644 (file)
@@ -81,7 +81,8 @@ struct
     val text = ref ([] : string list)
 
     fun print x = text := x :: (!text)
-
+    fun clear () = text := []
+    fun noOutput () = !text = []
     fun output () =
        (TextIO.print "Status: 200\nContent-type: text/html\n\n";
         TextIO.print (String.concat (List.rev (!text))))
@@ -128,4 +129,8 @@ struct
     fun summary () =
        StringMap.foldli (fn (n, vs, s) => foldl (fn (v, s) => s ^ " VALUE: " ^ v) (s ^ " NAME: " ^ n) vs)
        "" (!params)
+
+    val exn = ref (NONE : exn option)
+    fun setExn ex = exn := SOME ex
+    fun getExn () = valOf (!exn)
 end
\ No newline at end of file