X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fcurses.priv.h;h=1ec7e73ee0c9426724100bc703395da96bc5ceda;hp=b5be745dd0b9c3b390e8104fd91cd07709e86e32;hb=eccca377f55c70b12e3e92621d94d1e1c1fcfb7d;hpb=45291421bee33c79ffb4c8f0e1b67ca5cc262114 diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index b5be745d..1ec7e73e 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.612 2018/12/16 01:16:58 tom Exp $ + * $Id: curses.priv.h,v 1.615 2019/01/21 14:50:27 tom Exp $ * * curses.priv.h * @@ -1544,26 +1544,27 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #define PUTC_INIT init_mb (PUT_st) #define PUTC(ch) do { if(!isWidecExt(ch)) { \ if (Charable(ch)) { \ - TR_PUTC(CharOf(ch)); \ - NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \ + TR_PUTC(CharOf(ch)); \ + NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \ COUNT_OUTCHARS(1); \ } else { \ for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { \ PUTC_ch = (ch).chars[PUTC_i]; \ if (PUTC_ch == L'\0') \ break; \ - PUTC_INIT; \ + PUTC_INIT; \ PUTC_n = (int) wcrtomb(PUTC_buf, \ (ch).chars[PUTC_i], &PUT_st); \ if (PUTC_n <= 0) { \ - if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \ - TR_PUTC(CharOf(ch)); \ + if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) { \ + TR_PUTC(CharOf(ch)); \ NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \ + } \ break; \ } else { \ int PUTC_j; \ for (PUTC_j = 0; PUTC_j < PUTC_n; ++PUTC_j) { \ - TR_PUTC(PUTC_buf[PUTC_j]); \ + TR_PUTC(PUTC_buf[PUTC_j]); \ NCURSES_OUTC_FUNC (NCURSES_SP_ARGx PUTC_buf[PUTC_j]); \ } \ } \ @@ -1709,6 +1710,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 */ @@ -1765,7 +1774,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) @@ -2065,9 +2075,13 @@ extern NCURSES_EXPORT(int) _nc_init_color(SCREEN *, int, int, int, int); extern NCURSES_EXPORT(int) _nc_init_pair(SCREEN *, int, int, int); extern NCURSES_EXPORT(int) _nc_pair_content(SCREEN *, int, int *, int *); extern NCURSES_EXPORT(bool) _nc_reset_colors(void); -extern NCURSES_EXPORT(colorpair_t *) _nc_reserve_pairs(SCREEN *, int); +extern NCURSES_EXPORT(void) _nc_reserve_pairs(SCREEN *, int); extern NCURSES_EXPORT(void) _nc_change_pair(SCREEN *, int); +#define ReservePairs(sp,want) \ + if ((sp->_color_pairs == 0) || (want >= sp->_pair_alloc)) \ + _nc_reserve_pairs(sp, want) + /* lib_getch.c */ extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, int *, int EVENTLIST_2nd(_nc_eventlist *));