-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfilter.h
45 lines (37 loc) · 1.57 KB
/
filter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
/* Copyright © 2011 Fritz Grimpen
*
* This file is part of Xelix.
*
* Xelix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xelix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xelix. If not, see <http://www.gnu.org/licenses/>.
*/
#include <lib/generic.h>
#include <console/info.h>
#include <console/driver.h>
struct console_filter {
// General callback for all actions etc.
// Preferred prototype:
// char <name>(char c, console_info_t *info, console_driver_t *input, console_driver_t *output);
char (*callback)(char, console_info_t*, console_driver_t*, console_driver_t*);
// Specific callbacks for read and write
// Preferred prototype:
// char <name>(char c, console_info_t *info, console_driver_t *input);
char (*read_callback)(char, console_info_t*, console_driver_t*);
// Preferred prototype:
// char <name>(char c, console_info_t *info, console_driver_t *output);
char (*write_callback)(char, console_info_t*, console_driver_t*);
// The next filter in the filter chain
struct console_filter* next;
};
typedef struct console_filter console_filter_t;