Compare commits
92 Commits
Bugzilla_P
...
NSS_3_2_BR
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b42d36f1ef | ||
|
|
558404d4a7 | ||
|
|
f80d1dcac9 | ||
|
|
e0138119d3 | ||
|
|
a6dc60f91f | ||
|
|
af7dac2b57 | ||
|
|
3d5e52a983 | ||
|
|
0bf8e842ae | ||
|
|
11e5d30069 | ||
|
|
a484623ca5 | ||
|
|
6de0b360c3 | ||
|
|
2cdb8bb3d6 | ||
|
|
e0af0a5ba5 | ||
|
|
6b7fba578d | ||
|
|
af921f0718 | ||
|
|
2a8270303e | ||
|
|
d7b4f960d8 | ||
|
|
a4de103594 | ||
|
|
d0dd8114bb | ||
|
|
b74cdd9bcc | ||
|
|
b49dd26de7 | ||
|
|
2f9e1853e4 | ||
|
|
ee5cd00624 | ||
|
|
bd075d80f3 | ||
|
|
3e668e508f | ||
|
|
309181a6c7 | ||
|
|
c374060956 | ||
|
|
c2f6e69f10 | ||
|
|
b4553f74bc | ||
|
|
2e5dfaada6 | ||
|
|
abc5a74632 | ||
|
|
c414a7977b | ||
|
|
c726cb4a0c | ||
|
|
16375108e2 | ||
|
|
e78de1ae95 | ||
|
|
591d3430f4 | ||
|
|
94eed35f51 | ||
|
|
535659cbcd | ||
|
|
32a26607c5 | ||
|
|
44089d5f47 | ||
|
|
8926bda152 | ||
|
|
38332e259f | ||
|
|
ba440b238a | ||
|
|
8b48b845d0 | ||
|
|
290ecf1853 | ||
|
|
dec7891350 | ||
|
|
4d539c597d | ||
|
|
d505ee784e | ||
|
|
a99e5f4d66 | ||
|
|
437df77517 | ||
|
|
78423641d9 | ||
|
|
b0f39ffe10 | ||
|
|
28cdd94a74 | ||
|
|
c0bb9ab3a6 | ||
|
|
67fcf38e3f | ||
|
|
818d022837 | ||
|
|
ab2502ea3b | ||
|
|
750f663ecb | ||
|
|
2335288f7d | ||
|
|
5effe8c369 | ||
|
|
6db32103ea | ||
|
|
65487e1b1c | ||
|
|
a54a8bfce4 | ||
|
|
14c433f089 | ||
|
|
d56ef79019 | ||
|
|
28dfa1774f | ||
|
|
854b53e63e | ||
|
|
1e4801a2b1 | ||
|
|
5ac48d51c1 | ||
|
|
4cd1210d92 | ||
|
|
7695870fb3 | ||
|
|
3dded8af7a | ||
|
|
7826aaff6b | ||
|
|
a22c4e7cf9 | ||
|
|
7273ce89f3 | ||
|
|
1c81274537 | ||
|
|
2f49470a29 | ||
|
|
7f1171ea3d | ||
|
|
f578eb80cb | ||
|
|
14aa8ddb95 | ||
|
|
f83543da54 | ||
|
|
dbc3666f23 | ||
|
|
2867a1cab3 | ||
|
|
bc8bdb6d04 | ||
|
|
8542a59314 | ||
|
|
cf87683d63 | ||
|
|
9a92012381 | ||
|
|
01aa370596 | ||
|
|
c0844eef89 | ||
|
|
3f2596d3b0 | ||
|
|
24f23a00f9 | ||
|
|
aa5fe7cd4d |
36
mozilla/dbm/Makefile.in
Normal file
36
mozilla/dbm/Makefile.in
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = include src
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
17
mozilla/dbm/include/MANIFEST
Normal file
17
mozilla/dbm/include/MANIFEST
Normal file
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
cdefs.h
|
||||
extern.h
|
||||
hash.h
|
||||
hsearch.h
|
||||
mcom_db.h
|
||||
mpool.h
|
||||
ncompat.h
|
||||
ndbm.h
|
||||
nsres.h
|
||||
page.h
|
||||
queue.h
|
||||
search.h
|
||||
watcomfx.h
|
||||
55
mozilla/dbm/include/Makefile.in
Normal file
55
mozilla/dbm/include/Makefile.in
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = dbm
|
||||
|
||||
EXPORTS = \
|
||||
nsres.h \
|
||||
cdefs.h \
|
||||
mcom_db.h \
|
||||
ncompat.h \
|
||||
winfile.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
PRIVATE_EXPORTS = \
|
||||
hsearch.h \
|
||||
page.h \
|
||||
extern.h \
|
||||
ndbm.h \
|
||||
queue.h \
|
||||
hash.h \
|
||||
mpool.h \
|
||||
search.h \
|
||||
$(NULL)
|
||||
|
||||
PRIVATE_EXPORTS := $(addprefix $(srcdir)/, $(PRIVATE_EXPORTS))
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
63
mozilla/dbm/include/Makefile.win
Normal file
63
mozilla/dbm/include/Makefile.win
Normal file
@@ -0,0 +1,63 @@
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build the cert library
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
!ifndef MOZ_DEBUG
|
||||
OPTIMIZER=-Os -UDEBUG -DNDEBUG
|
||||
!endif
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..
|
||||
|
||||
!ifndef MAKE_OBJ_TYPE
|
||||
MAKE_OBJ_TYPE=EXE
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// install headers
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
INSTALL_DIR=$(XPDIST)\include
|
||||
INSTALL_FILE_LIST= nsres.h cdefs.h mcom_db.h ncompat.h winfile.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
|
||||
|
||||
export:: INSTALL_FILES
|
||||
|
||||
166
mozilla/dbm/include/cdefs.h
Normal file
166
mozilla/dbm/include/cdefs.h
Normal file
@@ -0,0 +1,166 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Berkeley Software Design, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cdefs.h 8.7 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _CDEFS_H_
|
||||
#define _CDEFS_H_
|
||||
|
||||
#ifdef __BEGIN_DECLS
|
||||
#undef __BEGIN_DECLS
|
||||
#endif
|
||||
#ifdef __END_DECLS
|
||||
#undef __END_DECLS
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define __BEGIN_DECLS extern "C" {
|
||||
#define __END_DECLS }
|
||||
#else
|
||||
#define __BEGIN_DECLS
|
||||
#define __END_DECLS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
|
||||
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
|
||||
* The __CONCAT macro is a bit tricky -- make sure you don't put spaces
|
||||
* in between its arguments. __CONCAT can also concatenate double-quoted
|
||||
* strings produced by the __STRING macro, but this only works with ANSI C.
|
||||
*/
|
||||
#undef __P
|
||||
#undef __CONCAT
|
||||
#undef __STRING
|
||||
|
||||
#if defined(__STDC__) || defined(__cplusplus) || defined(_WINDOWS) || defined(XP_OS2)
|
||||
#define __P(protos) protos /* full-blown ANSI C */
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#define __STRING(x) #x
|
||||
|
||||
#ifndef __const
|
||||
#define __const const /* define reserved names to standard */
|
||||
#endif /* __const */
|
||||
#define __signed signed
|
||||
#define __volatile volatile
|
||||
#ifndef _WINDOWS
|
||||
#if defined(__cplusplus)
|
||||
#define __inline inline /* convert to C++ keyword */
|
||||
#else
|
||||
#if !defined(__GNUC__) && !defined(__MWERKS__)
|
||||
#define __inline /* delete GCC keyword */
|
||||
#endif /* !__GNUC__ */
|
||||
#endif /* !__cplusplus */
|
||||
#endif /* !_WINDOWS */
|
||||
|
||||
#else /* !(__STDC__ || __cplusplus) */
|
||||
#define __P(protos) () /* traditional C preprocessor */
|
||||
#define __CONCAT(x,y) x/**/y
|
||||
#define __STRING(x) "x"
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define __const /* delete pseudo-ANSI C keywords */
|
||||
#define __inline
|
||||
#define __signed
|
||||
#define __volatile
|
||||
/*
|
||||
* In non-ANSI C environments, new programs will want ANSI-only C keywords
|
||||
* deleted from the program and old programs will want them left alone.
|
||||
* When using a compiler other than gcc, programs using the ANSI C keywords
|
||||
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
|
||||
* When using "gcc -traditional", we assume that this is the intent; if
|
||||
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
|
||||
*/
|
||||
#ifndef NO_ANSI_KEYWORDS
|
||||
#define const /* delete ANSI C keywords */
|
||||
#define inline
|
||||
#define signed
|
||||
#define volatile
|
||||
#endif
|
||||
#endif /* !__GNUC__ */
|
||||
#endif /* !(__STDC__ || __cplusplus) */
|
||||
|
||||
/*
|
||||
* GCC1 and some versions of GCC2 declare dead (non-returning) and
|
||||
* pure (no side effects) functions using "volatile" and "const";
|
||||
* unfortunately, these then cause warnings under "-ansi -pedantic".
|
||||
* GCC2 uses a new, peculiar __attribute__((attrs)) style. All of
|
||||
* these work for GNU C++ (modulo a slight glitch in the C++ grammar
|
||||
* in the distribution version of 2.5.5).
|
||||
*/
|
||||
#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 5
|
||||
#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
#define __dead __volatile
|
||||
#define __pure __const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Delete pseudo-keywords wherever they are not available or needed. */
|
||||
#ifndef __dead
|
||||
#define __dead
|
||||
#define __pure
|
||||
#endif
|
||||
|
||||
#ifdef AIXV3
|
||||
/* Wont compile without const. Need a cleaner way to handle this. */
|
||||
#ifdef const
|
||||
#undef const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !_CDEFS_H_ */
|
||||
65
mozilla/dbm/include/extern.h
Normal file
65
mozilla/dbm/include/extern.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.4 (Berkeley) 6/16/94
|
||||
*/
|
||||
|
||||
BUFHEAD *__add_ovflpage (HTAB *, BUFHEAD *);
|
||||
int __addel (HTAB *, BUFHEAD *, const DBT *, const DBT *);
|
||||
int __big_delete (HTAB *, BUFHEAD *);
|
||||
int __big_insert (HTAB *, BUFHEAD *, const DBT *, const DBT *);
|
||||
int __big_keydata (HTAB *, BUFHEAD *, DBT *, DBT *, int);
|
||||
int __big_return (HTAB *, BUFHEAD *, int, DBT *, int);
|
||||
int __big_split (HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
|
||||
uint32, uint32, SPLIT_RETURN *);
|
||||
int __buf_free (HTAB *, int, int);
|
||||
void __buf_init (HTAB *, int);
|
||||
uint32 __call_hash (HTAB *, char *, size_t);
|
||||
int __delpair (HTAB *, BUFHEAD *, int);
|
||||
int __expand_table (HTAB *);
|
||||
int __find_bigpair (HTAB *, BUFHEAD *, int, char *, int);
|
||||
uint16 __find_last_page (HTAB *, BUFHEAD **);
|
||||
void __free_ovflpage (HTAB *, BUFHEAD *);
|
||||
BUFHEAD *__get_buf (HTAB *, uint32, BUFHEAD *, int);
|
||||
int __get_page (HTAB *, char *, uint32, int, int, int);
|
||||
int __ibitmap (HTAB *, int, int, int);
|
||||
uint32 __log2 (uint32);
|
||||
int __put_page (HTAB *, char *, uint32, int, int);
|
||||
void __reclaim_buf (HTAB *, BUFHEAD *);
|
||||
int __split_page (HTAB *, uint32, uint32);
|
||||
|
||||
/* Default hash routine. */
|
||||
extern uint32 (*__default_hash) (const void *, size_t);
|
||||
|
||||
#ifdef HASH_STATISTICS
|
||||
extern int hash_accesses, hash_collisions, hash_expansions, hash_overflows;
|
||||
#endif
|
||||
337
mozilla/dbm/include/hash.h
Normal file
337
mozilla/dbm/include/hash.h
Normal file
@@ -0,0 +1,337 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)hash.h 8.3 (Berkeley) 5/31/94
|
||||
*/
|
||||
|
||||
/* Operations */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mcom_db.h"
|
||||
typedef enum {
|
||||
HASH_GET, HASH_PUT, HASH_PUTNEW, HASH_DELETE, HASH_FIRST, HASH_NEXT
|
||||
} ACTION;
|
||||
|
||||
/* Buffer Management structures */
|
||||
typedef struct _bufhead BUFHEAD;
|
||||
|
||||
struct _bufhead {
|
||||
BUFHEAD *prev; /* LRU links */
|
||||
BUFHEAD *next; /* LRU links */
|
||||
BUFHEAD *ovfl; /* Overflow page buffer header */
|
||||
uint32 addr; /* Address of this page */
|
||||
char *page; /* Actual page data */
|
||||
char is_disk;
|
||||
char flags;
|
||||
#define BUF_MOD 0x0001
|
||||
#define BUF_DISK 0x0002
|
||||
#define BUF_BUCKET 0x0004
|
||||
#define BUF_PIN 0x0008
|
||||
};
|
||||
|
||||
#define IS_BUCKET(X) ((X) & BUF_BUCKET)
|
||||
|
||||
typedef BUFHEAD **SEGMENT;
|
||||
|
||||
typedef int DBFILE_PTR;
|
||||
#define NO_FILE -1
|
||||
#ifdef macintosh
|
||||
#define DBFILE_OPEN(path, flag,mode) open((path), flag)
|
||||
#define EXISTS(path)
|
||||
#else
|
||||
#define DBFILE_OPEN(path, flag,mode) open((path), (flag), (mode))
|
||||
#endif
|
||||
/* Hash Table Information */
|
||||
typedef struct hashhdr { /* Disk resident portion */
|
||||
int32 magic; /* Magic NO for hash tables */
|
||||
int32 version; /* Version ID */
|
||||
uint32 lorder; /* Byte Order */
|
||||
int32 bsize; /* Bucket/Page Size */
|
||||
int32 bshift; /* Bucket shift */
|
||||
int32 dsize; /* Directory Size */
|
||||
int32 ssize; /* Segment Size */
|
||||
int32 sshift; /* Segment shift */
|
||||
int32 ovfl_point; /* Where overflow pages are being
|
||||
* allocated */
|
||||
int32 last_freed; /* Last overflow page freed */
|
||||
int32 max_bucket; /* ID of Maximum bucket in use */
|
||||
int32 high_mask; /* Mask to modulo into entire table */
|
||||
int32 low_mask; /* Mask to modulo into lower half of
|
||||
* table */
|
||||
int32 ffactor; /* Fill factor */
|
||||
int32 nkeys; /* Number of keys in hash table */
|
||||
int32 hdrpages; /* Size of table header */
|
||||
int32 h_charkey; /* value of hash(CHARKEY) */
|
||||
#define NCACHED 32 /* number of bit maps and spare
|
||||
* points */
|
||||
int32 spares[NCACHED];/* spare pages for overflow */
|
||||
uint16 bitmaps[NCACHED]; /* address of overflow page
|
||||
* bitmaps */
|
||||
} HASHHDR;
|
||||
|
||||
typedef struct htab { /* Memory resident data structure */
|
||||
HASHHDR hdr; /* Header */
|
||||
int nsegs; /* Number of allocated segments */
|
||||
int exsegs; /* Number of extra allocated
|
||||
* segments */
|
||||
uint32 /* Hash function */
|
||||
(*hash)(const void *, size_t);
|
||||
int flags; /* Flag values */
|
||||
DBFILE_PTR fp; /* File pointer */
|
||||
char *filename;
|
||||
char *tmp_buf; /* Temporary Buffer for BIG data */
|
||||
char *tmp_key; /* Temporary Buffer for BIG keys */
|
||||
BUFHEAD *cpage; /* Current page */
|
||||
int cbucket; /* Current bucket */
|
||||
int cndx; /* Index of next item on cpage */
|
||||
int dbmerrno; /* Error Number -- for DBM
|
||||
* compatability */
|
||||
int new_file; /* Indicates if fd is backing store
|
||||
* or no */
|
||||
int save_file; /* Indicates whether we need to flush
|
||||
* file at
|
||||
* exit */
|
||||
uint32 *mapp[NCACHED]; /* Pointers to page maps */
|
||||
int nmaps; /* Initial number of bitmaps */
|
||||
int nbufs; /* Number of buffers left to
|
||||
* allocate */
|
||||
BUFHEAD bufhead; /* Header of buffer lru list */
|
||||
SEGMENT *dir; /* Hash Bucket directory */
|
||||
off_t file_size; /* in bytes */
|
||||
char is_temp; /* unlink file on close */
|
||||
char updateEOF; /* close and reopen on flush */
|
||||
} HTAB;
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
#define DATABASE_CORRUPTED_ERROR -999 /* big ugly abort, delete database */
|
||||
#define OLD_MAX_BSIZE 65536 /* 2^16 */
|
||||
#define MAX_BSIZE 32l*1024l /* 2^15 */
|
||||
#define MIN_BUFFERS 6
|
||||
#define MINHDRSIZE 512
|
||||
#define DEF_BUFSIZE 65536l /* 64 K */
|
||||
#define DEF_BUCKET_SIZE 4096
|
||||
#define DEF_BUCKET_SHIFT 12 /* log2(BUCKET) */
|
||||
#define DEF_SEGSIZE 256
|
||||
#define DEF_SEGSIZE_SHIFT 8 /* log2(SEGSIZE) */
|
||||
#define DEF_DIRSIZE 256
|
||||
#define DEF_FFACTOR 65536l
|
||||
#define MIN_FFACTOR 4
|
||||
#define SPLTMAX 8
|
||||
#define CHARKEY "%$sniglet^&"
|
||||
#define NUMKEY 1038583l
|
||||
#define BYTE_SHIFT 3
|
||||
#define INT_TO_BYTE 2
|
||||
#define INT_BYTE_SHIFT 5
|
||||
#define ALL_SET ((uint32)0xFFFFFFFF)
|
||||
#define ALL_CLEAR 0
|
||||
|
||||
#define PTROF(X) ((ptrdiff_t)(X) == BUF_DISK ? 0 : (X))
|
||||
#define ISDISK(X) ((X) ? ((ptrdiff_t)(X) == BUF_DISK ? BUF_DISK \
|
||||
: (X)->is_disk) : 0)
|
||||
|
||||
#define BITS_PER_MAP 32
|
||||
|
||||
/* Given the address of the beginning of a big map, clear/set the nth bit */
|
||||
#define CLRBIT(A, N) ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
|
||||
#define SETBIT(A, N) ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
|
||||
#define ISSET(A, N) ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
|
||||
|
||||
/* Overflow management */
|
||||
/*
|
||||
* Overflow page numbers are allocated per split point. At each doubling of
|
||||
* the table, we can allocate extra pages. So, an overflow page number has
|
||||
* the top 5 bits indicate which split point and the lower 11 bits indicate
|
||||
* which page at that split point is indicated (pages within split points are
|
||||
* numberered starting with 1).
|
||||
*/
|
||||
|
||||
#define SPLITSHIFT 11
|
||||
#define SPLITMASK 0x7FF
|
||||
#define SPLITNUM(N) (((uint32)(N)) >> SPLITSHIFT)
|
||||
#define OPAGENUM(N) ((N) & SPLITMASK)
|
||||
#define OADDR_OF(S,O) ((uint32)((uint32)(S) << SPLITSHIFT) + (O))
|
||||
|
||||
#define BUCKET_TO_PAGE(B) \
|
||||
(B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__log2((uint32)((B)+1))-1] : 0)
|
||||
#define OADDR_TO_PAGE(B) \
|
||||
BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B));
|
||||
|
||||
/*
|
||||
* page.h contains a detailed description of the page format.
|
||||
*
|
||||
* Normally, keys and data are accessed from offset tables in the top of
|
||||
* each page which point to the beginning of the key and data. There are
|
||||
* four flag values which may be stored in these offset tables which indicate
|
||||
* the following:
|
||||
*
|
||||
*
|
||||
* OVFLPAGE Rather than a key data pair, this pair contains
|
||||
* the address of an overflow page. The format of
|
||||
* the pair is:
|
||||
* OVERFLOW_PAGE_NUMBER OVFLPAGE
|
||||
*
|
||||
* PARTIAL_KEY This must be the first key/data pair on a page
|
||||
* and implies that page contains only a partial key.
|
||||
* That is, the key is too big to fit on a single page
|
||||
* so it starts on this page and continues on the next.
|
||||
* The format of the page is:
|
||||
* KEY_OFF PARTIAL_KEY OVFL_PAGENO OVFLPAGE
|
||||
*
|
||||
* KEY_OFF -- offset of the beginning of the key
|
||||
* PARTIAL_KEY -- 1
|
||||
* OVFL_PAGENO - page number of the next overflow page
|
||||
* OVFLPAGE -- 0
|
||||
*
|
||||
* FULL_KEY This must be the first key/data pair on the page. It
|
||||
* is used in two cases.
|
||||
*
|
||||
* Case 1:
|
||||
* There is a complete key on the page but no data
|
||||
* (because it wouldn't fit). The next page contains
|
||||
* the data.
|
||||
*
|
||||
* Page format it:
|
||||
* KEY_OFF FULL_KEY OVFL_PAGENO OVFL_PAGE
|
||||
*
|
||||
* KEY_OFF -- offset of the beginning of the key
|
||||
* FULL_KEY -- 2
|
||||
* OVFL_PAGENO - page number of the next overflow page
|
||||
* OVFLPAGE -- 0
|
||||
*
|
||||
* Case 2:
|
||||
* This page contains no key, but part of a large
|
||||
* data field, which is continued on the next page.
|
||||
*
|
||||
* Page format it:
|
||||
* DATA_OFF FULL_KEY OVFL_PAGENO OVFL_PAGE
|
||||
*
|
||||
* KEY_OFF -- offset of the beginning of the data on
|
||||
* this page
|
||||
* FULL_KEY -- 2
|
||||
* OVFL_PAGENO - page number of the next overflow page
|
||||
* OVFLPAGE -- 0
|
||||
*
|
||||
* FULL_KEY_DATA
|
||||
* This must be the first key/data pair on the page.
|
||||
* There are two cases:
|
||||
*
|
||||
* Case 1:
|
||||
* This page contains a key and the beginning of the
|
||||
* data field, but the data field is continued on the
|
||||
* next page.
|
||||
*
|
||||
* Page format is:
|
||||
* KEY_OFF FULL_KEY_DATA OVFL_PAGENO DATA_OFF
|
||||
*
|
||||
* KEY_OFF -- offset of the beginning of the key
|
||||
* FULL_KEY_DATA -- 3
|
||||
* OVFL_PAGENO - page number of the next overflow page
|
||||
* DATA_OFF -- offset of the beginning of the data
|
||||
*
|
||||
* Case 2:
|
||||
* This page contains the last page of a big data pair.
|
||||
* There is no key, only the tail end of the data
|
||||
* on this page.
|
||||
*
|
||||
* Page format is:
|
||||
* DATA_OFF FULL_KEY_DATA <OVFL_PAGENO> <OVFLPAGE>
|
||||
*
|
||||
* DATA_OFF -- offset of the beginning of the data on
|
||||
* this page
|
||||
* FULL_KEY_DATA -- 3
|
||||
* OVFL_PAGENO - page number of the next overflow page
|
||||
* OVFLPAGE -- 0
|
||||
*
|
||||
* OVFL_PAGENO and OVFLPAGE are optional (they are
|
||||
* not present if there is no next page).
|
||||
*/
|
||||
|
||||
#define OVFLPAGE 0
|
||||
#define PARTIAL_KEY 1
|
||||
#define FULL_KEY 2
|
||||
#define FULL_KEY_DATA 3
|
||||
#define REAL_KEY 4
|
||||
|
||||
/* Short hands for accessing structure */
|
||||
#undef BSIZE
|
||||
#define BSIZE hdr.bsize
|
||||
#undef BSHIFT
|
||||
#define BSHIFT hdr.bshift
|
||||
#define DSIZE hdr.dsize
|
||||
#define SGSIZE hdr.ssize
|
||||
#define SSHIFT hdr.sshift
|
||||
#define LORDER hdr.lorder
|
||||
#define OVFL_POINT hdr.ovfl_point
|
||||
#define LAST_FREED hdr.last_freed
|
||||
#define MAX_BUCKET hdr.max_bucket
|
||||
#define FFACTOR hdr.ffactor
|
||||
#define HIGH_MASK hdr.high_mask
|
||||
#define LOW_MASK hdr.low_mask
|
||||
#define NKEYS hdr.nkeys
|
||||
#define HDRPAGES hdr.hdrpages
|
||||
#define SPARES hdr.spares
|
||||
#define BITMAPS hdr.bitmaps
|
||||
#define VERSION hdr.version
|
||||
#define MAGIC hdr.magic
|
||||
#define NEXT_FREE hdr.next_free
|
||||
#define H_CHARKEY hdr.h_charkey
|
||||
|
||||
extern uint32 (*__default_hash) (const void *, size_t);
|
||||
void __buf_init(HTAB *hashp, int32 nbytes);
|
||||
int __big_delete(HTAB *hashp, BUFHEAD *bufp);
|
||||
BUFHEAD * __get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage);
|
||||
uint32 __call_hash(HTAB *hashp, char *k, size_t len);
|
||||
#include "page.h"
|
||||
extern int __big_split(HTAB *hashp, BUFHEAD *op,BUFHEAD *np,
|
||||
BUFHEAD *big_keyp,uint32 addr,uint32 obucket, SPLIT_RETURN *ret);
|
||||
void __free_ovflpage(HTAB *hashp, BUFHEAD *obufp);
|
||||
BUFHEAD * __add_ovflpage(HTAB *hashp, BUFHEAD *bufp);
|
||||
int __big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val);
|
||||
int __expand_table(HTAB *hashp);
|
||||
uint32 __log2(uint32 num);
|
||||
void __reclaim_buf(HTAB *hashp, BUFHEAD *bp);
|
||||
int __get_page(HTAB *hashp, char * p, uint32 bucket, int is_bucket, int is_disk, int is_bitmap);
|
||||
int __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap);
|
||||
int __ibitmap(HTAB *hashp, int pnum, int nbits, int ndx);
|
||||
int __buf_free(HTAB *hashp, int do_free, int to_disk);
|
||||
int __find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size);
|
||||
uint16 __find_last_page(HTAB *hashp, BUFHEAD **bpp);
|
||||
int __addel(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT * val);
|
||||
int __big_return(HTAB *hashp, BUFHEAD *bufp, int ndx, DBT *val, int set_current);
|
||||
int __delpair(HTAB *hashp, BUFHEAD *bufp, int ndx);
|
||||
int __big_keydata(HTAB *hashp, BUFHEAD *bufp, DBT *key, DBT *val, int set);
|
||||
int __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket);
|
||||
51
mozilla/dbm/include/hsearch.h
Normal file
51
mozilla/dbm/include/hsearch.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)search.h 8.1 (Berkeley) 6/4/93
|
||||
*/
|
||||
|
||||
/* Backward compatibility to hsearch interface. */
|
||||
typedef struct entry {
|
||||
char *key;
|
||||
char *data;
|
||||
} ENTRY;
|
||||
|
||||
typedef enum {
|
||||
FIND, ENTER
|
||||
} ACTION;
|
||||
|
||||
int hcreate (unsigned int);
|
||||
void hdestroy (void);
|
||||
ENTRY *hsearch (ENTRY, ACTION);
|
||||
453
mozilla/dbm/include/mcom_db.h
Normal file
453
mozilla/dbm/include/mcom_db.h
Normal file
@@ -0,0 +1,453 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)db.h 8.7 (Berkeley) 6/16/94
|
||||
*/
|
||||
|
||||
#ifndef _DB_H_
|
||||
#define _DB_H_
|
||||
|
||||
#ifndef HAVE_SYS_CDEFS_H
|
||||
#include "cdefs.h"
|
||||
#else
|
||||
#include <cdefs.h>
|
||||
#endif
|
||||
#include "prtypes.h"
|
||||
|
||||
#ifdef HAVE_SYS_BYTEORDER_H
|
||||
#include <sys/types.h>
|
||||
#include <sys/byteorder.h>
|
||||
#endif
|
||||
|
||||
#if defined(__linux) || defined(__BEOS__)
|
||||
#include <endian.h>
|
||||
#ifndef BYTE_ORDER
|
||||
#define BYTE_ORDER __BYTE_ORDER
|
||||
#define BIG_ENDIAN __BIG_ENDIAN
|
||||
#define LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif /* __linux */
|
||||
|
||||
#ifdef __sgi
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
|
||||
#define __BIT_TYPES_DEFINED__
|
||||
#endif
|
||||
|
||||
#ifdef __sun
|
||||
#define BIG_ENDIAN 4321
|
||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
|
||||
|
||||
#ifdef HAVE_COMPAT_H
|
||||
#include <compat.h>
|
||||
#endif
|
||||
|
||||
/* XXX - dp
|
||||
* Need to find a general way of defining endian-ness in SunOS 5.3
|
||||
* SunOS 5.4 defines _BIG_ENDIAN and _LITTLE_ENDIAN
|
||||
* SunOS 5.3 does nothing like this.
|
||||
*/
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
|
||||
#if defined(_BIG_ENDIAN)
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#elif defined(_LITTLE_ENDIAN)
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#elif !defined(SVR4)
|
||||
/* 4.1.3 is always BIG_ENDIAN as it was released only on sparc platforms. */
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#elif !defined(vax) && !defined(ntohl) && !defined(lint) && !defined(i386)
|
||||
/* 5.3 big endian. Copied this above line from sys/byteorder.h */
|
||||
/* Now we are in a 5.3 SunOS rather non 5.4 or above SunOS */
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#else
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif /* !BYTE_ORDER */
|
||||
#endif /* __sun */
|
||||
|
||||
#ifdef NCR
|
||||
#include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#ifdef __QNX__
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#define BIG_ENDIAN 4321
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifdef SCO
|
||||
#include <sys/bitypes.h>
|
||||
#define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
#ifdef SNI
|
||||
/* #include <sys/hetero.h> */
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
#ifdef macintosh
|
||||
#include <unix.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WINDOWS) || defined(XP_OS2)
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifndef XP_OS2
|
||||
#define MAXPATHLEN 1024
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
|
||||
|
||||
#ifndef STDERR_FILENO
|
||||
#define STDIN_FILENO 0 /* ANSI C #defines */
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
#ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */
|
||||
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
|
||||
#endif
|
||||
|
||||
#ifdef BYTE_ORDER
|
||||
#undef BYTE_ORDER
|
||||
#endif
|
||||
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
|
||||
#if defined(_WINDOWS) && !defined(_WIN32)
|
||||
/* 16 bit windows defines */
|
||||
#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef macintosh
|
||||
#include <stdio.h>
|
||||
#include "xp_mcom.h"
|
||||
#define BIG_ENDIAN 4321
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#define O_ACCMODE 3 /* Mask for file access modes */
|
||||
#define EFTYPE 2000
|
||||
XP_BEGIN_PROTOS
|
||||
int mkstemp(const char *path);
|
||||
XP_END_PROTOS
|
||||
#endif /* MACINTOSH */
|
||||
|
||||
#if defined(XP_OS2)
|
||||
/* #include <xp_mcom.h> */
|
||||
/* XP_BEGIN_PROTOS */
|
||||
/* int mkstemp(char *path); */
|
||||
/* XP_END_PROTOS */
|
||||
#endif
|
||||
|
||||
#ifndef macintosh
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SYS_CDEFS_H
|
||||
#include "cdefs.h"
|
||||
#endif
|
||||
|
||||
#ifndef _WINDOWS /* included above to prevent spurious warnings chouck 12-Sep-95 */
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#define RET_ERROR -1 /* Return values. */
|
||||
#define RET_SUCCESS 0
|
||||
#define RET_SPECIAL 1
|
||||
|
||||
#if defined(__386BSD__) || defined(SCO)
|
||||
#define __BIT_TYPES_DEFINED__
|
||||
#endif
|
||||
|
||||
#define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
|
||||
|
||||
#ifndef __sgi
|
||||
typedef uint32 pgno_t;
|
||||
#endif
|
||||
|
||||
#define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
|
||||
typedef uint16 indx_t;
|
||||
#define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
|
||||
typedef uint32 recno_t;
|
||||
|
||||
/* define EFTYPE since most don't */
|
||||
#ifndef EFTYPE
|
||||
#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
|
||||
#endif
|
||||
|
||||
/* Key/data structure -- a Data-Base Thang. */
|
||||
typedef struct {
|
||||
void *data; /* data */
|
||||
size_t size; /* data length */
|
||||
} DBT;
|
||||
|
||||
/* Routine flags. */
|
||||
#define R_CURSOR 1 /* del, put, seq */
|
||||
#define __R_UNUSED 2 /* UNUSED */
|
||||
#define R_FIRST 3 /* seq */
|
||||
#define R_IAFTER 4 /* put (RECNO) */
|
||||
#define R_IBEFORE 5 /* put (RECNO) */
|
||||
#define R_LAST 6 /* seq (BTREE, RECNO) */
|
||||
#define R_NEXT 7 /* seq */
|
||||
#define R_NOOVERWRITE 8 /* put */
|
||||
#define R_PREV 9 /* seq (BTREE, RECNO) */
|
||||
#define R_SETCURSOR 10 /* put (RECNO) */
|
||||
#define R_RECNOSYNC 11 /* sync (RECNO) */
|
||||
|
||||
typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
|
||||
|
||||
typedef enum { LockOutDatabase, UnlockDatabase } DBLockFlagEnum;
|
||||
|
||||
/*
|
||||
* !!!
|
||||
* The following flags are included in the dbopen(3) call as part of the
|
||||
* open(2) flags. In order to avoid conflicts with the open flags, start
|
||||
* at the top of the 16 or 32-bit number space and work our way down. If
|
||||
* the open flags were significantly expanded in the future, it could be
|
||||
* a problem. Wish I'd left another flags word in the dbopen call.
|
||||
*
|
||||
* !!!
|
||||
* None of this stuff is implemented yet. The only reason that it's here
|
||||
* is so that the access methods can skip copying the key/data pair when
|
||||
* the DB_LOCK flag isn't set.
|
||||
*/
|
||||
#if UINT_MAX > 65535
|
||||
#define DB_LOCK 0x20000000 /* Do locking. */
|
||||
#define DB_SHMEM 0x40000000 /* Use shared memory. */
|
||||
#define DB_TXN 0x80000000 /* Do transactions. */
|
||||
#else
|
||||
#define DB_LOCK 0x2000 /* Do locking. */
|
||||
#define DB_SHMEM 0x4000 /* Use shared memory. */
|
||||
#define DB_TXN 0x8000 /* Do transactions. */
|
||||
#endif
|
||||
|
||||
/* Access method description structure. */
|
||||
typedef struct __db {
|
||||
DBTYPE type; /* Underlying db type. */
|
||||
int (*close) (struct __db *);
|
||||
int (*del) (const struct __db *, const DBT *, uint);
|
||||
int (*get) (const struct __db *, const DBT *, DBT *, uint);
|
||||
int (*put) (const struct __db *, DBT *, const DBT *, uint);
|
||||
int (*seq) (const struct __db *, DBT *, DBT *, uint);
|
||||
int (*sync) (const struct __db *, uint);
|
||||
void *internal; /* Access method private. */
|
||||
int (*fd) (const struct __db *);
|
||||
} DB;
|
||||
|
||||
#define BTREEMAGIC 0x053162
|
||||
#define BTREEVERSION 3
|
||||
|
||||
/* Structure used to pass parameters to the btree routines. */
|
||||
typedef struct {
|
||||
#define R_DUP 0x01 /* duplicate keys */
|
||||
uint32 flags;
|
||||
uint cachesize; /* bytes to cache */
|
||||
int maxkeypage; /* maximum keys per page */
|
||||
int minkeypage; /* minimum keys per page */
|
||||
uint psize; /* page size */
|
||||
int (*compare) /* comparison function */
|
||||
(const DBT *, const DBT *);
|
||||
size_t (*prefix) /* prefix function */
|
||||
(const DBT *, const DBT *);
|
||||
int lorder; /* byte order */
|
||||
} BTREEINFO;
|
||||
|
||||
#define HASHMAGIC 0x061561
|
||||
#define HASHVERSION 2
|
||||
|
||||
/* Structure used to pass parameters to the hashing routines. */
|
||||
typedef struct {
|
||||
uint bsize; /* bucket size */
|
||||
uint ffactor; /* fill factor */
|
||||
uint nelem; /* number of elements */
|
||||
uint cachesize; /* bytes to cache */
|
||||
uint32 /* hash function */
|
||||
(*hash) (const void *, size_t);
|
||||
int lorder; /* byte order */
|
||||
} HASHINFO;
|
||||
|
||||
/* Structure used to pass parameters to the record routines. */
|
||||
typedef struct {
|
||||
#define R_FIXEDLEN 0x01 /* fixed-length records */
|
||||
#define R_NOKEY 0x02 /* key not required */
|
||||
#define R_SNAPSHOT 0x04 /* snapshot the input */
|
||||
uint32 flags;
|
||||
uint cachesize; /* bytes to cache */
|
||||
uint psize; /* page size */
|
||||
int lorder; /* byte order */
|
||||
size_t reclen; /* record length (fixed-length records) */
|
||||
uint8 bval; /* delimiting byte (variable-length records */
|
||||
char *bfname; /* btree file name */
|
||||
} RECNOINFO;
|
||||
|
||||
/* #ifdef __DBINTERFACE_PRIVATE */
|
||||
/*
|
||||
* Little endian <==> big endian 32-bit swap macros.
|
||||
* M_32_SWAP swap a memory location
|
||||
* P_32_SWAP swap a referenced memory location
|
||||
* P_32_COPY swap from one location to another
|
||||
*/
|
||||
#define M_32_SWAP(a) { \
|
||||
uint32 _tmp = a; \
|
||||
((char *)&a)[0] = ((char *)&_tmp)[3]; \
|
||||
((char *)&a)[1] = ((char *)&_tmp)[2]; \
|
||||
((char *)&a)[2] = ((char *)&_tmp)[1]; \
|
||||
((char *)&a)[3] = ((char *)&_tmp)[0]; \
|
||||
}
|
||||
#define P_32_SWAP(a) { \
|
||||
uint32 _tmp = *(uint32 *)a; \
|
||||
((char *)a)[0] = ((char *)&_tmp)[3]; \
|
||||
((char *)a)[1] = ((char *)&_tmp)[2]; \
|
||||
((char *)a)[2] = ((char *)&_tmp)[1]; \
|
||||
((char *)a)[3] = ((char *)&_tmp)[0]; \
|
||||
}
|
||||
#define P_32_COPY(a, b) { \
|
||||
((char *)&(b))[0] = ((char *)&(a))[3]; \
|
||||
((char *)&(b))[1] = ((char *)&(a))[2]; \
|
||||
((char *)&(b))[2] = ((char *)&(a))[1]; \
|
||||
((char *)&(b))[3] = ((char *)&(a))[0]; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Little endian <==> big endian 16-bit swap macros.
|
||||
* M_16_SWAP swap a memory location
|
||||
* P_16_SWAP swap a referenced memory location
|
||||
* P_16_COPY swap from one location to another
|
||||
*/
|
||||
#define M_16_SWAP(a) { \
|
||||
uint16 _tmp = a; \
|
||||
((char *)&a)[0] = ((char *)&_tmp)[1]; \
|
||||
((char *)&a)[1] = ((char *)&_tmp)[0]; \
|
||||
}
|
||||
#define P_16_SWAP(a) { \
|
||||
uint16 _tmp = *(uint16 *)a; \
|
||||
((char *)a)[0] = ((char *)&_tmp)[1]; \
|
||||
((char *)a)[1] = ((char *)&_tmp)[0]; \
|
||||
}
|
||||
#define P_16_COPY(a, b) { \
|
||||
((char *)&(b))[0] = ((char *)&(a))[1]; \
|
||||
((char *)&(b))[1] = ((char *)&(a))[0]; \
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
__BEGIN_DECLS
|
||||
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
|
||||
extern DB *
|
||||
#else
|
||||
PR_EXTERN(DB *)
|
||||
#endif
|
||||
dbopen (const char *, int, int, DBTYPE, const void *);
|
||||
|
||||
/* set or unset a global lock flag to disable the
|
||||
* opening of any DBM file
|
||||
*/
|
||||
void dbSetOrClearDBLock(DBLockFlagEnum type);
|
||||
|
||||
/* #ifdef __DBINTERFACE_PRIVATE */
|
||||
DB *__bt_open (const char *, int, int, const BTREEINFO *, int);
|
||||
DB *__hash_open (const char *, int, int, const HASHINFO *, int);
|
||||
DB *__rec_open (const char *, int, int, const RECNOINFO *, int);
|
||||
void __dbpanic (DB *dbp);
|
||||
/* #endif */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#if defined(__hpux) || defined(__hppa)
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax, all NT risc */
|
||||
#endif
|
||||
|
||||
#if defined(AIXV3) || defined(AIX)
|
||||
/* BYTE_ORDER, LITTLE_ENDIAN, BIG_ENDIAN are all defined here */
|
||||
#include <sys/machine.h>
|
||||
#endif
|
||||
|
||||
/* Digital Unix */
|
||||
#ifdef __osf__
|
||||
#include <machine/endian.h>
|
||||
#endif
|
||||
|
||||
#ifdef __alpha
|
||||
#ifndef WIN32
|
||||
#else
|
||||
/* Alpha NT */
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !_DB_H_ */
|
||||
99
mozilla/dbm/include/mpool.h
Normal file
99
mozilla/dbm/include/mpool.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mpool.h 8.2 (Berkeley) 7/14/94
|
||||
*/
|
||||
|
||||
#include <sys/queue.h>
|
||||
|
||||
/*
|
||||
* The memory pool scheme is a simple one. Each in-memory page is referenced
|
||||
* by a bucket which is threaded in up to two of three ways. All active pages
|
||||
* are threaded on a hash chain (hashed by page number) and an lru chain.
|
||||
* Inactive pages are threaded on a free chain. Each reference to a memory
|
||||
* pool is handed an opaque MPOOL cookie which stores all of this information.
|
||||
*/
|
||||
#define HASHSIZE 128
|
||||
#define HASHKEY(pgno) ((pgno - 1) % HASHSIZE)
|
||||
|
||||
/* The BKT structures are the elements of the queues. */
|
||||
typedef struct _bkt {
|
||||
CIRCLEQ_ENTRY(_bkt) hq; /* hash queue */
|
||||
CIRCLEQ_ENTRY(_bkt) q; /* lru queue */
|
||||
void *page; /* page */
|
||||
pgno_t pgno; /* page number */
|
||||
|
||||
#define MPOOL_DIRTY 0x01 /* page needs to be written */
|
||||
#define MPOOL_PINNED 0x02 /* page is pinned into memory */
|
||||
uint8 flags; /* flags */
|
||||
} BKT;
|
||||
|
||||
typedef struct MPOOL {
|
||||
CIRCLEQ_HEAD(_lqh, _bkt) lqh; /* lru queue head */
|
||||
/* hash queue array */
|
||||
CIRCLEQ_HEAD(_hqh, _bkt) hqh[HASHSIZE];
|
||||
pgno_t curcache; /* current number of cached pages */
|
||||
pgno_t maxcache; /* max number of cached pages */
|
||||
pgno_t npages; /* number of pages in the file */
|
||||
uint32 pagesize; /* file page size */
|
||||
int fd; /* file descriptor */
|
||||
/* page in conversion routine */
|
||||
void (*pgin) (void *, pgno_t, void *);
|
||||
/* page out conversion routine */
|
||||
void (*pgout) (void *, pgno_t, void *);
|
||||
void *pgcookie; /* cookie for page in/out routines */
|
||||
#ifdef STATISTICS
|
||||
uint32 cachehit;
|
||||
uint32 cachemiss;
|
||||
uint32 pagealloc;
|
||||
uint32 pageflush;
|
||||
uint32 pageget;
|
||||
uint32 pagenew;
|
||||
uint32 pageput;
|
||||
uint32 pageread;
|
||||
uint32 pagewrite;
|
||||
#endif
|
||||
} MPOOL;
|
||||
|
||||
__BEGIN_DECLS
|
||||
MPOOL *mpool_open (void *, int, pgno_t, pgno_t);
|
||||
void mpool_filter (MPOOL *, void (*)(void *, pgno_t, void *),
|
||||
void (*)(void *, pgno_t, void *), void *);
|
||||
void *mpool_new (MPOOL *, pgno_t *);
|
||||
void *mpool_get (MPOOL *, pgno_t, uint);
|
||||
int mpool_put (MPOOL *, void *, uint);
|
||||
int mpool_sync (MPOOL *);
|
||||
int mpool_close (MPOOL *);
|
||||
#ifdef STATISTICS
|
||||
void mpool_stat (MPOOL *);
|
||||
#endif
|
||||
__END_DECLS
|
||||
232
mozilla/dbm/include/ncompat.h
Normal file
232
mozilla/dbm/include/ncompat.h
Normal file
@@ -0,0 +1,232 @@
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)compat.h 8.13 (Berkeley) 2/21/94
|
||||
*/
|
||||
|
||||
#ifndef _COMPAT_H_
|
||||
#define _COMPAT_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* If your system doesn't typedef u_long, u_short, or u_char, change
|
||||
* the 0 to a 1.
|
||||
*/
|
||||
#if 0
|
||||
typedef unsigned char u_char; /* 4.[34]BSD names. */
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
typedef unsigned short u_short;
|
||||
#endif
|
||||
|
||||
/* If your system doesn't typedef size_t, change the 0 to a 1. */
|
||||
#if 0
|
||||
typedef unsigned int size_t; /* POSIX, 4.[34]BSD names. */
|
||||
#endif
|
||||
|
||||
/* If your system doesn't typedef ssize_t, change the 0 to a 1. */
|
||||
#if 0
|
||||
typedef int ssize_t; /* POSIX names. */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If your system doesn't have the POSIX type for a signal mask,
|
||||
* change the 0 to a 1.
|
||||
*/
|
||||
#if 0 /* POSIX 1003.1 signal mask type. */
|
||||
typedef unsigned int sigset_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If your system's vsprintf returns a char *, not an int,
|
||||
* change the 0 to a 1.
|
||||
*/
|
||||
#if defined (__sun) && !defined(SVR4) /* SUNOS */
|
||||
#define VSPRINTF_CHARSTAR
|
||||
#endif
|
||||
/*
|
||||
* If you don't have POSIX 1003.1 signals, the signal code surrounding the
|
||||
* temporary file creation is intended to block all of the possible signals
|
||||
* long enough to create the file and unlink it. All of this stuff is
|
||||
* intended to use old-style BSD calls to fake POSIX 1003.1 calls.
|
||||
*/
|
||||
#ifdef NO_POSIX_SIGNALS
|
||||
#define sigemptyset(set) (*(set) = 0)
|
||||
#define sigfillset(set) (*(set) = ~(sigset_t)0, 0)
|
||||
#define sigaddset(set,signo) (*(set) |= sigmask(signo), 0)
|
||||
#define sigdelset(set,signo) (*(set) &= ~sigmask(signo), 0)
|
||||
#define sigismember(set,signo) ((*(set) & sigmask(signo)) != 0)
|
||||
|
||||
#define SIG_BLOCK 1
|
||||
#define SIG_UNBLOCK 2
|
||||
#define SIG_SETMASK 3
|
||||
|
||||
static int __sigtemp; /* For the use of sigprocmask */
|
||||
|
||||
/* Repeated test of oset != NULL is to avoid "*0". */
|
||||
#define sigprocmask(how, set, oset) \
|
||||
((__sigtemp = \
|
||||
(((how) == SIG_BLOCK) ? \
|
||||
sigblock(0) | *(set) : \
|
||||
(((how) == SIG_UNBLOCK) ? \
|
||||
sigblock(0) & ~(*(set)) : \
|
||||
((how) == SIG_SETMASK ? \
|
||||
*(set) : sigblock(0))))), \
|
||||
((oset) ? (*(oset ? oset : set) = sigsetmask(__sigtemp)) : \
|
||||
sigsetmask(__sigtemp)), 0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If your system doesn't have an include file with the appropriate
|
||||
* byte order set, make sure you specify the correct one.
|
||||
*/
|
||||
#ifndef BYTE_ORDER
|
||||
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||
#define BYTE_ORDER BIG_ENDIAN /* Set for your system. */
|
||||
#endif
|
||||
|
||||
#if defined(SYSV) || defined(SYSTEM5) || defined(__sun)
|
||||
#define index(a, b) strchr(a, b)
|
||||
#define rindex(a, b) strrchr(a, b)
|
||||
#define bzero(a, b) memset(a, 0, b)
|
||||
#define bcmp(a, b, n) memcmp(a, b, n)
|
||||
#define bcopy(a, b, n) memmove(b, a, n)
|
||||
#endif
|
||||
|
||||
#if defined(BSD) || defined(BSD4_3)
|
||||
#define strchr(a, b) index(a, b)
|
||||
#define strrchr(a, b) rindex(a, b)
|
||||
#define memcmp(a, b, n) bcmp(a, b, n)
|
||||
#define memmove(a, b, n) bcopy(b, a, n)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 32-bit machine. The db routines are theoretically independent of
|
||||
* the size of u_shorts and u_longs, but I don't know that anyone has
|
||||
* ever actually tried it. At a minimum, change the following #define's
|
||||
* if you are trying to compile on a different type of system.
|
||||
*/
|
||||
#ifndef USHRT_MAX
|
||||
#define USHRT_MAX 0xFFFF
|
||||
#define ULONG_MAX 0xFFFFFFFF
|
||||
#endif
|
||||
|
||||
#ifndef O_ACCMODE /* POSIX 1003.1 access mode mask. */
|
||||
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX2_RE_DUP_MAX /* POSIX 1003.2 RE limit. */
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If you can't provide lock values in the open(2) call. Note, this
|
||||
* allows races to happen.
|
||||
*/
|
||||
#ifndef O_EXLOCK /* 4.4BSD extension. */
|
||||
#define O_EXLOCK 0
|
||||
#endif
|
||||
|
||||
#ifndef O_SHLOCK /* 4.4BSD extension. */
|
||||
#define O_SHLOCK 0
|
||||
#endif
|
||||
|
||||
#ifndef EFTYPE
|
||||
#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */
|
||||
#endif
|
||||
|
||||
#ifndef WCOREDUMP /* 4.4BSD extension */
|
||||
#define WCOREDUMP(a) 0
|
||||
#endif
|
||||
|
||||
#ifndef STDERR_FILENO
|
||||
#define STDIN_FILENO 0 /* ANSI C #defines */
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_END
|
||||
#define SEEK_SET 0 /* POSIX 1003.1 seek values */
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX_VDISABLE /* POSIX 1003.1 disabling char. */
|
||||
#define _POSIX_VDISABLE 0 /* Some systems used 0. */
|
||||
#endif
|
||||
|
||||
#ifndef TCSASOFT /* 4.4BSD extension. */
|
||||
#define TCSASOFT 0
|
||||
#endif
|
||||
|
||||
#ifndef _POSIX2_RE_DUP_MAX /* POSIX 1003.2 values. */
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
#endif
|
||||
|
||||
#ifndef NULL /* ANSI C #defines NULL everywhere. */
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifndef MAX /* Usually found in <sys/param.h>. */
|
||||
#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a))
|
||||
#endif
|
||||
#ifndef MIN /* Usually found in <sys/param.h>. */
|
||||
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
|
||||
#endif
|
||||
|
||||
/* Default file permissions. */
|
||||
#ifndef DEFFILEMODE /* 4.4BSD extension. */
|
||||
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
|
||||
#endif
|
||||
|
||||
#ifndef __sun
|
||||
#ifndef S_ISDIR /* POSIX 1003.1 file type tests. */
|
||||
#define S_ISDIR(m) ((m & 0170000) == 0040000) /* directory */
|
||||
#define S_ISCHR(m) ((m & 0170000) == 0020000) /* char special */
|
||||
#define S_ISBLK(m) ((m & 0170000) == 0060000) /* block special */
|
||||
#define S_ISREG(m) ((m & 0170000) == 0100000) /* regular file */
|
||||
#define S_ISFIFO(m) ((m & 0170000) == 0010000) /* fifo */
|
||||
#endif
|
||||
#ifndef S_ISLNK /* BSD POSIX 1003.1 extensions */
|
||||
#define S_ISLNK(m) ((m & 0170000) == 0120000) /* symbolic link */
|
||||
#define S_ISSOCK(m) ((m & 0170000) == 0140000) /* socket */
|
||||
#endif
|
||||
#endif /* __sun */
|
||||
|
||||
/* The type of a va_list. */
|
||||
#ifndef _BSD_VA_LIST_ /* 4.4BSD #define. */
|
||||
#define _BSD_VA_LIST_ char *
|
||||
#endif
|
||||
|
||||
#endif /* !_COMPAT_H_ */
|
||||
77
mozilla/dbm/include/ndbm.h
Normal file
77
mozilla/dbm/include/ndbm.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ndbm.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _NDBM_H_
|
||||
#define _NDBM_H_
|
||||
|
||||
#include "mcom_db.h"
|
||||
|
||||
/* Map dbm interface onto db(3). */
|
||||
#define DBM_RDONLY O_RDONLY
|
||||
|
||||
/* Flags to dbm_store(). */
|
||||
#define DBM_INSERT 0
|
||||
#define DBM_REPLACE 1
|
||||
|
||||
/*
|
||||
* The db(3) support for ndbm(3) always appends this suffix to the
|
||||
* file name to avoid overwriting the user's original database.
|
||||
*/
|
||||
#define DBM_SUFFIX ".db"
|
||||
|
||||
typedef struct {
|
||||
char *dptr;
|
||||
int dsize;
|
||||
} datum;
|
||||
|
||||
typedef DB DBM;
|
||||
#define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE
|
||||
|
||||
__BEGIN_DECLS
|
||||
void dbm_close (DBM *);
|
||||
int dbm_delete (DBM *, datum);
|
||||
datum dbm_fetch (DBM *, datum);
|
||||
datum dbm_firstkey (DBM *);
|
||||
long dbm_forder (DBM *, datum);
|
||||
datum dbm_nextkey (DBM *);
|
||||
DBM *dbm_open (const char *, int, int);
|
||||
int dbm_store (DBM *, datum, datum, int);
|
||||
int dbm_dirfno (DBM *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_NDBM_H_ */
|
||||
42
mozilla/dbm/include/nsres.h
Normal file
42
mozilla/dbm/include/nsres.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef NSRES_H
|
||||
#define NSRES_H
|
||||
#include "cdefs.h"
|
||||
#include "mcom_db.h"
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* C version */
|
||||
#define NSRESHANDLE void *
|
||||
|
||||
typedef void (*NSRESTHREADFUNC)(void *);
|
||||
|
||||
typedef struct NSRESTHREADINFO
|
||||
{
|
||||
void *lock;
|
||||
NSRESTHREADFUNC fn_lock;
|
||||
NSRESTHREADFUNC fn_unlock;
|
||||
} NSRESTHREADINFO;
|
||||
|
||||
#define MAXBUFNUM 10
|
||||
#define MAXSTRINGLEN 300
|
||||
|
||||
#define NSRES_CREATE 1
|
||||
#define NSRES_OPEN 2
|
||||
|
||||
|
||||
|
||||
NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo);
|
||||
NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo);
|
||||
void NSResCloseTable(NSRESHANDLE handle);
|
||||
|
||||
char *NSResLoadString(NSRESHANDLE handle, const char * library, int32 id,
|
||||
unsigned int charsetid, char *retbuf);
|
||||
int32 NSResGetSize(NSRESHANDLE handle, const char *library, int32 id);
|
||||
int32 NSResLoadResource(NSRESHANDLE handle, const char *library, int32 id, char *retbuf);
|
||||
int NSResAddString(NSRESHANDLE handle, const char *library, int32 id, const char *string, unsigned int charset);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
96
mozilla/dbm/include/page.h
Normal file
96
mozilla/dbm/include/page.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)page.h 8.2 (Berkeley) 5/31/94
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for hashing page file format.
|
||||
*/
|
||||
|
||||
/*
|
||||
* routines dealing with a data page
|
||||
*
|
||||
* page format:
|
||||
* +------------------------------+
|
||||
* p | n | keyoff | datoff | keyoff |
|
||||
* +------------+--------+--------+
|
||||
* | datoff | free | ptr | --> |
|
||||
* +--------+---------------------+
|
||||
* | F R E E A R E A |
|
||||
* +--------------+---------------+
|
||||
* | <---- - - - | data |
|
||||
* +--------+-----+----+----------+
|
||||
* | key | data | key |
|
||||
* +--------+----------+----------+
|
||||
*
|
||||
* Pointer to the free space is always: p[p[0] + 2]
|
||||
* Amount of free space on the page is: p[p[0] + 1]
|
||||
*/
|
||||
|
||||
/*
|
||||
* How many bytes required for this pair?
|
||||
* 2 shorts in the table at the top of the page + room for the
|
||||
* key and room for the data
|
||||
*
|
||||
* We prohibit entering a pair on a page unless there is also room to append
|
||||
* an overflow page. The reason for this it that you can get in a situation
|
||||
* where a single key/data pair fits on a page, but you can't append an
|
||||
* overflow page and later you'd have to split the key/data and handle like
|
||||
* a big pair.
|
||||
* You might as well do this up front.
|
||||
*/
|
||||
#ifndef PAGE_H
|
||||
#define PAGE_H
|
||||
|
||||
#define PAIRSIZE(K,D) (2*sizeof(uint16) + (K)->size + (D)->size)
|
||||
#define BIGOVERHEAD (4*sizeof(uint16))
|
||||
#define KEYSIZE(K) (4*sizeof(uint16) + (K)->size);
|
||||
#define OVFLSIZE (2*sizeof(uint16))
|
||||
#define FREESPACE(P) ((P)[(P)[0]+1])
|
||||
#define OFFSET(P) ((P)[(P)[0]+2])
|
||||
#define PAIRFITS(P,K,D) \
|
||||
(((P)[2] >= REAL_KEY) && \
|
||||
(PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
|
||||
#define PAGE_META(N) (((N)+3) * sizeof(uint16))
|
||||
|
||||
typedef struct {
|
||||
BUFHEAD *newp;
|
||||
BUFHEAD *oldp;
|
||||
BUFHEAD *nextp;
|
||||
uint16 next_addr;
|
||||
} SPLIT_RETURN;
|
||||
#endif
|
||||
|
||||
245
mozilla/dbm/include/queue.h
Normal file
245
mozilla/dbm/include/queue.h
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)queue.h 8.3 (Berkeley) 12/13/93
|
||||
*/
|
||||
|
||||
#ifndef _QUEUE_H_
|
||||
#define _QUEUE_H_
|
||||
|
||||
/*
|
||||
* This file defines three types of data structures: lists, tail queues,
|
||||
* and circular queues.
|
||||
*
|
||||
* A list is headed by a single forward pointer (or an array of forward
|
||||
* pointers for a hash table header). The elements are doubly linked
|
||||
* so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list after
|
||||
* an existing element or at the head of the list. A list may only be
|
||||
* traversed in the forward direction.
|
||||
*
|
||||
* A tail queue is headed by a pair of pointers, one to the head of the
|
||||
* list and the other to the tail of the list. The elements are doubly
|
||||
* linked so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list after
|
||||
* an existing element, at the head of the list, or at the end of the
|
||||
* list. A tail queue may only be traversed in the forward direction.
|
||||
*
|
||||
* A circle queue is headed by a pair of pointers, one to the head of the
|
||||
* list and the other to the tail of the list. The elements are doubly
|
||||
* linked so that an arbitrary element can be removed without a need to
|
||||
* traverse the list. New elements can be added to the list before or after
|
||||
* an existing element, at the head of the list, or at the end of the list.
|
||||
* A circle queue may be traversed in either direction, but has a more
|
||||
* complex end of list detection.
|
||||
*
|
||||
* For details on the use of these macros, see the queue(3) manual page.
|
||||
*/
|
||||
|
||||
/*
|
||||
* List definitions.
|
||||
*/
|
||||
#define LIST_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *lh_first; /* first element */ \
|
||||
}
|
||||
|
||||
#define LIST_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *le_next; /* next element */ \
|
||||
struct type **le_prev; /* address of previous next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* List functions.
|
||||
*/
|
||||
#define LIST_INIT(head) { \
|
||||
(head)->lh_first = NULL; \
|
||||
}
|
||||
|
||||
#define LIST_INSERT_AFTER(listelm, elm, field) { \
|
||||
if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
|
||||
(listelm)->field.le_next->field.le_prev = \
|
||||
&(elm)->field.le_next; \
|
||||
(listelm)->field.le_next = (elm); \
|
||||
(elm)->field.le_prev = &(listelm)->field.le_next; \
|
||||
}
|
||||
|
||||
#define LIST_INSERT_HEAD(head, elm, field) { \
|
||||
if (((elm)->field.le_next = (head)->lh_first) != NULL) \
|
||||
(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
|
||||
(head)->lh_first = (elm); \
|
||||
(elm)->field.le_prev = &(head)->lh_first; \
|
||||
}
|
||||
|
||||
#define LIST_REMOVE(elm, field) { \
|
||||
if ((elm)->field.le_next != NULL) \
|
||||
(elm)->field.le_next->field.le_prev = \
|
||||
(elm)->field.le_prev; \
|
||||
*(elm)->field.le_prev = (elm)->field.le_next; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Tail queue definitions.
|
||||
*/
|
||||
#define TAILQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *tqh_first; /* first element */ \
|
||||
struct type **tqh_last; /* addr of last next element */ \
|
||||
}
|
||||
|
||||
#define TAILQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *tqe_next; /* next element */ \
|
||||
struct type **tqe_prev; /* address of previous next element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Tail queue functions.
|
||||
*/
|
||||
#define TAILQ_INIT(head) { \
|
||||
(head)->tqh_first = NULL; \
|
||||
(head)->tqh_last = &(head)->tqh_first; \
|
||||
}
|
||||
|
||||
#define TAILQ_INSERT_HEAD(head, elm, field) { \
|
||||
if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
&(elm)->field.tqe_next; \
|
||||
else \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
(head)->tqh_first = (elm); \
|
||||
(elm)->field.tqe_prev = &(head)->tqh_first; \
|
||||
}
|
||||
|
||||
#define TAILQ_INSERT_TAIL(head, elm, field) { \
|
||||
(elm)->field.tqe_next = NULL; \
|
||||
(elm)->field.tqe_prev = (head)->tqh_last; \
|
||||
*(head)->tqh_last = (elm); \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
}
|
||||
|
||||
#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
|
||||
if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
&(elm)->field.tqe_next; \
|
||||
else \
|
||||
(head)->tqh_last = &(elm)->field.tqe_next; \
|
||||
(listelm)->field.tqe_next = (elm); \
|
||||
(elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
|
||||
}
|
||||
|
||||
#define TAILQ_REMOVE(head, elm, field) { \
|
||||
if (((elm)->field.tqe_next) != NULL) \
|
||||
(elm)->field.tqe_next->field.tqe_prev = \
|
||||
(elm)->field.tqe_prev; \
|
||||
else \
|
||||
(head)->tqh_last = (elm)->field.tqe_prev; \
|
||||
*(elm)->field.tqe_prev = (elm)->field.tqe_next; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Circular queue definitions.
|
||||
*/
|
||||
#define CIRCLEQ_HEAD(name, type) \
|
||||
struct name { \
|
||||
struct type *cqh_first; /* first element */ \
|
||||
struct type *cqh_last; /* last element */ \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_ENTRY(type) \
|
||||
struct { \
|
||||
struct type *cqe_next; /* next element */ \
|
||||
struct type *cqe_prev; /* previous element */ \
|
||||
}
|
||||
|
||||
/*
|
||||
* Circular queue functions.
|
||||
*/
|
||||
#define CIRCLEQ_INIT(head) { \
|
||||
(head)->cqh_first = (void *)(head); \
|
||||
(head)->cqh_last = (void *)(head); \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
|
||||
(elm)->field.cqe_next = (listelm)->field.cqe_next; \
|
||||
(elm)->field.cqe_prev = (listelm); \
|
||||
if ((listelm)->field.cqe_next == (void *)(head)) \
|
||||
(head)->cqh_last = (elm); \
|
||||
else \
|
||||
(listelm)->field.cqe_next->field.cqe_prev = (elm); \
|
||||
(listelm)->field.cqe_next = (elm); \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
|
||||
(elm)->field.cqe_next = (listelm); \
|
||||
(elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
|
||||
if ((listelm)->field.cqe_prev == (void *)(head)) \
|
||||
(head)->cqh_first = (elm); \
|
||||
else \
|
||||
(listelm)->field.cqe_prev->field.cqe_next = (elm); \
|
||||
(listelm)->field.cqe_prev = (elm); \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
|
||||
(elm)->field.cqe_next = (head)->cqh_first; \
|
||||
(elm)->field.cqe_prev = (void *)(head); \
|
||||
if ((head)->cqh_last == (void *)(head)) \
|
||||
(head)->cqh_last = (elm); \
|
||||
else \
|
||||
(head)->cqh_first->field.cqe_prev = (elm); \
|
||||
(head)->cqh_first = (elm); \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
|
||||
(elm)->field.cqe_next = (void *)(head); \
|
||||
(elm)->field.cqe_prev = (head)->cqh_last; \
|
||||
if ((head)->cqh_first == (void *)(head)) \
|
||||
(head)->cqh_first = (elm); \
|
||||
else \
|
||||
(head)->cqh_last->field.cqe_next = (elm); \
|
||||
(head)->cqh_last = (elm); \
|
||||
}
|
||||
|
||||
#define CIRCLEQ_REMOVE(head, elm, field) { \
|
||||
if ((elm)->field.cqe_next == (void *)(head)) \
|
||||
(head)->cqh_last = (elm)->field.cqe_prev; \
|
||||
else \
|
||||
(elm)->field.cqe_next->field.cqe_prev = \
|
||||
(elm)->field.cqe_prev; \
|
||||
if ((elm)->field.cqe_prev == (void *)(head)) \
|
||||
(head)->cqh_first = (elm)->field.cqe_next; \
|
||||
else \
|
||||
(elm)->field.cqe_prev->field.cqe_next = \
|
||||
(elm)->field.cqe_next; \
|
||||
}
|
||||
#endif /* !_QUEUE_H_ */
|
||||
51
mozilla/dbm/include/search.h
Normal file
51
mozilla/dbm/include/search.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)search.h 8.1 (Berkeley) 6/4/93
|
||||
*/
|
||||
|
||||
/* Backward compatibility to hsearch interface. */
|
||||
typedef struct entry {
|
||||
char *key;
|
||||
char *data;
|
||||
} ENTRY;
|
||||
|
||||
typedef enum {
|
||||
FIND, ENTER
|
||||
} ACTION;
|
||||
|
||||
int hcreate (unsigned int);
|
||||
void hdestroy (void);
|
||||
ENTRY *hsearch (ENTRY, ACTION);
|
||||
26
mozilla/dbm/include/watcomfx.h
Normal file
26
mozilla/dbm/include/watcomfx.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
|
||||
#ifndef __WATCOM_FIX_H__
|
||||
#define __WATCOM_FIX_H__ 1
|
||||
/*
|
||||
* WATCOM's C compiler doesn't default to "__cdecl" conventions for external
|
||||
* symbols and functions. Rather than adding an explicit __cdecl modifier to
|
||||
* every external symbol and function declaration and definition, we use the
|
||||
* following pragma to (attempt to) change WATCOM c's default to __cdecl.
|
||||
* These pragmas were taken from pages 180-181, 266 & 269 of the
|
||||
* Watcom C/C++ version 11 User's Guide, 3rd edition.
|
||||
*/
|
||||
#if defined(XP_WIN16) || defined(WIN16)
|
||||
#pragma aux default "_*" \
|
||||
parm caller [] \
|
||||
value struct float struct routine [ax] \
|
||||
modify [ax bx cx dx es]
|
||||
#else
|
||||
#pragma aux default "_*" \
|
||||
parm caller [] \
|
||||
value struct float struct routine [eax] \
|
||||
modify [eax ecx edx]
|
||||
#endif
|
||||
#pragma aux default far
|
||||
|
||||
#endif /* once */
|
||||
#endif /* WATCOM compiler */
|
||||
106
mozilla/dbm/include/winfile.h
Normal file
106
mozilla/dbm/include/winfile.h
Normal file
@@ -0,0 +1,106 @@
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Stuff to fake unix file I/O on windows boxes
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef WINFILE_H
|
||||
#define WINFILE_H
|
||||
|
||||
#ifdef _WINDOWS
|
||||
/* hacked out of <dirent.h> on an SGI */
|
||||
#if defined(XP_WIN32) || defined(_WIN32)
|
||||
/* 32-bit stuff here */
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef __MINGW32__
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#else
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#endif
|
||||
|
||||
typedef struct DIR_Struct {
|
||||
void * directoryPtr;
|
||||
WIN32_FIND_DATA data;
|
||||
} DIR;
|
||||
|
||||
#define _ST_FSTYPSZ 16
|
||||
|
||||
#if !defined(__BORLANDC__) && !defined(__GNUC__)
|
||||
typedef unsigned long mode_t;
|
||||
typedef long uid_t;
|
||||
typedef long gid_t;
|
||||
typedef long off_t;
|
||||
typedef unsigned long nlink_t;
|
||||
#endif
|
||||
|
||||
typedef struct timestruc {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* and nanoseconds */
|
||||
} timestruc_t;
|
||||
|
||||
|
||||
struct dirent { /* data from readdir() */
|
||||
ino_t d_ino; /* inode number of entry */
|
||||
off_t d_off; /* offset of disk direntory entry */
|
||||
unsigned short d_reclen; /* length of this record */
|
||||
char d_name[_MAX_FNAME]; /* name of file */
|
||||
};
|
||||
|
||||
#if !defined(__BORLANDC__) && !defined (__GNUC__)
|
||||
#define S_ISDIR(s) ((s) & _S_IFDIR)
|
||||
#endif
|
||||
|
||||
#else /* _WIN32 */
|
||||
/* 16-bit windows stuff */
|
||||
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
#include <dos.h>
|
||||
|
||||
|
||||
|
||||
/* Getting cocky to support multiple file systems */
|
||||
typedef struct dirStruct_tag {
|
||||
struct _find_t file_data;
|
||||
char c_checkdrive;
|
||||
} dirStruct;
|
||||
|
||||
typedef struct DIR_Struct {
|
||||
void * directoryPtr;
|
||||
dirStruct data;
|
||||
} DIR;
|
||||
|
||||
#define _ST_FSTYPSZ 16
|
||||
typedef unsigned long mode_t;
|
||||
typedef long uid_t;
|
||||
typedef long gid_t;
|
||||
typedef long off_t;
|
||||
typedef unsigned long nlink_t;
|
||||
|
||||
typedef struct timestruc {
|
||||
time_t tv_sec; /* seconds */
|
||||
long tv_nsec; /* and nanoseconds */
|
||||
} timestruc_t;
|
||||
|
||||
struct dirent { /* data from readdir() */
|
||||
ino_t d_ino; /* inode number of entry */
|
||||
off_t d_off; /* offset of disk direntory entry */
|
||||
unsigned short d_reclen; /* length of this record */
|
||||
#ifdef XP_WIN32
|
||||
char d_name[_MAX_FNAME]; /* name of file */
|
||||
#else
|
||||
char d_name[20]; /* name of file */
|
||||
#endif
|
||||
};
|
||||
|
||||
#define S_ISDIR(s) ((s) & _S_IFDIR)
|
||||
|
||||
#endif /* 16-bit windows */
|
||||
|
||||
#define CONST const
|
||||
|
||||
#endif /* _WINDOWS */
|
||||
|
||||
#endif /* WINFILE_H */
|
||||
33
mozilla/dbm/macbuild/DBM.Prefix
Normal file
33
mozilla/dbm/macbuild/DBM.Prefix
Normal file
@@ -0,0 +1,33 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
//
|
||||
// DBM.Prefix
|
||||
//
|
||||
// Global prefix file for the non-debug DBM project.
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#include "MacPrefix.h"
|
||||
#include "DBMConfig.h"
|
||||
|
||||
BIN
mozilla/dbm/macbuild/DBM.mcp
Normal file
BIN
mozilla/dbm/macbuild/DBM.mcp
Normal file
Binary file not shown.
23
mozilla/dbm/macbuild/DBMConfig.h
Normal file
23
mozilla/dbm/macbuild/DBMConfig.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
/* Nothing to do here. If you need DBM-specific defines, put them here */
|
||||
32
mozilla/dbm/macbuild/DBMDebug.Prefix
Normal file
32
mozilla/dbm/macbuild/DBMDebug.Prefix
Normal file
@@ -0,0 +1,32 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
//
|
||||
// DBMDebug.Prefix
|
||||
//
|
||||
// Global prefix file for the debug DBM project.
|
||||
//
|
||||
//
|
||||
|
||||
#include "MacPrefix_debug.h"
|
||||
#include "DBMConfig.h"
|
||||
|
||||
8
mozilla/dbm/macbuild/macstubs.c
Normal file
8
mozilla/dbm/macbuild/macstubs.c
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
// Hack to define a never-called routine from libdbm
|
||||
#include "mcom_db.h"
|
||||
|
||||
int mkstemp(const char* /*path*/)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
38
mozilla/dbm/makefile.win
Normal file
38
mozilla/dbm/makefile.win
Normal file
@@ -0,0 +1,38 @@
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
|
||||
#// (these must come before the common makefiles are included)
|
||||
#//
|
||||
#// DIRS - There are subdirectories to process
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DIRS = include src
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
70
mozilla/dbm/src/Makefile.in
Normal file
70
mozilla/dbm/src/Makefile.in
Normal file
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
LIBRARY_NAME = mozdbm_s
|
||||
LIB_IS_C_ONLY = 1
|
||||
|
||||
CSRCS = \
|
||||
db.c \
|
||||
h_bigkey.c \
|
||||
h_func.c \
|
||||
h_log2.c \
|
||||
h_page.c \
|
||||
hash.c \
|
||||
hash_buf.c \
|
||||
hsearch.c \
|
||||
mktemp.c \
|
||||
ndbm.c \
|
||||
strerror.c \
|
||||
nsres.c \
|
||||
$(NULL)
|
||||
|
||||
ifeq (,$(filter -DHAVE_MEMMOVE=1,$(DEFS)))
|
||||
CSRC += memmove.c
|
||||
endif
|
||||
|
||||
ifeq (,$(filter -DHAVE_SNPRINTF=1,$(DEFS)))
|
||||
CSRC += snprintf.c
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir)/../include
|
||||
|
||||
override NO_SHARED_LIB=1
|
||||
override NO_STATIC_LIB=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -DMEMMOVE -D__DBINTERFACE_PRIVATE $(SECURITY_FLAG)
|
||||
ifeq ($(OS_ARCH), Linux)
|
||||
DEFINES += -D_BSD_SOURCE
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
OS_LIBS += -lc_r
|
||||
endif
|
||||
|
||||
96
mozilla/dbm/src/Makefile.win
Normal file
96
mozilla/dbm/src/Makefile.win
Normal file
@@ -0,0 +1,96 @@
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build the cert library
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
!ifndef MOZ_DEBUG
|
||||
OPTIMIZER=-Os -UDEBUG -DNDEBUG
|
||||
!endif
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..
|
||||
|
||||
!ifndef MAKE_OBJ_TYPE
|
||||
MAKE_OBJ_TYPE=EXE
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBNAME=dbm$(MOZ_BITS)
|
||||
PDBFILE=$(LIBNAME).pdb
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\db.obj \
|
||||
.\$(OBJDIR)\h_bigkey.obj \
|
||||
.\$(OBJDIR)\h_func.obj \
|
||||
.\$(OBJDIR)\h_log2.obj \
|
||||
.\$(OBJDIR)\h_page.obj \
|
||||
.\$(OBJDIR)\hash.obj \
|
||||
.\$(OBJDIR)\hash_buf.obj \
|
||||
.\$(OBJDIR)\hsearch.obj \
|
||||
.\$(OBJDIR)\memmove.obj \
|
||||
.\$(OBJDIR)\mktemp.obj \
|
||||
.\$(OBJDIR)\ndbm.obj \
|
||||
.\$(OBJDIR)\snprintf.obj \
|
||||
.\$(OBJDIR)\strerror.obj \
|
||||
.\$(OBJDIR)\nsres.obj \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBNAME).lib
|
||||
LINCS = -I..\include
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
|
||||
144
mozilla/dbm/src/db.c
Normal file
144
mozilla/dbm/src/db.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#ifndef __DBINTERFACE_PRIVATE
|
||||
#define __DBINTERFACE_PRIVATE
|
||||
#endif
|
||||
#ifdef macintosh
|
||||
#include <unix.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "mcom_db.h"
|
||||
|
||||
/* a global flag that locks closed all databases */
|
||||
int all_databases_locked_closed = 0;
|
||||
|
||||
/* set or unset a global lock flag to disable the
|
||||
* opening of any DBM file
|
||||
*/
|
||||
void
|
||||
dbSetOrClearDBLock(DBLockFlagEnum type)
|
||||
{
|
||||
if(type == LockOutDatabase)
|
||||
all_databases_locked_closed = 1;
|
||||
else
|
||||
all_databases_locked_closed = 0;
|
||||
}
|
||||
|
||||
#if defined(__WATCOMC__) || defined(__WATCOM_CPLUSPLUS__)
|
||||
DB *
|
||||
#else
|
||||
PR_IMPLEMENT(DB *)
|
||||
#endif
|
||||
dbopen(const char *fname, int flags,int mode, DBTYPE type, const void *openinfo)
|
||||
{
|
||||
|
||||
/* lock out all file databases. Let in-memory databases through
|
||||
*/
|
||||
if(all_databases_locked_closed && fname)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
|
||||
|
||||
|
||||
#if 0 /* most systems dont have EXLOCK and SHLOCK */
|
||||
#define USE_OPEN_FLAGS \
|
||||
(O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY | \
|
||||
O_RDWR | O_SHLOCK | O_TRUNC)
|
||||
#else
|
||||
#define USE_OPEN_FLAGS \
|
||||
(O_CREAT | O_EXCL | O_RDONLY | \
|
||||
O_RDWR | O_TRUNC)
|
||||
#endif
|
||||
|
||||
if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0)
|
||||
switch (type) {
|
||||
/* we don't need btree and recno right now */
|
||||
#if 0
|
||||
case DB_BTREE:
|
||||
return (__bt_open(fname, flags & USE_OPEN_FLAGS,
|
||||
mode, openinfo, flags & DB_FLAGS));
|
||||
case DB_RECNO:
|
||||
return (__rec_open(fname, flags & USE_OPEN_FLAGS,
|
||||
mode, openinfo, flags & DB_FLAGS));
|
||||
#endif
|
||||
|
||||
case DB_HASH:
|
||||
return (__hash_open(fname, flags & USE_OPEN_FLAGS,
|
||||
mode, (const HASHINFO *)openinfo, flags & DB_FLAGS));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
__dberr()
|
||||
{
|
||||
return (RET_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* __DBPANIC -- Stop.
|
||||
*
|
||||
* Parameters:
|
||||
* dbp: pointer to the DB structure.
|
||||
*/
|
||||
void
|
||||
__dbpanic(DB *dbp)
|
||||
{
|
||||
/* The only thing that can succeed is a close. */
|
||||
dbp->del = (int (*)(const struct __db *, const DBT *, uint))__dberr;
|
||||
dbp->fd = (int (*)(const struct __db *))__dberr;
|
||||
dbp->get = (int (*)(const struct __db *, const DBT *, DBT *, uint))__dberr;
|
||||
dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, uint))__dberr;
|
||||
dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, uint))__dberr;
|
||||
dbp->sync = (int (*)(const struct __db *, uint))__dberr;
|
||||
}
|
||||
677
mozilla/dbm/src/h_bigkey.c
Normal file
677
mozilla/dbm/src/h_bigkey.c
Normal file
@@ -0,0 +1,677 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)hash_bigkey.c 8.3 (Berkeley) 5/31/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
/*
|
||||
* PACKAGE: hash
|
||||
* DESCRIPTION:
|
||||
* Big key/data handling for the hashing package.
|
||||
*
|
||||
* ROUTINES:
|
||||
* External
|
||||
* __big_keydata
|
||||
* __big_split
|
||||
* __big_insert
|
||||
* __big_return
|
||||
* __big_delete
|
||||
* __find_last_page
|
||||
* Internal
|
||||
* collect_key
|
||||
* collect_data
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#include "mcom_db.h"
|
||||
#include "hash.h"
|
||||
#include "page.h"
|
||||
/* #include "extern.h" */
|
||||
|
||||
static int collect_key __P((HTAB *, BUFHEAD *, int, DBT *, int));
|
||||
static int collect_data __P((HTAB *, BUFHEAD *, int, int));
|
||||
|
||||
/*
|
||||
* Big_insert
|
||||
*
|
||||
* You need to do an insert and the key/data pair is too big
|
||||
*
|
||||
* Returns:
|
||||
* 0 ==> OK
|
||||
*-1 ==> ERROR
|
||||
*/
|
||||
extern int
|
||||
__big_insert(HTAB *hashp, BUFHEAD *bufp, const DBT *key, const DBT *val)
|
||||
{
|
||||
register uint16 *p;
|
||||
uint key_size, n, val_size;
|
||||
uint16 space, move_bytes, off;
|
||||
char *cp, *key_data, *val_data;
|
||||
|
||||
cp = bufp->page; /* Character pointer of p. */
|
||||
p = (uint16 *)cp;
|
||||
|
||||
key_data = (char *)key->data;
|
||||
key_size = key->size;
|
||||
val_data = (char *)val->data;
|
||||
val_size = val->size;
|
||||
|
||||
/* First move the Key */
|
||||
for (space = FREESPACE(p) - BIGOVERHEAD; key_size;
|
||||
space = FREESPACE(p) - BIGOVERHEAD) {
|
||||
move_bytes = PR_MIN(space, key_size);
|
||||
off = OFFSET(p) - move_bytes;
|
||||
memmove(cp + off, key_data, move_bytes);
|
||||
key_size -= move_bytes;
|
||||
key_data += move_bytes;
|
||||
n = p[0];
|
||||
p[++n] = off;
|
||||
p[0] = ++n;
|
||||
FREESPACE(p) = off - PAGE_META(n);
|
||||
OFFSET(p) = off;
|
||||
p[n] = PARTIAL_KEY;
|
||||
bufp = __add_ovflpage(hashp, bufp);
|
||||
if (!bufp)
|
||||
return (-1);
|
||||
n = p[0];
|
||||
if (!key_size) {
|
||||
if (FREESPACE(p)) {
|
||||
move_bytes = PR_MIN(FREESPACE(p), val_size);
|
||||
off = OFFSET(p) - move_bytes;
|
||||
p[n] = off;
|
||||
memmove(cp + off, val_data, move_bytes);
|
||||
val_data += move_bytes;
|
||||
val_size -= move_bytes;
|
||||
p[n - 2] = FULL_KEY_DATA;
|
||||
FREESPACE(p) = FREESPACE(p) - move_bytes;
|
||||
OFFSET(p) = off;
|
||||
} else
|
||||
p[n - 2] = FULL_KEY;
|
||||
}
|
||||
p = (uint16 *)bufp->page;
|
||||
cp = bufp->page;
|
||||
bufp->flags |= BUF_MOD;
|
||||
}
|
||||
|
||||
/* Now move the data */
|
||||
for (space = FREESPACE(p) - BIGOVERHEAD; val_size;
|
||||
space = FREESPACE(p) - BIGOVERHEAD) {
|
||||
move_bytes = PR_MIN(space, val_size);
|
||||
/*
|
||||
* Here's the hack to make sure that if the data ends on the
|
||||
* same page as the key ends, FREESPACE is at least one.
|
||||
*/
|
||||
if (space == val_size && val_size == val->size)
|
||||
move_bytes--;
|
||||
off = OFFSET(p) - move_bytes;
|
||||
memmove(cp + off, val_data, move_bytes);
|
||||
val_size -= move_bytes;
|
||||
val_data += move_bytes;
|
||||
n = p[0];
|
||||
p[++n] = off;
|
||||
p[0] = ++n;
|
||||
FREESPACE(p) = off - PAGE_META(n);
|
||||
OFFSET(p) = off;
|
||||
if (val_size) {
|
||||
p[n] = FULL_KEY;
|
||||
bufp = __add_ovflpage(hashp, bufp);
|
||||
if (!bufp)
|
||||
return (-1);
|
||||
cp = bufp->page;
|
||||
p = (uint16 *)cp;
|
||||
} else
|
||||
p[n] = FULL_KEY_DATA;
|
||||
bufp->flags |= BUF_MOD;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when bufp's page contains a partial key (index should be 1)
|
||||
*
|
||||
* All pages in the big key/data pair except bufp are freed. We cannot
|
||||
* free bufp because the page pointing to it is lost and we can't get rid
|
||||
* of its pointer.
|
||||
*
|
||||
* Returns:
|
||||
* 0 => OK
|
||||
*-1 => ERROR
|
||||
*/
|
||||
extern int
|
||||
__big_delete(HTAB *hashp, BUFHEAD *bufp)
|
||||
{
|
||||
register BUFHEAD *last_bfp, *rbufp;
|
||||
uint16 *bp, pageno;
|
||||
int key_done, n;
|
||||
|
||||
rbufp = bufp;
|
||||
last_bfp = NULL;
|
||||
bp = (uint16 *)bufp->page;
|
||||
pageno = 0;
|
||||
key_done = 0;
|
||||
|
||||
while (!key_done || (bp[2] != FULL_KEY_DATA)) {
|
||||
if (bp[2] == FULL_KEY || bp[2] == FULL_KEY_DATA)
|
||||
key_done = 1;
|
||||
|
||||
/*
|
||||
* If there is freespace left on a FULL_KEY_DATA page, then
|
||||
* the data is short and fits entirely on this page, and this
|
||||
* is the last page.
|
||||
*/
|
||||
if (bp[2] == FULL_KEY_DATA && FREESPACE(bp))
|
||||
break;
|
||||
pageno = bp[bp[0] - 1];
|
||||
rbufp->flags |= BUF_MOD;
|
||||
rbufp = __get_buf(hashp, pageno, rbufp, 0);
|
||||
if (last_bfp)
|
||||
__free_ovflpage(hashp, last_bfp);
|
||||
last_bfp = rbufp;
|
||||
if (!rbufp)
|
||||
return (-1); /* Error. */
|
||||
bp = (uint16 *)rbufp->page;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we get here then rbufp points to the last page of the big
|
||||
* key/data pair. Bufp points to the first one -- it should now be
|
||||
* empty pointing to the next page after this pair. Can't free it
|
||||
* because we don't have the page pointing to it.
|
||||
*/
|
||||
|
||||
/* This is information from the last page of the pair. */
|
||||
n = bp[0];
|
||||
pageno = bp[n - 1];
|
||||
|
||||
/* Now, bp is the first page of the pair. */
|
||||
bp = (uint16 *)bufp->page;
|
||||
if (n > 2) {
|
||||
/* There is an overflow page. */
|
||||
bp[1] = pageno;
|
||||
bp[2] = OVFLPAGE;
|
||||
bufp->ovfl = rbufp->ovfl;
|
||||
} else
|
||||
/* This is the last page. */
|
||||
bufp->ovfl = NULL;
|
||||
n -= 2;
|
||||
bp[0] = n;
|
||||
FREESPACE(bp) = hashp->BSIZE - PAGE_META(n);
|
||||
OFFSET(bp) = hashp->BSIZE - 1;
|
||||
|
||||
bufp->flags |= BUF_MOD;
|
||||
if (rbufp)
|
||||
__free_ovflpage(hashp, rbufp);
|
||||
if (last_bfp != rbufp)
|
||||
__free_ovflpage(hashp, last_bfp);
|
||||
|
||||
hashp->NKEYS--;
|
||||
return (0);
|
||||
}
|
||||
/*
|
||||
* Returns:
|
||||
* 0 = key not found
|
||||
* -1 = get next overflow page
|
||||
* -2 means key not found and this is big key/data
|
||||
* -3 error
|
||||
*/
|
||||
extern int
|
||||
__find_bigpair(HTAB *hashp, BUFHEAD *bufp, int ndx, char *key, int size)
|
||||
{
|
||||
register uint16 *bp;
|
||||
register char *p;
|
||||
int ksize;
|
||||
uint16 bytes;
|
||||
char *kkey;
|
||||
|
||||
bp = (uint16 *)bufp->page;
|
||||
p = bufp->page;
|
||||
ksize = size;
|
||||
kkey = key;
|
||||
|
||||
for (bytes = hashp->BSIZE - bp[ndx];
|
||||
bytes <= size && bp[ndx + 1] == PARTIAL_KEY;
|
||||
bytes = hashp->BSIZE - bp[ndx]) {
|
||||
if (memcmp(p + bp[ndx], kkey, bytes))
|
||||
return (-2);
|
||||
kkey += bytes;
|
||||
ksize -= bytes;
|
||||
bufp = __get_buf(hashp, bp[ndx + 2], bufp, 0);
|
||||
if (!bufp)
|
||||
return (-3);
|
||||
p = bufp->page;
|
||||
bp = (uint16 *)p;
|
||||
ndx = 1;
|
||||
}
|
||||
|
||||
if (bytes != ksize || memcmp(p + bp[ndx], kkey, bytes)) {
|
||||
#ifdef HASH_STATISTICS
|
||||
++hash_collisions;
|
||||
#endif
|
||||
return (-2);
|
||||
} else
|
||||
return (ndx);
|
||||
}
|
||||
|
||||
/*
|
||||
* Given the buffer pointer of the first overflow page of a big pair,
|
||||
* find the end of the big pair
|
||||
*
|
||||
* This will set bpp to the buffer header of the last page of the big pair.
|
||||
* It will return the pageno of the overflow page following the last page
|
||||
* of the pair; 0 if there isn't any (i.e. big pair is the last key in the
|
||||
* bucket)
|
||||
*/
|
||||
extern uint16
|
||||
__find_last_page(HTAB *hashp, BUFHEAD **bpp)
|
||||
{
|
||||
BUFHEAD *bufp;
|
||||
uint16 *bp, pageno;
|
||||
uint n;
|
||||
|
||||
bufp = *bpp;
|
||||
bp = (uint16 *)bufp->page;
|
||||
for (;;) {
|
||||
n = bp[0];
|
||||
|
||||
/*
|
||||
* This is the last page if: the tag is FULL_KEY_DATA and
|
||||
* either only 2 entries OVFLPAGE marker is explicit there
|
||||
* is freespace on the page.
|
||||
*/
|
||||
if (bp[2] == FULL_KEY_DATA &&
|
||||
((n == 2) || (bp[n] == OVFLPAGE) || (FREESPACE(bp))))
|
||||
break;
|
||||
|
||||
/* LJM bound the size of n to reasonable limits
|
||||
*/
|
||||
if(n > hashp->BSIZE/sizeof(uint16))
|
||||
return(0);
|
||||
|
||||
pageno = bp[n - 1];
|
||||
bufp = __get_buf(hashp, pageno, bufp, 0);
|
||||
if (!bufp)
|
||||
return (0); /* Need to indicate an error! */
|
||||
bp = (uint16 *)bufp->page;
|
||||
}
|
||||
|
||||
*bpp = bufp;
|
||||
if (bp[0] > 2)
|
||||
return (bp[3]);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the data for the key/data pair that begins on this page at this
|
||||
* index (index should always be 1).
|
||||
*/
|
||||
extern int
|
||||
__big_return(
|
||||
HTAB *hashp,
|
||||
BUFHEAD *bufp,
|
||||
int ndx,
|
||||
DBT *val,
|
||||
int set_current)
|
||||
{
|
||||
BUFHEAD *save_p;
|
||||
uint16 *bp, len, off, save_addr;
|
||||
char *tp;
|
||||
|
||||
bp = (uint16 *)bufp->page;
|
||||
while (bp[ndx + 1] == PARTIAL_KEY) {
|
||||
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
|
||||
if (!bufp)
|
||||
return (-1);
|
||||
bp = (uint16 *)bufp->page;
|
||||
ndx = 1;
|
||||
}
|
||||
|
||||
if (bp[ndx + 1] == FULL_KEY) {
|
||||
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
|
||||
if (!bufp)
|
||||
return (-1);
|
||||
bp = (uint16 *)bufp->page;
|
||||
save_p = bufp;
|
||||
save_addr = save_p->addr;
|
||||
off = bp[1];
|
||||
len = 0;
|
||||
} else
|
||||
if (!FREESPACE(bp)) {
|
||||
/*
|
||||
* This is a hack. We can't distinguish between
|
||||
* FULL_KEY_DATA that contains complete data or
|
||||
* incomplete data, so we require that if the data
|
||||
* is complete, there is at least 1 byte of free
|
||||
* space left.
|
||||
*/
|
||||
off = bp[bp[0]];
|
||||
len = bp[1] - off;
|
||||
save_p = bufp;
|
||||
save_addr = bufp->addr;
|
||||
bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
|
||||
if (!bufp)
|
||||
return (-1);
|
||||
bp = (uint16 *)bufp->page;
|
||||
} else {
|
||||
/* The data is all on one page. */
|
||||
tp = (char *)bp;
|
||||
off = bp[bp[0]];
|
||||
val->data = (uint8 *)tp + off;
|
||||
val->size = bp[1] - off;
|
||||
if (set_current) {
|
||||
if (bp[0] == 2) { /* No more buckets in
|
||||
* chain */
|
||||
hashp->cpage = NULL;
|
||||
hashp->cbucket++;
|
||||
hashp->cndx = 1;
|
||||
} else {
|
||||
hashp->cpage = __get_buf(hashp,
|
||||
bp[bp[0] - 1], bufp, 0);
|
||||
if (!hashp->cpage)
|
||||
return (-1);
|
||||
hashp->cndx = 1;
|
||||
if (!((uint16 *)
|
||||
hashp->cpage->page)[0]) {
|
||||
hashp->cbucket++;
|
||||
hashp->cpage = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
val->size = collect_data(hashp, bufp, (int)len, set_current);
|
||||
if ((val->size + 1) == 0) /* unsigned ints are not really negative */
|
||||
return (-1);
|
||||
if (save_p->addr != save_addr) {
|
||||
/* We are pretty short on buffers. */
|
||||
errno = EINVAL; /* OUT OF BUFFERS */
|
||||
return (-1);
|
||||
}
|
||||
memmove(hashp->tmp_buf, (save_p->page) + off, len);
|
||||
val->data = (uint8 *)hashp->tmp_buf;
|
||||
return (0);
|
||||
}
|
||||
/*
|
||||
* Count how big the total datasize is by recursing through the pages. Then
|
||||
* allocate a buffer and copy the data as you recurse up.
|
||||
*/
|
||||
static int
|
||||
collect_data(
|
||||
HTAB *hashp,
|
||||
BUFHEAD *bufp,
|
||||
int len, int set)
|
||||
{
|
||||
register uint16 *bp;
|
||||
register char *p;
|
||||
BUFHEAD *xbp;
|
||||
uint16 save_addr;
|
||||
int mylen, totlen;
|
||||
|
||||
p = bufp->page;
|
||||
bp = (uint16 *)p;
|
||||
mylen = hashp->BSIZE - bp[1];
|
||||
|
||||
/* if mylen ever goes negative it means that the
|
||||
* page is screwed up.
|
||||
*/
|
||||
if(mylen < 0)
|
||||
return (-1);
|
||||
|
||||
save_addr = bufp->addr;
|
||||
|
||||
if (bp[2] == FULL_KEY_DATA) { /* End of Data */
|
||||
totlen = len + mylen;
|
||||
if (hashp->tmp_buf)
|
||||
free(hashp->tmp_buf);
|
||||
if ((hashp->tmp_buf = (char *)malloc((size_t)totlen)) == NULL)
|
||||
return (-1);
|
||||
if (set) {
|
||||
hashp->cndx = 1;
|
||||
if (bp[0] == 2) { /* No more buckets in chain */
|
||||
hashp->cpage = NULL;
|
||||
hashp->cbucket++;
|
||||
} else {
|
||||
hashp->cpage =
|
||||
__get_buf(hashp, bp[bp[0] - 1], bufp, 0);
|
||||
if (!hashp->cpage)
|
||||
return (-1);
|
||||
else if (!((uint16 *)hashp->cpage->page)[0]) {
|
||||
hashp->cbucket++;
|
||||
hashp->cpage = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
xbp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
|
||||
if (!xbp || ((totlen =
|
||||
collect_data(hashp, xbp, len + mylen, set)) < 1))
|
||||
return (-1);
|
||||
}
|
||||
if (bufp->addr != save_addr) {
|
||||
errno = EINVAL; /* Out of buffers. */
|
||||
return (-1);
|
||||
}
|
||||
memmove(&hashp->tmp_buf[len], (bufp->page) + bp[1], (size_t)mylen);
|
||||
return (totlen);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill in the key and data for this big pair.
|
||||
*/
|
||||
extern int
|
||||
__big_keydata(
|
||||
HTAB *hashp,
|
||||
BUFHEAD *bufp,
|
||||
DBT *key, DBT *val,
|
||||
int set)
|
||||
{
|
||||
key->size = collect_key(hashp, bufp, 0, val, set);
|
||||
if ((key->size + 1) == 0) /* same compile warning about comparing signed and unsigned */
|
||||
return (-1);
|
||||
key->data = (uint8 *)hashp->tmp_key;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Count how big the total key size is by recursing through the pages. Then
|
||||
* collect the data, allocate a buffer and copy the key as you recurse up.
|
||||
*/
|
||||
static int
|
||||
collect_key(
|
||||
HTAB *hashp,
|
||||
BUFHEAD *bufp,
|
||||
int len,
|
||||
DBT *val,
|
||||
int set)
|
||||
{
|
||||
BUFHEAD *xbp;
|
||||
char *p;
|
||||
int mylen, totlen;
|
||||
uint16 *bp, save_addr;
|
||||
|
||||
p = bufp->page;
|
||||
bp = (uint16 *)p;
|
||||
mylen = hashp->BSIZE - bp[1];
|
||||
|
||||
save_addr = bufp->addr;
|
||||
totlen = len + mylen;
|
||||
if (bp[2] == FULL_KEY || bp[2] == FULL_KEY_DATA) { /* End of Key. */
|
||||
if (hashp->tmp_key != NULL)
|
||||
free(hashp->tmp_key);
|
||||
if ((hashp->tmp_key = (char *)malloc((size_t)totlen)) == NULL)
|
||||
return (-1);
|
||||
if (__big_return(hashp, bufp, 1, val, set))
|
||||
return (-1);
|
||||
} else {
|
||||
xbp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
|
||||
if (!xbp || ((totlen =
|
||||
collect_key(hashp, xbp, totlen, val, set)) < 1))
|
||||
return (-1);
|
||||
}
|
||||
if (bufp->addr != save_addr) {
|
||||
errno = EINVAL; /* MIS -- OUT OF BUFFERS */
|
||||
return (-1);
|
||||
}
|
||||
memmove(&hashp->tmp_key[len], (bufp->page) + bp[1], (size_t)mylen);
|
||||
return (totlen);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* 0 => OK
|
||||
* -1 => error
|
||||
*/
|
||||
extern int
|
||||
__big_split(
|
||||
HTAB *hashp,
|
||||
BUFHEAD *op, /* Pointer to where to put keys that go in old bucket */
|
||||
BUFHEAD *np, /* Pointer to new bucket page */
|
||||
/* Pointer to first page containing the big key/data */
|
||||
BUFHEAD *big_keyp,
|
||||
uint32 addr, /* Address of big_keyp */
|
||||
uint32 obucket,/* Old Bucket */
|
||||
SPLIT_RETURN *ret)
|
||||
{
|
||||
register BUFHEAD *tmpp;
|
||||
register uint16 *tp;
|
||||
BUFHEAD *bp;
|
||||
DBT key, val;
|
||||
uint32 change;
|
||||
uint16 free_space, n, off;
|
||||
|
||||
bp = big_keyp;
|
||||
|
||||
/* Now figure out where the big key/data goes */
|
||||
if (__big_keydata(hashp, big_keyp, &key, &val, 0))
|
||||
return (-1);
|
||||
change = (__call_hash(hashp,(char*) key.data, key.size) != obucket);
|
||||
|
||||
if ((ret->next_addr = __find_last_page(hashp, &big_keyp))) {
|
||||
if (!(ret->nextp =
|
||||
__get_buf(hashp, ret->next_addr, big_keyp, 0)))
|
||||
return (-1);;
|
||||
} else
|
||||
ret->nextp = NULL;
|
||||
|
||||
/* Now make one of np/op point to the big key/data pair */
|
||||
#ifdef DEBUG
|
||||
assert(np->ovfl == NULL);
|
||||
#endif
|
||||
if (change)
|
||||
tmpp = np;
|
||||
else
|
||||
tmpp = op;
|
||||
|
||||
tmpp->flags |= BUF_MOD;
|
||||
#ifdef DEBUG1
|
||||
(void)fprintf(stderr,
|
||||
"BIG_SPLIT: %d->ovfl was %d is now %d\n", tmpp->addr,
|
||||
(tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
|
||||
#endif
|
||||
tmpp->ovfl = bp; /* one of op/np point to big_keyp */
|
||||
tp = (uint16 *)tmpp->page;
|
||||
|
||||
|
||||
#if 0 /* this get's tripped on database corrupted error */
|
||||
assert(FREESPACE(tp) >= OVFLSIZE);
|
||||
#endif
|
||||
if(FREESPACE(tp) < OVFLSIZE)
|
||||
return(DATABASE_CORRUPTED_ERROR);
|
||||
|
||||
n = tp[0];
|
||||
off = OFFSET(tp);
|
||||
free_space = FREESPACE(tp);
|
||||
tp[++n] = (uint16)addr;
|
||||
tp[++n] = OVFLPAGE;
|
||||
tp[0] = n;
|
||||
OFFSET(tp) = off;
|
||||
FREESPACE(tp) = free_space - OVFLSIZE;
|
||||
|
||||
/*
|
||||
* Finally, set the new and old return values. BIG_KEYP contains a
|
||||
* pointer to the last page of the big key_data pair. Make sure that
|
||||
* big_keyp has no following page (2 elements) or create an empty
|
||||
* following page.
|
||||
*/
|
||||
|
||||
ret->newp = np;
|
||||
ret->oldp = op;
|
||||
|
||||
tp = (uint16 *)big_keyp->page;
|
||||
big_keyp->flags |= BUF_MOD;
|
||||
if (tp[0] > 2) {
|
||||
/*
|
||||
* There may be either one or two offsets on this page. If
|
||||
* there is one, then the overflow page is linked on normally
|
||||
* and tp[4] is OVFLPAGE. If there are two, tp[4] contains
|
||||
* the second offset and needs to get stuffed in after the
|
||||
* next overflow page is added.
|
||||
*/
|
||||
n = tp[4];
|
||||
free_space = FREESPACE(tp);
|
||||
off = OFFSET(tp);
|
||||
tp[0] -= 2;
|
||||
FREESPACE(tp) = free_space + OVFLSIZE;
|
||||
OFFSET(tp) = off;
|
||||
tmpp = __add_ovflpage(hashp, big_keyp);
|
||||
if (!tmpp)
|
||||
return (-1);
|
||||
tp[4] = n;
|
||||
} else
|
||||
tmpp = big_keyp;
|
||||
|
||||
if (change)
|
||||
ret->newp = tmpp;
|
||||
else
|
||||
ret->oldp = tmpp;
|
||||
return (0);
|
||||
}
|
||||
211
mozilla/dbm/src/h_func.c
Normal file
211
mozilla/dbm/src/h_func.c
Normal file
@@ -0,0 +1,211 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)hash_func.c 8.2 (Berkeley) 2/21/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#ifndef macintosh
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include "mcom_db.h"
|
||||
#include "hash.h"
|
||||
#include "page.h"
|
||||
/* #include "extern.h" */
|
||||
|
||||
#if 0
|
||||
static uint32 hash1 __P((const void *, size_t));
|
||||
static uint32 hash2 __P((const void *, size_t));
|
||||
static uint32 hash3 __P((const void *, size_t));
|
||||
#endif
|
||||
static uint32 hash4 __P((const void *, size_t));
|
||||
|
||||
/* Global default hash function */
|
||||
uint32 (*__default_hash) __P((const void *, size_t)) = hash4;
|
||||
|
||||
/*
|
||||
* HASH FUNCTIONS
|
||||
*
|
||||
* Assume that we've already split the bucket to which this key hashes,
|
||||
* calculate that bucket, and check that in fact we did already split it.
|
||||
*
|
||||
* This came from ejb's hsearch.
|
||||
*/
|
||||
|
||||
#define PRIME1 37
|
||||
#define PRIME2 1048583
|
||||
|
||||
#if 0
|
||||
static uint32
|
||||
hash1(const void *keyarg, register size_t len)
|
||||
{
|
||||
register const uint8 *key;
|
||||
register uint32 h;
|
||||
|
||||
/* Convert string to integer */
|
||||
for (key = (const uint8 *)keyarg, h = 0; len--;)
|
||||
h = h * PRIME1 ^ (*key++ - ' ');
|
||||
h %= PRIME2;
|
||||
return (h);
|
||||
}
|
||||
|
||||
/*
|
||||
* Phong's linear congruential hash
|
||||
*/
|
||||
#define dcharhash(h, c) ((h) = 0x63c63cd9*(h) + 0x9c39c33d + (c))
|
||||
|
||||
static uint32
|
||||
hash2(const void *keyarg, size_t len)
|
||||
{
|
||||
register const uint8 *e, *key;
|
||||
register uint32 h;
|
||||
register uint8 c;
|
||||
|
||||
key = (const uint8 *)keyarg;
|
||||
e = key + len;
|
||||
for (h = 0; key != e;) {
|
||||
c = *key++;
|
||||
if (!c && key > e)
|
||||
break;
|
||||
dcharhash(h, c);
|
||||
}
|
||||
return (h);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is INCREDIBLY ugly, but fast. We break the string up into 8 byte
|
||||
* units. On the first time through the loop we get the "leftover bytes"
|
||||
* (strlen % 8). On every other iteration, we perform 8 HASHC's so we handle
|
||||
* all 8 bytes. Essentially, this saves us 7 cmp & branch instructions. If
|
||||
* this routine is heavily used enough, it's worth the ugly coding.
|
||||
*
|
||||
* OZ's original sdbm hash
|
||||
*/
|
||||
static uint32
|
||||
hash3(const void *keyarg, register size_t len)
|
||||
{
|
||||
register const uint8 *key;
|
||||
register size_t loop;
|
||||
register uint32 h;
|
||||
|
||||
#define HASHC h = *key++ + 65599 * h
|
||||
|
||||
h = 0;
|
||||
key = (const uint8 *)keyarg;
|
||||
if (len > 0) {
|
||||
loop = (len + 8 - 1) >> 3;
|
||||
|
||||
switch (len & (8 - 1)) {
|
||||
case 0:
|
||||
do {
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 7:
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 6:
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 5:
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 4:
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 3:
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 2:
|
||||
HASHC;
|
||||
/* FALLTHROUGH */
|
||||
case 1:
|
||||
HASHC;
|
||||
} while (--loop);
|
||||
}
|
||||
}
|
||||
return (h);
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
/* Hash function from Chris Torek. */
|
||||
static uint32
|
||||
hash4(const void *keyarg, register size_t len)
|
||||
{
|
||||
register const uint8 *key;
|
||||
register size_t loop;
|
||||
register uint32 h;
|
||||
|
||||
#define HASH4a h = (h << 5) - h + *key++;
|
||||
#define HASH4b h = (h << 5) + h + *key++;
|
||||
#define HASH4 HASH4b
|
||||
|
||||
h = 0;
|
||||
key = (const uint8 *)keyarg;
|
||||
if (len > 0) {
|
||||
loop = (len + 8 - 1) >> 3;
|
||||
|
||||
switch (len & (8 - 1)) {
|
||||
case 0:
|
||||
do {
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 7:
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 6:
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 5:
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 4:
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 3:
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 2:
|
||||
HASH4;
|
||||
/* FALLTHROUGH */
|
||||
case 1:
|
||||
HASH4;
|
||||
} while (--loop);
|
||||
}
|
||||
}
|
||||
return (h);
|
||||
}
|
||||
56
mozilla/dbm/src/h_log2.c
Normal file
56
mozilla/dbm/src/h_log2.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)hash_log2.c 8.2 (Berkeley) 5/31/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#ifndef macintosh
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include "mcom_db.h"
|
||||
|
||||
uint32 __log2(uint32 num)
|
||||
{
|
||||
register uint32 i, limit;
|
||||
|
||||
limit = 1;
|
||||
for (i = 0; limit < num; limit = limit << 1, i++) {}
|
||||
return (i);
|
||||
}
|
||||
1284
mozilla/dbm/src/h_page.c
Normal file
1284
mozilla/dbm/src/h_page.c
Normal file
File diff suppressed because it is too large
Load Diff
1258
mozilla/dbm/src/hash.c
Normal file
1258
mozilla/dbm/src/hash.c
Normal file
File diff suppressed because it is too large
Load Diff
408
mozilla/dbm/src/hash_buf.c
Normal file
408
mozilla/dbm/src/hash_buf.c
Normal file
@@ -0,0 +1,408 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)hash_buf.c 8.5 (Berkeley) 7/15/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
/*
|
||||
* PACKAGE: hash
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* Contains buffer management
|
||||
*
|
||||
* ROUTINES:
|
||||
* External
|
||||
* __buf_init
|
||||
* __get_buf
|
||||
* __buf_free
|
||||
* __reclaim_buf
|
||||
* Internal
|
||||
* newbuf
|
||||
*/
|
||||
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#include "mcom_db.h"
|
||||
#include "hash.h"
|
||||
#include "page.h"
|
||||
/* #include "extern.h" */
|
||||
|
||||
static BUFHEAD *newbuf __P((HTAB *, uint32, BUFHEAD *));
|
||||
|
||||
/* Unlink B from its place in the lru */
|
||||
#define BUF_REMOVE(B) { \
|
||||
(B)->prev->next = (B)->next; \
|
||||
(B)->next->prev = (B)->prev; \
|
||||
}
|
||||
|
||||
/* Insert B after P */
|
||||
#define BUF_INSERT(B, P) { \
|
||||
(B)->next = (P)->next; \
|
||||
(B)->prev = (P); \
|
||||
(P)->next = (B); \
|
||||
(B)->next->prev = (B); \
|
||||
}
|
||||
|
||||
#define MRU hashp->bufhead.next
|
||||
#define LRU hashp->bufhead.prev
|
||||
|
||||
#define MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead)
|
||||
#define LRU_INSERT(B) BUF_INSERT((B), LRU)
|
||||
|
||||
/*
|
||||
* We are looking for a buffer with address "addr". If prev_bp is NULL, then
|
||||
* address is a bucket index. If prev_bp is not NULL, then it points to the
|
||||
* page previous to an overflow page that we are trying to find.
|
||||
*
|
||||
* CAVEAT: The buffer header accessed via prev_bp's ovfl field may no longer
|
||||
* be valid. Therefore, you must always verify that its address matches the
|
||||
* address you are seeking.
|
||||
*/
|
||||
extern BUFHEAD *
|
||||
__get_buf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp, int newpage)
|
||||
/* If prev_bp set, indicates a new overflow page. */
|
||||
{
|
||||
register BUFHEAD *bp;
|
||||
register uint32 is_disk_mask;
|
||||
register int is_disk, segment_ndx = 0;
|
||||
SEGMENT segp = 0;
|
||||
|
||||
is_disk = 0;
|
||||
is_disk_mask = 0;
|
||||
if (prev_bp) {
|
||||
bp = prev_bp->ovfl;
|
||||
if (!bp || (bp->addr != addr))
|
||||
bp = NULL;
|
||||
if (!newpage)
|
||||
is_disk = BUF_DISK;
|
||||
} else {
|
||||
/* Grab buffer out of directory */
|
||||
segment_ndx = addr & (hashp->SGSIZE - 1);
|
||||
|
||||
/* valid segment ensured by __call_hash() */
|
||||
segp = hashp->dir[addr >> hashp->SSHIFT];
|
||||
#ifdef DEBUG
|
||||
assert(segp != NULL);
|
||||
#endif
|
||||
|
||||
bp = PTROF(segp[segment_ndx]);
|
||||
|
||||
is_disk_mask = ISDISK(segp[segment_ndx]);
|
||||
is_disk = is_disk_mask || !hashp->new_file;
|
||||
}
|
||||
|
||||
if (!bp) {
|
||||
bp = newbuf(hashp, addr, prev_bp);
|
||||
if (!bp)
|
||||
return(NULL);
|
||||
if(__get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0))
|
||||
{
|
||||
/* free bp and its page */
|
||||
if(prev_bp)
|
||||
{
|
||||
/* if prev_bp is set then the new page that
|
||||
* failed is hooked onto prev_bp as an overflow page.
|
||||
* if we don't remove the pointer to the bad page
|
||||
* we may try and access it later and we will die
|
||||
* horribly because it will have already been
|
||||
* free'd and overwritten with bogus data.
|
||||
*/
|
||||
prev_bp->ovfl = NULL;
|
||||
}
|
||||
BUF_REMOVE(bp);
|
||||
free(bp->page);
|
||||
free(bp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (!prev_bp)
|
||||
{
|
||||
#if 0
|
||||
/* 16 bit windows and mac can't handle the
|
||||
* oring of the is disk flag.
|
||||
*/
|
||||
segp[segment_ndx] =
|
||||
(BUFHEAD *)((ptrdiff_t)bp | is_disk_mask);
|
||||
#else
|
||||
/* set the is_disk thing inside the structure
|
||||
*/
|
||||
bp->is_disk = is_disk_mask;
|
||||
segp[segment_ndx] = bp;
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
BUF_REMOVE(bp);
|
||||
MRU_INSERT(bp);
|
||||
}
|
||||
return (bp);
|
||||
}
|
||||
|
||||
/*
|
||||
* We need a buffer for this page. Either allocate one, or evict a resident
|
||||
* one (if we have as many buffers as we're allowed) and put this one in.
|
||||
*
|
||||
* If newbuf finds an error (returning NULL), it also sets errno.
|
||||
*/
|
||||
static BUFHEAD *
|
||||
newbuf(HTAB *hashp, uint32 addr, BUFHEAD *prev_bp)
|
||||
{
|
||||
register BUFHEAD *bp; /* The buffer we're going to use */
|
||||
register BUFHEAD *xbp; /* Temp pointer */
|
||||
register BUFHEAD *next_xbp;
|
||||
SEGMENT segp;
|
||||
int segment_ndx;
|
||||
uint16 oaddr, *shortp;
|
||||
|
||||
oaddr = 0;
|
||||
bp = LRU;
|
||||
/*
|
||||
* If LRU buffer is pinned, the buffer pool is too small. We need to
|
||||
* allocate more buffers.
|
||||
*/
|
||||
if (hashp->nbufs || (bp->flags & BUF_PIN)) {
|
||||
/* Allocate a new one */
|
||||
if ((bp = (BUFHEAD *)malloc(sizeof(BUFHEAD))) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/* this memset is supposedly unnecessary but lets add
|
||||
* it anyways.
|
||||
*/
|
||||
memset(bp, 0xff, sizeof(BUFHEAD));
|
||||
|
||||
if ((bp->page = (char *)malloc((size_t)hashp->BSIZE)) == NULL) {
|
||||
free(bp);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* this memset is supposedly unnecessary but lets add
|
||||
* it anyways.
|
||||
*/
|
||||
memset(bp->page, 0xff, (size_t)hashp->BSIZE);
|
||||
|
||||
if (hashp->nbufs)
|
||||
hashp->nbufs--;
|
||||
} else {
|
||||
/* Kick someone out */
|
||||
BUF_REMOVE(bp);
|
||||
/*
|
||||
* If this is an overflow page with addr 0, it's already been
|
||||
* flushed back in an overflow chain and initialized.
|
||||
*/
|
||||
if ((bp->addr != 0) || (bp->flags & BUF_BUCKET)) {
|
||||
/*
|
||||
* Set oaddr before __put_page so that you get it
|
||||
* before bytes are swapped.
|
||||
*/
|
||||
shortp = (uint16 *)bp->page;
|
||||
if (shortp[0])
|
||||
{
|
||||
if(shortp[0] > (hashp->BSIZE / sizeof(uint16)))
|
||||
{
|
||||
return(NULL);
|
||||
}
|
||||
oaddr = shortp[shortp[0] - 1];
|
||||
}
|
||||
if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
|
||||
bp->addr, (int)IS_BUCKET(bp->flags), 0))
|
||||
return (NULL);
|
||||
/*
|
||||
* Update the pointer to this page (i.e. invalidate it).
|
||||
*
|
||||
* If this is a new file (i.e. we created it at open
|
||||
* time), make sure that we mark pages which have been
|
||||
* written to disk so we retrieve them from disk later,
|
||||
* rather than allocating new pages.
|
||||
*/
|
||||
if (IS_BUCKET(bp->flags)) {
|
||||
segment_ndx = bp->addr & (hashp->SGSIZE - 1);
|
||||
segp = hashp->dir[bp->addr >> hashp->SSHIFT];
|
||||
#ifdef DEBUG
|
||||
assert(segp != NULL);
|
||||
#endif
|
||||
|
||||
if (hashp->new_file &&
|
||||
((bp->flags & BUF_MOD) ||
|
||||
ISDISK(segp[segment_ndx])))
|
||||
segp[segment_ndx] = (BUFHEAD *)BUF_DISK;
|
||||
else
|
||||
segp[segment_ndx] = NULL;
|
||||
}
|
||||
/*
|
||||
* Since overflow pages can only be access by means of
|
||||
* their bucket, free overflow pages associated with
|
||||
* this bucket.
|
||||
*/
|
||||
for (xbp = bp; xbp->ovfl;) {
|
||||
next_xbp = xbp->ovfl;
|
||||
xbp->ovfl = 0;
|
||||
xbp = next_xbp;
|
||||
|
||||
/* Check that ovfl pointer is up date. */
|
||||
if (IS_BUCKET(xbp->flags) ||
|
||||
(oaddr != xbp->addr))
|
||||
break;
|
||||
|
||||
shortp = (uint16 *)xbp->page;
|
||||
if (shortp[0])
|
||||
{
|
||||
/* LJM is the number of reported
|
||||
* pages way too much?
|
||||
*/
|
||||
if(shortp[0] > hashp->BSIZE/sizeof(uint16))
|
||||
return NULL;
|
||||
/* set before __put_page */
|
||||
oaddr = shortp[shortp[0] - 1];
|
||||
}
|
||||
if ((xbp->flags & BUF_MOD) && __put_page(hashp,
|
||||
xbp->page, xbp->addr, 0, 0))
|
||||
return (NULL);
|
||||
xbp->addr = 0;
|
||||
xbp->flags = 0;
|
||||
BUF_REMOVE(xbp);
|
||||
LRU_INSERT(xbp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now assign this buffer */
|
||||
bp->addr = addr;
|
||||
#ifdef DEBUG1
|
||||
(void)fprintf(stderr, "NEWBUF1: %d->ovfl was %d is now %d\n",
|
||||
bp->addr, (bp->ovfl ? bp->ovfl->addr : 0), 0);
|
||||
#endif
|
||||
bp->ovfl = NULL;
|
||||
if (prev_bp) {
|
||||
/*
|
||||
* If prev_bp is set, this is an overflow page, hook it in to
|
||||
* the buffer overflow links.
|
||||
*/
|
||||
#ifdef DEBUG1
|
||||
(void)fprintf(stderr, "NEWBUF2: %d->ovfl was %d is now %d\n",
|
||||
prev_bp->addr, (prev_bp->ovfl ? bp->ovfl->addr : 0),
|
||||
(bp ? bp->addr : 0));
|
||||
#endif
|
||||
prev_bp->ovfl = bp;
|
||||
bp->flags = 0;
|
||||
} else
|
||||
bp->flags = BUF_BUCKET;
|
||||
MRU_INSERT(bp);
|
||||
return (bp);
|
||||
}
|
||||
|
||||
extern void __buf_init(HTAB *hashp, int32 nbytes)
|
||||
{
|
||||
BUFHEAD *bfp;
|
||||
int npages;
|
||||
|
||||
bfp = &(hashp->bufhead);
|
||||
npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT;
|
||||
npages = PR_MAX(npages, MIN_BUFFERS);
|
||||
|
||||
hashp->nbufs = npages;
|
||||
bfp->next = bfp;
|
||||
bfp->prev = bfp;
|
||||
/*
|
||||
* This space is calloc'd so these are already null.
|
||||
*
|
||||
* bfp->ovfl = NULL;
|
||||
* bfp->flags = 0;
|
||||
* bfp->page = NULL;
|
||||
* bfp->addr = 0;
|
||||
*/
|
||||
}
|
||||
|
||||
extern int
|
||||
__buf_free(HTAB *hashp, int do_free, int to_disk)
|
||||
{
|
||||
BUFHEAD *bp;
|
||||
int status = -1;
|
||||
|
||||
/* Need to make sure that buffer manager has been initialized */
|
||||
if (!LRU)
|
||||
return (0);
|
||||
for (bp = LRU; bp != &hashp->bufhead;) {
|
||||
/* Check that the buffer is valid */
|
||||
if (bp->addr || IS_BUCKET(bp->flags)) {
|
||||
if (to_disk && (bp->flags & BUF_MOD) &&
|
||||
(status = __put_page(hashp, bp->page,
|
||||
bp->addr, IS_BUCKET(bp->flags), 0))) {
|
||||
|
||||
if (do_free) {
|
||||
if (bp->page)
|
||||
free(bp->page);
|
||||
BUF_REMOVE(bp);
|
||||
free(bp);
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
}
|
||||
/* Check if we are freeing stuff */
|
||||
if (do_free) {
|
||||
if (bp->page)
|
||||
free(bp->page);
|
||||
BUF_REMOVE(bp);
|
||||
free(bp);
|
||||
bp = LRU;
|
||||
} else
|
||||
bp = bp->prev;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
extern void
|
||||
__reclaim_buf(HTAB *hashp, BUFHEAD *bp)
|
||||
{
|
||||
bp->ovfl = 0;
|
||||
bp->addr = 0;
|
||||
bp->flags = 0;
|
||||
BUF_REMOVE(bp);
|
||||
LRU_INSERT(bp);
|
||||
}
|
||||
108
mozilla/dbm/src/hsearch.c
Normal file
108
mozilla/dbm/src/hsearch.c
Normal file
@@ -0,0 +1,108 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)hsearch.c 8.4 (Berkeley) 7/21/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#ifndef macintosh
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mcom_db.h"
|
||||
#include "hsearch.h"
|
||||
|
||||
static DB *dbp = NULL;
|
||||
static ENTRY retval;
|
||||
|
||||
extern int
|
||||
hcreate(uint nel)
|
||||
{
|
||||
HASHINFO info;
|
||||
|
||||
info.nelem = nel;
|
||||
info.bsize = 256;
|
||||
info.ffactor = 8;
|
||||
info.cachesize = 0;
|
||||
info.hash = NULL;
|
||||
info.lorder = 0;
|
||||
dbp = (DB *)__hash_open(NULL, O_CREAT | O_RDWR, 0600, &info, 0);
|
||||
return ((int)dbp);
|
||||
}
|
||||
|
||||
extern ENTRY *
|
||||
hsearch(ENTRY item, ACTION action)
|
||||
{
|
||||
DBT key, val;
|
||||
int status;
|
||||
|
||||
if (!dbp)
|
||||
return (NULL);
|
||||
key.data = (uint8 *)item.key;
|
||||
key.size = strlen(item.key) + 1;
|
||||
|
||||
if (action == ENTER) {
|
||||
val.data = (uint8 *)item.data;
|
||||
val.size = strlen(item.data) + 1;
|
||||
status = (dbp->put)(dbp, &key, &val, R_NOOVERWRITE);
|
||||
if (status)
|
||||
return (NULL);
|
||||
} else {
|
||||
/* FIND */
|
||||
status = (dbp->get)(dbp, &key, &val, 0);
|
||||
if (status)
|
||||
return (NULL);
|
||||
else
|
||||
item.data = (char *)val.data;
|
||||
}
|
||||
retval.key = item.key;
|
||||
retval.data = item.data;
|
||||
return (&retval);
|
||||
}
|
||||
|
||||
extern void
|
||||
hdestroy()
|
||||
{
|
||||
if (dbp) {
|
||||
(void)(dbp->close)(dbp);
|
||||
dbp = NULL;
|
||||
}
|
||||
}
|
||||
150
mozilla/dbm/src/memmove.c
Normal file
150
mozilla/dbm/src/memmove.c
Normal file
@@ -0,0 +1,150 @@
|
||||
#if defined(__sun) && !defined(__svr4__)
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Chris Torek.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#ifdef HAVE_SYS_CDEFS_H
|
||||
#include <sys/cdefs.h>
|
||||
#else
|
||||
#include "cdefs.h"
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* sizeof(word) MUST BE A POWER OF TWO
|
||||
* SO THAT wmask BELOW IS ALL ONES
|
||||
*/
|
||||
typedef int word; /* "word" used for optimal copy speed */
|
||||
|
||||
#define wsize sizeof(word)
|
||||
#define wmask (wsize - 1)
|
||||
|
||||
/*
|
||||
* Copy a block of memory, handling overlap.
|
||||
* This is the routine that actually implements
|
||||
* (the portable versions of) bcopy, memcpy, and memmove.
|
||||
*/
|
||||
#ifdef MEMCOPY
|
||||
void *
|
||||
memcpy(dst0, src0, length)
|
||||
#else
|
||||
#ifdef MEMMOVE
|
||||
void *
|
||||
memmove(dst0, src0, length)
|
||||
#else
|
||||
void
|
||||
bcopy(src0, dst0, length)
|
||||
#endif
|
||||
#endif
|
||||
void *dst0;
|
||||
const void *src0;
|
||||
register size_t length;
|
||||
{
|
||||
register char *dst = dst0;
|
||||
register const char *src = src0;
|
||||
register size_t t;
|
||||
|
||||
if (length == 0 || dst == src) /* nothing to do */
|
||||
goto done;
|
||||
|
||||
/*
|
||||
* Macros: loop-t-times; and loop-t-times, t>0
|
||||
*/
|
||||
#define TLOOP(s) if (t) TLOOP1(s)
|
||||
#define TLOOP1(s) do { s; } while (--t)
|
||||
|
||||
if ((unsigned long)dst < (unsigned long)src) {
|
||||
/*
|
||||
* Copy forward.
|
||||
*/
|
||||
t = (int)src; /* only need low bits */
|
||||
if ((t | (int)dst) & wmask) {
|
||||
/*
|
||||
* Try to align operands. This cannot be done
|
||||
* unless the low bits match.
|
||||
*/
|
||||
if ((t ^ (int)dst) & wmask || length < wsize)
|
||||
t = length;
|
||||
else
|
||||
t = wsize - (t & wmask);
|
||||
length -= t;
|
||||
TLOOP1(*dst++ = *src++);
|
||||
}
|
||||
/*
|
||||
* Copy whole words, then mop up any trailing bytes.
|
||||
*/
|
||||
t = length / wsize;
|
||||
TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize);
|
||||
t = length & wmask;
|
||||
TLOOP(*dst++ = *src++);
|
||||
} else {
|
||||
/*
|
||||
* Copy backwards. Otherwise essentially the same.
|
||||
* Alignment works as before, except that it takes
|
||||
* (t&wmask) bytes to align, not wsize-(t&wmask).
|
||||
*/
|
||||
src += length;
|
||||
dst += length;
|
||||
t = (int)src;
|
||||
if ((t | (int)dst) & wmask) {
|
||||
if ((t ^ (int)dst) & wmask || length <= wsize)
|
||||
t = length;
|
||||
else
|
||||
t &= wmask;
|
||||
length -= t;
|
||||
TLOOP1(*--dst = *--src);
|
||||
}
|
||||
t = length / wsize;
|
||||
TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src);
|
||||
t = length & wmask;
|
||||
TLOOP(*--dst = *--src);
|
||||
}
|
||||
done:
|
||||
#if defined(MEMCOPY) || defined(MEMMOVE)
|
||||
return (dst0);
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
#endif /* no __sgi */
|
||||
|
||||
/* Some compilers don't like an empty source file. */
|
||||
static int dummy = 0;
|
||||
162
mozilla/dbm/src/mktemp.c
Normal file
162
mozilla/dbm/src/mktemp.c
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (c) 1987, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#ifdef macintosh
|
||||
#include <unix.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include "mcom_db.h"
|
||||
|
||||
#if !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef XP_OS2_VACPP
|
||||
#define ENOTDIR EBADPOS
|
||||
#include <process.h>
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <process.h>
|
||||
#include "winfile.h"
|
||||
#endif
|
||||
|
||||
static int _gettemp(char *path, register int *doopen, int extraFlags);
|
||||
|
||||
int
|
||||
mkstemp(char *path)
|
||||
{
|
||||
int fd;
|
||||
|
||||
return (_gettemp(path, &fd, 0) ? fd : -1);
|
||||
}
|
||||
|
||||
int
|
||||
mkstempflags(char *path, int extraFlags)
|
||||
{
|
||||
int fd;
|
||||
|
||||
return (_gettemp(path, &fd, extraFlags) ? fd : -1);
|
||||
}
|
||||
|
||||
char *
|
||||
mktemp(char *path)
|
||||
{
|
||||
return(_gettemp(path, (int *)NULL, 0) ? path : (char *)NULL);
|
||||
}
|
||||
|
||||
/* NB: This routine modifies its input string, and does not always restore it.
|
||||
** returns 1 on success, 0 on failure.
|
||||
*/
|
||||
static int
|
||||
_gettemp(char *path, register int *doopen, int extraFlags)
|
||||
{
|
||||
#if !defined(_WINDOWS) || defined(_WIN32)
|
||||
extern int errno;
|
||||
#endif
|
||||
register char *start, *trv;
|
||||
struct stat sbuf;
|
||||
unsigned int pid;
|
||||
|
||||
pid = getpid();
|
||||
for (trv = path; *trv; ++trv); /* extra X's get set to 0's */
|
||||
while (*--trv == 'X') {
|
||||
*trv = (pid % 10) + '0';
|
||||
pid /= 10;
|
||||
}
|
||||
|
||||
/*
|
||||
* check the target directory; if you have six X's and it
|
||||
* doesn't exist this runs for a *very* long time.
|
||||
*/
|
||||
for (start = trv + 1;; --trv) {
|
||||
char saved;
|
||||
if (trv <= path)
|
||||
break;
|
||||
saved = *trv;
|
||||
if (saved == '/' || saved == '\\') {
|
||||
int rv;
|
||||
*trv = '\0';
|
||||
rv = stat(path, &sbuf);
|
||||
*trv = saved;
|
||||
if (rv)
|
||||
return(0);
|
||||
if (!S_ISDIR(sbuf.st_mode)) {
|
||||
errno = ENOTDIR;
|
||||
return(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (doopen) {
|
||||
if ((*doopen =
|
||||
open(path, O_CREAT|O_EXCL|O_RDWR|extraFlags, 0600)) >= 0)
|
||||
return(1);
|
||||
if (errno != EEXIST)
|
||||
return(0);
|
||||
}
|
||||
else if (stat(path, &sbuf))
|
||||
return(errno == ENOENT ? 1 : 0);
|
||||
|
||||
/* tricky little algorithm for backward compatibility */
|
||||
for (trv = start;;) {
|
||||
if (!*trv)
|
||||
return(0);
|
||||
if (*trv == 'z')
|
||||
*trv++ = 'a';
|
||||
else {
|
||||
if (isdigit(*trv))
|
||||
*trv = 'a';
|
||||
else
|
||||
++*trv;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
195
mozilla/dbm/src/ndbm.c
Normal file
195
mozilla/dbm/src/ndbm.c
Normal file
@@ -0,0 +1,195 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Margo Seltzer.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
/*
|
||||
* This package provides a dbm compatible interface to the new hashing
|
||||
* package described in db(3).
|
||||
*/
|
||||
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if defined(__linux)
|
||||
#include <linux/limits.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ndbm.h"
|
||||
#include "hash.h"
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* *DBM on success
|
||||
* NULL on failure
|
||||
*/
|
||||
extern DBM *
|
||||
dbm_open(const char *file, int flags, int mode)
|
||||
{
|
||||
HASHINFO info;
|
||||
char path[MAXPATHLEN];
|
||||
|
||||
info.bsize = 4096;
|
||||
info.ffactor = 40;
|
||||
info.nelem = 1;
|
||||
info.cachesize = 0;
|
||||
info.hash = NULL;
|
||||
info.lorder = 0;
|
||||
(void)strcpy(path, file);
|
||||
(void)strcat(path, DBM_SUFFIX);
|
||||
return ((DBM *)__hash_open(path, flags, mode, &info, 0));
|
||||
}
|
||||
|
||||
extern void
|
||||
dbm_close(DBM *db)
|
||||
{
|
||||
(void)(db->close)(db);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* DATUM on success
|
||||
* NULL on failure
|
||||
*/
|
||||
extern datum
|
||||
dbm_fetch(DBM *db, datum key)
|
||||
{
|
||||
datum retval;
|
||||
int status;
|
||||
|
||||
status = (db->get)(db, (DBT *)&key, (DBT *)&retval, 0);
|
||||
if (status) {
|
||||
retval.dptr = NULL;
|
||||
retval.dsize = 0;
|
||||
}
|
||||
return (retval);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* DATUM on success
|
||||
* NULL on failure
|
||||
*/
|
||||
extern datum
|
||||
dbm_firstkey(DBM *db)
|
||||
{
|
||||
int status;
|
||||
datum retdata, retkey;
|
||||
|
||||
status = (db->seq)(db, (DBT *)&retkey, (DBT *)&retdata, R_FIRST);
|
||||
if (status)
|
||||
retkey.dptr = NULL;
|
||||
return (retkey);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* DATUM on success
|
||||
* NULL on failure
|
||||
*/
|
||||
extern datum
|
||||
dbm_nextkey(DBM *db)
|
||||
{
|
||||
int status;
|
||||
datum retdata, retkey;
|
||||
|
||||
status = (db->seq)(db, (DBT *)&retkey, (DBT *)&retdata, R_NEXT);
|
||||
if (status)
|
||||
retkey.dptr = NULL;
|
||||
return (retkey);
|
||||
}
|
||||
/*
|
||||
* Returns:
|
||||
* 0 on success
|
||||
* <0 failure
|
||||
*/
|
||||
extern int
|
||||
dbm_delete(DBM *db, datum key)
|
||||
{
|
||||
int status;
|
||||
|
||||
status = (db->del)(db, (DBT *)&key, 0);
|
||||
if (status)
|
||||
return (-1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* 0 on success
|
||||
* <0 failure
|
||||
* 1 if DBM_INSERT and entry exists
|
||||
*/
|
||||
extern int
|
||||
dbm_store(DBM *db, datum key, datum content, int flags)
|
||||
{
|
||||
return ((db->put)(db, (DBT *)&key, (DBT *)&content,
|
||||
(flags == DBM_INSERT) ? R_NOOVERWRITE : 0));
|
||||
}
|
||||
|
||||
|
||||
extern int
|
||||
dbm_error(DBM *db)
|
||||
{
|
||||
HTAB *hp;
|
||||
|
||||
hp = (HTAB *)db->internal;
|
||||
return (hp->dbmerrno);
|
||||
}
|
||||
|
||||
extern int
|
||||
dbm_clearerr(DBM *db)
|
||||
{
|
||||
HTAB *hp;
|
||||
|
||||
hp = (HTAB *)db->internal;
|
||||
hp->dbmerrno = 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
extern int
|
||||
dbm_dirfno(DBM *db)
|
||||
{
|
||||
return(((HTAB *)db->internal)->fp);
|
||||
}
|
||||
311
mozilla/dbm/src/nsres.c
Normal file
311
mozilla/dbm/src/nsres.c
Normal file
@@ -0,0 +1,311 @@
|
||||
#include "watcomfx.h"
|
||||
|
||||
#include "nsres.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(BSDI)||defined(RHAPSODY)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct RESDATABASE
|
||||
{
|
||||
DB *hdb;
|
||||
NSRESTHREADINFO *threadinfo;
|
||||
char * pbuf[MAXBUFNUM];
|
||||
} ;
|
||||
typedef struct RESDATABASE * RESHANDLE;
|
||||
|
||||
typedef struct STRINGDATA
|
||||
{
|
||||
char *str;
|
||||
unsigned int charsetid;
|
||||
} STRINGDATA;
|
||||
|
||||
|
||||
typedef unsigned int CHARSETTYPE;
|
||||
#define RES_LOCK if (hres->threadinfo) hres->threadinfo->fn_lock(hres->threadinfo->lock);
|
||||
#define RES_UNLOCK if (hres->threadinfo) hres->threadinfo->fn_unlock(hres->threadinfo->lock);
|
||||
|
||||
int GenKeyData(const char *library, int32 id, DBT *key);
|
||||
|
||||
/*
|
||||
Right now, the page size used for resource is same as for Navigator cache
|
||||
database
|
||||
*/
|
||||
HASHINFO res_hash_info = {
|
||||
32*1024,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0, /* 64 * 1024U */
|
||||
0};
|
||||
|
||||
int GenKeyData(const char *library, int32 id, DBT *key)
|
||||
{
|
||||
char idstr[10];
|
||||
static char * strdata = NULL;
|
||||
size_t len;
|
||||
|
||||
if (strdata)
|
||||
free (strdata);
|
||||
|
||||
if (id == 0)
|
||||
idstr[0] = '\0';
|
||||
else
|
||||
{
|
||||
sprintf(idstr, "%d", id);
|
||||
/* itoa(id, idstr, 10); */
|
||||
}
|
||||
|
||||
if (library == NULL)
|
||||
len = strlen(idstr) + 1;
|
||||
else
|
||||
len = strlen(library) + strlen(idstr) + 1;
|
||||
strdata = (char *) malloc (len);
|
||||
strcpy(strdata, library);
|
||||
strcat(strdata, idstr);
|
||||
|
||||
key->size = len;
|
||||
key->data = strdata;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo)
|
||||
{
|
||||
RESHANDLE hres;
|
||||
int flag;
|
||||
|
||||
flag = O_RDWR | O_CREAT;
|
||||
|
||||
hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
|
||||
memset(hres, 0, sizeof(struct RESDATABASE));
|
||||
|
||||
if (threadinfo && threadinfo->lock && threadinfo->fn_lock
|
||||
&& threadinfo->fn_unlock)
|
||||
{
|
||||
hres->threadinfo = (NSRESTHREADINFO *) malloc( sizeof(NSRESTHREADINFO) );
|
||||
hres->threadinfo->lock = threadinfo->lock;
|
||||
hres->threadinfo->fn_lock = threadinfo->fn_lock;
|
||||
hres->threadinfo->fn_unlock = threadinfo->fn_unlock;
|
||||
}
|
||||
|
||||
|
||||
RES_LOCK
|
||||
|
||||
hres->hdb = dbopen(filename, flag, 0644, DB_HASH, &res_hash_info);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
if(!hres->hdb)
|
||||
return NULL;
|
||||
|
||||
return (NSRESHANDLE) hres;
|
||||
}
|
||||
|
||||
NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo)
|
||||
{
|
||||
RESHANDLE hres;
|
||||
int flag;
|
||||
|
||||
flag = O_RDONLY; /* only open database for reading */
|
||||
|
||||
hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
|
||||
memset(hres, 0, sizeof(struct RESDATABASE));
|
||||
|
||||
if (threadinfo && threadinfo->lock && threadinfo->fn_lock
|
||||
&& threadinfo->fn_unlock)
|
||||
{
|
||||
hres->threadinfo = (NSRESTHREADINFO *) malloc( sizeof(NSRESTHREADINFO) );
|
||||
hres->threadinfo->lock = threadinfo->lock;
|
||||
hres->threadinfo->fn_lock = threadinfo->fn_lock;
|
||||
hres->threadinfo->fn_unlock = threadinfo->fn_unlock;
|
||||
}
|
||||
|
||||
|
||||
RES_LOCK
|
||||
|
||||
hres->hdb = dbopen(filename, flag, 0644, DB_HASH, &res_hash_info);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
if(!hres->hdb)
|
||||
return NULL;
|
||||
|
||||
return (NSRESHANDLE) hres;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void NSResCloseTable(NSRESHANDLE handle)
|
||||
{
|
||||
RESHANDLE hres;
|
||||
int i;
|
||||
|
||||
if (handle == NULL)
|
||||
return;
|
||||
hres = (RESHANDLE) handle;
|
||||
|
||||
RES_LOCK
|
||||
|
||||
(*hres->hdb->sync)(hres->hdb, 0);
|
||||
(*hres->hdb->close)(hres->hdb);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
for (i = 0; i < MAXBUFNUM; i++)
|
||||
{
|
||||
if (hres->pbuf[i])
|
||||
free (hres->pbuf[i]);
|
||||
}
|
||||
|
||||
if (hres->threadinfo)
|
||||
free (hres->threadinfo);
|
||||
free (hres);
|
||||
}
|
||||
|
||||
|
||||
char *NSResLoadString(NSRESHANDLE handle, const char * library, int32 id,
|
||||
unsigned int charsetid, char *retbuf)
|
||||
{
|
||||
int status;
|
||||
RESHANDLE hres;
|
||||
DBT key, data;
|
||||
if (handle == NULL)
|
||||
return NULL;
|
||||
|
||||
hres = (RESHANDLE) handle;
|
||||
GenKeyData(library, id, &key);
|
||||
|
||||
RES_LOCK
|
||||
|
||||
status = (*hres->hdb->get)(hres->hdb, &key, &data, 0);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
if (retbuf)
|
||||
{
|
||||
memcpy(retbuf, (char *)data.data + sizeof(CHARSETTYPE), data.size - sizeof(CHARSETTYPE));
|
||||
return retbuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
static int WhichString = 0;
|
||||
static int bFirstTime = 1;
|
||||
char *szLoadedString;
|
||||
int i;
|
||||
|
||||
RES_LOCK
|
||||
|
||||
if (bFirstTime) {
|
||||
for (i = 0; i < MAXBUFNUM; i++)
|
||||
hres->pbuf[i] = (char *) malloc(MAXSTRINGLEN * sizeof(char));
|
||||
bFirstTime = 0;
|
||||
}
|
||||
|
||||
szLoadedString = hres->pbuf[WhichString];
|
||||
WhichString++;
|
||||
|
||||
/* reset to 0, if WhichString reaches to the end */
|
||||
if (WhichString == MAXBUFNUM)
|
||||
WhichString = 0;
|
||||
|
||||
if (status == 0)
|
||||
memcpy(szLoadedString, (char *) data.data + sizeof(CHARSETTYPE),
|
||||
data.size - sizeof(CHARSETTYPE));
|
||||
else
|
||||
szLoadedString[0] = 0;
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
return szLoadedString;
|
||||
}
|
||||
}
|
||||
|
||||
int32 NSResGetSize(NSRESHANDLE handle, const char *library, int32 id)
|
||||
{
|
||||
int status;
|
||||
RESHANDLE hres;
|
||||
DBT key, data;
|
||||
if (handle == NULL)
|
||||
return 0;
|
||||
hres = (RESHANDLE) handle;
|
||||
GenKeyData(library, id, &key);
|
||||
|
||||
RES_LOCK
|
||||
|
||||
status = (*hres->hdb->get)(hres->hdb, &key, &data, 0);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
return data.size - sizeof(CHARSETTYPE);
|
||||
}
|
||||
|
||||
int32 NSResLoadResource(NSRESHANDLE handle, const char *library, int32 id, char *retbuf)
|
||||
{
|
||||
int status;
|
||||
RESHANDLE hres;
|
||||
DBT key, data;
|
||||
if (handle == NULL)
|
||||
return 0;
|
||||
hres = (RESHANDLE) handle;
|
||||
GenKeyData(library, id, &key);
|
||||
|
||||
RES_LOCK
|
||||
|
||||
status = (*hres->hdb->get)(hres->hdb, &key, &data, 0);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
if (retbuf)
|
||||
{
|
||||
memcpy(retbuf, (char *)data.data + sizeof(CHARSETTYPE), data.size - sizeof(CHARSETTYPE));
|
||||
return data.size;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NSResAddString(NSRESHANDLE handle, const char *library, int32 id,
|
||||
const char *string, unsigned int charset)
|
||||
{
|
||||
int status;
|
||||
RESHANDLE hres;
|
||||
DBT key, data;
|
||||
char * recdata;
|
||||
|
||||
if (handle == NULL)
|
||||
return 0;
|
||||
hres = (RESHANDLE) handle;
|
||||
|
||||
GenKeyData(library, id, &key);
|
||||
|
||||
data.size = sizeof(CHARSETTYPE) + (strlen(string) + 1) ;
|
||||
|
||||
recdata = (char *) malloc(data.size) ;
|
||||
|
||||
/* set charset to the first field of record data */
|
||||
*((CHARSETTYPE *)recdata) = (CHARSETTYPE)charset;
|
||||
|
||||
/* set data field */
|
||||
memcpy(recdata+sizeof(CHARSETTYPE), string, strlen(string) + 1);
|
||||
|
||||
data.data = recdata;
|
||||
|
||||
RES_LOCK
|
||||
|
||||
status = (*hres->hdb->put)(hres->hdb, &key, &data, 0);
|
||||
|
||||
|
||||
if (recdata)
|
||||
free(recdata);
|
||||
|
||||
RES_UNLOCK
|
||||
|
||||
return status;
|
||||
}
|
||||
75
mozilla/dbm/src/snprintf.c
Normal file
75
mozilla/dbm/src/snprintf.c
Normal file
@@ -0,0 +1,75 @@
|
||||
#ifndef HAVE_SNPRINTF
|
||||
|
||||
#include "watcomfx.h"
|
||||
#include <sys/types.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(_WINDOWS) || defined(SOLARIS) || defined(AIXV3) || defined(AIX) || defined(OSF1) || defined(NEC) || !defined(HAVE_SYS_CDEFS_H)
|
||||
#include "cdefs.h"
|
||||
#elif !defined(HPUX) && !defined(UNIXWARE) && !defined(SNI)
|
||||
#include <sys/cdefs.h>
|
||||
#endif
|
||||
|
||||
#include "prtypes.h"
|
||||
|
||||
#include <ncompat.h>
|
||||
|
||||
/* The OS/2 VAC compiler doesn't appear to define __STDC__ and won't let us define it either */
|
||||
#if defined(__STDC__) || defined(XP_OS2_VACPP)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
#if defined(__STDC__) || defined(XP_OS2_VACPP)
|
||||
snprintf(char *str, size_t n, const char *fmt, ...)
|
||||
#else
|
||||
snprintf(str, n, fmt, va_alist)
|
||||
char *str;
|
||||
size_t n;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list ap;
|
||||
#ifdef VSPRINTF_CHARSTAR
|
||||
char *rp;
|
||||
#else
|
||||
int rval;
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(XP_OS2_VACPP)
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
#ifdef VSPRINTF_CHARSTAR
|
||||
rp = vsprintf(str, fmt, ap);
|
||||
va_end(ap);
|
||||
return (strlen(rp));
|
||||
#else
|
||||
rval = vsprintf(str, fmt, ap);
|
||||
va_end(ap);
|
||||
return (rval);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
vsnprintf(str, n, fmt, ap)
|
||||
char *str;
|
||||
size_t n;
|
||||
const char *fmt;
|
||||
va_list ap;
|
||||
{
|
||||
#ifdef VSPRINTF_CHARSTAR
|
||||
return (strlen(vsprintf(str, fmt, ap)));
|
||||
#else
|
||||
return (vsprintf(str, fmt, ap));
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* HAVE_SNPRINTF */
|
||||
|
||||
/* Some compilers don't like an empty source file. */
|
||||
static int dummy = 0;
|
||||
78
mozilla/dbm/src/strerror.c
Normal file
78
mozilla/dbm/src/strerror.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)strerror.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "watcomfx.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _DLL
|
||||
#define sys_nerr (*_sys_nerr_dll)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
#ifndef _AFXDLL
|
||||
char *
|
||||
strerror(num)
|
||||
int num;
|
||||
{
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
#define UPREFIX "Unknown error: "
|
||||
static char ebuf[40] = UPREFIX; /* 64-bit number + slop */
|
||||
register unsigned int errnum;
|
||||
register char *p, *t;
|
||||
char tmp[40];
|
||||
|
||||
errnum = num; /* convert to unsigned */
|
||||
if (errnum < sys_nerr)
|
||||
return(sys_errlist[errnum]);
|
||||
|
||||
/* Do this by hand, so we don't include stdio(3). */
|
||||
t = tmp;
|
||||
do {
|
||||
*t++ = "0123456789"[errnum % 10];
|
||||
} while (errnum /= 10);
|
||||
for (p = ebuf + sizeof(UPREFIX) - 1;;) {
|
||||
*p++ = *--t;
|
||||
if (t <= tmp)
|
||||
break;
|
||||
}
|
||||
return(ebuf);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* !HAVE_STRERROR */
|
||||
46
mozilla/dbm/tests/Makefile.in
Normal file
46
mozilla/dbm/tests/Makefile.in
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = dbm
|
||||
PROGRAM = lots$(BIN_SUFFIX)
|
||||
|
||||
CSRCS = lots.c
|
||||
|
||||
EXTRA_DSO_LIBS = mozdbm_s
|
||||
|
||||
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
||||
LIBS = $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX)
|
||||
else
|
||||
LIBS = $(EXTRA_DSO_LIBS)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifeq ($(OS_ARCH), Linux)
|
||||
DEFINES += -D_BSD_SOURCE
|
||||
endif
|
||||
623
mozilla/dbm/tests/lots.c
Normal file
623
mozilla/dbm/tests/lots.c
Normal file
@@ -0,0 +1,623 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
/* use sequental numbers printed to strings
|
||||
* to store lots and lots of entries in the
|
||||
* database.
|
||||
*
|
||||
* Start with 100 entries, put them and then
|
||||
* read them out. Then delete the first
|
||||
* half and verify that all of the first half
|
||||
* is gone and then verify that the second
|
||||
* half is still there.
|
||||
* Then add the first half back and verify
|
||||
* again. Then delete the middle third
|
||||
* and verify again.
|
||||
* Then increase the size by 1000 and do
|
||||
* the whole add delete thing again.
|
||||
*
|
||||
* The data for each object is the number string translated
|
||||
* to hex and replicated a random number of times. The
|
||||
* number of times that the data is replicated is the first
|
||||
* int32 in the data.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "mcom_db.h"
|
||||
|
||||
DB *database=0;
|
||||
int MsgPriority=5;
|
||||
|
||||
#if defined(_WINDOWS) && !defined(WIN32)
|
||||
#define int32 long
|
||||
#define uint32 unsigned long
|
||||
#else
|
||||
#define int32 int
|
||||
#define uint32 unsigned int
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
USE_LARGE_KEY,
|
||||
USE_SMALL_KEY
|
||||
} key_type_enum;
|
||||
|
||||
#define TraceMe(priority, msg) \
|
||||
do { \
|
||||
if(priority <= MsgPriority) \
|
||||
{ \
|
||||
ReportStatus msg; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
int
|
||||
ReportStatus(char *string, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
va_start(args, string);
|
||||
#else
|
||||
va_start(args);
|
||||
#endif
|
||||
vfprintf(stderr, string, args);
|
||||
va_end(args);
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
ReportError(char *string, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
va_start(args, string);
|
||||
#else
|
||||
va_start(args);
|
||||
#endif
|
||||
fprintf (stderr, "\n ");
|
||||
vfprintf(stderr, string, args);
|
||||
fprintf (stderr, "\n");
|
||||
va_end(args);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
DBT * MakeLargeKey(int32 num)
|
||||
{
|
||||
int32 low_bits;
|
||||
static DBT rv;
|
||||
static char *string_rv=0;
|
||||
int rep_char;
|
||||
int32 size;
|
||||
|
||||
if(string_rv)
|
||||
free(string_rv);
|
||||
|
||||
/* generate a really large text key derived from
|
||||
* an int32
|
||||
*/
|
||||
low_bits = (num % 10000) + 1;
|
||||
|
||||
/* get the repeat char from the low 26 */
|
||||
rep_char = (char) ((low_bits % 26) + 'a');
|
||||
|
||||
/* malloc a string low_bits wide */
|
||||
size = low_bits*sizeof(char);
|
||||
string_rv = (char *)malloc((size_t)size);
|
||||
|
||||
memset(string_rv, rep_char, (size_t)size);
|
||||
|
||||
rv.data = string_rv;
|
||||
rv.size = size;
|
||||
|
||||
return(&rv);
|
||||
}
|
||||
|
||||
DBT * MakeSmallKey(int32 num)
|
||||
{
|
||||
static DBT rv;
|
||||
static char data_string[64];
|
||||
|
||||
rv.data = data_string;
|
||||
|
||||
sprintf(data_string, "%ld", (long)num);
|
||||
rv.size = strlen(data_string);
|
||||
|
||||
return(&rv);
|
||||
|
||||
}
|
||||
|
||||
DBT * GenKey(int32 num, key_type_enum key_type)
|
||||
{
|
||||
DBT *key;
|
||||
|
||||
switch(key_type)
|
||||
{
|
||||
case USE_LARGE_KEY:
|
||||
key = MakeLargeKey(num);
|
||||
break;
|
||||
case USE_SMALL_KEY:
|
||||
key = MakeSmallKey(num);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
|
||||
return(key);
|
||||
}
|
||||
|
||||
int
|
||||
SeqDatabase()
|
||||
{
|
||||
int status;
|
||||
DBT key, data;
|
||||
|
||||
ReportStatus("SEQuencing through database...");
|
||||
|
||||
/* seq throught the whole database */
|
||||
if(!(status = (*database->seq)(database, &key, &data, R_FIRST)))
|
||||
{
|
||||
while(!(status = (database->seq) (database, &key, &data, R_NEXT)));
|
||||
; /* null body */
|
||||
}
|
||||
|
||||
if(status < 0)
|
||||
ReportError("Error seq'ing database");
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
int
|
||||
VerifyData(DBT *data, int32 num, key_type_enum key_type)
|
||||
{
|
||||
int32 count, compare_num;
|
||||
uint32 size;
|
||||
int32 *int32_array;
|
||||
|
||||
/* The first int32 is count
|
||||
* The other n entries should
|
||||
* all equal num
|
||||
*/
|
||||
if(data->size < sizeof(int32))
|
||||
{
|
||||
ReportError("Data size corrupted");
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(&count, data->data, sizeof(int32));
|
||||
|
||||
size = sizeof(int32)*(count+1);
|
||||
|
||||
if(size != data->size)
|
||||
{
|
||||
ReportError("Data size corrupted");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32_array = (int32*)data->data;
|
||||
|
||||
for(;count > 0; count--)
|
||||
{
|
||||
memcpy(&compare_num, &int32_array[count], sizeof(int32));
|
||||
|
||||
if(compare_num != num)
|
||||
{
|
||||
ReportError("Data corrupted");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/* verify that a range of number strings exist
|
||||
* or don't exist. And that the data is valid
|
||||
*/
|
||||
#define SHOULD_EXIST 1
|
||||
#define SHOULD_NOT_EXIST 0
|
||||
int
|
||||
VerifyRange(int32 low, int32 high, int32 should_exist, key_type_enum key_type)
|
||||
{
|
||||
DBT *key, data;
|
||||
int32 num;
|
||||
int status;
|
||||
|
||||
TraceMe(1, ("Verifying: %ld to %ld, using %s keys",
|
||||
low, high, key_type == USE_SMALL_KEY ? "SMALL" : "LARGE"));
|
||||
|
||||
for(num = low; num <= high; num++)
|
||||
{
|
||||
|
||||
key = GenKey(num, key_type);
|
||||
|
||||
status = (*database->get)(database, key, &data, 0);
|
||||
|
||||
if(status == 0)
|
||||
{
|
||||
/* got the item */
|
||||
if(!should_exist)
|
||||
{
|
||||
ReportError("Item exists but shouldn't: %ld", num);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* else verify the data */
|
||||
VerifyData(&data, num, key_type);
|
||||
}
|
||||
}
|
||||
else if(status > 0)
|
||||
{
|
||||
/* item not found */
|
||||
if(should_exist)
|
||||
{
|
||||
ReportError("Item not found but should be: %ld", num);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* database error */
|
||||
ReportError("Database error");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TraceMe(1, ("Correctly verified: %ld to %ld", low, high));
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
DBT *
|
||||
GenData(int32 num)
|
||||
{
|
||||
int32 n;
|
||||
static DBT *data=0;
|
||||
int32 *int32_array;
|
||||
int32 size;
|
||||
|
||||
if(!data)
|
||||
{
|
||||
data = (DBT*)malloc(sizeof(DBT));
|
||||
data->size = 0;
|
||||
data->data = 0;
|
||||
}
|
||||
else if(data->data)
|
||||
{
|
||||
free(data->data);
|
||||
}
|
||||
|
||||
n = rand();
|
||||
|
||||
n = n % 512; /* bound to a 2K size */
|
||||
|
||||
|
||||
size = sizeof(int32)*(n+1);
|
||||
int32_array = (int32 *) malloc((size_t)size);
|
||||
|
||||
memcpy(&int32_array[0], &n, sizeof(int32));
|
||||
|
||||
for(; n > 0; n--)
|
||||
{
|
||||
memcpy(&int32_array[n], &num, sizeof(int32));
|
||||
}
|
||||
|
||||
data->data = (void*)int32_array;
|
||||
data->size = size;
|
||||
|
||||
return(data);
|
||||
}
|
||||
|
||||
#define ADD_RANGE 1
|
||||
#define DELETE_RANGE 2
|
||||
|
||||
int
|
||||
AddOrDelRange(int32 low, int32 high, int action, key_type_enum key_type)
|
||||
{
|
||||
DBT *key, *data;
|
||||
#if 0 /* only do this if your really analy checking the puts */
|
||||
DBT tmp_data;
|
||||
#endif
|
||||
int32 num;
|
||||
int status;
|
||||
|
||||
if(action != ADD_RANGE && action != DELETE_RANGE)
|
||||
assert(0);
|
||||
|
||||
if(action == ADD_RANGE)
|
||||
{
|
||||
TraceMe(1, ("Adding: %ld to %ld: %s keys", low, high,
|
||||
key_type == USE_SMALL_KEY ? "SMALL" : "LARGE"));
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceMe(1, ("Deleting: %ld to %ld: %s keys", low, high,
|
||||
key_type == USE_SMALL_KEY ? "SMALL" : "LARGE"));
|
||||
}
|
||||
|
||||
for(num = low; num <= high; num++)
|
||||
{
|
||||
|
||||
key = GenKey(num, key_type);
|
||||
|
||||
if(action == ADD_RANGE)
|
||||
{
|
||||
data = GenData(num);
|
||||
status = (*database->put)(database, key, data, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = (*database->del)(database, key, 0);
|
||||
}
|
||||
|
||||
if(status < 0)
|
||||
{
|
||||
ReportError("Database error %s item: %ld",
|
||||
action == ADD_RANGE ? "ADDING" : "DELETING",
|
||||
num);
|
||||
}
|
||||
else if(status > 0)
|
||||
{
|
||||
ReportError("Could not %s item: %ld",
|
||||
action == ADD_RANGE ? "ADD" : "DELETE",
|
||||
num);
|
||||
}
|
||||
else if(action == ADD_RANGE)
|
||||
{
|
||||
#define SYNC_EVERY_TIME
|
||||
#ifdef SYNC_EVERY_TIME
|
||||
status = (*database->sync)(database, 0);
|
||||
if(status != 0)
|
||||
ReportError("Database error syncing after add");
|
||||
#endif
|
||||
|
||||
#if 0 /* only do this if your really analy checking the puts */
|
||||
|
||||
/* make sure we can still get it
|
||||
*/
|
||||
status = (*database->get)(database, key, &tmp_data, 0);
|
||||
|
||||
if(status != 0)
|
||||
{
|
||||
ReportError("Database error checking item just added: %d",
|
||||
num);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* now verify that none of the ones we already
|
||||
* put in have disappeared
|
||||
*/
|
||||
VerifyRange(low, num, SHOULD_EXIST, key_type);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(action == ADD_RANGE)
|
||||
{
|
||||
TraceMe(1, ("Successfully added: %ld to %ld", low, high));
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceMe(1, ("Successfully deleted: %ld to %ld", low, high));
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int
|
||||
TestRange(int32 low, int32 range, key_type_enum key_type)
|
||||
{
|
||||
int status; int32 low_of_range1, high_of_range1; int32 low_of_range2, high_of_range2;
|
||||
int32 low_of_range3, high_of_range3;
|
||||
|
||||
status = AddOrDelRange(low, low+range, ADD_RANGE, key_type);
|
||||
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 1"));
|
||||
|
||||
SeqDatabase();
|
||||
|
||||
low_of_range1 = low;
|
||||
high_of_range1 = low+(range/2);
|
||||
low_of_range2 = high_of_range1+1;
|
||||
high_of_range2 = low+range;
|
||||
status = AddOrDelRange(low_of_range1, high_of_range1, DELETE_RANGE, key_type);
|
||||
status = VerifyRange(low_of_range1, high_of_range1, SHOULD_NOT_EXIST, key_type);
|
||||
status = VerifyRange(low_of_range2, low_of_range2, SHOULD_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 2"));
|
||||
|
||||
SeqDatabase();
|
||||
|
||||
status = AddOrDelRange(low_of_range1, high_of_range1, ADD_RANGE, key_type);
|
||||
/* the whole thing should exist now */
|
||||
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 3"));
|
||||
|
||||
SeqDatabase();
|
||||
|
||||
status = AddOrDelRange(low_of_range2, high_of_range2, DELETE_RANGE, key_type);
|
||||
status = VerifyRange(low_of_range1, high_of_range1, SHOULD_EXIST, key_type);
|
||||
status = VerifyRange(low_of_range2, high_of_range2, SHOULD_NOT_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 4"));
|
||||
|
||||
SeqDatabase();
|
||||
|
||||
status = AddOrDelRange(low_of_range2, high_of_range2, ADD_RANGE, key_type);
|
||||
/* the whole thing should exist now */
|
||||
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 5"));
|
||||
|
||||
SeqDatabase();
|
||||
|
||||
low_of_range1 = low;
|
||||
high_of_range1 = low+(range/3);
|
||||
low_of_range2 = high_of_range1+1;
|
||||
high_of_range2 = high_of_range1+(range/3);
|
||||
low_of_range3 = high_of_range2+1;
|
||||
high_of_range3 = low+range;
|
||||
/* delete range 2 */
|
||||
status = AddOrDelRange(low_of_range2, high_of_range2, DELETE_RANGE, key_type);
|
||||
status = VerifyRange(low_of_range1, high_of_range1, SHOULD_EXIST, key_type);
|
||||
status = VerifyRange(low_of_range2, low_of_range2, SHOULD_NOT_EXIST, key_type);
|
||||
status = VerifyRange(low_of_range3, low_of_range2, SHOULD_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 6"));
|
||||
|
||||
SeqDatabase();
|
||||
|
||||
status = AddOrDelRange(low_of_range2, high_of_range2, ADD_RANGE, key_type);
|
||||
/* the whole thing should exist now */
|
||||
status = VerifyRange(low, low+range, SHOULD_EXIST, key_type);
|
||||
|
||||
TraceMe(1, ("Finished with sub test 7"));
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
#define START_RANGE 109876
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int32 i, j=0;
|
||||
int quick_exit = 0;
|
||||
int large_keys = 0;
|
||||
HASHINFO hash_info = {
|
||||
16*1024,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0};
|
||||
|
||||
|
||||
if(argc > 1)
|
||||
{
|
||||
while(argc > 1)
|
||||
{
|
||||
if(!strcmp(argv[argc-1], "-quick"))
|
||||
quick_exit = 1;
|
||||
else if(!strcmp(argv[argc-1], "-large"))
|
||||
{
|
||||
large_keys = 1;
|
||||
}
|
||||
argc--;
|
||||
}
|
||||
}
|
||||
|
||||
database = dbopen("test.db", O_RDWR | O_CREAT, 0644, DB_HASH, &hash_info);
|
||||
|
||||
if(!database)
|
||||
{
|
||||
ReportError("Could not open database");
|
||||
#ifdef unix
|
||||
perror("");
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(quick_exit)
|
||||
{
|
||||
if(large_keys)
|
||||
TestRange(START_RANGE, 200, USE_LARGE_KEY);
|
||||
else
|
||||
TestRange(START_RANGE, 200, USE_SMALL_KEY);
|
||||
|
||||
(*database->sync)(database, 0);
|
||||
(*database->close)(database);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for(i=100; i < 10000000; i+=200)
|
||||
{
|
||||
if(1 || j)
|
||||
{
|
||||
TestRange(START_RANGE, i, USE_LARGE_KEY);
|
||||
j = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
TestRange(START_RANGE, i, USE_SMALL_KEY);
|
||||
j = 1;
|
||||
}
|
||||
|
||||
if(1 == rand() % 3)
|
||||
{
|
||||
(*database->sync)(database, 0);
|
||||
}
|
||||
|
||||
if(1 == rand() % 3)
|
||||
{
|
||||
/* close and reopen */
|
||||
(*database->close)(database);
|
||||
database = dbopen("test.db", O_RDWR | O_CREAT, 0644, DB_HASH, 0);
|
||||
if(!database)
|
||||
{
|
||||
ReportError("Could not reopen database");
|
||||
#ifdef unix
|
||||
perror("");
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* reopen database without closeing the other */
|
||||
database = dbopen("test.db", O_RDWR | O_CREAT, 0644, DB_HASH, 0);
|
||||
if(!database)
|
||||
{
|
||||
ReportError("Could not reopen database "
|
||||
"after not closing the other");
|
||||
#ifdef unix
|
||||
perror("");
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
273
mozilla/security/coreconf/.cshrc
Normal file
273
mozilla/security/coreconf/.cshrc
Normal file
@@ -0,0 +1,273 @@
|
||||
#!/bin/csh
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Startup file for csh and tcsh. It is meant to work on:
|
||||
#
|
||||
# SunOS 4.1.3_U1,
|
||||
# Sun Solaris,
|
||||
# Sun Solaris on Intel,
|
||||
# SGI IRIX,
|
||||
# SGI IRIX64,
|
||||
# UNIX_SV,
|
||||
# IBM AIX,
|
||||
# Hewlett-Packard HP-UX,
|
||||
# SCO_SV,
|
||||
# FreeBSD,
|
||||
# DEC OSF/1,
|
||||
# Linux,
|
||||
# and everything else.
|
||||
#
|
||||
|
||||
###############################################
|
||||
# Set operating system name and release level #
|
||||
###############################################
|
||||
|
||||
set os_name=`uname -s`
|
||||
set os_release=`uname -r`
|
||||
|
||||
##########################################################
|
||||
# Set environment variables based upon operating system #
|
||||
##########################################################
|
||||
|
||||
if ($os_name == "SunOS" && $os_release == "4.1.3_U1") then
|
||||
##############################
|
||||
# SunOS 4.1.3_U1
|
||||
#
|
||||
|
||||
setenv NO_MDUPDATE 1
|
||||
|
||||
set path = ( /tools/ns/soft/gcc-2.6.3/run/default/sparc_sun_sunos4.1.3_U1/bin \
|
||||
/tools/ns/bin \
|
||||
/sbin \
|
||||
/usr/bin \
|
||||
/usr/openwin/bin \
|
||||
/usr/openwin/include \
|
||||
/usr/ucb \
|
||||
/usr/local/bin \
|
||||
/etc \
|
||||
/usr/etc \
|
||||
/usr/etc/install \
|
||||
. )
|
||||
|
||||
else if ($os_name == "SunOS") then
|
||||
################################
|
||||
# Assume it is Sun Solaris
|
||||
#
|
||||
|
||||
# To build Navigator on Solaris 2.5, I must set the environment
|
||||
# variable NO_MDUPDATE and use gcc-2.6.3.
|
||||
setenv NO_MDUPDATE 1
|
||||
|
||||
set path = ( /share/builds/components/jdk/1.2.2_01/SunOS \
|
||||
/usr/ccs/bin \
|
||||
/usr/opt/bin \
|
||||
/tools/ns/bin \
|
||||
/usr/sbin \
|
||||
/sbin \
|
||||
/usr/bin \
|
||||
/usr/dt/bin \
|
||||
/usr/openwin/bin \
|
||||
/usr/openwin/include \
|
||||
/usr/ucb \
|
||||
/usr/opt/java/bin \
|
||||
/usr/local/bin \
|
||||
/etc \
|
||||
/usr/etc \
|
||||
/usr/etc/install \
|
||||
/opt/Acrobat3/bin \
|
||||
. )
|
||||
|
||||
# To get the native Solaris cc
|
||||
if (`uname -m` == i86pc) then
|
||||
set path = ( /h/solx86/export/home/opt/SUNWspro/SC3.0.1/bin \
|
||||
$path )
|
||||
else
|
||||
set path = ( /tools/ns/workshop/bin \
|
||||
/tools/ns/soft/gcc-2.6.3/run/default/sparc_sun_solaris2.4/bin \
|
||||
$path )
|
||||
endif
|
||||
|
||||
setenv LD_LIBRARY_PATH /share/builds/components/jdk/1.2.2_01/SunOS/lib/sparc/native_threads
|
||||
|
||||
setenv MANPATH /usr/local/man:/usr/local/lib/mh/man:/usr/local/lib/rcscvs/man:/usr/local/lib/fvwm/man:/usr/local/lib/xscreensaver/man:/usr/share/man:/usr/openwin/man:/usr/opt/man
|
||||
|
||||
# For Purify
|
||||
setenv PURIFYHOME /usr/local-sparc-solaris/pure/purify-4.0-solaris2
|
||||
setenv PATH ${PURIFYHOME}:$PATH
|
||||
setenv MANPATH $PURIFYHOME/man:$MANPATH
|
||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$PURIFYHOME
|
||||
setenv PURIFYOPTIONS "-max_threads=1000 -follow-child-processes=yes"
|
||||
|
||||
else if ($os_name == "IRIX" || $os_name == "IRIX64") then
|
||||
#############
|
||||
# SGI Irix
|
||||
#
|
||||
|
||||
set path = ( /share/builds/components/jdk/1.2.1/IRIX \
|
||||
/tools/ns/bin \
|
||||
/tools/contrib/bin \
|
||||
/usr/local/bin \
|
||||
/usr/sbin \
|
||||
/usr/bsd \
|
||||
/usr/bin \
|
||||
/bin \
|
||||
/etc \
|
||||
/usr/etc \
|
||||
/usr/bin/X11 \
|
||||
. )
|
||||
|
||||
else if ($os_name == "UNIX_SV") then
|
||||
#################
|
||||
# UNIX_SV
|
||||
#
|
||||
|
||||
set path = ( /usr/local/bin \
|
||||
/tools/ns/bin \
|
||||
/bin \
|
||||
/usr/bin \
|
||||
/usr/bin/X11 \
|
||||
/X11/bin \
|
||||
/usr/X/bin \
|
||||
/usr/ucb \
|
||||
/usr/sbin \
|
||||
/sbin \
|
||||
/usr/ccs/bin \
|
||||
. )
|
||||
|
||||
else if ($os_name == "AIX") then
|
||||
#################
|
||||
# IBM AIX
|
||||
#
|
||||
|
||||
set path = ( /share/builds/components/jdk/1.2.2/AIX \
|
||||
/usr/ucb/ \
|
||||
/tools/ns-arch/rs6000_ibm_aix4.1/bin \
|
||||
/tools/ns-arch/rs6000_ibm_aix3.2.5/bin \
|
||||
/share/tools/ns/soft/cvs-1.8/run/default/rs6000_ibm_aix3.2.5/bin \
|
||||
/bin \
|
||||
/usr/bin \
|
||||
/usr/ccs/bin \
|
||||
/usr/sbin \
|
||||
/usr/local/bin \
|
||||
/usr/bin/X11 \
|
||||
/usr/etc \
|
||||
/etc \
|
||||
/sbin \
|
||||
. )
|
||||
|
||||
else if ($os_name == "HP-UX") then
|
||||
#################
|
||||
# HP UX
|
||||
#
|
||||
|
||||
set path = ( /share/builds/components/jdk/1.1.6/HP-UX \
|
||||
/usr/bin \
|
||||
/opt/ansic/bin \
|
||||
/usr/ccs/bin \
|
||||
/usr/contrib/bin \
|
||||
/opt/nettladm/bin \
|
||||
/opt/graphics/common/bin \
|
||||
/usr/bin/X11 \
|
||||
/usr/contrib/bin/X11 \
|
||||
/opt/upgrade/bin \
|
||||
/opt/CC/bin \
|
||||
/opt/aCC/bin \
|
||||
/opt/langtools/bin \
|
||||
/opt/imake/bin \
|
||||
/etc \
|
||||
/usr/etc \
|
||||
/usr/local/bin \
|
||||
/tools/ns/bin \
|
||||
/tools/contrib/bin \
|
||||
/usr/sbin \
|
||||
/usr/local/bin \
|
||||
/tools/ns/bin \
|
||||
/tools/contrib/bin \
|
||||
/usr/sbin \
|
||||
/usr/include/X11R5 \
|
||||
. )
|
||||
|
||||
else if ($os_name == "SCO_SV") then
|
||||
#################
|
||||
# SCO
|
||||
#
|
||||
|
||||
set path = ( /bin \
|
||||
/usr/bin \
|
||||
/tools/ns/bin \
|
||||
/tools/contrib/bin \
|
||||
/usr/sco/bin \
|
||||
/usr/bin/X11 \
|
||||
/usr/local/bin \
|
||||
. )
|
||||
|
||||
else if ($os_name == "FreeBSD") then
|
||||
#################
|
||||
# FreeBSD
|
||||
#
|
||||
|
||||
setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/java/bin:/usr/local/bin:/usr/ucb:/usr/ccs/bin:/tools/contrib/bin:/tools/ns/bin:.
|
||||
|
||||
else if ($os_name == "OSF1") then
|
||||
#################
|
||||
# DEC OSF1
|
||||
#
|
||||
|
||||
set path = ( /share/builds/components/jdk/1.2.2_3/OSF1 \
|
||||
/tools/ns-arch/alpha_dec_osf4.0/bin \
|
||||
/tools/ns-arch/soft/cvs-1.8.3/run/default/alpha_dec_osf2.0/bin \
|
||||
/usr/local-alpha-osf/bin \
|
||||
/usr3/local/bin \
|
||||
/usr/local/bin \
|
||||
/usr/sbin \
|
||||
/usr/bin \
|
||||
/bin \
|
||||
/usr/bin/X11 \
|
||||
/usr/ucb \
|
||||
. )
|
||||
|
||||
else if ($os_name == "Linux") then
|
||||
#################
|
||||
# Linux
|
||||
#
|
||||
|
||||
set path = ( /share/builds/components/jdk/1.2.2/Linux \
|
||||
$path )
|
||||
|
||||
endif
|
||||
|
||||
###############################
|
||||
# Reset any "tracked" aliases #
|
||||
###############################
|
||||
|
||||
rehash
|
||||
216
mozilla/security/coreconf/.profile
Normal file
216
mozilla/security/coreconf/.profile
Normal file
@@ -0,0 +1,216 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Startup file for sh, ksh and bash. It is meant to work on:
|
||||
#
|
||||
# SunOS 4.1.3_U1,
|
||||
# Sun Solaris,
|
||||
# Sun Solaris on Intel,
|
||||
# SGI IRIX,
|
||||
# SGI IRIX64,
|
||||
# UNIX_SV,
|
||||
# IBM AIX,
|
||||
# Hewlett-Packard HP-UX,
|
||||
# SCO_SV,
|
||||
# FreeBSD,
|
||||
# DEC OSF/1,
|
||||
# Linux,
|
||||
# and everything else.
|
||||
#
|
||||
|
||||
###############################################
|
||||
# Set operating system name and release level #
|
||||
###############################################
|
||||
|
||||
OS_NAME=`uname -s`
|
||||
export OS_NAME
|
||||
|
||||
OS_RELEASE=`uname -r`
|
||||
export OS_RELEASE
|
||||
|
||||
##########################################################
|
||||
# Set environment variables based upon operating system #
|
||||
##########################################################
|
||||
|
||||
case $OS_NAME in
|
||||
|
||||
SunOS)
|
||||
##############################
|
||||
# Sun
|
||||
#
|
||||
|
||||
case $OS_RELEASE in
|
||||
|
||||
4.1.3_U1)
|
||||
##############################
|
||||
# SunOS 4.1.3_U1
|
||||
#
|
||||
|
||||
NO_MDUPDATE=1
|
||||
export NO_MDUPDATE
|
||||
|
||||
PATH=/tools/ns/soft/gcc-2.6.3/run/default/sparc_sun_sunos4.1.3_U1/bin:tools/ns/bin:/sbin:/usr/bin:/usr/openwin/bin:/usr/openwin/include:/usr/ucb:/usr/local/bin:/etc:/usr/etc:/usr/etc/install:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
*)
|
||||
################################
|
||||
# Assume it is Sun Solaris
|
||||
#
|
||||
|
||||
# To build Navigator on Solaris 2.5, I must set the environment
|
||||
# variable NO_MDUPDATE and use gcc-2.6.3.
|
||||
NO_MDUPDATE=1
|
||||
export NO_MDUPDATE
|
||||
|
||||
PATH=/share/builds/components/jdk/1.2.2_01/SunOS:/usr/ccs/bin:/usr/opt/bin:/tools/ns/bin:/usr/sbin:/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/openwin/include:/usr/ucb:/usr/opt/java/bin:/usr/local/bin:/etc:/usr/etc:/usr/etc/install:/opt/Acrobat3/bin:.
|
||||
export PATH
|
||||
|
||||
# To get the native Solaris cc
|
||||
OS_TEST=`uname -m`
|
||||
export OS_TEST
|
||||
|
||||
case $OS_TEST in
|
||||
|
||||
i86pc)
|
||||
PATH=/h/solx86/export/home/opt/SUNWspro/SC3.0.1/bin:$PATH
|
||||
export PATH
|
||||
;;
|
||||
|
||||
*)
|
||||
PATH=/tools/ns/workshop/bin:/tools/ns/soft/gcc-2.6.3/run/default/sparc_sun_solaris2.4/bin:$PATH
|
||||
export PATH
|
||||
;;
|
||||
esac
|
||||
|
||||
LD_LIBRARY_PATH=/share/builds/components/jdk/1.2.2_01/SunOS/lib/sparc/native_threads
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
MANPATH=/usr/local/man:/usr/local/lib/mh/man:/usr/local/lib/rcscvs/man:/usr/local/lib/fvwm/man:/usr/local/lib/xscreensaver/man:/usr/share/man:/usr/openwin/man:/usr/opt/man
|
||||
export MANPATH
|
||||
|
||||
# For Purify
|
||||
PURIFYHOME=/usr/local-sparc-solaris/pure/purify-4.0-solaris2
|
||||
export PURIFYHOME
|
||||
PATH=/usr/local-sparc-solaris/pure/purify-4.0-solaris2:$PATH
|
||||
export PATH
|
||||
MANPATH=$PURIFYHOME/man:$MANPATH
|
||||
export MANPATH
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local-sparc-solaris/pure/purify-4.0-solaris2
|
||||
export LD_LIBRARY_PATH
|
||||
PURIFYOPTIONS="-max_threads=1000 -follow-child-processes=yes"
|
||||
export PURIFYOPTIONS
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
IRIX | IRIX64)
|
||||
#############
|
||||
# SGI Irix
|
||||
#
|
||||
|
||||
PATH=/share/builds/components/jdk/1.2.1/IRIX:/tools/ns/bin:/tools/contrib/bin:/usr/local/bin:/usr/sbin:/usr/bsd:/usr/bin:/bin:/etc:/usr/etc:/usr/bin/X11:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
UNIX_SV)
|
||||
#################
|
||||
# UNIX_SV
|
||||
#
|
||||
|
||||
PATH=/usr/local/bin:/tools/ns/bin:/bin:/usr/bin:/usr/bin/X11:/X11/bin:/usr/X/bin:/usr/ucb:/usr/sbin:/sbin:/usr/ccs/bin:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
AIX)
|
||||
#################
|
||||
# IBM AIX
|
||||
#
|
||||
|
||||
PATH=/share/builds/components/jdk/1.2.2/AIX:/usr/ucb/:/tools/ns-arch/rs6000_ibm_aix4.1/bin:/tools/ns-arch/rs6000_ibm_aix3.2.5/bin:/share/tools/ns/soft/cvs-1.8/run/default/rs6000_ibm_aix3.2.5/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/usr/local/bin:/usr/bin/X11:/usr/etc:/etc:/sbin:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
HP-UX)
|
||||
#################
|
||||
# HP UX
|
||||
#
|
||||
|
||||
PATH=/share/builds/components/jdk/1.1.6/HP-UX:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/graphics/common/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/upgrade/bin:/opt/CC/bin:/opt/aCC/bin:/opt/langtools/bin:/opt/imake/bin:/etc:/usr/etc:/usr/local/bin:/tools/ns/bin:/tools/contrib/bin:/usr/sbin:/usr/local/bin:/tools/ns/bin:/tools/contrib/bin:/usr/sbin:/usr/include/X11R5:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
SCO_SV)
|
||||
#################
|
||||
# SCO
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/tools/ns/bin:/tools/contrib/bin:/usr/sco/bin:/usr/bin/X11:/usr/local/bin:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
FreeBSD)
|
||||
|
||||
#################
|
||||
# FreeBSD
|
||||
#
|
||||
|
||||
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/java/bin:/usr/local/bin:/usr/ucb:/usr/ccs/bin:/tools/contrib/bin:/tools/ns/bin:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
OSF1)
|
||||
#################
|
||||
# DEC OSF1
|
||||
#
|
||||
|
||||
PATH=/share/builds/components/jdk/1.2.2_3/OSF1:/tools/ns-arch/alpha_dec_osf4.0/bin:/tools/ns-arch/soft/cvs-1.8.3/run/default/alpha_dec_osf2.0/bin:/usr/local-alpha-osf/bin:/usr3/local/bin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/ucb:.
|
||||
export PATH
|
||||
;;
|
||||
|
||||
Linux)
|
||||
|
||||
#################
|
||||
# Linux
|
||||
#
|
||||
|
||||
PATH=/share/builds/components/jdk/1.2.2/Linux:$PATH
|
||||
export PATH
|
||||
;;
|
||||
esac
|
||||
|
||||
###############################
|
||||
# Reset any "tracked" aliases #
|
||||
###############################
|
||||
|
||||
hash -r
|
||||
74
mozilla/security/coreconf/AIX.mk
Normal file
74
mozilla/security/coreconf/AIX.mk
Normal file
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for AIX.
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
#
|
||||
# There are two implementation strategies available on AIX:
|
||||
# pthreads, and pthreads-user. The default is pthreads.
|
||||
# In both strategies, we need to use pthread_user.c, instead of
|
||||
# aix.c. The fact that aix.c is never used is somewhat strange.
|
||||
#
|
||||
# So we need to do the following:
|
||||
# - Default (PTHREADS_USER not defined in the environment or on
|
||||
# the command line):
|
||||
# Set PTHREADS_USER=1, USE_PTHREADS=1
|
||||
# - PTHREADS_USER=1 set in the environment or on the command line:
|
||||
# Do nothing.
|
||||
#
|
||||
ifeq ($(PTHREADS_USER),1)
|
||||
USE_PTHREADS = # just to be safe
|
||||
IMPL_STRATEGY = _PTH_USER
|
||||
else
|
||||
USE_PTHREADS = 1
|
||||
PTHREADS_USER = 1
|
||||
endif
|
||||
|
||||
DEFAULT_COMPILER = xlC_r
|
||||
|
||||
CC = xlC_r
|
||||
CCC = xlC_r
|
||||
|
||||
CPU_ARCH = rs6000
|
||||
|
||||
RANLIB = ranlib
|
||||
|
||||
OS_CFLAGS = -DAIX -DSYSV
|
||||
ifeq ($(CC),xlC_r)
|
||||
OS_CFLAGS += -qarch=com
|
||||
endif
|
||||
|
||||
AIX_WRAP = $(DIST)/lib/aixwrap.o
|
||||
AIX_TMP = $(OBJDIR)/_aix_tmp.o
|
||||
OS_LIBS += -lsvld
|
||||
35
mozilla/security/coreconf/AIX3.2.mk
Normal file
35
mozilla/security/coreconf/AIX3.2.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for AIX3.2.5
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/AIX.mk
|
||||
46
mozilla/security/coreconf/AIX4.1.mk
Normal file
46
mozilla/security/coreconf/AIX4.1.mk
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for AIX4.1
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/AIX.mk
|
||||
|
||||
|
||||
AIX_LINK_OPTS += -bnso -berok
|
||||
#AIX_LINK_OPTS += -bnso -berok -brename:.select,.wrap_select -brename:.poll,.wrap_poll -bI:/usr/lib/syscalls.exp
|
||||
|
||||
# The AIX4.1 linker had a bug which always looked for a dynamic library
|
||||
# with an extension of .a. AIX4.2 fixed this problem
|
||||
DLL_SUFFIX = a
|
||||
|
||||
OS_LIBS += -lsvld
|
||||
45
mozilla/security/coreconf/AIX4.2.mk
Normal file
45
mozilla/security/coreconf/AIX4.2.mk
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
|
||||
#
|
||||
# Config stuff for AIX4.2
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/AIX.mk
|
||||
|
||||
OS_CFLAGS += -DAIX4_2
|
||||
DSO_LDOPTS = -brtl -bM:SRE -bnoentry $(EXPORT_RULES)
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS) -lsvld -L/usr/lpp/xlC/lib -lc -lm
|
||||
|
||||
OS_LIBS += -L/usr/lpp/xlC/lib -lc -lm
|
||||
EXPORT_RULES = -bexpall
|
||||
|
||||
52
mozilla/security/coreconf/AIX4.3.mk
Normal file
52
mozilla/security/coreconf/AIX4.3.mk
Normal file
@@ -0,0 +1,52 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for AIX4.3
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/AIX.mk
|
||||
|
||||
|
||||
ifeq ($(USE_64), 1)
|
||||
# Next line replaced by generic name handling in arch.mk
|
||||
# COMPILER_TAG = _64
|
||||
OS_CFLAGS += -DAIX_64BIT
|
||||
OBJECT_MODE=64
|
||||
export OBJECT_MODE
|
||||
endif
|
||||
OS_CFLAGS += -DAIX4_3
|
||||
DSO_LDOPTS = -brtl -bM:SRE -bnoentry $(EXPORT_RULES)
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS) -lsvld -L/usr/lpp/xlC/lib -lc -lm
|
||||
|
||||
OS_LIBS += -L/usr/lpp/xlC/lib -lc -lm
|
||||
EXPORT_RULES = -bexpall
|
||||
|
||||
83
mozilla/security/coreconf/BSD_OS.mk
Normal file
83
mozilla/security/coreconf/BSD_OS.mk
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Kurt J. Lidl
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for BSD/OS
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = gcc
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
RANLIB = ranlib
|
||||
|
||||
ifeq ($(OS_TEST),i386)
|
||||
OS_REL_CFLAGS = -D__i386__
|
||||
CPU_ARCH = x86
|
||||
else
|
||||
ifeq ($(OS_TEST),ppc)
|
||||
OS_REL_CFLAGS = -D__ppc__
|
||||
CPU_ARCH = ppc
|
||||
else
|
||||
ifeq ($(OS_TEST),sparc)
|
||||
OS_REL_CFLAGS = -D__sparc__
|
||||
CPU_ARCH = sparc
|
||||
else
|
||||
# treat the ultrasparc like a regular sparc, at least for now!
|
||||
ifeq ($(OS_TEST),sparc_v9)
|
||||
OS_REL_CFLAGS = -D__sparc__
|
||||
CPU_ARCH = sparc
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
DLL_SUFFIX = so
|
||||
|
||||
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wall -DBSD_OS -DBSDI -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK
|
||||
|
||||
ARCH = bsdos
|
||||
|
||||
DSO_CFLAGS = -fPIC -DPIC
|
||||
DSO_LDOPTS = -shared
|
||||
DSO_LDFLAGS =
|
||||
DSO_LDOPTS += -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
||||
|
||||
ifdef LIBRUNPATH
|
||||
DSO_LDOPTS += -Wl,-R$(LIBRUNPATH)
|
||||
endif
|
||||
|
||||
MKSHLIB = $(CC) $(DSO_LDOPTS)
|
||||
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
|
||||
INCLUDES += -I/usr/X11R6/include
|
||||
79
mozilla/security/coreconf/FreeBSD.mk
Normal file
79
mozilla/security/coreconf/FreeBSD.mk
Normal file
@@ -0,0 +1,79 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for FreeBSD
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = gcc
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
RANLIB = ranlib
|
||||
|
||||
ifeq ($(OS_TEST),alpha)
|
||||
CPU_ARCH = alpha
|
||||
else
|
||||
OS_REL_CFLAGS = -Di386
|
||||
CPU_ARCH = x86
|
||||
endif
|
||||
|
||||
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe $(THREAD_FLAG) -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
|
||||
|
||||
#
|
||||
# The default implementation strategy for FreeBSD is pthreads.
|
||||
#
|
||||
ifndef CLASSIC_NSPR
|
||||
USE_PTHREADS = 1
|
||||
DEFINES += -D_THREAD_SAFE
|
||||
THREAD_FLAG = -pthread
|
||||
endif
|
||||
|
||||
ARCH = freebsd
|
||||
|
||||
MOZ_OBJFORMAT := $(shell test -x /usr/bin/objformat && /usr/bin/objformat || echo aout)
|
||||
|
||||
ifeq ($(MOZ_OBJFORMAT),elf)
|
||||
DLL_SUFFIX = so
|
||||
else
|
||||
DLL_SUFFIX = so.1.0
|
||||
endif
|
||||
|
||||
DSO_CFLAGS = -fPIC
|
||||
DSO_LDOPTS = -Bshareable
|
||||
DSO_LDFLAGS =
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
|
||||
INCLUDES += -I/usr/X11R6/include
|
||||
36
mozilla/security/coreconf/FreeBSD2.mk
Normal file
36
mozilla/security/coreconf/FreeBSD2.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for FreeBSD2
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/FreeBSD.mk
|
||||
71
mozilla/security/coreconf/HP-UX.mk
Normal file
71
mozilla/security/coreconf/HP-UX.mk
Normal file
@@ -0,0 +1,71 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
|
||||
#
|
||||
# Config stuff for HP-UX
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
CPU_ARCH = hppa
|
||||
DLL_SUFFIX = sl
|
||||
CC = cc
|
||||
CCC = CC
|
||||
OS_CFLAGS += -Ae $(DSO_CFLAGS) -DHPUX -D$(CPU_ARCH) -D_HPUX_SOURCE
|
||||
|
||||
ifeq ($(DEFAULT_IMPL_STRATEGY),_PTH)
|
||||
USE_PTHREADS = 1
|
||||
ifeq ($(CLASSIC_NSPR),1)
|
||||
USE_PTHREADS =
|
||||
IMPL_STRATEGY = _CLASSIC
|
||||
endif
|
||||
ifeq ($(PTHREADS_USER),1)
|
||||
USE_PTHREADS =
|
||||
IMPL_STRATEGY = _PTH_USER
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef PTHREADS_USER
|
||||
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
|
||||
endif
|
||||
|
||||
LDFLAGS = -z -Wl,+s
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
DSO_LDOPTS = -b +h $(notdir $@)
|
||||
DSO_LDFLAGS =
|
||||
|
||||
# +Z generates position independent code for use in shared libraries.
|
||||
DSO_CFLAGS = +Z
|
||||
44
mozilla/security/coreconf/HP-UXA.09.03.mk
Normal file
44
mozilla/security/coreconf/HP-UXA.09.03.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
|
||||
#
|
||||
# On HP-UX 9, the default (and only) implementation strategy is
|
||||
# classic nspr.
|
||||
#
|
||||
ifeq ($(OS_RELEASE),A.09.03)
|
||||
DEFAULT_IMPL_STRATEGY = _CLASSIC
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXA.09.03
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXA.09.mk
|
||||
43
mozilla/security/coreconf/HP-UXA.09.07.mk
Normal file
43
mozilla/security/coreconf/HP-UXA.09.07.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On HP-UX 9, the default (and only) implementation strategy is
|
||||
# classic nspr.
|
||||
#
|
||||
ifeq ($(OS_RELEASE),A.09.07)
|
||||
DEFAULT_IMPL_STRATEGY = _CLASSIC
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXA.09.07
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXA.09.mk
|
||||
38
mozilla/security/coreconf/HP-UXA.09.mk
Normal file
38
mozilla/security/coreconf/HP-UXA.09.mk
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXA.09
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UX.mk
|
||||
|
||||
OS_CFLAGS += -DHPUX9
|
||||
40
mozilla/security/coreconf/HP-UXB.10.01.mk
Normal file
40
mozilla/security/coreconf/HP-UXB.10.01.mk
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
ifeq ($(OS_RELEASE),B.10.01)
|
||||
DEFAULT_IMPL_STRATEGY = _CLASSIC
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXB.10.01
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
|
||||
50
mozilla/security/coreconf/HP-UXB.10.10.mk
Normal file
50
mozilla/security/coreconf/HP-UXB.10.10.mk
Normal file
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On HP-UX 10.10 and 10.20, the default implementation strategy is
|
||||
# pthreads (actually DCE threads). Classic nspr is also available.
|
||||
#
|
||||
|
||||
ifeq ($(OS_RELEASE),B.10.10)
|
||||
DEFAULT_IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXB.10.10
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
|
||||
|
||||
OS_CFLAGS += -DHPUX10_10
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
OS_CFLAGS += -D_REENTRANT
|
||||
endif
|
||||
50
mozilla/security/coreconf/HP-UXB.10.20.mk
Normal file
50
mozilla/security/coreconf/HP-UXB.10.20.mk
Normal file
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On HP-UX 10.10 and 10.20, the default implementation strategy is
|
||||
# pthreads (actually DCE threads). Classic nspr is also available.
|
||||
#
|
||||
|
||||
ifeq ($(OS_RELEASE),B.10.20)
|
||||
DEFAULT_IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXB.10.20
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
|
||||
|
||||
OS_CFLAGS += -DHPUX10_20
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
OS_CFLAGS += -D_REENTRANT
|
||||
endif
|
||||
56
mozilla/security/coreconf/HP-UXB.10.30.mk
Normal file
56
mozilla/security/coreconf/HP-UXB.10.30.mk
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On HP-UX 10.30 and 11.00, the default implementation strategy is
|
||||
# pthreads. Classic nspr and pthreads-user are also available.
|
||||
#
|
||||
|
||||
ifeq ($(OS_RELEASE),B.10.30)
|
||||
DEFAULT_IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXB.10.30.
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXB.10.mk
|
||||
|
||||
OS_CFLAGS += -DHPUX10_30
|
||||
|
||||
#
|
||||
# To use the true pthread (kernel thread) library on 10.30 and
|
||||
# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
|
||||
# The _REENTRANT macro is deprecated.
|
||||
#
|
||||
|
||||
ifdef USE_PTHREADS
|
||||
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
|
||||
endif
|
||||
38
mozilla/security/coreconf/HP-UXB.10.mk
Normal file
38
mozilla/security/coreconf/HP-UXB.10.mk
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for HP-UXB.10
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UX.mk
|
||||
|
||||
OS_CFLAGS += -DHPUX10
|
||||
OS_LIBS += -lpthread -lm
|
||||
55
mozilla/security/coreconf/HP-UXB.11.00.mk
Normal file
55
mozilla/security/coreconf/HP-UXB.11.00.mk
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On HP-UX 10.30 and 11.00, the default implementation strategy is
|
||||
# pthreads. Classic nspr and pthreads-user are also available.
|
||||
#
|
||||
|
||||
ifeq ($(OS_RELEASE),B.11.00)
|
||||
OS_CFLAGS += -DHPUX10
|
||||
DEFAULT_IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
|
||||
#
|
||||
# To use the true pthread (kernel thread) library on 10.30 and
|
||||
# 11.00, we should define _POSIX_C_SOURCE to be 199506L.
|
||||
# The _REENTRANT macro is deprecated.
|
||||
#
|
||||
|
||||
ifdef USE_PTHREADS
|
||||
OS_CFLAGS += -D_POSIX_C_SOURCE=199506L
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for HP-UXB.11.00.
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UXB.11.mk
|
||||
65
mozilla/security/coreconf/HP-UXB.11.mk
Normal file
65
mozilla/security/coreconf/HP-UXB.11.mk
Normal file
@@ -0,0 +1,65 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for HP-UXB.11
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/HP-UX.mk
|
||||
|
||||
ifdef USE_LONG_LONGS
|
||||
USE_HYBRID = 1
|
||||
endif
|
||||
|
||||
ifndef NS_USE_GCC
|
||||
CCC = /opt/aCC/bin/aCC -ext
|
||||
ifeq ($(USE_64), 1)
|
||||
OS_CFLAGS += -Aa +e +DA2.0W +DS2.0 +DChpux
|
||||
# Next line replaced by generic name handling in arch.mk
|
||||
# COMPILER_TAG = _64
|
||||
else
|
||||
ifdef USE_HYBRID
|
||||
OS_CFLAGS += -Aa +e +DA2.0 +DS2.0
|
||||
else
|
||||
OS_CFLAGS += +DAportable +DS2.0
|
||||
endif
|
||||
endif
|
||||
else
|
||||
CCC = aCC
|
||||
endif
|
||||
|
||||
OS_CFLAGS += -DHPUX11
|
||||
OS_LIBS += -lpthread -lm -lrt
|
||||
#ifeq ($(USE_64), 1)
|
||||
#OS_LIBS += -ldl
|
||||
#else
|
||||
#OS_LIBS += -ldld
|
||||
#endif
|
||||
HPUX11 = 1
|
||||
120
mozilla/security/coreconf/IRIX.mk
Normal file
120
mozilla/security/coreconf/IRIX.mk
Normal file
@@ -0,0 +1,120 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
#
|
||||
# The default implementation strategy for Irix is classic nspr.
|
||||
#
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
ifeq ($(USE_N32),1)
|
||||
IMPL_STRATEGY = _n32_PTH
|
||||
else
|
||||
IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
endif
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
ifdef NS_USE_GCC
|
||||
CC = gcc
|
||||
AS = $(CC) -x assembler-with-cpp
|
||||
ODD_CFLAGS = -Wall -Wno-format
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O6
|
||||
endif
|
||||
else
|
||||
CC = cc
|
||||
CCC = CC
|
||||
ODD_CFLAGS = -fullwarn -xansi
|
||||
ifdef BUILD_OPT
|
||||
ifeq ($(USE_N32),1)
|
||||
OPTIMIZER = -O -OPT:Olimit=4000
|
||||
else
|
||||
OPTIMIZER = -O -Olimit 4000
|
||||
endif
|
||||
endif
|
||||
|
||||
# For 6.x machines, include this flag
|
||||
ifeq (6., $(findstring 6., $(OS_RELEASE)))
|
||||
ifeq ($(USE_N32),1)
|
||||
ODD_CFLAGS += -n32 -mips3 -exceptions
|
||||
else
|
||||
ODD_CFLAGS += -32 -multigot
|
||||
endif
|
||||
else
|
||||
ODD_CFLAGS += -xgot
|
||||
endif
|
||||
ifeq ($(USE_N32),1)
|
||||
OS_CFLAGS += -dollar
|
||||
endif
|
||||
endif
|
||||
|
||||
ODD_CFLAGS += -DSVR4 -DIRIX
|
||||
|
||||
CPU_ARCH = mips
|
||||
|
||||
RANLIB = /bin/true
|
||||
# For purify
|
||||
# NOTE: should always define _SGI_MP_SOURCE
|
||||
NOMD_OS_CFLAGS += $(ODD_CFLAGS) -D_SGI_MP_SOURCE
|
||||
|
||||
ifndef NO_MDUPDATE
|
||||
OS_CFLAGS += $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
|
||||
else
|
||||
OS_CFLAGS += $(NOMD_OS_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(USE_N32),1)
|
||||
SHLIB_LD_OPTS += -n32 -mips3
|
||||
endif
|
||||
|
||||
MKSHLIB += $(LD) $(SHLIB_LD_OPTS) -shared -soname $(@:$(OBJDIR)/%.so=%.so)
|
||||
|
||||
DSO_LDOPTS = -elf -shared -all
|
||||
|
||||
ifdef DSO_BACKEND
|
||||
DSO_LDOPTS += -soname $(DSO_NAME)
|
||||
endif
|
||||
|
||||
#
|
||||
# Revision notes:
|
||||
#
|
||||
# In the IRIX compilers prior to version 7.2, -n32 implied -mips3.
|
||||
# Beginning in the 7.2 compilers, -n32 implies -mips4 when the compiler
|
||||
# is running on a system with a mips4 CPU (e.g. R8K, R10K).
|
||||
# We want our code to explicitly be mips3 code, so we now explicitly
|
||||
# set -mips3 whenever we set -n32.
|
||||
#
|
||||
35
mozilla/security/coreconf/IRIX5.2.mk
Normal file
35
mozilla/security/coreconf/IRIX5.2.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 5.2
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/IRIX5.mk
|
||||
37
mozilla/security/coreconf/IRIX5.3.mk
Normal file
37
mozilla/security/coreconf/IRIX5.3.mk
Normal file
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 5.3
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/IRIX5.mk
|
||||
|
||||
OS_CFLAGS += -DIRIX5_3
|
||||
40
mozilla/security/coreconf/IRIX5.mk
Normal file
40
mozilla/security/coreconf/IRIX5.mk
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 5
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/IRIX.mk
|
||||
|
||||
ifndef NS_USE_GCC
|
||||
ODD_CFLAGS += -xgot
|
||||
endif
|
||||
43
mozilla/security/coreconf/IRIX6.2.mk
Normal file
43
mozilla/security/coreconf/IRIX6.2.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 6.2
|
||||
#
|
||||
|
||||
|
||||
# catch unresolved symbols
|
||||
|
||||
SHLIB_LD_OPTS += -no_unresolved
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/IRIX6.mk
|
||||
|
||||
OS_CFLAGS += -DIRIX6_2
|
||||
42
mozilla/security/coreconf/IRIX6.3.mk
Normal file
42
mozilla/security/coreconf/IRIX6.3.mk
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 6.3
|
||||
#
|
||||
|
||||
# catch unresolved symbols
|
||||
|
||||
SHLIB_LD_OPTS += -no_unresolved
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/IRIX6.mk
|
||||
|
||||
OS_CFLAGS += -DIRIX6_3
|
||||
45
mozilla/security/coreconf/IRIX6.5.mk
Normal file
45
mozilla/security/coreconf/IRIX6.5.mk
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 6.5
|
||||
#
|
||||
|
||||
# catch unresolved symbols
|
||||
|
||||
SHLIB_LD_OPTS += -no_unresolved
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/IRIX6.mk
|
||||
|
||||
OS_CFLAGS += -DIRIX6_5
|
||||
ifndef NS_USE_GCC
|
||||
OS_CFLAGS += -mips3
|
||||
endif
|
||||
47
mozilla/security/coreconf/IRIX6.mk
Normal file
47
mozilla/security/coreconf/IRIX6.mk
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for IRIX 6
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/IRIX.mk
|
||||
|
||||
ifndef NS_USE_GCC
|
||||
ifneq ($(USE_N32),1)
|
||||
OS_CFLAGS += -32
|
||||
endif
|
||||
ODD_CFLAGS += -multigot
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
OS_LIBS += -lpthread
|
||||
endif
|
||||
105
mozilla/security/coreconf/Linux.mk
Normal file
105
mozilla/security/coreconf/Linux.mk
Normal file
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for Linux
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
#
|
||||
# The default implementation strategy for Linux is now pthreads
|
||||
#
|
||||
USE_PTHREADS = 1
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
IMPL_STRATEGY = _PTH
|
||||
endif
|
||||
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
RANLIB = ranlib
|
||||
|
||||
DEFAULT_COMPILER = gcc
|
||||
|
||||
ifeq ($(OS_TEST),ppc)
|
||||
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
|
||||
CPU_ARCH = ppc
|
||||
else
|
||||
ifeq ($(OS_TEST),alpha)
|
||||
OS_REL_CFLAGS = -D_ALPHA_ -DLINUX1_2 -D_XOPEN_SOURCE
|
||||
CPU_ARCH = alpha
|
||||
else
|
||||
ifeq ($(OS_TEST),sparc)
|
||||
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
|
||||
CPU_ARCH = sparc
|
||||
else
|
||||
ifeq ($(OS_TEST),sparc64)
|
||||
OS_REL_CFLAGS = -DLINUX1_2 -D_XOPEN_SOURCE
|
||||
CPU_ARCH = sparc
|
||||
else
|
||||
OS_REL_CFLAGS = -DLINUX1_2 -Di386 -D_XOPEN_SOURCE
|
||||
CPU_ARCH = x86
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
LIBC_TAG = _glibc
|
||||
|
||||
ifeq ($(OS_RELEASE),2.0)
|
||||
OS_REL_CFLAGS += -DLINUX2_0
|
||||
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
OS_PTHREAD = -lpthread
|
||||
endif
|
||||
|
||||
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DLINUX -Dlinux -D_POSIX_SOURCE -D_BSD_SOURCE -DHAVE_STRERROR
|
||||
OS_LIBS = -L/lib $(OS_PTHREAD) -ldl -lc
|
||||
|
||||
ifdef USE_PTHREADS
|
||||
DEFINES += -D_REENTRANT
|
||||
endif
|
||||
|
||||
ARCH = linux
|
||||
|
||||
DSO_CFLAGS = -fPIC
|
||||
DSO_LDOPTS = -shared
|
||||
DSO_LDFLAGS =
|
||||
|
||||
# INCLUDES += -I/usr/include -Y/usr/include/linux
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
44
mozilla/security/coreconf/Linux2.1.mk
Normal file
44
mozilla/security/coreconf/Linux2.1.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for Linux 2.1 (ELF)
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/Linux.mk
|
||||
ifeq ($(OS_RELEASE),2.1)
|
||||
OS_REL_CFLAGS += -DLINUX2_1
|
||||
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O2
|
||||
endif
|
||||
endif
|
||||
|
||||
43
mozilla/security/coreconf/Linux2.2.mk
Normal file
43
mozilla/security/coreconf/Linux2.2.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for Linux 2.2 (ELF)
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/Linux.mk
|
||||
|
||||
OS_REL_CFLAGS += -DLINUX2_1
|
||||
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O2
|
||||
endif
|
||||
|
||||
43
mozilla/security/coreconf/Linux2.4.mk
Normal file
43
mozilla/security/coreconf/Linux2.4.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for Linux 2.4 (ELF)
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/Linux.mk
|
||||
|
||||
OS_REL_CFLAGS += -DLINUX2_1
|
||||
MKSHLIB = $(CC) -shared -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so)
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O2
|
||||
endif
|
||||
|
||||
36
mozilla/security/coreconf/LinuxELF1.2.mk
Normal file
36
mozilla/security/coreconf/LinuxELF1.2.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for Linux 1.2 (ELF)
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/Linux.mk
|
||||
36
mozilla/security/coreconf/LinuxELF2.0.mk
Normal file
36
mozilla/security/coreconf/LinuxELF2.0.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for Linux 2.0 (ELF)
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/Linux.mk
|
||||
43
mozilla/security/coreconf/Makefile
Normal file
43
mozilla/security/coreconf/Makefile
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
DEPTH = ..
|
||||
CORE_DEPTH = ..
|
||||
|
||||
MODULE = coreconf
|
||||
|
||||
DIRS = nsinstall mkdepend md
|
||||
|
||||
include $(DEPTH)/coreconf/config.mk
|
||||
include $(DEPTH)/coreconf/rules.mk
|
||||
|
||||
export:: libs
|
||||
90
mozilla/security/coreconf/NCR3.0.mk
Normal file
90
mozilla/security/coreconf/NCR3.0.mk
Normal file
@@ -0,0 +1,90 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for NCR SysVr4 v 3.0
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
###
|
||||
NS_USE_NATIVE = 1
|
||||
|
||||
# NS_USE_GCC = 1
|
||||
|
||||
export PATH:=$(PATH):/opt/ncc/bin
|
||||
###
|
||||
|
||||
RANLIB = true
|
||||
GCC_FLAGS_EXTRA += -pipe
|
||||
|
||||
DEFINES += -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR
|
||||
|
||||
OS_CFLAGS += -Hnocopyr -DSVR4 -DSYSV -DHAVE_STRERROR -DNCR -DPRFSTREAMS_BROKEN
|
||||
|
||||
ifdef NS_USE_NATIVE
|
||||
CC = cc
|
||||
CCC = ncc
|
||||
CXX = ncc
|
||||
# OS_LIBS += -L/opt/ncc/lib
|
||||
else
|
||||
# OS_LIBS +=
|
||||
endif
|
||||
|
||||
#OS_LIBS += -lsocket -lnsl -ldl -lc
|
||||
|
||||
MKSHLIB += $(LD) $(DSO_LDOPTS)
|
||||
#DSO_LDOPTS += -G -z defs
|
||||
DSO_LDOPTS += -G
|
||||
|
||||
CPU_ARCH = x86
|
||||
ARCH = ncr
|
||||
|
||||
NOSUCHFILE = /solaris-rm-f-sucks
|
||||
|
||||
# now take care of default GCC (rus@5/5/97)
|
||||
|
||||
ifdef NS_USE_GCC
|
||||
# if gcc-settings are redefined already - don't touch it
|
||||
#
|
||||
ifeq (,$(findstring gcc, $(CC)))
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
CXX = g++
|
||||
# always use -fPIC - some makefiles are still broken and don't distinguish
|
||||
# situation when they build shared and static libraries
|
||||
CFLAGS += -fPIC -Wall $(GCC_FLAGS_EXTRA)
|
||||
# OS_LIBS += -L/usr/local/lib -lstdc++ -lg++ -lgcc
|
||||
endif
|
||||
endif
|
||||
###
|
||||
61
mozilla/security/coreconf/NEC4.2.mk
Normal file
61
mozilla/security/coreconf/NEC4.2.mk
Normal file
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for NEC Mips SYSV
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = $(CORE_DEPTH)/build/hcc
|
||||
|
||||
CPU_ARCH = mips
|
||||
|
||||
ifdef NS_USE_GCC
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
else
|
||||
CC = $(CORE_DEPTH)/build/hcc
|
||||
OS_CFLAGS = -Xa -KGnum=0 -KOlimit=4000
|
||||
CCC = g++
|
||||
endif
|
||||
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
|
||||
RANLIB = /bin/true
|
||||
|
||||
OS_CFLAGS += $(ODD_CFLAGS) -DSVR4 -D__SVR4 -DNEC -Dnec_ews -DHAVE_STRERROR
|
||||
OS_LIBS = -lsocket -lnsl -ldl $(LDOPTIONS)
|
||||
LDOPTIONS = -lc -L/usr/ucblib -lucb
|
||||
|
||||
NOSUCHFILE = /nec-rm-f-sucks
|
||||
|
||||
DSO_LDOPTS = -G
|
||||
77
mozilla/security/coreconf/NetBSD.mk
Normal file
77
mozilla/security/coreconf/NetBSD.mk
Normal file
@@ -0,0 +1,77 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for NetBSD
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = gcc
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
RANLIB = ranlib
|
||||
|
||||
OS_REL_CFLAGS = -Di386
|
||||
CPU_ARCH = x86
|
||||
|
||||
ifndef OBJECT_FMT
|
||||
OBJECT_FMT := $(shell if echo __ELF__ | $${CC:-cc} -E - | grep -q __ELF__ ; then echo a.out ; else echo ELF ; fi)
|
||||
endif
|
||||
|
||||
ifeq ($(OBJECT_FMT),ELF)
|
||||
DLL_SUFFIX = so
|
||||
else
|
||||
DLL_SUFFIX = so.1.0
|
||||
endif
|
||||
|
||||
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -ansi -Wall -pipe -DNETBSD -Dunix -DHAVE_STRERROR -DHAVE_BSD_FLOCK
|
||||
|
||||
OS_LIBS = -lcompat
|
||||
|
||||
ARCH = netbsd
|
||||
|
||||
DSO_CFLAGS = -fPIC -DPIC
|
||||
DSO_LDOPTS = -shared
|
||||
DSO_LDFLAGS =
|
||||
ifeq ($(OBJECT_FMT),ELF)
|
||||
DSO_LDOPTS += -Wl,-soname,lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
||||
endif
|
||||
|
||||
ifdef LIBRUNPATH
|
||||
DSO_LDOPTS += -Wl,-R$(LIBRUNPATH)
|
||||
endif
|
||||
|
||||
MKSHLIB = $(CC) $(DSO_LDOPTS)
|
||||
|
||||
G++INCLUDES = -I/usr/include/g++
|
||||
|
||||
INCLUDES += -I/usr/X11R6/include
|
||||
220
mozilla/security/coreconf/OS2.mk
Normal file
220
mozilla/security/coreconf/OS2.mk
Normal file
@@ -0,0 +1,220 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
|
||||
MOZ_WIDGET_TOOLKIT = os2
|
||||
|
||||
# Specify toolset. Default to EMX.
|
||||
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
||||
XP_OS2_VACPP = 1
|
||||
else
|
||||
ifeq ($(MOZ_OS2_TOOLS),PGCC)
|
||||
XP_OS2_EMX = 1
|
||||
else
|
||||
MOZ_OS2_TOOLS = EMX
|
||||
XP_OS2_EMX = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
# XP_PC is for Window and OS2 on Intel X86
|
||||
# XP_OS2 is strictly for OS2 only
|
||||
XP_DEFINE += -DXP_PC=1 -DXP_OS2=1
|
||||
|
||||
# Override suffix in suffix.mk
|
||||
LIB_SUFFIX = lib
|
||||
DLL_SUFFIX = dll
|
||||
OBJ_SUFFIX = .obj
|
||||
ASM_SUFFIX = .asm
|
||||
PROG_SUFFIX = .exe
|
||||
|
||||
|
||||
ifdef XP_OS2_EMX
|
||||
|
||||
#
|
||||
# On OS/2 we proudly support gbash...
|
||||
#
|
||||
SHELL = GBASH.EXE
|
||||
CCC = gcc
|
||||
LINK = gcc
|
||||
AR = emxomfar -p256 r $@
|
||||
# Keep AR_FLAGS blank so that we do not have to change rules.mk
|
||||
AR_FLAGS =
|
||||
RANLIB = @echo OS2 RANLIB
|
||||
BSDECHO = @echo OS2 BSDECHO
|
||||
IMPLIB = emximp -o
|
||||
FILTER = emxexp
|
||||
|
||||
ifndef NO_SHARED_LIB
|
||||
WRAP_MALLOC_LIB =
|
||||
WRAP_MALLOC_CFLAGS =
|
||||
DSO_CFLAGS =
|
||||
DSO_PIC_CFLAGS =
|
||||
MKSHLIB = $(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@
|
||||
MKCSHLIB = $(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@
|
||||
MKSHLIB_FORCE_ALL =
|
||||
MKSHLIB_UNFORCE_ALL =
|
||||
DSO_LDOPTS = -Zomf -Zdll -Zmt -Zcrtdll -Zlinker /NOO
|
||||
# DLL_SUFFIX = .dll
|
||||
SHLIB_LDSTARTFILE =
|
||||
SHLIB_LDENDFILE =
|
||||
endif #NO_SHARED_LIB
|
||||
|
||||
OS_CFLAGS = -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Zmtd -Zomf -Zmt -DDEBUG -DDEBUG_wintrinh -DTRACING -g
|
||||
|
||||
# Where the libraries are
|
||||
MOZ_COMPONENT_NSPR_LIBS=-L$(DIST)/lib $(NSPR_LIBS)
|
||||
NSPR_LIBS = -lplds4 -lplc4 -lnspr4
|
||||
NSPR_INCLUDE_DIR =
|
||||
|
||||
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -O6
|
||||
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
|
||||
DLLFLAGS = -DLL -OUT:$@ -MAP:$(@:.dll=.map)
|
||||
EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
|
||||
OBJDIR_TAG = _OPT
|
||||
else
|
||||
#OPTIMIZER = -O+ -Oi
|
||||
DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
|
||||
DLLFLAGS = -DEBUG -DLL -OUT:$@ -MAP:$(@:.dll=.map)
|
||||
EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
|
||||
OBJDIR_TAG = _DBG
|
||||
LDFLAGS = -DEBUG
|
||||
endif # BUILD_OPT
|
||||
|
||||
else # XP_OS2_VACPP
|
||||
|
||||
#
|
||||
# On OS/2 we proudly support gbash...
|
||||
#
|
||||
SHELL = GBASH.EXE
|
||||
CCC = icc -q -DXP_OS2 -DOS2=4 -N10
|
||||
LINK = -ilink
|
||||
AR = -ilib /NOL /NOI /O:$(subst /,\\,$@)
|
||||
# Keep AR_FLAGS blank so that we do not have to change rules.mk
|
||||
AR_FLAGS =
|
||||
RANLIB = @echo OS2 RANLIB
|
||||
BSDECHO = @echo OS2 BSDECHO
|
||||
IMPLIB = implib /NOL /NOI
|
||||
FILTER = cppfilt -b -p -q
|
||||
|
||||
ifndef NO_SHARED_LIB
|
||||
WRAP_MALLOC_LIB =
|
||||
WRAP_MALLOC_CFLAGS =
|
||||
DSO_CFLAGS =
|
||||
DSO_PIC_CFLAGS =
|
||||
MKSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
MKCSHLIB = $(LD) $(DSO_LDOPTS)
|
||||
MKSHLIB_FORCE_ALL =
|
||||
MKSHLIB_UNFORCE_ALL =
|
||||
DSO_LDOPTS =
|
||||
# DLL_SUFFIX = .dll
|
||||
SHLIB_LDSTARTFILE =
|
||||
SHLIB_LDENDFILE =
|
||||
endif #NO_SHARED_LIB
|
||||
|
||||
OS_CFLAGS = /Q /qlibansi /Gd /Gm /Su4 /Mp /Tl-
|
||||
INCLUDES += -I$(CORE_DEPTH)/../dist/include
|
||||
DEFINES += -DXP_OS2_VACPP -DTCPV40HDRS
|
||||
|
||||
# Where the libraries are
|
||||
NSPR_LIBS = $(DIST)/lib/nspr4.lib $(DIST)/lib/plc4.lib $(DIST)/lib/plds4.lib
|
||||
MOZ_COMPONENT_NSPR_LIBS=-L$(DIST)/lib $(NSPR_LIBS)
|
||||
NSPR_INCLUDE_DIR =
|
||||
|
||||
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER = -Oi -G5
|
||||
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
|
||||
DLLFLAGS = /DLL /O:$@ /INC:_dllentry /MAP:$(@:.dll=.map)
|
||||
EXEFLAGS = -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
|
||||
OBJDIR_TAG = _OPT
|
||||
LDFLAGS = /FREE /NODEBUG /NOE /LINENUMBERS /nologo
|
||||
else
|
||||
OS_CFLAGS += /Ti+
|
||||
DEFINES += -DDEBUG -D_DEBUG -DDEBUGPRINTS #HCT Need += to avoid overidding manifest.mn
|
||||
DLLFLAGS = /DEBUG /DLL /O:$@ /INC:_dllentry /MAP:$(@:.dll=.map)
|
||||
EXEFLAGS = -DEBUG -PMTYPE:VIO -OUT:$@ -MAP:$(@:.exe=.map) -nologo -NOE
|
||||
OBJDIR_TAG = _DBG
|
||||
LDFLAGS = /FREE /DE /NOE /LINENUMBERS /nologo
|
||||
endif # BUILD_OPT
|
||||
|
||||
endif # XP_OS2_VACPP
|
||||
|
||||
# OS/2 use nsinstall that is included in the toolkit.
|
||||
# since we do not wish to support and maintain 3 version of nsinstall in mozilla, nspr and nss
|
||||
|
||||
ifdef BUILD_TREE
|
||||
NSINSTALL_DIR = $(BUILD_TREE)/nss
|
||||
else
|
||||
NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
|
||||
endif
|
||||
# NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
|
||||
NSINSTALL = nsinstall # HCT4OS2
|
||||
INSTALL = $(NSINSTALL)
|
||||
|
||||
MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
|
||||
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend
|
||||
MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
|
||||
|
||||
####################################################################
|
||||
#
|
||||
# One can define the makefile variable NSDISTMODE to control
|
||||
# how files are published to the 'dist' directory. If not
|
||||
# defined, the default is "install using relative symbolic
|
||||
# links". The two possible values are "copy", which copies files
|
||||
# but preserves source mtime, and "absolute_symlink", which
|
||||
# installs using absolute symbolic links. The "absolute_symlink"
|
||||
# option requires NFSPWD.
|
||||
# - THIS IS NOT PART OF THE NEW BINARY RELEASE PLAN for 9/30/97
|
||||
# - WE'RE KEEPING IT ONLY FOR BACKWARDS COMPATIBILITY
|
||||
####################################################################
|
||||
|
||||
ifeq ($(NSDISTMODE),copy)
|
||||
# copy files, but preserve source mtime
|
||||
INSTALL = $(NSINSTALL)
|
||||
INSTALL += -t
|
||||
else
|
||||
ifeq ($(NSDISTMODE),absolute_symlink)
|
||||
# install using absolute symbolic links
|
||||
INSTALL = $(NSINSTALL)
|
||||
INSTALL += -L `$(NFSPWD)`
|
||||
else
|
||||
# install using relative symbolic links
|
||||
INSTALL = $(NSINSTALL)
|
||||
INSTALL += -R
|
||||
endif
|
||||
endif
|
||||
|
||||
define MAKE_OBJDIR
|
||||
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
|
||||
endef
|
||||
66
mozilla/security/coreconf/OSF1.mk
Normal file
66
mozilla/security/coreconf/OSF1.mk
Normal file
@@ -0,0 +1,66 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for DEC OSF/1
|
||||
#
|
||||
|
||||
#
|
||||
# The Bourne shell (sh) on OSF1 doesn't handle "set -e" correctly,
|
||||
# which we use to stop LOOP_OVER_DIRS submakes as soon as any
|
||||
# submake fails. So we use the Korn shell instead.
|
||||
#
|
||||
SHELL = /usr/bin/ksh
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
CC = cc
|
||||
OS_CFLAGS += $(NON_LD_FLAGS) -std1
|
||||
CCC = cxx
|
||||
RANLIB = /bin/true
|
||||
CPU_ARCH = alpha
|
||||
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER += -Olimit 4000
|
||||
endif
|
||||
|
||||
NON_LD_FLAGS += -ieee_with_inexact
|
||||
OS_CFLAGS += -DOSF1 -D_REENTRANT
|
||||
|
||||
ifeq ($(USE_PTHREADS),1)
|
||||
OS_CFLAGS += -pthread
|
||||
endif
|
||||
|
||||
# The command to build a shared library on OSF1.
|
||||
MKSHLIB += ld -shared -expect_unresolved "*" -soname $(notdir $@)
|
||||
DSO_LDOPTS += -shared
|
||||
35
mozilla/security/coreconf/OSF1V2.0.mk
Normal file
35
mozilla/security/coreconf/OSF1V2.0.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V2.0
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1.mk
|
||||
35
mozilla/security/coreconf/OSF1V3.0.mk
Normal file
35
mozilla/security/coreconf/OSF1V3.0.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V3.0
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1.mk
|
||||
44
mozilla/security/coreconf/OSF1V3.2.mk
Normal file
44
mozilla/security/coreconf/OSF1V3.2.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On OSF1 V3.2, classic nspr is the default (and only) implementation
|
||||
# strategy.
|
||||
#
|
||||
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V3.2
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1.mk
|
||||
|
||||
ifeq ($(OS_RELEASE),V3.2)
|
||||
OS_CFLAGS += -DOSF1V3
|
||||
endif
|
||||
51
mozilla/security/coreconf/OSF1V4.0.mk
Normal file
51
mozilla/security/coreconf/OSF1V4.0.mk
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On OSF1 V4.0, pthreads is the default implementation strategy.
|
||||
# Classic nspr is also available.
|
||||
#
|
||||
ifneq ($(OS_RELEASE),V3.2)
|
||||
USE_PTHREADS = 1
|
||||
ifeq ($(CLASSIC_NSPR), 1)
|
||||
USE_PTHREADS =
|
||||
IMPL_STRATEGY := _CLASSIC
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V4.0
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1.mk
|
||||
|
||||
ifeq ($(OS_RELEASE),V4.0)
|
||||
OS_CFLAGS += -DOSF1V4
|
||||
endif
|
||||
35
mozilla/security/coreconf/OSF1V4.0B.mk
Normal file
35
mozilla/security/coreconf/OSF1V4.0B.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V4.0B
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1V4.0.mk
|
||||
39
mozilla/security/coreconf/OSF1V4.0D.mk
Normal file
39
mozilla/security/coreconf/OSF1V4.0D.mk
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V4.0D
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1V4.0.mk
|
||||
DEFINES += -DOSF1V4D
|
||||
|
||||
OS_LIBS += -lpthread -lrt
|
||||
|
||||
47
mozilla/security/coreconf/OSF1V5.0.mk
Normal file
47
mozilla/security/coreconf/OSF1V5.0.mk
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# On OSF1 V5.0, pthreads is the default implementation strategy.
|
||||
# Classic nspr is also available.
|
||||
#
|
||||
ifneq ($(OS_RELEASE),V3.2)
|
||||
USE_PTHREADS = 1
|
||||
ifeq ($(CLASSIC_NSPR), 1)
|
||||
USE_PTHREADS =
|
||||
IMPL_STRATEGY := _CLASSIC
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Config stuff for DEC OSF/1 V5.0
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/OSF1.mk
|
||||
56
mozilla/security/coreconf/OpenVMS.mk
Executable file
56
mozilla/security/coreconf/OpenVMS.mk
Executable file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.1 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Config stuff for Compaq OpenVMS
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
ifdef INTERNAL_TOOLS
|
||||
CC = c89
|
||||
CCC = cxx
|
||||
OPTIMIZER = -O
|
||||
else
|
||||
CC = ccc
|
||||
CCC = ccc
|
||||
endif
|
||||
|
||||
RANLIB = /bin/true
|
||||
|
||||
CPU_ARCH := $(shell uname -Wh)
|
||||
|
||||
OS_CFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
|
||||
-DGENERIC_PTHREAD_REDEFINES -DNO_UDSOCK
|
||||
OS_CXXFLAGS = -DVMS -DVMS_AS_IS -Wc,names=\(short,as\) \
|
||||
-DGENERIC_PTHREAD_REDEFINES -DNO_UDSOCK
|
||||
|
||||
# Maybe this should go into rules.mk or something?
|
||||
ifdef NSPR_INCLUDE_DIR
|
||||
INCLUDES += -I$(NSPR_INCLUDE_DIR)
|
||||
endif
|
||||
|
||||
#
|
||||
# XCFLAGS are the only CFLAGS that are used during a link operation. Defining
|
||||
# OPTIMIZER in XCFLAGS means that each compilation line gets OPTIMIZER
|
||||
# included twice, but at least we get OPTIMIZER included in the link
|
||||
# operations; and OpenVMS needs it!
|
||||
#
|
||||
XCFLAGS += $(OPTIMIZER)
|
||||
|
||||
# The command to build a shared library in POSIX on OpenVMS.
|
||||
MKSHLIB = vmsld_psm OBJDIR=$(OBJDIR) $(OPTIMIZER)
|
||||
22
mozilla/security/coreconf/OpenVMSV7.1-2.mk
Executable file
22
mozilla/security/coreconf/OpenVMSV7.1-2.mk
Executable file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.1 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Config stuff for Compaq OpenVMS
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/OpenVMS.mk
|
||||
563
mozilla/security/coreconf/README
Normal file
563
mozilla/security/coreconf/README
Normal file
@@ -0,0 +1,563 @@
|
||||
OVERVIEW of "ns/coreconf":
|
||||
|
||||
This README file is an attempt to provide the reader with a simple
|
||||
synopsis of the "ns/coreconf" build system which was originally
|
||||
fundamentally designed and built to accomodate Netscape's binary
|
||||
release model. Wherever possible, an attempt has been made to
|
||||
comply with the NSPR 2.0 build system, including mimicing the
|
||||
compiler/linker flags, and directory naming structure. The reader
|
||||
should keep in mind that the system builds binary releases of
|
||||
header files, class files, libraries, and executables on numerous
|
||||
flavors of UNIX and Windows operating systems. Unfortunately,
|
||||
no serious attempt has ever been made to incorporate an ability to
|
||||
generate cross-platform binaries on an Apple MacIntosh platform.
|
||||
|
||||
Note that this file will not attempt to redefine or document the
|
||||
architecture of this system. However, documents on this subject
|
||||
are available at the following URL:
|
||||
|
||||
http://warp/hardcore/prj-ttools/specs/release/index.html
|
||||
|
||||
|
||||
|
||||
DEPENDENCIES of "ns/coreconf":
|
||||
|
||||
The "ns/coreconf" build system requires the specified versions of
|
||||
the following platform-dependent tools:
|
||||
|
||||
UNIX Platforms:
|
||||
--------------
|
||||
gmake (version 3.74 or later)
|
||||
perl 4.0 (NOTE: perl 5.003 or later recommended)
|
||||
uname
|
||||
|
||||
Windows Platforms:
|
||||
-----------------
|
||||
gmake 3.74 (must use hacked Netscape version)
|
||||
shmsdos.exe (contained in Netscape gmake.exe)
|
||||
nsinstall.exe (contained in Netscape gmake.exe)
|
||||
perl.exe (version 4.0 for everything except testing;
|
||||
NOTE: MKS toolkit perl 5.002 is broken)
|
||||
perl5.exe (for testing;
|
||||
NOTE: perl 5.003 or later recommended;
|
||||
MKS toolkit perl 5.002 is broken)
|
||||
uname.exe (use nstools version)
|
||||
|
||||
ENHANCEMENTS to "ns/coreconf":
|
||||
|
||||
With the advent of Certificate Server 4.0 using the ns/coreconf
|
||||
build system, several changes had to be made to enhance
|
||||
ns/coreconf support for building Java/JNI classes/programs, as
|
||||
well as libraries slated to be released as binaries. While the
|
||||
following may not represent an exhaustive list of these changes,
|
||||
it does attempt to be at least somewhat comprehensive:
|
||||
|
||||
(1) During the course of these enhancements, a total of
|
||||
four files have been modified, and four new files have
|
||||
been added.
|
||||
|
||||
The following files have been modified:
|
||||
|
||||
- command.mk: removed old definition of JAR
|
||||
|
||||
- config.mk: added include statement of new
|
||||
"jdk.mk" file
|
||||
|
||||
- ruleset.mk: allowed the $(MKPROG) variable to be
|
||||
overridden by supplying it with a
|
||||
default value of $(CC); augmented
|
||||
numerous definitions to enhance
|
||||
ability of ns/coreconf to produce
|
||||
a more robust set of libraries;
|
||||
added some JNI definitions; PACKAGE
|
||||
definition may be overridden by new
|
||||
"jdk.mk" file
|
||||
|
||||
- rules.mk: separated the compile phase of a
|
||||
program from the link phase of a
|
||||
program such that a developer can
|
||||
now strictly override program linkage
|
||||
by simply supplying a $(MKPROG)
|
||||
variable; augmented NETLIBDEPTH
|
||||
to use CORE_DEPTH but retain backward
|
||||
compatibility; added JNI section;
|
||||
modified .PRECIOUS rule;
|
||||
|
||||
The following files have been added:
|
||||
|
||||
- README: this file; an ASCII-based text
|
||||
document used to summarize the
|
||||
ns/coreconf build system and
|
||||
suitable (paginated) for printing
|
||||
|
||||
- jdk.mk: a file comprising most (if not all)
|
||||
of the default Java related build
|
||||
information; the definitions in this
|
||||
file are only included if NS_USE_JDK
|
||||
has been defined
|
||||
|
||||
- jniregen.pl: a perl script used to create a
|
||||
dependency for when JNI files should
|
||||
be regenerated (based upon any change
|
||||
to the ".class" file from which the
|
||||
".h" file was originally generated)
|
||||
|
||||
- outofdate.pl: a perl script used to create a
|
||||
dependency for when ".class" files
|
||||
should be regenerated (based upon
|
||||
any change to the ".java" file
|
||||
from which the ".class" file was
|
||||
originally generated)
|
||||
|
||||
(2) As stated above, the ns/coreconf build system now separates
|
||||
the link phase of a program from its compilation phase.
|
||||
While ns/coreconf still works exactly as it used to because
|
||||
the $(MKPROG) variable is assigned $(CC) by default, a developer
|
||||
may now override this behavior by simply supplying their
|
||||
own unique value for $(MKPROG) on every platform. This allows
|
||||
a program compiled with $(CC) to link with external libraries
|
||||
that may contain "C++" linkage. Before this change, a
|
||||
programmer would need to reference their own local copy of
|
||||
rules.mk (see the ns/sectools/cmd/pk12util program for
|
||||
an example of how this used to be accomplished).
|
||||
|
||||
(3) Currently, the ns/coreconf build system differs from the
|
||||
NSPR 2.0 build system which utilizes an "_s" to denote
|
||||
static libraries from import libraries. In fact, the
|
||||
ns/coreconf build system adds no prefixes or suffixes to
|
||||
distinguish one version of static libraries from another.
|
||||
Note that both the ns/coreconf build system as well as the
|
||||
NSPR 2.0 build system do nothing to provide a method of
|
||||
distinguishing 16-bit from 32-bit static libraries on the
|
||||
same machine, either, since:
|
||||
|
||||
a) this might only provide difficulty during
|
||||
development, since static libraries always
|
||||
need to be embedded within a program
|
||||
(note this is highly unlikely, since libraries
|
||||
for different platforms are subdivided via
|
||||
a well-known subdirectory structure, and
|
||||
a developer may use multiple trees for
|
||||
development),
|
||||
|
||||
b) this maintains backwards compatibility,
|
||||
something very important since no legacy
|
||||
programs will need to change their link phase, and
|
||||
|
||||
c) Netscape as a company has dropped any plans
|
||||
of future development of 16-bit products.
|
||||
|
||||
(4) Since several members of the Hardcore Security group did
|
||||
not favor NSPR 2.0's solution of adding an "_s" to static
|
||||
libraries on Windows platforms as a method to distinguish
|
||||
them from their import library cousins, a different solution
|
||||
was proposed and has been recently implemented for ns/coreconf:
|
||||
|
||||
- a 16 has been added as a suffix to both dynamic and
|
||||
import libraries built on 16-bit Windows platforms
|
||||
|
||||
- a 32 has been added as a suffix to both dynamic and
|
||||
import libraries built on 32-bit Windows platforms
|
||||
|
||||
Since, the HCL release process currently only contains a
|
||||
single instance of building a dynamic library,
|
||||
ns/security/lib/fortcrypt/fort12.dll, the impact of this
|
||||
change should be relatively small.
|
||||
|
||||
It should be noted that although this would additionally
|
||||
limit the 8.3 namespace on 16-bit platforms, it is highly
|
||||
unlikely that any future development will be performed on
|
||||
this platform.
|
||||
|
||||
(5) The $(LIBRARY_VERSION) tag has been added to all non-static
|
||||
libraries created on UNIX operating systems to alleviate
|
||||
any future confusion for binary releases which utilize this
|
||||
tag. Again, it should be noted that this tag is only
|
||||
utilized on non-static libraries, since more than one
|
||||
version of the library may need to exist simultaneously
|
||||
if multiple products are utilized.
|
||||
|
||||
Currently, only one HCL released library utilizes this tag:
|
||||
|
||||
ns/security/lib/fortcrypt/fort12.a
|
||||
(e. g. - in this library, the tag has been set to '12')
|
||||
|
||||
Again, it should be noted that although this would
|
||||
additionally limit the 8.3 namespace on 16-bit platforms,
|
||||
it is highly unlikely that any future development will be
|
||||
performed on this platform.
|
||||
|
||||
(6) The $(JDK_DEBUG_SUFFIX) extension has been added to all
|
||||
library and program names to support debug versions of
|
||||
Java programs (e. g. - java_g, javac_g, etc).
|
||||
|
||||
Once again, it should be noted that although this would
|
||||
additionally limit the 8.3 namespace on 16-bit platforms,
|
||||
it is highly unlikely that any future Java development
|
||||
will be performed on this platform.
|
||||
|
||||
(7) Most (if not all) default definitions for java have been
|
||||
encapsulated within their own file, jdk.mk, which is
|
||||
always included by default in ns/coreconf/config.mk.
|
||||
However, the definitions within this file are only ever
|
||||
activated if NS_USE_JDK has been set to be 1.
|
||||
|
||||
|
||||
(8) Two perl scripts (jniregen.pl and outofdate.pl) have been
|
||||
added to the system to foster a more robust development
|
||||
environment for composing Java and JNI programs
|
||||
utilizing the ns/coreconf build system. Both of these
|
||||
perl scripts are related to resolving dependencies which
|
||||
can not be accomplished through normal makefile dependencies.
|
||||
|
||||
(9) This file, README, was created in an attempt to allow
|
||||
developers who have familiarity with ns/coreconf a simple
|
||||
roadmap for what has changed, as well as a top-level view of
|
||||
what comprises ns/coreconf. This file was written in
|
||||
ASCII (rather than HTML) primarily to promote simple
|
||||
paginated printing.
|
||||
|
||||
OVERVIEW of "config.mk":
|
||||
|
||||
This file contains the configuration information necessary to
|
||||
build each "Core Components" source module:
|
||||
|
||||
include file name Purpose
|
||||
=================== =======================================
|
||||
arch.mk source and release <architecture> tags
|
||||
|
||||
command.mk default command macros
|
||||
(NOTE: may be overridden in $(OS_CONFIG).mk)
|
||||
|
||||
$(OS_CONFIG).mk <architecture>-specific macros
|
||||
(dependent upon <architecture> tags)
|
||||
|
||||
platform.mk source and release <platform> tags
|
||||
(dependent upon <architecture> tags)
|
||||
|
||||
tree.mk release <tree> tags
|
||||
(dependent upon <architecture> tags)
|
||||
|
||||
module.mk source and release <component> tags
|
||||
(NOTE: A component is also called a module
|
||||
or a subsystem. This file is dependent upon
|
||||
$(MODULE) being defined on the command
|
||||
line, as an environment variable, or in
|
||||
individual makefiles, or more
|
||||
appropriately, manifest.mn)
|
||||
|
||||
version.mk release <version> tags
|
||||
(dependent upon $(MODULE) being defined on
|
||||
the command line, as an environment variable,
|
||||
or in individual makefiles, or more
|
||||
appropriately, manifest.mn)
|
||||
|
||||
location.mk macros to figure out binary code location
|
||||
(dependent upon <platform> tags)
|
||||
|
||||
source.mk <component>-specific source path
|
||||
(dependent upon <user_source_tree>,
|
||||
<source_component>, <version>, and
|
||||
<platform> tags)
|
||||
|
||||
headers.mk include switch for support header files
|
||||
(dependent upon <tree>, <component>, <version>,
|
||||
and <platform> tags)
|
||||
|
||||
prefix.mk compute program prefixes
|
||||
|
||||
suffix.mk compute program suffixes
|
||||
(dependent upon <architecture> tags)
|
||||
|
||||
jdk.mk define JDK
|
||||
(dependent upon <architecture>,
|
||||
<source>, and <suffix> tags)
|
||||
|
||||
ruleset.mk Master "Core Components" rule set
|
||||
(should always be the last file
|
||||
included by config.mk)
|
||||
|
||||
|
||||
|
||||
OVERVIEW of "rules.mk":
|
||||
|
||||
The "rules.mk" file consists of four sections. The first section
|
||||
contains the "master" build rules for all binary releases. While
|
||||
this section can (and should) largely be thought of as "language"
|
||||
independent, it does utilize the "perl" scripting language to
|
||||
perform both the "import" and "release" of binary modules.
|
||||
|
||||
The rules which dwell in this section and their purpose:
|
||||
|
||||
|
||||
CATEGORY/rule:: Purpose
|
||||
=================== =======================================
|
||||
|
||||
GENERAL
|
||||
-------
|
||||
all:: "default" all-encompassing rule which
|
||||
performs "export libs program install"
|
||||
|
||||
export:: recursively copy specified
|
||||
cross-platform header files to the
|
||||
$(SOURCE_XPHEADERS_DIR) directory;
|
||||
recursively copy specified
|
||||
machine-dependent header files to the
|
||||
$(SOURCE_MDHEADERS_DIR) directory;
|
||||
although all rules can be written to
|
||||
repetively "chain" into other sections,
|
||||
this rule is the most commonly used
|
||||
rule to "chain" into other sections
|
||||
such as Java providing a simple
|
||||
mechanism which allows no need for
|
||||
developers to memorize specialized
|
||||
rules
|
||||
|
||||
libs:: recursively build
|
||||
static (archival) $(LIBRARY), shared
|
||||
(dynamic link) $(SHARED_LIBRARY),
|
||||
and/or import $(IMPORT_LIBRARY)
|
||||
libraries
|
||||
|
||||
program:: recursively build $(PROGRAM)
|
||||
executable
|
||||
|
||||
install:: recursively copy all libraries to
|
||||
$(SOURCE_LIB_DIR) directory;
|
||||
recursively copy all executables to
|
||||
$(SOURCE_BIN_DIR) directory
|
||||
|
||||
clean:: remove all files specified in the
|
||||
$(ALL_TRASH) variable
|
||||
|
||||
clobber:: synonym for "clean::" rule
|
||||
|
||||
realclean:: remove all files specified by
|
||||
$(wildcard *.OBJ), dist, and in
|
||||
the $(ALL_TRASH) variable
|
||||
|
||||
clobber_all:: synonym for "realclean::" rule
|
||||
|
||||
private_export:: recursively copy specified
|
||||
cross-platform header files to the
|
||||
$(SOURCE_XPPRIVATE_DIR) directory
|
||||
|
||||
|
||||
IMPORT
|
||||
------
|
||||
import:: uses perl script to retrieve specified
|
||||
VERSION of the binary release from
|
||||
$(RELEASE_TREE)
|
||||
|
||||
RELEASE
|
||||
-------
|
||||
release_clean:: remove all files from the
|
||||
$(SOURCE_RELEASE_PREFIX) directory
|
||||
|
||||
release:: place specified VERSION of the
|
||||
binary release in the appropriate
|
||||
$(RELEASE_TREE) directory
|
||||
|
||||
release_export:: recursively copy specified
|
||||
cross-platform header files to the
|
||||
$(SOURCE_XPHEADERS_DIR)/include
|
||||
directory
|
||||
|
||||
release_md:: recursively copy all libraries to
|
||||
$(SOURCE_RELEASE_PREFIX)/
|
||||
$(SOURCE_RELEASE_LIB_DIR) directory;
|
||||
recursively copy all executables to
|
||||
$(SOURCE_RELEASE_PREFIX)/
|
||||
$(SOURCE_RELEASE_BIN_DIR) directory
|
||||
|
||||
release_jars:: use perl script to package appropriate
|
||||
files in the $(XPCLASS_JAR),
|
||||
$(XPHEADER_JAR), $(MDHEADER_JAR), and
|
||||
$(MDBINARY_JAR) jar files
|
||||
|
||||
release_cpdistdir:: use perl script to copy the
|
||||
$(XPCLASS_JAR), $(XPHEADER_JAR),
|
||||
$(MDHEADER_JAR), and $(MDBINARY_JAR)
|
||||
jar files to the specified VERSION
|
||||
of the $(RELEASE_TREE) directory
|
||||
|
||||
|
||||
|
||||
TOOLS and AUTOMATION
|
||||
--------------------
|
||||
platform:: tool used to display the platform name
|
||||
as composed within the "arch.mk" file
|
||||
|
||||
autobuild:: automation rule used by "Bonsai" and
|
||||
"Tinderbox" to automatically generate
|
||||
binary releases on various platforms
|
||||
|
||||
tests:: automation tool used to run the
|
||||
"regress" and "reporter" tools
|
||||
on various regression test suites
|
||||
|
||||
The second section of "rules.mk" primarily contains several
|
||||
"language" dependent build rules for binary releases. These are
|
||||
generally "computed" rules (created on the "fly"), and include
|
||||
rules used by "C", "C++", assembly, the preprocessor, perl, and
|
||||
the shell.
|
||||
|
||||
The rules which dwell in this section and their purpose:
|
||||
|
||||
|
||||
CATEGORY/rule:: Purpose
|
||||
=================== =============================
|
||||
|
||||
LIBRARIES
|
||||
---------
|
||||
$(LIBRARY): build the static library
|
||||
specified by the $(LIBRARY)
|
||||
variable
|
||||
|
||||
$(IMPORT_LIBRARY): build the import library
|
||||
specified by the
|
||||
$(IMPORT_LIBRARY) variable
|
||||
|
||||
$(SHARED_LIBRARY): build the shared
|
||||
(dynamic link) library
|
||||
specified by the
|
||||
$(SHARED_LIBRARY) variable
|
||||
|
||||
|
||||
PROGRAMS
|
||||
--------
|
||||
$(PROGRAM): build the binary executable
|
||||
specified by the $(PROGRAM)
|
||||
rule
|
||||
|
||||
$(OBJDIR)/
|
||||
$(PROG_PREFIX)%.pure: build the "purified" binary
|
||||
executable specified by this
|
||||
rule
|
||||
|
||||
|
||||
OBJECTS
|
||||
-------
|
||||
$(OBJDIR)/
|
||||
$(PROG_PREFIX)%$(OBJ_SUFFIX): build the object file
|
||||
associated with the
|
||||
makefile rule dependency:
|
||||
|
||||
%.c = C file
|
||||
%.cpp = C++ file
|
||||
%.cc = C++ file
|
||||
%.s = assembly file
|
||||
%.S = assembly file
|
||||
|
||||
$(OBJDIR)/
|
||||
$(PROG_PREFIX)%: (NOTE: deprecated rule)
|
||||
build the object file
|
||||
associated with the
|
||||
makefile rule dependency:
|
||||
|
||||
%.cpp = C++ file
|
||||
|
||||
MISCELLANEOUS
|
||||
-------------
|
||||
$(DIRS):: specifies a helper method
|
||||
used by $(LOOP_THROUGH_DIRS)
|
||||
to recursively change
|
||||
directories and invoke
|
||||
$(MAKE)
|
||||
|
||||
%.i: build the preprocessor file
|
||||
associated with the
|
||||
makefile rule dependency:
|
||||
|
||||
%.c = C file
|
||||
%.cpp = C++ file
|
||||
|
||||
%: process the specified file
|
||||
using the method associated
|
||||
with the makefile rule
|
||||
dependency:
|
||||
|
||||
%.pl = perl script
|
||||
%.sh = shell script
|
||||
|
||||
alltags: tool used to recursively
|
||||
create a "ctags"-style
|
||||
file for reference
|
||||
|
||||
The third section of "rules.mk' primarily contains several JAVA
|
||||
"language" build rules for binary releases. These are also
|
||||
generally "computed" rules (created on the "fly").
|
||||
|
||||
The rules which dwell in this section and their purpose:
|
||||
|
||||
|
||||
CATEGORY/rule:: Purpose
|
||||
=================== =============================
|
||||
$(JAVA_DESTPATH):: create directory specified
|
||||
as the Java destination path
|
||||
for where classes are
|
||||
deposited
|
||||
|
||||
$(JAVA_DESTPATH)/$(PACKAGE):: create directories specified
|
||||
within the $(PACKAGE)
|
||||
variable
|
||||
|
||||
$(JMCSRCDIR):: create directory specified
|
||||
as the JMC destination path
|
||||
|
||||
$(JRI_HEADER_CFILES): used to generate/regenerate
|
||||
JRI header files for "C"
|
||||
|
||||
$(JRI_STUB_CFILES): used to generate/regenerate
|
||||
JRI stub files for "C"
|
||||
|
||||
$(JNI_HEADERS): used to generate/regenerate
|
||||
JNI header files for "C"
|
||||
|
||||
The fourth section of "rules.mk" primarily contains miscellaneous
|
||||
build rules for binary releases. Many of these rules are here to
|
||||
create new subdirectories, manage dependencies, and/or override
|
||||
standard gmake "Makefile" rules.
|
||||
|
||||
The rules which dwell in this section and their purpose:
|
||||
|
||||
|
||||
CATEGORY/rule:: Purpose
|
||||
=================== =============================
|
||||
|
||||
$(PUBLIC_EXPORT_DIR):: create directory used to
|
||||
house public "C" header files
|
||||
|
||||
$(PRIVATE_EXPORT_DIR):: create directory used to
|
||||
house private "C" header
|
||||
files
|
||||
|
||||
$(SOURCE_XP_DIR)/
|
||||
release/include:: create directory used to
|
||||
house "C" header files
|
||||
contained in a release
|
||||
|
||||
$(MKDEPENDENCIES):: for UNIX systems, create
|
||||
a directory used to house
|
||||
dependencies and utilize
|
||||
the $(MKDEPEND) rule to
|
||||
create them
|
||||
|
||||
$(MKDEPEND):: cd to the dependency
|
||||
directory and create them
|
||||
|
||||
depend:: if $(OBJS) exist, perform the
|
||||
$(MKDEPEND) rule followed by
|
||||
the $(MKDEPENDENCIES) rule
|
||||
|
||||
dependclean:: remove all files contained
|
||||
in the dependency repository
|
||||
|
||||
.DEFAULT: standard gmake rule
|
||||
|
||||
.SUFFIXES: standard gmake rule
|
||||
|
||||
.PRECIOUS: standard gmake rule
|
||||
|
||||
.PHONY: standard gmake rule
|
||||
|
||||
83
mozilla/security/coreconf/ReliantUNIX.mk
Normal file
83
mozilla/security/coreconf/ReliantUNIX.mk
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for ReliantUNIX
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
ifdef NS_USE_GCC
|
||||
## gcc-2.7.2 homebrewn
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
AS = $(CC)
|
||||
ASFLAGS += -x assembler-with-cpp
|
||||
LD = gld
|
||||
ODD_CFLAGS = -pipe -Wall -Wno-format
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER += -O6
|
||||
endif
|
||||
MKSHLIB = $(LD)
|
||||
MKSHLIB += -G -h $(@:$(OBJDIR)/%.so=%.so)
|
||||
DSO_LDOPTS += -G -Xlinker -Blargedynsym
|
||||
else
|
||||
## native compiler (CDS++ 1.0)
|
||||
# CC = /usr/bin/cc
|
||||
CC = cc
|
||||
CCC = /usr/bin/CC
|
||||
AS = /usr/bin/cc
|
||||
ODD_CFLAGS =
|
||||
ifdef BUILD_OPT
|
||||
OPTIMIZER += -O -F Olimit,4000
|
||||
endif
|
||||
MKSHLIB = $(CC)
|
||||
MKSHLIB += -G -h $(@:$(OBJDIR)/%.so=%.so)
|
||||
DSO_LDOPTS += -G -W l,-Blargedynsym
|
||||
endif
|
||||
|
||||
NOSUCHFILE = /sni-rm-f-sucks
|
||||
ODD_CFLAGS += -DSVR4 -DSNI -DRELIANTUNIX
|
||||
CPU_ARCH = mips
|
||||
RANLIB = /bin/true
|
||||
|
||||
# For purify
|
||||
NOMD_OS_CFLAGS += $(ODD_CFLAGS)
|
||||
|
||||
# we do not have -MDupdate ...
|
||||
OS_CFLAGS += $(NOMD_OS_CFLAGS)
|
||||
OS_LIBS += -lsocket -lnsl -lresolv -lgen -ldl -lc /usr/ucblib/libucb.a
|
||||
|
||||
ifdef DSO_BACKEND
|
||||
DSO_LDOPTS += -h $(DSO_NAME)
|
||||
endif
|
||||
35
mozilla/security/coreconf/ReliantUNIX5.4.mk
Normal file
35
mozilla/security/coreconf/ReliantUNIX5.4.mk
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for ReliantUNIX5.4
|
||||
#
|
||||
include $(CORE_DEPTH)/coreconf/ReliantUNIX.mk
|
||||
36
mozilla/security/coreconf/SCOOS5.0.mk
Normal file
36
mozilla/security/coreconf/SCOOS5.0.mk
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for SCO OpenServer 5.0 for x86.
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/SCO_SV3.2.mk
|
||||
86
mozilla/security/coreconf/SCO_SV3.2.mk
Normal file
86
mozilla/security/coreconf/SCO_SV3.2.mk
Normal file
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for SCO Unix for x86.
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
CC = cc
|
||||
OS_CFLAGS += -b elf -KPIC
|
||||
CCC = g++
|
||||
CCC += -b elf -DPRFSTREAMS_BROKEN -I/usr/local/lib/g++-include
|
||||
# CCC = $(CORE_DEPTH)/build/hcpp
|
||||
# CCC += +.cpp +w
|
||||
RANLIB = /bin/true
|
||||
|
||||
#
|
||||
# -DSCO_PM - Policy Manager AKA: SCO Licensing
|
||||
# -DSCO - Changes to Netscape source (consistent with AIX, LINUX, etc..)
|
||||
# -Dsco - Needed for /usr/include/X11/*
|
||||
#
|
||||
OS_CFLAGS += -DSCO_SV -DSYSV -D_SVID3 -DHAVE_STRERROR -DSW_THREADS -DSCO_PM -DSCO -Dsco
|
||||
#OS_LIBS += -lpmapi -lsocket -lc
|
||||
MKSHLIB = $(LD)
|
||||
MKSHLIB += $(DSO_LDOPTS)
|
||||
XINC = /usr/include/X11
|
||||
MOTIFLIB += -lXm
|
||||
INCLUDES += -I$(XINC)
|
||||
CPU_ARCH = x86
|
||||
GFX_ARCH = x
|
||||
ARCH = sco
|
||||
LOCALE_MAP = $(CORE_DEPTH)/cmd/xfe/intl/sco.lm
|
||||
EN_LOCALE = C
|
||||
DE_LOCALE = de_DE.ISO8859-1
|
||||
FR_LOCALE = fr_FR.ISO8859-1
|
||||
JP_LOCALE = ja
|
||||
SJIS_LOCALE = ja_JP.SJIS
|
||||
KR_LOCALE = ko_KR.EUC
|
||||
CN_LOCALE = zh
|
||||
TW_LOCALE = zh
|
||||
I2_LOCALE = i2
|
||||
LOC_LIB_DIR = /usr/lib/X11
|
||||
NOSUCHFILE = /solaris-rm-f-sucks
|
||||
BSDECHO = /bin/echo
|
||||
|
||||
#
|
||||
# These defines are for building unix plugins
|
||||
#
|
||||
BUILD_UNIX_PLUGINS = 1
|
||||
#DSO_LDOPTS += -b elf -G -z defs
|
||||
DSO_LDOPTS += -b elf -G
|
||||
DSO_LDFLAGS += -nostdlib -L/lib -L/usr/lib -lXm -lXt -lX11 -lgen
|
||||
|
||||
# Used for Java compiler
|
||||
EXPORT_FLAGS += -W l,-Bexport
|
||||
58
mozilla/security/coreconf/SunOS4.1.3_U1.mk
Normal file
58
mozilla/security/coreconf/SunOS4.1.3_U1.mk
Normal file
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for SunOS4.1
|
||||
#
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/UNIX.mk
|
||||
|
||||
DEFAULT_COMPILER = cc
|
||||
|
||||
INCLUDES += -I/usr/dt/include -I/usr/openwin/include -I/home/motif/usr/include
|
||||
|
||||
# SunOS 4 _requires_ that shared libs have a version number.
|
||||
# XXX FIXME: Version number should use NSPR_VERSION_NUMBER?
|
||||
DLL_SUFFIX = so.1.0
|
||||
CC = gcc
|
||||
RANLIB = ranlib
|
||||
CPU_ARCH = sparc
|
||||
|
||||
# Purify doesn't like -MDupdate
|
||||
NOMD_OS_CFLAGS += -Wall -Wno-format -DSUNOS4
|
||||
OS_CFLAGS += $(DSO_CFLAGS) $(NOMD_OS_CFLAGS) -MDupdate $(DEPENDENCIES)
|
||||
MKSHLIB = $(LD)
|
||||
MKSHLIB += $(DSO_LDOPTS)
|
||||
NOSUCHFILE = /solaris-rm-f-sucks
|
||||
DSO_LDOPTS =
|
||||
|
||||
# -fPIC generates position-independent code for use in a shared library.
|
||||
DSO_CFLAGS += -fPIC
|
||||
38
mozilla/security/coreconf/SunOS5.3.mk
Normal file
38
mozilla/security/coreconf/SunOS5.3.mk
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for SunOS5.3
|
||||
#
|
||||
|
||||
SOL_CFLAGS =
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/SunOS5.mk
|
||||
38
mozilla/security/coreconf/SunOS5.4.mk
Normal file
38
mozilla/security/coreconf/SunOS5.4.mk
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the
|
||||
# terms of the GNU General Public License Version 2 or later (the
|
||||
# "GPL"), in which case the provisions of the GPL are applicable
|
||||
# instead of those above. If you wish to allow use of your
|
||||
# version of this file only under the terms of the GPL and not to
|
||||
# allow others to use your version of this file under the MPL,
|
||||
# indicate your decision by deleting the provisions above and
|
||||
# replace them with the notice and other provisions required by
|
||||
# the GPL. If you do not delete the provisions above, a recipient
|
||||
# may use your version of this file under either the MPL or the
|
||||
# GPL.
|
||||
#
|
||||
# Config stuff for SunOS5.4
|
||||
#
|
||||
|
||||
SOL_CFLAGS =
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/SunOS5.mk
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user