本文整理汇总了C++中putpad函数的典型用法代码示例。如果您正苦于以下问题:C++ putpad函数的具体用法?C++ putpad怎么用?C++ putpad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putpad函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
}
}
开发者ID:RsrchBoy,项目名称:dpkg-alpine,代码行数:25,代码来源:color.c
示例2: tcapclose
static void tcapclose(void)
{
putpad(tgoto(CM, 0, term.t_nrow));
putpad(TE);
tioflush();
tiorestore();
}
开发者ID:ajaysusarla,项目名称:cgol,代码行数:7,代码来源:tcap.c
示例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;
}
}
}
开发者ID:RsrchBoy,项目名称:dpkg-alpine,代码行数:34,代码来源:color.c
示例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");
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:39,代码来源:tty.c
示例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");
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:38,代码来源:tty.c
示例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
);
}
}
}
开发者ID:chungy,项目名称:ex-vi,代码行数:35,代码来源:ex_put.c
示例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;
}
}
开发者ID:ThomasDickey,项目名称:pgf-vile-snapshots,代码行数:68,代码来源:tcap.c
示例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);
}
开发者ID:chungy,项目名称:ex-vi,代码行数:9,代码来源:ex_put.c
示例9: tcaprev
static void tcaprev(int state)
{
if (state) {
if (SO != NULL)
putpad(SO);
} else if (SE != NULL)
putpad(SE);
}
开发者ID:ajaysusarla,项目名称:cgol,代码行数:8,代码来源:tcap.c
示例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);
}
开发者ID:YoshikazuNakahara,项目名称:Unixv7x86,代码行数:11,代码来源:tl2.c
示例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);
}
开发者ID:andreiw,项目名称:polaris,代码行数:9,代码来源:ex_subr.c
示例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 */
}
开发者ID:sarami55,项目名称:ng-.1.5,代码行数:18,代码来源:tty.c
示例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);
}
}
开发者ID:nysan,项目名称:alpine,代码行数:14,代码来源:terminal.c
示例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);
}
}
开发者ID:nysan,项目名称:alpine,代码行数:17,代码来源:terminal.c
示例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 */
}
开发者ID:YoshikazuNakahara,项目名称:Unixv7x86,代码行数:17,代码来源:tl2.c
示例16: ttcolor
/*
* Set the current writing color to the specified color. Watch for color
* changes that are not going to do anything (the color is already right)
* and don't send anything to the display. The rainbow version does this
* in putline.s on a line by line basis, so don't bother sending out the
* color shift.
*/
void
ttcolor(int color)
{
if (color != tthue) {
if (color == CTEXT)
/* normal video */
putpad(exit_standout_mode, 1);
else if (color == CMODE)
/* reverse video */
putpad(enter_standout_mode, 1);
/* save the color */
tthue = color;
}
}
开发者ID:repos-holder,项目名称:openbsd-patches,代码行数:21,代码来源:tty.c
示例17: tteeop
/*
* Erase to end of page.
*/
tteeop() {
if(CD) putpad(CD, nrow - ttrow);
else {
putpad(CE, 1);
if (insdel) ttdell(ttrow + 1, LI, LI - ttrow - 1);
else { /* do it by hand */
register int line;
for (line = ttrow + 1; line <= LI; ++line) {
ttmove(line, 0);
tteeol();
}
}
ttrow = ttcol = HUGE;
}
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:18,代码来源:tty.c
示例18: tcapkopen
static void
tcapkopen(void)
{
#if OPT_XTERM
if (i_am_xterm && global_g_val(GMDXTERM_MOUSE))
putpad(XTERM_ENABLE_TRACKING);
#endif
if (!keyboard_open) {
keyboard_open = TRUE;
if (TI)
putnpad(TI, (int)strlen(TI));
if (KS)
putpad(KS);
}
(void)strcpy(sres, "NORMAL");
}
开发者ID:ThomasDickey,项目名称:pgf-vile-snapshots,代码行数:16,代码来源:tcap.c
示例19: tcapkclose
static void
tcapkclose(void)
{
#if OPT_XTERM
if (i_am_xterm && global_g_val(GMDXTERM_MOUSE))
putpad(XTERM_DISABLE_TRACKING);
#endif
if (keyboard_open) {
keyboard_open = FALSE;
if (TE)
putnpad(TE, (int)strlen(TE));
if (KE)
putpad(KE);
}
TTflush();
}
开发者ID:ThomasDickey,项目名称:pgf-vile-snapshots,代码行数:16,代码来源:tcap.c
示例20: ttcolor
/*
* Set the current writing color to the
* specified color. Watch for color changes that are
* not going to do anything (the color is already right)
* and don't send anything to the display.
* The rainbow version does this in putline.s on a
* line by line basis, so don't bother sending
* out the color shift.
*/
void
ttcolor (int color)
{
if (color != tthue)
{
if (color == CTEXT)
{ /* Normal video. */
putpad (SE);
}
else if (color == CMODE)
{ /* Reverse video. */
putpad (SO);
}
tthue = color; /* Save the color. */
}
}
开发者ID:bloovis,项目名称:micro-emacs,代码行数:25,代码来源:tty.c
注:本文中的putpad函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论