-static int select_add_handle (guestfs_main_loop *ml, guestfs_h *g, int fd, int events, guestfs_handle_event_cb cb, void *data);
-static int select_remove_handle (guestfs_main_loop *ml, guestfs_h *g, int watch);
-static int select_add_timeout (guestfs_main_loop *ml, guestfs_h *g, int interval, guestfs_handle_timeout_cb cb, void *data);
-static int select_remove_timeout (guestfs_main_loop *ml, guestfs_h *g, int timer);
-static int select_main_loop_run (guestfs_main_loop *ml, guestfs_h *g);
-static int select_main_loop_quit (guestfs_main_loop *ml, guestfs_h *g);
-
-/* Default select-based main loop. */
-struct select_handle_cb_data {
- guestfs_handle_event_cb cb;
- guestfs_h *g;
- void *data;
-};
-
-struct select_main_loop {
- /* NB. These fields must be the same as in struct guestfs_main_loop: */
- guestfs_add_handle_cb add_handle;
- guestfs_remove_handle_cb remove_handle;
- guestfs_add_timeout_cb add_timeout;
- guestfs_remove_timeout_cb remove_timeout;
- guestfs_main_loop_run_cb main_loop_run;
- guestfs_main_loop_quit_cb main_loop_quit;
-
- /* Additional private data: */
- int is_running;
-
- fd_set rset;
- fd_set wset;
- fd_set xset;
-
- int max_fd;
- int nr_fds;
- struct select_handle_cb_data *handle_cb_data;
-};
-
-/* Default main loop. */
-static struct select_main_loop default_main_loop = {
- .add_handle = select_add_handle,
- .remove_handle = select_remove_handle,
- .add_timeout = select_add_timeout,
- .remove_timeout = select_remove_timeout,
- .main_loop_run = select_main_loop_run,
- .main_loop_quit = select_main_loop_quit,
-
- /* XXX hopefully .rset, .wset, .xset are initialized to the empty
- * set by the normal action of everything being initialized to zero.
- */
- .is_running = 0,
- .max_fd = -1,
- .nr_fds = 0,
- .handle_cb_data = NULL,
-};
-