diff options
author | 2009-06-23 15:56:04 -0400 | |
---|---|---|
committer | 2009-06-23 15:56:04 -0400 | |
commit | a4717bf85434747f0e96aa11030ce0869db2706c (patch) | |
tree | 5c08087fd98403edb3500ac4399ddece25c667ad /src/settings.sml | |
parent | ca88628fbeb6fe8cadf9d7e12e5faccf2a7da96b (diff) |
Initial implementation of protocols in Settings
Diffstat (limited to 'src/settings.sml')
-rw-r--r-- | src/settings.sml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/settings.sml b/src/settings.sml index 9c7b1175..75c879f7 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -248,4 +248,27 @@ val checkMime = check (CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"/" orelse ch = #"-" orelse ch = #".")) mime + +type protocol = { + name : string, + link : string, + supportsPush : bool +} +val protocols = ref ([] : protocol list) +fun addProtocol p = protocols := p :: !protocols +fun getProtocol s = List.find (fn p => #name p = s) (!protocols) + +fun clibFile s = OS.Path.joinDirFile {dir = Config.libC, + file = s} + +val http = {name = "http", + link = clibFile "request.o" ^ " " ^ clibFile "http.o", + supportsPush = true} + +val () = addProtocol http + +val curProto = ref http +fun setProtocol p = curProto := p +fun currentProtocol () = !curProto + end |