X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2Fcurses.h.in;h=ac5a400a761d04571cc9956b92214a2b0464d862;hp=23201e00ed70cf4a127c448b13b4948675c5760d;hb=77afe78361875f531dc2bf8d73f2e781c8e76176;hpb=2782cd7cf38dc9cfaa9d90b7e66792dbc7537b08 diff --git a/include/curses.h.in b/include/curses.h.in index 23201e00..ac5a400a 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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.195 2009/03/21 21:04:57 tom Exp $ */ +/* $Id: curses.h.in,v 1.208 2010/01/09 19:34:26 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -111,11 +111,10 @@ #endif /* - * For reentrant code, we map the various global variables into SCREEN by - * using functions to access them. + * Control whether bindings for interop support are added. */ -#define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name -#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) +#undef NCURSES_INTEROP_FUNCS +#define NCURSES_INTEROP_FUNCS @NCURSES_INTEROP_FUNCS@ /* * The internal type used for window dimensions. @@ -146,7 +145,6 @@ typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t; #endif #include -#include #include /* we need va_list */ #ifdef _XOPEN_SOURCE_EXTENDED #include /* we want wchar_t */ @@ -352,7 +350,13 @@ typedef unsigned short wchar_t@NCURSES_OK_WCHAR_T@; typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@; #endif -#define CCHARW_MAX 5 +/* + * cchar_t stores an array of CCHARW_MAX wide characters. The first is + * normally a spacing character. The others are non-spacing. If those + * (spacing and nonspacing) do not fill the array, a null L'\0' follows. + * Otherwise, a null is assumed to follow when extracting via getcchar(). + */ +#define CCHARW_MAX @NCURSES_CCHARW_MAX@ typedef struct { attr_t attr; @@ -518,6 +522,12 @@ extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *); #define GCC_UNUSED /* nothing */ #endif +/* + * Curses uses a helper function. Define our type for this to simplify + * extending it for the sp-funcs feature. + */ +typedef int (*NCURSES_OUTC)(int); + /* * Function prototypes. This is the complete X/Open Curses list of required * functions. Those marked `generated' will have sources generated from the @@ -735,7 +745,7 @@ extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ -extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int)); /* 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); /* implemented */ extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* generated */ @@ -813,6 +823,8 @@ extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,l extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */ #endif +extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */ + /* * These functions are not in X/Open, but we use them in macro definitions: */ @@ -846,6 +858,7 @@ extern NCURSES_EXPORT(char *) keybound (int, int); extern NCURSES_EXPORT(const char *) curses_version (void); extern NCURSES_EXPORT(int) assume_default_colors (int, int); extern NCURSES_EXPORT(int) define_key (const char *, int); +extern NCURSES_EXPORT(int) get_escdelay (void); extern NCURSES_EXPORT(int) key_defined (const char *); extern NCURSES_EXPORT(int) keyok (int, bool); extern NCURSES_EXPORT(int) resize_term (int, int); @@ -873,7 +886,9 @@ extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* @GENERATED_EXT_FUNCS extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_pad (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* @GENERATED_EXT_FUNCS@ */ @@ -890,12 +905,17 @@ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* @GENERA #define NCURSES_SP_FUNCS @NCURSES_PATCH@ #define NCURSES_SP_NAME(name) name##_sp +/* Define the sp-funcs helper function */ +#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC) +typedef int (*NCURSES_SP_OUTC)(SCREEN*, int); + extern NCURSES_EXPORT(SCREEN*) new_prescr(void); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented */ @@ -907,6 +927,7 @@ extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented */ +extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay)(SCREEN*, int); /* implemented */ extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented */ @@ -921,12 +942,11 @@ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemente extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented */ extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented */ -extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, NCURSES_CONST char *, FILE *, FILE *); /* implemented */ +extern NCURSES_EXPORT(SCREEN*) NCURSES_SP_NAME(newterm) (SCREEN*, NCURSES_CONST char *, FILE *, FILE *); /* implemented */ extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented */ @@ -935,7 +955,9 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented * extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int)); /* implemented */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented */ @@ -959,13 +981,19 @@ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemente extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented */ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented */ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented */ #if @NCURSES_EXT_FUNCS@ extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*); +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined)(SCREEN*, const char *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool); +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*); @@ -975,6 +1003,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); #undef NCURSES_SP_FUNCS #define NCURSES_SP_FUNCS 0 #define NCURSES_SP_NAME(name) name +#define NCURSES_SP_OUTC NCURSES_OUTC #endif /* attributes */ @@ -1075,9 +1104,11 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); #if !NCURSES_OPAQUE #if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@ #define wattrset(win,at) ((win)->_color = PAIR_NUMBER(at), \ - (win)->_attrs = (at)) + (win)->_attrs = (at), \ + NCURSES_CAST(int, (win)->_attrs)) #else -#define wattrset(win,at) ((win)->_attrs = (at)) +#define wattrset(win,at) ((win)->_attrs = (at), \ + NCURSES_CAST(int, (win)->_attrs)) #endif #endif /* NCURSES_OPAQUE */ @@ -1252,16 +1283,18 @@ NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); */ #if @NCURSES_EXT_FUNCS@ #if !NCURSES_OPAQUE -#define is_cleared(win) ((win)->_clear) -#define is_idcok(win) ((win)->_idcok) -#define is_idlok(win) ((win)->_idlok) -#define is_immedok(win) ((win)->_immed) -#define is_keypad(win) ((win)->_use_keypad) -#define is_leaveok(win) ((win)->_leaveok) -#define is_nodelay(win) ((win)->_delay == 0) -#define is_notimeout(win) ((win)->_notimeout) -#define is_scrollok(win) ((win)->_scroll) -#define is_syncok(win) ((win)->_sync) +#define is_cleared(win) ((win) ? (win)->_clear : FALSE) +#define is_idcok(win) ((win) ? (win)->_idcok : FALSE) +#define is_idlok(win) ((win) ? (win)->_idlok : FALSE) +#define is_immedok(win) ((win) ? (win)->_immed : FALSE) +#define is_keypad(win) ((win) ? (win)->_use_keypad : FALSE) +#define is_leaveok(win) ((win) ? (win)->_leaveok : FALSE) +#define is_nodelay(win) ((win) ? ((win)->_delay == 0) : FALSE) +#define is_notimeout(win) ((win) ? (win)->_notimeout : FALSE) +#define is_pad(win) ((win) ? ((win)->_flags & _ISPAD) != 0 : FALSE) +#define is_scrollok(win) ((win) ? (win)->_scroll : FALSE) +#define is_subwin(win) ((win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE) +#define is_syncok(win) ((win) ? (win)->_sync : FALSE) #define wgetparent(win) ((win) ? (win)->_parent : 0) #define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) #endif