1 /* 2 * Copyright (C) 2009 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 17 #ifndef _APPLYPATCH_IMGDIFF_H 18 #define _APPLYPATCH_IMGDIFF_H 19 20 #include <stddef.h> 21 22 // Image patch chunk types 23 #define CHUNK_NORMAL 0 24 #define CHUNK_GZIP 1 // version 1 only 25 #define CHUNK_DEFLATE 2 // version 2 only 26 #define CHUNK_RAW 3 // version 2 only 27 28 // The gzip header size is actually variable, but we currently don't 29 // support gzipped data with any of the optional fields, so for now it 30 // will always be ten bytes. See RFC 1952 for the definition of the 31 // gzip format. 32 static constexpr size_t GZIP_HEADER_LEN = 10; 33 34 // The gzip footer size really is fixed. 35 static constexpr size_t GZIP_FOOTER_LEN = 8; 36 37 int imgdiff(int argc, const char** argv); 38 39 #endif // _APPLYPATCH_IMGDIFF_H 40