****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.477 2011/04/23 18:05:15 tom Exp $
+ * $Id: curses.priv.h,v 1.485 2011/10/08 21:00:56 tom Exp $
*
* curses.priv.h
*
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/stat.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#define end_va_copy(dst) /* nothing */
#endif
+/*
+ * Either/both S_ISxxx and/or S_IFxxx are defined in sys/types.h; some systems
+ * lack one or the other.
+ */
+#ifndef S_ISDIR
+#define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
+#endif
+
+#ifndef S_ISREG
+#define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG)
+#endif
+
/*
* Scroll hints are useless when hashmap is used
*/
#endif
#include <term.h>
+#include <nc_termios.h>
/*
* Reduce dependency on cur_term global by using terminfo data from SCREEN's
#define INIT_TERM_DRIVER() /* nothing */
#endif
+typedef struct {
+ const char *name;
+ char *value;
+} ITERATOR_VARS;
+
/*
* Global data which is not specific to a screen.
*/
bool init_signals;
bool init_screen;
- const char *comp_sourcename;
+ char *comp_sourcename;
char *comp_termtype;
bool have_tic_directory;
int tgetent_index;
long tgetent_sequence;
+ char *dbd_blob; /* string-heap for dbd_list[] */
+ char **dbd_list; /* distinct places to look for data */
+ int dbd_size; /* length of dbd_list[] */
+ time_t dbd_time; /* cache last updated */
+ ITERATOR_VARS dbd_vars[dbdLAST];
+
#ifndef USE_SP_WINDOWLIST
WINDOWLIST *_nc_windowlist;
#define WindowList(sp) _nc_globals._nc_windowlist
int _mouse_fd; /* file-descriptor, if any */
bool _mouse_active; /* true if initialized */
mmask_t _mouse_mask;
+ mmask_t _mouse_bstate;
NCURSES_CONST char *_mouse_xtermcap; /* string to enable/disable mouse */
MEVENT _mouse_events[EV_MAX]; /* hold the last mouse event seen */
MEVENT *_mouse_eventp; /* next free slot in event queue */
#define CHANGED_CELL(line,col) \
if (line->firstchar == _NOCHANGE) \
- line->firstchar = line->lastchar = (NCURSES_SIZE_T) col; \
+ line->firstchar = line->lastchar = (NCURSES_SIZE_T) (col); \
else if ((col) < line->firstchar) \
- line->firstchar = (NCURSES_SIZE_T) col; \
+ line->firstchar = (NCURSES_SIZE_T) (col); \
else if ((col) > line->lastchar) \
- line->lastchar = (NCURSES_SIZE_T) col
+ line->lastchar = (NCURSES_SIZE_T) (col)
#define CHANGED_RANGE(line,start,end) \
if (line->firstchar == _NOCHANGE \
|| line->firstchar > (start)) \
- line->firstchar = (NCURSES_SIZE_T) start; \
+ line->firstchar = (NCURSES_SIZE_T) (start); \
if (line->lastchar == _NOCHANGE \
|| line->lastchar < (end)) \
- line->lastchar = (NCURSES_SIZE_T) end
+ line->lastchar = (NCURSES_SIZE_T) (end)
#define CHANGED_TO_EOL(line,start,end) \
if (line->firstchar == _NOCHANGE \
|| line->firstchar > (start)) \
- line->firstchar = (NCURSES_SIZE_T) start; \
- line->lastchar = (NCURSES_SIZE_T) end
+ line->firstchar = (NCURSES_SIZE_T) (start); \
+ line->lastchar = (NCURSES_SIZE_T) (end)
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
/* lib_set_term.c */
extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int));
+/* lib_setup.c */
+#define ret_error(code, fmt, arg) if (errret) {\
+ *errret = code;\
+ returnCode(ERR);\
+ } else {\
+ fprintf(stderr, fmt, arg);\
+ exit(EXIT_FAILURE);\
+ }
+
+#define ret_error1(code, fmt, arg) ret_error(code, "'%s': " fmt, arg)
+
+#define ret_error0(code, msg) if (errret) {\
+ *errret = code;\
+ returnCode(ERR);\
+ } else {\
+ fprintf(stderr, msg);\
+ exit(EXIT_FAILURE);\
+ }
+
/* lib_tstp.c */
#if USE_SIGWINCH
extern NCURSES_EXPORT(int) _nc_handle_sigwinch(SCREEN *);
extern NCURSES_EXPORT(void) _nc_codes_leaks(void);
extern NCURSES_EXPORT(void) _nc_comp_captab_leaks(void);
extern NCURSES_EXPORT(void) _nc_comp_scan_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);
extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);