本文整理汇总了C++中T_RETURN函数的典型用法代码示例。如果您正苦于以下问题:C++ T_RETURN函数的具体用法?C++ T_RETURN怎么用?C++ T_RETURN使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了T_RETURN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_curterm
set_curterm(TERMINAL * termp)
{
TERMINAL *oldterm;
T((T_CALLED("set_curterm(%p)"), termp));
_nc_lock_global(curses);
oldterm = cur_term;
if (SP)
SP->_term = termp;
#if BROKEN_LINKER || USE_REENTRANT
_nc_prescreen._cur_term = termp;
#else
cur_term = termp;
#endif
if (termp != 0) {
ospeed = _nc_ospeed(termp->_baudrate);
if (termp->type.Strings) {
PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
}
}
_nc_unlock_global(curses);
T((T_RETURN("%p"), oldterm));
return (oldterm);
}
示例2: wecho_wchar
wecho_wchar(WINDOW *win, const cchar_t * wch)
{
PUTC_DATA;
int n;
int code = ERR;
TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win,
_tracech_t(wch)));
if (win != 0) {
PUTC_INIT;
while (PUTC_i < CCHARW_MAX) {
if ((PUTC_ch = wch->chars[PUTC_i++]) == L'\0')
break;
if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) {
code = ERR;
if (is8bits(PUTC_ch))
code = waddch(win, UChar(PUTC_ch) | wch->attr);
break;
}
for (n = 0; n < PUTC_n; n++) {
if ((code = waddch(win, UChar(PUTC_buf[n]) | wch->attr)) == ERR) {
break;
}
}
if (code == ERR)
break;
}
wrefresh(win);
}
TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
return (code);
}
示例3: wadd_wch
wadd_wch(WINDOW *win, const cchar_t *wch)
{
PUTC_DATA;
int n;
int code = ERR;
TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win,
_tracech_t(wch)));
if (win != 0) {
PUTC_INIT;
for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) {
attr_t attrs = (wch->attr & A_ATTRIBUTES);
if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0')
break;
if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) {
code = ERR;
if (is8bits(PUTC_ch))
code = waddch(win, UChar(PUTC_ch) | attrs);
break;
}
for (n = 0; n < PUTC_n; n++) {
if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) {
break;
}
}
if (code == ERR)
break;
}
}
TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
return (code);
}
示例4: _nc_va_tracef
static void
_nc_va_tracef(const char *fmt, va_list ap)
{
static const char Called[] = T_CALLED("");
static const char Return[] = T_RETURN("");
bool before = FALSE;
bool after = FALSE;
unsigned doit = _nc_tracing;
int save_err = errno;
if (strlen(fmt) >= sizeof(Called) - 1) {
if (!strncmp(fmt, Called, sizeof(Called) - 1)) {
before = TRUE;
TraceLevel++;
} else if (!strncmp(fmt, Return, sizeof(Return) - 1)) {
after = TRUE;
}
if (before || after) {
if ((TraceLevel <= 1)
|| (doit & TRACE_ICALLS) != 0)
doit &= (TRACE_CALLS | TRACE_CCALLS);
else
doit = 0;
}
}
if (doit != 0) {
if (TraceFP == 0)
TraceFP = stderr;
#ifdef USE_PTHREADS
/*
* TRACE_ICALLS is "really" needed to show normal use with threaded
* applications, since anything can be running during a napms(),
* making it appear in the hierarchical trace as it other functions
* are being called.
*
* Rather than add the complication of a per-thread stack, just
* show the thread-id in each line of the trace.
*/
# if USE_WEAK_SYMBOLS
if ((pthread_self))
# endif
fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self());
#endif
if (before || after) {
int n;
for (n = 1; n < TraceLevel; n++)
fputs("+ ", TraceFP);
}
vfprintf(TraceFP, fmt, ap);
fputc('\n', TraceFP);
fflush(TraceFP);
}
if (after && TraceLevel)
TraceLevel--;
errno = save_err;
}
示例5: NCURSES_SP_NAME
NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp)
{
TERMINAL *oldterm;
T((T_CALLED("set_curterm(%p)"), (void *) termp));
_nc_lock_global(curses);
oldterm = cur_term;
if (SP_PARM)
SP_PARM->_term = termp;
#if USE_REENTRANT
CurTerm = termp;
#else
cur_term = termp;
#endif
if (termp != 0) {
#ifdef USE_TERM_DRIVER
TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp;
ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate);
if (TCB->drv->isTerminfo && termp->type.Strings) {
PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
}
TCB->csp = SP_PARM;
#else
ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate);
if (termp->type.Strings) {
PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
}
#endif
}
_nc_unlock_global(curses);
T((T_RETURN("%p"), (void *) oldterm));
return (oldterm);
}
示例6: set_curterm
set_curterm(TERMINAL * termp)
{
TERMINAL *oldterm = cur_term;
T((T_CALLED("set_curterm(%p)"), termp));
if ((cur_term = termp) != 0) {
ospeed = _nc_ospeed(cur_term->_baudrate);
PC = (pad_char != NULL) ? pad_char[0] : 0;
}
T((T_RETURN("%p"), oldterm));
return (oldterm);
}
示例7: waddch
int waddch(WINDOW *win, const chtype ch)
{
int code = ERR;
TR(TRACE_VIRTPUT|TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win, _tracechtype(ch)));
if (win && (waddch_nosync(win, ch) != ERR))
{
_nc_synchook(win);
code = OK;
}
TR(TRACE_VIRTPUT|TRACE_CCALLS, (T_RETURN("%d"), code));
return(code);
}
示例8: wadd_wch
wadd_wch(WINDOW *win, const cchar_t *wch)
{
int code = ERR;
TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"),
(void *) win,
_tracecchar_t(wch)));
if (win && (wadd_wch_nosync(win, *wch) != ERR)) {
_nc_synchook(win);
code = OK;
}
TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
return (code);
}
示例9: _tracef
void
_tracef(const char *fmt, ...)
{
static const char Called[] = T_CALLED("");
static const char Return[] = T_RETURN("");
static int level;
va_list ap;
bool before = FALSE;
bool after = FALSE;
int doit = _nc_tracing;
int save_err = errno;
if (strlen(fmt) >= sizeof(Called) - 1) {
if (!strncmp(fmt, Called, sizeof(Called)-1)) {
before = TRUE;
level++;
} else if (!strncmp(fmt, Return, sizeof(Return)-1)) {
after = TRUE;
}
if (before || after) {
if ((level <= 1)
|| (doit & TRACE_ICALLS) != 0)
doit &= (TRACE_CALLS|TRACE_CCALLS);
else
doit = 0;
}
}
if (doit != 0) {
if (tracefp == 0)
tracefp = stderr;
if (before || after) {
int n;
for (n = 1; n < level; n++)
fputs("+ ", tracefp);
}
va_start(ap, fmt);
vfprintf(tracefp, fmt, ap);
fputc('\n', tracefp);
va_end(ap);
fflush(tracefp);
}
if (after && level)
level--;
errno = save_err;
}
示例10: setcchar
setcchar(cchar_t *wcval,
const wchar_t *wch,
const attr_t attrs,
short color_pair,
const void *opts)
{
unsigned i;
unsigned len;
int code = OK;
TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"),
(void *) wcval, _nc_viswbuf(wch),
(unsigned long) attrs, color_pair, opts));
len = (unsigned) wcslen(wch);
if (opts != NULL
|| (len > 1 && wcwidth(wch[0]) < 0)) {
code = ERR;
} else {
if (len > CCHARW_MAX)
len = CCHARW_MAX;
/*
* If we have a following spacing-character, stop at that point. We
* are only interested in adding non-spacing characters.
*/
for (i = 1; i < len; ++i) {
if (wcwidth(wch[i]) != 0) {
len = i;
break;
}
}
memset(wcval, 0, sizeof(*wcval));
if (len != 0) {
SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair));
SetPair(CHDEREF(wcval), color_pair);
memcpy(&wcval->chars, wch, len * sizeof(wchar_t));
TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len,
_tracecchar_t(wcval)));
}
}
TR(TRACE_CCALLS, (T_RETURN("%d"), code));
return (code);
}
示例11: wechochar
int wechochar(WINDOW *win, const chtype ch)
{
int code = ERR;
TR(TRACE_VIRTPUT|TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win, _tracechtype(ch)));
if (win && (waddch_nosync(win, ch) != ERR))
{
bool save_immed = win->_immed;
win->_immed = TRUE;
_nc_synchook(win);
win->_immed = save_immed;
code = OK;
}
TR(TRACE_VIRTPUT|TRACE_CCALLS, (T_RETURN("%d"), code));
return(code);
}
示例12: _nc_leaks_tinfo
_nc_leaks_tinfo(void)
{
#if NO_LEAKS
char *s;
#endif
T((T_CALLED("_nc_free_tinfo()")));
#if NO_LEAKS
_nc_globals.leak_checking = TRUE;
_nc_free_tparm();
_nc_tgetent_leaks();
if (TerminalOf(CURRENT_SCREEN) != 0) {
del_curterm(TerminalOf(CURRENT_SCREEN));
}
_nc_forget_prescr();
_nc_comp_captab_leaks();
_nc_free_entries(_nc_head);
_nc_get_type(0);
_nc_first_name(0);
_nc_db_iterator_leaks();
_nc_keyname_leaks();
#if BROKEN_LINKER || USE_REENTRANT
_nc_names_leaks();
_nc_codes_leaks();
FreeIfNeeded(_nc_prescreen.real_acs_map);
#endif
_nc_comp_error_leaks();
if ((s = _nc_home_terminfo()) != 0)
free(s);
#ifdef TRACE
T((T_RETURN("")));
trace(0);
_nc_trace_buf(-1, (size_t) 0);
#endif
#endif /* NO_LEAKS */
returnVoid;
}
示例13: getcchar
getcchar(const cchar_t *wcval,
wchar_t *wch,
attr_t *attrs,
short *color_pair,
void *opts)
{
wchar_t *wp;
int len;
int code = ERR;
TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"),
(const void *) wcval,
(void *) wch,
(void *) attrs,
(void *) color_pair,
opts));
if (opts == NULL) {
len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX))
? (int) (wp - wcval->chars)
: CCHARW_MAX);
if (wch == NULL) {
/*
* If the value is a null, set the length to 1.
* If the value is not a null, return the length plus 1 for null.
*/
code = (len < CCHARW_MAX) ? (len + 1) : CCHARW_MAX;
} else if (attrs == 0 || color_pair == 0) {
code = ERR;
} else if (len >= 0) {
*attrs = AttrOf(*wcval) & A_ATTRIBUTES;
*color_pair = (short) GetPair(*wcval);
wmemcpy(wch, wcval->chars, (unsigned) len);
wch[len] = L'\0';
code = OK;
}
}
TR(TRACE_CCALLS, (T_RETURN("%d"), code));
return (code);
}
示例14: set_term
set_term(SCREEN *screenp)
{
SCREEN *oldSP;
SCREEN *newSP;
T((T_CALLED("set_term(%p)"), (void *) screenp));
_nc_lock_global(curses);
oldSP = CURRENT_SCREEN;
_nc_set_screen(screenp);
newSP = screenp;
if (newSP != 0) {
TINFO_SET_CURTERM(newSP, newSP->_term);
#if !USE_REENTRANT
curscr = CurScreen(newSP);
newscr = NewScreen(newSP);
stdscr = StdScreen(newSP);
COLORS = newSP->_color_count;
COLOR_PAIRS = newSP->_pair_count;
#endif
} else {
TINFO_SET_CURTERM(oldSP, 0);
#if !USE_REENTRANT
curscr = 0;
newscr = 0;
stdscr = 0;
COLORS = 0;
COLOR_PAIRS = 0;
#endif
}
_nc_unlock_global(curses);
T((T_RETURN("%p"), (void *) oldSP));
return (oldSP);
}
示例15: set_term
set_term(SCREEN *screenp)
{
SCREEN *oldSP;
SCREEN *newSP;
T((T_CALLED("set_term(%p)"), screenp));
_nc_lock_global(curses);
oldSP = SP;
_nc_set_screen(screenp);
newSP = SP;
if (newSP != 0) {
set_curterm(newSP->_term);
#if !USE_REENTRANT
curscr = newSP->_curscr;
newscr = newSP->_newscr;
stdscr = newSP->_stdscr;
COLORS = newSP->_color_count;
COLOR_PAIRS = newSP->_pair_count;
#endif
} else {
set_curterm(0);
#if !USE_REENTRANT
curscr = 0;
newscr = 0;
stdscr = 0;
COLORS = 0;
COLOR_PAIRS = 0;
#endif
}
_nc_unlock_global(curses);
T((T_RETURN("%p"), oldSP));
return (oldSP);
}