这篇教程C++ term_flushln函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中term_flushln函数的典型用法代码示例。如果您正苦于以下问题:C++ term_flushln函数的具体用法?C++ term_flushln怎么用?C++ term_flushln使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了term_flushln函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: termp_fn_pre/* ARGSUSED */static inttermp_fn_pre(DECL_ARGS){ size_t rmargin = 0; int pretty; pretty = MDOC_SYNPRETTY & n->flags; synopsis_pre(p, n); if (NULL == (n = n->child)) return(0); if (pretty) { rmargin = p->rmargin; p->rmargin = p->offset + term_len(p, 4); p->flags |= TERMP_NOBREAK | TERMP_HANG; } assert(MDOC_TEXT == n->type); term_fontpush(p, TERMFONT_BOLD); term_word(p, n->string); term_fontpop(p); if (pretty) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); p->offset = p->rmargin; p->rmargin = rmargin; } p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; for (n = n->next; n; n = n->next) { assert(MDOC_TEXT == n->type); term_fontpush(p, TERMFONT_UNDER); if (pretty) p->flags |= TERMP_NBRWORD; term_word(p, n->string); term_fontpop(p); if (n->next) { p->flags |= TERMP_NOSPACE; term_word(p, ","); } } p->flags |= TERMP_NOSPACE; term_word(p, ")"); if (pretty) { p->flags |= TERMP_NOSPACE; term_word(p, ";"); term_flushln(p); } return(0);}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:61,
示例2: termp_nm_post/* ARGSUSED */static voidtermp_nm_post(DECL_ARGS){ if (MDOC_BLOCK == n->type) { p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } else if (MDOC_HEAD == n->type && n->next->child) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); p->trailspace = 0; } else if (MDOC_BODY == n->type && n->child) term_flushln(p);}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:14,
示例3: print_mdoc_footstatic voidprint_mdoc_foot(struct termp *p, const void *arg){ const struct mdoc_meta *meta; size_t sz; meta = (const struct mdoc_meta *)arg; term_fontrepl(p, TERMFONT_NONE); /* * Output the footer in new-groff style, that is, three columns * with the middle being the manual date and flanking columns * being the operating system: * * SYSTEM DATE SYSTEM */ term_vspace(p); p->offset = 0; sz = term_strlen(p, meta->date); p->rmargin = p->maxrmargin > sz ? (p->maxrmargin + term_len(p, 1) - sz) / 2 : 0; p->trailspace = 1; p->flags |= TERMP_NOSPACE | TERMP_NOBREAK; term_word(p, meta->os); term_flushln(p); p->offset = p->rmargin; sz = term_strlen(p, meta->os); p->rmargin = p->maxrmargin > sz ? p->maxrmargin - sz : 0; p->flags |= TERMP_NOSPACE; term_word(p, meta->date); term_flushln(p); p->offset = p->rmargin; p->rmargin = p->maxrmargin; p->trailspace = 0; p->flags &= ~TERMP_NOBREAK; p->flags |= TERMP_NOSPACE; term_word(p, meta->os); term_flushln(p); p->offset = 0; p->rmargin = p->maxrmargin; p->flags = 0;}
开发者ID:jashank,项目名称:freebsd,代码行数:51,
示例4: termp_nm_poststatic voidtermp_nm_post(DECL_ARGS){ if (n->type == ROFFT_BLOCK) { p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } else if (n->type == ROFFT_HEAD && NULL != n->next && NULL != n->next->child) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->trailspace = 0; } else if (n->type == ROFFT_BODY && n->child != NULL) term_flushln(p);}
开发者ID:gokzy,项目名称:netbsd-src,代码行数:14,
示例5: roff_term_pre_cestatic voidroff_term_pre_ce(ROFF_TERM_ARGS){ const struct roff_node *nc1, *nc2; roff_term_pre_br(p, n); p->flags |= n->tok == ROFF_ce ? TERMP_CENTER : TERMP_RIGHT; nc1 = n->child->next; while (nc1 != NULL) { nc2 = nc1; do { nc2 = nc2->next; } while (nc2 != NULL && (nc2->type != ROFFT_TEXT || (nc2->flags & NODE_LINE) == 0)); while (nc1 != nc2) { if (nc1->type == ROFFT_TEXT) term_word(p, nc1->string); else roff_term_pre(p, nc1); nc1 = nc1->next; } p->flags |= TERMP_NOSPACE; term_flushln(p); } p->flags &= ~(TERMP_CENTER | TERMP_RIGHT);}
开发者ID:jaredmcneill,项目名称:netbsd-src,代码行数:26,
示例6: term_newln/* * A newline only breaks an existing line; it won't assert vertical * space. All data in the output buffer is flushed prior to the newline * assertion. */voidterm_newln(struct termp *p){ p->flags |= TERMP_NOSPACE; if (p->col || p->viscol) term_flushln(p);}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:13,
示例7: tbl_hframestatic voidtbl_hframe(struct termp *tp, const struct tbl_span *sp){ const struct tbl_head *hp; size_t width; if ( ! (TBL_OPT_BOX & sp->tbl->opts || TBL_OPT_DBOX & sp->tbl->opts)) return; /* * Print out the horizontal part of a frame or double frame. A * double frame has an unbroken `-' outer line the width of the * table, bordered by `+'. The frame (or inner frame, in the * case of the double frame) is a `-' bordered by `+' and broken * by `+' whenever a span is encountered. */ if (TBL_OPT_DBOX & sp->tbl->opts) { term_word(tp, "+"); for (hp = sp->head; hp; hp = hp->next) { width = tp->tbl.cols[hp->ident].width; tbl_char(tp, '-', width); } term_word(tp, "+"); term_flushln(tp); } term_word(tp, "+"); for (hp = sp->head; hp; hp = hp->next) { width = tp->tbl.cols[hp->ident].width; switch (hp->pos) { case (TBL_HEAD_DATA): tbl_char(tp, '-', width); break; default: tbl_char(tp, '+', width); break; } } term_word(tp, "+"); term_flushln(tp);}
开发者ID:AgamAgarwal,项目名称:minix,代码行数:43,
示例8: roff_term_pre_mcstatic voidroff_term_pre_mc(ROFF_TERM_ARGS){ if (p->col) { p->flags |= TERMP_NOBREAK; term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_NOSPACE); } if (n->child != NULL) { p->mc = n->child->string; p->flags |= TERMP_NEWMC; } else p->flags |= TERMP_ENDMC;}
开发者ID:jaredmcneill,项目名称:netbsd-src,代码行数:14,
示例9: tbl_hframe/* * Rules above and below the table are always single * and have an additional plus at the beginning and end. * For double frames, this function is called twice, * and the outer one does not have crossings. */static voidtbl_hframe(struct termp *tp, const struct tbl_span *sp, int outer){ const struct tbl_head *hp; term_word(tp, "+"); for (hp = sp->head; hp; hp = hp->next) { if (hp->prev && hp->vert) tbl_char(tp, (outer ? '-' : '+'), hp->vert); tbl_char(tp, '-', tbl_rulewidth(tp, hp)); } term_word(tp, "+"); term_flushln(tp);}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:20,
示例10: termp_fo_poststatic voidtermp_fo_post(DECL_ARGS){ if (n->type != ROFFT_BODY) return; p->flags |= TERMP_NOSPACE; term_word(p, ")"); if (MDOC_SYNPRETTY & n->flags) { p->flags |= TERMP_NOSPACE; term_word(p, ";"); term_flushln(p); }}
开发者ID:gokzy,项目名称:netbsd-src,代码行数:16,
示例11: post_TPstatic voidpost_TP(DECL_ARGS){ switch (n->type) { case ROFFT_HEAD: term_flushln(p); break; case ROFFT_BODY: term_newln(p); p->offset = mt->offset; break; default: break; }}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:16,
示例12: post_IPstatic voidpost_IP(DECL_ARGS){ switch (n->type) { case ROFFT_HEAD: term_flushln(p); p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; p->rmargin = p->maxrmargin; break; case ROFFT_BODY: term_newln(p); p->offset = mt->offset; break; default: break; }}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:19,
示例13: termp_fo_prestatic inttermp_fo_pre(DECL_ARGS){ size_t rmargin = 0; int pretty; pretty = MDOC_SYNPRETTY & n->flags; if (n->type == ROFFT_BLOCK) { synopsis_pre(p, n); return 1; } else if (n->type == ROFFT_BODY) { if (pretty) { rmargin = p->rmargin; p->rmargin = p->offset + term_len(p, 4); p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG; } p->flags |= TERMP_NOSPACE; term_word(p, "("); p->flags |= TERMP_NOSPACE; if (pretty) { term_flushln(p); p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG); p->offset = p->rmargin; p->rmargin = rmargin; } return 1; } if (NULL == n->child) return 0; /* XXX: we drop non-initial arguments as per groff. */ assert(n->child->string); term_fontpush(p, TERMFONT_BOLD); term_word(p, n->child->string); return 0;}
开发者ID:gokzy,项目名称:netbsd-src,代码行数:41,
示例14: termp_it_poststatic voidtermp_it_post(DECL_ARGS){ enum mdoc_list type; if (n->type == ROFFT_BLOCK) return; type = n->parent->parent->parent->norm->Bl.type; switch (type) { case LIST_item: case LIST_diag: case LIST_inset: if (n->type == ROFFT_BODY) term_newln(p); break; case LIST_column: if (n->type == ROFFT_BODY) term_flushln(p); break; default: term_newln(p); break; } /* * Now that our output is flushed, we can reset our tags. Since * only `It' sets these flags, we're free to assume that nobody * has munged them in the meanwhile. */ p->flags &= ~(TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND | TERMP_DANGLE | TERMP_HANG); p->trailspace = 0;}
开发者ID:gokzy,项目名称:netbsd-src,代码行数:36,
示例15: print_mdoc_headstatic voidprint_mdoc_head(struct termp *p, const struct roff_meta *meta){ char *volume, *title; size_t vollen, titlen; /* * The header is strange. It has three components, which are * really two with the first duplicated. It goes like this: * * IDENTIFIER TITLE IDENTIFIER * * The IDENTIFIER is NAME(SECTION), which is the command-name * (if given, or "unknown" if not) followed by the manual page * section. These are given in `Dt'. The TITLE is a free-form * string depending on the manual volume. If not specified, it * switches on the manual section. */ assert(meta->vol); if (NULL == meta->arch) volume = mandoc_strdup(meta->vol); else mandoc_asprintf(&volume, "%s (%s)", meta->vol, meta->arch); vollen = term_strlen(p, volume); if (NULL == meta->msec) title = mandoc_strdup(meta->title); else mandoc_asprintf(&title, "%s(%s)", meta->title, meta->msec); titlen = term_strlen(p, title); p->flags |= TERMP_NOBREAK | TERMP_NOSPACE; p->trailspace = 1; p->offset = 0; p->rmargin = 2 * (titlen+1) + vollen < p->maxrmargin ? (p->maxrmargin - vollen + term_len(p, 1)) / 2 : vollen < p->maxrmargin ? p->maxrmargin - vollen : 0; term_word(p, title); term_flushln(p); p->flags |= TERMP_NOSPACE; p->offset = p->rmargin; p->rmargin = p->offset + vollen + titlen < p->maxrmargin ? p->maxrmargin - titlen : p->maxrmargin; term_word(p, volume); term_flushln(p); p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; if (p->rmargin + titlen <= p->maxrmargin) { p->flags |= TERMP_NOSPACE; p->offset = p->rmargin; p->rmargin = p->maxrmargin; term_word(p, title); term_flushln(p); } p->flags &= ~TERMP_NOSPACE; p->offset = 0; p->rmargin = p->maxrmargin; free(title); free(volume);}
开发者ID:gokzy,项目名称:netbsd-src,代码行数:68,
示例16: termp_bd_prestatic inttermp_bd_pre(DECL_ARGS){ size_t tabwidth, lm, len, rm, rmax; struct roff_node *nn; int offset; if (n->type == ROFFT_BLOCK) { print_bvspace(p, n, n); return 1; } else if (n->type == ROFFT_HEAD) return 0; /* Handle the -offset argument. */ if (n->norm->Bd.offs == NULL || ! strcmp(n->norm->Bd.offs, "left")) /* nothing */; else if ( ! strcmp(n->norm->Bd.offs, "indent")) p->offset += term_len(p, p->defindent + 1); else if ( ! strcmp(n->norm->Bd.offs, "indent-two")) p->offset += term_len(p, (p->defindent + 1) * 2); else { offset = a2width(p, n->norm->Bd.offs); if (offset < 0 && (size_t)(-offset) > p->offset) p->offset = 0; else if (offset < SHRT_MAX) p->offset += offset; } /* * If -ragged or -filled are specified, the block does nothing * but change the indentation. If -unfilled or -literal are * specified, text is printed exactly as entered in the display: * for macro lines, a newline is appended to the line. Blank * lines are allowed. */ if (DISP_literal != n->norm->Bd.type && DISP_unfilled != n->norm->Bd.type && DISP_centered != n->norm->Bd.type) return 1; tabwidth = p->tabwidth; if (DISP_literal == n->norm->Bd.type) p->tabwidth = term_len(p, 8); lm = p->offset; rm = p->rmargin; rmax = p->maxrmargin; p->rmargin = p->maxrmargin = TERM_MAXMARGIN; for (nn = n->child; nn; nn = nn->next) { if (DISP_centered == n->norm->Bd.type) { if (nn->type == ROFFT_TEXT) { len = term_strlen(p, nn->string); p->offset = len >= rm ? 0 : lm + len >= rm ? rm - len : (lm + rm - len) / 2; } else p->offset = lm; } print_mdoc_node(p, pair, meta, nn); /* * If the printed node flushes its own line, then we * needn't do it here as well. This is hacky, but the * notion of selective eoln whitespace is pretty dumb * anyway, so don't sweat it. */ switch (nn->tok) { case MDOC_Sm: case MDOC_br: case MDOC_sp: case MDOC_Bl: case MDOC_D1: case MDOC_Dl: case MDOC_Lp: case MDOC_Pp: continue; default: break; } if (p->flags & TERMP_NONEWLINE || (nn->next && ! (nn->next->flags & MDOC_LINE))) continue; term_flushln(p); p->flags |= TERMP_NOSPACE; } p->tabwidth = tabwidth; p->rmargin = rm; p->maxrmargin = rmax; return 0;}
开发者ID:gokzy,项目名称:netbsd-src,代码行数:94,
示例17: termp_bd_pre/* ARGSUSED */static inttermp_bd_pre(DECL_ARGS){ size_t tabwidth, rm, rmax; struct mdoc_node *nn; if (MDOC_BLOCK == n->type) { print_bvspace(p, n, n); return(1); } else if (MDOC_HEAD == n->type) return(0); if (n->norm->Bd.offs) p->offset += a2offs(p, n->norm->Bd.offs); /* * If -ragged or -filled are specified, the block does nothing * but change the indentation. If -unfilled or -literal are * specified, text is printed exactly as entered in the display: * for macro lines, a newline is appended to the line. Blank * lines are allowed. */ if (DISP_literal != n->norm->Bd.type && DISP_unfilled != n->norm->Bd.type) return(1); tabwidth = p->tabwidth; if (DISP_literal == n->norm->Bd.type) p->tabwidth = term_len(p, 8); rm = p->rmargin; rmax = p->maxrmargin; p->rmargin = p->maxrmargin = TERM_MAXMARGIN; for (nn = n->child; nn; nn = nn->next) { print_mdoc_node(p, pair, meta, nn); /* * If the printed node flushes its own line, then we * needn't do it here as well. This is hacky, but the * notion of selective eoln whitespace is pretty dumb * anyway, so don't sweat it. */ switch (nn->tok) { case (MDOC_Sm): /* FALLTHROUGH */ case (MDOC_br): /* FALLTHROUGH */ case (MDOC_sp): /* FALLTHROUGH */ case (MDOC_Bl): /* FALLTHROUGH */ case (MDOC_D1): /* FALLTHROUGH */ case (MDOC_Dl): /* FALLTHROUGH */ case (MDOC_Lp): /* FALLTHROUGH */ case (MDOC_Pp): continue; default: break; } if (nn->next && nn->next->line == nn->line) continue; term_flushln(p); p->flags |= TERMP_NOSPACE; } p->tabwidth = tabwidth; p->rmargin = rm; p->maxrmargin = rmax; return(0);}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:75,
示例18: print_mdoc_headstatic voidprint_mdoc_head(struct termp *p, const void *arg){ char buf[BUFSIZ], title[BUFSIZ]; size_t buflen, titlen; const struct mdoc_meta *meta; meta = (const struct mdoc_meta *)arg; /* * The header is strange. It has three components, which are * really two with the first duplicated. It goes like this: * * IDENTIFIER TITLE IDENTIFIER * * The IDENTIFIER is NAME(SECTION), which is the command-name * (if given, or "unknown" if not) followed by the manual page * section. These are given in `Dt'. The TITLE is a free-form * string depending on the manual volume. If not specified, it * switches on the manual section. */ p->offset = 0; p->rmargin = p->maxrmargin; assert(meta->vol); strlcpy(buf, meta->vol, BUFSIZ); buflen = term_strlen(p, buf); if (meta->arch) { strlcat(buf, " (", BUFSIZ); strlcat(buf, meta->arch, BUFSIZ); strlcat(buf, ")", BUFSIZ); } snprintf(title, BUFSIZ, "%s(%s)", meta->title, meta->msec); titlen = term_strlen(p, title); p->flags |= TERMP_NOBREAK | TERMP_NOSPACE; p->trailspace = 1; p->offset = 0; p->rmargin = 2 * (titlen+1) + buflen < p->maxrmargin ? (p->maxrmargin - term_strlen(p, buf) + term_len(p, 1)) / 2 : p->maxrmargin - buflen; term_word(p, title); term_flushln(p); p->flags |= TERMP_NOSPACE; p->offset = p->rmargin; p->rmargin = p->offset + buflen + titlen < p->maxrmargin ? p->maxrmargin - titlen : p->maxrmargin; term_word(p, buf); term_flushln(p); p->flags &= ~TERMP_NOBREAK; p->trailspace = 0; if (p->rmargin + titlen <= p->maxrmargin) { p->flags |= TERMP_NOSPACE; p->offset = p->rmargin; p->rmargin = p->maxrmargin; term_word(p, title); term_flushln(p); } p->flags &= ~TERMP_NOSPACE; p->offset = 0; p->rmargin = p->maxrmargin;}
开发者ID:2015520,项目名称:SequoiaDB,代码行数:71,
示例19: term_tblvoidterm_tbl(struct termp *tp, const struct tbl_span *sp){ const struct tbl_head *hp; const struct tbl_dat *dp; struct roffcol *col; int spans; size_t rmargin, maxrmargin; rmargin = tp->rmargin; maxrmargin = tp->maxrmargin; tp->rmargin = tp->maxrmargin = TERM_MAXMARGIN; /* Inhibit printing of spaces: we do padding ourselves. */ tp->flags |= TERMP_NONOSPACE; tp->flags |= TERMP_NOSPACE; /* * The first time we're invoked for a given table block, * calculate the table widths and decimal positions. */ if (TBL_SPAN_FIRST & sp->flags) { term_flushln(tp); tp->tbl.len = term_tbl_len; tp->tbl.slen = term_tbl_strlen; tp->tbl.arg = tp; tblcalc(&tp->tbl, sp); } /* Horizontal frame at the start of boxed tables. */ if (TBL_SPAN_FIRST & sp->flags) { if (TBL_OPT_DBOX & sp->opts->opts) tbl_hframe(tp, sp, 1); if (TBL_OPT_DBOX & sp->opts->opts || TBL_OPT_BOX & sp->opts->opts) tbl_hframe(tp, sp, 0); } /* Vertical frame at the start of each row. */ if ((TBL_OPT_BOX | TBL_OPT_DBOX) & sp->opts->opts || sp->head->vert) term_word(tp, TBL_SPAN_HORIZ == sp->pos || TBL_SPAN_DHORIZ == sp->pos ? "+" : "|"); /* * Now print the actual data itself depending on the span type. * Spanner spans get a horizontal rule; data spanners have their * data printed by matching data to header. */ switch (sp->pos) { case TBL_SPAN_HORIZ: /* FALLTHROUGH */ case TBL_SPAN_DHORIZ: tbl_hrule(tp, sp); break; case TBL_SPAN_DATA: /* Iterate over template headers. */ dp = sp->first; spans = 0; for (hp = sp->head; hp; hp = hp->next) { /* * If the current data header is invoked during * a spanner ("spans" > 0), don't emit anything * at all. */ if (--spans >= 0) continue; /* Separate columns. */ if (NULL != hp->prev) tbl_vrule(tp, hp); col = &tp->tbl.cols[hp->ident]; tbl_data(tp, sp->opts, dp, col); /* * Go to the next data cell and assign the * number of subsequent spans, if applicable. */ if (dp) { spans = dp->spans; dp = dp->next; } } break; } /* Vertical frame at the end of each row. *///.........这里部分代码省略.........
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:101,
注:本文中的term_flushln函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ term_fontpush函数代码示例 C++ term函数代码示例 |