#! /bin/sh # (* exec ocaml "$0" "$@" *) directory ".";; (* Generate an O'Caml module wd_stdlib.ml defining * the variable "stdlib_1" containing the contents of the file * stdlib.bin *) let fout = open_out "wd_stdlib.ml" in List.iter (fun (fn, vn) -> let fin = open_in fn in let fin_len = in_channel_length fin in let s = String.create fin_len in really_input fin s 0 fin_len; output_string fout ("let " ^ vn ^ " = \""); output_string fout (String.escaped s); output_string fout "\";;\n\n"; close_in fin; ) [ "stdlib_lat1.bin", "stdlib_iso88591_1"; "stdlib_utf8.bin", "stdlib_utf8_1"; ]; close_out fout ;;