#include <guestfs.h>
+#include "fish-cmds.h"
+
#ifdef HAVE_GETTEXT
#include "gettext.h"
#define _(str) dgettext(PACKAGE, (str))
extern char *complete_dest_paths_generator (const char *text, int state);
/* in alloc.c */
-extern int run_alloc (const char *cmd, size_t argc, char *argv[]);
-extern int run_sparse (const char *cmd, size_t argc, char *argv[]);
extern int alloc_disk (const char *filename, const char *size,
int add, int sparse);
extern int parse_size (const char *str, off_t *size_rtn);
-/* in copy.c */
-extern int run_copy_in (const char *cmd, size_t argc, char *argv[]);
-extern int run_copy_out (const char *cmd, size_t argc, char *argv[]);
-
-/* in display.c */
-extern int run_display (const char *cmd, size_t argc, char *argv[]);
-
-/* in echo.c */
-extern int run_echo (const char *cmd, size_t argc, char *argv[]);
-
-/* in edit.c */
-extern int run_edit (const char *cmd, size_t argc, char *argv[]);
-
/* in help.c */
extern void display_help (void);
-/* in hexedit.c */
-extern int run_hexedit (const char *cmd, size_t argc, char *argv[]);
-
-/* in lcd.c */
-extern int run_lcd (const char *cmd, size_t argc, char *argv[]);
-
-/* in glob.c */
-extern int run_glob (const char *cmd, size_t argc, char *argv[]);
-
-/* in man.c */
-extern int run_man (const char *cmd, size_t argc, char *argv[]);
-
-/* in more.c */
-extern int run_more (const char *cmd, size_t argc, char *argv[]);
-
/* in prep.c */
struct prep_data {
const struct prep *prep;
extern int rc_remote (int pid, const char *cmd, size_t argc, char *argv[],
int exit_on_error);
-/* in reopen.c */
-extern int run_reopen (const char *cmd, size_t argc, char *argv[]);
-
-/* in supported.c */
-extern int run_supported (const char *cmd, size_t argc, char *argv[]);
-
-/* in time.c */
-extern int run_time (const char *cmd, size_t argc, char *argv[]);
-
/* in tilde.c */
extern char *try_tilde_expansion (char *path);
pr "#include <string.h>\n";
pr "#include <inttypes.h>\n";
pr "\n";
- pr "#include <guestfs.h>\n";
pr "#include \"c-ctype.h\"\n";
pr "#include \"full-write.h\"\n";
pr "#include \"xstrtol.h\"\n";
+ pr "\n";
+ pr "#include <guestfs.h>\n";
pr "#include \"fish.h\"\n";
+ pr "#include \"fish-cmds.h\"\n";
pr "#include \"options.h\"\n";
pr "#include \"cmds_gperf.h\"\n";
pr "\n";
pr " }\n";
pr "}\n"
+and generate_fish_cmds_h () =
+ generate_header CStyle GPLv2plus;
+
+ pr "#ifndef FISH_CMDS_H\n";
+ pr "#define FISH_CMDS_H\n";
+ pr "\n";
+
+ List.iter (
+ fun (shortname, _, _, _, _, _, _) ->
+ pr "extern int run_%s (const char *cmd, size_t argc, char *argv[]);\n"
+ shortname
+ ) fish_commands;
+
+ pr "\n";
+ pr "#endif /* FISH_CMDS_H */\n"
+
(* gperf code to do fast lookups of commands. *)
and generate_fish_cmds_gperf () =
generate_header CStyle GPLv2plus;
(* libguestfs
- * Copyright (C) 2009-2010 Red Hat Inc.
+ * Copyright (C) 2009-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
output_to "fish/cmds_gperf.gperf" generate_fish_cmds_gperf;
output_to "fish/cmds.c" generate_fish_cmds;
output_to "fish/completion.c" generate_fish_completion;
+ output_to "fish/fish-cmds.h" generate_fish_cmds_h;
output_to "fish/guestfish-commands.pod" generate_fish_commands_pod;
output_to "fish/guestfish-actions.pod" generate_fish_actions_pod;
output_to "fish/prepopts.c" generate_fish_prep_options_c;