本文整理汇总了C++中print_tagq函数的典型用法代码示例。如果您正苦于以下问题:C++ print_tagq函数的具体用法?C++ print_tagq怎么用?C++ print_tagq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_tagq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: html_mdoc
void
html_mdoc(void *arg, const struct roff_man *mdoc)
{
struct html *h;
struct roff_node *n;
struct tag *t;
h = (struct html *)arg;
n = mdoc->first->child;
if ((h->oflags & HTML_FRAGMENT) == 0) {
print_gen_decls(h);
print_otag(h, TAG_HTML, "");
if (n->type == ROFFT_COMMENT)
print_gen_comment(h, n);
t = print_otag(h, TAG_HEAD, "");
print_mdoc_head(&mdoc->meta, h);
print_tagq(h, t);
print_otag(h, TAG_BODY, "");
}
mdoc_root_pre(&mdoc->meta, h);
t = print_otag(h, TAG_DIV, "c", "manual-text");
print_mdoc_nodelist(&mdoc->meta, n, h);
print_tagq(h, t);
mdoc_root_post(&mdoc->meta, h);
print_tagq(h, NULL);
}
示例2: mdoc_rv_pre
static int
mdoc_rv_pre(MDOC_ARGS)
{
struct htmlpair tag;
struct tag *t;
int nchild;
if (n->prev)
print_otag(h, TAG_BR, 0, NULL);
PAIR_CLASS_INIT(&tag, "fname");
nchild = n->nchild;
if (nchild > 0) {
print_text(h, "The");
for (n = n->child; n; n = n->next) {
t = print_otag(h, TAG_B, 1, &tag);
print_text(h, n->string);
print_tagq(h, t);
h->flags |= HTML_NOSPACE;
print_text(h, "()");
if (n->next == NULL)
continue;
if (nchild > 2) {
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
if (n->next->next == NULL)
print_text(h, "and");
}
if (nchild > 1)
print_text(h, "functions return");
else
print_text(h, "function returns");
print_text(h, "the value\\~0 if successful;");
} else
print_text(h, "Upon successful completion,"
" the value\\~0 is returned;");
print_text(h, "otherwise the value\\~\\-1 is returned"
" and the global variable");
PAIR_CLASS_INIT(&tag, "var");
t = print_otag(h, TAG_B, 1, &tag);
print_text(h, "errno");
print_tagq(h, t);
print_text(h, "is set to indicate the error.");
return(0);
}
示例3: print_gen_head
void
print_gen_head(struct html *h)
{
struct htmlpair tag[4];
struct tag *t;
tag[0].key = ATTR_CHARSET;
tag[0].val = "utf-8";
print_otag(h, TAG_META, 1, tag);
/*
* Print a default style-sheet.
*/
t = print_otag(h, TAG_STYLE, 0, NULL);
print_text(h, "table.head, table.foot { width: 100%; }\n"
"td.head-rtitle, td.foot-os { text-align: right; }\n"
"td.head-vol { text-align: center; }\n"
"table.foot td { width: 50%; }\n"
"table.head td { width: 33%; }\n"
"div.spacer { margin: 1em 0; }\n");
print_tagq(h, t);
if (h->style) {
tag[0].key = ATTR_REL;
tag[0].val = "stylesheet";
tag[1].key = ATTR_HREF;
tag[1].val = h->style;
tag[2].key = ATTR_TYPE;
tag[2].val = "text/css";
tag[3].key = ATTR_MEDIA;
tag[3].val = "all";
print_otag(h, TAG_LINK, 4, tag);
}
}
示例4: man_root_post
static void
man_root_post(MAN_ARGS)
{
struct htmlpair tag;
struct tag *t, *tt;
PAIR_CLASS_INIT(&tag, "foot");
t = print_otag(h, TAG_TABLE, 1, &tag);
tt = print_otag(h, TAG_TR, 0, NULL);
PAIR_CLASS_INIT(&tag, "foot-date");
print_otag(h, TAG_TD, 1, &tag);
assert(man->date);
print_text(h, man->date);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag, "foot-os");
print_otag(h, TAG_TD, 1, &tag);
if (man->source)
print_text(h, man->source);
print_tagq(h, t);
}
示例5: print_text
void
print_text(struct html *h, const char *word)
{
if ( ! (HTML_NOSPACE & h->flags)) {
/* Manage keeps! */
if ( ! (HTML_KEEP & h->flags)) {
if (HTML_PREKEEP & h->flags)
h->flags |= HTML_KEEP;
putchar(' ');
} else
printf(" ");
}
assert(NULL == h->metaf);
if (HTMLFONT_NONE != h->metac)
h->metaf = HTMLFONT_BOLD == h->metac ?
print_otag(h, TAG_B, 0, NULL) :
print_otag(h, TAG_I, 0, NULL);
assert(word);
if ( ! print_encode(h, word, 0))
if ( ! (h->flags & HTML_NONOSPACE))
h->flags &= ~HTML_NOSPACE;
if (h->metaf) {
print_tagq(h, h->metaf);
h->metaf = NULL;
}
h->flags &= ~HTML_IGNDELIM;
}
示例6: man_root_post
/* ARGSUSED */
static void
man_root_post(MAN_ARGS)
{
struct htmlpair tag[3];
struct tag *t, *tt;
PAIR_SUMMARY_INIT(&tag[0], "Document Footer");
PAIR_CLASS_INIT(&tag[1], "foot");
PAIR_INIT(&tag[2], ATTR_WIDTH, "100%");
t = print_otag(h, TAG_TABLE, 3, tag);
PAIR_INIT(&tag[0], ATTR_WIDTH, "50%");
print_otag(h, TAG_COL, 1, tag);
print_otag(h, TAG_COL, 1, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
PAIR_CLASS_INIT(&tag[0], "foot-date");
print_otag(h, TAG_TD, 1, tag);
assert(man->date);
print_text(h, man->date);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag[0], "foot-os");
PAIR_INIT(&tag[1], ATTR_ALIGN, "right");
print_otag(h, TAG_TD, 2, tag);
if (man->source)
print_text(h, man->source);
print_tagq(h, t);
}
示例7: eqn_box
static void
eqn_box(struct html *p, const struct eqn_box *bp)
{
struct tag *t;
t = EQNFONT_NONE == bp->font ? NULL :
print_otag(p, fontmap[(int)bp->font], 0, NULL);
if (bp->left)
print_text(p, bp->left);
if (bp->text)
print_text(p, bp->text);
if (bp->first)
eqn_box(p, bp->first);
if (NULL != t)
print_tagq(p, t);
if (bp->right)
print_text(p, bp->right);
if (bp->next)
eqn_box(p, bp->next);
}
示例8: man_root_pre
static void
man_root_pre(MAN_ARGS)
{
struct tag *t, *tt;
char *title;
assert(man->title);
assert(man->msec);
mandoc_asprintf(&title, "%s(%s)", man->title, man->msec);
t = print_otag(h, TAG_TABLE, "c", "head");
tt = print_otag(h, TAG_TR, "");
print_otag(h, TAG_TD, "c", "head-ltitle");
print_text(h, title);
print_stagq(h, tt);
print_otag(h, TAG_TD, "c", "head-vol");
if (NULL != man->vol)
print_text(h, man->vol);
print_stagq(h, tt);
print_otag(h, TAG_TD, "c", "head-rtitle");
print_text(h, title);
print_tagq(h, t);
free(title);
}
示例9: mdoc_fa_pre
static int
mdoc_fa_pre(MDOC_ARGS)
{
const struct roff_node *nn;
struct tag *t;
if (n->parent->tok != MDOC_Fo) {
print_otag(h, TAG_VAR, "cT", "Fa");
return 1;
}
for (nn = n->child; nn; nn = nn->next) {
t = print_otag(h, TAG_VAR, "cT", "Fa");
print_text(h, nn->string);
print_tagq(h, t);
if (nn->next) {
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
}
if (n->child && n->next && n->next->tok == MDOC_Fa) {
h->flags |= HTML_NOSPACE;
print_text(h, ",");
}
return 0;
}
示例10: man_root_pre
static void
man_root_pre(MAN_ARGS)
{
struct htmlpair tag;
struct tag *t, *tt;
char *title;
assert(man->title);
assert(man->msec);
mandoc_asprintf(&title, "%s(%s)", man->title, man->msec);
PAIR_CLASS_INIT(&tag, "head");
t = print_otag(h, TAG_TABLE, 1, &tag);
print_otag(h, TAG_TBODY, 0, NULL);
tt = print_otag(h, TAG_TR, 0, NULL);
PAIR_CLASS_INIT(&tag, "head-ltitle");
print_otag(h, TAG_TD, 1, &tag);
print_text(h, title);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag, "head-vol");
print_otag(h, TAG_TD, 1, &tag);
if (NULL != man->vol)
print_text(h, man->vol);
print_stagq(h, tt);
PAIR_CLASS_INIT(&tag, "head-rtitle");
print_otag(h, TAG_TD, 1, &tag);
print_text(h, title);
print_tagq(h, t);
free(title);
}
示例11: print_tblclose
void
print_tblclose(struct html *h)
{
assert(h->tblt);
print_tagq(h, h->tblt);
h->tblt = NULL;
}
示例12: man_alt_pre
static int
man_alt_pre(MAN_ARGS)
{
const struct man_node *nn;
int i, savelit;
enum htmltag fp;
struct tag *t;
if ((savelit = mh->fl & MANH_LITERAL))
print_otag(h, TAG_BR, 0, NULL);
mh->fl &= ~MANH_LITERAL;
for (i = 0, nn = n->child; nn; nn = nn->next, i++) {
t = NULL;
switch (n->tok) {
case MAN_BI:
fp = i % 2 ? TAG_I : TAG_B;
break;
case MAN_IB:
fp = i % 2 ? TAG_B : TAG_I;
break;
case MAN_RI:
fp = i % 2 ? TAG_I : TAG_MAX;
break;
case MAN_IR:
fp = i % 2 ? TAG_MAX : TAG_I;
break;
case MAN_BR:
fp = i % 2 ? TAG_MAX : TAG_B;
break;
case MAN_RB:
fp = i % 2 ? TAG_B : TAG_MAX;
break;
default:
abort();
/* NOTREACHED */
}
if (i)
h->flags |= HTML_NOSPACE;
if (TAG_MAX != fp)
t = print_otag(h, fp, 0, NULL);
print_man_node(man, nn, mh, h);
if (t)
print_tagq(h, t);
}
if (savelit)
mh->fl |= MANH_LITERAL;
return(0);
}
示例13: print_paragraph
void
print_paragraph(struct html *h)
{
struct tag *t;
struct htmlpair tag;
PAIR_CLASS_INIT(&tag, "spacer");
t = print_otag(h, TAG_DIV, 1, &tag);
print_tagq(h, t);
}
示例14: print_tbl
void
print_tbl(struct html *h, const struct tbl_span *sp)
{
const struct tbl_head *hp;
const struct tbl_dat *dp;
struct htmlpair tag;
struct tag *tt;
/* Inhibit printing of spaces: we do padding ourselves. */
if (NULL == h->tblt)
html_tblopen(h, sp);
assert(h->tblt);
h->flags |= HTML_NONOSPACE;
h->flags |= HTML_NOSPACE;
tt = print_otag(h, TAG_TR, 0, NULL);
switch (sp->pos) {
case (TBL_SPAN_HORIZ):
/* FALLTHROUGH */
case (TBL_SPAN_DHORIZ):
PAIR_INIT(&tag, ATTR_COLSPAN, "0");
print_otag(h, TAG_TD, 1, &tag);
break;
default:
dp = sp->first;
for (hp = sp->head; hp; hp = hp->next) {
print_stagq(h, tt);
print_otag(h, TAG_TD, 0, NULL);
if (NULL == dp)
break;
if (TBL_CELL_DOWN != dp->layout->pos)
if (dp->string)
print_text(h, dp->string);
dp = dp->next;
}
break;
}
print_tagq(h, tt);
h->flags &= ~HTML_NONOSPACE;
if (TBL_SPAN_LAST & sp->flags) {
assert(h->tbl.cols);
free(h->tbl.cols);
h->tbl.cols = NULL;
print_tblclose(h);
}
}
示例15: print_tbl
void
print_tbl(struct html *h, const struct tbl_span *sp)
{
const struct tbl_dat *dp;
struct htmlpair tag;
struct tag *tt;
int ic;
/* Inhibit printing of spaces: we do padding ourselves. */
if (h->tblt == NULL)
html_tblopen(h, sp);
assert(h->tblt);
h->flags |= HTML_NONOSPACE;
h->flags |= HTML_NOSPACE;
tt = print_otag(h, TAG_TR, 0, NULL);
switch (sp->pos) {
case TBL_SPAN_HORIZ:
case TBL_SPAN_DHORIZ:
PAIR_INIT(&tag, ATTR_COLSPAN, "0");
print_otag(h, TAG_TD, 1, &tag);
break;
default:
dp = sp->first;
for (ic = 0; ic < sp->opts->cols; ic++) {
print_stagq(h, tt);
print_otag(h, TAG_TD, 0, NULL);
if (dp == NULL || dp->layout->col > ic)
continue;
if (dp->layout->pos != TBL_CELL_DOWN)
if (dp->string != NULL)
print_text(h, dp->string);
dp = dp->next;
}
break;
}
print_tagq(h, tt);
h->flags &= ~HTML_NONOSPACE;
if (sp->next == NULL) {
assert(h->tbl.cols);
free(h->tbl.cols);
h->tbl.cols = NULL;
print_tblclose(h);
}
}