OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [sim/] [console.c] - Blame information for rev 157

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 hellwig
/*
2
 * console.c -- the simulator's operator console
3
 */
4
 
5
 
6
#include <stdio.h>
7
#include <stdlib.h>
8
#include <string.h>
9
#include <stdarg.h>
10
#include <signal.h>
11
 
12
#include "common.h"
13
#include "console.h"
14
#include "error.h"
15
#include "cpu.h"
16
 
17
#include "getline.h"
18
 
19
 
20
static void (*oldSigIntHandler)(int signum);
21
 
22
 
23
static void newSigIntHandler(int signum) {
24
  signal(SIGINT, newSigIntHandler);
25
  cpuHalt();
26
}
27
 
28
 
29
char *cGetLine(char *prompt) {
30
  return gl_getline(prompt);
31
}
32
 
33
 
34
void cAddHist(char *line) {
35
  gl_histadd(line);
36
}
37
 
38
 
39
void cPrintf(char *format, ...) {
40
  va_list ap;
41
 
42
  va_start(ap, format);
43
  vprintf(format, ap);
44
  va_end(ap);
45
}
46
 
47
 
48
void cInit(void) {
49
  oldSigIntHandler = signal(SIGINT, newSigIntHandler);
50
}
51
 
52
 
53
void cExit(void) {
54
  signal(SIGINT, oldSigIntHandler);
55
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.