diff options
Diffstat (limited to 'panel')
-rw-r--r-- | panel/Makefile.in | 43 | ||||
-rw-r--r-- | panel/llib-lpanel | 23 | ||||
-rw-r--r-- | panel/llib-lpanelt | 23 | ||||
-rw-r--r-- | panel/llib-lpaneltw | 23 | ||||
-rw-r--r-- | panel/llib-lpanelw | 23 | ||||
-rw-r--r-- | panel/p_above.c | 6 | ||||
-rw-r--r-- | panel/p_below.c | 6 | ||||
-rw-r--r-- | panel/p_bottom.c | 10 | ||||
-rw-r--r-- | panel/p_delete.c | 17 | ||||
-rw-r--r-- | panel/p_hidden.c | 4 | ||||
-rw-r--r-- | panel/p_hide.c | 6 | ||||
-rw-r--r-- | panel/p_move.c | 4 | ||||
-rw-r--r-- | panel/p_new.c | 58 | ||||
-rw-r--r-- | panel/p_replace.c | 4 | ||||
-rw-r--r-- | panel/p_show.c | 10 | ||||
-rw-r--r-- | panel/p_top.c | 4 | ||||
-rw-r--r-- | panel/p_update.c | 6 | ||||
-rw-r--r-- | panel/p_user.c | 10 | ||||
-rw-r--r-- | panel/p_win.c | 4 | ||||
-rw-r--r-- | panel/panel.c | 34 | ||||
-rw-r--r-- | panel/panel.h | 49 | ||||
-rw-r--r-- | panel/panel.priv.h | 22 |
22 files changed, 219 insertions, 170 deletions
diff --git a/panel/Makefile.in b/panel/Makefile.in index 5f7b5b9..380f80c 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.71 2020/02/02 23:34:34 tom Exp $ +# $Id: Makefile.in,v 1.76 2021/07/03 15:45:33 tom Exp $ ############################################################################## -# Copyright 2020 Thomas E. Dickey # +# Copyright 2020,2021 Thomas E. Dickey # # Copyright 1998-2015,2018 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # @@ -92,16 +92,18 @@ ETAGS = @ETAGS@ CC = @CC@ CPP = @CPP@ -CFLAGS = @CFLAGS@ +CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@ -CPPFLAGS = -I${top_srcdir}/ncurses -DHAVE_CONFIG_H @CPPFLAGS@ +INCDIR = $(top_srcdir)/include +BASE_DIR = $(top_srcdir)/ncurses +CPPFLAGS = -I$(BASE_DIR) -DHAVE_CONFIG_H -DBUILDING_PANEL @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) CFLAGS_LIBTOOL = $(CCFLAGS) -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_NORMAL = $(CCFLAGS) -DNCURSES_STATIC +CFLAGS_DEBUG = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -DNCURSES_STATIC -pg CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) @@ -134,6 +136,19 @@ AUTO_SRC = \ ../include/panel.h ################################################################################ + +@MAKE_PHONY@.PHONY : all +@MAKE_PHONY@.PHONY : clean +@MAKE_PHONY@.PHONY : distclean +@MAKE_PHONY@.PHONY : install +@MAKE_PHONY@.PHONY : install.libs +@MAKE_PHONY@.PHONY : libs +@MAKE_PHONY@.PHONY : mostlyclean +@MAKE_PHONY@.PHONY : realclean +@MAKE_PHONY@.PHONY : sources +@MAKE_PHONY@.PHONY : uninstall +@MAKE_PHONY@.PHONY : uninstall.libs + all \ libs \ install :: $(AUTO_SRC) $(LIBRARIES) @@ -151,6 +166,20 @@ $(DESTDIR)$(libdir) : cp $(srcdir)/panel.h $@ HEADER_DEPS = \ + ../include/curses.h \ + ../include/ncurses_cfg.h \ + ../include/ncurses_def.h \ + ../include/ncurses_dll.h \ + ../include/term.h \ + ../include/unctrl.h \ + $(BASE_DIR)/curses.priv.h \ + $(BASE_DIR)/new_pair.h \ + $(INCDIR)/nc_alloc.h \ + $(INCDIR)/nc_panel.h \ + $(INCDIR)/nc_string.h \ + $(INCDIR)/nc_termios.h \ + $(INCDIR)/nc_tparm.h \ + $(INCDIR)/term_entry.h \ $(srcdir)/panel.priv.h \ $(srcdir)/panel.h diff --git a/panel/llib-lpanel b/panel/llib-lpanel index a3cf6f0..afdea20 100644 --- a/panel/llib-lpanel +++ b/panel/llib-lpanel @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2010,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,19 +43,20 @@ PANEL *_nc_retrace_panel( #undef _nc_my_visbuf const char *_nc_my_visbuf( - const void *ptr) + const void *ptr, + int n) { return(*(const char **)0); } #undef _nc_dPanel void _nc_dPanel( - const char *text, + const char *text, const PANEL *pan) { /* void */ } #undef _nc_dStack void _nc_dStack( - const char *fmt, - int num, + const char *fmt, + int num, const PANEL *pan) { /* void */ } @@ -71,8 +72,8 @@ void _nc_Touchpan( #undef _nc_Touchline void _nc_Touchline( - const PANEL *pan, - int start, + const PANEL *pan, + int start, int count) { /* void */ } @@ -132,8 +133,8 @@ int panel_hidden( #undef move_panel int move_panel( - PANEL *pan, - int starty, + PANEL *pan, + int starty, int startx) { return(*(int *)0); } @@ -148,7 +149,7 @@ PANEL *new_panel( #undef replace_panel int replace_panel( - PANEL *pan, + PANEL *pan, WINDOW *win) { return(*(int *)0); } @@ -181,7 +182,7 @@ void update_panels(void) #undef set_panel_userptr int set_panel_userptr( - PANEL *pan, + PANEL *pan, const void *uptr) { return(*(int *)0); } diff --git a/panel/llib-lpanelt b/panel/llib-lpanelt index 331e87a..0b99683 100644 --- a/panel/llib-lpanelt +++ b/panel/llib-lpanelt @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2010,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,19 +43,20 @@ PANEL *_nc_retrace_panel( #undef _nc_my_visbuf const char *_nc_my_visbuf( - const void *ptr) + const void *ptr, + int n) { return(*(const char **)0); } #undef _nc_dPanel void _nc_dPanel( - const char *text, + const char *text, const PANEL *pan) { /* void */ } #undef _nc_dStack void _nc_dStack( - const char *fmt, - int num, + const char *fmt, + int num, const PANEL *pan) { /* void */ } @@ -71,8 +72,8 @@ void _nc_Touchpan( #undef _nc_Touchline void _nc_Touchline( - const PANEL *pan, - int start, + const PANEL *pan, + int start, int count) { /* void */ } @@ -132,8 +133,8 @@ int panel_hidden( #undef move_panel int move_panel( - PANEL *pan, - int starty, + PANEL *pan, + int starty, int startx) { return(*(int *)0); } @@ -148,7 +149,7 @@ PANEL *new_panel( #undef replace_panel int replace_panel( - PANEL *pan, + PANEL *pan, WINDOW *win) { return(*(int *)0); } @@ -181,7 +182,7 @@ void update_panels(void) #undef set_panel_userptr int set_panel_userptr( - PANEL *pan, + PANEL *pan, const void *uptr) { return(*(int *)0); } diff --git a/panel/llib-lpaneltw b/panel/llib-lpaneltw index 331e87a..0b99683 100644 --- a/panel/llib-lpaneltw +++ b/panel/llib-lpaneltw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2010,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,19 +43,20 @@ PANEL *_nc_retrace_panel( #undef _nc_my_visbuf const char *_nc_my_visbuf( - const void *ptr) + const void *ptr, + int n) { return(*(const char **)0); } #undef _nc_dPanel void _nc_dPanel( - const char *text, + const char *text, const PANEL *pan) { /* void */ } #undef _nc_dStack void _nc_dStack( - const char *fmt, - int num, + const char *fmt, + int num, const PANEL *pan) { /* void */ } @@ -71,8 +72,8 @@ void _nc_Touchpan( #undef _nc_Touchline void _nc_Touchline( - const PANEL *pan, - int start, + const PANEL *pan, + int start, int count) { /* void */ } @@ -132,8 +133,8 @@ int panel_hidden( #undef move_panel int move_panel( - PANEL *pan, - int starty, + PANEL *pan, + int starty, int startx) { return(*(int *)0); } @@ -148,7 +149,7 @@ PANEL *new_panel( #undef replace_panel int replace_panel( - PANEL *pan, + PANEL *pan, WINDOW *win) { return(*(int *)0); } @@ -181,7 +182,7 @@ void update_panels(void) #undef set_panel_userptr int set_panel_userptr( - PANEL *pan, + PANEL *pan, const void *uptr) { return(*(int *)0); } diff --git a/panel/llib-lpanelw b/panel/llib-lpanelw index 463a02e..7ed8b3c 100644 --- a/panel/llib-lpanelw +++ b/panel/llib-lpanelw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2002-2010,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -43,19 +43,20 @@ PANEL *_nc_retrace_panel( #undef _nc_my_visbuf const char *_nc_my_visbuf( - const void *ptr) + const void *ptr, + int n) { return(*(const char **)0); } #undef _nc_dPanel void _nc_dPanel( - const char *text, + const char *text, const PANEL *pan) { /* void */ } #undef _nc_dStack void _nc_dStack( - const char *fmt, - int num, + const char *fmt, + int num, const PANEL *pan) { /* void */ } @@ -71,8 +72,8 @@ void _nc_Touchpan( #undef _nc_Touchline void _nc_Touchline( - const PANEL *pan, - int start, + const PANEL *pan, + int start, int count) { /* void */ } @@ -132,8 +133,8 @@ int panel_hidden( #undef move_panel int move_panel( - PANEL *pan, - int starty, + PANEL *pan, + int starty, int startx) { return(*(int *)0); } @@ -148,7 +149,7 @@ PANEL *new_panel( #undef replace_panel int replace_panel( - PANEL *pan, + PANEL *pan, WINDOW *win) { return(*(int *)0); } @@ -181,7 +182,7 @@ void update_panels(void) #undef set_panel_userptr int set_panel_userptr( - PANEL *pan, + PANEL *pan, const void *uptr) { return(*(int *)0); } diff --git a/panel/p_above.c b/panel/p_above.c index 12b5b87..2a6fde5 100644 --- a/panel/p_above.c +++ b/panel/p_above.c @@ -37,10 +37,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.10 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_above.c,v 1.11 2020/05/24 01:40:20 anonymous.maarten Exp $") #if NCURSES_SP_FUNCS -NCURSES_EXPORT(PANEL *) +PANEL_EXPORT(PANEL *) ground_panel(SCREEN * sp) { T((T_CALLED("ground_panel(%p)"), (void *)sp)); @@ -63,7 +63,7 @@ ground_panel(SCREEN * sp) } #endif -NCURSES_EXPORT(PANEL *) +PANEL_EXPORT(PANEL *) panel_above(const PANEL * pan) { PANEL *result; diff --git a/panel/p_below.c b/panel/p_below.c index a8b1ef4..100393d 100644 --- a/panel/p_below.c +++ b/panel/p_below.c @@ -37,10 +37,10 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.10 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_below.c,v 1.11 2020/05/24 01:40:20 anonymous.maarten Exp $") #if NCURSES_SP_FUNCS -NCURSES_EXPORT(PANEL *) +PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN * sp) { T((T_CALLED("ceiling_panel(%p)"), (void *)sp)); @@ -61,7 +61,7 @@ ceiling_panel(SCREEN * sp) } #endif -NCURSES_EXPORT(PANEL *) +PANEL_EXPORT(PANEL *) panel_below(const PANEL * pan) { PANEL *result; diff --git a/panel/p_bottom.c b/panel/p_bottom.c index a69ac9f..3ca9c77 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -34,13 +34,13 @@ ****************************************************************************/ /* p_bottom.c - * Place a panel on bottom of the stack; may already be in the stack + * Place a panel on bottom of the stack; may already be in the stack */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.14 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.17 2021/06/17 21:20:30 tom Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) bottom_panel(PANEL * pan) { int err = OK; @@ -52,7 +52,7 @@ bottom_panel(PANEL * pan) if (!Is_Bottom(pan)) { - dBug(("--> bottom_panel %s", USER_PTR(pan->user))); + dBug(("--> bottom_panel %s", USER_PTR(pan->user, 1))); HIDE_PANEL(pan, err, OK); assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); diff --git a/panel/p_delete.c b/panel/p_delete.c index 6b122a6..da3dcdf 100644 --- a/panel/p_delete.c +++ b/panel/p_delete.c @@ -38,22 +38,21 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_delete.c,v 1.11 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_delete.c,v 1.17 2020/12/26 18:25:34 tom Exp $") -NCURSES_EXPORT(int) -del_panel(PANEL * pan) +PANEL_EXPORT(int) +del_panel(PANEL *pan) { int err = OK; T((T_CALLED("del_panel(%p)"), (void *)pan)); if (pan) { - dBug(("--> del_panel %s", USER_PTR(pan->user))); - { - GetHook(pan); - HIDE_PANEL(pan, err, OK); - free((void *)pan); - } + GetHook(pan); + HIDE_PANEL(pan, err, OK); + dBug(("...discard ptr=%s", USER_PTR(pan->user, 1))); + dBug(("...deleted pan=%p", (void *)pan)); + free((void *)pan); } else err = ERR; diff --git a/panel/p_hidden.c b/panel/p_hidden.c index ddb23b1..43057fa 100644 --- a/panel/p_hidden.c +++ b/panel/p_hidden.c @@ -38,9 +38,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.10 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.11 2020/05/24 01:40:20 anonymous.maarten Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) panel_hidden(const PANEL * pan) { int rc = ERR; diff --git a/panel/p_hide.c b/panel/p_hide.c index fc26f75..6a372ac 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -37,9 +37,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.12 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_hide.c,v 1.14 2020/09/26 18:02:35 tom Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) hide_panel(register PANEL * pan) { int err = ERR; @@ -50,7 +50,7 @@ hide_panel(register PANEL * pan) { GetHook(pan); - dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dBug(("--> hide_panel %s", USER_PTR(pan->user, 1))); dStack("<u%d>", 1, pan); HIDE_PANEL(pan, err, ERR); diff --git a/panel/p_move.c b/panel/p_move.c index 02830bf..7ff6fa7 100644 --- a/panel/p_move.c +++ b/panel/p_move.c @@ -38,9 +38,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.12 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_move.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) move_panel(PANEL * pan, int starty, int startx) { int rc = ERR; diff --git a/panel/p_new.c b/panel/p_new.c index d2f8d03..37f851d 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -35,15 +35,33 @@ ****************************************************************************/ /* p_new.c - * Creation of a new panel + * Creation of a new panel */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.17 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.23 2021/06/17 21:20:30 tom Exp $") #ifdef TRACE static char *stdscr_id; static char *new_id; + +static PANEL * +AllocPanel(const char *name) +{ + PANEL *result = typeMalloc(PANEL, 1); + + _tracef("create :%s %p", name, (void *)result); + return result; +} +#define InitUser(name) \ + if (!name ## _id) \ + name ## _id = strdup(#name); \ + pan->user = name ## _id; \ + _tracef("create :user_ptr %p", pan->user) +#else +#define AllocPanel(name) typeMalloc(PANEL, 1) +#define InitUser(name) \ + pan->user = (void *)0 #endif /*+------------------------------------------------------------------------- @@ -60,39 +78,33 @@ root_panel(NCURSES_SP_DCL0) struct panelhook *ph = _nc_panelhook(); #endif - if (_nc_stdscr_pseudo_panel == (PANEL *) 0) + if (_nc_stdscr_pseudo_panel == (PANEL *)0) { assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel); #if NO_LEAKS ph->destroy = del_panel; #endif - _nc_stdscr_pseudo_panel = typeMalloc(PANEL, 1); + _nc_stdscr_pseudo_panel = AllocPanel("root_panel"); if (_nc_stdscr_pseudo_panel != 0) { PANEL *pan = _nc_stdscr_pseudo_panel; WINDOW *win = SP_PARM->_stdscr; pan->win = win; - pan->below = (PANEL *) 0; - pan->above = (PANEL *) 0; -#ifdef TRACE - if (!stdscr_id) - stdscr_id = strdup("stdscr"); - pan->user = stdscr_id; -#else - pan->user = (void *)0; -#endif + pan->below = (PANEL *)0; + pan->above = (PANEL *)0; + InitUser(stdscr); _nc_bottom_panel = _nc_top_panel = pan; } } return _nc_stdscr_pseudo_panel; } -NCURSES_EXPORT(PANEL *) +PANEL_EXPORT(PANEL *) new_panel(WINDOW *win) { - PANEL *pan = (PANEL *) 0; + PANEL *pan = (PANEL *)0; GetWindowHook(win); @@ -105,18 +117,12 @@ new_panel(WINDOW *win) (void)root_panel(NCURSES_SP_ARG); assert(_nc_stdscr_pseudo_panel); - if (!(win->_flags & _ISPAD) && (pan = typeMalloc(PANEL, 1))) + if (!(win->_flags & _ISPAD) && (pan = AllocPanel("new_panel"))) { pan->win = win; - pan->above = (PANEL *) 0; - pan->below = (PANEL *) 0; -#ifdef TRACE - if (!new_id) - new_id = strdup("new"); - pan->user = new_id; -#else - pan->user = (char *)0; -#endif + pan->above = (PANEL *)0; + pan->below = (PANEL *)0; + InitUser(new); (void)show_panel(pan); } returnPanel(pan); diff --git a/panel/p_replace.c b/panel/p_replace.c index 5acbccf..a2d56ae 100644 --- a/panel/p_replace.c +++ b/panel/p_replace.c @@ -37,9 +37,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.12 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_replace.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) replace_panel(PANEL * pan, WINDOW *win) { int rc = ERR; diff --git a/panel/p_show.c b/panel/p_show.c index 933bf5a..3503bec 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -33,13 +33,13 @@ ****************************************************************************/ /* p_show.c - * Place a panel on top of the stack; may already be in the stack + * Place a panel on top of the stack; may already be in the stack */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.14 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.17 2021/06/17 21:20:30 tom Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) show_panel(PANEL * pan) { int err = ERR; @@ -53,7 +53,7 @@ show_panel(PANEL * pan) if (Is_Top(pan)) returnCode(OK); - dBug(("--> show_panel %s", USER_PTR(pan->user))); + dBug(("--> show_panel %s", USER_PTR(pan->user, 1))); HIDE_PANEL(pan, err, OK); diff --git a/panel/p_top.c b/panel/p_top.c index 09e89fc..17abd76 100644 --- a/panel/p_top.c +++ b/panel/p_top.c @@ -37,9 +37,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_top.c,v 1.7 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_top.c,v 1.8 2020/05/24 01:40:20 anonymous.maarten Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) top_panel(PANEL * pan) { T((T_CALLED("top_panel(%p)"), (void *)pan)); diff --git a/panel/p_update.c b/panel/p_update.c index 3fe4770..4021296 100644 --- a/panel/p_update.c +++ b/panel/p_update.c @@ -38,9 +38,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.12 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_update.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $") -NCURSES_EXPORT(void) +PANEL_EXPORT(void) NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) { PANEL *pan; @@ -71,7 +71,7 @@ NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) } #if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) +PANEL_EXPORT(void) update_panels(void) { NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); diff --git a/panel/p_user.c b/panel/p_user.c index 633431e..8d65097 100644 --- a/panel/p_user.c +++ b/panel/p_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -33,13 +33,13 @@ ****************************************************************************/ /* p_user.c - * Set/Get panels user pointer + * Set/Get panels user pointer */ #include "panel.priv.h" -MODULE_ID("$Id: p_user.c,v 1.9 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_user.c,v 1.11 2021/06/17 21:20:30 tom Exp $") -NCURSES_EXPORT(int) +PANEL_EXPORT(int) set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) { T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); @@ -49,7 +49,7 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) returnCode(OK); } -NCURSES_EXPORT(NCURSES_CONST void *) +PANEL_EXPORT(NCURSES_CONST void *) panel_userptr(const PANEL * pan) { T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); diff --git a/panel/p_win.c b/panel/p_win.c index 023a71c..d188988 100644 --- a/panel/p_win.c +++ b/panel/p_win.c @@ -37,9 +37,9 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_win.c,v 1.7 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: p_win.c,v 1.8 2020/05/24 01:40:20 anonymous.maarten Exp $") -NCURSES_EXPORT(WINDOW *) +PANEL_EXPORT(WINDOW *) panel_window(const PANEL * pan) { T((T_CALLED("panel_window(%p)"), (const void *)pan)); diff --git a/panel/panel.c b/panel/panel.c index a0e632d..1b2d6e8 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -37,13 +37,13 @@ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.27 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: panel.c,v 1.30 2020/09/26 18:05:17 tom Exp $") /*+------------------------------------------------------------------------- _nc_retrace_panel (pan) --------------------------------------------------------------------------*/ #ifdef TRACE -NCURSES_EXPORT(PANEL *) +PANEL_EXPORT(PANEL *) _nc_retrace_panel(PANEL * pan) { T((T_RETURN("%p"), (void *)pan)); @@ -56,16 +56,16 @@ _nc_retrace_panel(PANEL * pan) --------------------------------------------------------------------------*/ #ifdef TRACE #ifndef TRACE_TXT -NCURSES_EXPORT(const char *) -_nc_my_visbuf(const void *ptr) +PANEL_EXPORT(const char *) +_nc_my_visbuf(const void *ptr, int n) { char temp[32]; if (ptr != 0) - _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "ptr:%p", ptr); + _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "%p", ptr); else _nc_STRCPY(temp, "<null>", sizeof(temp)); - return _nc_visbuf(temp); + return _nc_visbuf2(n, temp); } #endif #endif @@ -74,13 +74,13 @@ _nc_my_visbuf(const void *ptr) dPanel(text,pan) --------------------------------------------------------------------------*/ #ifdef TRACE -NCURSES_EXPORT(void) +PANEL_EXPORT(void) _nc_dPanel(const char *text, const PANEL * pan) { _tracef("%s id=%s b=%s a=%s y=%d x=%d", - text, USER_PTR(pan->user), - (pan->below) ? USER_PTR(pan->below->user) : "--", - (pan->above) ? USER_PTR(pan->above->user) : "--", + text, USER_PTR(pan->user, 1), + (pan->below) ? USER_PTR(pan->below->user, 2) : "--", + (pan->above) ? USER_PTR(pan->above->user, 3) : "--", PSTARTY(pan), PSTARTX(pan)); } #endif @@ -89,7 +89,7 @@ _nc_dPanel(const char *text, const PANEL * pan) dStack(fmt,num,pan) --------------------------------------------------------------------------*/ #ifdef TRACE -NCURSES_EXPORT(void) +PANEL_EXPORT(void) _nc_dStack(const char *fmt, int num, const PANEL * pan) { char s80[80]; @@ -98,10 +98,10 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) _nc_SPRINTF(s80, _nc_SLIMIT(sizeof(s80)) fmt, num, pan); _tracef("%s b=%s t=%s", s80, - (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--", - (_nc_top_panel) ? USER_PTR(_nc_top_panel->user) : "--"); + (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user, 1) : "--", + (_nc_top_panel) ? USER_PTR(_nc_top_panel->user, 2) : "--"); if (pan) - _tracef("pan id=%s", USER_PTR(pan->user)); + _tracef("pan id=%s", USER_PTR(pan->user, 1)); pan = _nc_bottom_panel; while (pan) { @@ -115,7 +115,7 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) Wnoutrefresh(pan) - debugging hook for wnoutrefresh --------------------------------------------------------------------------*/ #ifdef TRACE -NCURSES_EXPORT(void) +PANEL_EXPORT(void) _nc_Wnoutrefresh(const PANEL * pan) { dPanel("wnoutrefresh", pan); @@ -127,7 +127,7 @@ _nc_Wnoutrefresh(const PANEL * pan) Touchpan(pan) --------------------------------------------------------------------------*/ #ifdef TRACE -NCURSES_EXPORT(void) +PANEL_EXPORT(void) _nc_Touchpan(const PANEL * pan) { dPanel("Touchpan", pan); @@ -139,7 +139,7 @@ _nc_Touchpan(const PANEL * pan) Touchline(pan,start,count) --------------------------------------------------------------------------*/ #ifdef TRACE -NCURSES_EXPORT(void) +PANEL_EXPORT(void) _nc_Touchline(const PANEL * pan, int start, int count) { char s80[80]; diff --git a/panel/panel.h b/panel/panel.h index 2eebe17..62acc8f 100644 --- a/panel/panel.h +++ b/panel/panel.h @@ -33,7 +33,7 @@ * and: Juergen Pfeifer 1996-1999,2008 * ****************************************************************************/ -/* $Id: panel.h,v 1.13 2020/02/02 23:34:34 tom Exp $ */ +/* $Id: panel.h,v 1.14 2020/07/04 20:38:43 tom Exp $ */ /* panel.h -- interface file for panels library */ @@ -57,27 +57,38 @@ PANEL; extern "C" { #endif -extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); -extern NCURSES_EXPORT(void) update_panels (void); -extern NCURSES_EXPORT(int) hide_panel (PANEL *); -extern NCURSES_EXPORT(int) show_panel (PANEL *); -extern NCURSES_EXPORT(int) del_panel (PANEL *); -extern NCURSES_EXPORT(int) top_panel (PANEL *); -extern NCURSES_EXPORT(int) bottom_panel (PANEL *); -extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); -extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); -extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); -extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); -extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); -extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); -extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); -extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); +#if defined(BUILDING_PANEL) +# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT +#else +# define PANEL_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT +#endif + +#define PANEL_WRAPPED_VAR(type,name) extern PANEL_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) + +#define PANEL_EXPORT(type) PANEL_IMPEXP type NCURSES_API +#define PANEL_EXPORT_VAR(type) PANEL_IMPEXP type + +extern PANEL_EXPORT(WINDOW*) panel_window (const PANEL *); +extern PANEL_EXPORT(void) update_panels (void); +extern PANEL_EXPORT(int) hide_panel (PANEL *); +extern PANEL_EXPORT(int) show_panel (PANEL *); +extern PANEL_EXPORT(int) del_panel (PANEL *); +extern PANEL_EXPORT(int) top_panel (PANEL *); +extern PANEL_EXPORT(int) bottom_panel (PANEL *); +extern PANEL_EXPORT(PANEL*) new_panel (WINDOW *); +extern PANEL_EXPORT(PANEL*) panel_above (const PANEL *); +extern PANEL_EXPORT(PANEL*) panel_below (const PANEL *); +extern PANEL_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); +extern PANEL_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); +extern PANEL_EXPORT(int) move_panel (PANEL *, int, int); +extern PANEL_EXPORT(int) replace_panel (PANEL *,WINDOW *); +extern PANEL_EXPORT(int) panel_hidden (const PANEL *); #if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); -extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); +extern PANEL_EXPORT(PANEL *) ground_panel(SCREEN *); +extern PANEL_EXPORT(PANEL *) ceiling_panel(SCREEN *); -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); +extern PANEL_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); #endif #if defined(__cplusplus) diff --git a/panel/panel.priv.h b/panel/panel.priv.h index c8e3ea7..029a4f3 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.28 2020/02/02 23:34:34 tom Exp $ */ +/* $Id: panel.priv.h,v 1.30 2020/09/26 18:05:32 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 @@ -50,21 +50,21 @@ struct screen; /* forward declaration */ #include "panel.h" #ifdef TRACE - extern NCURSES_EXPORT(const char *) _nc_my_visbuf (const void *); + extern PANEL_EXPORT(const char *) _nc_my_visbuf (const void *, int); # ifdef TRACE_TXT -# define USER_PTR(ptr) _nc_visbuf((const char *)ptr) +# define USER_PTR(ptr,n) _nc_visbuf2(n, (const char *)ptr) # else -# define USER_PTR(ptr) _nc_my_visbuf((const char *)ptr) +# define USER_PTR(ptr,n) _nc_my_visbuf((const char *)ptr, n) # endif # define returnPanel(code) TRACE_RETURN1(code,panel) - extern NCURSES_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); - extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*); - extern NCURSES_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); - extern NCURSES_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); - extern NCURSES_EXPORT(void) _nc_Touchpan (const PANEL*); - extern NCURSES_EXPORT(void) _nc_Touchline (const PANEL*, int, int); + extern PANEL_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); + extern PANEL_EXPORT(void) _nc_dPanel (const char*, const PANEL*); + extern PANEL_EXPORT(void) _nc_dStack (const char*, int, const PANEL*); + extern PANEL_EXPORT(void) _nc_Wnoutrefresh (const PANEL*); + extern PANEL_EXPORT(void) _nc_Touchpan (const PANEL*); + extern PANEL_EXPORT(void) _nc_Touchline (const PANEL*, int, int); # define dBug(x) _tracef x # define dPanel(text,pan) _nc_dPanel(text,pan) @@ -205,7 +205,7 @@ struct screen; /* forward declaration */ #if NCURSES_SP_FUNCS /* These may become later renamed and part of panel.h and the public API */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); +extern PANEL_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); #endif /* *INDENT-ON* */ |