X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fcurses.priv.h;h=0d61dc34ea4e2f505d7cbbe3a30a0677b6c2a8de;hp=4519ce95729451bf50c84c3cf7abb6423d39b3e9;hb=9a0b985989d0aeb66b66b5711d432322aa994969;hpb=bfe3845eb1a2ff02a740e917b537e939ec4e44cb diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 4519ce95..0d61dc34 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * + * Copyright (c) 1998-2018,2019 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.613 2018/12/29 20:07:04 tom Exp $ + * $Id: curses.priv.h,v 1.623 2019/06/01 23:41:36 tom Exp $ * * curses.priv.h * @@ -239,6 +239,18 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); #define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG) #endif +/* + * POSIX ignores the "b", which c89 specified. Some very old systems do not + * accept it. + */ +#if USE_FOPEN_BIN_R +#define BIN_R "rb" +#define BIN_W "wb" +#else +#define BIN_R "r" +#define BIN_W "w" +#endif + /* * Scroll hints are useless when hashmap is used */ @@ -470,7 +482,14 @@ typedef union { #define SET_WINDOW_PAIR(w,p) (w)->_color = (p) #define SameAttrOf(a,b) (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b)) -#define VIDATTR(sp,attr,pair) NCURSES_SP_NAME(vid_puts)(NCURSES_SP_ARGx attr, (NCURSES_PAIRS_T) pair, 0, NCURSES_OUTC_FUNC) +#define VIDPUTS(sp,attr,pair) do { \ + int vid_pair = pair; \ + NCURSES_SP_NAME(vid_puts)( \ + NCURSES_SP_ARGx attr, \ + (NCURSES_PAIRS_T) pair, \ + &vid_pair, \ + NCURSES_OUTC_FUNC); \ + } while (0) #else /* !NCURSES_EXT_COLORS */ @@ -483,7 +502,7 @@ typedef union { 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) +#define VIDPUTS(sp,attr,pair) NCURSES_SP_NAME(vidputs)(NCURSES_SP_ARGx attr, NCURSES_OUTC_FUNC) #endif /* NCURSES_EXT_COLORS */ @@ -539,6 +558,8 @@ NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *); #endif +#define HasHardTabs() (NonEmpty(clear_all_tabs) && NonEmpty(set_tab)) + #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \ __FILE__, __LINE__, \ (unsigned long) (pthread_self()), \ @@ -1710,6 +1731,14 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; # endif #endif +#ifdef __TANDEM +#define ROOT_UID 65535 +#endif + +#ifndef ROOT_UID +#define ROOT_UID 0 +#endif + /* * Standardize/simplify common loops */ @@ -1766,7 +1795,8 @@ extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE typedef void VoidFunc(void); -#define TR_FUNC_BFR(max) char tr_func_data[max][(sizeof(void *) + sizeof(void (*)(void))) * 2 + 4] +#define TR_FUNC_LEN ((sizeof(void *) + sizeof(void (*)(void))) * 2 + 4) +#define TR_FUNC_BFR(max) char tr_func_data[max][TR_FUNC_LEN] #define TR_FUNC_ARG(num,func) _nc_fmt_funcptr(&tr_func_data[num][0], (const char *)&(func), sizeof((func))) #define returnAttr(code) TRACE_RETURN(code,attr_t) @@ -1928,7 +1958,7 @@ extern NCURSES_EXPORT(void) name (void); \ #if USE_XMC_SUPPORT #define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \ attr_t chg = AttrOf(SCREEN_ATTRS(sp)); \ - VIDATTR(sp, AttrOf(c), GetPair(c)); \ + VIDPUTS(sp, AttrOf(c), GetPair(c)); \ if (magic_cookie_glitch > 0 \ && XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(sp))))) { \ T(("%s @%d before glitch %d,%d", \ @@ -1940,7 +1970,7 @@ extern NCURSES_EXPORT(void) name (void); \ } #else #define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \ - VIDATTR(sp, AttrOf(c), GetPair(c)); \ + VIDPUTS(sp, AttrOf(c), GetPair(c)); \ } #endif @@ -2015,6 +2045,12 @@ extern NCURSES_EXPORT(void) _nc_expanded (void); ttytype[NAMESIZE - 1] = '\0'; \ } +#if !NCURSES_WCWIDTH_GRAPHICS +extern NCURSES_EXPORT(int) _nc_wacs_width(unsigned); +#else +#define _nc_wacs_width(ch) wcwidth(ch) +#endif + /* charable.c */ #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t); @@ -2037,6 +2073,16 @@ typedef struct short source; } alias_table_data; +/* comp_userdefs.c */ +typedef struct { + short ute_name; /* offset of name to hash on */ + unsigned ute_type; /* mask (BOOLEAN, NUMBER, STRING) */ + unsigned ute_argc; /* number of parameters */ + unsigned ute_args; /* bit-mask for string parameters */ + short ute_index; /* index of associated variable in its array */ + short ute_link; /* index in table of next hash, or -1 */ +} user_table_data; + /* doupdate.c */ #if USE_XMC_SUPPORT extern NCURSES_EXPORT(void) _nc_do_xmc_glitch (attr_t); @@ -2251,6 +2297,7 @@ extern NCURSES_EXPORT(void) _nc_codes_leaks(void); extern NCURSES_EXPORT(void) _nc_comp_captab_leaks(void); extern NCURSES_EXPORT(void) _nc_comp_error_leaks(void); extern NCURSES_EXPORT(void) _nc_comp_scan_leaks(void); +extern NCURSES_EXPORT(void) _nc_comp_userdefs_leaks(void); extern NCURSES_EXPORT(void) _nc_db_iterator_leaks(void); extern NCURSES_EXPORT(void) _nc_keyname_leaks(void); extern NCURSES_EXPORT(void) _nc_names_leaks(void);