Skip to content

Commit

Permalink
not using terminfo any more
Browse files Browse the repository at this point in the history
  • Loading branch information
freakout42 committed Nov 23, 2024
1 parent 009955c commit f367473
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
30 changes: 14 additions & 16 deletions docs/OperatorGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,24 @@ rpm -i https://github.com/freakout42/formax/releases/download/v0.9.9/sqliteodbc-
Install on Windows
==================

For running **formax** on Windows you have to install the
sqlite3 odbc driver with this installation exe:

https://github.com/freakout42/formax/releases/download/v0.9.9/sqliteodbc.exe

Copy the precompiles binaries to C:\Windows\System32 :

https://github.com/freakout42/formax/releases/download/v0.9.9/runform.exe
https://github.com/freakout42/formax/releases/download/v0.9.9/libncursesw6.dll

Now runform.exe can be run from the cmd or powershell prompt
from console or the windows terminal.
For running **formax** on Windows you have to download 5
files and install them accordingly:
https://github.com/freakout42/formax/releases/download/v0.9.9/sqliteodbc.exe
https://github.com/freakout42/formax/releases/download/v0.9.9/libgcc_s_dw2-1.dll
https://github.com/freakout42/formax/releases/download/v0.9.9/libstdc++-6.dll
https://github.com/freakout42/formax/releases/download/v0.9.9/libncursesw6.dll
https://github.com/freakout42/formax/releases/download/v0.9.9/runform.exe

Install the sqlite3 odbc driver by running sqliteodbc.exe
and copy the precompiles binaries (.exe and .dll) to
C:\Windows\System32. Now runform.exe can be run from the cmd
or powershell prompt from console or the windows terminal.

Build
=====

Fork in github and create codespace or download and extract:

https://github.com/freakout42/formax/archive/refs/heads/main.zip

Fork in github and create codespace or download and extract:
https://github.com/freakout42/formax/archive/refs/heads/main.zip
Then do the following to build and install into `/opt/arx/`.
Nothing outside `/opt/arx/` will be touched in any way by
the installation with the exception of /etc/profile.d/arx.sh
Expand Down
12 changes: 11 additions & 1 deletion runform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,18 @@ $(EXAMPLE): ../generate/scotty.in2
$(FORMAXE): ../generate/formax.inp
cd ../generate; make clean test

prepw32: libncursesw6.dll
libncursesw6.dll: ../bin/ncurses-win32.zip
unzip ../bin/ncurses-win32.zip
cp bin/libncursesw6.dll .
sqlite3 scotty.frm <../generate/scotty.in2
sqlite3 scotty.sq3 <../generate/scotty.sql

# wget -O../bin/ncurses-win32.zip https://invisible-island.net/datafiles/release/mingw32.zip
# compile with msys + mingw32

clean:
for D in colquery crypt membed elk regex ../generate; do ( cd $$D; make clean >/dev/null; ); done
rm -f *.o a.out *core.* runform runform0 curkeys curkeys.h test afiedt.buf \
/tmp/odbc.log ads_* $(EXAMPLE) testelk formax.frm company.h out *.exe libncursesw6.dll scotty.*
/tmp/odbc.log ads_* $(EXAMPLE) testelk formax.frm company.h out *.exe *.dll scotty.*
rm -rf bin include lib
6 changes: 0 additions & 6 deletions runform/Makefile.W32
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ clean:
rm -f *.o runform $(OBJB)
for SUB in colquery elk regex; do cd $$SUB; make clean CC=gcc; cd ..; done

libncursesw6.dll:
unzip ../bin/ncurses-win32.zip
cp bin/libncursesw6.dll .

# wget -O../bin/ncurses-win32.zip https://invisible-island.net/datafiles/release/mingw32.zip
# compile with msys + mingw32
16 changes: 8 additions & 8 deletions runform/screen.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/* curses screen handling interface */
#include <cstdarg>
#include <unistd.h>
#ifndef USETERMIO
#ifndef WIN32
#define WIN32
#ifdef WIN32
#undef USETERMIO
#endif
#endif
#ifndef WIN32
#ifdef USETERMIO
#include <termios.h>
#include <term.h>
#endif
Expand Down Expand Up @@ -114,17 +112,17 @@ return wattrset(wndw, attrib);
}

/* curses init and various terminal setup magic */
#ifndef WIN32
#ifdef USETERMIO
static struct termios otermio;
#endif
int Screen::init() {
#ifndef WIN32
#ifdef USETERMIO
struct termios termio;
#endif
int i;
if ((wndw = initscr()) == NULL) return 1;
/*assert(wndw == stdscr);*/
#ifndef WIN32
#ifdef USETERMIO
tcgetattr (fileno(stdin), &termio); /* give me all attributes */
otermio = termio;
termio.c_cc[VINTR] = 0; /* ctrl-c */
Expand Down Expand Up @@ -182,7 +180,9 @@ int Screen::fulledit(char *pth) { nocurses(0); return mainloop(pth, wndw); }
void Screen::closedisplay() {
nocurses();
endwin();
#ifdef USETERMIO
/*tcsetattr (fileno(stdin), TCSANOW, &otermio); curses takes care of resetting stty */
#endif
}

/* toggle overwrite/insert mode cursor shape not possible? */
Expand Down

0 comments on commit f367473

Please sign in to comment.