1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
37 /*--------------------------------------------------------------
40 * Constants used in processing the GDIFF format
41 *--------------------------------------------------------------*/
46 #define GDIFF_MAGIC "\xD1\xFF\xD1\xFF"
47 #define GDIFF_MAGIC_LEN 4
49 #define GDIFF_EOF "\0"
51 #define GDIFF_VER_POS 4
52 #define GDIFF_CS_POS 5
53 #define GDIFF_CSLEN_POS 6
55 #define GDIFF_HEADERSIZE 7
56 #define GDIFF_APPDATALEN 4
58 #define GDIFF_CS_NONE 0
59 #define GDIFF_CS_MD5 1
60 #define GDIFF_CS_SHA 2
61 #define GDIFF_CS_CRC32 32
65 /*--------------------------------------
67 *------------------------------------*/
72 #define COPY16BYTE 249
73 #define COPY16SHORT 250
74 #define COPY16LONG 251
75 #define COPY32BYTE 252
76 #define COPY32SHORT 253
77 #define COPY32LONG 254
80 /* instruction sizes */
83 #define COPY16BYTESIZE 3
84 #define COPY16SHORTSIZE 4
85 #define COPY16LONGSIZE 6
86 #define COPY32BYTESIZE 5
87 #define COPY32SHORTSIZE 6
88 #define COPY32LONGSIZE 8
92 /*--------------------------------------
94 *------------------------------------*/
96 #define GDIFF_ERR_UNKNOWN -1
97 #define GDIFF_ERR_ARGS -2
98 #define GDIFF_ERR_ACCESS -3
99 #define GDIFF_ERR_MEM -4
100 #define GDIFF_ERR_HEADER -5
101 #define GDIFF_ERR_BADDIFF -6
102 #define GDIFF_ERR_OPCODE -7
103 #define GDIFF_ERR_OLDFILE -8
104 #define GDIFF_ERR_CHKSUMTYPE -9
105 #define GDIFF_ERR_CHECKSUM -10
106 #define GDIFF_ERR_CHECKSUM_TARGET -11
107 #define GDIFF_ERR_CHECKSUM_RESULT -12
110 /*--------------------------------------
112 *------------------------------------*/
115 #include <sys/types.h>
117 typedef unsigned char uchar
;
121 typedef struct _diffdata
{
126 uint8 checksumLength
;
129 PRBool bMacAppleSingle
;
130 PRBool bWin32BoundImage
;
135 typedef DIFFDATA
* pDIFFDATA
;
138 /*--------------------------------------
140 *------------------------------------*/
142 #define APPFLAG_W32BOUND "autoinstall:Win32PE"
143 #define APPFLAG_APPLESINGLE "autoinstall:AppleSingle"