X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=include%2Fcurses.h.in;h=3bf96952fb7506d42929289428ae04a0289bea14;hb=643ec2bf782cd02efafe3ccdeaea8920a404645e;hp=743ff98c2bf184d5cf2b8070322bf2967269f14c;hpb=0de8912c1c0746eb37b733e9e6fdf852aab9506a;p=ncurses.git diff --git a/include/curses.h.in b/include/curses.h.in index 743ff98c..3bf96952 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * + * Copyright 2018-2020,2021 Thomas E. Dickey * + * Copyright 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,11 +33,39 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.264 2019/03/23 23:06:46 tom Exp $ */ +/* $Id: curses.h.in,v 1.276 2021/08/29 09:30:34 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H +/* + The symbols beginning NCURSES_ or USE_ are configuration choices. + A few of the former can be overridden by applications at compile-time. + Most of the others correspond to configure-script options (or checks + by the configure-script for features of the system on which it is built). + + These symbols can be overridden by applications at compile-time: + NCURSES_NOMACROS suppresses macro definitions in favor of functions + NCURSES_WATTR_MACROS suppresses wattr_* macro definitions + NCURSES_WIDECHAR is an alternative for declaring wide-character functions. + + These symbols are used only when building ncurses: + NCURSES_ATTR_T + NCURSES_FIELD_INTERNALS + NCURSES_INTERNALS + + These symbols are set by the configure script: + NCURSES_ENABLE_STDBOOL_H + NCURSES_EXPANDED + NCURSES_EXT_COLORS + NCURSES_EXT_FUNCS + NCURSES_EXT_PUTWIN + NCURSES_NO_PADDING + NCURSES_OSPEED_COMPAT + NCURSES_PATHSEP + NCURSES_REENTRANT + */ + #define CURSES 1 #define CURSES_H 1 @@ -59,10 +88,22 @@ */ #include +/* + * Extra headers. + */ #if @HAVE_STDINT_H@ #include #endif +#ifdef __cplusplus +#else +#if @HAVE_STDNORETURN_H@ +#include +#undef GCC_NORETURN +#define GCC_NORETURN _Noreturn +#endif +#endif + /* * User-definable tweak to disable the include of . */ @@ -129,6 +170,14 @@ #define NCURSES_REENTRANT @cf_cv_enable_reentrant@ #endif +/* + * In certain environments, we must work around linker problems for data + */ +#undef NCURSES_BROKEN_LINKER +#if @BROKEN_LINKER@ +#define NCURSES_BROKEN_LINKER 1 +#endif + /* * Control whether bindings for interop support are added. */ @@ -488,55 +537,6 @@ struct _win_st }; #endif /* NCURSES_OPAQUE */ -/* - * This is an extension to support events... - */ -#if @NCURSES_EXT_FUNCS@ -#ifdef NCURSES_WGETCH_EVENTS -#if !defined(__BEOS__) || defined(__HAIKU__) - /* Fix _nc_timed_wait() on BEOS... */ -# define NCURSES_EVENT_VERSION 1 -#endif /* !defined(__BEOS__) */ - -/* - * Bits to set in _nc_event.data.flags - */ -# define _NC_EVENT_TIMEOUT_MSEC 1 -# define _NC_EVENT_FILE 2 -# define _NC_EVENT_FILE_READABLE 2 -# if 0 /* Not supported yet... */ -# define _NC_EVENT_FILE_WRITABLE 4 -# define _NC_EVENT_FILE_EXCEPTION 8 -# endif - -typedef struct -{ - int type; - union - { - long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ - struct - { - unsigned int flags; - int fd; - unsigned int result; - } fev; /* _NC_EVENT_FILE */ - } data; -} _nc_event; - -typedef struct -{ - int count; - int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */ - _nc_event *events[1]; -} _nc_eventlist; - -extern NCURSES_EXPORT(int) wgetch_events (WINDOW *, _nc_eventlist *); /* experimental */ -extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *);/* experimental */ - -#endif /* NCURSES_WGETCH_EVENTS */ -#endif /* NCURSES_EXT_FUNCS */ - /* * GCC (and some other compilers) define '__attribute__'; we're using this * macro to alert the compiler to flag inconsistencies in printf/scanf-like @@ -550,14 +550,10 @@ extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *) /* * We cannot define these in ncurses_cfg.h, since they require parameters to be - * passed (that is non-portable). If you happen to be using gcc with warnings - * enabled, define - * GCC_PRINTF - * GCC_SCANF - * to improve checking of calls to printw(), etc. + * passed (that is non-portable). */ #ifndef GCC_PRINTFLIKE -#if defined(GCC_PRINTF) && !defined(printf) +#ifndef printf #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) #else #define GCC_PRINTFLIKE(fmt,var) /*nothing*/ @@ -565,7 +561,7 @@ extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *) #endif #ifndef GCC_SCANFLIKE -#if defined(GCC_SCANF) && !defined(scanf) +#ifndef scanf #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) #else #define GCC_SCANFLIKE(fmt,var) /*nothing*/ @@ -581,7 +577,7 @@ extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *) #endif #undef GCC_DEPRECATED -#if (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) +#if (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) && !defined(NCURSES_INTERNALS) #define GCC_DEPRECATED(msg) __attribute__((deprecated)) #else #define GCC_DEPRECATED(msg) /* nothing */ @@ -813,10 +809,14 @@ extern NCURSES_EXPORT(void) use_tioctl (bool); /* implemented */ extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC); /* implemented */ extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ -extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list) GCC_DEPRECATED(use vw_printw); /* implemented */ -extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* implemented */ -extern NCURSES_EXPORT(int) vwscanw (WINDOW *, const char *,va_list) GCC_DEPRECATED(use vw_scanw); /* implemented */ -extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, const char *,va_list); /* implemented */ +extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_printw) /* implemented */ + GCC_PRINTFLIKE(2,0); +extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *, va_list) /* implemented */ + GCC_PRINTFLIKE(2,0); +extern NCURSES_EXPORT(int) vwscanw (WINDOW *, const char *, va_list) GCC_DEPRECATED(use vw_scanw) /* implemented */ + GCC_SCANFLIKE(2,0); +extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, const char *, va_list) /* implemented */ + GCC_SCANFLIKE(2,0); extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */ extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int); /* implemented */ extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */ @@ -886,7 +886,6 @@ extern NCURSES_EXPORT(int) putp (const char *); /* implemented */ extern NCURSES_EXPORT(char *) tparm (const char *, ...); /* special */ #else extern NCURSES_EXPORT(char *) tparm (const char *, NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG,NCURSES_TPARM_ARG); /* special */ -extern NCURSES_EXPORT(char *) tparm_varargs (const char *, ...); /* special */ #endif extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */