1999-05-19 08:06:40 +04:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2001-09-20 04:02:59 +04:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Netscape Public
|
1999-11-06 06:43:54 +03: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 04:02:59 +04:00
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-05-19 08:06:40 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03: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 08:06:40 +04:00
|
|
|
*
|
2001-09-20 04:02:59 +04:00
|
|
|
* The Original Code is Mozilla Communicator client code,
|
|
|
|
* released March 31, 1998.
|
1999-05-19 08:06:40 +04:00
|
|
|
*
|
2001-09-20 04:02:59 +04: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 06:43:54 +03:00
|
|
|
* Rights Reserved.
|
1999-05-19 08:06:40 +04:00
|
|
|
*
|
2001-09-20 04:02:59 +04:00
|
|
|
* Contributor(s):
|
1999-05-19 08:06:40 +04:00
|
|
|
* Daniel Veditz <dveditz@netscape.com>
|
2000-08-24 04:48:34 +04:00
|
|
|
* Samir Gehani <sgehani@netscape.com>
|
2001-09-20 04:02:59 +04:00
|
|
|
*/
|
1999-05-19 08:06:40 +04:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
1999-08-11 03:06:44 +04:00
|
|
|
#ifdef XP_MAC
|
|
|
|
#include <stdlib.h>
|
|
|
|
#else
|
1999-05-19 08:06:40 +04:00
|
|
|
#include <malloc.h>
|
1999-08-11 03:06:44 +04:00
|
|
|
#endif
|
1999-05-19 08:06:40 +04:00
|
|
|
|
|
|
|
#define PR_ASSERT assert
|
|
|
|
#define PR_Malloc malloc
|
2003-02-01 00:53:39 +03:00
|
|
|
#define PR_Free free
|
1999-05-19 08:06:40 +04:00
|
|
|
#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 04:16:20 +03:00
|
|
|
#define PL_strlen strlen
|
1999-05-19 08:06:40 +04: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 03:44:56 +03:00
|
|
|
#define PR_Delete remove
|
1999-05-19 08:06:40 +04:00
|
|
|
|
2000-08-19 02:09:26 +04:00
|
|
|
#ifdef __cplusplus
|
1999-05-19 08:06:40 +04:00
|
|
|
#define PR_BEGIN_EXTERN_C extern "C" {
|
|
|
|
#define PR_END_EXTERN_C }
|
2000-08-19 02:09:26 +04:00
|
|
|
#else
|
|
|
|
#define PR_BEGIN_EXTERN_C
|
|
|
|
#define PR_END_EXTERN_C
|
|
|
|
#endif
|
1999-05-19 08:06:40 +04:00
|
|
|
|
2000-08-19 02:09:26 +04:00
|
|
|
#if defined(XP_MAC)
|
1999-08-11 03:06:44 +04:00
|
|
|
#define PR_EXTERN(__type) extern __declspec(export) __type
|
|
|
|
#define PR_PUBLIC_API(__type) __declspec(export) __type
|
2003-07-23 00:16:02 +04:00
|
|
|
#elif defined(XP_WIN)
|
1999-05-19 08:06:40 +04:00
|
|
|
#define PR_EXTERN(__type) extern _declspec(dllexport) __type
|
|
|
|
#define PR_PUBLIC_API(__type) _declspec(dllexport) __type
|
2000-08-19 02:09:26 +04:00
|
|
|
#else /* XP_UNIX */
|
|
|
|
#define PR_EXTERN(__type) extern __type
|
|
|
|
#define PR_PUBLIC_API(__type) __type
|
1999-08-11 03:06:44 +04:00
|
|
|
#endif
|
1999-05-19 08:06:40 +04:00
|
|
|
|
2001-12-15 16:15:24 +03:00
|
|
|
#define PR_CALLBACK
|
|
|
|
#define PR_STATIC_CALLBACK(__x) static __x
|
|
|
|
|
1999-05-19 08:06:40 +04:00
|
|
|
#define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr))
|
|
|
|
|
|
|
|
#define PRFileDesc FILE
|
|
|
|
typedef long PRInt32;
|
1999-11-03 03:41:20 +03:00
|
|
|
typedef PRInt32 PROffset32;
|
1999-05-19 08:06:40 +04:00
|
|
|
typedef unsigned long PRUint32;
|
|
|
|
typedef short PRInt16;
|
|
|
|
typedef unsigned short PRUint16;
|
|
|
|
typedef char PRBool;
|
|
|
|
typedef unsigned char PRUint8;
|
2001-12-07 04:16:20 +03:00
|
|
|
typedef PRUint8 PRPackedBool;
|
1999-05-19 08:06:40 +04:00
|
|
|
|
|
|
|
#define PR_TRUE 1
|
|
|
|
#define PR_FALSE 0
|
|
|
|
|
2001-03-21 07:08:12 +03:00
|
|
|
#define INVALID_SXP -2
|
|
|
|
#define NON_SXP -1
|
1999-05-19 08:06:40 +04:00
|
|
|
#define VALID_SXP 1
|
1999-06-10 05:58:06 +04:00
|
|
|
#define MATCH 0
|
|
|
|
#define NOMATCH 1
|
|
|
|
#define ABORTED -1
|
1999-05-19 08:06:40 +04:00
|
|
|
|
|
|
|
#define PR_RDONLY "rb"
|
|
|
|
#define PR_SEEK_SET SEEK_SET
|
2000-08-24 04:48:34 +04:00
|
|
|
#define PR_SEEK_END SEEK_END
|
1999-05-19 08:06:40 +04:00
|
|
|
|
2001-03-21 07:08:12 +03:00
|
|
|
#define NS_WildCardValid(a) NON_SXP
|
|
|
|
#define NS_WildCardMatch(a,b,c) PR_FALSE
|
1999-06-10 05:58:06 +04:00
|
|
|
|
2001-04-03 10:35:13 +04:00
|
|
|
#define MOZ_DECL_CTOR_COUNTER(x)
|
|
|
|
#define MOZ_COUNT_CTOR(x)
|
|
|
|
#define MOZ_COUNT_DTOR(x)
|