* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "ao-dbg.h"
#include <unistd.h>
#include <sys/types.h>
int s51_interrupted = 0;
int s51_monitor = 0;
char *s51_tty = NULL;
+char *s51_device = NULL;
static FILE *s51_input;
static FILE *s51_output;
static const struct option options[] = {
{ .name = "tty", .has_arg = 1, .val = 'T' },
+ { .name = "device", .has_arg = 1, .val = 'D' },
{ 0, 0, 0, 0 },
};
case 'T':
s51_tty = optarg;
break;
+ case 'D':
+ s51_device = optarg;
+ break;
}
}
if (s51_port) {
putc(c, s51_output);
}
+#if HAVE_LIBREADLINE
#include <readline/readline.h>
#include <readline/history.h>
+#endif
int
s51_read_line(char *line, int len)
{
int ret;
+#if HAVE_LIBREADLINE
if (s51_output == stdout && s51_input == stdin && s51_prompt) {
char *r;
line[len-1] = '\0';
add_history(r);
return 1;
- } else {
+ } else
+#endif
+ {
if (s51_prompt)
s51_printf("%s", s51_prompt);
else