blob: f24dccb2d328141b1d5cd987684d5c2000e078b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
* Copyright (C) 2002 Shaun McCance
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA.
*
* Author: Shaun McCance <shaunm@gnome.org>
*/
#include "yelp-man-parser.h"
#include "yelp-utils.h"
gint
main (gint argc, gchar **argv)
{
YelpManParser *parser;
YelpDocInfo *doc_info;
xmlDocPtr doc;
if (argc < 2) {
g_error ("Usage: test-man-parser file\n");
return 1;
}
parser = yelp_man_parser_new ();
doc_info = yelp_doc_info_get (argv[1]);
if (!doc_info) {
printf ("Failed to load URI: %s\n", argv[1]);
return -1;
}
doc = yelp_man_parser_parse_doc (parser, doc_info);
yelp_man_parser_free (parser);
xmlDocDump (stdout, doc);
xmlFreeDoc (doc);
return 0;
}
|