X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Fcurses.priv.h;h=d7e16707def4be5c36f3809d978aecfe1f1227f6;hb=048a1c1a65c6d98d92fca97f8d175d10d21091d0;hp=d2b5b1b99b029767b1fbb2303508cd5b3c4f77f4;hpb=89ca7974b018d46049b6eaf1b7f17784e3a001d1;p=ncurses.git diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index d2b5b1b9..d7e16707 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.552 2016/02/13 16:37:24 tom Exp $ + * $Id: curses.priv.h,v 1.560 2017/02/04 23:21:09 tom Exp $ * * curses.priv.h * @@ -406,7 +406,7 @@ color_t; * option for compiling the tracing into the library. */ #if 1 -#define ColorPair(n) NCURSES_BITS(n, 0) +#define ColorPair(n) (NCURSES_BITS(n, 0) & A_COLOR) #define PairNumber(a) (NCURSES_CAST(int,(((unsigned long)(a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) #else #define ColorPair(pair) COLOR_PAIR(pair) @@ -426,7 +426,7 @@ color_t; #define if_EXT_COLORS(stmt) stmt #define SetPair(value,p) SetPair2((value).ext_color, AttrOf(value), p) #define SetPair2(c,a,p) c = (p), \ - a = (unColor2(a) | (A_COLOR & (unsigned) ColorPair(oldColor(c)))) + a = (unColor2(a) | ColorPair(oldColor(c))) #define GetPair(value) GetPair2((value).ext_color, AttrOf(value)) #define GetPair2(c,a) ((c) ? (c) : PairNumber(a)) #define oldColor(p) (((p) > 255) ? 255 : (p)) @@ -440,11 +440,11 @@ color_t; #define if_EXT_COLORS(stmt) /* nothing */ #define SetPair(value,p) RemAttr(value, A_COLOR), \ - SetAttr(value, AttrOf(value) | (A_COLOR & (attr_t) ColorPair(p))) + SetAttr(value, AttrOf(value) | ColorPair(p)) #define GetPair(value) PairNumber(AttrOf(value)) #define GET_WINDOW_PAIR(w) PairNumber(WINDOW_ATTRS(w)) #define SET_WINDOW_PAIR(w,p) WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \ - WINDOW_ATTRS(w) |= (A_COLOR & (attr_t) ColorPair(p)) + WINDOW_ATTRS(w) |= ColorPair(p) #define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b)) #define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vidputs)(NCURSES_SP_ARGx attr, NCURSES_OUTC_FUNC) @@ -561,7 +561,7 @@ weak_symbol(pthread_mutexattr_settype); weak_symbol(pthread_mutexattr_init); extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *); # undef sigprocmask -# define sigprocmask _nc_sigprocmask +# define sigprocmask(a, b, c) _nc_sigprocmask(a, b, c) # endif #endif @@ -581,7 +581,7 @@ weak_symbol(pthread_self); weak_symbol(pthread_equal); extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *); # undef sigprocmask -# define sigprocmask _nc_sigprocmask +# define sigprocmask(a, b, c) _nc_sigprocmask(a, b, c) # endif #endif /* USE_PTHREADS_EINTR */ @@ -901,10 +901,11 @@ typedef struct { #endif #ifdef TRACE - bool init_trace; + bool trace_opened; char trace_fname[PATH_MAX]; int trace_level; FILE *trace_fp; + int trace_fd; char *tracearg_buf; size_t tracearg_used; @@ -939,6 +940,9 @@ typedef struct { #if USE_PTHREADS_EINTR pthread_t read_thread; /* The reading thread */ #endif +#if USE_WIDEC_SUPPORT + char key_name[MB_LEN_MAX + 1]; +#endif } NCURSES_GLOBALS; extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; @@ -1248,6 +1252,10 @@ struct screen { ripoff_t rippedoff[N_RIPS]; ripoff_t *rsp; +#if NCURSES_SP_FUNCS + bool use_tioctl; +#endif + /* * ncurses/ncursesw are the same up to this point. */ @@ -1258,8 +1266,6 @@ struct screen { bool _screen_acs_fix; bool _screen_unicode; #endif - - bool _use_tioctl; }; extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain; @@ -1651,6 +1657,8 @@ typedef void VoidFunc(void); #define returnVoidPtr(code) TRACE_RETURN1(code,void_ptr) #define returnWin(code) TRACE_RETURN1(code,win) +#define returnDB(code) do { TR(TRACE_DATABASE,(T_RETURN("code %d"), (code))); return (code); } while (0) + extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (int); extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *); extern NCURSES_EXPORT(SCREEN *) _nc_retrace_sp (SCREEN *); @@ -1720,6 +1728,8 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int); #define returnVoidPtr(code) return code #define returnWin(code) return code +#define returnDB(code) return code + #endif /* TRACE/!TRACE */ /*