diff -cr official+NetBSD/Makefile fep-cygwin/Makefile
*** official+NetBSD/Makefile Mon Sep 2 15:54:20 2002
--- fep-cygwin/Makefile Mon Sep 2 18:37:26 2002
***************
*** 25,35 ****
#DEBUG = -O
CFLAGS += $(DEBUG) $(CONFIG)
- .if exists(/usr/lib/libcompat.a)
- LDFLAGS = -ltermcap -lcompat
- .else
LDFLAGS = -ltermcap
- .endif
all: $(TARGET)
--- 25,31 ----
diff -cr official+NetBSD/fep_alias.c fep-cygwin/fep_alias.c
*** official+NetBSD/fep_alias.c Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_alias.c Mon Sep 2 19:01:17 2002
***************
*** 3,9 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_alias.c,v 4.2 88/11/13 15:50:52 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include <ctype.h>
--- 3,9 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_alias.c,v 4.2 88/11/13 15:50:52 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include <ctype.h>
diff -cr official+NetBSD/fep_com.c fep-cygwin/fep_com.c
*** official+NetBSD/fep_com.c Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_com.c Mon Sep 2 19:01:25 2002
***************
*** 3,15 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_com.c,v 4.9 91/05/29 14:30:43 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #ifdef __linux__
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
--- 3,15 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_com.c,v 4.9 91/05/29 14:30:43 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #if defined(__linux__) || defined(__CYGWIN__)
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
diff -cr official+NetBSD/fep_defs.h fep-cygwin/fep_defs.h
*** official+NetBSD/fep_defs.h Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_defs.h Mon Sep 2 19:04:53 2002
***************
*** 3,9 ****
#ifndef lint
# define FEP_DEFS \
"$Header: /home/mmb/utashiro/src/fep/RCS/fep_defs.h,v 4.3 1989/01/06 10:07:29 utashiro Exp $ (SRA)"
! #endif lint
#define MAXCMDLEN 512 /* maximum command length */
#define MAXARGS 64 /* maximum number of arguments */
--- 3,9 ----
#ifndef lint
# define FEP_DEFS \
"$Header: /home/mmb/utashiro/src/fep/RCS/fep_defs.h,v 4.3 1989/01/06 10:07:29 utashiro Exp $ (SRA)"
! #endif /* lint */
#define MAXCMDLEN 512 /* maximum command length */
#define MAXARGS 64 /* maximum number of arguments */
***************
*** 31,51 ****
# define isctlchar(c) (c && !iskanji(c) && (!(c&0140) || c=='\177'))
# define iswordchar(c) (c && (iskanji(c) || isalnum(c) || iscntrl(c)))
# define isWordchar(c) ((c) && !isspace((c)))
! #else KANJI
# define isctlchar(c) (c && (!(c&0140) || c=='\177'))
# define iswordchar(c) (isalnum(c) || iscntrl(c))
# define isWordchar(c) ((c) && !isspace((c)))
! #endif KANJI
#define unctl(c) (((c)=='\177') ? '?' : ((c) >= 040) ? (c) : (c)|0100)
#define toctrl(c) ((c)&~0100)
#define ctrl(c) ((c)&037)
#define INDIRECTED (1<<(sizeof(char*)*8-1))
/* this is actually 0x80000000 on 32 bit machine,
that addresses kernel address space */
#define isIndirect(f) ((u_int)(f)&(u_int)INDIRECTED)
#define setIndirect(f) (FUNC)((u_int)(f)|(u_int)INDIRECTED)
#define maskIndirect(f) (FUNC *)((u_int)(f)&~(u_int)INDIRECTED)
/*
* Type of character
--- 31,58 ----
# define isctlchar(c) (c && !iskanji(c) && (!(c&0140) || c=='\177'))
# define iswordchar(c) (c && (iskanji(c) || isalnum(c) || iscntrl(c)))
# define isWordchar(c) ((c) && !isspace((c)))
! #else /* KANJI */
# define isctlchar(c) (c && (!(c&0140) || c=='\177'))
# define iswordchar(c) (isalnum(c) || iscntrl(c))
# define isWordchar(c) ((c) && !isspace((c)))
! #endif /* KANJI */
#define unctl(c) (((c)=='\177') ? '?' : ((c) >= 040) ? (c) : (c)|0100)
#define toctrl(c) ((c)&~0100)
#define ctrl(c) ((c)&037)
+ #if defined(__alpha)
+ #define INDIRECTED (((u_long)1)<<63)
+ #define isIndirect(f) ((u_long)(f)&(u_long)INDIRECTED)
+ #define setIndirect(f) (FUNC)((u_long)(f)|(u_long)INDIRECTED)
+ #define maskIndirect(f) (FUNC *)((u_long)(f)&~(u_long)INDIRECTED)
+ #else
#define INDIRECTED (1<<(sizeof(char*)*8-1))
/* this is actually 0x80000000 on 32 bit machine,
that addresses kernel address space */
#define isIndirect(f) ((u_int)(f)&(u_int)INDIRECTED)
#define setIndirect(f) (FUNC)((u_int)(f)|(u_int)INDIRECTED)
#define maskIndirect(f) (FUNC *)((u_int)(f)&~(u_int)INDIRECTED)
+ #endif
/*
* Type of character
***************
*** 53,69 ****
#ifdef KANJI
# define CHAR unsigned char
# define CHARMASK 0377
! #else KANJI
# define CHAR char
# define CHARMASK 0177
! #endif KANJI
/*
* Only one machine I know alloca() works is vax.
*/
#ifdef vax
# define ALLOCA
! #endif vax
/*
* Typedef's
--- 60,76 ----
#ifdef KANJI
# define CHAR unsigned char
# define CHARMASK 0377
! #else /* KANJI */
# define CHAR char
# define CHARMASK 0177
! #endif /* KANJI */
/*
* Only one machine I know alloca() works is vax.
*/
#ifdef vax
# define ALLOCA
! #endif /* vax */
/*
* Typedef's
diff -cr official+NetBSD/fep_edit.c fep-cygwin/fep_edit.c
*** official+NetBSD/fep_edit.c Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_edit.c Mon Sep 2 19:07:54 2002
***************
*** 3,9 ****
#ifndef lint
static char rcsid[]=
"$Id: fep_edit.c,v 4.10 1995/01/20 08:15:55 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include <sys/types.h>
--- 3,9 ----
#ifndef lint
static char rcsid[]=
"$Id: fep_edit.c,v 4.10 1995/01/20 08:15:55 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include <sys/types.h>
***************
*** 11,17 ****
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #ifdef __linux__
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
--- 11,17 ----
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #if defined(__linux__) || defined(__CYGWIN__)
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
***************
*** 21,27 ****
--- 21,32 ----
#endif
#include <sys/time.h>
#include <ctype.h>
+ #if defined(__CYGWIN__)
+ #include <sys/dirent.h>
+ #define direct dirent
+ #else
#include <sys/dir.h>
+ #endif
#include <sys/file.h>
#include <setjmp.h>
#include "fep_defs.h"
***************
*** 207,213 ****
--- 212,225 ----
import (cft, initial_ttymode.c_cc[VSTART], ignore);
import (cft, initial_ttymode.c_cc[VSTOP], ignore);
*/
+ #if 0
import (cft, initial_ttymode.c_cc[VINTR], insert_and_flush);
+ #else
+ /* added by noro */
+ import (cft, initial_ttymode.c_cc[VINTR], send_int_sig);
+ /* XXX : this may not be necessary */
+ import (aft, initial_ttymode.c_cc[VINTR], send_int_sig);
+ #endif
import (cft, initial_ttymode.c_cc[VQUIT], insert_and_flush);
/* Now, EOF will be sent on empty line.
import (cft, initial_ttymode.c_cc[VEOF], send_eof);
***************
*** 230,236 ****
--- 242,253 ----
import (cft, tchars_buf.t_startc, ignore);
import (cft, tchars_buf.t_stopc, ignore);
*/
+ #if 0
import (cft, tchars_buf.t_intrc, insert_and_flush);
+ #else
+ import (cft, tchars_buf.t_intrc, send_int_sig);
+ import (aft, tchars_buf.t_intrc, send_int_sig);
+ #endif
import (cft, tchars_buf.t_quitc, insert_and_flush);
/* Now, EOF will be sent on empty line.
import (cft, tchars_buf.t_eofc, send_eof);
***************
*** 461,467 ****
register int i, nbyte = 1, currentNull;
#ifdef KANJI
CHAR byte2;
! #endif KANJI
currentNull = strlen (CommandLine);
--- 478,484 ----
register int i, nbyte = 1, currentNull;
#ifdef KANJI
CHAR byte2;
! #endif /* KANJI */
currentNull = strlen (CommandLine);
***************
*** 480,486 ****
nbyte = 2;
}
else
! #endif KANJI
putChar (c);
reverse_strcpy (
&CommandLine[CurrentPosition] + nbyte,
--- 497,503 ----
nbyte = 2;
}
else
! #endif /* KANJI */
putChar (c);
reverse_strcpy (
&CommandLine[CurrentPosition] + nbyte,
***************
*** 492,498 ****
if (nbyte > 1) {
CommandLine[CurrentPosition - 1] = byte2;
}
! #endif KANJI
printS (&CommandLine [CurrentPosition]);
if (CommandLine[CurrentPosition] != '\0') {
--- 509,515 ----
if (nbyte > 1) {
CommandLine[CurrentPosition - 1] = byte2;
}
! #endif /* KANJI */
printS (&CommandLine [CurrentPosition]);
if (CommandLine[CurrentPosition] != '\0') {
***************
*** 596,602 ****
#ifdef KANJI
&& !(CurrentPosition + 1 == position
&& iskanji (CommandLine[CurrentPosition]))
! #endif KANJI
)
(void) forward_n_character (1);
}
--- 613,619 ----
#ifdef KANJI
&& !(CurrentPosition + 1 == position
&& iskanji (CommandLine[CurrentPosition]))
! #endif /* KANJI */
)
(void) forward_n_character (1);
}
***************
*** 620,629 ****
#ifdef KANJI
#define INC(i) if(iskanji(CommandLine[i])) i+=2; else i++;
#define DEC(i) if(i>=2 && iskanji_in_string(CommandLine, i-2)) i-=2; else i--;
! #else KANJI
#define INC(i) i++
#define DEC(i) i--
! #endif KANJI
/*
* Move cursor to end of line
--- 637,646 ----
#ifdef KANJI
#define INC(i) if(iskanji(CommandLine[i])) i+=2; else i++;
#define DEC(i) if(i>=2 && iskanji_in_string(CommandLine, i-2)) i-=2; else i--;
! #else /* KANJI */
#define INC(i) i++
#define DEC(i) i--
! #endif /* KANJI */
/*
* Move cursor to end of line
***************
*** 681,687 ****
i--;
}
else
! #endif KANJI
putchar (BS);
i--;
}
--- 698,704 ----
i--;
}
else
! #endif /* KANJI */
putchar (BS);
i--;
}
***************
*** 736,742 ****
nchars++;
}
}
! #else KANJI
while (n--) {
i--, nchars++;
while (i > 0 && !iswordchar (CommandLine [i])) {
--- 753,759 ----
nchars++;
}
}
! #else /* KANJI */
while (n--) {
i--, nchars++;
while (i > 0 && !iswordchar (CommandLine [i])) {
***************
*** 746,752 ****
i--, nchars++;
}
}
! #endif KANJI
return (backward_n_character (nchars));
}
--- 763,769 ----
i--, nchars++;
}
}
! #endif /* KANJI */
return (backward_n_character (nchars));
}
***************
*** 797,803 ****
nchars++;
}
}
! #else KANJI
while (n--) {
i--, nchars++;
while (i > 0 && !isWordchar (CommandLine [i]))
--- 814,820 ----
nchars++;
}
}
! #else /* KANJI */
while (n--) {
i--, nchars++;
while (i > 0 && !isWordchar (CommandLine [i]))
***************
*** 805,811 ****
while (i > 0 && isWordchar (CommandLine [i - 1]))
i--, nchars++;
}
! #endif KANJI
return (backward_n_character (nchars));
}
--- 822,828 ----
while (i > 0 && isWordchar (CommandLine [i - 1]))
i--, nchars++;
}
! #endif /* KANJI */
return (backward_n_character (nchars));
}
***************
*** 843,849 ****
(void) putchar (CommandLine[i++]);
}
else
! #endif KANJI
if (isctlchar(CommandLine[i])) {
(void) putchar (unctl (CommandLine [i]));
i++;
--- 860,866 ----
(void) putchar (CommandLine[i++]);
}
else
! #endif /* KANJI */
if (isctlchar(CommandLine[i])) {
(void) putchar (unctl (CommandLine [i]));
i++;
***************
*** 858,864 ****
(void) putchar (CommandLine[i++]);
}
else
! #endif KANJI
putChar (CommandLine [i++]);
}
--- 875,881 ----
(void) putchar (CommandLine[i++]);
}
else
! #endif /* KANJI */
putChar (CommandLine [i++]);
}
***************
*** 1039,1047 ****
i -= 2, nbyte += 2;
else
i -= 1, nbyte += 1;
! #else KANJI
nbyte = n;
! #endif KANJI
deleteArea = howlong (&CommandLine[CurrentPosition - nbyte], nbyte);
restArea = howlong (&CommandLine[CurrentPosition], 0);
--- 1056,1064 ----
i -= 2, nbyte += 2;
else
i -= 1, nbyte += 1;
! #else /* KANJI */
nbyte = n;
! #endif /* KANJI */
deleteArea = howlong (&CommandLine[CurrentPosition - nbyte], nbyte);
restArea = howlong (&CommandLine[CurrentPosition], 0);
***************
*** 1114,1120 ****
nchars++;
}
}
! #else KANJI
while (n--) {
i--, nchars++;
while (i > 0 && !iswordchar (CommandLine [i]))
--- 1131,1137 ----
nchars++;
}
}
! #else /* KANJI */
while (n--) {
i--, nchars++;
while (i > 0 && !iswordchar (CommandLine [i]))
***************
*** 1122,1128 ****
while (i > 0 && iswordchar (CommandLine [i - 1]))
i--, nchars++;
}
! #endif KANJI
return (delete_previous_n_character (nchars));
}
--- 1139,1145 ----
while (i > 0 && iswordchar (CommandLine [i - 1]))
i--, nchars++;
}
! #endif /* KANJI */
return (delete_previous_n_character (nchars));
}
***************
*** 1175,1181 ****
nchars++;
}
}
! #else KANJI
while (n--) {
i--, nchars++;
while (i > 0 && !isWordchar (CommandLine [i]))
--- 1192,1198 ----
nchars++;
}
}
! #else /* KANJI */
while (n--) {
i--, nchars++;
while (i > 0 && !isWordchar (CommandLine [i]))
***************
*** 1183,1189 ****
while (i > 0 && isWordchar (CommandLine [i - 1]))
i--, nchars++;
}
! #endif KANJI
return (delete_previous_n_character (nchars));
}
--- 1200,1206 ----
while (i > 0 && isWordchar (CommandLine [i - 1]))
i--, nchars++;
}
! #endif /* KANJI */
return (delete_previous_n_character (nchars));
}
***************
*** 1222,1230 ****
else
cp++, nbyte++;
}
! #else KANJI
nbyte = n;
! #endif KANJI
deleteArea = howlong (&CommandLine[CurrentPosition], nbyte);
restArea = howlong (&CommandLine[CurrentPosition + nbyte], 0);
--- 1239,1247 ----
else
cp++, nbyte++;
}
! #else /* KANJI */
nbyte = n;
! #endif /* KANJI */
deleteArea = howlong (&CommandLine[CurrentPosition], nbyte);
restArea = howlong (&CommandLine[CurrentPosition + nbyte], 0);
***************
*** 1781,1789 ****
# ifdef ALLOCA
fcp = (char *) alloca (strlen (dp->d_name) + 1);
! # else ALLOCA
fcp = (char *) malloc (strlen (dp->d_name) + 1);
! # endif ALLOCA
if (fcp == 0) {
fputs ("\r\n", stdout);
perror ("alloca:");
--- 1798,1806 ----
# ifdef ALLOCA
fcp = (char *) alloca (strlen (dp->d_name) + 1);
! # else /* ALLOCA */
fcp = (char *) malloc (strlen (dp->d_name) + 1);
! # endif /* ALLOCA */
if (fcp == 0) {
fputs ("\r\n", stdout);
perror ("alloca:");
***************
*** 1844,1850 ****
# ifndef ALLOCA
for (i = 0; fileList [i]; i++)
free (fileList [i]);
! # endif ALLOCA
closedir(dirp);
return (0);
--- 1861,1867 ----
# ifndef ALLOCA
for (i = 0; fileList [i]; i++)
free (fileList [i]);
! # endif /* ALLOCA */
closedir(dirp);
return (0);
***************
*** 1972,1980 ****
if (prefix (prefixstring, dp->d_name)) {
# ifdef ALLOCA
fcp = (char *) alloca (strlen (dp->d_name) + 1);
! # else ALLOCA
fcp = (char *) malloc (strlen (dp->d_name) + 1);
! # endif ALLOCA
if (fcp == 0) {
fputs ("\r\n", stdout);
perror ("alloca:");
--- 1989,1997 ----
if (prefix (prefixstring, dp->d_name)) {
# ifdef ALLOCA
fcp = (char *) alloca (strlen (dp->d_name) + 1);
! # else /* ALLOCA */
fcp = (char *) malloc (strlen (dp->d_name) + 1);
! # endif /* ALLOCA */
if (fcp == 0) {
fputs ("\r\n", stdout);
perror ("alloca:");
***************
*** 2018,2024 ****
# ifndef ALLOCA
for (i = 0; fileList [i]; i++)
free (fileList [i]);
! # endif ALLOCA
return;
}
--- 2035,2041 ----
# ifndef ALLOCA
for (i = 0; fileList [i]; i++)
free (fileList [i]);
! # endif /* ALLOCA */
return;
}
***************
*** 2065,2071 ****
fputs ("\n", stdout);
}
}
! #endif RINFO
bind_key (ft, func, s, dfunc)
FUNC ft[]; /* Function table */
--- 2082,2088 ----
fputs ("\n", stdout);
}
}
! #endif /* RINFO */
bind_key (ft, func, s, dfunc)
FUNC ft[]; /* Function table */
diff -cr official+NetBSD/fep_funcs.c fep-cygwin/fep_funcs.c
*** official+NetBSD/fep_funcs.c Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_funcs.c Mon Sep 2 19:03:26 2002
***************
*** 3,9 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_funcs.c,v 4.5 91/05/29 14:31:01 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include "fep_defs.h"
--- 3,9 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_funcs.c,v 4.5 91/05/29 14:31:01 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include "fep_defs.h"
diff -cr official+NetBSD/fep_funcs.h fep-cygwin/fep_funcs.h
*** official+NetBSD/fep_funcs.h Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_funcs.h Mon Sep 2 19:05:03 2002
***************
*** 3,9 ****
#ifndef lint
# define FEP_FUNCS \
"$Header: fep_funcs.h,v 4.5 91/05/29 14:31:03 utashiro Exp $ (SRA)"
! #endif lint
/*
* command line edit functions
--- 3,9 ----
#ifndef lint
# define FEP_FUNCS \
"$Header: fep_funcs.h,v 4.5 91/05/29 14:31:03 utashiro Exp $ (SRA)"
! #endif /* lint */
/*
* command line edit functions
***************
*** 22,28 ****
--- 22,33 ----
int delete_previous_word();
int delete_previous_Word();
int delete_to_kill_buffer();
+ #if defined(__CYGWIN__)
+ void terminate(int);
+ #else
void terminate __P((int));
+ #endif
+ int send_int_sig();
int end_of_line();
int expand_file_name();
int forward_character();
diff -cr official+NetBSD/fep_glob.h fep-cygwin/fep_glob.h
*** official+NetBSD/fep_glob.h Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_glob.h Mon Sep 2 19:05:16 2002
***************
*** 3,9 ****
#ifndef lint
# define FEP_GLOB \
"$Header: fep_glob.h,v 4.1 88/08/28 14:36:41 utashiro Exp $ (SRA)"
! #endif lint
extern FUNC *curFuncTab; /* function table */
extern FUNC *altFuncTab; /* altanative function table */
--- 3,9 ----
#ifndef lint
# define FEP_GLOB \
"$Header: fep_glob.h,v 4.1 88/08/28 14:36:41 utashiro Exp $ (SRA)"
! #endif /* lint */
extern FUNC *curFuncTab; /* function table */
extern FUNC *altFuncTab; /* altanative function table */
diff -cr official+NetBSD/fep_hist.c fep-cygwin/fep_hist.c
*** official+NetBSD/fep_hist.c Mon Sep 2 15:54:20 2002
--- fep-cygwin/fep_hist.c Mon Sep 2 19:03:17 2002
***************
*** 3,9 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_hist.c,v 4.3 88/11/25 20:45:25 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include <stdlib.h>
--- 3,9 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_hist.c,v 4.3 88/11/25 20:45:25 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include <stdlib.h>
***************
*** 12,17 ****
--- 12,22 ----
#include "fep_defs.h"
#include "fep_glob.h"
#include "fep_funcs.h"
+
+ #if defined(__FreeBSD__) || defined(__CYGWIN__)
+ #define re_comp regcomp
+ #define re_exec regexec
+ #endif
char **HistoryTable;
int TopOfHist;
diff -cr official+NetBSD/fep_main.c fep-cygwin/fep_main.c
*** official+NetBSD/fep_main.c Mon Sep 2 15:54:21 2002
--- fep-cygwin/fep_main.c Mon Sep 2 19:03:54 2002
***************
*** 3,9 ****
#ifndef lint
static char rcsid[]=
"$Id: fep_main.c,v 4.11 1993/06/10 02:51:28 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include <signal.h>
--- 3,9 ----
#ifndef lint
static char rcsid[]=
"$Id: fep_main.c,v 4.11 1993/06/10 02:51:28 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include <signal.h>
***************
*** 12,18 ****
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #ifdef __linux__
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
--- 12,18 ----
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #if defined(__linux__) || defined(__CYGWIN__)
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
***************
*** 39,45 ****
#ifdef STAT
static char fep_statrc[] = FEP_STAT;
#endif
! #endif lint
char *myself; /* the command name */
char *prompt = ""; /* prompt string */
--- 39,45 ----
#ifdef STAT
static char fep_statrc[] = FEP_STAT;
#endif
! #endif /* lint */
char *myself; /* the command name */
char *prompt = ""; /* prompt string */
***************
*** 84,90 ****
#ifdef KANJI
struct jtchars jtchars_buf; /* kanji tty characters */
int kmode_buf; /* kanji mode */
! #endif KANJI
char master_tty[16]; /* master tty name */
char slave_tty[16]; /* slave tty name */
--- 84,90 ----
#ifdef KANJI
struct jtchars jtchars_buf; /* kanji tty characters */
int kmode_buf; /* kanji mode */
! #endif /* KANJI */
char master_tty[16]; /* master tty name */
char slave_tty[16]; /* slave tty name */
***************
*** 302,307 ****
--- 302,308 ----
sighup = signal (SIGHUP, terminate);
sigchld = signal (SIGCHLD, catchsig);
sigtstp = signal (SIGTSTP, SIG_IGN);
+ signal (SIGINT, (void(*)())send_int_sig);
#ifdef SIGWINCH
(void) signal(SIGWINCH, sigwinch);
#endif
***************
*** 685,691 ****
--- 686,694 ----
*/
t = open ("/dev/tty", 2);
if (t >= 0) {
+ #ifndef __CYGWIN32__
ioctl (t, TIOCNOTTY, (char *) 0);
+ #endif
(void) close (t);
}
***************
*** 818,823 ****
--- 821,833 ----
exit (0);
}
+ send_int_sig() {
+ #ifndef __CYGWIN__
+ kill(child_pid,SIGINT);
+ #endif
+ return 0;
+ }
+
get_pty_master()
{
char c;
***************
*** 828,833 ****
--- 838,853 ----
master = 1;
return;
}
+ #ifdef __CYGWIN32__
+ for (i = 0; i < 16; i++) {
+ sprintf (master_tty, "/dev/ptmx");
+ master = open (master_tty, O_RDWR);
+ if (master >= 0) {
+ sprintf (slave_tty, "/dev/tty%x",i);
+ goto FOUND;
+ }
+ }
+ #else
for (c = 'p'; c <= 's'; c++) {
for (i = 0; i < 16; i++) {
sprintf (master_tty, "/dev/pty%c%x", c, i);
***************
*** 838,844 ****
}
}
}
!
/*
* Can't get master tty
*/
--- 858,864 ----
}
}
}
! #endif
/*
* Can't get master tty
*/
***************
*** 877,883 ****
# if defined(TIOCKGETC) && defined(TIOCKSETC)
ioctl (0, TIOCKGETC, (char *) &jtchars_buf);
# endif
! #endif KANJI
FD_ZERO(&stdinmask);
FD_ZERO(&mastermask);
--- 897,903 ----
# if defined(TIOCKGETC) && defined(TIOCKSETC)
ioctl (0, TIOCKGETC, (char *) &jtchars_buf);
# endif
! #endif /* KANJI */
FD_ZERO(&stdinmask);
FD_ZERO(&mastermask);
***************
*** 916,922 ****
# if defined(TIOCKGETC) && defined(TIOCKSETC)
ioctl (slave, TIOCKSETC, (char *) &jtchars_buf);
# endif
! #endif KANJI
#ifdef TIOCSWINSZ
{
--- 936,942 ----
# if defined(TIOCKGETC) && defined(TIOCKSETC)
ioctl (slave, TIOCKSETC, (char *) &jtchars_buf);
# endif
! #endif /* KANJI */
#ifdef TIOCSWINSZ
{
***************
*** 944,950 ****
--- 964,972 ----
{
long pid;
void (*func) __P((int));
+ #ifndef __CYGWIN32__
int omask;
+ #endif
extern int errno;
pid = getpid ();
***************
*** 953,959 ****
--- 975,983 ----
signal (SIGTSTP, SIG_DFL);
recover_tty();
#define mask(s) (1 << ((s)-1))
+ #ifndef __CYGWIN32__
omask = sigsetmask (sigblock (0) & ~mask (SIGTSTP));
+ #endif
kill (0, SIGTSTP);
if (kill (child_pid, SIGCONT) < 0 && errno == ESRCH) {
***************
*** 964,970 ****
--- 988,996 ----
kill (0, SIGCONT);
signal (SIGCHLD, func);
signal (SIGTSTP, SIG_IGN);
+ #ifndef __CYGWIN32__
sigblock (mask (SIGTSTP));
+ #endif
fix_tty ();
if (look_var ("auto-repaint"))
fep_repaint(0);
diff -cr official+NetBSD/fep_set.c fep-cygwin/fep_set.c
*** official+NetBSD/fep_set.c Mon Sep 2 15:54:01 2002
--- fep-cygwin/fep_set.c Mon Sep 2 19:02:56 2002
***************
*** 3,9 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_set.c,v 4.3 91/05/29 14:31:08 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include "fep_defs.h"
--- 3,9 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_set.c,v 4.3 91/05/29 14:31:08 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include "fep_defs.h"
***************
*** 67,76 ****
#ifdef HASH
#define HASHNUM 10
VAR *var_htab[HASHNUM];
! #else HASH
VAR var_top = {"top", "top", (char *)0, (VAR *)0};
VAR *var_list = &var_top;
! #endif HASH
/*
* Functions
--- 67,76 ----
#ifdef HASH
#define HASHNUM 10
VAR *var_htab[HASHNUM];
! #else /* HASH */
VAR var_top = {"top", "top", (char *)0, (VAR *)0};
VAR *var_list = &var_top;
! #endif /* HASH */
/*
* Functions
***************
*** 251,262 ****
for (; vp != (VAR *)0; vp = vp->v_next)
printf ("%-16s %s\n", vp->v_name, vp->v_value);
}
! #else HASH
register VAR *vp;
for (vp = var_list->v_next; vp; vp = vp->v_next)
printf ("%-16s %s\n", vp->v_name, vp->v_value);
! #endif HASH
}
#ifdef HASH
--- 251,262 ----
for (; vp != (VAR *)0; vp = vp->v_next)
printf ("%-16s %s\n", vp->v_name, vp->v_value);
}
! #else /* HASH */
register VAR *vp;
for (vp = var_list->v_next; vp; vp = vp->v_next)
printf ("%-16s %s\n", vp->v_name, vp->v_value);
! #endif /* HASH */
}
#ifdef HASH
***************
*** 273,279 ****
return (sum % HASHNUM);
}
! #endif HASH
/*
* Get pointer to VAR.
--- 273,279 ----
return (sum % HASHNUM);
}
! #endif /* HASH */
/*
* Get pointer to VAR.
***************
*** 288,294 ****
{
#ifdef HASH
register i = getindex (name);
! #endif HASH
VAR *vp, *last = (VAR *)0;
#ifdef HASH
--- 288,294 ----
{
#ifdef HASH
register i = getindex (name);
! #endif /* HASH */
VAR *vp, *last = (VAR *)0;
#ifdef HASH
***************
*** 296,302 ****
if (strcmp (name, vp->v_value) == 0)
return (vp);
}
! #else HASH
for (vp = var_list->v_next, last = var_list; vp; last = vp, vp = vp->v_next) {
int r;
--- 296,302 ----
if (strcmp (name, vp->v_value) == 0)
return (vp);
}
! #else /* HASH */
for (vp = var_list->v_next, last = var_list; vp; last = vp, vp = vp->v_next) {
int r;
***************
*** 309,315 ****
else if (r < 0)
break;
}
! #endif HASH
if (alloc == 0)
return (0);
--- 309,315 ----
else if (r < 0)
break;
}
! #endif /* HASH */
if (alloc == 0)
return (0);
***************
*** 327,335 ****
else {
var_htab[i] = vp;
}
! #else HASH
vp->v_next = last->v_next;
last->v_next = vp;
! #endif HASH
return (vp);
}
--- 327,335 ----
else {
var_htab[i] = vp;
}
! #else /* HASH */
vp->v_next = last->v_next;
last->v_next = vp;
! #endif /* HASH */
return (vp);
}
diff -cr official+NetBSD/fep_stat.h fep-cygwin/fep_stat.h
*** official+NetBSD/fep_stat.h Mon Sep 2 15:54:01 2002
--- fep-cygwin/fep_stat.h Mon Sep 2 19:05:22 2002
***************
*** 3,9 ****
#ifndef lint
# define FEP_STAT \
"$Header: fep_stat.h,v 4.0 88/08/05 20:21:58 utashiro Rel $ (SRA)"
! #endif lint
extern long stat_obyte;
extern long stat_ibyte;
--- 3,9 ----
#ifndef lint
# define FEP_STAT \
"$Header: fep_stat.h,v 4.0 88/08/05 20:21:58 utashiro Rel $ (SRA)"
! #endif /* lint */
extern long stat_obyte;
extern long stat_ibyte;
diff -cr official+NetBSD/fep_util.c fep-cygwin/fep_util.c
*** official+NetBSD/fep_util.c Mon Sep 2 15:54:01 2002
--- fep-cygwin/fep_util.c Mon Sep 2 19:04:14 2002
***************
*** 3,16 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_util.c,v 4.1 88/08/28 18:57:41 utashiro Exp $ (SRA)";
! #endif lint
#ifndef MKARGDEBUG
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/dir.h>
#include <ctype.h>
#include "fep_defs.h"
--- 3,20 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_util.c,v 4.1 88/08/28 18:57:41 utashiro Exp $ (SRA)";
! #endif /* lint */
#ifndef MKARGDEBUG
#include <stdio.h>
#include <pwd.h>
#include <sys/types.h>
+ #if defined(__CYGWIN__)
+ #include <dirent.h>
+ #else
#include <sys/dir.h>
+ #endif
#include <ctype.h>
#include "fep_defs.h"
***************
*** 178,186 ****
{
return (d1 > d2 ? d1 : d2);
}
! #endif max
! #else MKARGDEBUG
#include <stdio.h>
#include <ctype.h>
--- 182,190 ----
{
return (d1 > d2 ? d1 : d2);
}
! #endif /* max */
! #else /* MKARGDEBUG */
#include <stdio.h>
#include <ctype.h>
***************
*** 198,204 ****
showArgs (s);
}
}
! #endif MKARGDEBUG
showArgs (comline)
char *comline;
--- 202,208 ----
showArgs (s);
}
}
! #endif /* MKARGDEBUG */
showArgs (comline)
char *comline;
***************
*** 402,405 ****
else
return (iskanji (*cp));
}
! #endif KANJI
--- 406,409 ----
else
return (iskanji (*cp));
}
! #endif /* KANJI */
diff -cr official+NetBSD/fep_vi.c fep-cygwin/fep_vi.c
*** official+NetBSD/fep_vi.c Mon Sep 2 15:54:21 2002
--- fep-cygwin/fep_vi.c Mon Sep 2 19:02:30 2002
***************
*** 3,15 ****
#ifndef lint
static char rcsid[]=
"$Header: fep_vi.c,v 4.7 91/05/29 14:31:10 utashiro Exp $ (SRA)";
! #endif lint
#include <stdio.h>
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #ifdef __linux__
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
--- 3,15 ----
#ifndef lint
static char rcsid[]=
"$Header: fep_vi.c,v 4.7 91/05/29 14:31:10 utashiro Exp $ (SRA)";
! #endif /* lint */
#include <stdio.h>
#include <sys/ioctl.h>
#ifdef TERMIOS
#include <termios.h>
! #if defined(__linux__) || defined(__CYGWIN__)
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE '\0'
#endif
***************
*** 176,183 ****
--- 176,190 ----
import (cft, initial_ttymode.c_cc[VSTART], ignore);
import (cft, initial_ttymode.c_cc[VSTOP], ignore);
*/
+ #if 0
import (cft, initial_ttymode.c_cc[VINTR], insert_and_flush);
import (aft, initial_ttymode.c_cc[VINTR], insert_and_flush);
+ #else
+ /* added by noro */
+ import (cft, initial_ttymode.c_cc[VINTR], send_int_sig);
+ /* XXX : this may not be necessary */
+ import (aft, initial_ttymode.c_cc[VINTR], send_int_sig);
+ #endif
import (cft, initial_ttymode.c_cc[VQUIT], insert_and_flush);
import (cft, initial_ttymode.c_cc[VEOF], send_eof);
#ifdef VSWTC
***************
*** 198,205 ****
--- 205,217 ----
import (cft, tchars_buf.t_startx, ignore);
import (cft, tchars_buf.t_stopc, ignore);
*/
+ #if 0
import (cft, tchars_buf.t_intrc, insert_and_flush);
import (aft, tchars_buf.t_intrc, insert_and_flush);
+ #else
+ import (cft, tchars_buf.t_intrc, send_int_sig);
+ import (aft, tchars_buf.t_intrc, send_int_sig);
+ #endif
import (cft, tchars_buf.t_quitc, insert_and_flush);
import (cft, tchars_buf.t_eofc, send_eof);
import (cft, tchars_buf.t_brkc, insert_and_flush);
diff -cr official+NetBSD/feprc.sample fep-cygwin/feprc.sample
*** official+NetBSD/feprc.sample Mon Sep 2 15:54:02 2002
--- fep-cygwin/feprc.sample Mon Sep 2 18:35:49 2002
***************
*** 6,11 ****
--- 6,13 ----
set alarm-on-eof
set savehist=50
+ #sed editmode=vi
+
echo "Welcome to fep! Editmode is" $editmode
echo "I'm a front end processor for" $command
***************
*** 39,41 ****
--- 41,55 ----
else
echo "History will be saved to" $history-file
endif
+
+ fep-bind suspend "\^Z"
+
+ #Fujimoto's setting
+ fep-bind delete-previous-character "\^H"
+ fep-bind backward-character "\^[[D"
+ fep-bind forward-character "\^[[C"
+ # fep-bind beginning-of-line "\^A"
+ # fep-bind end-of-line "\^E"
+ fep-bind previous-history "\^[[A"
+ fep-bind next-history "\^[[B"
+