/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 1998-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.644 2021/08/18 21:55:42 tom Exp $
+ * $Id: curses.priv.h,v 1.651 2022/08/13 14:35:01 tom Exp $
*
* curses.priv.h
*
#endif
+#define IS_SUBWIN(w) ((w)->_flags & _SUBWIN)
+#define IS_PAD(w) ((w)->_flags & _ISPAD)
+#define IS_WRAPPED(w) ((w)->_flags & _WRAPPED)
+
#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, \
#define _nc_lock_global(name) /* nothing */
#define _nc_try_global(name) 0
#define _nc_unlock_global(name) /* nothing */
-
#endif /* USE_PTHREADS */
+#if USE_PTHREADS_EINTR || defined(EXP_WIN32_DRIVER)
+extern NCURSES_EXPORT(void) _nc_set_read_thread(bool);
+#else
+#define _nc_set_read_thread(enable) /* nothing */
+#endif
+
/*
* When using sp-funcs, locks are targeted to SCREEN-level granularity.
* So the locking is done in the non-sp-func (which calls the sp-func) rather
/*
* The SCREEN structure.
*/
-
-struct screen {
+typedef struct screen {
int _ifd; /* input file descriptor for screen */
int _ofd; /* output file descriptor for screen */
FILE *_ofp; /* output file ptr for screen */
const char *_tputs_trace;
#endif
#endif
-};
+#undef SCREEN
+} SCREEN;
extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
_nc_err_abort(MSG_NO_MEMORY); \
} while (0)
+#define TYPE_CALLOC(type, size, name) \
+ do { \
+ name = typeCalloc(type, size); \
+ if (name == 0) \
+ _nc_err_abort(MSG_NO_MEMORY); \
+ } while (0)
+
#define TYPE_REALLOC(type, size, name) \
do { \
name = typeRealloc(type, size, name); \
#define returnWin(code) TRACE_RETURN1(code,win)
#define returnDB(rc) do { TR(TRACE_DATABASE,(T_RETURN("code %d"), (rc))); return (rc); } while (0)
+#define returnPtrDB(rc) do { TR(TRACE_DATABASE,(T_RETURN("%p"), (rc))); return (rc); } while (0)
+#define returnVoidDB do { TR(TRACE_DATABASE,(T_RETURN(""))); return; } while (0)
extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (int);
extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *);
#define returnWin(code) return code
#define returnDB(code) return code
+#define returnPtrDB(rc) return rc
+#define returnVoidDB return
#endif /* TRACE/!TRACE */
/*
* We don't want to use the lines or columns capabilities internally, because
- * if the application is running multiple screens under X, it's quite possible
+ * if the application is running multiple screens under X, it is quite possible
* they could all have type xterm but have different sizes! So...
*/
#define screen_lines(sp) (sp)->_lines