]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.9 - patch 20110625
[ncurses.git] / ncurses / curses.priv.h
index 49346c122a706ba7f42c47ba52ba1c693dc5468f..a9d2e128b1e558b54669027532aaea2ce73303b0 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.475 2011/01/22 21:10:19 tom Exp $
+ * $Id: curses.priv.h,v 1.480 2011/06/25 20:36:52 tom Exp $
  *
  *     curses.priv.h
  *
@@ -61,10 +61,15 @@ extern "C" {
 #define MODULE_ID(id) /*nothing*/
 #endif
 
+#if !(defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE))
+#define _POSIX_SOURCE
+#endif
+
 #include <stddef.h>            /* for offsetof */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 
 #if HAVE_UNISTD_H
 #include <unistd.h>
@@ -191,6 +196,18 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
 #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
  */
@@ -325,6 +342,7 @@ color_t;
 #endif
 
 #include <term.h>
+#include <nc_termios.h>
 
 /*
  * Reduce dependency on cur_term global by using terminfo data from SCREEN's
@@ -1015,6 +1033,7 @@ struct screen {
        int             _pair_count;    /* count of color pairs              */
        int             _pair_limit;    /* actual limit of color-pairs       */
 #if NCURSES_EXT_FUNCS
+       bool            _assumed_color; /* use assumed colors                */
        bool            _default_color; /* use default colors                */
        bool            _has_sgr_39_49; /* has ECMA default color support    */
        int             _default_fg;    /* assumed default foreground        */
@@ -1412,25 +1431,25 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 
 #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]))