dbm.c (cadd68ea0014761eda6a293664086dfa80686d85) dbm.c (44bf619d328827ce5eca6833fcd5c69f1592e578)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 10 unchanged lines hidden (view full) ---

19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 10 unchanged lines hidden (view full) ---

19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27/* All Rights Reserved */
27/* All Rights Reserved */
28
29/*
30 * Portions of this source code were derived from Berkeley 4.3 BSD
31 * under license from the Regents of the University of California.
32 */
33
34/*
28
29/*
30 * Portions of this source code were derived from Berkeley 4.3 BSD
31 * under license from the Regents of the University of California.
32 */
33
34/*
35 * Copyright (c) 2018, Joyent, Inc.
35 * Copyright 2019 Joyent, Inc.
36 */
37
38/*LINTLIBRARY*/
39
40#include <sys/types.h>
41#include <stdio.h>
42#include <unistd.h>
43#include <stdlib.h>

--- 192 unchanged lines hidden (view full) ---

236 if (item.dptr == NULL) {
237 if ((Sentry.dsize == key.dsize) &&
238 (strncmp(Sentry.dptr, key.dptr, key.dsize) == 0))
239 return (-1);
240 if (Oneflag == 2) {
241 Sentry.dsize = key.dsize;
242 Sentry.dptr = malloc(strlen(key.dptr)+1);
243 (void) strncpy(Sentry.dptr, key.dptr,
36 */
37
38/*LINTLIBRARY*/
39
40#include <sys/types.h>
41#include <stdio.h>
42#include <unistd.h>
43#include <stdlib.h>

--- 192 unchanged lines hidden (view full) ---

236 if (item.dptr == NULL) {
237 if ((Sentry.dsize == key.dsize) &&
238 (strncmp(Sentry.dptr, key.dptr, key.dsize) == 0))
239 return (-1);
240 if (Oneflag == 2) {
241 Sentry.dsize = key.dsize;
242 Sentry.dptr = malloc(strlen(key.dptr)+1);
243 (void) strncpy(Sentry.dptr, key.dptr,
244 key.dsize);
244 key.dsize);
245 }
246 break;
247 }
248 if (calchash(item) & (hmask+1)) {
249 (void) additem(ovfbuf, item);
250 delitem(pagbuf, i);
251 item = makdatum(pagbuf, i);
252 if (item.dptr == NULL) {

--- 184 unchanged lines hidden (view full) ---

437 return (n - d2.dsize);
438 if (n == 0)
439 return (0);
440 p1 = d1.dptr;
441 p2 = d2.dptr;
442 do
443 if (*p1++ != *p2++)
444 return (*--p1 - *--p2);
245 }
246 break;
247 }
248 if (calchash(item) & (hmask+1)) {
249 (void) additem(ovfbuf, item);
250 delitem(pagbuf, i);
251 item = makdatum(pagbuf, i);
252 if (item.dptr == NULL) {

--- 184 unchanged lines hidden (view full) ---

437 return (n - d2.dsize);
438 if (n == 0)
439 return (0);
440 p1 = d1.dptr;
441 p2 = d2.dptr;
442 do
443 if (*p1++ != *p2++)
444 return (*--p1 - *--p2);
445 while (--n);
445 while (--n)
446 ;
446 return (0);
447}
448
449int hitab[16]
450/*
451 * ken's
452 * {
453 * 055,043,036,054,063,014,004,005,

--- 130 unchanged lines hidden (view full) ---

584 }
585 if (t < (sp[0]+1)*sizeof (short))
586 goto bad;
587 return;
588
589bad:
590 (void) printf("bad block\n");
591 abort();
447 return (0);
448}
449
450int hitab[16]
451/*
452 * ken's
453 * {
454 * 055,043,036,054,063,014,004,005,

--- 130 unchanged lines hidden (view full) ---

585 }
586 if (t < (sp[0]+1)*sizeof (short))
587 goto bad;
588 return;
589
590bad:
591 (void) printf("bad block\n");
592 abort();
592 bzero(buf, PBLKSIZ);
593}
593}