Introduce async-event.[ch]
[deliverable/binutils-gdb.git] / gdb / event-loop.h
index c4f594643ecea1fb7943e0202292db69dffa5e35..2eaaa0c8b6049212a0ae2116ba677f2faa23aa1a 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions used by the GDB event loop.
-   Copyright (C) 1999-2019 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020 Free Software Foundation, Inc.
    Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
 
    This file is part of GDB.
@@ -17,6 +17,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef EVENT_LOOP_H
+#define EVENT_LOOP_H
+
 /* An event loop listens for events from multiple event sources.  When
    an event arrives, it is queued and processed by calling the
    appropriate event handler.  The event loop then continues to listen
    Corollary tasks are the creation and deletion of event sources.  */
 
 typedef void *gdb_client_data;
-struct async_signal_handler;
-struct async_event_handler;
 typedef void (handler_func) (int, gdb_client_data);
-typedef void (sig_handler_func) (gdb_client_data);
-typedef void (async_event_handler_func) (gdb_client_data);
 typedef void (timer_handler_func) (gdb_client_data);
 
 /* Exported functions from event-loop.c */
 
-extern void start_event_loop (void);
 extern int gdb_do_one_event (void);
 extern void delete_file_handler (int fd);
 extern void add_file_handler (int fd, handler_func *proc, 
                              gdb_client_data client_data);
-extern struct async_signal_handler *
-  create_async_signal_handler (sig_handler_func *proc, 
-                              gdb_client_data client_data);
-extern void delete_async_signal_handler (struct async_signal_handler **);
 extern int create_timer (int milliseconds, 
                         timer_handler_func *proc, 
                         gdb_client_data client_data);
 extern void delete_timer (int id);
 
-/* Call the handler from HANDLER the next time through the event
-   loop.  */
-extern void mark_async_signal_handler (struct async_signal_handler *handler);
-
-/* Returns true if HANDLER is marked ready.  */
-
-extern int
-  async_signal_handler_is_marked (struct async_signal_handler *handler);
+/* Must be defined by client.  */
 
-/* Mark HANDLER as NOT ready.  */
-
-extern void clear_async_signal_handler (struct async_signal_handler *handler);
-
-/* Create and register an asynchronous event source in the event loop,
-   and set PROC as its callback.  CLIENT_DATA is passed as argument to
-   PROC upon its invocation.  Returns a pointer to an opaque structure
-   used to mark as ready and to later delete this event source from
-   the event loop.  */
-extern struct async_event_handler *
-  create_async_event_handler (async_event_handler_func *proc,
-                             gdb_client_data client_data);
+extern void handle_event_loop_exception (const gdb_exception &);
 
-/* Remove the event source pointed by HANDLER_PTR created by
-   CREATE_ASYNC_EVENT_HANDLER from the event loop, and release it.  */
-extern void
-  delete_async_event_handler (struct async_event_handler **handler_ptr);
+/* Must be defined by client.  Returns true if any signal handler was
+   ready.  */
 
-/* Call the handler from HANDLER the next time through the event
-   loop.  */
-extern void mark_async_event_handler (struct async_event_handler *handler);
+extern int invoke_async_signal_handlers ();
 
-/* Mark the handler (ASYNC_HANDLER_PTR) as NOT ready.  */
+/* Must be defined by client.  Returns true if any event handler was
+   ready.  */
 
-extern void clear_async_event_handler (struct async_event_handler *handler);
+extern int check_async_event_handlers ();
 
-extern void initialize_async_signal_handlers (void);
+#endif /* EVENT_LOOP_H */
This page took 0.030149 seconds and 4 git commands to generate.