Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/fields/image-info.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/fields/image-info.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 238, Thu Aug 5 23:17:46 2010 UTC revision 239, Fri Aug 6 00:36:04 2010 UTC
# Line 42  Line 42 
42      fun hash (ImgInfo{id, ...}) = OS.FileSys.hash id      fun hash (ImgInfo{id, ...}) = OS.FileSys.hash id
43    
44      fun getInfo fileName = let      fun getInfo fileName = let
45    (* FIXME: check that file exists! *)
46            val {version, header} = RunDNorm.run fileName            val {version, header} = RunDNorm.run fileName
47              fun set (r, v) = (r := SOME v)
48              fun get (tag, r) = (case !r of NONE => raise Fail("missing "^tag) | SOME v => v)
49              val ty = ref NONE
50              val dim = ref NONE
51              fun doValue ("type", v) = set(ty, RawTypes.fromString v)
52                | doValue ("dimension", v) = ()
53                | doValue ("space dimension", v) = set (dim, valOf(Int.fromString v))
54                | doValue ("sizes", v) = ()
55                | doValue ("space directions", v) = ()
56                | doValue ("kinds", v) = ()
57                | doValue ("endian", v) = ()
58                | doValue ("encoding", v) = ()
59                | doValue ("space origin", v) = ()
60                | doValue _ = ()
61            in            in
62              Log.msg (concat[fileName, " file header:\n"]);              Log.msg (concat[fileName, " file header:\n"]);
63              List.app (fn (tag, value) => Log.msg(concat["  ", tag, ": ", value, "\n"])) header;              List.app (fn (tag, value) => Log.msg(concat["  ", tag, ": ", value, "\n"])) header;
64  (* FIXME*)raise Fail "getInfo"              List.app doValue header;
65                ImgInfo{
66                    id = OS.FileSys.fileId fileName,
67                    dim = get ("space dimension", dim),
68                    ty = get ("type", ty),
69                    origin = [],    (* FIXME *)
70                    sizes = []      (* FIXME *)
71                  }
72            end            end
73    
74      fun toString (ImgInfo{...}) = "IMAGE" (* FIXME *)      fun toString (ImgInfo{...}) = "IMAGE" (* FIXME *)

Legend:
Removed from v.238  
changed lines
  Added in v.239

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