summaryrefslogtreecommitdiff
path: root/lib/libcurses/curses.priv.h
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-10-31 06:30:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-10-31 06:30:32 +0000
commit6b2a1c68ae261f9418c63985441e14381a10cd12 (patch)
tree4ae6e697e6a9c43cbe1974319f6b1f7854838e02 /lib/libcurses/curses.priv.h
parent774a90a035f055fa6dcf304c080c05bf13a095ca (diff)
update to ncurses 4.2-981017
Diffstat (limited to 'lib/libcurses/curses.priv.h')
-rw-r--r--lib/libcurses/curses.priv.h67
1 files changed, 51 insertions, 16 deletions
diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h
index 4c95727e76f..5b66f2a5308 100644
--- a/lib/libcurses/curses.priv.h
+++ b/lib/libcurses/curses.priv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.priv.h,v 1.9 1998/09/17 04:14:30 millert Exp $ */
+/* $OpenBSD: curses.priv.h,v 1.10 1998/10/31 06:30:28 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -35,7 +35,7 @@
/*
- * $From: curses.priv.h,v 1.110 1998/09/12 22:50:21 tom Exp $
+ * $From: curses.priv.h,v 1.123 1998/10/03 23:35:34 tom Exp $
*
* curses.priv.h
*
@@ -119,6 +119,11 @@ extern int errno;
#define USE_QNX_MOUSE 0
#endif
+/* EMX mouse support */
+#ifdef __EMX__
+#define USE_EMX_MOUSE
+#endif
+
#define DEFAULT_MAXCLICK 166
#define EV_MAX 8 /* size of mouse circular event queue */
@@ -137,10 +142,21 @@ extern int errno;
#endif
/*
- * As currently coded, hashmap relies on the scroll-hints logic.
+ * Not all platforms have memmove; some have an equivalent bcopy. (Some may
+ * have neither).
+ */
+#if USE_OK_BCOPY
+#define memmove(d,s,n) bcopy(s,d,n)
+#elif USE_MY_MEMMOVE
+#define memmove(d,s,n) _nc_memmove(d,s,n)
+extern void * _nc_memmove(void *, const void *, size_t);
+#endif
+
+/*
+ * Scroll hints are useless when hashmap is used
*/
#if !USE_SCROLL_HINTS
-#if USE_HASHMAP
+#if !USE_HASHMAP
#define USE_SCROLL_HINTS 1
#else
#define USE_SCROLL_HINTS 0
@@ -177,6 +193,13 @@ struct tries {
#define PAIR_OF(fg, bg) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
/*
+ * Common/troublesome character definitions
+ */
+#define L_BRACE '{'
+#define R_BRACE '}'
+#define S_QUOTE '\''
+
+/*
* Structure for palette tables
*/
@@ -225,6 +248,7 @@ struct screen {
int _ifd; /* input file ptr for screen */
FILE *_ofp; /* output file ptr for screen */
char *_setbuf; /* buffered I/O for output */
+ int _buffered; /* setvbuf uses _setbuf data */
int _checkfd; /* filedesc for typeahead check */
struct term *_term; /* terminal type information */
short _lines; /* screen lines */
@@ -292,6 +316,9 @@ struct screen {
int _rep_cost; /* cost of (repeat_char) */
int _hpa_ch_cost; /* cost of (column_address) */
int _cup_ch_cost; /* cost of (cursor_address) */
+ int _smir_cost; /* cost of (enter_insert_mode) */
+ int _rmir_cost; /* cost of (exit_insert_mode) */
+ int _ip_cost; /* cost of (insert_padding) */
/* used in lib_mvcur.c */
char * _address_cursor;
int _carriage_return_length;
@@ -353,6 +380,9 @@ struct screen {
bool _sig_winch;
SCREEN *_next_screen;
+
+ /* hashes for old and new lines */
+ unsigned long *oldhash, *newhash;
};
extern SCREEN *_nc_screen_chain;
@@ -468,7 +498,6 @@ typedef struct {
#define returnPtr(code) TRACE_RETURN(code,ptr)
#define returnVoid T((T_RETURN(""))); return
#define returnWin(code) TRACE_RETURN(code,win)
-extern unsigned _nc_tracing;
extern WINDOW * _nc_retrace_win(WINDOW *);
extern attr_t _nc_retrace_attr_t(attr_t);
extern char *_nc_retrace_ptr(char *);
@@ -487,6 +516,7 @@ extern void _nc_fifo_dump(void);
#define returnWin(code) return code
#endif
+extern unsigned _nc_tracing;
extern const char *_nc_visbuf2(int, const char *);
#define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch))
@@ -529,9 +559,11 @@ extern const char *_nc_visbuf2(int, const char *);
#define InsCharCost(count) \
((parm_ich != 0) \
? SP->_ich_cost \
- : ((insert_character != 0) \
- ? (SP->_ich1_cost * count) \
- : INFINITY))
+ : ((enter_insert_mode && exit_insert_mode) \
+ ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) \
+ : ((insert_character != 0) \
+ ? (SP->_ich1_cost * count) \
+ : INFINITY)))
#if USE_XMC_SUPPORT
#define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) { \
@@ -601,7 +633,7 @@ extern void _nc_do_xmc_glitch(attr_t);
#endif
/* hardscroll.c */
-#if defined(TRACE) || defined(SCROLLDEBUG)
+#if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
extern void _nc_linedump(void);
#endif
@@ -628,10 +660,6 @@ extern int _nc_has_mouse(void);
/* safe_sprintf.c */
extern char * _nc_printf_string(const char *fmt, va_list ap);
-/* softscroll.c */
-extern void _nc_setup_scroll(void);
-extern void _nc_perform_scroll(void);
-
/* tries.c */
extern void _nc_add_to_try(struct tries **tree, char *str, unsigned short code);
extern char *_nc_expand_try(struct tries *tree, unsigned short code, size_t len);
@@ -639,10 +667,12 @@ extern int _nc_remove_key(struct tries **tree, unsigned short code);
/* elsewhere ... */
extern WINDOW *_nc_makenew(int, int, int, int, int);
+extern char *_nc_home_terminfo(void);
extern char *_nc_trace_buf(int, size_t);
extern chtype _nc_background(WINDOW *);
extern chtype _nc_render(WINDOW *, chtype);
extern int _nc_access(const char *, int);
+extern int _nc_getenv_num(const char *);
extern int _nc_keypad(bool);
extern int _nc_outch(int);
extern int _nc_setupscreen(short, short const, FILE *);
@@ -652,7 +682,9 @@ extern void _nc_do_color(int, bool, int (*)(int));
extern void _nc_freeall(void);
extern void _nc_freewin(WINDOW *win);
extern void _nc_hash_map(void);
+extern void _nc_make_oldhash(int i);
extern void _nc_outstr(const char *str);
+extern void _nc_scroll_oldhash(int n, int top, int bot);
extern void _nc_scroll_optimize(void);
extern void _nc_scroll_window(WINDOW *, int const, short const, short const, chtype);
extern void _nc_set_buffer(FILE *ofp, bool buffered);
@@ -663,8 +695,11 @@ extern void _nc_synchook(WINDOW *win);
extern void _nc_update_screensize(void);
#endif
+/* scroll indices */
+extern int *_nc_oldnums;
+
#define NC_BUFFERED(flag) \
- if ((SP->_setbuf == 0) != flag) \
+ if ((SP->_buffered != 0) != flag) \
_nc_set_buffer(SP->_ofp, flag)
/*
@@ -699,8 +734,8 @@ extern SCREEN *SP;
extern int _nc_slk_format; /* != 0 if slk_init() called */
extern int _nc_slk_initialize(WINDOW *, int);
-/*
- * Some constants related to SLK's
+/*
+ * Some constants related to SLK's
*/
#define MAX_SKEY_OLD 8 /* count of soft keys */
#define MAX_SKEY_LEN_OLD 8 /* max length of soft key text */