]>
git.cameronkatri.com Git - mandoc.git/blob - mdoctree.c
2c62359c39327b5646f2584b716845598e71d49d
1 /* $Id: mdoctree.c,v 1.2 2009/02/22 22:58:39 kristaps Exp $ */
3 * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
26 extern void treeprint(const struct mdoc_node
*,
27 const struct mdoc_meta
*);
30 main(int argc
, char *argv
[])
33 const struct mdoc
*mdoc
;
41 if ( ! mmain_getopt(p
, argc
, argv
, NULL
))
44 optreset
= optind
= 1;
47 while (-1 != (c
= getopt(argc
, argv
, "f:")))
50 printf("%s\n", optarg
);
53 if (mmain_isopt(optopt
)) {
54 printf("ok: %d\n", optopt
);
57 printf("bad: %d\n", optopt
);
65 if (NULL
== (mdoc
= mmain_mdoc(p
)))
68 treeprint(mdoc_node(mdoc
), mdoc_meta(mdoc
));