URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 15 to Rev 16
- ↔ Reverse comparison
Rev 15 → Rev 16
/trunk/or1ksim/configure.in
49,6 → 49,10
sys/ptem.h sys/pte.h sys/stream.h sys/select.h \ |
termcap.h termios.h termio.h sys/file.h locale.h) |
|
dnl check for GNU readline |
AC_ARG_ENABLE(readline, |
[ --enable-readline Use GNU readline], AC_CHECK_LIB(readline, add_history)) |
|
dnl yuck |
case "$host_os" in |
aix*) prefer_curses=yes ;; |
/trunk/or1ksim/toplevel.c
20,6 → 20,8
/* Simulator commands. Help and version output. SIGINT processing. |
Stdout redirection is specific to linux (I need to fix this). */ |
|
#include "config.h" |
|
#include <stdio.h> |
#include <ctype.h> |
#include <string.h> |
27,8 → 29,10
#include <signal.h> |
#include <stdarg.h> |
|
#ifdef HAVE_LIBREADLINE |
#include <readline/readline.h> |
#include <readline/history.h> |
#endif /* HAVE_LIBREADLINE */ |
|
#include "arch.h" |
#include "parse.h" |
37,7 → 41,7
#include "execute.h" |
|
/* CVS revision number. */ |
static const char rcsrev[] = "$Revision: 1.3 $"; |
static const char rcsrev[] = "$Revision: 1.4 $"; |
|
/* Continuos run versus single step tracing switch. */ |
int cont_run; |
45,7 → 49,6
/* History of execution */ |
int histexec[HISTEXEC_LEN]; |
|
|
char *sim_commands [] = { |
"q", |
"t", |
127,7 → 130,7
char *argv[]; |
{ |
char *linestr; |
char item1[500]; |
char item1[500], b2[500]; |
char *redirstr; |
int hush; |
|
137,8 → 140,10
exit(-1); |
} |
|
#ifdef HAVE_LIBREADLINE |
initialize_readline (); /* Bind our completer. */ |
|
#endif |
|
version(); |
init_defconfig(); |
signal(SIGINT, ctrl_c); |
148,7 → 153,12
|
while(1) |
{ |
#ifdef HAVE_LIBREADLINE |
linestr = readline("(sim) "); |
#else |
printf ("(sim) "); |
linestr = fgets(b2, sizeof b2, stdin); |
#endif |
|
if (!linestr) |
{ |
156,6 → 166,7
} |
linestr = stripwhite (linestr); |
|
#ifdef HAVE_LIBREADLINE |
if (strlen(linestr) == 0) |
{ |
char *l = repeat_last_command (); |
171,6 → 182,7
{ |
add_history (linestr); |
} |
#endif /* HAVE_LIBREADLINE */ |
|
if (redirstr = strstr(linestr, ">")) |
{ |
298,13 → 310,16
fflush(stdout); |
freopen("/dev/fd/0", "w+", stdout); |
|
#ifdef HAVE_LIBREADLINE |
if (linestr) |
free (linestr); |
#endif |
|
} |
exit(0); |
} |
|
#ifdef HAVE_LIBREADLINE |
char *command_generator (); |
char **sim_completion (); |
|
376,30 → 391,7
return ((char *)NULL); |
} |
|
|
/* Strip whitespace from the start and end of STRING. Return a pointer |
into STRING. */ |
char * |
stripwhite (string) |
char *string; |
{ |
register char *s, *t; |
|
for (s = string; whitespace (*s); s++) |
; |
|
if (*s == 0) |
return (s); |
|
t = s + strlen (s) - 1; |
while (t > s && whitespace (*t)) |
t--; |
*++t = '\0'; |
|
return s; |
} |
|
char * |
dupstr (s) |
char *s; |
{ |
423,3 → 415,31
} |
return 0; |
} |
|
#endif |
|
/* Strip whitespace from the start and end of STRING. Return a pointer |
into STRING. */ |
#ifndef whitespace |
#define whitespace(a) ((a) == '\t' ? 1 : ((a) == ' '? 1 : 0)) |
#endif |
|
char * |
stripwhite (string) |
char *string; |
{ |
register char *s, *t; |
|
for (s = string; whitespace (*s); s++) |
; |
|
if (*s == 0) |
return (s); |
|
t = s + strlen (s) - 1; |
while (t > s && whitespace (*t)) |
t--; |
*++t = '\0'; |
|
return s; |
} |