]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.6 - patch 20070414
[ncurses.git] / ncurses / curses.priv.h
index cfb3e62a62b03694a78ec2f01d09a97253530377..81340c87f9a7a12b7f802b897919fe7757e0c090 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,7 @@
 
 
 /*
- * $Id: curses.priv.h,v 1.314 2006/12/10 00:55:14 tom Exp $
+ * $Id: curses.priv.h,v 1.325 2007/03/10 23:43:50 tom Exp $
  *
  *     curses.priv.h
  *
@@ -202,12 +202,14 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
  * delays and expansion in raw mode.
  */
 
-struct tries {
-       struct tries    *child;     /* ptr to child.  NULL if none          */
-       struct tries    *sibling;   /* ptr to sibling.  NULL if none        */
+#define TRIES struct tries
+typedef TRIES {
+       TRIES    *child;            /* ptr to child.  NULL if none          */
+       TRIES    *sibling;          /* ptr to sibling.  NULL if none        */
        unsigned char    ch;        /* character at this node               */
        unsigned short   value;     /* code of string so far.  0 if none.   */
-};
+#undef TRIES
+} TRIES;
 
 /*
  * Common/troublesome character definitions
@@ -248,6 +250,10 @@ color_t;
 #define wbkgrnd            wbkgd
 #endif
 
+#undef NCURSES_OPAQUE
+#define NCURSES_INTERNALS 1
+#define NCURSES_OPAQUE 0
+
 #include <curses.h>    /* we'll use -Ipath directive to get the right one! */
 #include <term.h>
 #include <term_entry.h>
@@ -284,6 +290,14 @@ color_t;
 #define GET_SCREEN_PAIR(s)     GetPair(SCREEN_ATTRS(s))
 #define SET_SCREEN_PAIR(s,p)   SetPair(SCREEN_ATTRS(s), p)
 
+#if USE_REENTRANT
+#define SET_LINES(value) SP->_LINES = value
+#define SET_COLS(value)  SP->_COLS = value
+#else
+#define SET_LINES(value) LINES = value
+#define SET_COLS(value)  COLS = value
+#endif
+
 /*
  * Definitions for color pairs
  */
@@ -405,11 +419,12 @@ struct screen {
        bool            _buffered;      /* setvbuf uses _setbuf data        */
        int             _checkfd;       /* filedesc for typeahead check     */
        TERMINAL        *_term;         /* terminal type information        */
-       short           _lines;         /* screen lines                     */
-       short           _columns;       /* screen columns                   */
+       TTY             _saved_tty;     /* savetty/resetty information      */
+       NCURSES_SIZE_T  _lines;         /* screen lines                     */
+       NCURSES_SIZE_T  _columns;       /* screen columns                   */
 
-       short           _lines_avail;   /* lines available for stdscr       */
-       short           _topstolen;     /* lines stolen from top            */
+       NCURSES_SIZE_T  _lines_avail;   /* lines available for stdscr       */
+       NCURSES_SIZE_T  _topstolen;     /* lines stolen from top            */
        ripoff_t        _rippedoff[5];  /* list of lines stolen             */
        int             _rip_count;     /* ...and total lines stolen        */
 
@@ -417,8 +432,8 @@ struct screen {
        WINDOW          *_newscr;       /* virtual screen to be updated to  */
        WINDOW          *_stdscr;       /* screen's full-window context     */
 
-       struct tries    *_keytry;       /* "Try" for use with keypad mode   */
-       struct tries    *_key_ok;       /* Disabled keys via keyok(,FALSE)  */
+       TRIES           *_keytry;       /* "Try" for use with keypad mode   */
+       TRIES           *_key_ok;       /* Disabled keys via keyok(,FALSE)  */
        bool            _tried;         /* keypad mode was initialized      */
        bool            _keypad_on;     /* keypad mode is currently on      */
 
@@ -597,12 +612,21 @@ struct screen {
        unsigned long   *oldhash, *newhash;
        HASHMAP         *hashtab;
        int             hashtab_len;
+       int             *_oldnum_list;
+       int             _oldnum_size;
 
        bool            _cleanup;       /* cleanup after int/quit signal */
        int             (*_outch)(int); /* output handler if not putc */
 
        int             _legacy_coding; /* see use_legacy_coding() */
 
+#if USE_REENTRANT
+       char            _ttytype[NAMESIZE];
+       int             _ESCDELAY;
+       int             _TABSIZE;
+       int             _LINES;
+       int             _COLS;
+#endif
        /*
         * ncurses/ncursesw are the same up to this point.
         */
@@ -1141,6 +1165,7 @@ extern NCURSES_EXPORT(char *) _nc_get_locale(void);
 extern NCURSES_EXPORT(int) _nc_unicode_locale(void);
 extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(void);
 extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
+extern NCURSES_EXPORT(void) _nc_get_screensize(int *, int *);
 
 /* lib_tstp.c */
 #if USE_SIGWINCH
@@ -1177,10 +1202,10 @@ extern NCURSES_EXPORT(char *) _nc_strstr (const char *, const char *);
 extern NCURSES_EXPORT(char *) _nc_printf_string (const char *, va_list);
 
 /* tries.c */
-extern NCURSES_EXPORT(void) _nc_add_to_try (struct tries **, const char *, unsigned);
-extern NCURSES_EXPORT(char *) _nc_expand_try (struct tries *, unsigned, int *, size_t);
-extern NCURSES_EXPORT(int) _nc_remove_key (struct tries **, unsigned);
-extern NCURSES_EXPORT(int) _nc_remove_string (struct tries **, const char *);
+extern NCURSES_EXPORT(int) _nc_add_to_try (TRIES **, const char *, unsigned);
+extern NCURSES_EXPORT(char *) _nc_expand_try (TRIES *, unsigned, int *, size_t);
+extern NCURSES_EXPORT(int) _nc_remove_key (TRIES **, unsigned);
+extern NCURSES_EXPORT(int) _nc_remove_string (TRIES **, const char *);
 
 /* elsewhere ... */
 extern NCURSES_EXPORT(ENTRY *) _nc_delink_entry(ENTRY *, TERMTYPE *);
@@ -1210,7 +1235,7 @@ extern NCURSES_EXPORT(void) _nc_scroll_optimize (void);
 extern NCURSES_EXPORT(void) _nc_set_buffer (FILE *, bool);
 extern NCURSES_EXPORT(void) _nc_signal_handler (bool);
 extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *);
-extern NCURSES_EXPORT(void) _nc_trace_tries (struct tries *);
+extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *);
 
 #if NO_LEAKS
 extern NCURSES_EXPORT(void) _nc_alloc_entry_leaks(void);