| @@ -56,27 +56,28 @@ | | | @@ -56,27 +56,28 @@ |
56 | last iteration of the event loop, and need to be processed. An | | 56 | last iteration of the event loop, and need to be processed. An |
57 | event is represented by a procedure to be invoked in order to | | 57 | event is represented by a procedure to be invoked in order to |
58 | process the event. The queue is scanned head to tail. If the | | 58 | process the event. The queue is scanned head to tail. If the |
59 | event of interest is a change of state in a file descriptor, then a | | 59 | event of interest is a change of state in a file descriptor, then a |
60 | call to poll or select will be made to detect it. | | 60 | call to poll or select will be made to detect it. |
61 | | | 61 | |
62 | If the events generate signals, they are also queued by special | | 62 | If the events generate signals, they are also queued by special |
63 | functions that are invoked through traditional signal handlers. | | 63 | functions that are invoked through traditional signal handlers. |
64 | The actions to be taken is response to such events will be executed | | 64 | The actions to be taken is response to such events will be executed |
65 | when the SIGHANDLER_LIST is scanned, the next time through the | | 65 | when the SIGHANDLER_LIST is scanned, the next time through the |
66 | infinite loop. | | 66 | infinite loop. |
67 | | | 67 | |
68 | Corollary tasks are the creation and deletion of event sources. */ | | 68 | Corollary tasks are the creation and deletion of event sources. */ |
69 | | | 69 | #ifndef _EVENT_LOOP_H_ |
| | | 70 | #define _EVENT_LOOP_H_ |
70 | typedef void *gdb_client_data; | | 71 | typedef void *gdb_client_data; |
71 | struct async_signal_handler; | | 72 | struct async_signal_handler; |
72 | struct async_event_handler; | | 73 | struct async_event_handler; |
73 | typedef void (handler_func) (int, gdb_client_data); | | 74 | typedef void (handler_func) (int, gdb_client_data); |
74 | typedef void (sig_handler_func) (gdb_client_data); | | 75 | typedef void (sig_handler_func) (gdb_client_data); |
75 | typedef void (async_event_handler_func) (gdb_client_data); | | 76 | typedef void (async_event_handler_func) (gdb_client_data); |
76 | typedef void (timer_handler_func) (gdb_client_data); | | 77 | typedef void (timer_handler_func) (gdb_client_data); |
77 | | | 78 | |
78 | /* Exported functions from event-loop.c */ | | 79 | /* Exported functions from event-loop.c */ |
79 | | | 80 | |
80 | extern void start_event_loop (void); | | 81 | extern void start_event_loop (void); |
81 | extern int gdb_do_one_event (void); | | 82 | extern int gdb_do_one_event (void); |
82 | extern void delete_file_handler (int fd); | | 83 | extern void delete_file_handler (int fd); |
| @@ -117,13 +118,14 @@ extern struct async_event_handler * | | | @@ -117,13 +118,14 @@ extern struct async_event_handler * |
117 | CREATE_ASYNC_EVENT_HANDLER from the event loop, and release it. */ | | 118 | CREATE_ASYNC_EVENT_HANDLER from the event loop, and release it. */ |
118 | extern void | | 119 | extern void |
119 | delete_async_event_handler (struct async_event_handler **handler_ptr); | | 120 | delete_async_event_handler (struct async_event_handler **handler_ptr); |
120 | | | 121 | |
121 | /* Call the handler from HANDLER the next time through the event | | 122 | /* Call the handler from HANDLER the next time through the event |
122 | loop. */ | | 123 | loop. */ |
123 | extern void mark_async_event_handler (struct async_event_handler *handler); | | 124 | extern void mark_async_event_handler (struct async_event_handler *handler); |
124 | | | 125 | |
125 | /* Mark the handler (ASYNC_HANDLER_PTR) as NOT ready. */ | | 126 | /* Mark the handler (ASYNC_HANDLER_PTR) as NOT ready. */ |
126 | | | 127 | |
127 | extern void clear_async_event_handler (struct async_event_handler *handler); | | 128 | extern void clear_async_event_handler (struct async_event_handler *handler); |
128 | | | 129 | |
129 | extern void initialize_async_signal_handlers (void); | | 130 | extern void initialize_async_signal_handlers (void); |
| | | 131 | #endif |