Skip to content

Commit

Permalink
Followed wcbrine's lead: removed terminfo.c and term.h, moved mvcur()…
Browse files Browse the repository at this point in the history
… to move.c See docs/HISTORY.md for details on why this was done.
  • Loading branch information
Bill-Gray committed Jan 16, 2020
1 parent 3bf6d66 commit 22c4d82
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 319 deletions.
13 changes: 4 additions & 9 deletions dos/Makefile.dmc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ PDCURSES_CURSPRIV_H = $(PDCURSES_SRCDIR)\curspriv.h
PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H)

PANEL_HEADER = $(PDCURSES_SRCDIR)\panel.h
TERM_HEADER = $(PDCURSES_SRCDIR)\term.h

srcdir = $(PDCURSES_SRCDIR)\pdcurses
osdir = $(PDCURSES_SRCDIR)\dos
Expand All @@ -35,7 +34,7 @@ LIBCURSES = pdcurses.lib

BUILD = $(CC) $(CFLAGS) $(CPPFLAGS)

DEMOS = testcurs.exe ozdemo.exe newtest.exe xmas.exe \
DEMOS = testcurs.exe newdemo.exe newtest.exe xmas.exe \
tuidemo.exe firework.exe ptest.exe rain.exe worm.exe

all: $(LIBCURSES) $(DEMOS)
Expand All @@ -52,19 +51,18 @@ border.obj clear.obj color.obj delch.obj deleteln.obj getch.obj \
getstr.obj getyx.obj inch.obj inchstr.obj initscr.obj inopts.obj \
insch.obj insstr.obj instr.obj kernel.obj keyname.obj mouse.obj move.obj \
outopts.obj overlay.obj pad.obj panel.obj printw.obj refresh.obj \
scanw.obj scr_dump.obj scroll.obj slk.obj termattr.obj terminfo.obj \
scanw.obj scr_dump.obj scroll.obj slk.obj termattr.obj \
touch.obj util.obj window.obj debug.obj

PDCOBJS = pdcclip.obj pdcdisp.obj pdcgetsc.obj pdckbd.obj pdcscrn.obj \
pdcsetsc.obj pdcutil.obj

DEMOOBJS = testcurs.obj ozdemo.obj newtest.obj xmas.obj tuidemo.obj \
DEMOOBJS = testcurs.obj newdemo.obj newtest.obj xmas.obj tuidemo.obj \
tui.obj firework.obj ptest.obj rain.obj worm.obj

$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_DOS_H)
panel.obj ptest.obj: $(PANEL_HEADER)
terminfo.obj: $(TERM_HEADER)

$(DEMOOBJS) : $(PDCURSES_CURSES_H)
$(DEMOS) : $(LIBCURSES)
Expand Down Expand Up @@ -184,9 +182,6 @@ slk.obj: $(srcdir)\slk.c
termattr.obj: $(srcdir)\termattr.c
$(SRCBUILD)

terminfo.obj: $(srcdir)\terminfo.c
$(SRCBUILD)

touch.obj: $(srcdir)\touch.c
$(SRCBUILD)

Expand Down Expand Up @@ -223,7 +218,7 @@ pdcutil.obj: $(osdir)\pdcutil.c
firework.exe: $(demodir)\firework.c
$(DEMOBUILD)

ozdemo.exe: $(demodir)\ozdemo.c
newdemo.exe: $(demodir)\newdemo.c
$(DEMOBUILD)

newtest.exe: $(demodir)\newtest.c
Expand Down
3 changes: 1 addition & 2 deletions libobjs.mif
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ PDCURSES_CURSES_H = $(PDCURSES_SRCDIR)/curses.h
PDCURSES_CURSPRIV_H = $(PDCURSES_SRCDIR)/curspriv.h
PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H)
PANEL_HEADER = $(PDCURSES_SRCDIR)/panel.h
TERM_HEADER = $(PDCURSES_SRCDIR)/term.h

srcdir = $(PDCURSES_SRCDIR)/pdcurses
demodir = $(PDCURSES_SRCDIR)/demos
Expand All @@ -16,7 +15,7 @@ getch.$(O) getstr.$(O) getyx.$(O) inch.$(O) inchstr.$(O) \
initscr.$(O) inopts.$(O) insch.$(O) insstr.$(O) instr.$(O) kernel.$(O) \
keyname.$(O) mouse.$(O) move.$(O) outopts.$(O) overlay.$(O) pad.$(O) \
panel.$(O) printw.$(O) refresh.$(O) scanw.$(O) scr_dump.$(O) scroll.$(O) \
slk.$(O) termattr.$(O) terminfo.$(O) touch.$(O) util.$(O) window.$(O) \
slk.$(O) termattr.$(O) touch.$(O) util.$(O) window.$(O) \
debug.$(O)

PDCOBJS = pdcclip.$(O) pdcdisp.$(O) pdcgetsc.$(O) pdckbd.$(O) pdcscrn.$(O) \
Expand Down
1 change: 0 additions & 1 deletion makedist.mif
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dist: $(PDCLIBS)
echo $(PDCURSES_SRCDIR)\HISTORY.md >> flist
echo $(PDCURSES_SRCDIR)\curses.h >> flist
echo $(PDCURSES_SRCDIR)\panel.h >> flist
echo $(PDCURSES_SRCDIR)\term.h >> flist
echo $(LIBCURSES) >> flist
echo file_id.diz >> flist
zip -9jX $(ARCNAME) -@ <flist
Expand Down
1 change: 0 additions & 1 deletion os2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ $(LIBOBJS) $(PDCOBJS) $(DEMOOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_OS2_H)
$(DEMOS) : $(LIBCURSES)
panel.o ptest.o: $(PANEL_HEADER)
terminfo.o: $(TERM_HEADER)

$(LIBOBJS) : %.o: $(srcdir)/%.c
$(CC) -c $(CFLAGS) -o$@ $<
Expand Down
2 changes: 1 addition & 1 deletion os2/Makefile.bcc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
+inopts.obj +insch.obj +insstr.obj +instr.obj +kernel.obj +keyname.obj \
+mouse.obj +move.obj +outopts.obj +overlay.obj +pad.obj +panel.obj \
+printw.obj +refresh.obj +scanw.obj +scr_dump.obj +scroll.obj +slk.obj \
+termattr.obj +terminfo.obj +touch.obj +util.obj +window.obj +debug.obj \
+termattr.obj +touch.obj +util.obj +window.obj +debug.obj \
+pdcclip.obj +pdcdisp.obj +pdcgetsc.obj +pdckbd.obj +pdcscrn.obj \
+pdcsetsc.obj +pdcutil.obj ,lib.map
-copy $(LIBCURSES) panel.lib
Expand Down
1 change: 0 additions & 1 deletion os2/iccos2.lrf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
-+scroll.obj &
-+slk.obj &
-+termattr.obj &
-+terminfo.obj &
-+touch.obj &
-+util.obj &
-+window.obj &
Expand Down
3 changes: 0 additions & 3 deletions os2/iccos2.mak
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ slk.obj: $(srcdir)\slk.c $(PDCURSES_HEADERS)
termattr.obj: $(srcdir)\termattr.c $(PDCURSES_HEADERS)
$(BUILD) $(srcdir)\termattr.c

terminfo.obj: $(srcdir)\terminfo.c $(PDCURSES_HEADERS) $(TERM_HEADER)
$(BUILD) $(srcdir)\terminfo.c

touch.obj: $(srcdir)\touch.c $(PDCURSES_HEADERS)
$(BUILD) $(srcdir)\touch.c

Expand Down
28 changes: 24 additions & 4 deletions pdcurses/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ move
### Synopsis
int move(int y, int x);
int mvcur(int oldrow, int oldcol, int newrow, int newcol);
int wmove(WINDOW *win, int y, int x);
### Description
The cursor associated with the window is moved to the given
location. This does not move the physical cursor of the
terminal until refresh() is called. The position specified is
move() and wmove() move the cursor associated with the window to the
given location. This does not move the physical cursor of the
terminal until refresh() is called. The position specified is
relative to the upper left corner of the window, which is (0,0).
mvcur() moves the physical cursor without updating any window cursor
positions.
### Return Value
All functions return OK on success and ERR on error.
### Portability
X/Open BSD SYS V
X/Open ncurses NetBSD
move Y Y Y
mvcur Y Y Y
wmove Y Y Y
**man-end****************************************************************/
Expand All @@ -43,6 +48,21 @@ int move(int y, int x)
return OK;
}

int mvcur(int oldrow, int oldcol, int newrow, int newcol)
{
PDC_LOG(("mvcur() - called: oldrow %d oldcol %d newrow %d newcol %d\n",
oldrow, oldcol, newrow, newcol));

if (!SP || newrow < 0 || newrow >= LINES || newcol < 0 || newcol >= COLS)
return ERR;

PDC_gotoyx(newrow, newcol);
SP->cursrow = newrow;
SP->curscol = newcol;

return OK;
}

int wmove(WINDOW *win, int y, int x)
{
PDC_LOG(("wmove() - called: y=%d x=%d\n", y, x));
Expand Down
217 changes: 0 additions & 217 deletions pdcurses/terminfo.c

This file was deleted.

1 change: 0 additions & 1 deletion sdl1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_SDL_H)
$(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
tui.o tuidemo.o : $(PDCURSES_CURSES_H)
terminfo.o: $(TERM_HEADER)
panel.o ptest: $(PANEL_HEADER)

$(LIBOBJS) : %.o: $(srcdir)/%.c
Expand Down

0 comments on commit 22c4d82

Please sign in to comment.