X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2Fcurses.h.in;h=988f3d333125dd664ad6a147a0a52c3127eaf06e;hp=30da31a5aa8905b58eee132fb1599879680460a5;hb=048a1c1a65c6d98d92fca97f8d175d10d21091d0;hpb=f8a14dc01262d11475f9e4713a64567ae8f7fccc diff --git a/include/curses.h.in b/include/curses.h.in index 30da31a5..988f3d33 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 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 * @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.238 2014/03/15 19:04:15 tom Exp $ */ +/* $Id: curses.h.in,v 1.245 2017/01/21 23:06:27 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -59,6 +59,10 @@ */ #include +#if @HAVE_STDINT_H@ +#include +#endif + /* * User-definable tweak to disable the include of . */ @@ -70,12 +74,6 @@ * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses * configured using --disable-macros. */ -#ifdef NCURSES_NOMACROS -#ifndef NCURSES_ATTR_T -#define NCURSES_ATTR_T attr_t -#endif -#endif /* NCURSES_NOMACROS */ - #ifndef NCURSES_ATTR_T #define NCURSES_ATTR_T int #endif @@ -112,6 +110,15 @@ #define NCURSES_OPAQUE @NCURSES_OPAQUE@ #endif +/* + * Definition used to optionally suppress wattr* macros to help with the + * transition from ncurses5 to ncurses6 by allowing the header files to + * be shared across development packages for ncursesw in both ABIs. + */ +#ifndef NCURSES_WATTR_MACROS +#define NCURSES_WATTR_MACROS @NCURSES_WATTR_MACROS@ +#endif + /* * The reentrant code relies on the opaque setting, but adds features. */ @@ -144,6 +151,13 @@ #undef NCURSES_TPARM_ARG #define NCURSES_TPARM_ARG @NCURSES_TPARM_ARG@ +/* + * Control whether ncurses uses wcwidth() for checking width of line-drawing + * characters. + */ +#undef NCURSES_WCWIDTH_GRAPHICS +#define NCURSES_WCWIDTH_GRAPHICS @NCURSES_WCWIDTH_GRAPHICS@ + /* * NCURSES_CH_T is used in building the library, but not used otherwise in * this header file, since that would make the normal/wide-character versions @@ -156,8 +170,8 @@ typedef unsigned chtype; typedef unsigned mmask_t; #else -typedef unsigned @cf_cv_typeof_chtype@ chtype; -typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t; +typedef @cf_cv_typeof_chtype@ chtype; +typedef @cf_cv_typeof_mmask_t@ mmask_t; #endif /* @@ -1148,9 +1162,10 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL) #if !NCURSES_OPAQUE +#if NCURSES_WATTR_MACROS #if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@ #define wattrset(win,at) ((win) \ - ? ((win)->_color = PAIR_NUMBER(at), \ + ? ((win)->_color = NCURSES_CAST(int, PAIR_NUMBER(at)), \ (win)->_attrs = NCURSES_CAST(attr_t, at), \ OK) \ : ERR) @@ -1160,6 +1175,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* OK) \ : ERR) #endif +#endif /* NCURSES_WATTR_MACROS */ #endif /* NCURSES_OPAQUE */ #define scroll(win) wscrl(win,1) @@ -1187,7 +1203,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* /* * These apply to the first 256 color pairs. */ -#define COLOR_PAIR(n) NCURSES_BITS((n), 0) +#define COLOR_PAIR(n) (NCURSES_BITS((n), 0) & A_COLOR) #define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,(a)) & A_COLOR) >> NCURSES_ATTR_SHIFT))) /* @@ -1199,13 +1215,13 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #define addchstr(str) waddchstr(stdscr,(str)) #define addnstr(str,n) waddnstr(stdscr,(str),(n)) #define addstr(str) waddnstr(stdscr,(str),-1) -#define attroff(at) wattroff(stdscr,(at)) -#define attron(at) wattron(stdscr,(at)) -#define attrset(at) wattrset(stdscr,(at)) #define attr_get(ap,cp,o) wattr_get(stdscr,(ap),(cp),(o)) #define attr_off(a,o) wattr_off(stdscr,(a),(o)) #define attr_on(a,o) wattr_on(stdscr,(a),(o)) #define attr_set(a,c,o) wattr_set(stdscr,(a),(c),(o)) +#define attroff(at) wattroff(stdscr,(at)) +#define attron(at) wattron(stdscr,(at)) +#define attrset(at) wattrset(stdscr,(at)) #define bkgd(ch) wbkgd(stdscr,(ch)) #define bkgdset(ch) wbkgdset(stdscr,(ch)) #define chgat(n,a,c,o) wchgat(stdscr,(n),(a),(c),(o)) @@ -1248,8 +1264,8 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #define mvwaddchstr(win,y,x,str) (wmove((win),(y),(x)) == ERR ? ERR : waddchnstr((win),(str),-1)) #define mvwaddnstr(win,y,x,str,n) (wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),(n))) #define mvwaddstr(win,y,x,str) (wmove((win),(y),(x)) == ERR ? ERR : waddnstr((win),(str),-1)) -#define mvwdelch(win,y,x) (wmove((win),(y),(x)) == ERR ? ERR : wdelch(win)) #define mvwchgat(win,y,x,n,a,c,o) (wmove((win),(y),(x)) == ERR ? ERR : wchgat((win),(n),(a),(c),(o))) +#define mvwdelch(win,y,x) (wmove((win),(y),(x)) == ERR ? ERR : wdelch(win)) #define mvwgetch(win,y,x) (wmove((win),(y),(x)) == ERR ? ERR : wgetch(win)) #define mvwgetnstr(win,y,x,str,n) (wmove((win),(y),(x)) == ERR ? ERR : wgetnstr((win),(str),(n))) #define mvwgetstr(win,y,x,str) (wmove((win),(y),(x)) == ERR ? ERR : wgetstr((win),(str))) @@ -1296,6 +1312,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* #define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) #if !NCURSES_OPAQUE +#if NCURSES_WATTR_MACROS #if NCURSES_WIDECHAR && @NCURSES_EXT_COLORS@ #define wattr_set(win,a,p,opts) (((win) \ ? ((win)->_attrs = ((a) & ~A_COLOR), \ @@ -1314,6 +1331,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* (void)(((p) != (void *)0) ? (*(p) = (NCURSES_PAIRS_T) ((win) ? PAIR_NUMBER((win)->_attrs) : 0)) : OK), \ OK) #endif +#endif /* NCURSES_WATTR_MACROS */ #endif /* NCURSES_OPAQUE */ /*