X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fcurses.priv.h;h=839d5b359d70644f801a62fafc5cc19cd6cec0bc;hp=e4f62f6923a3ee5a18d67b4a1bb4064ad6974c2e;hb=71244b7927a8918c0b09a8eb13b017ef0ebb6de8;hpb=af3d0ee323cbb22d2a7596d564bf68f7307f5076 diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index e4f62f69..839d5b35 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.575 2017/06/17 22:21:08 tom Exp $ + * $Id: curses.priv.h,v 1.583 2017/07/22 23:19:00 tom Exp $ * * curses.priv.h * @@ -966,6 +966,9 @@ typedef struct { #ifdef USE_PTHREADS pthread_mutex_t mutex_curses; + pthread_mutex_t mutex_prescreen; + pthread_mutex_t mutex_screen; + pthread_mutex_t mutex_update; pthread_mutex_t mutex_tst_tracef; pthread_mutex_t mutex_tracef; int nested_tracef; @@ -984,12 +987,24 @@ extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; #define N_RIPS 5 +#ifdef USE_PTHREADS +typedef struct _prescreen_list { + struct _prescreen_list *next; + pthread_t id; + struct screen *sp; +} PRESCREEN_LIST; +#endif + /* * Global data which can be swept up into a SCREEN when one is created. * It may be modified before the next SCREEN is created. */ typedef struct { +#ifdef USE_PTHREADS + PRESCREEN_LIST *allocated; +#else struct screen * allocated; +#endif bool use_env; bool filter_mode; attr_t previous_attr; @@ -1031,6 +1046,12 @@ typedef struct { extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen; +typedef enum { + ewInitial = 0, + ewRunning, + ewSuspend +} ENDWIN; + /* * The SCREEN structure. */ @@ -1340,7 +1361,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; sp->_cbreak = 0; \ sp->_echo = TRUE; \ sp->_fifohead = -1; \ - sp->_endwin = TRUE; \ + sp->_endwin = ewSuspend; \ sp->_cursor = -1; \ SP_INIT_WINDOWLIST(sp); \ sp->_outch = NCURSES_OUTC_FUNC; \ @@ -1458,6 +1479,8 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; && (a).chars[3] == (b).chars[3] \ && (a).chars[4] == (b).chars[4] \ if_EXT_COLORS(&& (a).ext_color == (b).ext_color)) +#elif CCHARW_MAX > 0 +#error Inconsistent values for CCHARW_MAX #else #define CharEq(a,b) (!memcmp(&(a), &(b), sizeof(a))) #endif @@ -1685,7 +1708,7 @@ extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE typedef void VoidFunc(void); -#define TR_FUNC(value) ((const char*) &(value)) +#define TR_FUNC(value) ((const char*) (value)) #define NonNull(s) ((s) != 0 ? s : "") #define returnAttr(code) TRACE_RETURN(code,attr_t) @@ -2019,6 +2042,14 @@ extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *); extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, int); extern NCURSES_EXPORT(void) _nc_tinfo_cmdch(TERMINAL *, int); +#ifdef USE_PTHREADS +extern NCURSES_EXPORT(SCREEN *) _nc_find_prescr(void); +extern NCURSES_EXPORT(void) _nc_forget_prescr(void); +#else +#define _nc_find_prescr() _nc_prescreen.allocated +#define _nc_forget_prescr() _nc_prescreen.allocated = 0 +#endif + /* lib_set_term.c */ extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int)); @@ -2145,6 +2176,8 @@ extern NCURSES_EXPORT(void) _nc_import_termtype2(TERMTYPE2 *, const TERMTYPE *); #define _nc_export_termtype2(dst,src) /* nothing */ #define _nc_import_termtype2(dst,src) /* nothing */ #define _nc_free_termtype2(t) _nc_free_termtype(t) +/* also... */ +#define _nc_read_entry2 _nc_read_entry #endif #if NO_LEAKS