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

Annotation of mandoc/tbl_html.c, Revision 1.2

1.2     ! kristaps    1: /*     $Id: tbl_html.c,v 1.1 2011/01/04 10:29:41 kristaps Exp $ */
1.1       kristaps    2: /*
                      3:  * Copyright (c) 2009 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 above
                      7:  * copyright notice and this permission notice appear in all copies.
                      8:  *
                      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.
                     16:  */
                     17: #ifdef HAVE_CONFIG_H
                     18: #include "config.h"
                     19: #endif
                     20:
                     21: #include <assert.h>
                     22: #include <stdio.h>
                     23: #include <stdlib.h>
                     24: #include <string.h>
                     25:
                     26: #include "mandoc.h"
                     27: #include "out.h"
                     28: #include "html.h"
                     29:
                     30: void
                     31: print_tbl(struct html *h, const struct tbl_span *sp)
                     32: {
                     33:        const struct tbl_head *hp;
                     34:        const struct tbl_dat *dp;
                     35:        struct tag       *tt;
                     36:
                     37:        switch (sp->pos) {
                     38:        case (TBL_SPAN_HORIZ):
                     39:                /* FALLTHROUGH */
                     40:        case (TBL_SPAN_DHORIZ):
                     41:                return;
                     42:        default:
                     43:                break;
                     44:        }
                     45:
                     46:        /* Inhibit printing of spaces: we do padding ourselves. */
                     47:
                     48:        h->flags |= HTML_NONOSPACE;
                     49:        h->flags |= HTML_NOSPACE;
                     50:
                     51:        print_otag(h, TAG_TABLE, 0, NULL);
                     52:        print_otag(h, TAG_TR, 0, NULL);
                     53:
                     54:        dp = sp->first;
                     55:        for (hp = sp->head; hp; hp = hp->next) {
                     56:                switch (hp->pos) {
                     57:                case (TBL_HEAD_VERT):
                     58:                        /* FALLTHROUGH */
                     59:                case (TBL_HEAD_DVERT):
                     60:                        continue;
                     61:                case (TBL_HEAD_DATA):
                     62:                        break;
                     63:                }
                     64:                tt = print_otag(h, TAG_TD, 0, NULL);
                     65:                if (dp) {
1.2     ! kristaps   66:                        if (dp->string)
        !            67:                                print_text(h, dp->string);
1.1       kristaps   68:                        dp = dp->next;
                     69:                }
                     70:                print_tagq(h, tt);
                     71:        }
                     72:        h->flags &= ~HTML_NONOSPACE;
                     73: }

CVSweb