]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.7 - patch 20100327
[ncurses.git] / ncurses / curses.priv.h
index 3a61f764e4b1caf474417f501b39a011fdbf52a3..e88bff7a96ecc5e6c165e3c6d1a7a97c005ea849 100644 (file)
@@ -35,7 +35,7 @@
 
 
 /*
- * $Id: curses.priv.h,v 1.447 2010/01/16 21:32:59 tom Exp $
+ * $Id: curses.priv.h,v 1.453 2010/03/13 19:33:00 tom Exp $
  *
  *     curses.priv.h
  *
@@ -61,6 +61,7 @@ extern "C" {
 #define MODULE_ID(id) /*nothing*/
 #endif
 
+#include <stddef.h>            /* for offsetof */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -176,6 +177,20 @@ extern NCURSES_EXPORT(int) _nc_env_access (void);
 extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
 #endif
 
+/*
+ * If we have va_copy(), use it for assigning va_list's.
+ */
+#if defined(HAVE___VA_COPY)
+#define begin_va_copy(dst,src) __va_copy(dst, src)
+#define end_va_copy(dst)       va_end(dst)
+#elif defined(va_copy) || defined(HAVE_VA_COPY)
+#define begin_va_copy(dst,src) va_copy(dst, src)
+#define end_va_copy(dst)       va_end(dst)
+#else
+#define begin_va_copy(dst,src) (dst) = (src)
+#define end_va_copy(dst)       /* nothing */
+#endif
+
 /*
  * Scroll hints are useless when hashmap is used
  */
@@ -531,7 +546,7 @@ typedef unsigned colorpair_t;       /* type big enough to store PAIR_OF() */
 
 #define COLOR_DEFAULT          C_MASK
 
-#if defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T)
+#if defined(USE_BUILD_CC) || (defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T))
 
 #undef NCURSES_CH_T            /* this is not a termlib feature */
 #define NCURSES_CH_T void      /* ...but we need a pointer in SCREEN */
@@ -557,6 +572,9 @@ typedef enum {
 #if USE_SYSMOUSE
        ,M_SYSMOUSE             /* FreeBSD sysmouse on console */
 #endif
+#ifdef USE_TERM_DRIVER
+       ,M_TERM_DRIVER          /* Win32 console, etc */
+#endif
 } MouseType;
 
 /*
@@ -575,7 +593,7 @@ typedef struct {
 
 struct _SLK;
 
-#ifndef USE_TERMLIB
+#if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 
 typedef struct
 {
@@ -1030,6 +1048,13 @@ struct screen {
        int             _sysmouse_new_buttons;
 #endif
 
+#ifdef USE_TERM_DRIVER
+       MEVENT          _drv_mouse_fifo[FIFO_SIZE];
+       int             _drv_mouse_head;
+       int             _drv_mouse_tail;
+       int             _drv_mouse_old_buttons;
+       int             _drv_mouse_new_buttons;
+#endif
        /*
         * This supports automatic resizing
         */
@@ -1098,9 +1123,9 @@ extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
 extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 
        WINDOWLIST {
-       WINDOW  win;            /* first, so WINDOW_EXT() works */
        WINDOWLIST *next;
        SCREEN *screen;         /* screen containing the window */
+       WINDOW  win;            /* WINDOW_EXT() needs to account for offset */
 #ifdef _XOPEN_SOURCE_EXTENDED
        char addch_work[(MB_LEN_MAX * 9) + 1];
        unsigned addch_used;    /* number of bytes in addch_work[] */
@@ -1109,7 +1134,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 #endif
 };
 
-#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field)
+#define WINDOW_EXT(w,m) (((WINDOWLIST *)((char *)(w) - offsetof(WINDOWLIST, win)))->m)
 
 #define SP_PRE_INIT(sp)                         \
     sp->_cursrow = -1;                          \
@@ -1700,7 +1725,7 @@ NCURSES_EXPORT(int) _nc_build_wch(WINDOW *win, ARG_CH_T ch);
 #endif
 
 /* lib_addstr.c */
-#if USE_WIDEC_SUPPORT && !defined(USE_TERMLIB)
+#if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *);
 #endif
 
@@ -1831,7 +1856,7 @@ extern NCURSES_EXPORT(void) _nc_names_leaks(void);
 extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
 #endif
 
-#ifndef USE_TERMLIB
+#if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T);
 extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T);
 extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, NCURSES_SIZE_T const, NCURSES_SIZE_T const, NCURSES_CH_T);
@@ -1841,7 +1866,7 @@ extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, NCURSES_SIZE
 extern NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *, const cchar_t *);
 #endif
 
-#if USE_WIDEC_SUPPORT && !defined(USE_TERMLIB)
+#if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 extern NCURSES_EXPORT(size_t) _nc_wcrtomb (char *, wchar_t, mbstate_t *);
 #endif