blob: 22cbd4fa025ae4b91b0ce64f3edc63fa45d05e68 [file] [log] [blame]
Doug Zongker512536a2010-02-17 16:11:44 -08001/*
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
Tao Bao97555da2016-12-15 10:15:06 -080017#ifndef _APPLYPATCH_IMGDIFF_H
18#define _APPLYPATCH_IMGDIFF_H
19
20#include <stddef.h>
21
Doug Zongker512536a2010-02-17 16:11:44 -080022// Image patch chunk types
Tao Bao97555da2016-12-15 10:15:06 -080023#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
Doug Zongker512536a2010-02-17 16:11:44 -080027
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.
Tao Bao97555da2016-12-15 10:15:06 -080032static constexpr size_t GZIP_HEADER_LEN = 10;
Doug Zongker512536a2010-02-17 16:11:44 -080033
34// The gzip footer size really is fixed.
Tao Bao97555da2016-12-15 10:15:06 -080035static constexpr size_t GZIP_FOOTER_LEN = 8;
36
37int imgdiff(int argc, const char** argv);
38
39#endif // _APPLYPATCH_IMGDIFF_H