Bug 459878, fix up errors for 3.0.5 -> 3.1b2 MU test
[mozilla-1.9.git] / modules / libjar / zipstub.h
blob950b1a7c91e2a7e9b186379069dc880cde0c0cf8
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 Communicator client code, released
16 * March 31, 1998.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998-1999
21 * the Initial Developer. All Rights Reserved.
23 * Contributor(s):
24 * Daniel Veditz <dveditz@netscape.com>
25 * Samir Gehani <sgehani@netscape.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either the GNU General Public License Version 2 or later (the "GPL"), or
29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
41 #include <stdio.h>
42 #include <string.h>
43 #include <assert.h>
44 #ifdef XP_MAC
45 #include <stdlib.h>
46 #else
47 #include <malloc.h>
48 #endif
50 #define NS_ASSERTION(c,m)
52 #define PR_ASSERT assert
53 #define PR_Malloc malloc
54 #define PR_Free free
55 #define PR_FREEIF(x) do { if (x) free(x); } while(0)
56 #define PL_strfree free
57 #define PL_strcmp strcmp
58 #define PL_strdup strdup
59 #define PL_strcpy strcpy
60 #define PL_strlen strlen
62 #define PR_Open(a,b,c) fopen((a),(b)) // XXX Ignores mode
63 #define PR_Read(f,d,n) fread((d),1,(n),(f))
64 #define PR_Write(f,s,n) fwrite((s),1,(n),(f))
65 #define PR_Close fclose
66 #define PR_Seek fseek
67 #define PR_Delete remove
69 #ifdef __cplusplus
70 #define PR_BEGIN_EXTERN_C extern "C" {
71 #define PR_END_EXTERN_C }
72 #else
73 #define PR_BEGIN_EXTERN_C
74 #define PR_END_EXTERN_C
75 #endif
77 #if defined(XP_MAC)
78 #define PR_EXTERN(__type) extern __declspec(export) __type
79 #define PR_PUBLIC_API(__type) __declspec(export) __type
80 #elif defined(XP_WIN)
81 #define PR_EXTERN(__type) extern _declspec(dllexport) __type
82 #define PR_PUBLIC_API(__type) _declspec(dllexport) __type
83 #elif defined(XP_OS2) && defined(__declspec)
84 #define PR_EXTERN(__type) extern __declspec(dllexport) __type
85 #define PR_PUBLIC_API(__type) __declspec(dllexport) __type
86 #else /* XP_UNIX */
87 #define PR_EXTERN(__type) extern __type
88 #define PR_PUBLIC_API(__type) __type
89 #endif
91 #define PR_CALLBACK
92 #define PR_STATIC_CALLBACK(__x) static __x
94 #define PRFileDesc FILE
95 typedef long PRInt32;
96 typedef PRInt32 PROffset32;
97 typedef unsigned long PRUint32;
98 typedef short PRInt16;
99 typedef unsigned short PRUint16;
100 typedef char PRBool;
101 typedef unsigned char PRUint8;
102 typedef PRUint8 PRPackedBool;
103 typedef PRInt32 nsresult;
105 #define PR_TRUE 1
106 #define PR_FALSE 0
108 #define INVALID_SXP -2
109 #define NON_SXP -1
110 #define VALID_SXP 1
111 #define MATCH 0
112 #define NOMATCH 1
113 #define ABORTED -1
115 #define PR_RDONLY "rb"
116 #define PR_SEEK_SET SEEK_SET
117 #define PR_SEEK_END SEEK_END
119 #define NS_WildCardValid(a) NON_SXP
120 #define NS_WildCardMatch(a,b,c) PR_FALSE
122 #define MOZ_COUNT_CTOR(x)
123 #define MOZ_COUNT_DTOR(x)