David Sehr | 7629f60 | 2016-08-07 16:01:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | * |
| 16 | * Header file of the dexlayout utility. |
| 17 | * |
| 18 | * This is a tool to read dex files into an internal representation, |
| 19 | * reorganize the representation, and emit dex files with a better |
| 20 | * file layout. |
| 21 | */ |
| 22 | |
| 23 | #ifndef ART_DEXLAYOUT_DEXLAYOUT_H_ |
| 24 | #define ART_DEXLAYOUT_DEXLAYOUT_H_ |
| 25 | |
| 26 | #include <stdint.h> |
| 27 | #include <stdio.h> |
| 28 | |
| 29 | namespace art { |
| 30 | |
| 31 | /* Supported output formats. */ |
| 32 | enum OutputFormat { |
| 33 | kOutputPlain = 0, // default |
| 34 | kOutputXml, // XML-style |
| 35 | }; |
| 36 | |
| 37 | /* Command-line options. */ |
| 38 | struct Options { |
| 39 | bool build_dex_ir_; |
| 40 | bool checksum_only_; |
| 41 | bool disassemble_; |
| 42 | bool exports_only_; |
| 43 | bool ignore_bad_checksum_; |
Jeff Hao | 3ab96b4 | 2016-09-09 18:35:01 -0700 | [diff] [blame] | 44 | bool output_dex_files_; |
David Sehr | 7629f60 | 2016-08-07 16:01:51 -0700 | [diff] [blame] | 45 | bool show_annotations_; |
| 46 | bool show_cfg_; |
| 47 | bool show_file_headers_; |
| 48 | bool show_section_headers_; |
| 49 | bool verbose_; |
| 50 | OutputFormat output_format_; |
| 51 | const char* output_file_name_; |
| 52 | }; |
| 53 | |
| 54 | /* Prototypes. */ |
| 55 | extern struct Options options_; |
| 56 | extern FILE* out_file_; |
| 57 | int ProcessFile(const char* file_name); |
| 58 | |
| 59 | } // namespace art |
| 60 | |
| 61 | #endif // ART_DEXLAYOUT_DEXLAYOUT_H_ |