Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */ |
2 | /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
||
3 | #ifndef __dj_include_sys_fsext_h_ |
||
4 | #define __dj_include_sys_fsext_h_ |
||
5 | |||
6 | #ifdef __cplusplus |
||
7 | extern "C" { |
||
8 | #endif |
||
9 | |||
10 | #ifndef __dj_ENFORCE_ANSI_FREESTANDING |
||
11 | |||
12 | #ifndef __STRICT_ANSI__ |
||
13 | |||
14 | #ifndef _POSIX_SOURCE |
||
15 | |||
16 | #include |
||
17 | |||
18 | typedef enum { |
||
19 | __FSEXT_nop, |
||
20 | __FSEXT_open, |
||
21 | __FSEXT_creat, |
||
22 | __FSEXT_read, |
||
23 | __FSEXT_write, |
||
24 | __FSEXT_ready, |
||
25 | __FSEXT_close, |
||
26 | __FSEXT_fcntl, |
||
27 | __FSEXT_ioctl, |
||
28 | __FSEXT_lseek, |
||
29 | __FSEXT_link, |
||
30 | __FSEXT_unlink, |
||
31 | __FSEXT_dup, |
||
32 | __FSEXT_dup2, |
||
33 | __FSEXT_fstat, |
||
34 | __FSEXT_stat |
||
35 | } __FSEXT_Fnumber; |
||
36 | |||
37 | /* _ready gets passed a fd and should return a mask of these, |
||
38 | as if we were emulating "int ready(int fd)" */ |
||
39 | #define __FSEXT_ready_read 1 |
||
40 | #define __FSEXT_ready_write 2 |
||
41 | #define __FSEXT_ready_error 4 |
||
42 | |||
43 | /* The return value is nonzero if the function has overridden the |
||
44 | caller's functionality. */ |
||
45 | typedef int (__FSEXT_Function)(__FSEXT_Fnumber _function_number, |
||
46 | int *_rv, /*va_list*/void* _args); |
||
47 | |||
48 | int __FSEXT_alloc_fd(__FSEXT_Function *_function); |
||
49 | int __FSEXT_set_function(int _fd, __FSEXT_Function *_function); |
||
50 | __FSEXT_Function *__FSEXT_get_function(int _fd); |
||
51 | void *__FSEXT_set_data(int _fd, void *_data); |
||
52 | void *__FSEXT_get_data(int _fd); |
||
53 | |||
54 | int __FSEXT_add_open_handler(__FSEXT_Function *_function); |
||
55 | int __FSEXT_call_open_handlers(__FSEXT_Fnumber _function_number, |
||
56 | int *rv, /*va_list*/void* _args); |
||
57 | |||
58 | #endif /* !_POSIX_SOURCE */ |
||
59 | #endif /* !__STRICT_ANSI__ */ |
||
60 | #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
||
61 | |||
62 | #ifndef __dj_ENFORCE_FUNCTION_CALLS |
||
63 | #endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
||
64 | |||
65 | #ifdef __cplusplus |
||
66 | } |
||
67 | #endif |
||
68 | |||
69 | #endif /* !__dj_include_sys_fsext_h_ */ |