4 let ch = open_in_bin name in
5 let len = in_channel_length ch in
6 let sin = String.create len in
7 really_input ch sin 0 len;
10 Printf.printf "\\noindent\\begin{minipage}{5.5cm}\n";
11 (* Printf.printf "\\rule{5.5cm}{1pt}\n"; *)
12 Printf.printf "\\footnotesize\\bf File %s:\\\\\n" name;
13 Printf.printf "\\tt{}";
15 for i = 0 to len - 1 do
17 ('\000'..'\008'|'\011'|'\012'|'\014'..'\031'|'\127'..'\255') as c ->
18 Printf.printf "{\\sl (%02x)}\\linebreak[2]" (Char.code c)
20 Printf.printf "{\\sl HT}\\linebreak[3]"
22 Printf.printf "{\\sl LF}\\\\\n"
24 Printf.printf "{\\sl CR}";
25 if not(i < len - 1 && sin.[i+1] = '\010') then
26 Printf.printf "\\\\\n";
28 Printf.printf "\\symbol{32}\\linebreak[3]"
30 | ('"'|'#'|'$'|'%'|'&'|'-'|'<'|'>'|'['|'\\'|']'|'^'|'_'|'`'|
31 '{'|'|'|'}'|'~') as c ->
32 Printf.printf "\\symbol{%d}\\linebreak[2]" (Char.code c)
35 print_string "\\linebreak[0]"
38 Printf.printf "\\mbox{}\\\\\n";
39 Printf.printf "\\rule{5.5cm}{1pt}\n";
40 Printf.printf "\\end{minipage}\n"
44 print_endline "\\documentclass[a4paper]{article}";
45 print_endline "\\usepackage{multicol}";
46 print_endline "\\begin{document}";
47 print_endline "\\begin{multicols}{2}";
48 for i = 1 to Array.length(Sys.argv)-1 do
49 dump_file Sys.argv.(i)
51 print_endline "\\end{multicols}";
52 print_endline "\\end{document}"