version 1.1, 2009/02/23 13:05:06 |
version 1.4, 2009/03/16 23:37:28 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the |
* purpose with or without fee is hereby granted, provided that the |
|
|
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
{ |
{ |
struct mmain *p; |
struct mmain *p; |
const struct mdoc *mdoc; |
int c; |
|
|
p = mmain_alloc(); |
p = mmain_alloc(); |
|
|
if ( ! mmain_getopt(p, argc, argv, NULL, NULL, NULL, NULL)) |
c = mmain_getopt(p, argc, argv, NULL, |
mmain_exit(p, 1); |
"[infile...]", NULL, NULL, NULL); |
|
|
if (NULL == (mdoc = mmain_mdoc(p))) |
argv += c; |
mmain_exit(p, 1); |
if (0 == (argc -= c)) |
|
mmain_exit(p, NULL != mmain_mdoc(p, "-")); |
|
|
|
while (c-- > 0) { |
|
if (NULL == mmain_mdoc(p, *argv++)) |
|
mmain_exit(p, 1); |
|
mmain_reset(p); |
|
} |
|
|
mmain_exit(p, 0); |
mmain_exit(p, 0); |
/* NOTREACHED */ |
/* NOTREACHED */ |