Remove usage of DECLARE_POINTERS in dyna_curses.h

This commit is contained in:
Louis Gombert 2024-05-03 21:14:42 +02:00 committed by Jeod
parent 053aef798e
commit 321145c28f
2 changed files with 21 additions and 34 deletions

View File

@ -16,12 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef DECLARE_POINTERS
#define FEXTERN
#else
#define FEXTERN extern
#endif
#include <curses.h> #include <curses.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>
#define LINES (*soLINES) #define LINES (*soLINES)
#define COLS (*soCOLS) #define COLS (*soCOLS)
@ -42,61 +40,55 @@
#define doupdate sodoupdate #define doupdate sodoupdate
#define mvwin somvwin #define mvwin somvwin
FEXTERN int *soLINES; int *soLINES;
FEXTERN int *soCOLS; int *soCOLS;
FEXTERN WINDOW **sostdscr; WINDOW **sostdscr;
typedef WINDOW *(*initscr_fp)(void); typedef WINDOW *(*initscr_fp)(void);
FEXTERN initscr_fp soinitscr; initscr_fp soinitscr;
typedef WINDOW *(*newwin_fp)(int, int, int, int); typedef WINDOW *(*newwin_fp)(int, int, int, int);
FEXTERN newwin_fp sonewwin; newwin_fp sonewwin;
typedef int (*wclear_fp)(WINDOW *); typedef int (*wclear_fp)(WINDOW *);
FEXTERN wclear_fp sowclear; wclear_fp sowclear;
typedef int (*wrefresh_fp)(WINDOW *); typedef int (*wrefresh_fp)(WINDOW *);
FEXTERN wrefresh_fp sowrefresh; wrefresh_fp sowrefresh;
typedef int (*scrollok_fp)(WINDOW *, bool); typedef int (*scrollok_fp)(WINDOW *, bool);
FEXTERN scrollok_fp soscrollok; scrollok_fp soscrollok;
typedef int (*leaveok_fp)(WINDOW *, bool); typedef int (*leaveok_fp)(WINDOW *, bool);
FEXTERN leaveok_fp soleaveok; leaveok_fp soleaveok;
typedef int (*wmove_fp)(WINDOW *, int, int); typedef int (*wmove_fp)(WINDOW *, int, int);
FEXTERN wmove_fp sowmove; wmove_fp sowmove;
typedef int (*delwin_fp)(WINDOW *); typedef int (*delwin_fp)(WINDOW *);
FEXTERN delwin_fp sodelwin; delwin_fp sodelwin;
typedef int (*endwin_fp)(void); typedef int (*endwin_fp)(void);
FEXTERN endwin_fp soendwin; endwin_fp soendwin;
typedef int (*wprintw_fp)(WINDOW *, const char *, ...); typedef int (*wprintw_fp)(WINDOW *, const char *, ...);
FEXTERN wprintw_fp sowprintw; wprintw_fp sowprintw;
typedef int (*wnoutrefresh_fp)(WINDOW *); typedef int (*wnoutrefresh_fp)(WINDOW *);
FEXTERN wnoutrefresh_fp sownoutrefresh; wnoutrefresh_fp sownoutrefresh;
typedef int (*mvwprintw_fp)(WINDOW *, int, int, const char *, ...); typedef int (*mvwprintw_fp)(WINDOW *, int, int, const char *, ...);
FEXTERN mvwprintw_fp somvwprintw; mvwprintw_fp somvwprintw;
typedef int (*wtouchln_fp)(WINDOW *, int, int, int); typedef int (*wtouchln_fp)(WINDOW *, int, int, int);
FEXTERN wtouchln_fp sowtouchln; wtouchln_fp sowtouchln;
typedef int (*doupdate_fp)(void); typedef int (*doupdate_fp)(void);
FEXTERN doupdate_fp sodoupdate; doupdate_fp sodoupdate;
typedef int (*mvwin_fp)(WINDOW *, int, int); typedef int (*mvwin_fp)(WINDOW *, int, int);
FEXTERN mvwin_fp somvwin; mvwin_fp somvwin;
#ifndef DECLARE_POINTERS
bool LoadCursesLib(bool load = true);
#else
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>
void LoadCursesLibSetNULL(void) { void LoadCursesLibSetNULL(void) {
soLINES = NULL; soLINES = NULL;
soCOLS = NULL; soCOLS = NULL;
@ -224,4 +216,3 @@ load_error:
handle = NULL; handle = NULL;
return false; return false;
} }
#endif

View File

@ -60,9 +60,7 @@
#include "application.h" #include "application.h"
#include "AppConsole.h" #include "AppConsole.h"
#include "TaskSystem.h" #include "TaskSystem.h"
//@@#include "mem.h"
#include "mono.h" #include "mono.h"
// #include "local_malloc.h"
#include "pstring.h" #include "pstring.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
@ -70,9 +68,7 @@
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#define DECLARE_POINTERS
#include "linux/dyna_curses.h" #include "linux/dyna_curses.h"
#undef DECLARE_POINTERS
#include <algorithm> #include <algorithm>