• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ putp函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中putp函数的典型用法代码示例。如果您正苦于以下问题:C++ putp函数的具体用法?C++ putp怎么用?C++ putp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了putp函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main() {
  setupterm(NULL, 1, NULL);
  const char* setf = tigetstr("setaf");
  //  putp(setf);
  const char* red = tparm(setf, 1);
  putp(red);
  printf("whooo!\n");
  return 1;
}
开发者ID:crowejoshua,项目名称:markdown-to-terminal,代码行数:9,代码来源:cursesdemo.c


示例2: PrintBuffer9pin

/* ---------------------------------------------
   function PrintBuffer9pin().print  data  in buffer.
   include left-right trim  functions to  fasten
   graphic print. In text mode the printer print
   nothing when it reaches blank (' ').
   -------------------------------------------- */
void PrintBuffer9pin(unsigned char c[])
{
      extern int maxdot ;
      register int i;
      int left,right,length;
      charwidth(c)      ; /* alternate character width in cpi.obj */
      left = ltrim(c,0,maxdot);
      right = rtrim(c,0,maxdot);
      for(i=0; i<left; i++)
         putp(' ');       /* text mode */
      length = right - (left * 24)  ;
      if(length != 0){
         PrinterSetGraphicMode9pinQuadrupleDensity(length);
         for(i=0;i< length ; i++) {
            putp(c[(left * 24) + i]);   /* graphic (bit image) print */
         }
      }
}
开发者ID:kytulendu,项目名称:CW141,代码行数:24,代码来源:PRTG.C


示例3: reset_scroll_region

static void
reset_scroll_region(void)
/* Set the scroll-region to a known state (the default) */
{
    if (change_scroll_region) {
	TPUTS_TRACE("change_scroll_region");
	putp(tparm(change_scroll_region, 0, screen_lines - 1));
    }
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:9,代码来源:lib_mvcur.c


示例4: lower_left

/*
 * Below are the functions which perform all the 
 * terminal-specific screen manipulation.
 */

int short_file;				/* if file less than a screen */
void
lower_left(void)
{
	if (short_file) {
		putchar('\r');
		fflush(stdout);
	} else
		putp(sc_lower_left);
}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:15,代码来源:screen.c


示例5: cls

 void cls()
 {
     if (!cur_term)
     {
         int result;
         setupterm( NULL, STDOUT_FILENO, &result );
         if (result <= 0) return;
     }
     putp( tigetstr( "clear" ) );
 }
开发者ID:BeenEncoded,项目名称:Simple-Task-List-Program,代码行数:10,代码来源:iofunctions.cpp


示例6: beep

int beep(void)
{
	int res = ERR;

	T((T_CALLED("beep()")));

	/* FIXME: should make sure that we are not in altchar mode */
	if (bell) {
		TPUTS_TRACE("bell");
		res = putp(bell);
		fflush(SP->_ofp);
	} else if (flash_screen) {
		TPUTS_TRACE("flash_screen");
		res = putp(flash_screen);
		fflush(SP->_ofp);
	}

	returnCode(res);
}
开发者ID:aunali1,项目名称:exopc,代码行数:19,代码来源:lib_beep.c


示例7: curses_off

static void
curses_off()
{
	if ((is_curses_on == TRUE) && (opts.o_outpmode & OPT_TERMCAP)) {
		(void) putp(t_rmcup);
		(void) endwin();
		is_curses_on = FALSE;
	}
	(void) fflush(stdout);
}
开发者ID:andreiw,项目名称:polaris,代码行数:10,代码来源:prstat.c


示例8: enable_xterm_mouse

static void
enable_xterm_mouse(SCREEN *sp, int enable)
{
#if USE_EMX_MOUSE
    sp->_emxmouse_activated = enable;
#else
    putp(TPARM_1(sp->_mouse_xtermcap, enable));
#endif
    sp->_mouse_active = enable;
}
开发者ID:StarchLinux,项目名称:ncurses,代码行数:10,代码来源:lib_mouse.c


示例9: learn_map

/* Learn a single map. */
static void learn_map(map_t *mode) {
  sequence_t *current, *before_insert;
  size_t i;

  printf("Starting mode %s (press Control R to restart)\n", mode->name);
  if (mode->esc_seq_enter != NULL) {
    putp(mode->esc_seq_enter);
  }

  fflush(stdout);
  if (option_auto_learn) {
    usleep(100000);
  }

  for (i = 0; i < SIZEOF(modifiers); i++) {
    before_insert = head;
    if (getkeys(keynames, SIZEOF(keynames), i) < 0) {
      printf("\nRestarting...\n");
      goto skip;
    }
    if (getkeys(functionkeys, maxfkeys, i) < 0) {
      printf("\nRestarting...\n");
      goto skip;
    }

    if (!option_auto_learn && !confirm("Are you satisfied with the above keys [y/n]")) {
    skip:
      while (head != before_insert) {
        current = head;
        head = current->next;
        free(current);
      }
      i--;
    }
  }

  mode->sequences = reverse_key_list(head);
  head = NULL;

  if (mode->esc_seq_leave != NULL) {
    putp(mode->esc_seq_leave);
  }
}
开发者ID:gphalkes,项目名称:t3key,代码行数:44,代码来源:t3learnkeys.c


示例10: slk_intern_refresh

/*
 * Write the soft labels to the soft-key window.
 */
static void
slk_intern_refresh(SLK * slk)
{
    int i;
    int fmt = SP->slk_format;

    for (i = 0; i < slk->labcnt; i++) {
        if (slk->dirty || slk->ent[i].dirty) {
            if (slk->ent[i].visible) {
                if (num_labels > 0 && SLK_STDFMT(fmt)) {
                    if (i < num_labels) {
                        TPUTS_TRACE("plab_norm");
                        putp(TPARM_2(plab_norm, i + 1, slk->ent[i].form_text));
                    }
                } else {
                    if (fmt == 4)
                        slk_paint_info(slk->win);
                    wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].ent_x);
                    if (SP->_slk) {
                        wattrset(slk->win, AttrOf(SP->_slk->attr));
                    }
                    waddstr(slk->win, slk->ent[i].form_text);
                    /* if we simulate SLK's, it's looking much more
                       natural to use the current ATTRIBUTE also
                       for the label window */
                    wattrset(slk->win, WINDOW_ATTRS(stdscr));
                }
            }
            slk->ent[i].dirty = FALSE;
        }
    }
    slk->dirty = FALSE;

    if (num_labels > 0) {
        if (slk->hidden) {
            TPUTS_TRACE("label_off");
            putp(label_off);
        } else {
            TPUTS_TRACE("label_on");
            putp(label_on);
        }
    }
}
开发者ID:sofuture,项目名称:bitrig,代码行数:46,代码来源:lib_slkrefr.c


示例11: NCURSES_SP_NAME

NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0)
{
    int res = ERR;

    T((T_CALLED("flash()")));

    /* FIXME: should make sure that we are not in altchar mode */
    if (flash_screen) {
	TPUTS_TRACE("flash_screen");
	res = putp(flash_screen);
	_nc_flush();
    } else if (bell) {
	TPUTS_TRACE("bell");
	res = putp(bell);
	_nc_flush();
    }

    returnCode(res);
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-ncurses,代码行数:19,代码来源:lib_flash.c


示例12: curses_on

static void
curses_on()
{
	if ((opts.o_outpmode & OPT_TERMCAP) && (is_curses_on == FALSE)) {
		(void) initscr();
		(void) nonl();
		(void) putp(t_smcup);
		is_curses_on = TRUE;
	}
}
开发者ID:andreiw,项目名称:polaris,代码行数:10,代码来源:prstat.c


示例13: console_init

/*-----------------------------------------------------------------------------------*/
void
console_init(void)
{
  /* mouse support is ncurses-specific */
#ifdef NCURSES_MOUSE_VERSION
  mmask_t oldmask;
#endif
  static unsigned char done;
  int bg, fg;

  if(done) {
    return;
  }
  done = 1;

  initscr();
  start_color();
  cbreak();

  /* don't echo typed characters */
  noecho();
  /* disable return -> newline translation */
  nonl();

  /* hide text cursor, CTK draws its own */
  curs_set(0);

  intrflush(stdscr, FALSE);
  keypad(stdscr, TRUE);

#ifdef NCURSES_MOUSE_VERSION
  /* done here because ctk_mouse_init() is called before anyway */
  mousemask(ALL_MOUSE_EVENTS, &oldmask);
#endif

  screensize(&width, &height);

  /* we must declare all possible color pairs */
  for(fg = 0; fg < 8; fg++) {
    for(bg = 0; bg < 8; bg++) {
      init_pair(MKPAIR(bg, fg), fg, bg);
    }
  }

  /* set window title */
  putp("\033]0;Contiki\a");

  /* don't block on read, just timeout 1ms */
  timeout(1);

  /* make sure we return the terminal in a clean state */
  signal(SIGINT, ctrlhandler);
  atexit(console_exit);
}
开发者ID:agx,项目名称:osd-contiki,代码行数:55,代码来源:ctk-curses.c


示例14: slk_intern_refresh

/*
 * Write the soft labels to the soft-key window.
 */
static void
slk_intern_refresh(SLK * slk)
{
    int i;
    int fmt = SP->slk_format;

    for (i = 0; i < slk->labcnt; i++) {
	if (slk->dirty || slk->ent[i].dirty) {
	    if (slk->ent[i].visible) {
		if (num_labels > 0 && SLK_STDFMT(fmt)) {
		    if (i < num_labels) {
			TPUTS_TRACE("plab_norm");
			putp(tparm(plab_norm, i + 1, slk->ent[i].form_text));
		    }
		} else {
		    wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].x);
		    if (SP && SP->_slk)
			wattrset(slk->win, SP->_slk->attr);
		    waddnstr(slk->win, slk->ent[i].form_text,
			     MAX_SKEY_LEN(fmt));
		    /* if we simulate SLK's, it's looking much more
		       natural to use the current ATTRIBUTE also
		       for the label window */
		    wattrset(slk->win, stdscr->_attrs);
		}
	    }
	    slk->ent[i].dirty = FALSE;
	}
    }
    slk->dirty = FALSE;

    if (num_labels > 0) {
	if (slk->hidden) {
	    TPUTS_TRACE("label_off");
	    putp(label_off);
	} else {
	    TPUTS_TRACE("label_on");
	    putp(label_on);
	}
    }
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:44,代码来源:lib_slkrefr.c


示例15: voce_perdeu

void voce_perdeu(){
	setupterm(NULL, STDOUT_FILENO, NULL);
	putp(tparm(set_a_foreground, 1));
	printf("\n");
	printf("#            #######   ##########   #########\n");
	printf("#           ##     ##   #           #        \n");
	printf("#          ##       ##   #          #        \n");
	printf("#         ##         ##    ####     #####    \n");
	printf("#          ##       ##          #   #        \n");
	printf("#           ##     ##          #    #        \n");
	printf("#######      #######     ######     #########\n");
}
开发者ID:arthurhoch,项目名称:homeworks,代码行数:12,代码来源:Jogo_Senha.cpp


示例16: outputcap

static int
outputcap(char *cap, int argc, char **argv)
{
	int parmset = 0;
	char *thisstr;
	int i;

	if ((i = tigetflag(cap)) >= 0)
		return (1 - i);

	if ((i = tigetnum(cap)) >= -1) {
		(void) printf("%d\n", i);
		return (0);
	}

	if ((thisstr = tigetstr(cap)) != (char *)-1) {
		if (!thisstr) {
			return (1);
		}
		for (parmset = 0; optind < argc; optind++, parmset++)
			if (allnumeric(argv[optind]))
				parm[parmset] = atoi(argv[optind]);
			else
				parm[parmset] = (int)argv[optind];

		if (parmset)
			putp(tparm(thisstr,
			parm[0], parm[1], parm[2], parm[3], parm[4], parm[5],
			parm[6], parm[7], parm[8]));
		else
			putp(thisstr);
		return (0);
	}

	(void) fprintf(stderr,
	    gettext("%s: unknown terminfo capability '%s'\n"), progname, cap);

	exit(4);
	/* NOTREACHED */
}
开发者ID:andreiw,项目名称:polaris,代码行数:40,代码来源:tput.c


示例17: my_set_term

int	my_set_term()
{
  int	err;
  int	ret;
  char	*s;

  if ((err = setupterm(NULL, 1, &ret)) == ERR)
    return (1);
  if ((s = tigetstr("smkx")) == (char *)-1)
    return (2);
  putp(s);
  return (0);
}
开发者ID:MarcBrout,项目名称:tetris,代码行数:13,代码来源:recup_env.c


示例18: init_pair

/*
 * Extension (1997/1/18) - Allow negative f/b values to set default color
 * values.
 */
int init_pair(short pair, short f, short b)
{
	T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));

	if ((pair < 1) || (pair >= COLOR_PAIRS))
		returnCode(ERR);
	if (SP->_default_color)
	{
		if (f < 0)
			f = C_MASK;
		if (b < 0)
			b = C_MASK;
		if (f >= COLORS && f != C_MASK)
			returnCode(ERR);
		if (b >= COLORS && b != C_MASK)
			returnCode(ERR);
	}
	else
	if ((f < 0) || (f >= COLORS)
	 || (b < 0) || (b >= COLORS))
		returnCode(ERR);

	/*
	 * FIXME: when a pair's content is changed, replace its colors
	 * (if pair was initialized before a screen update is performed
	 * replacing original pair colors with the new ones)
	 */

	SP->_color_pairs[pair] = PAIR_OF(f,b);

	if (initialize_pair)
	{
	    const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette;

	    T(("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
	       pair,
	       tp[f].red, tp[f].green, tp[f].blue,
	       tp[b].red, tp[b].green, tp[b].blue));

	    if (initialize_pair)
	    {
		TPUTS_TRACE("initialize_pair");
		putp(tparm(initialize_pair,
			    pair,
			    tp[f].red, tp[f].green, tp[f].blue,
			    tp[b].red, tp[b].green, tp[b].blue));
	    }
	}

	returnCode(OK);
}
开发者ID:vocho,项目名称:openqnx,代码行数:55,代码来源:lib_color.c


示例19: use_terminfo_color

int use_terminfo_color(int ansicolor,int boldp){
	if(use_terminfo){
		const char *attrstr = boldp ? "bold" : "sgr0";
		const char *color,*attr;
		char *setaf;

		if((attr = tigetstr(attrstr)) == NULL){
			bitch("Couldn't get terminfo %s\n",attrstr);
			return -1;
		}
		putp(attr);
		if((setaf = tigetstr("setaf")) == NULL){
			bitch("Couldn't get terminfo setaf\n");
			return -1;
		}
		if((color = tparm(setaf,ansicolor)) == NULL){
			bitch("Couldn't get terminfo color %d\n",ansicolor);
			return -1;
		}
		putp(color);
	}
	return 0;
}
开发者ID:dankamongmen,项目名称:libdank,代码行数:23,代码来源:color.c


示例20: tty_vmsg

int tty_vmsg( const char *fmt, va_list ap )
{
	int r;

	putchar(13);
	putp( tcap.clreol );
	r = vprintf( fmt, ap );
	rl_on_new_line();

	if(! RL_ISSTATE(RL_STATE_DONE) )
		rl_redisplay();

	return r;
}
开发者ID:rclasen,项目名称:dudlc,代码行数:14,代码来源:tty.c



注:本文中的putp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ putpad函数代码示例发布时间:2022-05-30
下一篇:
C++ putnext函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap