ndbm.c (13545) | ndbm.c (14287) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Margo Seltzer. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Margo Seltzer. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) |
38static char sccsid[] = "@(#)ndbm.c 8.2 (Berkeley) 9/11/93"; | 38static char sccsid[] = "@(#)ndbm.c 8.4 (Berkeley) 7/21/94"; |
39#endif /* LIBC_SCCS and not lint */ 40 41/* 42 * This package provides a dbm compatible interface to the new hashing 43 * package described in db(3). 44 */ 45 46#include <sys/param.h> 47 | 39#endif /* LIBC_SCCS and not lint */ 40 41/* 42 * This package provides a dbm compatible interface to the new hashing 43 * package described in db(3). 44 */ 45 46#include <sys/param.h> 47 |
48#include <ndbm.h> | |
49#include <stdio.h> 50#include <string.h> 51 | 48#include <stdio.h> 49#include <string.h> 50 |
51#include <ndbm.h> |
|
52#include "hash.h" 53 54/* 55 * Returns: 56 * *DBM on success 57 * NULL on failure 58 */ 59extern DBM * 60dbm_open(file, flags, mode) 61 const char *file; 62 int flags, mode; 63{ 64 HASHINFO info; 65 char path[MAXPATHLEN]; 66 67 info.bsize = 4096; 68 info.ffactor = 40; 69 info.nelem = 1; | 52#include "hash.h" 53 54/* 55 * Returns: 56 * *DBM on success 57 * NULL on failure 58 */ 59extern DBM * 60dbm_open(file, flags, mode) 61 const char *file; 62 int flags, mode; 63{ 64 HASHINFO info; 65 char path[MAXPATHLEN]; 66 67 info.bsize = 4096; 68 info.ffactor = 40; 69 info.nelem = 1; |
70 info.cachesize = NULL; | 70 info.cachesize = 0; |
71 info.hash = NULL; 72 info.lorder = 0; 73 (void)strcpy(path, file); 74 (void)strcat(path, DBM_SUFFIX); 75 return ((DBM *)__hash_open(path, flags, mode, &info, 0)); 76} 77 78extern void --- 124 unchanged lines hidden --- | 71 info.hash = NULL; 72 info.lorder = 0; 73 (void)strcpy(path, file); 74 (void)strcat(path, DBM_SUFFIX); 75 return ((DBM *)__hash_open(path, flags, mode, &info, 0)); 76} 77 78extern void --- 124 unchanged lines hidden --- |