本文整理汇总了C++中putp函数的典型用法代码示例。如果您正苦于以下问题:C++ putp函数的具体用法?C++ putp怎么用?C++ putp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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 */
}
}
}
示例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));
}
}
示例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);
}
示例5: cls
void cls()
{
if (!cur_term)
{
int result;
setupterm( NULL, STDOUT_FILENO, &result );
if (result <= 0) return;
}
putp( tigetstr( "clear" ) );
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
}
}
示例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");
}