Project

General

Profile

Revision 3f823d04 src/lusic.ml

View differences:

src/lusic.ml
41 41

  
42 42
(* encode and write a header in a file *)
43 43
let write_lusic lusi (header : top_decl list) basename extension =
44
  let basename' = !Options.dest_dir ^ "/" ^ basename in
45
  let target_name = basename' ^ extension in
44
  let target_name = basename ^ extension in
46 45
  let outchan = open_out_bin target_name in
47 46
  begin
48 47
    Marshal.to_channel outchan {from_lusi = lusi; contents = header} [];
......
51 50

  
52 51
(* read and decode a header from a file *)
53 52
let read_lusic basename extension =
54
  let basename' = !Options.dest_dir ^ "/" ^ basename in
55
  let source_name = basename' ^ extension in
53
  let source_name = basename ^ extension in
56 54
  let inchan = open_in_bin source_name in
57 55
  let lusic = (Marshal.from_channel inchan : lusic) in
58 56
  begin
......
61 59
  end
62 60

  
63 61
let print_lusic_to_h basename extension =
64
  let basename' = !Options.dest_dir ^ "/" ^ basename in
65 62
  let lusic = read_lusic basename extension in
66
  let header_name = basename' ^ ".h" in
63
  let header_name = basename ^ ".h" in
67 64
  let h_out = open_out header_name in
68 65
  let h_fmt = formatter_of_out_channel h_out in
69 66
  begin
70 67
    Typing.uneval_prog_generics lusic.contents;
71 68
    Clock_calculus.uneval_prog_generics lusic.contents;
72
    Header.print_header_from_header h_fmt basename lusic.contents;
69
    Header.print_header_from_header h_fmt (Filename.basename basename) lusic.contents;
73 70
    close_out h_out
74 71
  end
75 72

  

Also available in: Unified diff