• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 #ifndef COMPONENTS_ZUCCHINI_ZUCCHINI_COMMANDS_H_
6 #define COMPONENTS_ZUCCHINI_ZUCCHINI_COMMANDS_H_
7 
8 #include <iosfwd>
9 #include <vector>
10 
11 #include "base/files/file_path.h"
12 #include "components/zucchini/zucchini.h"
13 
14 // Zucchini commands and tools that can be invoked from command-line.
15 
16 namespace base {
17 
18 class CommandLine;
19 
20 }  // namespace base
21 
22 // Aggregated parameter for Main*() functions, to simplify interface.
23 struct MainParams {
24   const base::CommandLine& command_line;
25   const std::vector<base::FilePath>& file_paths;
26   std::ostream& out;
27   std::ostream& err;
28 };
29 
30 // Signature of a Zucchini Command Function.
31 using CommandFunction = zucchini::status::Code (*)(MainParams);
32 
33 // Command Function: Patch generation.
34 zucchini::status::Code MainGen(MainParams params);
35 
36 // Command Function: Patch application.
37 zucchini::status::Code MainApply(MainParams params);
38 
39 // Command Function: Verify patch format and compatibility.
40 zucchini::status::Code MainVerify(MainParams params);
41 
42 // Command Function: Read and dump references from an executable.
43 zucchini::status::Code MainRead(MainParams params);
44 
45 // Command Function: Scan an archive file and detect executables.
46 zucchini::status::Code MainDetect(MainParams params);
47 
48 // Command Function: Scan two archive files and match detected executables.
49 zucchini::status::Code MainMatch(MainParams params);
50 
51 // Command Function: Compute CRC-32 of a file.
52 zucchini::status::Code MainCrc32(MainParams params);
53 
54 #endif  // COMPONENTS_ZUCCHINI_ZUCCHINI_COMMANDS_H_
55