Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ |
2 | #include |
||
3 | #include |
||
4 | |||
5 | typedef struct FuncList { |
||
6 | struct FuncList *next; |
||
7 | __FSEXT_Function *function; |
||
8 | } FuncList; |
||
9 | |||
10 | static FuncList *func_list = 0; |
||
11 | |||
12 | int |
||
13 | __FSEXT_add_open_handler(__FSEXT_Function *_function) |
||
14 | { |
||
15 | FuncList *new_func_list = (FuncList *)malloc(sizeof(FuncList)); |
||
16 | if (new_func_list == 0) |
||
17 | return 1; |
||
18 | new_func_list->next = func_list; |
||
19 | func_list = new_func_list; |
||
20 | func_list->function = _function; |
||
21 | return 0; |
||
22 | } |
||
23 | |||
24 | int |
||
25 | __FSEXT_call_open_handlers(__FSEXT_Fnumber _function_number, |
||
26 | int *rv, /*va_list*/void* _args) |
||
27 | { |
||
28 | FuncList *f; |
||
29 | for (f=func_list; f; f=f->next) |
||
30 | if (f->function(_function_number, rv, _args)) |
||
31 | return 1; |
||
32 | return 0; |
||
33 | } |