Skip to content

Commit

Permalink
fixup commit for tag 'NSS_3_10_BETA2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cvs2hg committed Mar 19, 2005
1 parent c22322c commit 7ff7827
Show file tree
Hide file tree
Showing 17 changed files with 4,508 additions and 28 deletions.
1 change: 0 additions & 1 deletion dbm/Makefile.in
Expand Up @@ -26,7 +26,6 @@ VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk

MODULE = dbm
DIRS = include src

ifdef ENABLE_TESTS
Expand Down
17 changes: 17 additions & 0 deletions dbm/include/MANIFEST
@@ -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
12 changes: 2 additions & 10 deletions dbm/include/mcom_db.h
Expand Up @@ -190,7 +190,7 @@
#define LITTLE_ENDIAN 1234
#endif

#if defined(_WINDOWS) || defined(XP_OS2_VACPP)
#if defined(_WINDOWS) || defined(XP_OS2)
#ifdef BYTE_ORDER
#undef BYTE_ORDER
#endif
Expand Down Expand Up @@ -222,14 +222,6 @@
#define MAXPATHLEN 1024
#endif

#ifdef XP_OS2_VACPP
#include <os2.h>
#define MAXPATHLEN CCHMAXPATH
#define EPERM EINVAL
#define ENOTDIR EBADPOS
#define S_ISDIR(s) ((s) & S_IFDIR)
#endif

#define EFTYPE EINVAL /* POSIX 1003.1 format errno. */

#ifndef STDERR_FILENO
Expand All @@ -253,7 +245,7 @@ int mkstemp(const char *path);
PR_END_EXTERN_C
#endif /* MACINTOSH */

#if !defined(_WINDOWS) && !defined(macintosh)
#if !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
#include <sys/stat.h>
#include <errno.h>
#endif
Expand Down
33 changes: 33 additions & 0 deletions dbm/macbuild/DBM.Prefix
@@ -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"

4,326 changes: 4,326 additions & 0 deletions dbm/macbuild/DBM.xml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions dbm/macbuild/DBMConfig.h
@@ -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):
*/

#define __DBINTERFACE_PRIVATE 1
32 changes: 32 additions & 0 deletions dbm/macbuild/DBMDebug.Prefix
@@ -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 changes: 8 additions & 0 deletions dbm/macbuild/macstubs.c
@@ -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 changes: 38 additions & 0 deletions dbm/makefile.win
@@ -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>

8 changes: 5 additions & 3 deletions dbm/src/Makefile.in
Expand Up @@ -51,23 +51,25 @@ CSRCS = \
ifeq ($(OS_ARCH),WINNT)
CSRCS += memmove.c snprintf.c
else
ifeq (,$(filter -DHAVE_MEMMOVE=1,$(ACDEFINES)))
ifeq (,$(filter -DHAVE_MEMMOVE=1,$(DEFS)))
CSRCS += memmove.c
endif

ifeq (,$(filter -DHAVE_SNPRINTF=1,$(ACDEFINES)))
ifeq (,$(filter -DHAVE_SNPRINTF=1,$(DEFS)))
CSRCS += snprintf.c
endif
endif # WINNT

LOCAL_INCLUDES = -I$(srcdir)/../include

FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1

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
Expand Down
6 changes: 1 addition & 5 deletions dbm/src/h_bigkey.c
Expand Up @@ -479,16 +479,12 @@ collect_data(
for (totlen = len; bufp ; bufp = __get_buf(hashp, bp[bp[0]-1], bufp, 0)) {
bp = (uint16 *)bufp->page;
mylen = hashp->BSIZE - bp[1];

/* if mylen ever goes negative it means that the
* page is screwed up.
*/
if (mylen < 0) {
save_bufp->flags = save_flags;
return (-1);
}
totlen += mylen;
if (bp[2] == FULL_KEY_DATA) { /* End of Data */
if (bp[2] == FULL_KEY_DATA) {
break;
}
}
Expand Down
12 changes: 10 additions & 2 deletions dbm/src/hash.c
Expand Up @@ -69,6 +69,11 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#include <windows.h>
#endif

#ifdef XP_OS2_VACPP
#include "types.h"
#define EPERM SOCEPERM
#endif

#include <assert.h>

#include "mcom_db.h"
Expand Down Expand Up @@ -186,13 +191,15 @@ __hash_open(const char *file, int flags, int mode, const HASHINFO *info, int dfl
hashp->file_size = statbuf.st_size;

if (file) {
#if defined(_WIN32) || defined(_WINDOWS) || defined (macintosh) || defined(XP_OS2)
#if defined(_WIN32) || defined(_WINDOWS) || defined (macintosh) || \
defined(XP_OS2_VACPP)
if ((hashp->fp = DBFILE_OPEN(file, flags | O_BINARY, mode)) == -1)
RETURN_ERROR(errno, error1);
#else
if ((hashp->fp = open(file, flags, mode)) == -1)
RETURN_ERROR(errno, error1);
(void)fcntl(hashp->fp, F_SETFD, 1);
/* We can't use fcntl because of NFS bugs. SIGH */
#endif
}
if (new_table) {
Expand Down Expand Up @@ -343,7 +350,8 @@ init_hash(HTAB *hashp, const char *file, HASHINFO *info)
if (stat(file, &statbuf))
return (NULL);

#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(VMS) && !defined(XP_OS2)
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && \
!defined(VMS) && !defined(XP_OS2)
#if defined(__QNX__) && !defined(__QNXNTO__)
hashp->BSIZE = 512; /* preferred blk size on qnx4 */
#else
Expand Down
2 changes: 2 additions & 0 deletions dbm/src/mktemp.c
Expand Up @@ -54,7 +54,9 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif

#ifdef XP_OS2_VACPP
#define ENOTDIR EBADPOS
#include <process.h>
#include <dirent.h>
#endif

#ifdef _WINDOWS
Expand Down
4 changes: 4 additions & 0 deletions dbm/src/ndbm.c
Expand Up @@ -52,6 +52,10 @@ static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94";
#include <linux/limits.h>
#endif

#ifdef __OS2__
#include "dirent.h"
#endif

#include <stdio.h>
#include <string.h>

Expand Down
6 changes: 4 additions & 2 deletions dbm/src/nsres.c
Expand Up @@ -79,7 +79,8 @@ NSRESHANDLE NSResCreateTable(const char *filename, NSRESTHREADINFO *threadinfo)

flag = O_RDWR | O_CREAT;

hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
memset(hres, 0, sizeof(struct RESDATABASE));

if (threadinfo && threadinfo->lock && threadinfo->fn_lock
&& threadinfo->fn_unlock)
Expand Down Expand Up @@ -110,7 +111,8 @@ NSRESHANDLE NSResOpenTable(const char *filename, NSRESTHREADINFO *threadinfo)

flag = O_RDONLY; /* only open database for reading */

hres = (RESHANDLE) calloc ( 1, sizeof(struct RESDATABASE) );
hres = (RESHANDLE) malloc ( sizeof(struct RESDATABASE) );
memset(hres, 0, sizeof(struct RESDATABASE));

if (threadinfo && threadinfo->lock && threadinfo->fn_lock
&& threadinfo->fn_unlock)
Expand Down
6 changes: 3 additions & 3 deletions dbm/tests/Makefile.in
Expand Up @@ -27,9 +27,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk

MODULE = dbm

PACKAGE_FILE = dbmtest.pkg

PROGRAM = lots$(BIN_SUFFIX)

CSRCS = lots.c
Expand All @@ -44,3 +41,6 @@ LIBS = $(EXTRA_DSO_LIBS)

include $(topsrcdir)/config/rules.mk

ifeq ($(OS_ARCH), Linux)
DEFINES += -D_BSD_SOURCE
endif
2 changes: 0 additions & 2 deletions dbm/tests/dbmtest.pkg

This file was deleted.

0 comments on commit 7ff7827

Please sign in to comment.