[BACK]Return to mdoclint.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/mdoclint.c, Revision 1.3

1.3     ! kristaps    1:        /* $Id: mdoclint.c,v 1.2 2009/03/06 14:13:47 kristaps Exp $ */
1.1       kristaps    2: /*
                      3:  * Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
                      4:  *
                      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
                      8:  * copies.
                      9:  *
                     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.
                     18:  */
                     19: #include <assert.h>
                     20: #include <err.h>
                     21: #include <getopt.h>
                     22: #include <stdio.h>
                     23: #include <stdlib.h>
                     24:
                     25: #include "mmain.h"
                     26:
                     27: int
                     28: main(int argc, char *argv[])
                     29: {
                     30:        struct mmain    *p;
1.2       kristaps   31:        int              c;
1.1       kristaps   32:
                     33:        p = mmain_alloc();
                     34:
1.3     ! kristaps   35:        c = mmain_getopt(p, argc, argv, NULL,
        !            36:                        "[infile...]", NULL, NULL, NULL);
1.1       kristaps   37:
1.3     ! kristaps   38:        argv += c;
        !            39:        if (0 == (argc -= c))
        !            40:                mmain_exit(p, NULL != mmain_mdoc(p, "-"));
        !            41:
        !            42:        while (c-- > 0) {
        !            43:                if (NULL == mmain_mdoc(p, *argv++))
        !            44:                        mmain_exit(p, 1);
        !            45:                mmain_reset(p);
        !            46:        }
1.1       kristaps   47:
                     48:        mmain_exit(p, 0);
                     49:        /* NOTREACHED */
                     50: }
                     51:

CVSweb