本文整理汇总了C++中putpad函数的典型用法代码示例。如果您正苦于以下问题:C++ putpad函数的具体用法?C++ putpad怎么用?C++ putpad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putpad函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pico_toggle_color
void
pico_toggle_color(int on)
{
if(on){
if(pico_hascolor())
_using_color = 1;
}
else{
_using_color = 0;
if(_color_inited){
_color_inited = 0;
if(!panicking())
free_color_table(&color_tbl);
if(ANSI_COLOR())
putpad("\033[39;49m");
else{
if(_op)
putpad(_op);
if(_oc)
putpad(_oc);
}
}
}
}
示例2: tcapclose
static void tcapclose(void)
{
putpad(tgoto(CM, 0, term.t_nrow));
putpad(TE);
tioflush();
tiorestore();
}
示例3: flip_ul
/*
* Start or end underline mode
*
* Result: escape sequence to go into or out of underline is output
*
* Arg state = ON set underline
* OFF set normal
*/
void
flip_ul(int state)
{
extern char *_setunderline, *_clearunderline;
if((pulstate = state) == TRUE){
if(_setunderline != NULL)
putpad(_setunderline);
}
else{
/*
* Unfortunately, some termcap entries configure end underline to
* be clear all attributes.
*/
if(_clearunderline != NULL){
if(!color_blasted_by_attrs)
color_blasted_by_attrs = pico_get_cur_color();
_force_fg_color_change = _force_bg_color_change = 1;
putpad(_clearunderline);
pboldstate = (pboldstate == FALSE) ? pboldstate : A_UNKNOWN;
pinvstate = (pinvstate == FALSE) ? pinvstate : A_UNKNOWN;
rev_color_state = A_UNKNOWN;
}
}
}
示例4: ttdell
/*
* Delete nchunk line(s) from "row", replacing the
* bottom line on the screen with a blank line.
* Unless we're using the scrolling region, this is
* done with a crafty sequences of insert and delete
* lines. The presence of the echo area makes a
* boundry condition go away.
*/
ttdell(row, bot, nchunk)
{
register int i, nl;
if (row == bot) { /* One line special case */
ttmove(row, 0);
tteeol();
return;
}
if (CS) { /* scrolling region */
nl = bot - row;
ttwindow(row, bot);
ttmove(bot, 0);
while (nchunk--) putpad(SF, nl);
ttnowindow();
}
else if(insdel) {
ttmove(row, 0); /* Else use insert/delete line */
nl = nrow - ttrow;
if (pDL) putpad(tgoto(pDL, 0, nchunk), nl);
else for (i=0; i<nchunk; i++) /* For all lines in the chunk */
putpad(DL, nl);
ttmove(1+bot-nchunk,0);
nl = nrow - ttrow; /* ttmove() changes ttrow */
if (pAL) putpad(tgoto(pAL, 0, nchunk), nl);
else for (i=0; i<nchunk; i++) /* For all lines in the chunk */
putpad(AL, nl);
ttrow = HUGE;
ttcol = HUGE;
} else panic("ttdell: Can't insert/delete line");
}
示例5: ttinsl
/*
* Insert nchunk blank line(s) onto the
* screen, scrolling the last line on the
* screen off the bottom. Use the scrolling
* region if possible for a smoother display.
* If no scrolling region, use a set
* of insert and delete line sequences
*/
ttinsl(row, bot, nchunk) {
register int i, nl;
if (row == bot) { /* Case of one line insert is */
ttmove(row, 0); /* special */
tteeol();
return;
}
if (CS && SR) { /* Use scroll region and back index */
nl = bot - row;
ttwindow(row,bot);
ttmove(row, 0);
while (nchunk--) putpad(SR, nl);
ttnowindow();
return;
} else if (insdel) {
ttmove(1+bot-nchunk, 0);
nl = nrow - ttrow;
if (pDL) putpad(tgoto(pDL, 0, nchunk), nl);
else for (i=0; i<nchunk; i++) /* For all lines in the chunk */
putpad(DL, nl);
ttmove(row, 0);
nl = nrow - ttrow; /* ttmove() changes ttrow */
if (pAL) putpad(tgoto(pAL, 0, nchunk), nl);
else for (i=0; i<nchunk; i++) /* For all lines in the chunk */
putpad(AL, nl);
ttrow = HUGE;
ttcol = HUGE;
} else panic("ttinsl: Can't insert/delete line");
}
示例6: tostart
/* actions associated with putting the terminal in open mode */
void
tostart(void)
{
putpad(VS);
putpad(KS);
if (!value(MESG)) {
if (ttynbuf[0] == 0) {
register char *tn;
if ((tn=ttyname(2)) == NULL &&
(tn=ttyname(1)) == NULL &&
(tn=ttyname(0)) == NULL)
ttynbuf[0] = 1;
else
safecp(ttynbuf, tn, sizeof ttynbuf,
"%s too long", tn);
}
if (ttynbuf[0] != 1) {
struct stat sbuf;
stat(ttynbuf, &sbuf);
ttymesg = sbuf.st_mode & 0777;
chmod(ttynbuf,
#ifdef UCBV7
/*
* This applies to the UCB V7 Pdp-11 system with the
* -u write option only.
*/
0611 /* 11 = urgent only allowed */
#else
0600
#endif
);
}
}
}
示例7: tcapattr
/*
* NOTE:
* On Linux console, the 'me' termcap setting \E[m resets _all_ attributes,
* including color. However, if we use 'se' instead, it doesn't clear the
* boldface. To compensate, we reset the colors when we put out any "ending"
* sequence, such as 'me'.
*
* In rxvt (2.12), setting _any_ attribute seems to clobber the color settings.
*/
static void
tcapattr(int attr)
{
static const struct {
char **start;
char **end;
int mask;
} tbl[] = {
{ &SO, &SE, VASEL|VAREV },
{ &US, &UE, VAUL },
{ &US, &UE, VAITAL },
{ &MD, &ME, VABOLD },
};
static int last;
attr = VATTRIB(attr); /* FIXME: color? */
attr &= ~(VAML|VAMLFOC);
if (attr != last) {
register int n;
register char *s;
int diff = attr ^ last;
int ends = FALSE;
/* turn OFF old attributes */
for (n = 0; n < TABLESIZE(tbl); n++) {
if ((tbl[n].mask & diff) != 0
&& (tbl[n].mask & attr) == 0
&& (s = *(tbl[n].end)) != 0) {
putpad(s);
#if OPT_COLOR
reinitialize_colors();
#endif
ends = TRUE;
diff &= ~(tbl[n].mask);
}
}
/* turn ON new attributes */
for (n = 0; n < TABLESIZE(tbl); n++) {
if ((tbl[n].mask & diff) != 0
&& (tbl[n].mask & attr) != 0
&& (s = *(tbl[n].start)) != 0) {
putpad(s);
diff &= ~(tbl[n].mask);
}
}
if (SO != 0 && SE != 0) {
if (ends && (attr & (VAREV|VASEL))) {
putpad(SO);
} else if (diff) { /* we didn't find it */
putpad(SE);
}
}
last = attr;
}
}
示例8: tostop
/* Actions associated with putting the terminal in the right mode. */
void
tostop(void)
{
putpad(VE);
putpad(KE);
if (!value(MESG) && ttynbuf[0]>1)
chmod(ttynbuf, ttymesg);
}
示例9: tcaprev
static void tcaprev(int state)
{
if (state) {
if (SO != NULL)
putpad(SO);
} else if (SE != NULL)
putpad(SE);
}
示例10: ttyrestore
/*
* restore terminal to normal mode (upon exit, for shell escapes).
*/
ttyrestore()
{
putpad(tgoto(CM, 0, LINES-1)); /* go to lower left corner */
putpad(KE);
putpad(TE);
ttybuf = ottybuf;
ioctl(2, TIOCSETN, &ttybuf);
}
示例11: dingdong
void
dingdong(void)
{
if (flash_screen && value(vi_FLASH))
putpad((unsigned char *)flash_screen);
else if (value(vi_ERRORBELLS))
putpad((unsigned char *)bell);
}
示例12: tttidy
/*
* Clean up the terminal, in anticipation of
* a return to the command interpreter. This is a no-op
* on the ANSI display. On the SCALD display, it sets the
* window back to half screen scrolling. Perhaps it should
* query the display for the increment, and put it
* back to what it was.
*/
tttidy() {
#ifndef TCCONIO
if (TE && *TE) putpad(TE, 1); /* set the term back to normal mode */
putpad(tgoto(CM, 0, ttrow), 1); /* not nrow */
if (CE && *CE) putpad(CE, 1); /* erase one line */
# ifdef XKEYS
ttykeymaptidy();
# endif
#endif /* TCCONIO */
}
示例13: tinfodelete
/*
* tinfodelete - delete a character at the current character position.
*/
static void
tinfodelete(void)
{
if(_startdelete == NULL && _enddelete == NULL)
putpad(_deletechar);
else{
putpad(_startdelete);
putpad(_deletechar);
putpad(_enddelete);
}
}
示例14: tinfoinsert
/*
* tinfoinsert - insert a character at the current character position.
* _insertchar takes precedence.
*/
static void
tinfoinsert(UCS ch)
{
if(_insertchar != NULL){
putpad(_insertchar);
ttputc(ch);
}
else{
putpad(_startinsert);
ttputc(ch);
putpad(_endinsert);
}
}
示例15: ttyinit
/*
* put terminal into screen mode.
*/
ttyinit()
{
gtty(2, &ttybuf);
UPPERCASE = (ttybuf.sg_flags & LCASE) != 0;
HASTABS = (ttybuf.sg_flags & XTABS) != 0;
NONL = (ttybuf.sg_flags & CRMOD) == 0;
ottybuf = ttybuf;
ttybuf.sg_flags &= ~(ECHO|CRMOD);
ttybuf.sg_flags |= CBREAK;
ioctl(2, TIOCSETN, &ttybuf); /* or stty */
putpad(TI);
putpad(KS); /* only needed if you use keypad */
}