X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=generator%2Fgenerator_fish.ml;h=ef5ea5fc4390f19553c5eb2f7583ea527968e759;hb=25791edff58665a949807081d131ef74e74a2d7c;hp=61916a3573779a1bd17d607ae0cc0438aa18d52a;hpb=01d62985c3f0234fc0e9e4909c85c6a401c4bfcc;p=libguestfs.git diff --git a/generator/generator_fish.ml b/generator/generator_fish.ml index 61916a3..ef5ea5f 100644 --- a/generator/generator_fish.ml +++ b/generator/generator_fish.ml @@ -53,11 +53,13 @@ let generate_fish_cmds () = pr "#include \n"; pr "#include \n"; pr "\n"; - pr "#include \n"; pr "#include \"c-ctype.h\"\n"; pr "#include \"full-write.h\"\n"; pr "#include \"xstrtol.h\"\n"; + pr "\n"; + pr "#include \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"; @@ -393,7 +395,7 @@ Guestfish will prompt for these separately." pr " %s = argv[i++];\n" name | Pathname name | Dev_or_Path name -> - pr " %s = resolve_win_path (argv[i++]);\n" name; + pr " %s = win_prefix (argv[i++]); /* process \"win:\" prefix */\n" name; pr " if (%s == NULL) return -1;\n" name | OptString name -> pr " %s = STRNEQ (argv[i], \"\") ? argv[i] : NULL;\n" name; @@ -616,6 +618,22 @@ Guestfish will prompt for these separately." 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;