+#include "../src/guestfs_protocol.h"
+
+/*-- in guestfsd.c --*/
+extern int verbose;
+
+extern const char *sysroot;
+extern int sysroot_len;
+
+extern char *sysroot_path (const char *path);
+
+extern int xwrite (int sock, const void *buf, size_t len)
+ __attribute__((__warn_unused_result__));
+extern int xread (int sock, void *buf, size_t len)
+ __attribute__((__warn_unused_result__));
+
+extern int add_string (char ***argv, int *size, int *alloc, const char *str);
+extern int count_strings (char *const *argv);
+extern void sort_strings (char **argv, int len);
+extern void free_strings (char **argv);
+extern void free_stringslen (char **argv, int len);
+
+#define command(out,err,name,...) commandf((out),(err),0,(name),__VA_ARGS__)
+#define commandr(out,err,name,...) commandrf((out),(err),0,(name),__VA_ARGS__)
+#define commandv(out,err,argv) commandvf((out),(err),0,(argv))
+#define commandrv(out,err,argv) commandrvf((out),(err),0,(argv))
+
+#define COMMAND_FLAG_FOLD_STDOUT_ON_STDERR 1
+
+extern int commandf (char **stdoutput, char **stderror, int flags,
+ const char *name, ...);
+extern int commandrf (char **stdoutput, char **stderror, int flags,
+ const char *name, ...);
+extern int commandvf (char **stdoutput, char **stderror, int flags,
+ char const *const *argv);
+extern int commandrvf (char **stdoutput, char **stderror, int flags,
+ char const* const *argv);
+
+extern char **split_lines (char *str);
+
+extern int device_name_translation (char *device, const char *func);
+
+extern void udev_settle (void);
+
+/* This just stops gcc from giving a warning about our custom
+ * printf formatters %Q and %R. See HACKING file for more
+ * info about these.
+ */
+static inline int
+asprintf_nowarn (char **strp, const char *fmt, ...)
+{
+ int r;
+ va_list args;
+
+ va_start (args, fmt);
+ r = vasprintf (strp, fmt, args);
+ va_end (args);
+ return r;
+}
+
+/*-- in names.c (auto-generated) --*/
+extern const char *function_names[];