build: link nums only when BT is enabled (ref #27)
[mldonkey.git] / tools / testrss.ml
blob940fbf9ef5d746118983a5871b725a73029aff2a
1 (*********************************************************************************)
2 (* OCaml-RSS *)
3 (* *)
4 (* Copyright (C) 2003 Institut National de Recherche en Informatique et *)
5 (* en Automatique. All rights reserved. *)
6 (* *)
7 (* This program is free software; you can redistribute it and/or modify *)
8 (* it under the terms of the GNU General Public License as published by *)
9 (* the Free Software Foundation; either version 2 of the License, or *)
10 (* any later version. *)
11 (* *)
12 (* This program is distributed in the hope that it will be useful, *)
13 (* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
14 (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
15 (* GNU General Public License for more details. *)
16 (* *)
17 (* You should have received a copy of the GNU General Public License *)
18 (* along with this program; if not, write to the Free Software *)
19 (* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *)
20 (* 02111-1307 USA *)
21 (* *)
22 (* Contact: Maxence.Guesdon@inria.fr *)
23 (*********************************************************************************)
25 let main () =
26 if Array.length Sys.argv < 2 then
28 Printf.eprintf "usage: %s <file to parse>\n" Sys.argv.(0);
29 exit 1
31 try
32 let ch = Rss.channel_of_file Sys.argv.(1) in
33 Rss.print_channel Format.std_formatter ch;
34 print_newline ()
35 with
36 Xml.Error e ->
37 prerr_endline (Xml.error e);
38 exit 1
39 | Xml_dtd.Parse_error e ->
40 prerr_endline (Xml_dtd.parse_error e);
41 exit 2
43 let _ = main ()