fixed input system (callback added), more ivac tests
[my-code/ivac.git] / src / input.h
1 /* input.h -- input headers */
2
3 #ifndef INPUT_H
4 #define INPUT_H
5
6 /* includes */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <errno.h>
11 #include <termios.h>
12
13 /* defines */
14 #define I_SUCCESS 1
15 #define I_ERROR -1
16
17 #define MENUE (1<<0)
18 #define CONNECTIONS (1<<1)
19
20 #define MAX_CONTENT 128
21
22 /* input specific variables */
23 typedef struct s_input {
24   char *content;
25   int c_count;
26   unsigned char mode;
27 } t_input;
28
29 /* function prototypes */
30 int input_init(t_input *input);
31 int input_shutdown(t_input *input);
32 int input_get_char(t_input *input,int (*callback)(t_input *input,void *ptr),
33                    void *ptr);
34
35 #endif