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

Annotation of mandoc/man.c, Revision 1.42

1.42    ! kristaps    1: /*     $Id: man.c,v 1.41 2009/09/23 11:53:45 kristaps Exp $ */
1.1       kristaps    2: /*
1.19      kristaps    3:  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
1.1       kristaps    4:  *
                      5:  * Permission to use, copy, modify, and distribute this software for any
1.18      kristaps    6:  * purpose with or without fee is hereby granted, provided that the above
                      7:  * copyright notice and this permission notice appear in all copies.
1.1       kristaps    8:  *
1.18      kristaps    9:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13:  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14:  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15:  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1       kristaps   16:  */
1.41      kristaps   17: #include <sys/types.h>
                     18:
1.1       kristaps   19: #include <assert.h>
                     20: #include <ctype.h>
                     21: #include <stdarg.h>
                     22: #include <stdlib.h>
                     23: #include <stdio.h>
                     24: #include <string.h>
                     25:
                     26: #include "libman.h"
                     27:
1.27      kristaps   28: const  char *const __man_merrnames[WERRMAX] = {
                     29:        "invalid character", /* WNPRINT */
                     30:        "system: malloc error", /* WNMEM */
                     31:        "invalid manual section", /* WMSEC */
                     32:        "invalid date format", /* WDATE */
                     33:        "scope of prior line violated", /* WLNSCOPE */
                     34:        "trailing whitespace", /* WTSPACE */
                     35:        "unterminated quoted parameter", /* WTQUOTE */
                     36:        "document has no body", /* WNODATA */
                     37:        "document has no title/section", /* WNOTITLE */
                     38:        "invalid escape sequence", /* WESCAPE */
1.28      kristaps   39:        "invalid number format", /* WNUMFMT */
1.29      kristaps   40:        "expected block head arguments", /* WHEADARGS */
                     41:        "expected block body arguments", /* WBODYARGS */
                     42:        "expected empty block head", /* WNHEADARGS */
                     43:        "unknown macro", /* WMACRO */
                     44:        "ill-formed macro", /* WMACROFORM */
1.30      kristaps   45:        "scope open on exit", /* WEXITSCOPE */
1.35      kristaps   46:        "no scope context", /* WNOSCOPE */
                     47:        "literal context already open", /* WOLITERAL */
                     48:        "no literal context open" /* WNLITERAL */
1.27      kristaps   49: };
                     50:
1.1       kristaps   51: const  char *const __man_macronames[MAN_MAX] = {
1.21      kristaps   52:        "br",           "TH",           "SH",           "SS",
1.1       kristaps   53:        "TP",           "LP",           "PP",           "P",
                     54:        "IP",           "HP",           "SM",           "SB",
                     55:        "BI",           "IB",           "BR",           "RB",
1.11      kristaps   56:        "R",            "B",            "I",            "IR",
1.29      kristaps   57:        "RI",           "na",           "i",            "sp",
1.30      kristaps   58:        "nf",           "fi",           "r",            "RE",
1.42    ! kristaps   59:        "RS",           "DT",           "UC",           "PD"
1.1       kristaps   60:        };
                     61:
                     62: const  char * const *man_macronames = __man_macronames;
                     63:
1.16      kristaps   64: static struct man_node *man_node_alloc(int, int,
                     65:                                enum man_type, int);
1.1       kristaps   66: static int              man_node_append(struct man *,
                     67:                                struct man_node *);
                     68: static int              man_ptext(struct man *, int, char *);
                     69: static int              man_pmacro(struct man *, int, char *);
1.2       kristaps   70: static void             man_free1(struct man *);
1.16      kristaps   71: static int              man_alloc1(struct man *);
1.31      kristaps   72: static int              pstring(struct man *, int, int,
                     73:                                const char *, size_t);
1.1       kristaps   74:
1.32      kristaps   75: #ifdef __linux__
                     76: extern size_t            strlcpy(char *, const char *, size_t);
                     77: #endif
                     78:
1.1       kristaps   79:
                     80: const struct man_node *
1.2       kristaps   81: man_node(const struct man *m)
1.1       kristaps   82: {
                     83:
1.2       kristaps   84:        return(MAN_HALT & m->flags ? NULL : m->first);
1.1       kristaps   85: }
                     86:
                     87:
                     88: const struct man_meta *
1.2       kristaps   89: man_meta(const struct man *m)
1.1       kristaps   90: {
                     91:
1.2       kristaps   92:        return(MAN_HALT & m->flags ? NULL : &m->meta);
1.1       kristaps   93: }
                     94:
                     95:
1.15      kristaps   96: int
1.1       kristaps   97: man_reset(struct man *man)
                     98: {
                     99:
1.2       kristaps  100:        man_free1(man);
1.16      kristaps  101:        return(man_alloc1(man));
1.1       kristaps  102: }
                    103:
                    104:
                    105: void
                    106: man_free(struct man *man)
                    107: {
                    108:
1.2       kristaps  109:        man_free1(man);
1.1       kristaps  110:        free(man);
                    111: }
                    112:
                    113:
                    114: struct man *
1.7       kristaps  115: man_alloc(void *data, int pflags, const struct man_cb *cb)
1.1       kristaps  116: {
                    117:        struct man      *p;
                    118:
1.16      kristaps  119:        if (NULL == (p = calloc(1, sizeof(struct man))))
                    120:                return(NULL);
1.2       kristaps  121:
1.16      kristaps  122:        if ( ! man_alloc1(p)) {
                    123:                free(p);
                    124:                return(NULL);
                    125:        }
1.1       kristaps  126:
1.40      kristaps  127:        man_hash_init();
                    128:
1.4       kristaps  129:        p->data = data;
1.7       kristaps  130:        p->pflags = pflags;
1.16      kristaps  131:        (void)memcpy(&p->cb, cb, sizeof(struct man_cb));
1.1       kristaps  132:        return(p);
                    133: }
                    134:
                    135:
                    136: int
                    137: man_endparse(struct man *m)
                    138: {
                    139:
1.3       kristaps  140:        if (MAN_HALT & m->flags)
                    141:                return(0);
                    142:        else if (man_macroend(m))
                    143:                return(1);
                    144:        m->flags |= MAN_HALT;
                    145:        return(0);
1.1       kristaps  146: }
                    147:
                    148:
                    149: int
                    150: man_parseln(struct man *m, int ln, char *buf)
                    151: {
                    152:
                    153:        return('.' == *buf ?
                    154:                        man_pmacro(m, ln, buf) :
                    155:                        man_ptext(m, ln, buf));
                    156: }
                    157:
                    158:
1.2       kristaps  159: static void
                    160: man_free1(struct man *man)
                    161: {
                    162:
                    163:        if (man->first)
                    164:                man_node_freelist(man->first);
                    165:        if (man->meta.title)
                    166:                free(man->meta.title);
1.6       kristaps  167:        if (man->meta.source)
                    168:                free(man->meta.source);
1.2       kristaps  169:        if (man->meta.vol)
                    170:                free(man->meta.vol);
                    171: }
                    172:
                    173:
1.16      kristaps  174: static int
1.2       kristaps  175: man_alloc1(struct man *m)
                    176: {
                    177:
                    178:        bzero(&m->meta, sizeof(struct man_meta));
                    179:        m->flags = 0;
                    180:        m->last = calloc(1, sizeof(struct man_node));
                    181:        if (NULL == m->last)
1.16      kristaps  182:                return(0);
1.2       kristaps  183:        m->first = m->last;
                    184:        m->last->type = MAN_ROOT;
                    185:        m->next = MAN_NEXT_CHILD;
1.16      kristaps  186:        return(1);
1.2       kristaps  187: }
                    188:
                    189:
1.1       kristaps  190: static int
                    191: man_node_append(struct man *man, struct man_node *p)
                    192: {
                    193:
                    194:        assert(man->last);
                    195:        assert(man->first);
                    196:        assert(MAN_ROOT != p->type);
                    197:
                    198:        switch (man->next) {
                    199:        case (MAN_NEXT_SIBLING):
                    200:                man->last->next = p;
                    201:                p->prev = man->last;
                    202:                p->parent = man->last->parent;
                    203:                break;
                    204:        case (MAN_NEXT_CHILD):
                    205:                man->last->child = p;
                    206:                p->parent = man->last;
                    207:                break;
                    208:        default:
                    209:                abort();
                    210:                /* NOTREACHED */
                    211:        }
1.22      kristaps  212:
                    213:        p->parent->nchild++;
1.1       kristaps  214:
1.29      kristaps  215:        if ( ! man_valid_pre(man, p))
                    216:                return(0);
                    217:
                    218:        switch (p->type) {
                    219:        case (MAN_HEAD):
                    220:                assert(MAN_BLOCK == p->parent->type);
                    221:                p->parent->head = p;
                    222:                break;
                    223:        case (MAN_BODY):
                    224:                assert(MAN_BLOCK == p->parent->type);
                    225:                p->parent->body = p;
                    226:                break;
                    227:        default:
                    228:                break;
                    229:        }
                    230:
1.2       kristaps  231:        man->last = p;
                    232:
1.1       kristaps  233:        switch (p->type) {
1.2       kristaps  234:        case (MAN_TEXT):
                    235:                if ( ! man_valid_post(man))
                    236:                        return(0);
                    237:                if ( ! man_action_post(man))
                    238:                        return(0);
1.1       kristaps  239:                break;
                    240:        default:
                    241:                break;
                    242:        }
                    243:
                    244:        return(1);
                    245: }
                    246:
                    247:
                    248: static struct man_node *
1.16      kristaps  249: man_node_alloc(int line, int pos, enum man_type type, int tok)
1.1       kristaps  250: {
                    251:        struct man_node *p;
                    252:
1.16      kristaps  253:        p = calloc(1, sizeof(struct man_node));
                    254:        if (NULL == p)
                    255:                return(NULL);
                    256:
1.1       kristaps  257:        p->line = line;
                    258:        p->pos = pos;
                    259:        p->type = type;
1.16      kristaps  260:        p->tok = tok;
1.1       kristaps  261:        return(p);
                    262: }
                    263:
                    264:
                    265: int
1.30      kristaps  266: man_elem_alloc(struct man *m, int line, int pos, int tok)
1.1       kristaps  267: {
                    268:        struct man_node *p;
                    269:
1.16      kristaps  270:        p = man_node_alloc(line, pos, MAN_ELEM, tok);
                    271:        if (NULL == p)
                    272:                return(0);
1.30      kristaps  273:        if ( ! man_node_append(m, p))
                    274:                return(0);
                    275:        m->next = MAN_NEXT_CHILD;
                    276:        return(1);
1.1       kristaps  277: }
                    278:
                    279:
                    280: int
1.29      kristaps  281: man_head_alloc(struct man *m, int line, int pos, int tok)
                    282: {
                    283:        struct man_node *p;
                    284:
                    285:        p = man_node_alloc(line, pos, MAN_HEAD, tok);
                    286:        if (NULL == p)
                    287:                return(0);
                    288:        if ( ! man_node_append(m, p))
                    289:                return(0);
                    290:        m->next = MAN_NEXT_CHILD;
                    291:        return(1);
                    292: }
                    293:
                    294:
                    295: int
                    296: man_body_alloc(struct man *m, int line, int pos, int tok)
                    297: {
                    298:        struct man_node *p;
                    299:
                    300:        p = man_node_alloc(line, pos, MAN_BODY, tok);
                    301:        if (NULL == p)
                    302:                return(0);
                    303:        if ( ! man_node_append(m, p))
                    304:                return(0);
                    305:        m->next = MAN_NEXT_CHILD;
                    306:        return(1);
                    307: }
                    308:
                    309:
                    310: int
                    311: man_block_alloc(struct man *m, int line, int pos, int tok)
                    312: {
                    313:        struct man_node *p;
                    314:
                    315:        p = man_node_alloc(line, pos, MAN_BLOCK, tok);
                    316:        if (NULL == p)
                    317:                return(0);
                    318:        if ( ! man_node_append(m, p))
                    319:                return(0);
                    320:        m->next = MAN_NEXT_CHILD;
                    321:        return(1);
                    322: }
                    323:
                    324:
1.31      kristaps  325: static int
                    326: pstring(struct man *m, int line, int pos,
                    327:                const char *p, size_t len)
1.1       kristaps  328: {
1.31      kristaps  329:        struct man_node *n;
                    330:        size_t           sv;
1.1       kristaps  331:
1.31      kristaps  332:        n = man_node_alloc(line, pos, MAN_TEXT, -1);
                    333:        if (NULL == n)
1.16      kristaps  334:                return(0);
1.31      kristaps  335:
                    336:        n->string = malloc(len + 1);
                    337:        if (NULL == n->string) {
                    338:                free(n);
1.16      kristaps  339:                return(0);
1.31      kristaps  340:        }
                    341:
                    342:        sv = strlcpy(n->string, p, len + 1);
                    343:
                    344:        /* Prohibit truncation. */
                    345:        assert(sv < len + 1);
                    346:
                    347:        if ( ! man_node_append(m, n))
1.30      kristaps  348:                return(0);
                    349:        m->next = MAN_NEXT_SIBLING;
                    350:        return(1);
1.1       kristaps  351: }
                    352:
                    353:
1.31      kristaps  354: int
                    355: man_word_alloc(struct man *m, int line, int pos, const char *word)
                    356: {
                    357:
                    358:        return(pstring(m, line, pos, word, strlen(word)));
                    359: }
                    360:
                    361:
1.1       kristaps  362: void
                    363: man_node_free(struct man_node *p)
                    364: {
                    365:
                    366:        if (p->string)
                    367:                free(p->string);
1.24      kristaps  368:        if (p->parent)
                    369:                p->parent->nchild--;
1.1       kristaps  370:        free(p);
                    371: }
                    372:
                    373:
                    374: void
                    375: man_node_freelist(struct man_node *p)
                    376: {
1.37      kristaps  377:        struct man_node *n;
1.1       kristaps  378:
                    379:        if (p->child)
                    380:                man_node_freelist(p->child);
1.24      kristaps  381:        assert(0 == p->nchild);
1.37      kristaps  382:        n = p->next;
1.1       kristaps  383:        man_node_free(p);
1.37      kristaps  384:        if (n)
                    385:                man_node_freelist(n);
1.1       kristaps  386: }
                    387:
                    388:
                    389: static int
                    390: man_ptext(struct man *m, int line, char *buf)
                    391: {
1.31      kristaps  392:        int              i, j;
                    393:
1.35      kristaps  394:        /* Literal free-form text whitespace is preserved. */
                    395:
                    396:        if (MAN_LITERAL & m->flags) {
                    397:                if ( ! man_word_alloc(m, line, 0, buf))
                    398:                        return(0);
                    399:                goto descope;
                    400:        }
                    401:
1.31      kristaps  402:        /* First de-chunk and allocate words. */
                    403:
                    404:        for (i = 0; ' ' == buf[i]; i++)
                    405:                /* Skip leading whitespace. */ ;
                    406:        if (0 == buf[i]) {
                    407:                if ( ! pstring(m, line, 0, &buf[i], 0))
                    408:                        return(0);
                    409:                goto descope;
                    410:        }
                    411:
                    412:        for (j = i; buf[i]; i++) {
                    413:                if (' ' != buf[i])
                    414:                        continue;
                    415:
                    416:                /* Escaped whitespace. */
                    417:                if (i && ' ' == buf[i] && '\\' == buf[i - 1])
                    418:                        continue;
1.1       kristaps  419:
1.31      kristaps  420:                buf[i++] = 0;
                    421:                if ( ! pstring(m, line, j, &buf[j], (size_t)(i - j)))
                    422:                        return(0);
1.29      kristaps  423:
1.31      kristaps  424:                for ( ; ' ' == buf[i]; i++)
                    425:                        /* Skip trailing whitespace. */ ;
1.30      kristaps  426:
1.31      kristaps  427:                j = i;
                    428:                if (0 == buf[i])
                    429:                        break;
                    430:        }
                    431:
                    432:        if (j != i && ! pstring(m, line, j, &buf[j], (size_t)(i - j)))
1.1       kristaps  433:                return(0);
1.31      kristaps  434:
                    435: descope:
1.11      kristaps  436:
                    437:        /*
1.29      kristaps  438:         * Co-ordinate what happens with having a next-line scope open:
                    439:         * first close out the element scope (if applicable), then close
                    440:         * out the block scope (also if applicable).
1.11      kristaps  441:         */
                    442:
1.29      kristaps  443:        if (MAN_ELINE & m->flags) {
                    444:                m->flags &= ~MAN_ELINE;
                    445:                if ( ! man_unscope(m, m->last->parent))
                    446:                        return(0);
                    447:        }
                    448:
                    449:        if ( ! (MAN_BLINE & m->flags))
1.11      kristaps  450:                return(1);
1.29      kristaps  451:        m->flags &= ~MAN_BLINE;
1.11      kristaps  452:
1.29      kristaps  453:        if ( ! man_unscope(m, m->last->parent))
1.11      kristaps  454:                return(0);
1.29      kristaps  455:        return(man_body_alloc(m, line, 0, m->last->tok));
1.1       kristaps  456: }
                    457:
                    458:
                    459: int
                    460: man_pmacro(struct man *m, int ln, char *buf)
                    461: {
1.34      kristaps  462:        int              i, j, c, ppos, fl;
                    463:        char             mac[5];
                    464:        struct man_node *n;
1.1       kristaps  465:
                    466:        /* Comments and empties are quickly ignored. */
                    467:
1.29      kristaps  468:        fl = m->flags;
1.11      kristaps  469:
1.1       kristaps  470:        if (0 == buf[1])
1.11      kristaps  471:                goto out;
1.1       kristaps  472:
1.9       kristaps  473:        i = 1;
                    474:
                    475:        if (' ' == buf[i]) {
                    476:                i++;
1.1       kristaps  477:                while (buf[i] && ' ' == buf[i])
                    478:                        i++;
                    479:                if (0 == buf[i])
1.11      kristaps  480:                        goto out;
1.1       kristaps  481:        }
                    482:
1.10      kristaps  483:        ppos = i;
                    484:
1.1       kristaps  485:        /* Copy the first word into a nil-terminated buffer. */
                    486:
1.10      kristaps  487:        for (j = 0; j < 4; j++, i++) {
                    488:                if (0 == (mac[j] = buf[i]))
1.1       kristaps  489:                        break;
1.10      kristaps  490:                else if (' ' == buf[i])
1.1       kristaps  491:                        break;
1.38      kristaps  492:
                    493:                /* Check for invalid characters. */
                    494:
                    495:                if (isgraph((u_char)buf[i]))
                    496:                        continue;
                    497:                return(man_perr(m, ln, i, WNPRINT));
1.1       kristaps  498:        }
                    499:
1.9       kristaps  500:        mac[j] = 0;
1.1       kristaps  501:
1.9       kristaps  502:        if (j == 4 || j < 1) {
1.7       kristaps  503:                if ( ! (MAN_IGN_MACRO & m->pflags)) {
1.29      kristaps  504:                        (void)man_perr(m, ln, ppos, WMACROFORM);
1.7       kristaps  505:                        goto err;
                    506:                }
1.29      kristaps  507:                if ( ! man_pwarn(m, ln, ppos, WMACROFORM))
1.7       kristaps  508:                        goto err;
1.12      kristaps  509:                return(1);
1.7       kristaps  510:        }
1.1       kristaps  511:
1.40      kristaps  512:        if (MAN_MAX == (c = man_hash_find(mac))) {
1.7       kristaps  513:                if ( ! (MAN_IGN_MACRO & m->pflags)) {
1.29      kristaps  514:                        (void)man_perr(m, ln, ppos, WMACRO);
1.7       kristaps  515:                        goto err;
                    516:                }
1.29      kristaps  517:                if ( ! man_pwarn(m, ln, ppos, WMACRO))
1.7       kristaps  518:                        goto err;
1.12      kristaps  519:                return(1);
1.1       kristaps  520:        }
                    521:
                    522:        /* The macro is sane.  Jump to the next word. */
                    523:
                    524:        while (buf[i] && ' ' == buf[i])
                    525:                i++;
                    526:
1.34      kristaps  527:        /* Remove prior ELINE macro, if applicable. */
                    528:
                    529:        if (m->flags & MAN_ELINE) {
                    530:                n = m->last;
                    531:                assert(NULL == n->child);
1.37      kristaps  532:                assert(0 == n->nchild);
1.34      kristaps  533:                if ( ! man_nwarn(m, n, WLNSCOPE))
                    534:                        return(0);
                    535:
                    536:                if (n->prev) {
                    537:                        assert(n != n->parent->child);
                    538:                        assert(n == n->prev->next);
                    539:                        n->prev->next = NULL;
                    540:                        m->last = n->prev;
1.37      kristaps  541:                        m->next = MAN_NEXT_SIBLING;
1.34      kristaps  542:                } else {
                    543:                        assert(n == n->parent->child);
                    544:                        n->parent->child = NULL;
                    545:                        m->last = n->parent;
1.37      kristaps  546:                        m->next = MAN_NEXT_CHILD;
1.34      kristaps  547:                }
                    548:
                    549:                man_node_free(n);
                    550:                m->flags &= ~MAN_ELINE;
                    551:        }
                    552:
1.1       kristaps  553:        /* Begin recursive parse sequence. */
                    554:
1.29      kristaps  555:        assert(man_macros[c].fp);
                    556:
                    557:        if ( ! (*man_macros[c].fp)(m, c, ln, ppos, &i, buf))
1.1       kristaps  558:                goto err;
                    559:
1.11      kristaps  560: out:
1.29      kristaps  561:        if ( ! (MAN_BLINE & fl))
                    562:                return(1);
                    563:
                    564:        /*
                    565:         * If we've opened a new next-line element scope, then return
                    566:         * now, as the next line will close out the block scope.
                    567:         */
                    568:
                    569:        if (MAN_ELINE & m->flags)
                    570:                return(1);
                    571:
                    572:        /* Close out the block scope opened in the prior line.  */
1.11      kristaps  573:
1.29      kristaps  574:        assert(MAN_BLINE & m->flags);
                    575:        m->flags &= ~MAN_BLINE;
1.11      kristaps  576:
1.29      kristaps  577:        if ( ! man_unscope(m, m->last->parent))
                    578:                return(0);
                    579:        return(man_body_alloc(m, ln, 0, m->last->tok));
1.1       kristaps  580:
                    581: err:   /* Error out. */
                    582:
1.2       kristaps  583:        m->flags |= MAN_HALT;
1.1       kristaps  584:        return(0);
                    585: }
1.3       kristaps  586:
1.4       kristaps  587:
                    588: int
                    589: man_verr(struct man *man, int ln, int pos, const char *fmt, ...)
                    590: {
                    591:        char             buf[256];
                    592:        va_list          ap;
                    593:
                    594:        if (NULL == man->cb.man_err)
                    595:                return(0);
                    596:
                    597:        va_start(ap, fmt);
                    598:        (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
                    599:        va_end(ap);
                    600:        return((*man->cb.man_err)(man->data, ln, pos, buf));
                    601: }
                    602:
                    603:
                    604: int
                    605: man_vwarn(struct man *man, int ln, int pos, const char *fmt, ...)
                    606: {
                    607:        char             buf[256];
                    608:        va_list          ap;
                    609:
                    610:        if (NULL == man->cb.man_warn)
                    611:                return(0);
                    612:
                    613:        va_start(ap, fmt);
                    614:        (void)vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
                    615:        va_end(ap);
                    616:        return((*man->cb.man_warn)(man->data, ln, pos, buf));
                    617: }
                    618:
                    619:
1.23      kristaps  620: int
1.27      kristaps  621: man_err(struct man *m, int line, int pos, int iserr, enum merr type)
1.23      kristaps  622: {
                    623:        const char       *p;
                    624:
1.27      kristaps  625:        p = __man_merrnames[(int)type];
1.23      kristaps  626:        assert(p);
                    627:
                    628:        if (iserr)
                    629:                return(man_verr(m, line, pos, p));
                    630:
                    631:        return(man_vwarn(m, line, pos, p));
                    632: }

CVSweb