Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/cm/paths/pathconfig.sml
ViewVC logotype

Annotation of /sml/trunk/src/cm/paths/pathconfig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 360 - (view) (download)

1 : blume 267 (*
2 :     * Configurable path anchors for new CM.
3 :     *
4 :     * (C) 1999 Lucent Technologies, Bell Laboratories
5 :     *
6 :     * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp)
7 :     *)
8 :    
9 : blume 265 signature PATHCONFIG = sig
10 : blume 321
11 : blume 318 type mode
12 :    
13 : blume 321 val hardwire : (string * string) list -> mode
14 :     val envcfg : (string * string EnvConfig.getterSetter) list -> mode
15 : blume 360 val bootcfg : string -> mode
16 : blume 318
17 :     val configAnchor : mode -> string -> (unit -> string) option
18 : blume 265 end
19 :    
20 : blume 309 (*
21 :     * The names of config anchors must be names of actual files.
22 :     * Function configAnchor will map the name of the anchor to
23 :     * the directory that contains the corresponding file.
24 :     *)
25 : blume 265 structure PathConfig :> PATHCONFIG = struct
26 : blume 318
27 : blume 321 type mode = string -> (unit -> string) option
28 : blume 318
29 : blume 321 fun hardwire [] (a: string) = NONE
30 :     | hardwire ((a', v) :: t) a =
31 :     if a = a' then SOME (fn () => v) else hardwire t a
32 :    
33 :     fun envcfg [] (a: string) = NONE
34 :     | envcfg ((a', gs) :: t) a =
35 :     if a = a' then SOME (fn () => EnvConfig.getSet gs NONE)
36 :     else envcfg t a
37 :    
38 : blume 360 fun bootcfg bootdir a = let
39 :     fun isDir x = OS.FileSys.isDir x handle _ => false
40 :     val d = OS.Path.concat (bootdir, a)
41 :     in
42 :     if isDir d then SOME (fn () => d) else NONE
43 :     end
44 :    
45 : blume 321 fun configAnchor m s = m s
46 : blume 265 end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0