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_; |
| 44 | bool show_annotations_; |
| 45 | bool show_cfg_; |
| 46 | bool show_file_headers_; |
| 47 | bool show_section_headers_; |
| 48 | bool verbose_; |
| 49 | OutputFormat output_format_; |
| 50 | const char* output_file_name_; |
| 51 | }; |
| 52 | |
| 53 | /* Prototypes. */ |
| 54 | extern struct Options options_; |
| 55 | extern FILE* out_file_; |
| 56 | int ProcessFile(const char* file_name); |
| 57 | |
| 58 | } // namespace art |
| 59 | |
| 60 | #endif // ART_DEXLAYOUT_DEXLAYOUT_H_ |