]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.9 - patch 20120826
[ncurses.git] / ncurses / curses.priv.h
index 5fbb7b9ae692c7b5e67bc621610426ce715bbe39..5d43b4e7efdf521b5b9afaead01903a9460dd366 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.499 2012/03/10 21:16:32 tom Exp $
+ * $Id: curses.priv.h,v 1.505 2012/08/25 20:49:15 tom Exp $
  *
  *     curses.priv.h
  *
@@ -814,6 +814,7 @@ typedef struct {
  * Global data which is not specific to a screen.
  */
 typedef struct {
+       SIG_ATOMIC_T    have_sigtstp;
        SIG_ATOMIC_T    have_sigwinch;
        SIG_ATOMIC_T    cleanup_nested;
 
@@ -941,6 +942,7 @@ typedef struct {
        const char      *_tputs_trace;
 #endif
 #endif
+       bool            use_tioctl;
 } NCURSES_PRESCREEN;
 
 /*
@@ -961,11 +963,13 @@ extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
  */
 
 struct screen {
-       int             _ifd;           /* input file ptr for screen        */
+       int             _ifd;           /* input file descriptor for screen */
+       int             _ofd;           /* output file descriptor for screen */
        FILE            *_ofp;          /* output file ptr for screen       */
-       char            *_setbuf;       /* buffered I/O for output          */
+       char            *out_buffer;    /* output buffer                    */
+       size_t          out_limit;      /* output buffer size               */
+       size_t          out_inuse;      /* output buffer current use        */
        bool            _filtered;      /* filter() was called              */
-       bool            _buffered;      /* setvbuf uses _setbuf data        */
        bool            _prescreen;     /* is in prescreen phase            */
        bool            _use_env;       /* LINES & COLS from environment?   */
        int             _checkfd;       /* filedesc for typeahead check     */
@@ -1159,6 +1163,7 @@ struct screen {
         */
 #if USE_SIZECHANGE
        int             (*_resize)(NCURSES_SP_DCLx int y, int x);
+       int             (*_ungetch)(SCREEN *, int);
 #endif
 
        /*
@@ -1177,7 +1182,6 @@ struct screen {
        int             *_oldnum_list;
        int             _oldnum_size;
 
-       bool            _cleanup;       /* cleanup after int/quit signal */
        NCURSES_SP_OUTC _outch;         /* output handler if not putc */
 
        int             _legacy_coding; /* see use_legacy_coding() */
@@ -1216,6 +1220,8 @@ struct screen {
         */
        bool            _screen_acs_fix;
 #endif
+
+       bool            _use_tioctl;
 };
 
 extern NCURSES_EXPORT_VAR(SCREEN *) _nc_screen_chain;
@@ -1379,9 +1385,9 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 #define PUTC_DATA      char PUTC_buf[MB_LEN_MAX]; int PUTC_i, PUTC_n; \
                        mbstate_t PUT_st; wchar_t PUTC_ch
 #define PUTC_INIT      init_mb (PUT_st)
-#define PUTC(ch,b)     do { if(!isWidecExt(ch)) {                                  \
+#define PUTC(ch)       do { if(!isWidecExt(ch)) {                                  \
                        if (Charable(ch)) {                                         \
-                           fputc(CharOf(ch), b);                                   \
+                           NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx CharOf(ch)); \
                            COUNT_OUTCHARS(1);                                      \
                        } else {                                                    \
                            PUTC_INIT;                                              \
@@ -1393,10 +1399,14 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
                                                       (ch).chars[PUTC_i], &PUT_st); \
                                if (PUTC_n <= 0) {                                  \
                                    if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \
-                                       putc(PUTC_ch,b);                            \
+                                       NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx CharOf(ch)); \
                                    break;                                          \
+                               } else {                                            \
+                                   int PUTC_j;                                     \
+                                   for (PUTC_j = 0; PUTC_j < PUTC_n; ++PUTC_j) {   \
+                                       NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx PUTC_buf[PUTC_j]); \
+                                   }                                               \
                                }                                                   \
-                               IGNORE_RC(fwrite(PUTC_buf, (size_t) PUTC_n, (size_t) 1, b)); \
                            }                                                       \
                            COUNT_OUTCHARS(PUTC_i);                                 \
                        } } } while (0)
@@ -1440,8 +1450,8 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 #define CHDEREF(wch)   wch
 #define ARG_CH_T       NCURSES_CH_T
 #define CARG_CH_T      NCURSES_CH_T
-#define PUTC_DATA      int data = 0
-#define PUTC(ch,b)     do { data = CharOf(ch); putc(data,b); } while (0)
+#define PUTC_DATA      /* nothing */
+#define PUTC(ch)       NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx ch)
 
 #define BLANK          (' '|A_NORMAL)
 #define ZEROS          ('\0'|A_NORMAL)
@@ -1957,8 +1967,8 @@ extern NCURSES_EXPORT(int) _nc_outch (int);
 extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *);
 extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *);
 extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const);
-extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int);
 extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *);
+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(void) _nc_do_color (int, int, int, NCURSES_OUTC);
 extern NCURSES_EXPORT(void) _nc_flush (void);
@@ -1972,6 +1982,7 @@ extern NCURSES_EXPORT(void) _nc_make_oldhash (int i);
 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);
+extern NCURSES_EXPORT(void) _nc_setenv_num (const char *, int);
 extern NCURSES_EXPORT(void) _nc_signal_handler (int);
 extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *);
 extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *);