Back to index

lightning-sunbird  0.9+nobinonly
zipstub.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Daniel Veditz <dveditz@netscape.com>
00025  *   Samir Gehani <sgehani@netscape.com>
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either the GNU General Public License Version 2 or later (the "GPL"), or
00029  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #include <stdio.h>
00042 #include <string.h>
00043 #include <assert.h>
00044 #ifdef XP_MAC
00045 #include <stdlib.h>
00046 #else
00047 #include <malloc.h>
00048 #endif
00049 
00050 #define PR_ASSERT         assert
00051 #define PR_Malloc         malloc
00052 #define PR_Free           free
00053 #define PR_FREEIF(x)      do { if (x) free(x); } while(0)
00054 #define PL_strfree        free
00055 #define PL_strcmp         strcmp
00056 #define PL_strdup         strdup
00057 #define PL_strcpy         strcpy
00058 #define PL_strlen         strlen
00059 
00060 #define PR_Open(a,b,c)    fopen((a),(b)) // XXX Ignores mode
00061 #define PR_Read(f,d,n)    fread((d),1,(n),(f))
00062 #define PR_Write(f,s,n)   fwrite((s),1,(n),(f))
00063 #define PR_Close          fclose
00064 #define PR_Seek           fseek
00065 #define PR_Delete         remove
00066 
00067 #ifdef __cplusplus
00068 #define PR_BEGIN_EXTERN_C       extern "C" {
00069 #define PR_END_EXTERN_C         }
00070 #else
00071 #define PR_BEGIN_EXTERN_C   
00072 #define PR_END_EXTERN_C  
00073 #endif
00074 
00075 #if defined(XP_MAC)
00076 #define PR_EXTERN(__type)       extern __declspec(export) __type
00077 #define PR_PUBLIC_API(__type)   __declspec(export) __type
00078 #elif defined(XP_WIN)
00079 #define PR_EXTERN(__type)       extern _declspec(dllexport) __type
00080 #define PR_PUBLIC_API(__type)   _declspec(dllexport) __type
00081 #else /* XP_UNIX */
00082 #define PR_EXTERN(__type)       extern __type
00083 #define PR_PUBLIC_API(__type)   __type 
00084 #endif
00085 
00086 #define PR_CALLBACK
00087 #define PR_STATIC_CALLBACK(__x) static __x
00088 
00089 #define NS_STATIC_CAST(__type, __ptr)      ((__type)(__ptr))
00090 
00091 #define PRFileDesc          FILE
00092 typedef long                PRInt32;
00093 typedef PRInt32             PROffset32;
00094 typedef unsigned long       PRUint32;
00095 typedef short               PRInt16;
00096 typedef unsigned short      PRUint16;
00097 typedef char                PRBool;
00098 typedef unsigned char       PRUint8;
00099 typedef PRUint8             PRPackedBool;
00100 
00101 #define PR_TRUE             1
00102 #define PR_FALSE            0
00103 
00104 #define INVALID_SXP   -2
00105 #define NON_SXP       -1
00106 #define VALID_SXP     1
00107 #define MATCH 0
00108 #define NOMATCH 1
00109 #define ABORTED -1
00110 
00111 #define PR_RDONLY     "rb"
00112 #define PR_SEEK_SET   SEEK_SET
00113 #define PR_SEEK_END   SEEK_END
00114 
00115 #define NS_WildCardValid(a)       NON_SXP
00116 #define NS_WildCardMatch(a,b,c)   PR_FALSE
00117 
00118 #define MOZ_DECL_CTOR_COUNTER(x)
00119 #define MOZ_COUNT_CTOR(x)
00120 #define MOZ_COUNT_DTOR(x)