Commit 1e29cbf1 authored by deuce's avatar deuce
Browse files

Add a CMakeList and clean up some curses direct usage hacks.

parent d52bebb3
project (UEdit C)
cmake_minimum_required(VERSION 2.8.11)
INCLUDE (../../build/SynchronetMacros.cmake)
INCLUDE (FindCurses)
add_executable(uedit
../ars.c
../dat_rec.c
../date_str.c
../getmail.c
../getstats.c
../load_cfg.c
../nopen.c
../sbbs_ini.c
../scfglib1.c
../scfglib2.c
../str_util.c
../userdat.c
uedit.c
)
double_require_lib(uedit xpdev)
double_require_lib_dir(uedit ciolib conio)
double_require_lib(uedit smblib)
double_require_lib(uedit uifc)
target_include_directories(uedit PRIVATE ..)
if(CURSES_FOUND)
target_compile_definitions(uedit PRIVATE HAS_CURSES)
endif()
......@@ -22,7 +22,7 @@ endif
vpath %.c ..
CFLAGS += -I.. -I../../comio $(SMBLIB_CFLAGS) $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS)
CFLAGS += -DHAS_CURSES -I.. -I../../comio $(SMBLIB_CFLAGS) $(UIFC-MT_CFLAGS) $(CIOLIB-MT_CFLAGS) $(XPDEV-MT_CFLAGS)
LDFLAGS += $(SMBLIB_LDFLAGS) $(UIFC-MT_LDFLAGS) $(CIOLIB-MT_LDFLAGS) $(XPDEV-MT_LDFLAGS) $(MT_LDFLAGS)
$(UEDIT): $(OBJS)
......
......@@ -35,8 +35,6 @@
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include "ciolib.h"
#include "sbbs.h"
#include <sys/types.h>
#include <time.h>
#ifdef __QNX__
......@@ -49,6 +47,9 @@
#include <signal.h>
#endif
#include "ciolib.h"
#include "sbbs.h"
#include "genwrap.h"
#include "uifc.h"
#include "sbbsdefs.h"
......@@ -201,12 +202,14 @@ int do_cmd(char *cmd)
{
int i;
#ifdef __unix__
endwin();
#ifdef HAS_CURSES
if(cio_api.mode == CIOLIB_MODE_CURSES || cio_api.mode == CIOLIB_MODE_CURSES_IBM)
endwin();
#endif
i=system(cmd);
#ifdef __unix__
refresh();
#ifdef HAS_CURSES
if(cio_api.mode == CIOLIB_MODE_CURSES || cio_api.mode == CIOLIB_MODE_CURSES_IBM)
refresh();
#endif
return(i);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment