/* libguestfs
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <rpc/xdr.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct guestfs_h guestfs_h;
typedef struct guestfs_main_loop guestfs_main_loop;
#include <guestfs-structs.h>
#include <guestfs-actions.h>
-/* Free up return values. */
-extern void guestfs_free_int_bool (struct guestfs_int_bool *);
-extern void guestfs_free_lvm_pv_list (struct guestfs_lvm_pv_list *);
-extern void guestfs_free_lvm_vg_list (struct guestfs_lvm_vg_list *);
-extern void guestfs_free_lvm_lv_list (struct guestfs_lvm_lv_list *);
-
/* Low-level event API. */
typedef void (*guestfs_send_cb) (guestfs_h *g, void *data);
typedef void (*guestfs_reply_cb) (guestfs_h *g, void *data, XDR *xdr);
extern void guestfs_set_subprocess_quit_callback (guestfs_h *g, guestfs_subprocess_quit_cb cb, void *opaque);
extern void guestfs_set_launch_done_callback (guestfs_h *g, guestfs_launch_done_cb cb, void *opaque);
-extern void guestfs_error (guestfs_h *g, const char *fs, ...);
-extern void guestfs_perrorf (guestfs_h *g, const char *fs, ...);
+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 guestfs_main_loop *guestfs_create_main_loop (void);
extern void guestfs_free_main_loop (guestfs_main_loop *);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GUESTFS_H_ */