1999-05-19 04:06:40 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2001-09-20 00:02:59 +00:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
1999-11-06 03:43:54 +00:00
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
2001-09-20 00:02:59 +00:00
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-05-19 04:06:40 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-05-19 04:06:40 +00:00
|
|
|
*
|
2001-09-20 00:02:59 +00:00
|
|
|
* The Original Code is Mozilla Communicator client code,
|
|
|
|
* released March 31, 1998.
|
1999-05-19 04:06:40 +00:00
|
|
|
*
|
2001-09-20 00:02:59 +00:00
|
|
|
* The Initial Developer of the Original Code is Netscape Communications
|
|
|
|
* Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
1999-11-06 03:43:54 +00:00
|
|
|
* Rights Reserved.
|
1999-05-19 04:06:40 +00:00
|
|
|
*
|
2001-09-20 00:02:59 +00:00
|
|
|
* Contributor(s):
|
1999-05-19 04:06:40 +00:00
|
|
|
* Daniel Veditz <dveditz@netscape.com>
|
2000-08-24 00:48:34 +00:00
|
|
|
* Samir Gehani <sgehani@netscape.com>
|
2001-09-20 00:02:59 +00:00
|
|
|
*/
|
1999-05-19 04:06:40 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
1999-08-10 23:06:44 +00:00
|
|
|
#ifdef XP_MAC
|
|
|
|
#include <stdlib.h>
|
|
|
|
#else
|
1999-05-19 04:06:40 +00:00
|
|
|
#include <malloc.h>
|
1999-08-10 23:06:44 +00:00
|
|
|
#endif
|
1999-05-19 04:06:40 +00:00
|
|
|
|
|
|
|
#define PR_ASSERT assert
|
|
|
|
#define PR_Malloc malloc
|
|
|
|
#define PR_FREEIF(x) do { if (x) free(x); } while(0)
|
|
|
|
#define PL_strfree free
|
|
|
|
#define PL_strcmp strcmp
|
|
|
|
#define PL_strdup strdup
|
|
|
|
#define PL_strcpy strcpy
|
2001-12-07 01:16:20 +00:00
|
|
|
#define PL_strlen strlen
|
1999-05-19 04:06:40 +00:00
|
|
|
|
|
|
|
#define PR_Open(a,b,c) fopen((a),(b))
|
|
|
|
#define PR_Read(f,d,n) fread((d),1,(n),(f))
|
|
|
|
#define PR_Write(f,s,n) fwrite((s),1,(n),(f))
|
|
|
|
#define PR_Close fclose
|
|
|
|
#define PR_Seek fseek
|
1999-11-13 00:44:56 +00:00
|
|
|
#define PR_Delete remove
|
1999-05-19 04:06:40 +00:00
|
|
|
|
2000-08-18 22:09:26 +00:00
|
|
|
#ifdef __cplusplus
|
1999-05-19 04:06:40 +00:00
|
|
|
#define PR_BEGIN_EXTERN_C extern "C" {
|
|
|
|
#define PR_END_EXTERN_C }
|
2000-08-18 22:09:26 +00:00
|
|
|
#else
|
|
|
|
#define PR_BEGIN_EXTERN_C
|
|
|
|
#define PR_END_EXTERN_C
|
|
|
|
#endif
|
1999-05-19 04:06:40 +00:00
|
|
|
|
2000-08-18 22:09:26 +00:00
|
|
|
#if defined(XP_MAC)
|
1999-08-10 23:06:44 +00:00
|
|
|
#define PR_EXTERN(__type) extern __declspec(export) __type
|
|
|
|
#define PR_PUBLIC_API(__type) __declspec(export) __type
|
2000-08-18 22:09:26 +00:00
|
|
|
#elif defined(XP_PC)
|
1999-05-19 04:06:40 +00:00
|
|
|
#define PR_EXTERN(__type) extern _declspec(dllexport) __type
|
|
|
|
#define PR_PUBLIC_API(__type) _declspec(dllexport) __type
|
2000-08-18 22:09:26 +00:00
|
|
|
#else /* XP_UNIX */
|
|
|
|
#define PR_EXTERN(__type) extern __type
|
|
|
|
#define PR_PUBLIC_API(__type) __type
|
1999-08-10 23:06:44 +00:00
|
|
|
#endif
|
1999-05-19 04:06:40 +00:00
|
|
|
|
2001-12-15 13:15:24 +00:00
|
|
|
#ifdef XP_OS2_VACPP
|
|
|
|
#define PR_CALLBACK _Optlink
|
|
|
|
#define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
|
|
|
|
#else
|
|
|
|
#define PR_CALLBACK
|
|
|
|
#define PR_STATIC_CALLBACK(__x) static __x
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-05-19 04:06:40 +00:00
|
|
|
#define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr))
|
|
|
|
|
|
|
|
#define PRFileDesc FILE
|
|
|
|
typedef long PRInt32;
|
1999-11-03 00:41:20 +00:00
|
|
|
typedef PRInt32 PROffset32;
|
1999-05-19 04:06:40 +00:00
|
|
|
typedef unsigned long PRUint32;
|
|
|
|
typedef short PRInt16;
|
|
|
|
typedef unsigned short PRUint16;
|
|
|
|
typedef char PRBool;
|
|
|
|
typedef unsigned char PRUint8;
|
2001-12-07 01:16:20 +00:00
|
|
|
typedef PRUint8 PRPackedBool;
|
1999-05-19 04:06:40 +00:00
|
|
|
|
|
|
|
#define PR_TRUE 1
|
|
|
|
#define PR_FALSE 0
|
|
|
|
|
2001-03-21 04:08:12 +00:00
|
|
|
#define INVALID_SXP -2
|
|
|
|
#define NON_SXP -1
|
1999-05-19 04:06:40 +00:00
|
|
|
#define VALID_SXP 1
|
1999-06-10 01:58:06 +00:00
|
|
|
#define MATCH 0
|
|
|
|
#define NOMATCH 1
|
|
|
|
#define ABORTED -1
|
1999-05-19 04:06:40 +00:00
|
|
|
|
|
|
|
#define PR_RDONLY "rb"
|
|
|
|
#define PR_SEEK_SET SEEK_SET
|
2000-08-24 00:48:34 +00:00
|
|
|
#define PR_SEEK_END SEEK_END
|
1999-05-19 04:06:40 +00:00
|
|
|
|
2001-03-21 04:08:12 +00:00
|
|
|
#define NS_WildCardValid(a) NON_SXP
|
|
|
|
#define NS_WildCardMatch(a,b,c) PR_FALSE
|
1999-06-10 01:58:06 +00:00
|
|
|
|
2001-04-03 06:35:13 +00:00
|
|
|
#define MOZ_DECL_CTOR_COUNTER(x)
|
|
|
|
#define MOZ_COUNT_CTOR(x)
|
|
|
|
#define MOZ_COUNT_DTOR(x)
|