-/* Main loop. */
-#define GUESTFS_HANDLE_READABLE 0x1
-#define GUESTFS_HANDLE_WRITABLE 0x2
-#define GUESTFS_HANDLE_HANGUP 0x4
-#define GUESTFS_HANDLE_ERROR 0x8
-
-typedef void (*guestfs_handle_event_cb) (void *data, int watch, int fd, int events);
-typedef int (*guestfs_add_handle_cb) (guestfs_h *g, int fd, int events, guestfs_handle_event_cb cb, void *data);
-typedef int (*guestfs_remove_handle_cb) (guestfs_h *g, int watch);
-typedef void (*guestfs_handle_timeout_cb) (void *data, int timer);
-typedef int (*guestfs_add_timeout_cb) (guestfs_h *g, int interval, guestfs_handle_timeout_cb cb, void *data);
-typedef int (*guestfs_remove_timeout_cb) (guestfs_h *g, int timer);
-typedef void (*guestfs_main_loop_run_cb) (guestfs_h *g);
-typedef void (*guestfs_main_loop_quit_cb) (guestfs_h *g);
-
-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;
-};
-typedef struct guestfs_main_loop guestfs_main_loop;
-
-extern void guestfs_set_main_loop (guestfs_main_loop *);
-extern void guestfs_main_loop_run (void);
-extern void guestfs_main_loop_quit (void);
+/* Private, for use only by the actions. */
+struct guestfs_message_header;
+struct guestfs_message_error;
+extern void guestfs_error (guestfs_h *g, const char *fs, ...)
+ __attribute__((format (printf,2,3)));
+extern void guestfs_perrorf (guestfs_h *g, const char *fs, ...)
+ __attribute__((format (printf,2,3)));
+extern void *guestfs_safe_malloc (guestfs_h *g, size_t nbytes);
+extern void *guestfs_safe_calloc (guestfs_h *g, size_t n, size_t s);
+extern void *guestfs_safe_realloc (guestfs_h *g, void *ptr, int nbytes);
+extern char *guestfs_safe_strdup (guestfs_h *g, const char *str);
+extern void *guestfs_safe_memdup (guestfs_h *g, void *ptr, size_t size);
+extern int guestfs___set_busy (guestfs_h *g);
+extern int guestfs___end_busy (guestfs_h *g);
+extern int guestfs___send (guestfs_h *g, int proc_nr, xdrproc_t xdrp, char *args);
+extern int guestfs___recv (guestfs_h *g, const char *fn, struct guestfs_message_header *hdr, struct guestfs_message_error *err, xdrproc_t xdrp, char *ret);
+extern int guestfs___send_file (guestfs_h *g, const char *filename);
+extern int guestfs___recv_file (guestfs_h *g, const char *filename);
+
+#ifdef __cplusplus
+}
+#endif