| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COURGETTE_COURGETTE_H_ | 5 #ifndef COURGETTE_COURGETTE_H_ |
| 6 #define COURGETTE_COURGETTE_H_ | 6 #define COURGETTE_COURGETTE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> // Required to define size_t on GCC | 8 #include <cstddef> |
| 9 #include <cstdint> |
| 9 | 10 |
| 10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 11 | 12 |
| 12 namespace courgette { | 13 namespace courgette { |
| 13 | 14 |
| 14 // Status codes for Courgette APIs. | 15 // Status codes for Courgette APIs. |
| 15 // | 16 // |
| 16 // Client code should only rely on the distintion between C_OK and the other | 17 // Client code should only rely on the distintion between C_OK and the other |
| 17 // status codes. | 18 // status codes. |
| 18 // | 19 // |
| (...skipping 26 matching lines...) Expand all Loading... |
| 45 C_SERIALIZATION_FAILED = 22, // | 46 C_SERIALIZATION_FAILED = 22, // |
| 46 C_DESERIALIZATION_FAILED = 23, // | 47 C_DESERIALIZATION_FAILED = 23, // |
| 47 C_INPUT_NOT_RECOGNIZED = 24, // Unrecognized input (not an executable). | 48 C_INPUT_NOT_RECOGNIZED = 24, // Unrecognized input (not an executable). |
| 48 C_DISASSEMBLY_FAILED = 25, // | 49 C_DISASSEMBLY_FAILED = 25, // |
| 49 C_ASSEMBLY_FAILED = 26, // | 50 C_ASSEMBLY_FAILED = 26, // |
| 50 C_ADJUSTMENT_FAILED = 27, // | 51 C_ADJUSTMENT_FAILED = 27, // |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 // What type of executable is something | 54 // What type of executable is something |
| 54 // This is part of the patch format. Never reuse an id number. | 55 // This is part of the patch format. Never reuse an id number. |
| 55 enum ExecutableType { | 56 enum ExecutableType : uint8_t { |
| 56 EXE_UNKNOWN = 0, | 57 EXE_UNKNOWN = 0, |
| 57 EXE_WIN_32_X86 = 1, | 58 EXE_WIN_32_X86 = 1, |
| 58 EXE_ELF_32_X86 = 2, | 59 EXE_ELF_32_X86 = 2, |
| 59 EXE_ELF_32_ARM = 3, | 60 EXE_ELF_32_ARM = 3, |
| 60 EXE_WIN_32_X64 = 4, | 61 EXE_WIN_32_X64 = 4, |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 class SinkStream; | 64 class SinkStream; |
| 64 class SinkStreamSet; | 65 class SinkStreamSet; |
| 65 class SourceStream; | 66 class SourceStream; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // |buffer| in an undefined state. | 99 // |buffer| in an undefined state. |
| 99 Status Assemble(EncodedProgram* encoded, SinkStream* buffer); | 100 Status Assemble(EncodedProgram* encoded, SinkStream* buffer); |
| 100 | 101 |
| 101 // Adjusts |program| to look more like |model|. | 102 // Adjusts |program| to look more like |model|. |
| 102 // | 103 // |
| 103 Status Adjust(const AssemblyProgram& model, AssemblyProgram *program); | 104 Status Adjust(const AssemblyProgram& model, AssemblyProgram *program); |
| 104 | 105 |
| 105 } // namespace courgette | 106 } // namespace courgette |
| 106 | 107 |
| 107 #endif // COURGETTE_COURGETTE_H_ | 108 #endif // COURGETTE_COURGETTE_H_ |
| OLD | NEW |