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 <stddef.h> // Required to define size_t on GCC |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Generates a patch that will transform the bytes in |old| into the bytes in | 87 // Generates a patch that will transform the bytes in |old| into the bytes in |
88 // |target|. | 88 // |target|. |
89 // Returns C_OK unless something when wrong (unexpected). | 89 // Returns C_OK unless something when wrong (unexpected). |
90 Status GenerateEnsemblePatch(SourceStream* old, SourceStream* target, | 90 Status GenerateEnsemblePatch(SourceStream* old, SourceStream* target, |
91 SinkStream* patch); | 91 SinkStream* patch); |
92 | 92 |
93 // Detects the type of an executable file, and it's length. The length | 93 // Detects the type of an executable file, and it's length. The length |
94 // may be slightly smaller than some executables (like ELF), but will include | 94 // may be slightly smaller than some executables (like ELF), but will include |
95 // all bytes the courgette algorithm has special benefit for. | 95 // all bytes the courgette algorithm has special benefit for. |
96 // On sucess: | 96 // On success: |
97 // Fill in type and detected_length, and return C_OK. | 97 // Fill in type and detected_length, and return C_OK. |
98 // On failure: | 98 // On failure: |
99 // Fill in type with UNKNOWN, detected_length with 0, and | 99 // Fill in type with UNKNOWN, detected_length with 0, and |
100 // return C_INPUT_NOT_RECOGNIZED | 100 // return C_INPUT_NOT_RECOGNIZED |
101 Status DetectExecutableType(const void* buffer, size_t length, | 101 Status DetectExecutableType(const void* buffer, size_t length, |
102 ExecutableType* type, | 102 ExecutableType* type, |
103 size_t* detected_length); | 103 size_t* detected_length); |
104 | 104 |
105 // Attempts to detect the type of executable, and parse it with the | 105 // Attempts to detect the type of executable, and parse it with the |
106 // appropriate tools, storing the pointer to the AssemblyProgram in |*output|. | 106 // appropriate tools, storing the pointer to the AssemblyProgram in |*output|. |
(...skipping 30 matching lines...) Expand all Loading... |
137 | 137 |
138 // Used to free an EncodedProgram returned by other APIs. | 138 // Used to free an EncodedProgram returned by other APIs. |
139 void DeleteEncodedProgram(EncodedProgram* encoded); | 139 void DeleteEncodedProgram(EncodedProgram* encoded); |
140 | 140 |
141 // Adjusts |program| to look more like |model|. | 141 // Adjusts |program| to look more like |model|. |
142 // | 142 // |
143 Status Adjust(const AssemblyProgram& model, AssemblyProgram *program); | 143 Status Adjust(const AssemblyProgram& model, AssemblyProgram *program); |
144 | 144 |
145 } // namespace courgette | 145 } // namespace courgette |
146 #endif // COURGETTE_COURGETTE_H_ | 146 #endif // COURGETTE_COURGETTE_H_ |
OLD | NEW |