bug 393626. fixing a bug causing us to always append the system default font to the...
[mozilla-central.git] / xpinstall / src / gdiff.h
bloba3e21c000ef43db1c8bd523cbffc98725274cc29
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
13 * License.
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.
22 * Contributor(s):
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 /*--------------------------------------------------------------
38 * GDIFF.H
40 * Constants used in processing the GDIFF format
41 *--------------------------------------------------------------*/
44 #include "prio.h"
46 #define GDIFF_MAGIC "\xD1\xFF\xD1\xFF"
47 #define GDIFF_MAGIC_LEN 4
48 #define GDIFF_VER 5
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
63 #define CRC32_LEN 4
65 /*--------------------------------------
66 * GDIFF opcodes
67 *------------------------------------*/
68 #define ENDDIFF 0
69 #define ADD8MAX 246
70 #define ADD16 247
71 #define ADD32 248
72 #define COPY16BYTE 249
73 #define COPY16SHORT 250
74 #define COPY16LONG 251
75 #define COPY32BYTE 252
76 #define COPY32SHORT 253
77 #define COPY32LONG 254
78 #define COPY64 255
80 /* instruction sizes */
81 #define ADD16SIZE 2
82 #define ADD32SIZE 4
83 #define COPY16BYTESIZE 3
84 #define COPY16SHORTSIZE 4
85 #define COPY16LONGSIZE 6
86 #define COPY32BYTESIZE 5
87 #define COPY32SHORTSIZE 6
88 #define COPY32LONGSIZE 8
89 #define COPY64SIZE 12
92 /*--------------------------------------
93 * error codes
94 *------------------------------------*/
95 #define GDIFF_OK 0
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 /*--------------------------------------
111 * types
112 *------------------------------------*/
113 #ifndef AIX
114 #ifdef OSF1
115 #include <sys/types.h>
116 #else
117 typedef unsigned char uchar;
118 #endif
119 #endif
121 typedef struct _diffdata {
122 PRFileDesc* fSrc;
123 PRFileDesc* fOut;
124 PRFileDesc* fDiff;
125 uint8 checksumType;
126 uint8 checksumLength;
127 uchar* oldChecksum;
128 uchar* newChecksum;
129 PRBool bMacAppleSingle;
130 PRBool bWin32BoundImage;
131 uchar* databuf;
132 uint32 bufsize;
133 } DIFFDATA;
135 typedef DIFFDATA* pDIFFDATA;
138 /*--------------------------------------
139 * miscellaneous
140 *------------------------------------*/
142 #define APPFLAG_W32BOUND "autoinstall:Win32PE"
143 #define APPFLAG_APPLESINGLE "autoinstall:AppleSingle"
145 #ifndef TRUE
146 #define TRUE 1
147 #endif
149 #ifndef FALSE
150 #define FALSE 0
151 #endif