X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fevent-loop.h;h=bde1784a8317398cd5178fd8c74e5581ee6b269d;hb=1174497c8ae1bf9293addcb216c48dbdbf487e4f;hp=69c38e704a09c77229ef06b9b4e10ce46955361a;hpb=9e086581c726753ae7459a4c77ea9b37c34c5500;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/event-loop.h b/gdb/event-loop.h index 69c38e704a..bde1784a83 100644 --- a/gdb/event-loop.h +++ b/gdb/event-loop.h @@ -16,18 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#include "defs.h" + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* An event loop listens for events from multiple event sources. When an event arrives, it is queued and processed by calling the @@ -70,8 +60,7 @@ typedef PTR gdb_client_data; typedef struct gdb_event gdb_event; -typedef void (file_handler_func) PARAMS ((gdb_client_data, int mask)); -typedef void (async_handler_func) PARAMS ((gdb_client_data)); +typedef void (handler_func) PARAMS ((gdb_client_data)); typedef void (event_handler_func) PARAMS ((int)); /* Event for the GDB event system. Events are queued by calling @@ -101,7 +90,7 @@ typedef struct file_handler int mask; /* Events we want to monitor: POLLIN, etc. */ int ready_mask; /* Events that have been seen since the last time. */ - file_handler_func *proc; /* Procedure to call when fd is ready. */ + handler_func *proc; /* Procedure to call when fd is ready. */ gdb_client_data client_data; /* Argument to pass to proc. */ struct file_handler *next_file; /* Next registered file descriptor. */ } @@ -118,10 +107,10 @@ file_handler; typedef struct async_signal_handler { - int ready; /* If ready, call this handler from the main event loop, + int ready; /* If ready, call this handler from the main event loop, using invoke_async_handler. */ struct async_signal_handler *next_handler; /* Ptr to next handler */ - async_handler_func *proc; /* Function to call to do the work */ + handler_func *proc; /* Function to call to do the work */ gdb_client_data client_data; /* Argument to async_handler_func */ } async_signal_handler; @@ -134,7 +123,7 @@ typedef enum TAIL, /* Add at head of queue. It will be processed in last in first out order. */ - HEAD + HEAD } queue_position; @@ -233,11 +222,37 @@ struct prompts #define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix #define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix +/* Exported functions from event-loop.c */ + +extern void start_event_loop PARAMS ((void)); extern void delete_file_handler PARAMS ((int)); -extern void - create_file_handler PARAMS ((int, int, file_handler_func, gdb_client_data)); -extern int gdb_do_one_event PARAMS ((void)); +extern void add_file_handler PARAMS ((int, void (*) (void), gdb_client_data)); extern void mark_async_signal_handler PARAMS ((async_signal_handler *)); extern async_signal_handler * - create_async_signal_handler PARAMS ((async_handler_func *, gdb_client_data)); - + create_async_signal_handler PARAMS ((handler_func *, gdb_client_data)); +extern void delete_async_signal_handler PARAMS ((async_signal_handler ** async_handler_ptr)); + +/* Exported functions from event-top.c. + FIXME: these should really go into top.h. */ + +extern void display_gdb_prompt PARAMS ((char *)); +extern void async_init_signals PARAMS ((void)); +extern void set_async_editing_command PARAMS ((char *, int, struct cmd_list_element *)); +extern void set_async_annotation_level PARAMS ((char *, int, struct cmd_list_element *)); +extern void set_async_prompt PARAMS ((char *, int, struct cmd_list_element *)); +extern void handle_stop_sig PARAMS ((int)); +extern void handle_sigint PARAMS ((int)); +extern void pop_prompt PARAMS ((void)); +extern void push_prompt PARAMS ((char *, char *, char *)); +extern void gdb_readline2 PARAMS ((void)); + +/* Exported variables from event-top.c. + FIXME: these should really go into top.h. */ + +extern int async_command_editing_p; +extern char *async_annotation_suffix; +extern char *new_async_prompt; +extern struct prompts the_prompts; +extern void (*call_readline) PARAMS ((void)); +extern void (*input_handler) PARAMS ((char *)); +extern int input_fd;