mirror of
https://git.freebsd.org/ports.git
synced 2025-06-09 14:50:31 -04:00
Applied patch for maintainer's update.
PR: ports/30875 Submitted by: the maintainer
This commit is contained in:
parent
eaebd1bcbc
commit
c4f8b80b14
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=48597
3 changed files with 395 additions and 427 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= cider
|
PORTNAME= cider
|
||||||
PORTVERSION= 1.b1
|
PORTVERSION= 1.b1
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= cad
|
CATEGORIES= cad
|
||||||
MASTER_SITES= ftp://ic.eecs.berkeley.edu/pub/Cider/new/
|
MASTER_SITES= ftp://ic.eecs.berkeley.edu/pub/Cider/new/
|
||||||
DISTNAME= cider1b1
|
DISTNAME= cider1b1
|
||||||
|
|
|
@ -1,213 +1,197 @@
|
||||||
*** spice/common/src/bin/main.c.orig Sat Mar 12 08:22:28 1994
|
--- spice/common/src/bin/main.c.orig Sat Mar 12 08:22:28 1994
|
||||||
--- spice/common/src/bin/main.c Tue Oct 24 03:32:20 2000
|
+++ spice/common/src/bin/main.c Wed Sep 19 11:06:34 2001
|
||||||
***************
|
@@ -25,6 +25,13 @@
|
||||||
*** 25,30 ****
|
#include <pwd.h>
|
||||||
--- 25,37 ----
|
#endif
|
||||||
#include <pwd.h>
|
|
||||||
#endif
|
+#ifdef HAS_GNUREADLINE
|
||||||
|
+/* Added GNU Readline Support 11/3/97 -- Andrew Veliath <veliaa@rpi.edu> */
|
||||||
+ #ifdef HAS_GNUREADLINE
|
+#include <readline/readline.h>
|
||||||
+ /* Added GNU Readline Support 11/3/97 -- Andrew Veliath <veliaa@rpi.edu> */
|
+#include <readline/history.h>
|
||||||
+ #include <readline/readline.h>
|
+#include "fteinput.h"
|
||||||
+ #include <readline/history.h>
|
+#endif
|
||||||
+ #include "fteinput.h"
|
+
|
||||||
+ #endif
|
#ifdef HAS_UNIX_SIGS
|
||||||
+
|
#include <signal.h>
|
||||||
#ifdef HAS_UNIX_SIGS
|
#endif
|
||||||
#include <signal.h>
|
@@ -36,6 +43,11 @@
|
||||||
#endif
|
#endif
|
||||||
***************
|
|
||||||
*** 36,41 ****
|
#include "patchlev.h"
|
||||||
--- 43,53 ----
|
+
|
||||||
#endif
|
+#ifdef __FreeBSD__
|
||||||
|
+#include <ieeefp.h>
|
||||||
#include "patchlev.h"
|
+#endif
|
||||||
+
|
+
|
||||||
+ #ifdef __FreeBSD__
|
#include "suffix.h"
|
||||||
+ #include <ieeefp.h>
|
|
||||||
+ #endif
|
/* (Virtual) Machine architecture parameters */
|
||||||
+
|
@@ -53,6 +65,11 @@
|
||||||
#include "suffix.h"
|
bool ft_intrpt = false; /* Set by the (void) signal handlers. */
|
||||||
|
bool ft_setflag = false; /* Don't abort after an interrupt. */
|
||||||
/* (Virtual) Machine architecture parameters */
|
|
||||||
***************
|
+#ifdef HAS_GNUREADLINE
|
||||||
*** 53,58 ****
|
+char gnu_history_file[512];
|
||||||
--- 65,75 ----
|
+static char *application_name;
|
||||||
bool ft_intrpt = false; /* Set by the (void) signal handlers. */
|
+#endif
|
||||||
bool ft_setflag = false; /* Don't abort after an interrupt. */
|
+
|
||||||
|
struct variable *(*if_getparam)( );
|
||||||
+ #ifdef HAS_GNUREADLINE
|
|
||||||
+ char gnu_history_file[512];
|
#ifdef BATCH
|
||||||
+ static char *application_name;
|
@@ -185,6 +202,95 @@
|
||||||
+ #endif
|
|
||||||
+
|
#endif
|
||||||
struct variable *(*if_getparam)( );
|
|
||||||
|
+#ifdef HAS_GNUREADLINE
|
||||||
#ifdef BATCH
|
+/* Adapted ../lib/cp/lexical.c:prompt() for GNU Readline -- Andrew Veliath <veliaa@rpi.edu> */
|
||||||
***************
|
+static char *
|
||||||
*** 185,190 ****
|
+prompt()
|
||||||
--- 202,294 ----
|
+{
|
||||||
|
+ static char pbuf[128];
|
||||||
#endif
|
+ int n = sizeof(pbuf);
|
||||||
|
+ char *p = pbuf, *s;
|
||||||
+ #ifdef HAS_GNUREADLINE
|
+
|
||||||
+ /* Adapted ../lib/cp/lexical.c:prompt() for GNU Readline -- Andrew Veliath <veliaa@rpi.edu> */
|
+ if (cp_interactive == false)
|
||||||
+ static char *
|
+ return;
|
||||||
+ prompt()
|
+ if (cp_promptstring == NULL)
|
||||||
+ {
|
+ s = "-> ";
|
||||||
+ static char pbuf[128];
|
+ else
|
||||||
+ int n = sizeof(pbuf);
|
+ s = cp_promptstring;
|
||||||
+ char *p = pbuf, *s;
|
+ if (cp_altprompt)
|
||||||
+
|
+ s = cp_altprompt;
|
||||||
+ if (cp_interactive == false)
|
+ while (*s && (n > 1)) {
|
||||||
+ return;
|
+ int w;
|
||||||
+ if (cp_promptstring == NULL)
|
+ switch (strip(*s)) {
|
||||||
+ s = "-> ";
|
+ case '!':
|
||||||
+ else
|
+ w = snprintf(p, n, "%d", where_history() + 1);
|
||||||
+ s = cp_promptstring;
|
+ w = (w >= n) ? n - 1 : w;
|
||||||
+ if (cp_altprompt)
|
+ p += w;
|
||||||
+ s = cp_altprompt;
|
+ n -= w;
|
||||||
+ while (*s && (n > 1)) {
|
+ break;
|
||||||
+ int w;
|
+ case '\\':
|
||||||
+ switch (strip(*s)) {
|
+ if (*(s + 1)) ++s;
|
||||||
+ case '!':
|
+ default:
|
||||||
+ w = snprintf(p, n, "%d", where_history() + 1);
|
+ *p = strip(*s); ++p;
|
||||||
+ w = (w >= n) ? n - 1 : w;
|
+ --n;
|
||||||
+ p += w;
|
+ break;
|
||||||
+ n -= w;
|
+ }
|
||||||
+ break;
|
+ s++;
|
||||||
+ default:
|
+ }
|
||||||
+ *p = strip(*s); ++p;
|
+ *p = 0;
|
||||||
+ --n;
|
+ return pbuf;
|
||||||
+ break;
|
+}
|
||||||
+ }
|
+
|
||||||
+ s++;
|
+/* Process device events in Readline's hook since there is no where
|
||||||
+ }
|
+ else to do it now - AV */
|
||||||
+ *p = 0;
|
+int rl_event_func()
|
||||||
+ return pbuf;
|
+{
|
||||||
+ }
|
+ static REQUEST reqst = { checkup_option, 0 };
|
||||||
+
|
+ Input(&reqst, NULL);
|
||||||
+ /* Process device events in Readline's hook since there is no where
|
+ return 0;
|
||||||
+ else to do it now - AV */
|
+}
|
||||||
+ int rl_event_func()
|
+
|
||||||
+ {
|
+/* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
|
||||||
+ static REQUEST reqst = { checkup_option, 0 };
|
+void app_rl_readlines()
|
||||||
+ Input(&reqst, NULL);
|
+{
|
||||||
+ return 0;
|
+ char *line, *expanded_line;
|
||||||
+ }
|
+
|
||||||
+
|
+ strcpy(gnu_history_file, getenv("HOME"));
|
||||||
+ /* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
|
+ strcat(gnu_history_file, "/.");
|
||||||
+ void app_rl_readlines()
|
+ strcat(gnu_history_file, application_name);
|
||||||
+ {
|
+ strcat(gnu_history_file, "_history");
|
||||||
+ char *line, *expanded_line;
|
+
|
||||||
+
|
+ using_history();
|
||||||
+ strcpy(gnu_history_file, getenv("HOME"));
|
+ read_history(gnu_history_file);
|
||||||
+ strcat(gnu_history_file, "/.");
|
+
|
||||||
+ strcat(gnu_history_file, application_name);
|
+ rl_readline_name = application_name;
|
||||||
+ strcat(gnu_history_file, "_history");
|
+ rl_instream = cp_in;
|
||||||
+
|
+ rl_outstream = cp_out;
|
||||||
+ using_history();
|
+ rl_event_hook = rl_event_func;
|
||||||
+ read_history(gnu_history_file);
|
+
|
||||||
+
|
+ while (1) {
|
||||||
+ rl_readline_name = application_name;
|
+ history_set_pos(history_length);
|
||||||
+ rl_instream = cp_in;
|
+ line = readline(prompt());
|
||||||
+ rl_outstream = cp_out;
|
+ if (line && *line) {
|
||||||
+ rl_event_hook = rl_event_func;
|
+ int s = history_expand(line, &expanded_line);
|
||||||
+
|
+
|
||||||
+ while (1) {
|
+ if (s == 2) {
|
||||||
+ history_set_pos(history_length);
|
+ fprintf(stderr, "-> %s\n", expanded_line);
|
||||||
+ line = readline(prompt());
|
+ } else if (s == -1) {
|
||||||
+ if (line && *line) {
|
+ fprintf(stderr, "readline: %s\n", expanded_line);
|
||||||
+ int s = history_expand(line, &expanded_line);
|
+ } else {
|
||||||
+
|
+ cp_evloop(expanded_line);
|
||||||
+ if (s == 2) {
|
+ add_history(expanded_line);
|
||||||
+ fprintf(stderr, "-> %s\n", expanded_line);
|
+ }
|
||||||
+ } else if (s == -1) {
|
+ free(expanded_line);
|
||||||
+ fprintf(stderr, "readline: %s\n", expanded_line);
|
+ }
|
||||||
+ } else {
|
+ if (line) free(line);
|
||||||
+ cp_evloop(expanded_line);
|
+ else if (line == NULL) cp_evloop("quit");
|
||||||
+ add_history(expanded_line);
|
+ }
|
||||||
+ }
|
+ /* History gets written in ../fte/misccoms.c com_quit */
|
||||||
+ free(expanded_line);
|
+}
|
||||||
+ }
|
+#endif /* HAS_GNUREADLINE */
|
||||||
+ if (line) free(line);
|
+
|
||||||
+ else if (line == NULL) cp_evloop("quit");
|
char *hlp_filelist[] = { "spice", 0 };
|
||||||
+ }
|
|
||||||
+ /* History gets written in ../fte/misccoms.c com_quit */
|
void
|
||||||
+ }
|
@@ -216,6 +322,10 @@
|
||||||
+ #endif /* HAS_GNUREADLINE */
|
|
||||||
+
|
#endif
|
||||||
char *hlp_filelist[] = { "spice", 0 };
|
|
||||||
|
+#ifdef __FreeBSD__
|
||||||
void
|
+ fpsetmask(fpgetmask() & ~FP_X_INV & ~FP_X_DZ & ~FP_X_OFL);
|
||||||
***************
|
+#endif
|
||||||
*** 216,221 ****
|
+
|
||||||
--- 320,329 ----
|
/* MFB tends to jump to 0 on errors. This tends to catch it. */
|
||||||
|
if (started) {
|
||||||
#endif
|
fprintf(cp_err, "main: Internal Error: jump to zero\n");
|
||||||
|
@@ -236,6 +346,13 @@
|
||||||
+ #ifdef __FreeBSD__
|
ARCHsize = 1;
|
||||||
+ fpsetmask(fpgetmask() & ~FP_X_INV & ~FP_X_DZ & ~FP_X_OFL);
|
#endif /* PARALLEL_ARCH */
|
||||||
+ #endif
|
|
||||||
+
|
+#ifdef HAS_GNUREADLINE
|
||||||
/* MFB tends to jump to 0 on errors. This tends to catch it. */
|
+ if (!(application_name = strrchr(av[0],'/')))
|
||||||
if (started) {
|
+ application_name = av[0];
|
||||||
fprintf(cp_err, "main: Internal Error: jump to zero\n");
|
+ else
|
||||||
***************
|
+ ++application_name;
|
||||||
*** 236,241 ****
|
+#endif
|
||||||
--- 344,356 ----
|
+
|
||||||
ARCHsize = 1;
|
#ifdef HAS_MAC_ARGCARGV
|
||||||
#endif /* PARALLEL_ARCH */
|
ac = initmac(&av);
|
||||||
|
#endif
|
||||||
+ #ifdef HAS_GNUREADLINE
|
@@ -472,7 +589,11 @@
|
||||||
+ if (!(application_name = strrchr(av[0],'/')))
|
# ifdef HAS_UNIX_SIGS
|
||||||
+ application_name = av[0];
|
/* Set up (void) signal handling */
|
||||||
+ else
|
if (!ft_batchmode) {
|
||||||
+ ++application_name;
|
+# ifdef HAS_GNUREADLINE
|
||||||
+ #endif
|
+ (void) signal(SIGINT, SIG_IGN);
|
||||||
+
|
+# else
|
||||||
#ifdef HAS_MAC_ARGCARGV
|
(void) signal(SIGINT, ft_sigintr);
|
||||||
ac = initmac(&av);
|
+# endif
|
||||||
#endif
|
(void) signal(SIGFPE, sigfloat);
|
||||||
***************
|
# ifdef SIGTSTP
|
||||||
*** 472,478 ****
|
(void) signal(SIGTSTP, sigstop);
|
||||||
--- 587,597 ----
|
@@ -668,7 +789,11 @@
|
||||||
# ifdef HAS_UNIX_SIGS
|
} else {
|
||||||
/* Set up (void) signal handling */
|
(void) setjmp(jbuf);
|
||||||
if (!ft_batchmode) {
|
cp_interactive = true;
|
||||||
+ # ifdef HAS_GNUREADLINE
|
+#ifdef HAS_GNUREADLINE
|
||||||
+ (void) signal(SIGINT, SIG_IGN);
|
+ app_rl_readlines();
|
||||||
+ # else
|
+#else
|
||||||
(void) signal(SIGINT, ft_sigintr);
|
while (cp_evloop((char *) NULL) == 1) ;
|
||||||
+ # endif
|
+#endif /* ifelse HAS_GNUREADLINE */
|
||||||
(void) signal(SIGFPE, sigfloat);
|
}
|
||||||
# ifdef SIGTSTP
|
|
||||||
(void) signal(SIGTSTP, sigstop);
|
# else /* if BATCH */
|
||||||
***************
|
@@ -708,7 +833,11 @@
|
||||||
*** 668,674 ****
|
/* Nutmeg "main" */
|
||||||
--- 787,797 ----
|
(void) setjmp(jbuf);
|
||||||
} else {
|
cp_interactive = true;
|
||||||
(void) setjmp(jbuf);
|
+#ifdef HAS_GNUREADLINE
|
||||||
cp_interactive = true;
|
+ app_rl_readlines();
|
||||||
+ #ifdef HAS_GNUREADLINE
|
+#else
|
||||||
+ app_rl_readlines();
|
while (cp_evloop((char *) NULL) == 1) ;
|
||||||
+ #else
|
+#endif /* ifelse HAS_GNUREADLINE */
|
||||||
while (cp_evloop((char *) NULL) == 1) ;
|
|
||||||
+ #endif /* ifelse HAS_GNUREADLINE */
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
# else /* if BATCH */
|
|
||||||
***************
|
|
||||||
*** 708,714 ****
|
|
||||||
--- 831,841 ----
|
|
||||||
/* Nutmeg "main" */
|
|
||||||
(void) setjmp(jbuf);
|
|
||||||
cp_interactive = true;
|
|
||||||
+ #ifdef HAS_GNUREADLINE
|
|
||||||
+ app_rl_readlines();
|
|
||||||
+ #else
|
|
||||||
while (cp_evloop((char *) NULL) == 1) ;
|
|
||||||
+ #endif /* ifelse HAS_GNUREADLINE */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
|
@ -1,213 +1,197 @@
|
||||||
*** cider/common/src/bin/main.c.orig Sat Mar 12 08:20:59 1994
|
--- cider/common/src/bin/main.c.orig Sat Mar 12 08:20:59 1994
|
||||||
--- cider/common/src/bin/main.c Tue Oct 24 03:37:38 2000
|
+++ cider/common/src/bin/main.c Wed Sep 19 11:07:47 2001
|
||||||
***************
|
@@ -25,6 +25,13 @@
|
||||||
*** 25,30 ****
|
#include <pwd.h>
|
||||||
--- 25,37 ----
|
#endif
|
||||||
#include <pwd.h>
|
|
||||||
#endif
|
+#ifdef HAS_GNUREADLINE
|
||||||
|
+/* Added GNU Readline Support 11/3/97 -- Andrew Veliath <veliaa@rpi.edu> */
|
||||||
+ #ifdef HAS_GNUREADLINE
|
+#include <readline/readline.h>
|
||||||
+ /* Added GNU Readline Support 11/3/97 -- Andrew Veliath <veliaa@rpi.edu> */
|
+#include <readline/history.h>
|
||||||
+ #include <readline/readline.h>
|
+#include "fteinput.h"
|
||||||
+ #include <readline/history.h>
|
+#endif
|
||||||
+ #include "fteinput.h"
|
+
|
||||||
+ #endif
|
#ifdef HAS_UNIX_SIGS
|
||||||
+
|
#include <signal.h>
|
||||||
#ifdef HAS_UNIX_SIGS
|
#endif
|
||||||
#include <signal.h>
|
@@ -36,6 +43,11 @@
|
||||||
#endif
|
#endif
|
||||||
***************
|
|
||||||
*** 36,41 ****
|
#include "patchlev.h"
|
||||||
--- 43,53 ----
|
+
|
||||||
#endif
|
+#ifdef __FreeBSD__
|
||||||
|
+#include <ieeefp.h>
|
||||||
#include "patchlev.h"
|
+#endif
|
||||||
+
|
+
|
||||||
+ #ifdef __FreeBSD__
|
#include "suffix.h"
|
||||||
+ #include <ieeefp.h>
|
|
||||||
+ #endif
|
/* (Virtual) Machine architecture parameters */
|
||||||
+
|
@@ -53,6 +65,11 @@
|
||||||
#include "suffix.h"
|
bool ft_intrpt = false; /* Set by the (void) signal handlers. */
|
||||||
|
bool ft_setflag = false; /* Don't abort after an interrupt. */
|
||||||
/* (Virtual) Machine architecture parameters */
|
|
||||||
***************
|
+#ifdef HAS_GNUREADLINE
|
||||||
*** 53,58 ****
|
+char gnu_history_file[512];
|
||||||
--- 65,75 ----
|
+static char *application_name;
|
||||||
bool ft_intrpt = false; /* Set by the (void) signal handlers. */
|
+#endif
|
||||||
bool ft_setflag = false; /* Don't abort after an interrupt. */
|
+
|
||||||
|
struct variable *(*if_getparam)( );
|
||||||
+ #ifdef HAS_GNUREADLINE
|
|
||||||
+ char gnu_history_file[512];
|
#ifdef BATCH
|
||||||
+ static char *application_name;
|
@@ -185,6 +202,95 @@
|
||||||
+ #endif
|
|
||||||
+
|
#endif
|
||||||
struct variable *(*if_getparam)( );
|
|
||||||
|
+#ifdef HAS_GNUREADLINE
|
||||||
#ifdef BATCH
|
+/* Adapted ../lib/cp/lexical.c:prompt() for GNU Readline -- Andrew Veliath <veliaa@rpi.edu> */
|
||||||
***************
|
+static char *
|
||||||
*** 185,190 ****
|
+prompt()
|
||||||
--- 202,294 ----
|
+{
|
||||||
|
+ static char pbuf[128];
|
||||||
#endif
|
+ int n = sizeof(pbuf);
|
||||||
|
+ char *p = pbuf, *s;
|
||||||
+ #ifdef HAS_GNUREADLINE
|
+
|
||||||
+ /* Adapted ../lib/cp/lexical.c:prompt() for GNU Readline -- Andrew Veliath <veliaa@rpi.edu> */
|
+ if (cp_interactive == false)
|
||||||
+ static char *
|
+ return;
|
||||||
+ prompt()
|
+ if (cp_promptstring == NULL)
|
||||||
+ {
|
+ s = "-> ";
|
||||||
+ static char pbuf[128];
|
+ else
|
||||||
+ int n = sizeof(pbuf);
|
+ s = cp_promptstring;
|
||||||
+ char *p = pbuf, *s;
|
+ if (cp_altprompt)
|
||||||
+
|
+ s = cp_altprompt;
|
||||||
+ if (cp_interactive == false)
|
+ while (*s && (n > 1)) {
|
||||||
+ return;
|
+ int w;
|
||||||
+ if (cp_promptstring == NULL)
|
+ switch (strip(*s)) {
|
||||||
+ s = "-> ";
|
+ case '!':
|
||||||
+ else
|
+ w = snprintf(p, n, "%d", where_history() + 1);
|
||||||
+ s = cp_promptstring;
|
+ w = (w >= n) ? n - 1 : w;
|
||||||
+ if (cp_altprompt)
|
+ p += w;
|
||||||
+ s = cp_altprompt;
|
+ n -= w;
|
||||||
+ while (*s && (n > 1)) {
|
+ break;
|
||||||
+ int w;
|
+ case '\\':
|
||||||
+ switch (strip(*s)) {
|
+ if (*(s + 1)) ++s;
|
||||||
+ case '!':
|
+ default:
|
||||||
+ w = snprintf(p, n, "%d", where_history() + 1);
|
+ *p = strip(*s); ++p;
|
||||||
+ w = (w >= n) ? n - 1 : w;
|
+ --n;
|
||||||
+ p += w;
|
+ break;
|
||||||
+ n -= w;
|
+ }
|
||||||
+ break;
|
+ s++;
|
||||||
+ default:
|
+ }
|
||||||
+ *p = strip(*s); ++p;
|
+ *p = 0;
|
||||||
+ --n;
|
+ return pbuf;
|
||||||
+ break;
|
+}
|
||||||
+ }
|
+
|
||||||
+ s++;
|
+/* Process device events in Readline's hook since there is no where
|
||||||
+ }
|
+ else to do it now - AV */
|
||||||
+ *p = 0;
|
+int rl_event_func()
|
||||||
+ return pbuf;
|
+{
|
||||||
+ }
|
+ static REQUEST reqst = { checkup_option, 0 };
|
||||||
+
|
+ Input(&reqst, NULL);
|
||||||
+ /* Process device events in Readline's hook since there is no where
|
+ return 0;
|
||||||
+ else to do it now - AV */
|
+}
|
||||||
+ int rl_event_func()
|
+
|
||||||
+ {
|
+/* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
|
||||||
+ static REQUEST reqst = { checkup_option, 0 };
|
+void app_rl_readlines()
|
||||||
+ Input(&reqst, NULL);
|
+{
|
||||||
+ return 0;
|
+ char *line, *expanded_line;
|
||||||
+ }
|
+
|
||||||
+
|
+ strcpy(gnu_history_file, getenv("HOME"));
|
||||||
+ /* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
|
+ strcat(gnu_history_file, "/.");
|
||||||
+ void app_rl_readlines()
|
+ strcat(gnu_history_file, application_name);
|
||||||
+ {
|
+ strcat(gnu_history_file, "_history");
|
||||||
+ char *line, *expanded_line;
|
+
|
||||||
+
|
+ using_history();
|
||||||
+ strcpy(gnu_history_file, getenv("HOME"));
|
+ read_history(gnu_history_file);
|
||||||
+ strcat(gnu_history_file, "/.");
|
+
|
||||||
+ strcat(gnu_history_file, application_name);
|
+ rl_readline_name = application_name;
|
||||||
+ strcat(gnu_history_file, "_history");
|
+ rl_instream = cp_in;
|
||||||
+
|
+ rl_outstream = cp_out;
|
||||||
+ using_history();
|
+ rl_event_hook = rl_event_func;
|
||||||
+ read_history(gnu_history_file);
|
+
|
||||||
+
|
+ while (1) {
|
||||||
+ rl_readline_name = application_name;
|
+ history_set_pos(history_length);
|
||||||
+ rl_instream = cp_in;
|
+ line = readline(prompt());
|
||||||
+ rl_outstream = cp_out;
|
+ if (line && *line) {
|
||||||
+ rl_event_hook = rl_event_func;
|
+ int s = history_expand(line, &expanded_line);
|
||||||
+
|
+
|
||||||
+ while (1) {
|
+ if (s == 2) {
|
||||||
+ history_set_pos(history_length);
|
+ fprintf(stderr, "-> %s\n", expanded_line);
|
||||||
+ line = readline(prompt());
|
+ } else if (s == -1) {
|
||||||
+ if (line && *line) {
|
+ fprintf(stderr, "readline: %s\n", expanded_line);
|
||||||
+ int s = history_expand(line, &expanded_line);
|
+ } else {
|
||||||
+
|
+ cp_evloop(expanded_line);
|
||||||
+ if (s == 2) {
|
+ add_history(expanded_line);
|
||||||
+ fprintf(stderr, "-> %s\n", expanded_line);
|
+ }
|
||||||
+ } else if (s == -1) {
|
+ free(expanded_line);
|
||||||
+ fprintf(stderr, "readline: %s\n", expanded_line);
|
+ }
|
||||||
+ } else {
|
+ if (line) free(line);
|
||||||
+ cp_evloop(expanded_line);
|
+ else if (line == NULL) cp_evloop("quit");
|
||||||
+ add_history(expanded_line);
|
+ }
|
||||||
+ }
|
+ /* History gets written in ../fte/misccoms.c com_quit */
|
||||||
+ free(expanded_line);
|
+}
|
||||||
+ }
|
+#endif /* HAS_GNUREADLINE */
|
||||||
+ if (line) free(line);
|
+
|
||||||
+ else if (line == NULL) cp_evloop("quit");
|
char *hlp_filelist[] = { "spice", "cider", 0 };
|
||||||
+ }
|
|
||||||
+ /* History gets written in ../fte/misccoms.c com_quit */
|
void
|
||||||
+ }
|
@@ -216,6 +322,10 @@
|
||||||
+ #endif /* HAS_GNUREADLINE */
|
|
||||||
+
|
#endif
|
||||||
char *hlp_filelist[] = { "spice", "cider", 0 };
|
|
||||||
|
+#ifdef __FreeBSD__
|
||||||
void
|
+ fpsetmask(fpgetmask() & ~FP_X_INV & ~FP_X_DZ & ~FP_X_OFL);
|
||||||
***************
|
+#endif
|
||||||
*** 216,221 ****
|
+
|
||||||
--- 320,329 ----
|
/* MFB tends to jump to 0 on errors. This tends to catch it. */
|
||||||
|
if (started) {
|
||||||
#endif
|
fprintf(cp_err, "main: Internal Error: jump to zero\n");
|
||||||
|
@@ -236,6 +346,13 @@
|
||||||
+ #ifdef __FreeBSD__
|
ARCHsize = 1;
|
||||||
+ fpsetmask(fpgetmask() & ~FP_X_INV & ~FP_X_DZ & ~FP_X_OFL);
|
#endif /* PARALLEL_ARCH */
|
||||||
+ #endif
|
|
||||||
+
|
+#ifdef HAS_GNUREADLINE
|
||||||
/* MFB tends to jump to 0 on errors. This tends to catch it. */
|
+ if (!(application_name = strrchr(av[0],'/')))
|
||||||
if (started) {
|
+ application_name = av[0];
|
||||||
fprintf(cp_err, "main: Internal Error: jump to zero\n");
|
+ else
|
||||||
***************
|
+ ++application_name;
|
||||||
*** 236,241 ****
|
+#endif
|
||||||
--- 344,356 ----
|
+
|
||||||
ARCHsize = 1;
|
#ifdef HAS_MAC_ARGCARGV
|
||||||
#endif /* PARALLEL_ARCH */
|
ac = initmac(&av);
|
||||||
|
#endif
|
||||||
+ #ifdef HAS_GNUREADLINE
|
@@ -472,7 +589,11 @@
|
||||||
+ if (!(application_name = strrchr(av[0],'/')))
|
# ifdef HAS_UNIX_SIGS
|
||||||
+ application_name = av[0];
|
/* Set up (void) signal handling */
|
||||||
+ else
|
if (!ft_batchmode) {
|
||||||
+ ++application_name;
|
+# ifdef HAS_GNUREADLINE
|
||||||
+ #endif
|
+ (void) signal(SIGINT, SIG_IGN);
|
||||||
+
|
+# else
|
||||||
#ifdef HAS_MAC_ARGCARGV
|
(void) signal(SIGINT, ft_sigintr);
|
||||||
ac = initmac(&av);
|
+# endif
|
||||||
#endif
|
(void) signal(SIGFPE, sigfloat);
|
||||||
***************
|
# ifdef SIGTSTP
|
||||||
*** 472,478 ****
|
(void) signal(SIGTSTP, sigstop);
|
||||||
--- 587,597 ----
|
@@ -668,7 +789,11 @@
|
||||||
# ifdef HAS_UNIX_SIGS
|
} else {
|
||||||
/* Set up (void) signal handling */
|
(void) setjmp(jbuf);
|
||||||
if (!ft_batchmode) {
|
cp_interactive = true;
|
||||||
+ # ifdef HAS_GNUREADLINE
|
+#ifdef HAS_GNUREADLINE
|
||||||
+ (void) signal(SIGINT, SIG_IGN);
|
+ app_rl_readlines();
|
||||||
+ # else
|
+#else
|
||||||
(void) signal(SIGINT, ft_sigintr);
|
while (cp_evloop((char *) NULL) == 1) ;
|
||||||
+ # endif
|
+#endif /* ifelse HAS_GNUREADLINE */
|
||||||
(void) signal(SIGFPE, sigfloat);
|
}
|
||||||
# ifdef SIGTSTP
|
|
||||||
(void) signal(SIGTSTP, sigstop);
|
# else /* if BATCH */
|
||||||
***************
|
@@ -708,7 +833,11 @@
|
||||||
*** 668,674 ****
|
/* Nutmeg "main" */
|
||||||
--- 787,797 ----
|
(void) setjmp(jbuf);
|
||||||
} else {
|
cp_interactive = true;
|
||||||
(void) setjmp(jbuf);
|
+#ifdef HAS_GNUREADLINE
|
||||||
cp_interactive = true;
|
+ app_rl_readlines();
|
||||||
+ #ifdef HAS_GNUREADLINE
|
+#else
|
||||||
+ app_rl_readlines();
|
while (cp_evloop((char *) NULL) == 1) ;
|
||||||
+ #else
|
+#endif /* ifelse HAS_GNUREADLINE */
|
||||||
while (cp_evloop((char *) NULL) == 1) ;
|
|
||||||
+ #endif /* ifelse HAS_GNUREADLINE */
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
# else /* if BATCH */
|
|
||||||
***************
|
|
||||||
*** 708,714 ****
|
|
||||||
--- 831,841 ----
|
|
||||||
/* Nutmeg "main" */
|
|
||||||
(void) setjmp(jbuf);
|
|
||||||
cp_interactive = true;
|
|
||||||
+ #ifdef HAS_GNUREADLINE
|
|
||||||
+ app_rl_readlines();
|
|
||||||
+ #else
|
|
||||||
while (cp_evloop((char *) NULL) == 1) ;
|
|
||||||
+ #endif /* ifelse HAS_GNUREADLINE */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue