projects
/
my-code
/
ivac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d3c5d3d
)
canoncial mode fixes
author
hackbard
<hackbard>
Thu, 6 May 2004 19:16:39 +0000
(19:16 +0000)
committer
hackbard
<hackbard>
Thu, 6 May 2004 19:16:39 +0000
(19:16 +0000)
src/input.c
patch
|
blob
|
history
src/input.h
patch
|
blob
|
history
diff --git
a/src/input.c
b/src/input.c
index
1403017
..
30f60b9
100644
(file)
--- a/
src/input.c
+++ b/
src/input.c
@@
-18,11
+18,14
@@
int input_init(t_input *input) {
}
input->c_count=0;
}
input->c_count=0;
+ tcgetattr(0,&(input->tios));
+ tios=input->tios;
+
if(!(input->mode&LINE_BUFFERED)) {
if(!(input->mode&LINE_BUFFERED)) {
- tcgetattr(0,&tios);
- /* switch off canonical mode */
tios.c_lflag&=(~ICANON);
tios.c_lflag&=(~ECHO);
tios.c_lflag&=(~ICANON);
tios.c_lflag&=(~ECHO);
+ tios.c_cc[VTIME]=0;
+ tios.c_cc[VMIN]=1;
tcsetattr(0,TCSANOW,&tios);
}
tcsetattr(0,TCSANOW,&tios);
}
@@
-31,15
+34,8
@@
int input_init(t_input *input) {
int input_shutdown(t_input *input) {
int input_shutdown(t_input *input) {
- struct termios tios;
-
free(input->content);
free(input->content);
-
- tcgetattr(0,&tios);
- tios.c_lflag|=ICANON;
- tios.c_lflag|=ECHO;
- tcsetattr(0,TCSANOW,&tios);
-
+ tcsetattr(0,TCSANOW,&(input->tios));
puts("[input] shutdown");
return I_SUCCESS;
puts("[input] shutdown");
return I_SUCCESS;
diff --git
a/src/input.h
b/src/input.h
index
a3d8dd4
..
b4929fb
100644
(file)
--- a/
src/input.h
+++ b/
src/input.h
@@
-28,6
+28,7
@@
typedef struct s_input {
char *content;
int c_count;
unsigned char mode;
char *content;
int c_count;
unsigned char mode;
+ struct termios tios;
} t_input;
/* function prototypes */
} t_input;
/* function prototypes */