projects
/
my-code
/
api.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
output to stder, added list.* api which is still in work
[my-code/api.git]
/
input
/
input.c
diff --git
a/input/input.c
b/input/input.c
index
86dac62
..
c734a5b
100644
(file)
--- a/
input/input.c
+++ b/
input/input.c
@@
-11,10
+11,9
@@
int input_init(t_input *input) {
struct termios tios;
int size;
struct termios tios;
int size;
-
puts(
"[input] initializing input system ...");
+
fprintf(stderr,
"[input] initializing input system ...");
- // size=((input->mode&CONTENT_BUFFER)?MAX_CONTENT:1); <- ???
- size=MAX_CONTENT;
+ size=((input->mode&CONTENT_BUFFER)?MAX_CONTENT:1);
if((input->content=(char *)malloc(size))==NULL) {
perror("[input] malloc call");
if((input->content=(char *)malloc(size))==NULL) {
perror("[input] malloc call");
@@
-45,7
+44,7
@@
int input_shutdown(t_input *input) {
free(input->content);
tcsetattr(0,TCSANOW,&(input->tios));
free(input->content);
tcsetattr(0,TCSANOW,&(input->tios));
-
puts(
"[input] shutdown");
+
fprintf(stderr,
"[input] shutdown");
return I_SUCCESS;
}
return I_SUCCESS;
}
@@
-65,7
+64,7
@@
int input_get_event(t_input *input,int (*callback)(t_input *input,void *ptr),
}
if(input->c_count>=MAX_CONTENT) {
}
if(input->c_count>=MAX_CONTENT) {
-
puts(
"[input] max input length reached");
+
fprintf(stderr,
"[input] max input length reached");
return I_ERROR;
}
return I_ERROR;
}