Skip to content

Commit

Permalink
Initial port of Windows support.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Apr 22, 1996
1 parent c24433c commit ec02d5d
Show file tree
Hide file tree
Showing 23 changed files with 388 additions and 150 deletions.
6 changes: 4 additions & 2 deletions Makefile.aut
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ DISTFILES = ${SRC} regexp.c regexp.h \
cmd.h funcs.h less.h lesskey.h option.h position.h \
install.sh defines.h.in defines.h.top mkinstalldirs \
less.nro lesskey.nro less.man lesskey.man less.hlp \
Makefile.dos Makefile.bcc defines.dos doscreen.c \
Makefile.dos Makefile.bcc defines.dos screen.c \
Makefile.os2 defines.os2 \
Makefile.osk defines.osk
Makefile.os9 defines.os9 \
Makefile.w32 defines.w32

all: help.c funcs.h ${srcdir}/configure

Expand All @@ -35,6 +36,7 @@ ${srcdir}/configure: ${srcdir}/configure.in
funcs.h: ${SRC:%=${srcdir}/%}
mv -f ${srcdir}/funcs.h ${srcdir}/funcs.h.old
awk -f ${srcdir}/mkfuncs.awk ${SRC:%=${srcdir}/%} >${srcdir}/funcs.h
if cmp -s funcs.h funcs.h.old; then mv funcs.h.old funcs.h; fi

lint:
lint -I. ${CPPFLAGS} ${SRC}
Expand Down
8 changes: 1 addition & 7 deletions Makefile.dsb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ EXT = .EXE
.c.obj:
$(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $<

SRC = main.c doscreen.c brac.c ch.c charset.c cmdbuf.c command.c \
decode.c edit.c filename.c forwback.c help.c ifile.c \
input.c jump.c line.c linenum.c lsystem.c \
mark.c optfunc.c option.c opttbl.c os.c output.c \
position.c prompt.c search.c signal.c tags.c \
ttyin.c version.c
OBJ = main.obj doscreen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
input.obj jump.obj line.obj linenum.obj lsystem.obj \
mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
Expand Down
8 changes: 1 addition & 7 deletions Makefile.dsu
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ LIBS = $(LIBDIR)\llibce.lib $(LIBDIR)\graphics.lib
.c.obj:
$(CC) -c -I. $(CPPFLAGS) $(CFLAGS) $<

SRC = main.c doscreen.c brac.c ch.c charset.c cmdbuf.c command.c \
decode.c edit.c filename.c forwback.c help.c ifile.c \
input.c jump.c line.c linenum.c lsystem.c \
mark.c optfunc.c option.c opttbl.c os.c output.c \
position.c prompt.c search.c signal.c tags.c \
ttyin.c version.c
OBJ = main.obj doscreen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
OBJ = main.obj screen.obj brac.obj ch.obj charset.obj cmdbuf.obj command.obj \
decode.obj edit.obj filename.obj forwback.obj help.obj ifile.obj \
input.obj jump.obj line.obj linenum.obj lsystem.obj \
mark.obj optfunc.obj option.obj opttbl.obj os.obj output.obj \
Expand Down
8 changes: 0 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ SHELL = /bin/sh
.c.o:
${CC} -I. ${CFLAGS_COMPILE_ONLY} ${CPPFLAGS} ${CFLAGS} $<

SRC = main.c screen.c brac.c ch.c charset.c cmdbuf.c \
command.c decode.c edit.c filename.c forwback.c \
help.c ifile.c input.c jump.c line.c linenum.c \
lsystem.c mark.c optfunc.c option.c opttbl.c os.c \
output.c position.c prompt.c search.c signal.c \
tags.c ttyin.c version.c
OBJ = main.${O} screen.${O} brac.${O} ch.${O} charset.${O} cmdbuf.${O} \
command.${O} decode.${O} edit.${O} filename.${O} forwback.${O} \
help.${O} ifile.${O} input.${O} jump.${O} line.${O} linenum.${O} \
Expand Down Expand Up @@ -96,8 +90,6 @@ config.status: ${srcdir}/configure
${srcdir}/configure: ${srcdir}/configure.in
cd ${srcdir}; autoheader; autoconf

lint:
lint -I. ${CPPFLAGS} ${SRC}
clean:
rm -f *.${O} core less lesskey

Expand Down
2 changes: 1 addition & 1 deletion Makefile.o9u
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#### Start of system configuration section. ####

CC = cc
CFLAGS = -D_OSK -v=.
CFLAGS = -v=.
CFLAGS_COMPILE_ONLY = -eas
LDFLAGS = -olM=24k
LIBS = -ltermlib.l -lsys_clib.l -lunix.l
Expand Down
6 changes: 5 additions & 1 deletion NEWS.VER
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
* Added -Ph to change the prompt for the help text.
Added -Ps to change the default short prompt (same as plain -P).

* Ported to Borland C compiler for MS-DOS.
* Ported to the Borland C compiler for MS-DOS.

* Ported to Windows 95 & Windows NT.

* Ported to OS-9.

* Ported to GNU Hurd.

======================================================================


Expand Down
33 changes: 29 additions & 4 deletions README.VER
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ INSTALLATION (Unix systems only):
If you choose not to include some features in your version, you may
wish to edit the manual page "less.nro" and the help page "less.hlp"
to remove the descriptions of the features which you are removing.
If you edit less.hlp, you should run "make -f Makefile.author help.c".
If you edit less.hlp, you should run "make -f Makefile.aut help.c".

4. Type "make" and watch the fun.

Expand Down Expand Up @@ -91,6 +91,32 @@ INSTALLATION (MS-DOS systems only)



=======================================================================
INSTALLATION (Windows-95 and Windows-NT systems only)

1. Move the distributed source to its own directory.

2. Rename Makefile.w32 to Makefile.

3. Check the Makefile to make sure the definitions look ok.

4. If you wish, you may edit defines.w32 to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.

5. Type "make" and watch the fun.

6. If the make succeeds, it will generate a program "less"
in your current directory. Test the generated program.

7. When satisfied that it works, if you wish to install it
in a public place, type "make install".
See step 6 of the Unix installation instructions for details
on how to change the default installation directories.



=======================================================================
INSTALLATION (OS/2 systems only)

Expand Down Expand Up @@ -126,12 +152,11 @@ INSTALLATION (OS-9 systems only)

1. Move the distributed source to its own directory.

2. If you are using gcc, rename Makefile.gcc.os9 to Makefile.
If you are using Ultra C, rename Makefile.ult.os9 to Makefile.
2. Rename Makefile.os9 to Makefile.

3. Check the Makefile to make sure the definitions look ok.

4. If you wish, you may edit defines.osk to remove some optional features.
4. If you wish, you may edit defines.os9 to remove some optional features.
If you choose not to include some features in your version, you may
wish to edit the manual page less.man and the help page help.c
to remove the descriptions of the features which you are removing.
Expand Down
12 changes: 10 additions & 2 deletions ch.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
*/

#include "less.h"
#if MSDOS_COMPILER==WIN32C
#include "errno.h"
#endif

public int ignore_eoi;

Expand Down Expand Up @@ -207,8 +210,13 @@ fch_get()
return (EOI);
if (n < 0)
{
error("read error", NULL_PARG);
clear_eol();
#if MSDOS_COMPILER==WIN32C
if (errno != EPIPE)
#endif
{
error("read error", NULL_PARG);
clear_eol();
}
n = 0;
}

Expand Down
4 changes: 2 additions & 2 deletions cmdbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ len_cmdbuf()
* Then position the cursor just after the char old_cp (a pointer into cmdbuf).
*/
static void
cmd_repaint(char *old_cp)
cmd_repaint(old_cp)
char *old_cp;
{
char *p;

Expand Down Expand Up @@ -305,7 +306,6 @@ cmd_ichar(c)
int c;
{
int col;
char *p;
char *s;

if (strlen(cmdbuf) >= sizeof(cmdbuf)-2)
Expand Down
18 changes: 13 additions & 5 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,15 @@ mca_search()

if (search_type & SRCH_NO_MATCH)
cmd_putstr("Non-match ");
if (search_type & SRCH_PAST_EOF)
cmd_putstr("EOF-skip ");
if (search_type & SRCH_FIRST_FILE)
cmd_putstr("First-file ");
if (search_type & SRCH_PAST_EOF)
cmd_putstr("EOF-ignore ");
if (search_type & SRCH_NO_MOVE)
cmd_putstr("Keep-pos ");
if (search_type & SRCH_NO_REGEX)
cmd_putstr("Regex-off ");

if (search_type & ~(SRCH_FORW | SRCH_BACK))
cmd_putstr(" ");

if (search_type & SRCH_FORW)
cmd_putstr("/");
else
Expand Down Expand Up @@ -1026,6 +1023,17 @@ commands()
/*
* Exit.
*/
if (curr_ifile != NULL_IFILE &&
ch_getflags() & CH_HELPFILE)
{
/*
* Quit while viewing the help file
* just means return to viewing the
* previous file.
*/
if (edit_prev(1) == 0)
break;
}
quit(QUIT_OK);
break;

Expand Down
7 changes: 6 additions & 1 deletion defines.ds
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@
*/
#define HAVE_SYS_TYPES_H 1

/*
* Define if you have the <sgstat.h> header file.
*/
#define HAVE_SGSTAT_H 0

/*
* HAVE_STAT is 1 if your system has the stat() call.
*/
Expand Down Expand Up @@ -245,9 +250,9 @@
#define HAVE_SYS_ERRLIST 1

/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
#define HAVE_OSPEED 0
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
* in termcap.h. */
#define HAVE_OSPEED 0
#define MUST_DEFINE_OSPEED 0

/* Define HAVE_LOCALE if you have locale.h and setlocale. */
Expand Down
7 changes: 6 additions & 1 deletion defines.o2
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@
*/
#define HAVE_SYS_TYPES_H 1

/*
* Define if you have the <sgstat.h> header file.
*/
#define HAVE_SGSTAT_H 0

/*
* HAVE_STAT is 1 if your system has the stat() call.
*/
Expand Down Expand Up @@ -218,9 +223,9 @@
#define HAVE_FILENO 1

/* Define HAVE_ERRNO if you have the errno variable */
#define HAVE_ERRNO 1
/* Define MUST_DEFINE_ERRNO if you have errno but it is not define
* in errno.h */
#define HAVE_ERRNO 1
#define MUST_DEFINE_ERRNO 1

/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
Expand Down
20 changes: 16 additions & 4 deletions defines.o9
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
*/

/* OS/9 definition file for less. */
/*
* This file has 2 sections:
* User preferences.
* Settings always true for OS-9 systems.
*/

/* User preferences. */

Expand Down Expand Up @@ -123,13 +128,21 @@
#define DEF_LESSKEYINFILE ".lesskey"


/* Settings always true on Unix. */
/* Settings always true for OS-9. */

/* This is not needed; it is defined by the compiler. */
/* #define _OSK 1 */

/*
* HAVE_SYS_TYPES_H is 1 if your system has <sys/types.h>.
*/
#undef HAVE_SYS_TYPES_H

/*
* Define if you have the <sgstat.h> header file.
*/
#define HAVE_SGSTAT_H 1

/*
* HAVE_STAT is 1 if your system has the stat() call.
*/
Expand Down Expand Up @@ -211,18 +224,18 @@
#define HAVE_FILENO 1

/* Define HAVE_ERRNO if you have the errno variable */
#define HAVE_ERRNO 1
/* Define MUST_DEFINE_ERRNO if you have errno but it is not define
* in errno.h */
#define HAVE_ERRNO 1
#undef MUST_DEFINE_ERRNO

/* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */
#undef HAVE_SYS_ERRLIST

/* Define HAVE_OSPEED if your termcap library has the ospeed variable */
#undef HAVE_OSPEED
/* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined
* in termcap.h. */
#undef HAVE_OSPEED
#undef MUST_DEFINE_OSPEED

/* Define HAVE_LOCALE if you have locale.h and setlocale. */
Expand Down Expand Up @@ -293,4 +306,3 @@

/* Define if you have the <values.h> header file. */
#undef HAVE_VALUES_H

Loading

0 comments on commit ec02d5d

Please sign in to comment.