本文整理汇总了C++中print_text函数的典型用法代码示例。如果您正苦于以下问题:C++ print_text函数的具体用法?C++ print_text怎么用?C++ print_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_text函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mdoc_ap_pre
static int
mdoc_ap_pre(MDOC_ARGS)
{
h->flags |= HTML_NOSPACE;
print_text(h, "\\(aq");
h->flags |= HTML_NOSPACE;
return(1);
}
示例2: print
/* parent depends on dep which is satisfied by pkg */
static void print(const char *parentname, const char *pkgname,
const char *depname, tdepth *depth, int last)
{
if(graphviz) {
print_graph(parentname, pkgname, depname);
} else {
print_text(pkgname, depname, depth, last);
}
}
示例3: mdoc_in_pre
static int
mdoc_in_pre(MDOC_ARGS)
{
struct tag *t;
synopsis_pre(h, n);
print_otag(h, TAG_CODE, "cT", "In");
/*
* The first argument of the `In' gets special treatment as
* being a linked value. Subsequent values are printed
* afterward. groff does similarly. This also handles the case
* of no children.
*/
if (NODE_SYNPRETTY & n->flags && NODE_LINE & n->flags)
print_text(h, "#include");
print_text(h, "<");
h->flags |= HTML_NOSPACE;
if (NULL != (n = n->child)) {
assert(n->type == ROFFT_TEXT);
if (h->base_includes)
t = print_otag(h, TAG_A, "cThI", "In", n->string);
else
t = print_otag(h, TAG_A, "cT", "In");
print_text(h, n->string);
print_tagq(h, t);
n = n->next;
}
h->flags |= HTML_NOSPACE;
print_text(h, ">");
for ( ; n; n = n->next) {
assert(n->type == ROFFT_TEXT);
print_text(h, n->string);
}
return 0;
}
示例4: store_continuation
static void store_continuation(struct tid_data *tid,
const uint8_t *data, uint16_t size)
{
if (size > MAX_CONT_SIZE) {
print_text(COLOR_ERROR, "invalid continuation size");
return;
}
memcpy(tid->cont, data, size);
print_continuation(data, size);
}
示例5: print_text1
/*----------------------------------------------------------------------
printf style formatting with one arg for printer
Args: line -- The printf control string
a1 -- The 1st argument for printf
----*/
void
print_text1(char *line, char *a1)
{
char buf[64000];
if(!ps_global->print->err && snprintf(buf, sizeof(buf), line, a1) < 0)
ps_global->print->err = 1;
else
print_text(buf);
}
示例6: whatnow
/* If flag = 0 (default): check if s existed in 1.39.15 and print verbosely
* the answer.
* If flag > 0: silently return n+1 if function changed, 0 otherwise.
* (where n is the index of s in whatnowlist).
* If flag < 0: -flag-1 is the index in whatnowlist
*/
int
whatnow(char *s, int flag)
{
int n;
char *def;
whatnow_t wp;
entree *ep;
if (flag < 0) { n = -flag; flag = 0; }
else
{
if (flag && strlen(s)==1) return 0; /* special case "i" and "o" */
if (!is_identifier(s) || !is_entry_intern(s,funct_old_hash,NULL))
{
if (flag) return 0;
pari_err(talker,"as far as I can recall, this function never existed");
}
n = 0;
do
def = (oldfonctions[n++]).name;
while (def && strcmp(def,s));
if (!def)
{
int m=0;
do
def = (functions_oldgp[m++]).name;
while (def && strcmp(def,s));
n += m - 1;
}
}
wp=whatnowlist[n-1]; def=wp.name;
if (def == SAME)
{
if (flag) return 0;
pari_err(talker,"this function did not change");
}
if (flag) return n;
if (def == REMOV)
pari_err(talker,"this function was suppressed");
if (!strcmp(def,"x*y"))
{
pariprintf(" %s is now called *.\n\n",s);
pariprintf(" %s%s ===> %s%s\n\n",s,wp.oldarg,wp.name,wp.newarg);
return 1;
}
ep = is_entry(wp.name);
if (!ep) pari_err(bugparier,"whatnow");
pariputs("New syntax: "); term_color(c_ERR);
pariprintf("%s%s ===> %s%s\n\n",s,wp.oldarg,wp.name,wp.newarg);
term_color(c_HELP);
print_text(ep->help); pariputc('\n');
term_color(c_NONE); return 1;
}
示例7: 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);
}
}
示例8: print_continuation
static void print_continuation(const uint8_t *data, uint16_t size)
{
if (data[0] != size - 1) {
print_text(COLOR_ERROR, "invalid continuation state");
packet_hexdump(data, size);
return;
}
print_field("Continuation state: %d", data[0]);
packet_hexdump(data + 1, size - 1);
}
示例9: print_man_head
static void
print_man_head(MAN_ARGS)
{
char *cp;
print_gen_head(h);
mandoc_asprintf(&cp, "%s(%s)", man->title, man->msec);
print_otag(h, TAG_TITLE, "");
print_text(h, cp);
free(cp);
}
示例10: 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);
}
}
示例11: print_man_head
static void
print_man_head(MAN_ARGS)
{
print_gen_head(h);
assert(man->title);
assert(man->msec);
bufcat_fmt(h, "%s(%s)", man->title, man->msec);
print_otag(h, TAG_TITLE, 0, NULL);
print_text(h, h->buf);
}
示例12: mdoc_nd_pre
static int
mdoc_nd_pre(MDOC_ARGS)
{
if (n->type != ROFFT_BODY)
return 1;
print_text(h, "\\(em");
/* Cannot use TAG_SPAN because it may contain blocks. */
print_otag(h, TAG_DIV, "cT", "Nd");
return 1;
}
示例13: data_packet
static void data_packet(const void *data, uint8_t size)
{
const uint8_t *ptr = data;
uint8_t llid, length;
bool nesn, sn, md;
const char *str;
if (size < 2) {
print_text(COLOR_ERROR, "packet too short");
packet_hexdump(data, size);
return;
}
llid = ptr[0] & 0x03;
nesn = !!(ptr[0] & 0x04);
sn = !!(ptr[0] & 0x08);
md = !!(ptr[0] & 0x10);
length = ptr[1] & 0x1f;
switch (llid) {
case 0x01:
if (length > 0)
str = "Continuation fragement of L2CAP message";
else
str = "Empty message";
break;
case 0x02:
str = "Start of L2CAP message";
break;
case 0x03:
str = "Control";
break;
default:
str = "Reserved";
break;
}
print_field("LLID: %s (0x%2.2x)", str, llid);
print_field("Next expected sequence number: %u", nesn);
print_field("Sequence number: %u", sn);
print_field("More data: %u", md);
print_field("Length: %u", length);
switch (llid) {
case 0x03:
llcp_packet(data + 2, size - 2);
break;
default:
packet_hexdump(data + 2, size - 2);
break;
}
}
示例14: verifier
int verifier(int nb_a_verifier){
int nbmodifiable=nb_a_verifier;
while((nbmodifiable<1)||(nbmodifiable>10000)){
print_text("Fais pas chier rentres un nombre valable ");
print_newline();
print_newline();
nbmodifiable=read_int();
print_newline();}
return nbmodifiable;}
示例15: comparer
bool comparer(int nombre_a_comparer, int nb_genere_aleatoirement){
bool gagne_ou_pas;
if(nb_genere_aleatoirement < nombre_a_comparer){
print_text("Le nombre mysterieux est plus petit que le nombre entré");
print_newline();
print_newline();
gagne_ou_pas=false;}
else if(nb_genere_aleatoirement > nombre_a_comparer){
print_text("Le nombre mysterieux est plus grand que le nombre entré");
print_newline();
print_newline();
gagne_ou_pas=false;}
else{
print_text("Vous avez gagné");
print_newline();
print_newline();
gagne_ou_pas=true;}
return gagne_ou_pas;}