(*
* Dynamic web page generation with Standard ML
- * Copyright (C) 2003 Adam Chlipala
+ * Copyright (C) 2003-2004 Adam Chlipala
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
structure Config :> CONFIG =
struct
- val defaultFile = "/etc/mlt.conf"
+ open Settings
datatype config =
CONFIG of {inPath : string, (* Directory for input sources *)
fun read (fields as {inPath, outPath, pubPath, lib, compiler, cm, sml, printFn, beforeT, afterT, exnT}) =
(case TextIO.inputLine inf of
- "" => CONFIG fields
- | line =>
+ NONE => CONFIG fields
+ | SOME line =>
(case String.tokens Char.isSpace line of
[] => read fields
| ["in", inPath] => read {inPath = expandPath inPath, outPath = outPath, pubPath = pubPath,
let
val cwd = OS.FileSys.getDir ()
- val base = CONFIG {lib = "/usr/local/share/mlt/src/lib/sources.cm",
- compiler = "/usr/local/share/mlt/src/sources.cm",
- sml = "/usr/local/sml/bin",
+ val base = CONFIG {lib = mltdir ^ "/src/lib/sources.cm",
+ compiler = mltdir ^ "/src/sources.cm",
+ sml = smlbin,
inPath = cwd,
outPath = cwd,
pubPath = cwd,