zucchini_commands.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_ZUCCHINI_ZUCCHINI_COMMANDS_H_
  5. #define COMPONENTS_ZUCCHINI_ZUCCHINI_COMMANDS_H_
  6. #include <iosfwd>
  7. #include <vector>
  8. #include "base/files/file_path.h"
  9. #include "components/zucchini/zucchini.h"
  10. // Zucchini commands and tools that can be invoked from command-line.
  11. namespace base {
  12. class CommandLine;
  13. } // namespace base
  14. // Aggregated parameter for Main*() functions, to simplify interface.
  15. struct MainParams {
  16. const base::CommandLine& command_line;
  17. const std::vector<base::FilePath>& file_paths;
  18. std::ostream& out;
  19. std::ostream& err;
  20. };
  21. // Signature of a Zucchini Command Function.
  22. using CommandFunction = zucchini::status::Code (*)(MainParams);
  23. // Command Function: Patch generation.
  24. zucchini::status::Code MainGen(MainParams params);
  25. // Command Function: Patch application.
  26. zucchini::status::Code MainApply(MainParams params);
  27. // Command Function: Verify patch format and compatibility.
  28. zucchini::status::Code MainVerify(MainParams params);
  29. // Command Function: Read and dump references from an executable.
  30. zucchini::status::Code MainRead(MainParams params);
  31. // Command Function: Scan an archive file and detect executables.
  32. zucchini::status::Code MainDetect(MainParams params);
  33. // Command Function: Scan two archive files and match detected executables.
  34. zucchini::status::Code MainMatch(MainParams params);
  35. // Command Function: Compute CRC-32 of a file.
  36. zucchini::status::Code MainCrc32(MainParams params);
  37. #endif // COMPONENTS_ZUCCHINI_ZUCCHINI_COMMANDS_H_