****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.660 2023/02/25 21:24:20 tom Exp $
+ * $Id: curses.priv.h,v 1.667 2023/05/27 20:13:10 tom Exp $
*
* curses.priv.h
*
# endif
#endif
+#if (defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0) && (defined(__GNUC__) && (__GNUC__ < 12))
+# undef PRIxPTR /* gcc bug fixed in 12.x */
+# define PRIxPTR "lX"
+# define CASTxPTR(n) (unsigned long)(intptr_t)(n)
+#else
+# define CASTxPTR(n) (intptr_t)(n)
+#endif
+
#ifndef PRIxPTR
# define PRIxPTR "lx"
+# define CASTxPTR(n) (long)(n)
#endif
/* include signal.h before curses.h to work-around defect in glibc 2.1.3 */
ewSuspend
} ENDWIN;
+typedef struct {
+ int _nl; /* True if NL -> CR/NL is on */
+ int _raw; /* True if in raw mode */
+ int _cbreak; /* 1 if in cbreak mode */
+ /* > 1 if in halfdelay mode */
+ int _echo; /* True if echo on */
+} TTY_FLAGS;
+
+#define IsNl(sp) (sp)->_tty_flags._nl
+#define IsRaw(sp) (sp)->_tty_flags._raw
+#define IsCbreak(sp) (sp)->_tty_flags._cbreak
+#define IsEcho(sp) (sp)->_tty_flags._echo
+
/*
* The SCREEN structure.
*/
int _cursrow; /* physical cursor row */
int _curscol; /* physical cursor column */
bool _notty; /* true if we cannot switch non-tty */
- int _nl; /* True if NL -> CR/NL is on */
- int _raw; /* True if in raw mode */
- int _cbreak; /* 1 if in cbreak mode */
- /* > 1 if in halfdelay mode */
- int _echo; /* True if echo on */
+ TTY_FLAGS _tty_flags;
int _use_meta; /* use the meta key? */
struct _SLK *_slk; /* ptr to soft key struct / NULL */
int slk_format; /* selected format for this screen */
#endif
#define SP_PRE_INIT(sp) \
- sp->_cursrow = -1; \
- sp->_curscol = -1; \
- sp->_nl = TRUE; \
- sp->_raw = FALSE; \
- sp->_cbreak = 0; \
- sp->_echo = TRUE; \
- sp->_fifohead = -1; \
- sp->_endwin = ewSuspend; \
- sp->_cursor = -1; \
+ sp->_cursrow = -1; \
+ sp->_curscol = -1; \
+ IsNl(sp) = TRUE; \
+ IsRaw(sp) = FALSE; \
+ IsCbreak(sp) = 0; \
+ IsEcho(sp) = TRUE; \
+ sp->_fifohead = -1; \
+ sp->_endwin = ewSuspend; \
+ sp->_cursor = -1; \
SP_INIT_WINDOWLIST(sp); \
- sp->_outch = NCURSES_OUTC_FUNC; \
- sp->jump = 0 \
+ sp->_outch = NCURSES_OUTC_FUNC; \
+ sp->jump = 0 \
/* usually in <limits.h> */
#ifndef UCHAR_MAX
#define returnMMask(code) TRACE_RETURN_SP(code,mmask_t)
#define returnPtr(code) TRACE_RETURN1(code,ptr)
#define returnSP(code) TRACE_RETURN1(code,sp)
-#define returnVoid T((T_RETURN(""))); return
+#define returnVoid { T((T_RETURN(""))); return; }
#define returnVoidPtr(code) TRACE_RETURN1(code,void_ptr)
#define returnWin(code) TRACE_RETURN1(code,win)
/* lib_acs.c */
extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */
-extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int); /* used by 'tack' program */
+extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int);
/* lib_addch.c */
#if USE_WIDEC_SUPPORT
/* strings.c */
extern NCURSES_EXPORT(string_desc *) _nc_str_init (string_desc *, char *, size_t);
extern NCURSES_EXPORT(string_desc *) _nc_str_null (string_desc *, size_t);
-extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, string_desc *);
+extern NCURSES_EXPORT(string_desc *) _nc_str_copy (string_desc *, const string_desc *);
extern NCURSES_EXPORT(bool) _nc_safe_strcat (string_desc *, const char *);
extern NCURSES_EXPORT(bool) _nc_safe_strcpy (string_desc *, const char *);
extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE2 *);
extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int);
extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
+extern NCURSES_EXPORT(int) _nc_trans_string (char *, const char *);
extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE2 *const);
extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC);
extern NCURSES_EXPORT(void) _nc_flush (void);
extern NCURSES_EXPORT(void) _nc_init_keytry (SCREEN *);
extern NCURSES_EXPORT(void) _nc_keep_tic_dir (const char *);
extern NCURSES_EXPORT(void) _nc_make_oldhash (int i);
+extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *);
extern NCURSES_EXPORT(void) _nc_scroll_oldhash (int n, int top, int bot);
extern NCURSES_EXPORT(void) _nc_scroll_optimize (void);
extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, int);
#define _nc_fallback2(tp) _nc_fallback(tp)
#endif
+NCURSES_EXPORT(void) _nc_copy_termtype(TERMTYPE *, const TERMTYPE *);
+
#if NCURSES_EXT_NUMBERS
extern NCURSES_EXPORT(void) _nc_copy_termtype2 (TERMTYPE2 *, const TERMTYPE2 *);
extern NCURSES_EXPORT(void) _nc_export_termtype2(TERMTYPE *, const TERMTYPE2 *);
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);
-extern NCURSES_EXPORT(void) _nc_tgetent_leak(TERMINAL *);
+extern NCURSES_EXPORT(void) _nc_tgetent_leak(const TERMINAL *);
extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
#endif