cscope.out   [plain text]


cscope 15 $HOME/berkeleydb/db-4.6.21/dist               0004923159
	@../btree/bt_compact.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/log.h
"

16 
	~"dbc/mp.h
"

17 
	~"dbc/txn.h
"

19 
__bam_com_dups
 
__P
((
DBC
 *,

20 
PAGE
 **, 
u_t32_t
, , 
DB_COMPACT
 *, *));

21 
__bam_com_t
 
__P
((
DBC
 *,

22 
DBT
 *, DBT *, 
u_t32_t
, *, 
DB_COMPACT
 *, *));

23 
__bam_cch
 
__P
((
DBC
 *, 
DBT
 *, 
u_t32_t
, ));

24 
__bam_mge
 
__P
((
DBC
 *,

25 
DBC
 *, 
u_t32_t
, 
DBT
 *, 
DB_COMPACT
 *,*));

26 
__bam_mge_
 
__P
((
DBC
 *, DBC *, , 
DB_COMPACT
 *, *));

27 
__bam_mge_ges
 
__P
((
DBC
 *, DBC *, 
DB_COMPACT
 *));

28 
__bam_mge_cds
 
__P
((
DBC
 *, DBC*, 
u_t32_t
, 
DB_COMPACT
 *));

29 
__bam_un__ovow
 
__P
((
DBC
 *, 
PAGE
 *, 
DB_COMPACT
 *));

30 
__bam_un_ovow
 
__P
((
DBC
 *,

31 
db_pgno_t
, db_pgno_t, 
DB_COMPACT
 *));

32 
__bam_un_ge
 
__P
((
DBC
 *, 
PAGE
 **, ));

33 
__bam_un_ro_ge
 
__P
((
DBC
 *,

34 
PAGE
 *, 
u_t32_t
, 
DB_COMPACT
 *));

36 #ifde
HAVE_FTRUNCATE


37 
__bam__li
 
__P
((
DB
 *, 
DB_TXN
 *));

38 
__bam_vekey
 
__P
((
DBC
 *, , 
DBT
 *));

39 
__bam_tup_li
 
__P
((
DB
 *, 
pgli
 *, 
u_t32_t
));

40 
__bam_un_
 
__P
((
DB
 *, 
DB_TXN
 *, 
DB_COMPACT
 *));

43 
	#SAVE_START
 \

45 
ve_da
 = *
c_da
; \

46 
t
 = 
	`__db_tcy
(
dbv
, \

47 &
ve_t
, 
cut
.
da
, cut.
size
, \

48 &
ve_t
.
da
, &ve_t.
un
); \

49 } 0)

	)

56 
	#RESTORE_START
 \

58 
c_da
->
com_ges_
 = \

59 
ve_da
.
com_ges_
; \

60 
c_da
->
com_vs
 = 
ve_da
.compact_levels; \

61 
c_da
->
com_un
 = 
ve_da
.compact_truncate; \

62 
t
 = 
	`__db_tcy
(
dbv
, &
cut
, \

63 
ve_t
.
da
, save_t.
size
, \

64 &
cut
.
da
, &cut.
un
); \

65 } 0)

	)

73 
	$__bam_com
(
dbp
, 
txn
, 
t
, 

, 
c_da
, 
ags
, 
d
)

74 
DB
 *
dbp
;

75 
DB_TXN
 *
txn
;

76 
DBT
 *
t
, *

;

77 
DB_COMPACT
 *
c_da
;

78 
u_t32_t
 
ags
;

79 
DBT
 *
d
;

81 
DBT
 
cut
, 
ve_t
;

82 
DBC
 *
dbc
;

83 
DB_COMPACT
 
ve_da
;

84 
DB_ENV
 *
dbv
;

85 
u_t32_t
 

;

86 
ddlock
, 
de
, 
t
, 

, 
t_t
, 
txn_lol
;

88 #ifde
HAVE_FTRUNCATE


89 
pgli
 *
li
;

90 
db_pgno_t
 
ϡ_pgno
;

91 
u_t32_t
 
ms
, 
und
;

94 
dbv
 = 
dbp
->dbenv;

96 
	`memt
(&
cut
, 0, (current));

97 
	`memt
(&
ve_t
, 0, (save_start));

98 
dbc
 = 
NULL
;

99 

 = 0;

100 
ddlock
 = 
de
 = 
t
 = 

 = 0;

102 #ifde
HAVE_FTRUNCATE


103 
li
 = 
NULL
;

104 
ϡ_pgno
 = 0;

105 
ms
 = 
und
 = 0;

113 i(
t
 !
NULL
 && (
t
 = 
	`__db_tcy
(
dbv
,

114 &
cut
, 
t
->
da
, s->
size
,

115 &
cut
.
da
, &cut.
un
)) != 0)

116  (
t
);

118 i(
	`IS_DB_AUTO_COMMIT
(
dbp
, 
txn
))

119 
txn_lol
 = 1;

121 
txn_lol
 = 0;

122 i(!
	`LF_ISSET
(
DB_FREE_SPACE
 | 
DB_FREELIST_ONLY
))

123 
no_
;

124 i(
	`LF_ISSET
(
DB_FREELIST_ONLY
))

125 
	`LF_SET
(
DB_FREE_SPACE
);

127 #ifde
HAVE_FTRUNCATE


129 i(
txn_lol
 && (
t
 = 
	`__txn_beg
(
dbv
, 
NULL
, &
txn
, 0)) != 0)

130 
r
;

132 i((
t
 = 
	`__db__un
(
dbp
,

133 
txn
, 
ags
, 
c_da
, &
li
, &
ms
, &
ϡ_pgno
)) != 0) {

134 
	`LF_CLR
(
DB_FREE_SPACE
);

135 

;

139 i(
ms
 =0 && 
	`LF_ISSET
(
DB_FREELIST_ONLY
)) {

140 
t
 = 0;

141 
	`LF_CLR
(
DB_FREE_SPACE
);

142 

;

144 i((
t
 = 
	`__bam_tup_li
(
dbp
, 
li
, 
ms
)) != 0) {

146 i(
t
 =
EBUSY
)

147 
t
 = 0;

151 

: i(
txn_lol
) {

152 i((
t_t
 = 
	`__txn_comm
(
txn
, 
DB_TXN_NOSYNC
)!0 && 
t
 == 0)

153 
t
 = 
t_t
;

154 
txn
 = 
NULL
;

156 i(
t
 != 0)

157 
r
;

160 
und
 = 
c_da
->
com_ges_und
;

161 i(
	`LF_ISSET
(
DB_FREELIST_ONLY
))

162 
de
;

172 
no_
:

173 

 = 
dbp
->
pgsize
 - 
SIZEOF_PAGE
;

174 i(
c_da
->
com_f͔
 != 0) {

175 

 *
c_da
->
com_f͔
;

176 

 /= 100;

179 

 = (
dbp
->
pgsize
 - 
SIZEOF_PAGE
) - factor;

181 i(
c_da
->
com_ges
 == 0)

182 
c_da
->
com_ges
 = 
DB_MAX_PAGES
;

185 
ddlock
 = 0;

187 
SAVE_START
;

188 i(
t
 != 0)

191 i(
txn_lol
) {

192 i((
t
 = 
	`__txn_beg
(
dbv
, 
NULL
, &
txn
, 0)) != 0)

195 i(
c_da
->
com_timeout
 != 0 &&

196 (
t
 = 
	`__txn_t_timeout
(
txn
,

197 
c_da
->
com_timeout
, 
DB_SET_LOCK_TIMEOUT
)) != 0)

198 
r
;

201 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 0)) != 0)

202 
r
;

204 i((
t
 = 
	`__bam_com_t
(
dbc
, &
cut
, 

, 

,

205 &

, 
c_da
, &
de
)=
DB_LOCK_DEADLOCK
 && 
txn_lol
) {

211 
ddlock
 = 1;

212 
c_da
->
com_ddlock
++;

213 
RESTORE_START
;

216 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

217 
t
 = 
t_t
;

219 
r
: i(
txn_lol
 && 
txn
 !
NULL
) {

220 i(
t
 =0 && 
ddlock
 == 0)

221 
t
 = 
	`__txn_comm
(
txn
, 
DB_TXN_NOSYNC
);

222 i((
t_t
 = 
	`__txn_abt
(
txn
)!0 && 
t
 == 0)

223 
t
 = 
t_t
;

224 
txn
 = 
NULL
;

226 } 
t
 =0 && !
de
);

228 i(
t
 =0 && 
d
 !
NULL
)

229 
t
 = 
	`__db_tcy
(
dbv
, 
d
, 
cut
.
da
, cut.
size
,

230 &
d
->
da
, &d->
un
);

231 i(
cut
.
da
 !
NULL
)

232 
	`__os_
(
dbv
, 
cut
.
da
);

233 i(
ve_t
.
da
 !
NULL
)

234 
	`__os_
(
dbv
, 
ve_t
.
da
);

236 #ifde
HAVE_FTRUNCATE


243 
de
: i(
	`LF_ISSET
(
DB_FREE_SPACE
)) {

244 
DBMETA
 *
ma
;

245 
db_pgno_t
 
pgno
;

247 
pgno
 = 
PGNO_BASE_MD
;

248 
de
 = 1;

249 i(
t
 =0 && !
	`LF_ISSET
(
DB_FREELIST_ONLY
&& (
t_t
 =

250 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
, 
txn
, 0, &
ma
)) == 0) {

251 
de
 = 
ma
->

 =
PGNO_INVALID
;

252 
t
 = 
	`__memp_ut
(
dbp
->
mpf
, 
ma
, 
dbc
->
iܙy
);

255 i(!
de
)

256 
t
 = 
	`__bam_un_
(
dbp
, 
txn
, 
c_da
);

259 i(
li
 !
NULL
)

260 
	`__os_
(
dbv
, 
li
);

262 i((
t_t
 =

263 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
, 
txn
, 0, &
ma
)) == 0) {

264 
c_da
->
com_ges_und
 =

265 
und
 + 
ϡ_pgno
 - 
ma
->last_pgno;

266 i((
t_t
 = 
	`__memp_ut
(

267 
dbp
->
mpf
, 
ma
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

268 
t
 = 
t_t
;

269 } i(
t
 == 0)

270 
t
 = 
t_t
;

272 i((
t_t
 = 
	`__bam__li
(
dbp
, 
txn
)!0 && 
t
 == 0)

273 
t_t
 = 
t
;

277  (
t
);

278 
	}
}

285 
	#CS_READ
 0

	)

286 
	#CS_PARENT
 1

	)

287 
	#CS_NEXT
 2

	)

288 
	#CS_NEXT_WRITE
 3

	)

289 
	#CS_DEL
 4

	)

290 
	#CS_START
 5

	)

291 
	#CS_GETRECNO
 0x80

	)

294 
	$__bam_cch
(
dbc
, 
t
, 
sag
, 
v
)

295 
DBC
 *
dbc
;

296 
DBT
 *
t
;

297 
u_t32_t
 
sag
;

298 
v
;

300 
BTREE_CURSOR
 *

;

301 
n_ud
, 
t
;

303 

 = (
BTREE_CURSOR
 *)
dbc
->

;

305 i(
dbc
->
dbty
 =
DB_RECNO
) {

307 i(
	`FLD_ISSET
(
sag
, 
CS_GETRECNO
)) {

308 i(
t
 =
NULL
 || s->
size
 == 0)

309 

->
o
 = 1;

310 i((
t
 =

311 
	`__m_gno
(
dbc
, 
t
, &

->
o
, 0)) != 0)

312  (
t
);

313 
	`FLD_CLR
(
sag
, 
CS_GETRECNO
);

315 
sag
) {

316 
CS_READ
:

317 
sag
 = 
SR_READ
;

319 
CS_NEXT
:

320 
sag
 = 
SR_PARENT
 | 
SR_READ
;

322 
CS_START
:

323 
v
 = 
LEAFLEVEL
;

325 
CS_DEL
:

326 
CS_NEXT_WRITE
:

327 
sag
 = 
SR_STACK
;

329 
CS_PARENT
:

330 
sag
 = 
SR_PARENT
 | 
SR_WRITE
;

333  (
	`__db_nic
(
dbc
->
dbp
->
dbv
, 
EINVAL
));

335 i((
t
 = 
	`__bam_rch
(
dbc
,

336 &

->
o
, 
sag
, 
v
, &
n_ud
)) != 0)

337  (
t
);

339 

->
o
 -->
c
->
dx
;

341 
	`FLD_CLR
(
sag
, 
CS_GETRECNO
);

342 
sag
) {

343 
CS_READ
:

344 
sag
 = 
SR_READ
 | 
SR_DUPFIRST
;

346 
CS_DEL
:

347 
sag
 = 
SR_DEL
;

349 
CS_NEXT
:

350 
sag
 = 
SR_NEXT
;

352 
CS_NEXT_WRITE
:

353 
sag
 = 
SR_NEXT
 | 
SR_WRITE
;

355 
CS_START
:

356 
sag
 = 
SR_START
 | 
SR_WRITE
;

358 
CS_PARENT
:

359 
sag
 = 
SR_PARENT
 | 
SR_WRITE
;

362  (
	`__db_nic
(
dbc
->
dbp
->
dbv
, 
EINVAL
));

364 i(
t
 =
NULL
 || s->
size
 == 0)

365 
	`FLD_SET
(
sag
, 
SR_MIN
);

367 i((
t
 = 
	`__bam_ch
(
dbc
,

368 

->
ro
, 
t
, 
sag
, 
v
, 
NULL
, &
n_ud
)) != 0)

369  (
t
);

373 
	}
}

382 
	$__bam_com_t
(
dbc
, 
t
, 

, 

, 
p
, 
c_da
, 
dڕ
)

383 
DBC
 *
dbc
;

384 
DBT
 *
t
, *

;

385 
u_t32_t
 

;

386 *
p
;

387 
DB_COMPACT
 *
c_da
;

388 *
dڕ
;

390 
BTREE_CURSOR
 *

, *
n
;

391 
DB
 *
dbp
;

392 
DBC
 *
ndbc
;

393 
DB_ENV
 *
dbv
;

394 
DB_LOCK
 
nock
;

395 
EPG
 *
g
;

396 
DB_MPOOLFILE
 *
dbmp
;

397 
PAGE
 *
pg
, *
g
, *
g
;

398 
db_pgno_t
 
gno
;

399 
db_o_t
 
xt_o
;

400 
u_t32_t
 
sag
;

401 
check_dups
, 
check_unc
, 
de
, 
v
;

402 
mged
, 
ry
, 
xt_ge
, 
pgs_de
, 
t
, 
t_t
, 
tde
;

404 #ifdef 
DEBUG


405 
	#CTRACE
(
dbc
, 
loti
, 
t
, 
t
, 
f
) do { \

406 
DBT
 
__a
; \

407 
	`DB_SET_DBT
(
__a
, 
t
, 
	`
(t)); \

408 
	`DEBUG_LWRITE
( \

409 
dbc
, (dbc)->
txn
, 
loti
, &
__a
, 
t
, 
f
) \

410 } 0)

	)

411 
	#PTRACE
(
dbc
, 
loti
, 
p
, 
t
, 
f
) do { \

412 
__buf
[32]; \

413 ()
	`tf
(
__buf
, \

414 (
__buf
), "pgno: %lu", (
u_lg
)
p
); \

415 
	`CTRACE
(
dbc
, 
loti
, 
__buf
, 
t
, 
f
); \

416 } 0)

	)

418 
	#CTRACE
(
dbc
, 
loti
, 
t
, 
t
, 
f
)

	)

419 
	#PTRACE
(
dbc
, 
loti
, 
p
, 
t
, 
f
)

	)

422 
ndbc
 = 
NULL
;

423 
pg
 = 
NULL
;

424 
g
 = 
NULL
;

425 
de
 = 0;

426 
tde
 = 0;

427 
pgs_de
 = 0;

428 
xt_o
 = 0;

429 
xt_ge
 = 0;

430 
	`LOCK_INIT
(
nock
);

431 
check_unc
 = 
c_da
->
com_un
 !
PGNO_INVALID
;

432 
check_dups
 = (!
	`F_ISSET
(
dbc
, 
DBC_OPD
) &&

433 
	`F_ISSET
(
dbc
->
dbp
, 
DB_AM_DUP
)|| 
check_unc
;

435 
dbp
 = 
dbc
->dbp;

436 
dbv
 = 
dbp
->dbenv;

437 
dbmp
 = 
dbp
->
mpf
;

438 

 = (
BTREE_CURSOR
 *)
dbc
->

;

441 i((
t
 = 
	`__bam_cch
(
dbc
,

442 
t
, 
CS_READ
 | 
CS_GETRECNO
, 
LEAFLEVEL
)) != 0) {

444 i(
t
 =
DB_NOTFOUND
)

445 
t
 = 0;

446 
de
 = 1;

447 
r
;

454 
pg
 = 

->
c
->
ge
;

455 

->
c
->
ge
 = 
NULL
;

456 
xt_o
 = 

->
o
;

457 
xt
:

474 (
gno
 = 
	`NEXT_PGNO
(
pg
)!
PGNO_INVALID
) {

475 
c_da
->
com_ges_exame
++;

476 
	`PTRACE
(
dbc
, "Next", 
	`PGNO
(
pg
), 
t
, 0);

479 i(
xt_ge
 == 1 &&

480 
dbc
->
dbty
 !
DB_RECNO
 && 
	`NUM_ENT
(
pg
) != 0) {

481 i((
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
, 
pg
,

482 0, 
t
, &t->
da
, &t->
un
)) != 0)

483 
r
;

485 
xt_o
 +
	`NUM_ENT
(
pg
);

486 i(
	`P_FREESPACE
(
dbp
, 
pg
> 

 ||

487 (
check_unc
 && 
	`PGNO
(
pg
> 
c_da
->
com_un
))

494 

->
o
 +
	`NUM_ENT
(
pg
);

495 
xt_ge
 = 1;

496 
tde
 = 
pgs_de
;

497 
	`PTRACE
(
dbc
, "Dups", 
	`PGNO
(
pg
), 
t
, 0);

498 i(
check_dups
 && (
t
 = 
	`__bam_com_dups
(

499 
dbc
, &
pg
, 

, 0, 
c_da
, &
pgs_de
)) != 0)

500 
r
;

501 
gno
 = 
	`NEXT_PGNO
(
pg
);

502 i((
t
 = 
	`__memp_ut
(
dbmp
, 
pg
, 
dbc
->
iܙy
)) != 0)

503 
r
;

504 
pg
 = 
NULL
;

509 i((
t
 = 
	`__db_lg
(
dbc
,

510 
tde
 =
pgs_de
 ? 
LCK_COUPLE_ALWAYS
 : 
LCK_COUPLE
,

511 
gno
, 
DB_LOCK_READ
, 0, &

->
c
->
lock
)) != 0)

512 
r
;

513 i((
t
 = 
	`__memp_fg
(
dbmp
, &
gno
, 
dbc
->
txn
, 0, &
pg
)) != 0)

514 
r
;

527 i((
ry
 = 
	`NUM_ENT
(
pg
)) != 0) {

528 
xt_ge
 = 0;

530 i(
dbc
->
dbty
 =
DB_RECNO
) {

531 i((
t
 = 
	`__db_tcy
(
dbp
->
dbv
, 
t
,

532 &

->
o
, (cp->recno),

533 &
t
->
da
, &t->
un
)) != 0)

534 
r
;

535 } i(
t
->
size
 == 0 &&

536 (
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
, 
pg
,

537 0, 
t
, &t->
da
, &t->
un
)) != 0)

538 
r
;

540 i(
gno
 =
PGNO_INVALID
) {

542 
	`PTRACE
(
dbc
, "GoDe", 
	`PGNO
(
pg
), 
t
, 0);

543 i(
check_dups
 && (
t
 = 
	`__bam_com_dups
(
dbc
,

544 &
pg
, 

, 0, 
c_da
, &
pgs_de
)) != 0)

545 
r
;

546 
c_da
->
com_ges_exame
++;

547 
de
 = 1;

548 
de
;

553 i((
t
 = 
	`__LPUT
(
dbc
, 

->
c
->
lock
)) != 0)

554 
r
;

555 i((
t
 = 
	`__memp_ut
(
dbmp
, 
pg
, 
dbc
->
iܙy
)) != 0)

556 
r
;

557 
	`BT_STK_CLR
(

);

558 
pg
 = 
NULL
;

582 i(
ry
 == 0) {

583 
	`CTRACE
(
dbc
, "Emy", "", 
t
, 0);

584 i(
xt_ge
 == 1)

585 
sag
 = 
CS_NEXT_WRITE
;

587 
sag
 = 
CS_DEL
;

588 i((
t
 = 
	`__bam_cch
(
dbc
, 
t
, 
sag
, 
LEAFLEVEL
)) != 0)

589 
r
;

591 
pg
 = 

->
c
->
ge
;

593 i(
	`NUM_ENT
(
pg
) != 0)

594 
gno
 = 
	`PGNO
(
pg
);

596 
gno
 = 
	`NEXT_PGNO
(
pg
);

598 i(
	`PGNO
(
pg
=

->
ro
)

599 
de
 = 1;

601 i((
t
 = 
	`__bam_dges
(
dbc
, 0, 0)) != 0)

602 
r
;

603 
c_da
->
com_ges_
++;

604 
xt_no_a
;

607 
xt_ge
;

611 i(*
p
) {

612 
	`CTRACE
(
dbc
, "Sn", "", 
t
, 0);

613 i(
ndbc
 =
NULL
 && (
t
 = 
	`__dbc_dup
(
dbc
, &ndbc, 0)) != 0)

614 
r
;

615 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

616 
n
->
o
 = 
xt_o
;

623 i((
t
 = 
	`__bam_cch
(
ndbc
, 
t
, 
CS_NEXT_WRITE
, 0)) != 0)

624 
r
;

626 i(
dbc
->
dbty
 =
DB_RECNO
) {

633 i(
n
->
c
[-1].
dx
 != 0) {

634 *
p
 = 0;

635 
ded
;

639 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

640 &
n
->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

641 
r
;

642 
	`PTRACE
(
dbc
, "SDups", 
	`PGNO
(
n
->
c
->
ge
), 
t
, 0);

643 i(
check_dups
 && (
t
 = 
	`__bam_com_dups
(
ndbc
,

644 &
n
->
c
->
ge
, 

, 1, 
c_da
, &
pgs_de
)) != 0)

645 
r
;

648 i(
	`PGNO
(
n
->
c
->
ge
=n->
ro
)

649 
de
;

654 
v
 = 
	`LEVEL
(
n
->

->
ge
);

655 
sag
 = 
CS_START
;

656 i((
t
 = 
	`__bam_cch
(
dbc
, 
t
, 
sag
, 
v
)) != 0)

657 
r
;

658 
pg
 = 

->
c
->
ge
;

659 *
p
 = 0;

666 i(
	`NUM_ENT
(
pg
) == 0) {

667 
gno
 = 
	`PGNO
(
pg
);

668 
xt_ge
;

670 i(
check_unc
 && 
	`PGNO
(
pg
> 
c_da
->
com_un
) {

671 
pgs_de
++;

673 i((
t
 = 
	`__bam_un_ge
(
dbc
, &
pg
, 1)) != 0)

674 
r1
;

677 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

678 &

->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

679 
r1
;

680 
pg
 = 

->
c
->
ge
;

681 
gno
 = 
	`NEXT_PGNO
(
pg
);

682 
	`PTRACE
(
dbc
, "SDups", 
	`PGNO
(
pg
), 
t
, 0);

683 i(
check_dups
 && (
t
 =

684 
	`__bam_com_dups
(
dbc
, &

->
c
->
ge
,

685 

, 1, 
c_da
, &
pgs_de
)) != 0)

686 
r1
;

694 i(
	`P_FREESPACE
(
dbp
, 
pg
<

 ||

695 

->
c
[-1].
dx
 !
	`NUM_ENT
(->c[-1].
ge
) - 1)

696 
xt_ge
;

701 
mged
 = 0;

702 
g
 = 

->

;pg !->
c
;pg++) {

703 i(
	`PGNO
(
g
->
ge
=

->
ro
)

705 
	`PTRACE
(
dbc
, "PMge", 
	`PGNO
(
g
->
ge
), 
t
, 0);

706 i((
t
 = 
	`__bam_mge_
(
dbc
,

707 
ndbc
, 
	`LEVEL
(
g
->
ge
), 
c_da
, &
mged
)) != 0)

708 
r1
;

709 i(
mged
)

714 i(
mged
) {

715 
pgs_de
++;

716 i(

->
c
->
ge
 =
NULL
)

717 
ded
;

718 
gno
 = 
	`PGNO
(
pg
);

719 
xt_ge
;

721 
	`PTRACE
(
dbc
, "SMge", 
	`PGNO
(

->
c
->
ge
), 
t
, 0);

722 
gno
 = 
	`NEXT_PGNO
(
n
->
c
->
ge
);

723 i((
t
 = 
	`__bam_mge
(
dbc
,

724 
ndbc
, 

, 

, 
c_da
, &
de
)) != 0)

725 
r1
;

726 
pgs_de
++;

731 i(

->
c
->
ge
 =
NULL
)

732 
ded
;

733 

->
o
 +
	`NUM_ENT
(
pg
);

736 i(
gno
 !
	`NEXT_PGNO
(
pg
)) {

737 
gno
 = 
	`NEXT_PGNO
(
pg
);

738 
xt_ge
;

742 
	`CTRACE
(
dbc
, "Sib", "", 
t
, 0);

743 i((
t
 =

744 
	`__bam_cch
(
dbc
, 
t
, 
CS_PARENT
, 
LEAFLEVEL
)) != 0)

745 
r
;

747 
pg
 = 

->
c
->
ge
;

748 
gno
 = 
	`PGNO
(
pg
);

751 i((
ry
 = 
	`NUM_ENT
(
pg
)) == 0)

752 
xt_ge
;

754 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
, &

->
c
->
ge
,

755 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

756 
r
;

757 
pg
 = 

->
c
->
ge
;

759 
gno
 = 
	`NEXT_PGNO
(
pg
);

762 
	`PTRACE
(
dbc
, "SibDup", 
	`PGNO
(
pg
), 
t
, 0);

763 i(
check_dups
 && (
t
 =

764 
	`__bam_com_dups
(
dbc
, &

->
c
->
ge
,

765 

, 1, 
c_da
, &
pgs_de
)) != 0)

766 
r1
;

767 
pg
 = 

->
c
->
ge
;

770 i(
	`PGNO
(
pg
=

->
ro
)

771 
r1
;

772 
	`DB_ASSERT
(
dbv
, 

->
c
 - cp->

 == 1);

774 i(
check_unc
 && 
	`PGNO
(
pg
> 
c_da
->
com_un
) {

775 
pgs_de
++;

777 i((
t
 = 
	`__bam_un_ge
(
dbc
, &
pg
, 1)) != 0)

778 
r1
;

782 i(
	`P_FREESPACE
(
dbp
, 
pg
<

)

783 
xt_ge
;

786 i(
ndbc
 !
NULL
 && (
t
 = 
	`__dbc_o
(ndbc)) != 0)

787 
r1
;

788 i((
t
 = 
	`__dbc_dup
(
dbc
, &
ndbc
, 
DB_POSITION
)) != 0)

789 
r1
;

790 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

796 
n
->
o
 +
	`NUM_ENT
(
pg
);

800 !
de
 && 
gno
 !
PGNO_INVALID
 &&

801 
	`P_FREESPACE
(
dbp
, 
pg
> 

 && 
c_da
->
com_ges
 != 0) {

810 i(

->
c
[-1].
dx
 =
	`NUM_ENT
(->c[-1].
ge
) - 1) {

811 *
p
 = 1;

812 
gno
 = 
	`PGNO
(
pg
);

813 
xt_o
 = 

->
o
;

814 
xt_ge
;

818 i((
t
 = 
	`__db_lg
(
dbc
, 
LCK_COUPLE
,

819 
gno
, 
DB_LOCK_WRITE
, 0, &
n
->
lock
)) != 0)

820 
r1
;

821 i((
t
 = 
	`__memp_fg
(
dbmp
, &
gno
, 
dbc
->
txn
,

822 
DB_MPOOL_DIRTY
, &
g
)) != 0)

823 
r1
;

826 i((
t
 = 
	`__memp_fg
(
dbmp
, &
	`PGNO
(

->
c
[-1].
ge
),

827 
dbc
->
txn
, 0, &
g
)) != 0)

828 
r1
;

829 
	`BT_STK_PUSH
(
dbv
, 
n
, 
g
,

830 

->
c
[-1].
dx
 + 1, 
nock
, 
DB_LOCK_NG
, 
t
);

831 i(
t
 != 0)

832 
r1
;

835 
	`BT_STK_ENTER
(
dbv
, 
n
, 
g
, 0,->
lock
, 
DB_LOCK_WRITE
, 
t
);

837 
	`LOCK_INIT
(
n
->
lock
);

838 
g
 = 
NULL
;

840 
c_da
->
com_ges_exame
++;

842 
	`PTRACE
(
dbc
, "MDups", 
	`PGNO
(
n
->
c
->
ge
), 
t
, 0);

843 i(
check_dups
 && (
t
 = 
	`__bam_com_dups
(
ndbc
,

844 &
n
->
c
->
ge
, 

, 1, 
c_da
, &
pgs_de
)) != 0)

845 
r1
;

847 
gno
 = 
	`NEXT_PGNO
(
n
->
c
->
ge
);

852 
	`PTRACE
(
dbc
, "Mge", 
	`PGNO
(

->
c
->
ge
), 
t
, 0);

853 i((
t
 = 
	`__bam_mge
(
dbc
,

854 
ndbc
, 

, 

, 
c_da
, &
de
)) != 0)

855 
r1
;

857 
pgs_de
++;

863 i(

->
c
->
ge
 =
NULL
)

864 
ded
;

866 i(
gno
 !
	`NEXT_PGNO
(
pg
))

871 
gno
 = 
	`NEXT_PGNO
(
pg
);

872 

->
o
 +
	`NUM_ENT
(
pg
);

873 
xt_o
 = 

->
o
;

875 
xt_ge
:

876 i((
t
 = 
	`__bam_kl
(
dbc
, 
pgs_de
 =0 ? 
STK_NOLOCK
 : 0)) != 0)

877 
r1
;

878 i(
ndbc
 !
NULL
 &&

879 (
t
 = 
	`__bam_kl
(
ndbc
, 
pgs_de
 =0 ? 
STK_NOLOCK
 : 0)) != 0)

880 
r1
;

882 
xt_no_a
:

883 
pg
 = 
NULL
;

885 i(
gno
 =
PGNO_INVALID
 || 
c_da
->
com_ges
 == 0)

886 
de
 = 1;

887 i(!
de
) {

892 i(
pgs_de
 !0 && *
p
) {

893 
ded
: i(((
t
 = 
	`__bam_kl
(
ndbc
, 0)) != 0 ||

894 (
t
 = 
	`__dbc_o
(
ndbc
)) != 0))

895 
r
;

896 *
dڕ
 = 0;

901 

->
o
 = 
xt_o
;

902 i((
t
 = 
	`__db_lg
(
dbc
,

903 
pgs_de
 ? 
LCK_COUPLE_ALWAYS
 : 
LCK_COUPLE
,

904 
gno
, 
DB_LOCK_READ
, 0, &

->
c
->
lock
)) != 0 ||

905 (
t
 = 
	`__memp_fg
(
dbmp
, &
gno
, 
dbc
->
txn
, 0, &
pg
)) != 0)

906 
r
;

907 
xt_ge
 = 1;

908 
xt
;

911 
de
:

914 
r1
: 
pg
 = 
NULL
;

916 
r
: i(
dbc
 !
NULL
 &&

917 (
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
)!0 && 
t
 == 0)

918 
t
 = 
t_t
;

919 i(
ndbc
 !
NULL
) {

920 i((
t_t
 = 
	`__bam_kl
(
ndbc
, 
STK_CLRDBC
)!0 && 
t
 == 0)

921 
t
 = 
t_t
;

922 i((
t_t
 = 
	`__dbc_o
(
ndbc
)!0 && 
t
 == 0)

923 
t
 = 
t_t
;

926 i(
pg
 !
NULL
 && (
t_t
 =

927 
	`__memp_ut
(
dbmp
, 
pg
, 
dbc
->
iܙy
!0&& 
t
 == 0)

928 
t
 = 
t_t
;

929 i(
g
 !
NULL
 && (
t_t
 =

930 
	`__memp_ut
(
dbmp
, 
g
, 
dbc
->
iܙy
!0&& 
t
 == 0)

931 
t
 = 
t_t
;

933 *
dڕ
 = 
de
;

935  (
t
);

936 
	}
}

942 
	$__bam_mge
(
dbc
, 
ndbc
, 

, 

, 
c_da
, 
dڕ
)

943 
DBC
 *
dbc
, *
ndbc
;

944 
u_t32_t
 

;

945 
DBT
 *

;

946 
DB_COMPACT
 *
c_da
;

947 *
dڕ
;

949 
BTREE_CURSOR
 *

, *
n
;

950 
BTREE
 *
t
;

951 
DB
 *
dbp
;

952 
PAGE
 *
pg
, *
g
;

953 
db_dx_t
 
adj
, 

;

954 
db_o_t
 
o
;

955 
cmp
, 
t
;

956 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

958 
dbp
 = 
dbc
->dbp;

959 
t
 = 
dbp
->
bt_
;

960 

 = (
BTREE_CURSOR
 *)
dbc
->

;

961 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

962 
pg
 = 

->
c
->
ge
;

963 
g
 = 
n
->
c
->
ge
;

965 

 = 
	`NUM_ENT
(
g
);

968 i(

 == 0)

969 

;

970 
adj
 = 
	`TYPE
(
g
=
P_LBTREE
 ? 
P_INDX
 : 
O_INDX
;

972 i(

 !
NULL
 && st->
size
 != 0) {

973 i(
dbc
->
dbty
 =
DB_RECNO
) {

974 i((
t
 = 
	`__m_gno
(
dbc
, 

, &
o
, 0)) != 0)

975 
r
;

976 i(
n
->
o
 >ecno) {

977 *
dڕ
 = 1;

978 i(

->
o
 >ecno)

979 
de
;

982 
func
 = 
	`TYPE
(
g
=
P_LBTREE
 ?

983 (
dbp
->
dup_com
 =
NULL
 ?

984 
__bam_defcmp
 : 
dbp
->
dup_com
: 
t
->
bt_com
;

986 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
,

987 

, 
g
, 

 - 
adj
, 
func
, &
cmp
)) != 0)

988 
r
;

996 i(
cmp
 <= 0) {

997 *
dڕ
 = 1;

998 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
,

999 

, 
g
, 0, 
func
, &
cmp
)) != 0)

1000 
r
;

1001 i(
cmp
 <= 0)

1002 
de
;

1013 i((
dbc
->
dbty
 =
DB_BTREE
 &&

1014 
n
->
c
[-1].
dx
 =0 &&->c[-1].
s
 != 1) ||

1015 ()(
	`P_FREESPACE
(
dbp
, 
pg
) -

1016 ((
dbp
->
pgsize
 - 
	`P_OVERHEAD
(dbp)) -

1017 
	`P_FREESPACE
(
dbp
, 
g
))< ()

)

1018 
t
 = 
	`__bam_mge_cds
(
dbc
, 
ndbc
, 

, 
c_da
);

1020 

: 
t
 = 
	`__bam_mge_ges
(
dbc
, 
ndbc
, 
c_da
);

1022 
de
:

1023 
r
:  (
t
);

1024 
	}
}

1027 
	$__bam_mge_cds
(
dbc
, 
ndbc
, 

, 
c_da
)

1028 
DBC
 *
dbc
, *
ndbc
;

1029 
u_t32_t
 

;

1030 
DB_COMPACT
 *
c_da
;

1032 
BINTERNAL
 *
bi
;

1033 
BKEYDATA
 *
bk
, *
tmp_bk
;

1034 
BTREE
 *
t
;

1035 
BTREE_CURSOR
 *

, *
n
;

1036 
DB
 *
dbp
;

1037 
DBT
 
a
, 
b
, 
da
, 
hdr
;

1038 
DB_ENV
 *
dbv
;

1039 
EPG
 *
g
;

1040 
PAGE
 *
pg
, *
g
;

1041 
db_dx_t
 
adj
, 
dx
, 

, *
np
, 
pd
;

1042 
t32_t
 
adju
;

1043 
u_t32_t
 
䓥a
, 
nksize
, 
p
, 
size
;

1044 
f_dup
, 
is_dup
, 
xt_dup
, 
n_ok
, 
t
;

1045 
	`size_t
 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

1047 
dbp
 = 
dbc
->dbp;

1048 
dbv
 = 
dbp
->dbenv;

1049 
t
 = 
dbp
->
bt_
;

1050 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1051 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

1052 
pg
 = 

->
c
->
ge
;

1053 
g
 = 
n
->
c
->
ge
;

1054 
	`memt
(&
hdr
, 0, (hdr));

1055 
pd
 = 
	`NUM_ENT
(
pg
);

1056 
n_ok
 = 0;

1057 
adju
 = 0;

1058 
t
 = 0;

1059 

 = 
	`NUM_ENT
(
g
);

1061 
	`DB_ASSERT
(
dbv
, 

 != 0);

1064 i(
c_da
->
com_un
 !
PGNO_INVALID
 &&

1065 
	`PGNO
(
g
> 
c_da
->
com_un
) {

1067 i((
t
 = 
	`__bam_un_ge
(
ndbc
, &
g
, 1)) != 0)

1068 
r
;

1071 
np
 = 
	`P_INP
(
dbp
, 
g
);

1077 
䓥a
 = 
	`P_FREESPACE
(
dbp
, 
pg
);

1079 
adj
 = 
	`TYPE
(
g
=
P_LBTREE
 ? 
P_INDX
 : 
O_INDX
;

1083 
dx
 = 0; indx < 

; indx +
adj
) {

1084 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
g
, 
dx
);

1087 
size
 = 
	`BITEM_PSIZE
(
bk
);

1090 i(
	`TYPE
(
pg
=
P_LBTREE
)

1091 
size
 +
	`BITEM_PSIZE
(
	`GET_BKEYDATA
(
dbp
, 
g
, 
dx
 + 1));

1096 
n_ok
 = 
adj
;

1097 i(
	`TYPE
(
pg
=
P_LBTREE
 &&

1098 
dx
 < 

 - 
adj
 &&

1099 
np
[
dx
] =np[dx + 
adj
]) {

1102 
size
 +(
db_dx_t
);

1103 
n_ok
++;

1105 
size
 +
	`BITEM_PSIZE
(

1106 
	`GET_BKEYDATA
(
dbp
, 
g
, 
dx
 + 
n_ok
));

1107 
n_ok
++;

1108 } 
dx
 + 
n_ok
 < 

 &&

1109 
np
[
dx
] =np[dx + 
n_ok
]);

1112 i(
䓥a
 < 
size
)

1120 i((
䓥a
 - 
size
< 

) {

1121 i(
䓥a
 - 

 > fa - (䓥a - 
size
))

1122 
dx
 +
n_ok
;

1125 
䓥a
 -
size
;

1126 
dx
 +
n_ok
 - 
adj
;

1128 i(
dx
 == 0)

1129 
de
;

1130 i(
	`TYPE
(
pg
!
P_LBTREE
 && TYPEg!
P_LDUP
) {

1131 i(
dx
 =

)

1132  (
	`__bam_mge_ges
(
dbc
, 
ndbc
, 
c_da
));

1133 
no_check
;

1145 
p
 = 
dbp
->
pgsize
;

1146 
g
 = &
n
->
c
[-1];pg >n->

;pg--)

1147 i((
䓥a
 = 
	`P_FREESPACE
(
dbp
, 
g
->
ge
)< 
p
) {

1148 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
g
->
ge
,pg->
dx
);

1150 
䓥a
 +
	`BINTERNAL_PSIZE
(
bi
->
n
);

1151 i(
䓥a
 < 
p
)

1152 
p
 = 
䓥a
;

1153 i(
g
->
dx
 != 0)

1162 i(
dx
 =

) {

1163 i(
n
->
c
[-1].
dx
 !0 ||->c[-1].
s
 == 1 ||

1164 
	`BINTERNAL_PSIZE
(
	`GET_BINTERNAL
(
dbp
,

1165 
n
->
c
[-1].
ge
, 1)->
n
<
p
)

1166  (
	`__bam_mge_ges
(
dbc
, 
ndbc
, 
c_da
));

1167 
dx
 -
adj
;

1169 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
g
, 
dx
);

1170 i(
dx
 !0 && 
	`BINTERNAL_SIZE
(
bk
->
n
>
p
) {

1171 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

1172 i(
dbp
->
dup_com
 =
__bam_defcmp
)

1173 
func
 = 
__bam_defx
;

1175 
func
 = 
NULL
;

1177 
func
 = 
t
->
bt_efix
;

1179 
func
 = 
NULL
;

1182 
dx
 !0 && 
np
[dx] =np[dx - 
adj
])

1183 
dx
 -
adj
;

1185 
dx
 !0 && 
	`BINTERNAL_SIZE
(
bk
->
n
>
p
) {

1186 i(
	`B_TYPE
(
bk
->
ty
!
B_KEYDATA
)

1187 
nݻfix
;

1192 i(
func
 =
NULL
)

1193 
nݻfix
;

1194 
tmp_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
g
, 
dx
 - 
adj
);

1195 i(
	`B_TYPE
(
tmp_bk
->
ty
!
B_KEYDATA
)

1196 
nݻfix
;

1197 
	`memt
(&
a
, 0, (a));

1198 
a
.
size
 = 
tmp_bk
->
n
;

1199 
a
.
da
 = 
tmp_bk
->data;

1200 
	`memt
(&
b
, 0, (b));

1201 
b
.
size
 = 
bk
->
n
;

1202 
b
.
da
 = 
bk
->data;

1203 
nksize
 = (
u_t32_t
)
	`func
(
dbp
, &
a
, &
b
);

1204 i(
	`BINTERNAL_PSIZE
(
nksize
< 
p
)

1206 
nݻfix
:

1209 
dx
 -
adj
;

1210 } 
dx
 !0 && 
np
[dx] =np[dx - 
adj
]);

1212 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
g
, 
dx
);

1215 i(
dx
 == 0)

1216 
de
;

1217 
	`DB_ASSERT
(
dbv
, 
dx
 <

);

1220 
no_check
: 
is_dup
 = 
f_dup
 = 
xt_dup
 = 0;

1221 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1222 &

->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0 ||

1223 (
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1224 &
n
->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1225 
r
;

1226 
pg
 = 

->
c
->
ge
;

1227 
g
 = 
n
->
c
->
ge
;

1228 
np
 = 
	`P_INP
(
dbp
, 
g
);

1230 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
g
, 0);

1232 i((
	`NUM_ENT
(
g
) % 2) == 0) {

1233 i(
	`NUM_ENT
(
g
> 2 && 
np
[0] ==inp[2]) {

1234 i(!
is_dup
) {

1235 
f_dup
 = 1;

1236 
is_dup
 = 1;

1238 
f_dup
 = 0;

1240 
xt_dup
 = 1;

1241 } i(
xt_dup
) {

1242 
is_dup
 = 1;

1243 
f_dup
 = 0;

1244 
xt_dup
 = 0;

1246 
is_dup
 = 0;

1249 i(
is_dup
 && !
f_dup
 && (
pd
 % 2) == 0) {

1251 i((
t
 = 
	`__bam_adjdx
(
dbc
,

1252 
pg
, 
pd
,d - 
P_INDX
, 1)) != 0)

1253 
r
;

1254 i(!
xt_dup
)

1255 
is_dup
 = 0;

1256 } 
	`B_TYPE
(
bk
->
ty
)) {

1257 
B_KEYDATA
:

1258 
hdr
.
da
 = 
bk
;

1259 
hdr
.
size
 = 
	`SSZA
(
BKEYDATA
, 
da
);

1260 
da
.
size
 = 
bk
->
n
;

1261 
da
.d
bk
->data;

1262 i((
t
 = 
	`__db_pem
(
dbc
, 
pg
, 
pd
,

1263 
	`BKEYDATA_SIZE
(
bk
->
n
), &
hdr
, &
da
)) != 0)

1264 
r
;

1266 
B_OVERFLOW
:

1267 
B_DUPLICATE
:

1268 
da
.
size
 = 
BOVERFLOW_SIZE
;

1269 
da
.d
bk
;

1270 i((
t
 = 
	`__db_pem
(
dbc
, 
pg
, 
pd
,

1271 
BOVERFLOW_SIZE
, &
da
, 
NULL
)) != 0)

1272 
r
;

1275 
	`__db_rx
(
dbv
,

1277 (
u_lg
)
	`PGNO
(
pg
));

1278 
t
 = 
EINVAL
;

1279 
r
;

1281 
pd
++;

1282 i(
xt_dup
 && (
	`NUM_ENT
(
g
) % 2) == 0) {

1283 i((
t
 = 
	`__bam_adjdx
(
ndbc
,

1284 
g
, 0, 
O_INDX
, 0)) != 0)

1285 
r
;

1287 i((
t
 = 
	`__db_dem
(
ndbc
,

1288 
g
, 0, 
	`BITEM_SIZE
(
bk
))) != 0)

1289 
r
;

1291 
adju
++;

1292 } --
dx
 != 0);

1294 
	`DB_ASSERT
(
dbv
, 
	`NUM_ENT
(
g
) != 0);

1296 i(
adju
 != 0 &&

1297 (
	`F_ISSET
(

, 
C_RECNUM
|| F_ISSET(
dbc
, 
DBC_OPD
))) {

1298 
	`DB_ASSERT
(
dbv
, 

->
c
 - cp->

 =
n
->csp -cp->sp);

1299 i(
	`TYPE
(
pg
=
P_LBTREE
)

1300 
adju
 /
P_INDX
;

1301 i((
t
 = 
	`__bam_adju
(
ndbc
, -
adju
)) != 0)

1302 
r
;

1304 i((
t
 = 
	`__bam_adju
(
dbc
, 
adju
)) != 0)

1305 
r
;

1309 i(
ndbc
->
dbty
 =
DB_BTREE
 &&

1310 (
t
 = 
	`__bam_pupde
(
ndbc
, 
pg
)) != 0)

1311 
r
;

1313 
de
: 
t
 = 
	`__bam_kl
(
ndbc
, 
STK_CLRDBC
);

1315 
r
:  (
t
);

1316 
	}
}

1319 
	$__bam_mge_ges
(
dbc
, 
ndbc
, 
c_da
)

1320 
DBC
 *
dbc
, *
ndbc
;

1321 
DB_COMPACT
 *
c_da
;

1323 
BTREE_CURSOR
 *

, *
n
;

1324 
DB
 *
dbp
;

1325 
DBT
 
da
, 
hdr
, 
d
;

1326 
DB_MPOOLFILE
 *
dbmp
;

1327 
PAGE
 *
pg
, *
g
;

1328 
db_dx_t
 

, *
np
, *
pp
;

1329 
db_pgno_t
 
gno
;

1330 
u_t8_t
 *
bp
;

1331 
u_t32_t
 
n
;

1332 
i
, 
v
, 
t
;

1334 
	`COMPQUIET
(
gno
, 
PGNO_INVALID
);

1335 
dbp
 = 
dbc
->dbp;

1336 
dbmp
 = 
dbp
->
mpf
;

1337 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1338 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

1339 
pg
 = 

->
c
->
ge
;

1340 
g
 = 
n
->
c
->
ge
;

1341 
	`memt
(&
hdr
, 0, (hdr));

1342 

 = 
	`NUM_ENT
(
g
);

1345 i(

 == 0)

1346 

;

1348 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1349 &

->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0 ||

1350 (
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1351 &
n
->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1352 
r
;

1353 
pg
 = 

->
c
->
ge
;

1354 
g
 = 
n
->
c
->
ge
;

1355 
	`DB_ASSERT
(
dbp
->
dbv
, 

 =
	`NUM_ENT
(
g
));

1358 
n
 = 
dbp
->
pgsize
 - 
	`HOFFSET
(
g
);

1359 i(
	`DBC_LOGGING
(
dbc
)) {

1360 
da
.d(
u_t8_t
 *)
g
 + 
	`HOFFSET
(npg);

1361 
da
.
size
 = 
n
;

1362 
d
.
da
 = 
	`P_INP
(
dbp
, 
g
);

1363 
d
.
size
 = 
	`NUM_ENT
(
g
* (
db_dx_t
);

1364 i((
t
 = 
	`__bam_mge_log
(
dbp
,

1365 
dbc
->
txn
, &
	`LSN
(
pg
), 0, 
	`PGNO
(pg),

1366 &
	`LSN
(
pg
), 
	`PGNO
(
g
), &LSNpg), 
NULL
, &
da
, &
d
)) != 0)

1367 
r
;

1369 
	`LSN_NOT_LOGGED
(
	`LSN
(
pg
));

1370 
	`LSN
(
g
LSN(
pg
);

1371 
bp
 = (
u_t8_t
 *)
pg
 + 
	`HOFFSET
g- 
n
;

1372 
	`memy
(
bp
, (
u_t8_t
 *)
g
 + 
	`HOFFSET
pg), 
n
);

1375 
pp
 = 
	`P_INP
(
dbp
, 
pg
+ 
	`NUM_ENT
(pg);

1376 
np
 = 
	`P_INP
(
dbp
, 
g
);

1377 
i
 = 0; i < 
	`NUM_ENT
(
g
); i++)

1378 *
pp
++ = *
np
++ - (
dbp
->
pgsize
 - 
	`HOFFSET
(
pg
));

1379 
	`HOFFSET
(
pg
-
n
;

1380 
	`NUM_ENT
(
pg
+
i
;

1382 
	`NUM_ENT
(
g
) = 0;

1383 
	`HOFFSET
(
g
+
n
;

1385 i(
	`F_ISSET
(

, 
C_RECNUM
|| F_ISSET(
dbc
, 
DBC_OPD
)) {

1386 
	`DB_ASSERT
(
dbp
->
dbv
, 

->
c
 - cp->

 =
n
->csp -cp->sp);

1387 i(
	`TYPE
(
pg
=
P_LBTREE
)

1388 
i
 /
P_INDX
;

1389 i((
t
 = 
	`__bam_adju
(
ndbc
, -
i
)) != 0)

1390 
r
;

1392 i((
t
 = 
	`__bam_adju
(
dbc
, 
i
)) != 0)

1393 
r
;

1396 

:

1405 i(
	`PGNO
(
n
->

->
ge
=n->
ro
 &&

1406 
	`NUM_ENT
(
n
->

->
ge
) == 2) {

1407 i((
t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
 | 
STK_PGONLY
)) != 0)

1408 
r
;

1409 
v
 = 
	`LEVEL
(
n
->

->
ge
);

1410 
gno
 = 
	`PGNO
(
n
->
c
[-1].
ge
);

1412 
v
 = 0;

1413 i(
c_da
->
com_un
 > 
	`PGNO
(
g
))

1414 
c_da
->
com_un
--;

1415 i((
t
 = 
	`__bam_dges
(
ndbc
,

1416 0, 
ndbc
->
dbty
 =
DB_RECNO
 ? 0 : 1)) != 0)

1417 
r
;

1418 
g
 = 
NULL
;

1419 
c_da
->
com_ges_
++;

1420 
c_da
->
com_ges
--;

1421 i(
v
 != 0) {

1422 i((
t
 = 
	`__memp_fg
(
dbmp
, &
n
->
ro
, 
dbc
->
txn
,

1423 0, &
g
)) != 0)

1424 
r
;

1425 i(
v
 =
	`LEVEL
(
g
))

1426 
v
 = 0;

1427 i((
t
 = 
	`__memp_ut
(
dbmp
, 
g
, 
dbc
->
iܙy
)) != 0)

1428 
r
;

1429 
g
 = 
NULL
;

1430 i(
v
 != 0) {

1431 
c_da
->
com_vs
++;

1432 
c_da
->
com_ges_
++;

1433 i(
c_da
->
com_un
 > 
gno
)

1434 
c_da
->
com_un
--;

1435 i(
c_da
->
com_ges
 != 0)

1436 
c_da
->
com_ges
--;

1440 
r
:  (
t
);

1441 
	}
}

1448 
	$__bam_mge_
(
dbc
, 
ndbc
, 
v
, 
c_da
, 
mged
)

1449 
DBC
 *
dbc
, *
ndbc
;

1450 
v
;

1451 
DB_COMPACT
 *
c_da
;

1452 *
mged
;

1454 
BINTERNAL
 
bi
, *
b
, *
f
;

1455 
BTREE_CURSOR
 *

, *
n
;

1456 
DB
 *
dbp
;

1457 
DBT
 
da
, 
hdr
;

1458 
DB_MPOOLFILE
 *
dbmp
;

1459 
EPG
 *
g
, *
ve_c
, *
nve_c
;

1460 
PAGE
 *
pg
, *
g
;

1461 
RINTERNAL
 *
rk
;

1462 
db_dx_t
 
dx
, 
pd
;

1463 
db_pgno_t
 
gno
;

1464 
t32_t
 
ecs
;

1465 
u_t16_t
 
size
;

1466 
u_t32_t
 
䓥a
, 
p
;

1467 
t
;

1469 
	`COMPQUIET
(
b
, 
NULL
);

1470 
	`COMPQUIET
(
gno
, 
PGNO_INVALID
);

1479 
dbp
 = 
dbc
->dbp;

1480 
dbmp
 = 
dbp
->
mpf
;

1481 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1482 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

1483 *
mged
 = 0;

1484 
t
 = 0;

1490 
ve_c
 = 

->
c
;

1491 

->
c
 = &->c[-
v
 + 1];

1492 
pg
 = 

->
c
->
ge
;

1493 
pd
 = 
	`NUM_ENT
(
pg
);

1495 
nve_c
 = 
n
->
c
;

1496 
n
->
c
 = &n->c[-
v
 + 1];

1497 
g
 = 
n
->
c
->
ge
;

1498 
dx
 = 
	`NUM_ENT
(
g
);

1504 i(
g
 =
pg
)

1505 
de
;

1507 i((
t
 = 
	`__memp_dty
(
dbmp
,

1508 &

->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0 ||

1509 (
t
 = 
	`__memp_dty
(
dbmp
,

1510 &
n
->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1511 
r
;

1512 
pg
 = 

->
c
->
ge
;

1513 
g
 = 
n
->
c
->
ge
;

1515 i(
	`TYPE
(
pg
=
P_IBTREE
) {

1520 i((
t
 =

1521 
	`__bam_un__ovow
(
dbc
, 
pg
, 
c_da
)) != 0)

1522 
r
;

1523 i((
t
 =

1524 
	`__bam_un__ovow
(
dbc
, 
g
, 
c_da
)) != 0)

1525 
r
;

1534 
f
 = 
NULL
;

1535 i(
	`TYPE
(
pg
=
P_IBTREE
) {

1537 
䓥a
 = 
	`P_FREESPACE
(
dbp
, 
pg
);

1542 
g
 = 
n
->
c
;

1543 --
g
 >
n
->

 &&pg->
dx
 == 0)

1545 
f
 = 
b
 = 
	`GET_BINTERNAL
(
dbp
, 
g
->
ge
,pg->
dx
);

1546 
g
 = 
n
->
c
;

1548 
dx
 = 0;;) {

1549 
size
 = 
	`BINTERNAL_PSIZE
(
b
->
n
);

1550 i(
size
 > 
䓥a
)

1552 
䓥a
 -
size
;

1553 i(++
dx
 >
	`NUM_ENT
(
g
))

1555 
b
 = 
	`GET_BINTERNAL
(
dbp
, 
g
, 
dx
);

1559 i(
dx
 =
	`NUM_ENT
(
g
&& 
g
[-1].indx != 0)

1560 
fs
;

1562 
p
 = 
dbp
->
pgsize
;

1563 
g
--;pg >
n
->

;pg--)

1564 i((
䓥a
 = 
	`P_FREESPACE
(
dbp
, 
g
->
ge
)< 
p
) {

1565 
b
 = 
	`GET_BINTERNAL
(
dbp
, 
g
->
ge
,pg->
dx
);

1567 
䓥a
 +
	`BINTERNAL_PSIZE
(
b
->
n
);

1568 i(
䓥a
 < 
p
)

1569 
p
 = 
䓥a
;

1570 i(
g
->
dx
 != 0)

1573 
g
 = 
n
->
c
;

1576 i(
dx
 =
	`NUM_ENT
(
g
)) {

1577 i(
	`NUM_ENT
(
g
[-1].
ge
) == 1)

1578 
fs
;

1579 
b
 =

1580 
	`GET_BINTERNAL
(
dbp
, 
g
[-1].
ge
,pg[-1].
dx
 + 1);

1582 
b
 = 
	`GET_BINTERNAL
(
dbp
, 
g
, 
dx
);

1585 
dx
 !0 && 
	`BINTERNAL_PSIZE
(
b
->
n
> 
p
) {

1586 
dx
--;

1587 
b
 = 
	`GET_BINTERNAL
(
dbp
, 
g
, 
dx
);

1589 i(
dx
 == 0)

1590 
de
;

1593 
fs
: 
	`memt
(&
bi
, 0, (bi));

1594 
	`memt
(&
hdr
, 0, (hdr));

1595 
	`memt
(&
da
, 0, (data));

1596 
ecs
 = 0;

1603 i(
dbc
->
dbty
 =
DB_BTREE
) {

1604 
b
 = 
	`GET_BINTERNAL
(
dbp
, 
g
, 0);

1605 
size
 = 
f
 =
NULL
 ?

1606 
	`BINTERNAL_SIZE
(
b
->
n
) :

1607 
	`BINTERNAL_SIZE
(
f
->
n
);

1608 i(
	`P_FREESPACE
(
dbp
, 
pg
< 
size
 + (
db_dx_t
))

1611 i(
f
 =
NULL
) {

1612 
da
.
size
 = 
b
->
n
;

1613 
da
.d
b
->data;

1615 
da
.
size
 = 
f
->
n
;

1616 
da
.d
f
->data;

1618 
bi
.
n
 = 
da
.
size
;

1619 
	`B_TSET
(
bi
.
ty
, 
b
->type);

1620 
bi
.
pgno
 = 
b
->pgno;

1621 
bi
.
ecs
 = 
b
->nrecs;

1622 
hdr
.
da
 = &
bi
;

1623 
hdr
.
size
 = 
	`SSZA
(
BINTERNAL
, 
da
);

1624 i(
	`F_ISSET
(

, 
C_RECNUM
|| F_ISSET(
dbc
, 
DBC_OPD
))

1625 
ecs
 +(
t32_t
)
b
->
ecs
;

1627 
rk
 = 
	`GET_RINTERNAL
(
dbp
, 
g
, 0);

1628 
size
 = 
RINTERNAL_SIZE
;

1629 i(
	`P_FREESPACE
(
dbp
, 
pg
< 
size
 + (
db_dx_t
))

1632 
hdr
.
da
 = 
rk
;

1633 
hdr
.
size
 = size;

1634 
ecs
 +(
t32_t
)
rk
->
ecs
;

1636 i((
t
 = 
	`__db_pem
(
dbc
, 
pg
, 
pd
, 
size
, &
hdr
, &
da
)) != 0)

1637 
r
;

1638 
pd
++;

1639 i(
f
 !
NULL
) {

1641 
size
 = 
	`BINTERNAL_SIZE
(
b
->
n
);

1642 
f
 = 
NULL
;

1644 i((
t
 = 
	`__db_dem
(
ndbc
, 
g
, 0, 
size
)) != 0)

1645 
r
;

1646 *
mged
 = 1;

1647 } --
dx
 != 0);

1649 i(
c_da
->
com_un
 !
PGNO_INVALID
 &&

1650 
	`PGNO
(
pg
> 
c_da
->
com_un
 && 

->
c
 !->

) {

1651 i((
t
 = 
	`__bam_un_ge
(
dbc
, &
pg
, 1)) != 0)

1652 
r
;

1655 i(
	`NUM_ENT
(
g
!0 && 
c_da
->
com_un
 !
PGNO_INVALID
 &&

1656 
	`PGNO
(
g
> 
c_da
->
com_un
 && 
n
->
c
 !n->

) {

1657 i((
t
 = 
	`__bam_un_ge
(
ndbc
, &
g
, 1)) != 0)

1658 
r
;

1661 i(!*
mged
)

1662 
de
;

1664 i(
ecs
 != 0) {

1665 
	`DB_ASSERT
(
dbp
->
dbv
, 

->
c
 - cp->

 =
n
->csp -cp->sp);

1666 

->
c
--;

1667 i((
t
 = 
	`__bam_adju
(
dbc
, 
ecs
)) != 0)

1668 
r
;

1670 
n
->
c
--;

1671 i((
t
 = 
	`__bam_adju
(
ndbc
, -
ecs
)) != 0)

1672 
r
;

1673 
n
->
c
++;

1675 

->
c
 = 
ve_c
;

1686 i((
t
 =

1687 
	`__memp_ut
(
dbmp
, 
nve_c
->
ge
, 
dbc
->
iܙy
)) != 0)

1688 
r
;

1689 i((
t
 = 
	`__LPUT
(
dbc
, 
nve_c
->
lock
)) != 0)

1690 
r
;

1691 
nve_c
--;

1692 } 
nve_c
 !
n
->
c
);

1694 i(
	`NUM_ENT
(
g
) == 0) {

1701 i(
	`PGNO
(
n
->

->
ge
=n->
ro
 &&

1702 
	`NUM_ENT
(
n
->

->
ge
) == 2) {

1703 i((
t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
)) != 0)

1704 
r
;

1705 
v
 = 
	`LEVEL
(
n
->

->
ge
);

1706 
gno
 = 
	`PGNO
(
n
->
c
[-1].
ge
);

1708 
v
 = 0;

1710 i(
c_da
->
com_un
 > 
	`PGNO
(
g
))

1711 
c_da
->
com_un
--;

1712 
t
 = 
	`__bam_dges
(
ndbc
,

1713 0, 
ndbc
->
dbty
 =
DB_RECNO
 ? 0 : 1);

1714 
c_da
->
com_ges_
++;

1715 i(
t
 =0 && 
v
 != 0) {

1716 i((
t
 = 
	`__memp_fg
(
dbmp
, &
n
->
ro
, 
dbc
->
txn
,

1717 0, &
g
)) != 0)

1718 
r
;

1719 i(
v
 =
	`LEVEL
(
g
))

1720 
v
 = 0;

1721 i((
t
 =

1722 
	`__memp_ut
(
dbmp
, 
g
, 
dbc
->
iܙy
)) != 0)

1723 
r
;

1724 
g
 = 
NULL
;

1725 i(
v
 != 0) {

1726 
c_da
->
com_vs
++;

1727 
c_da
->
com_ges_
++;

1728 i(
c_da
->
com_un
 > 
gno
)

1729 
c_da
->
com_un
--;

1730 i(
c_da
->
com_ges
 != 0)

1731 
c_da
->
com_ges
--;

1735 
t
 = 
	`__bam_pupde
(
ndbc
, 
g
);

1736  (
t
);

1738 
de
:

1739 
r
: 

->
c
 = 
ve_c
;

1740 
n
->
c
 = 
nve_c
;

1742  (
t
);

1743 
	}
}

1750 
	$__bam_com_dups
(
dbc
, 
g
, 

, 
have_lock
, 
c_da
, 
dڕ
)

1751 
DBC
 *
dbc
;

1752 
PAGE
 **
g
;

1753 
u_t32_t
 

;

1754 
have_lock
;

1755 
DB_COMPACT
 *
c_da
;

1756 *
dڕ
;

1758 
BOVERFLOW
 *
bo
;

1759 
BTREE_CURSOR
 *

;

1760 
DB
 *
dbp
;

1761 
DBC
 *
d
;

1762 
DBT
 
t
;

1763 
DB_ENV
 *
dbv
;

1764 
DB_MPOOLFILE
 *
dbmp
;

1765 
PAGE
 *
dpg
, *
pg
;

1766 
db_dx_t
 
i
;

1767 
de
, 
v
, 
t
, 

, 
t_t
;

1769 

 = 0;

1770 
t
 = 0;

1771 
d
 = 
NULL
;

1773 
dbp
 = 
dbc
->dbp;

1774 
dbv
 = 
dbp
->dbenv;

1775 
dbmp
 = 
dbp
->
mpf
;

1776 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1777 
pg
 = *
g
;

1779 
i
 = 0; i < 
	`NUM_ENT
(
pg
); i++) {

1780 
bo
 = 
	`GET_BOVERFLOW
(
dbp
, 
pg
, 
i
);

1781 i(
	`B_TYPE
(
bo
->
ty
=
B_KEYDATA
)

1783 
c_da
->
com_ges_exame
++;

1784 i(
bo
->
pgno
 > 
c_da
->
com_un
) {

1785 (*
dڕ
)++;

1786 i(!
have_lock
) {

1787 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
	`PGNO
(
pg
),

1788 
DB_LOCK_WRITE
, 0, &

->
c
->
lock
)) != 0)

1789 
r
;

1790 
have_lock
 = 1;

1791 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
, 
g
,

1792 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1793 
r
;

1794 
pg
 = *
g
;

1796 i((
t
 =

1797 
	`__bam_un_ro_ge
(
dbc
, 
pg
, 
i
, 
c_da
)) != 0)

1798 
r
;

1800 
bo
 = 
	`GET_BOVERFLOW
(
dbp
, 
pg
, 
i
);

1803 i(
	`B_TYPE
(
bo
->
ty
=
B_OVERFLOW
) {

1804 i((
t
 = 
	`__bam_un_ovow
(
dbc
, 
bo
->
pgno
,

1805 
have_lock
 ? 
PGNO_INVALID
 : 
	`PGNO
(
pg
), 
c_da
)) != 0)

1806 
r
;

1807 (*
dڕ
)++;

1814 i((
t
 = 
	`__memp_fg
(
dbmp
, &
bo
->
pgno
, 
dbc
->
txn
,

1815 0, &
dpg
)) != 0)

1816 
r
;

1818 
v
 = 
dpg
->level;

1819 i((
t
 = 
	`__memp_ut
(
dbmp
, 
dpg
, 
dbc
->
iܙy
)) != 0)

1820 
r
;

1821 i(
v
 =
LEAFLEVEL
)

1823 i((
t
 = 
	`__dbc_wd
(
dbc
, 
bo
->
pgno
, 
NULL
, &
d
)) != 0)

1824  (
t
);

1825 i(!
have_lock
) {

1826 i((
t
 = 
	`__db_lg
(
dbc
, 0,

1827 
	`PGNO
(
pg
), 
DB_LOCK_WRITE
, 0, &

->
c
->
lock
)) != 0)

1828 
r
;

1829 
have_lock
 = 1;

1830 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
, 
g
,

1831 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1832 
r
;

1833 
pg
 = *
g
;

1835 (*
dڕ
)++;

1836 
	`memt
(&
t
, 0, (start));

1838 i((
t
 = 
	`__bam_com_t
(
d
, &
t
,

1839 
NULL
, 

, &

, 
c_da
, &
de
)) != 0)

1841 } !
de
);

1843 i(
t
.
da
 !
NULL
)

1844 
	`__os_
(
dbv
, 
t
.
da
);

1846 i(
t
 != 0)

1847 
r
;

1849 
t
 = 
	`__dbc_o
(
d
);

1850 
d
 = 
NULL
;

1851 i(
t
 != 0)

1852 
r
;

1855 
r
: i(
d
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(d)!0 && 
t
 == 0)

1856 
t
 = 
t_t
;

1857  (
t
);

1858 
	}
}

1866 
	$__bam_un_ge
(
dbc
, 
pgp
, 
upde_
)

1867 
DBC
 *
dbc
;

1868 
PAGE
 **
pgp
;

1869 
upde_
;

1871 
BTREE_CURSOR
 *

;

1872 
DB
 *
dbp
;

1873 
DBT
 
da
, 
hdr
, 
d
;

1874 
DB_LSN
 
l
;

1875 
EPG
 *
g
;

1876 
PAGE
 *
wge
;

1877 
db_pgno_t
 
wpgno
, *
pgn
;

1878 
t
;

1880 
dbp
 = 
dbc
->dbp;

1890 i((
t
 = 
	`__db_w
(
dbc
, 
P_DONTEXTEND
 | 
	`TYPE
(*
pgp
), &
wge
)) != 0)

1891  (
t
);

1898 i(
wge
 =
NULL
)

1905 i(
	`PGNO
(
wge
> PGNO(*
pgp
)) {

1907 i(
	`TYPE
(
wge
=
P_OVERFLOW
)

1908 
	`OV_LEN
(
wge
) = 0;

1909  (
	`__db_
(
dbc
, 
wge
));

1912 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1913 &
wge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1914 
r
;

1917 i(
	`DBC_LOGGING
(
dbc
)) {

1918 
hdr
.
da
 = *
pgp
;

1919 
hdr
.
size
 = 
	`P_OVERHEAD
(
dbp
);

1920 i(
	`TYPE
(*
pgp
=
P_OVERFLOW
) {

1921 
da
.d(
u_t8_t
 *)*
pgp
 + 
	`P_OVERHEAD
(
dbp
);

1922 
da
.
size
 = 
	`OV_LEN
(*
pgp
);

1923 
d
.
size
 = 0;

1925 
da
.d(
u_t8_t
 *)*
pgp
 + 
	`HOFFSET
(*pgp);

1926 
da
.
size
 = 
dbp
->
pgsize
 - 
	`HOFFSET
(*
pgp
);

1927 
d
.
da
 = 
	`P_INP
(
dbp
, *
pgp
);

1928 
d
.
size
 = 
	`NUM_ENT
(*
pgp
* (
db_dx_t
);

1930 i((
t
 = 
	`__bam_mge_log
(
dbp
, 
dbc
->
txn
,

1931 &
	`LSN
(
wge
), 0, 
	`PGNO
(newpage), &LSN(newpage),

1932 
	`PGNO
(*
pgp
), &
	`LSN
(*pgp), &
hdr
, &
da
, &
d
)) != 0)

1933 
r
;

1935 
	`LSN_NOT_LOGGED
(
	`LSN
(
wge
));

1937 
wpgno
 = 
	`PGNO
(
wge
);

1938 
l
 = 
	`LSN
(
wge
);

1939 
	`memy
(
wge
, *
pgp
, 
dbp
->
pgsize
);

1940 
	`PGNO
(
wge

wpgno
;

1941 
	`LSN
(
wge

l
;

1944 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1945 
pgp
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1946 
r
;

1947 i(
	`TYPE
(*
pgp
=
P_OVERFLOW
)

1948 
	`OV_LEN
(*
pgp
) = 0;

1950 
	`HOFFSET
(*
pgp

dbp
->
pgsize
;

1951 
	`NUM_ENT
(*
pgp
) = 0;

1953 
	`LSN
(*
pgp

l
;

1956 
	`TYPE
(
wge
)) {

1957 
P_OVERFLOW
:

1958 
P_LBTREE
:

1959 
P_LRECNO
:

1960 
P_LDUP
:

1961 i(
	`NEXT_PGNO
(
wge
=
PGNO_INVALID
 &&

1962 
	`PREV_PGNO
(
wge
=
PGNO_INVALID
)

1964 i((
t
 = 
	`__bam_lk
(
dbc
, *
pgp
, 
	`PGNO
(
wge
))) != 0)

1965 
r
;

1970 

 = (
BTREE_CURSOR
*)
dbc
->

;

1976 
t
 = 
	`__db_
(
dbc
, *
pgp
);

1978 *
pgp
 = 
wge
;

1980 i(
t
 != 0)

1981  (
t
);

1983 i(!
upde_
)

1984 
de
;

1987 
g
 = &

->
c
[-1];

1988 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

1989 &
g
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

1990  (
t
);

1992 
	`TYPE
(
g
->
ge
)) {

1993 
P_IBTREE
:

1994 
pgn
 = &
	`GET_BINTERNAL
(
dbp
, 
g
->
ge
,pg->
dx
)->
pgno
;

1996 
P_IRECNO
:

1997 
pgn
 = &
	`GET_RINTERNAL
(
dbp
, 
g
->
ge
,pg->
dx
)->
pgno
;

2000 
pgn
 = &
	`GET_BOVERFLOW
(
dbp
, 
g
->
ge
,pg->
dx
)->
pgno
;

2003 i(
	`DBC_LOGGING
(
dbc
)) {

2004 i((
t
 = 
	`__bam_pgno_log
(
dbp
, 
dbc
->
txn
, &
	`LSN
(
g
->
ge
),

2005 0, 
	`PGNO
(
g
->
ge
), &
	`LSN
pg->ge), (
u_t32_t
pg->
dx
,

2006 *
pgn
, 
	`PGNO
(
wge
))) != 0)

2007  (
t
);

2009 
	`LSN_NOT_LOGGED
(
	`LSN
(
g
->
ge
));

2011 *
pgn
 = 
	`PGNO
(
wge
);

2012 

->
c
->
ge
 = 
wge
;

2014 
de
:  (0);

2016 
r
: ()
	`__memp_ut
(
dbp
->
mpf
, 
wge
, 
dbc
->
iܙy
);

2017  (
t
);

2018 
	}
}

2028 
	$__bam_un_ovow
(
dbc
, 
pgno
, 
pg_lock
, 
c_da
)

2029 
DBC
 *
dbc
;

2030 
db_pgno_t
 
pgno
;

2031 
db_pgno_t
 
pg_lock
;

2032 
DB_COMPACT
 *
c_da
;

2034 
DB
 *
dbp
;

2035 
DB_LOCK
 
lock
;

2036 
PAGE
 *
ge
;

2037 
t
, 
t_t
;

2039 
dbp
 = 
dbc
->dbp;

2040 
ge
 = 
NULL
;

2041 
	`LOCK_INIT
(
lock
);

2043 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
, 
dbc
->
txn
, 0, &
ge
)) != 0)

2044  (
t
);

2046 (
pgno
 = 
	`NEXT_PGNO
(
ge
)!
PGNO_INVALID
) {

2047 i((
t
 = 
	`__memp_ut
(
dbp
->
mpf
, 
ge
, 
dbc
->
iܙy
)) != 0)

2048  (
t
);

2049 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
, 
dbc
->
txn
,

2050 0, &
ge
)) != 0)

2051  (
t
);

2052 i(
pgno
 <
c_da
->
com_un
)

2054 i(
pg_lock
 !
PGNO_INVALID
) {

2055 i((
t
 = 
	`__db_lg
(
dbc
,

2056 0, 
pg_lock
, 
DB_LOCK_WRITE
, 0, &
lock
)) != 0)

2058 
pg_lock
 = 
PGNO_INVALID
;

2060 i((
t
 = 
	`__bam_un_ge
(
dbc
, &
ge
, 0)) != 0)

2064 i(
ge
 !
NULL
 &&

2065 (
t_t
 = 
	`__memp_ut
(

2066 
dbp
->
mpf
, 
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

2067 
t
 = 
t_t
;

2068 i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

2069 
t
 = 
t_t
;

2070  (
t
);

2071 
	}
}

2079 
	$__bam_un_ro_ge
(
dbc
, 
pg
, 
dx
, 
c_da
)

2080 
DBC
 *
dbc
;

2081 
PAGE
 *
pg
;

2082 
u_t32_t
 
dx
;

2083 
DB_COMPACT
 *
c_da
;

2085 
BINTERNAL
 *
bi
;

2086 
BOVERFLOW
 *
bo
;

2087 
DB
 *
dbp
;

2088 
DBT
 
ig
;

2089 
PAGE
 *
ge
;

2090 
db_pgno_t
 
wpgno
, *
pgn
;

2091 
t
, 
t_t
;

2093 
	`COMPQUIET
(
c_da
, 
NULL
);

2094 
	`COMPQUIET
(
bo
, 
NULL
);

2095 
	`COMPQUIET
(
wpgno
, 
PGNO_INVALID
);

2096 
dbp
 = 
dbc
->dbp;

2097 
ge
 = 
NULL
;

2098 i(
	`TYPE
(
pg
=
P_IBTREE
) {

2099 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
pg
, 
dx
);

2100 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
) {

2101 
bo
 = (
BOVERFLOW
 *)(
bi
->
da
);

2102 
pgn
 = &
bo
->
pgno
;

2104 
pgn
 = &
bi
->
pgno
;

2106 
bo
 = 
	`GET_BOVERFLOW
(
dbp
, 
pg
, 
dx
);

2107 
pgn
 = &
bo
->
pgno
;

2110 
	`DB_ASSERT
(
dbp
->
dbv
, 
	`IS_DIRTY
(
pg
));

2112 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, 
pgn
, 
dbc
->
txn
, 0, &
ge
)) != 0)

2113 
r
;

2120 i(
	`TYPE
(
ge
=
P_OVERFLOW
 && 
	`OV_REF
(page) > 1) {

2121 i((
t
 = 
	`__db_ovf
(
dbc
, 
bo
->
pgno
)) != 0)

2122 
r
;

2123 
	`memt
(&
ig
, 0, (orig));

2124 i((
t
 = 
	`__db_goff
(
dbp
, 
dbc
->
txn
, &
ig
,

2125 
bo
->

, bo->
pgno
, &
ig
.
da
, &ig.
size
)) == 0)

2126 
t
 = 
	`__db_poff
(
dbc
, &
ig
, &
wpgno
);

2127 i(
ig
.
da
 !
NULL
)

2128 
	`__os_
(
dbp
->
dbv
, 
ig
.
da
);

2129 i(
t
 != 0)

2130 
r
;

2132 i((
t
 = 
	`__bam_un_ge
(
dbc
, &
ge
, 0)) != 0)

2133 
r
;

2134 
wpgno
 = 
	`PGNO
(
ge
);

2136 i(
wpgno
 =*
pgn
)

2137 
r
;

2141 i(
	`DBC_LOGGING
(
dbc
)) {

2142 i((
t
 = 
	`__bam_pgno_log
(
dbp
,

2143 
dbc
->
txn
, &
	`LSN
(
pg
), 0, 
	`PGNO
(pg),

2144 &
	`LSN
(
pg
), (
u_t32_t
)
dx
, *
pgn
, 
wpgno
)) != 0)

2145 
r
;

2147 
	`LSN_NOT_LOGGED
(
	`LSN
(
pg
));

2149 *
pgn
 = 
wpgno
;

2151 
r
: i(
ge
 !
NULL
 && (
t_t
 =

2152 
	`__memp_ut
(
dbp
->
mpf
, 
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

2153 
t
 = 
t_t
;

2154  (
t
);

2155 
	}
}

2165 
	$__bam_un__ovow
(
dbc
, 
ge
, 
c_da
)

2166 
DBC
 *
dbc
;

2167 
PAGE
 *
ge
;

2168 
DB_COMPACT
 *
c_da
;

2170 
BINTERNAL
 *
bi
;

2171 
BOVERFLOW
 *
bo
;

2172 
db_dx_t
 
dx
;

2173 
t
;

2175 
	`COMPQUIET
(
bo
, 
NULL
);

2176 
t
 = 0;

2177 
dx
 = 0; indx < 
	`NUM_ENT
(
ge
); indx++) {

2178 
bi
 = 
	`GET_BINTERNAL
(
dbc
->
dbp
, 
ge
, 
dx
);

2179 i(
	`B_TYPE
(
bi
->
ty
!
B_OVERFLOW
)

2181 
bo
 = (
BOVERFLOW
 *)(
bi
->
da
);

2182 i(
bo
->
pgno
 > 
c_da
->
com_un
 && (
t
 =

2183 
	`__bam_un_ro_ge
(
dbc
, 
ge
, 
dx
, 
c_da
)) != 0)

2185 i((
t
 = 
	`__bam_un_ovow
(

2186 
dbc
, 
bo
->
pgno
, 
PGNO_INVALID
, 
c_da
)) != 0)

2189  (
t
);

2190 
	}
}

2192 #ifde
HAVE_FTRUNCATE


2201 
	$__bam_vekey
(
dbc
, 
xt
, 
t
)

2202 
DBC
 *
dbc
;

2203 
xt
;

2204 
DBT
 *
t
;

2206 
BINTERNAL
 *
bi
;

2207 
BOVERFLOW
 *
bo
;

2208 
BTREE_CURSOR
 *

;

2209 
DB
 *
dbp
;

2210 
DB_ENV
 *
dbv
;

2211 
PAGE
 *
pg
;

2212 
RINTERNAL
 *
ri
;

2213 
db_dx_t
 
dx
, 
t
;

2215 
dbp
 = 
dbc
->dbp;

2216 
dbv
 = 
dbp
->dbenv;

2217 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2218 
pg
 = 

->
c
->
ge
;

2220 i(
dbc
->
dbty
 =
DB_RECNO
) {

2221 i(
xt
)

2222 
dx
 = 0, 
t
 = 
	`NUM_ENT
(
pg
); indx !=op; indx++) {

2223 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
pg
, 
dx
);

2224 

->
o
 +
ri
->
ecs
;

2226  (
	`__db_tcy
(
dbv
, 
t
, &

->
o
,

2227 (

->
o
), &
t
->
da
, &t->
un
));

2230 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
pg
, 
	`NUM_ENT
(pg) - 1);

2231 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
) {

2232 
bo
 = (
BOVERFLOW
 *)(
bi
->
da
);

2233  (
	`__db_goff
(
dbp
, 
dbc
->
txn
, 
t
,

2234 
bo
->

, bo->
pgno
, &
t
->
da
, &t->
un
));

2236  (
	`__db_tcy
(
dbv
,

2237 
t
, 
bi
->
da
, bi->
n
, &t->da, &t->
un
));

2238 
	}
}

2246 
	$__bam_un_
(
dbp
, 
txn
, 
c_da
)

2247 
DB
 *
dbp
;

2248 
DB_TXN
 *
txn
;

2249 
DB_COMPACT
 *
c_da
;

2251 
BTREE_CURSOR
 *

;

2252 
DBC
 *
dbc
;

2253 
DBT
 
t
;

2254 
PAGE
 *
pg
;

2255 
db_pgno_t
 
pgno
;

2256 
u_t32_t
 
sag
;

2257 
v
, 
lol_txn
, 
t
, 
t_t
;

2259 
dbc
 = 
NULL
;

2260 
	`memt
(&
t
, 0, (start));

2262 i(
	`IS_DB_AUTO_COMMIT
(
dbp
, 
txn
)) {

2263 
lol_txn
 = 1;

2264 
txn
 = 
NULL
;

2266 
lol_txn
 = 0;

2268 
v
 = 
LEAFLEVEL
 + 1;

2269 
sag
 = 
CS_READ
 | 
CS_GETRECNO
;

2271 
w_txn
:

2272 i(
lol_txn
 && (
t
 = 
	`__txn_beg
(
dbp
->
dbv
, 
NULL
, &
txn
, 0)) != 0)

2273 
r
;

2275 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 0)) != 0)

2276 
r
;

2277 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2279 
pgno
 = 
PGNO_INVALID
;

2281 i((
t
 = 
	`__bam_cch
(
dbc
, &
t
, 
sag
, 
v
)) != 0) {

2283 i(
t
 =
DB_NOTFOUND
) {

2284 
v
++;

2285 i(
t
.
da
 !
NULL
)

2286 
	`__os_
(
dbp
->
dbv
, 
t
.
da
);

2287 
	`memt
(&
t
, 0, (start));

2288 
sag
 = 
CS_READ
 | 
CS_GETRECNO
;

2291 
r
;

2293 
c_da
->
com_ges_exame
++;

2295 
pg
 = 

->
c
->
ge
;

2296 
pgno
 = 
	`PGNO
(
pg
);

2298 
sag
 = 
CS_NEXT
 | 
CS_GETRECNO
;

2300 i(
pgno
 !

->
ro
 && (
t
 = 
	`__bam_vekey
(
dbc
,

2301 
pgno
 <
c_da
->
com_un
, &
t
)) != 0)

2302 
r
;

2304 i((
t
 = 
	`__bam_kl
(
dbc
, 
STK_NOLOCK
)) != 0)

2305 
r
;

2306 i(
pgno
 =

->
ro
)

2309 i(
pgno
 <
c_da
->
com_un
)

2313 i((
t
 = 
	`__bam_cch
(
dbc
,

2314 &
t
, 
CS_PARENT
 | 
CS_GETRECNO
, 
v
)) != 0)

2315 
r
;

2316 
pg
 = 

->
c
->
ge
;

2317 
pgno
 = 
	`PGNO
(
pg
);

2319 i(
pgno
 > 
c_da
->
com_un
) {

2320 i((
t
 = 
	`__bam_un_ge
(
dbc
, &
pg
, 1)) != 0)

2321 
r
;

2323 i((
t
 = 
	`__bam_kl
(
dbc
,

2324 
pgno
 > 
c_da
->
com_un
 ? 0 : 
STK_NOLOCK
)) != 0)

2325 
r
;

2328 i(
lol_txn
 && 
pgno
 > 
c_da
->
com_un
)

2330 } 
pgno
 !

->
ro
);

2332 i((
t
 = 
	`__dbc_o
(
dbc
)) != 0)

2333 
r
;

2334 
dbc
 = 
NULL
;

2335 i(
lol_txn
) {

2336 i((
t
 = 
	`__txn_comm
(
txn
, 
DB_TXN_NOSYNC
)) != 0)

2337 
r
;

2338 
txn
 = 
NULL
;

2340 i(
pgno
 !((
BTREE
 *)
dbp
->
bt_
)->
bt_ro
)

2341 
w_txn
;

2343 
r
: i(
dbc
 !
NULL
 && (
t_t
 = 
	`__bam_kl
(dbc, 0)!0 && 
t
 == 0)

2344 
t
 = 
t_t
;

2345 i(
dbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(dbc)!0 && 
t
 == 0)

2346 
t
 = 
t_t
;

2347 i(
lol_txn
 &&

2348 
txn
 !
NULL
 && (
t_t
 = 
	`__txn_abt
xn)!0 && 
t
 == 0)

2349 
t
 = 
t_t
;

2350 i(
t
.
da
 !
NULL
)

2351 
	`__os_
(
dbp
->
dbv
, 
t
.
da
);

2352  (
t
);

2353 
	}
}

2356 
	$__bam_tup_li
(
dbp
, 
li
, 
ms
)

2357 
DB
 *
dbp
;

2358 
pgli
 *
li
;

2359 
u_t32_t
 
ms
;

2361 
DB_MPOOLFILE
 *
mpf
;

2362 
db_pgno_t
 *
i
;

2363 
t
;

2365 
mpf
 = 
dbp
->mpf;

2367 i((
t
 = 
	`__memp_loc_li
(
mpf
, 
ms
, &
i
)) != 0)

2368  (
t
);

2370 
ms
-- != 0)

2371 *
i
++ = 
li
++->
pgno
;

2374 
	}
}

2377 
	$__bam__li
(
dbp
, 
txn
)

2378 
DB
 *
dbp
;

2379 
DB_TXN
 *
txn
;

2381 
DBC
 *
dbc
;

2382 
DB_LOCK
 
lock
;

2383 
auto_comm
, 
t
, 
t_t
;

2385 
	`LOCK_INIT
(
lock
);

2386 
auto_comm
 = 
t
 = 0;

2394 
dbc
 = 
NULL
;

2395 i(
	`IS_DB_AUTO_COMMIT
(
dbp
, 
txn
)) {

2402 i(
	`__txn_beg
(
dbp
->
dbv
, 
NULL
, &
txn
, 0) == 0) {

2403 ()
	`__lock_t_timeout
(
dbp
->
dbv
,

2404 
txn
->
lock
, 0, 
DB_SET_TXN_TIMEOUT
);

2405 ()
	`__lock_t_timeout
(
dbp
->
dbv
,

2406 
txn
->
lock
, 0, 
DB_SET_LOCK_TIMEOUT
);

2407 
auto_comm
 = 1;

2410 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 0)) != 0)

2411  (
t
);

2413 i((
t
 = 
	`__db_lg
(
dbc
,

2414 0, 
PGNO_BASE_MD
, 
DB_LOCK_WRITE
, 0, &
lock
)) != 0)

2415 
r
;

2418 
t
 = 
	`__memp__li
(
dbp
->
mpf
);

2420 
r
: i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

2421 
t
 = 
t_t
;

2423 i(
dbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(dbc)!0 && 
t
 == 0)

2424 
t
 = 
t_t
;

2426 i(
auto_comm
 && 
	`__txn_abt
(
txn
!0 && 
t
 == 0)

2427 
t
 = 
t_t
;

2429  (
t
);

2430 
	}
}

	@../btree/bt_compare.c

44 
	~"db_cfig.h
"

46 
	~"db_t.h
"

47 
	~"dbc/db_ge.h
"

48 
	~"dbc/b.h
"

58 
	$__bam_cmp
(
dbp
, 
txn
, 
dbt
, 
h
, 
dx
, 
func
, 
cm
)

59 
DB
 *
dbp
;

60 
DB_TXN
 *
txn
;

61 cڡ 
DBT
 *
dbt
;

62 
PAGE
 *
h
;

63 
u_t32_t
 
dx
;

64 (*
func
)
	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

65 *
cm
;

67 
BINTERNAL
 *
bi
;

68 
BKEYDATA
 *
bk
;

69 
BOVERFLOW
 *
bo
;

70 
DBT
 
pg_dbt
;

85 
	`TYPE
(
h
)) {

86 
P_LBTREE
:

87 
P_LDUP
:

88 
P_LRECNO
:

89 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

90 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
)

91 
bo
 = (
BOVERFLOW
 *)
bk
;

93 
pg_dbt
.
p_da
 = 
NULL
;

94 
pg_dbt
.
da
 = 
bk
->data;

95 
pg_dbt
.
size
 = 
bk
->
n
;

96 *
cm
 = 
	`func
(
dbp
, 
dbt
, &
pg_dbt
);

100 
P_IBTREE
:

118 i(
dx
 == 0) {

119 *
cm
 = 1;

123 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
);

124 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
)

125 
bo
 = (
BOVERFLOW
 *)(
bi
->
da
);

127 
pg_dbt
.
p_da
 = 
NULL
;

128 
pg_dbt
.
da
 = 
bi
->data;

129 
pg_dbt
.
size
 = 
bi
->
n
;

130 *
cm
 = 
	`func
(
dbp
, 
dbt
, &
pg_dbt
);

135  (
	`__db_pgfmt
(
dbp
->
dbv
, 
	`PGNO
(
h
)));

141  (
	`__db_moff
(
dbp
, 
txn
, 
dbt
,

142 
bo
->
pgno
, bo->

, 
func
 =
__bam_defcmp
 ? 
NULL
 : func, 
cm
));

143 
	}
}

152 
	$__bam_defcmp
(
dbp
, 
a
, 
b
)

153 
DB
 *
dbp
;

154 cڡ 
DBT
 *
a
, *
b
;

156 
size_t
 
n
;

157 
u_t8_t
 *
p1
, *
p2
;

159 
	`COMPQUIET
(
dbp
, 
NULL
);

173 
n
 = 
a
->
size
 > 
b
->size ? b->size :->size;

174 
p1
 = 
a
->
da
, 
p2
 = 
b
->da; 
n
--; ++p1, ++p2)

175 i(*
p1
 !*
p2
)

176  (()*
p1
 - ()*
p2
);

177  (()
a
->
size
 - ()
b
->size);

178 
	}
}

186 
size_t


187 
	$__bam_defx
(
dbp
, 
a
, 
b
)

188 
DB
 *
dbp
;

189 cڡ 
DBT
 *
a
, *
b
;

191 
size_t
 
t
, 
n
;

192 
u_t8_t
 *
p1
, *
p2
;

194 
	`COMPQUIET
(
dbp
, 
NULL
);

196 
t
 = 1;

197 
n
 = 
a
->
size
 > 
b
->size ? b->size :->size;

198 
p1
 = 
a
->
da
, 
p2
 = 
b
->da; 
n
--; ++p1, ++p2, ++
t
)

199 i(*
p1
 !*
p2
)

200  (
t
);

206 i(
a
->
size
 < 
b
->size)

207  (
a
->
size
 + 1);

208 i(
b
->
size
 < 
a
->size)

209  (
b
->
size
 + 1);

210  (
b
->
size
);

211 
	}
}

	@../btree/bt_conv.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_sw.h
"

14 
	~"dbc/b.h
"

24 
	$__bam_pg
(
dbv
, 
dummydbp
, 
pg
, 

, 
cook
)

25 
DB_ENV
 *
dbv
;

26 
DB
 *
dummydbp
;

27 
db_pgno_t
 
pg
;

28 *

;

29 
DBT
 *
cook
;

31 
DB_PGINFO
 *
pgfo
;

32 
PAGE
 *
h
;

34 
pgfo
 = (
DB_PGINFO
 *)
cook
->
da
;

35 i(!
	`F_ISSET
(
pgfo
, 
DB_AM_SWAP
))

38 
h
 = 

;

39  (
	`TYPE
(
h
=
P_BTREEMETA
 ? 
	`__bam_msw
(

) :

40 
	`__db_bysw
(
dbv
, 
dummydbp
, 
pg
, 

, 
pgfo
->
db_gesize
, 1));

41 
	}
}

51 
	$__bam_pgout
(
dbv
, 
dummydbp
, 
pg
, 

, 
cook
)

52 
DB_ENV
 *
dbv
;

53 
DB
 *
dummydbp
;

54 
db_pgno_t
 
pg
;

55 *

;

56 
DBT
 *
cook
;

58 
DB_PGINFO
 *
pgfo
;

59 
PAGE
 *
h
;

61 
pgfo
 = (
DB_PGINFO
 *)
cook
->
da
;

62 i(!
	`F_ISSET
(
pgfo
, 
DB_AM_SWAP
))

65 
h
 = 

;

66  (
	`TYPE
(
h
=
P_BTREEMETA
 ? 
	`__bam_msw
(

) :

67 
	`__db_bysw
(
dbv
, 
dummydbp
, 
pg
, 

, 
pgfo
->
db_gesize
, 0));

68 
	}
}

77 
	$__bam_msw
(
pg
)

78 
PAGE
 *
pg
;

80 
u_t8_t
 *
p
;

82 
	`__db_masw
(
pg
);

84 
p
 = (
u_t8_t
 *)
pg
 + (
DBMETA
);

86 
p
 +(
u_t32_t
);

87 
	`SWAP32
(
p
);

88 
	`SWAP32
(
p
);

89 
	`SWAP32
(
p
);

90 
	`SWAP32
(
p
);

91 
p
 +92 * (
u_t32_t
);

92 
	`SWAP32
(
p
);

95 
	}
}

	@../btree/bt_curadj.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/mp.h
"

16 
__bam_d_curs
 
__P
((
DB
 *, 
DBC
 *, 
db_pgno_t
, 
u_t32_t
, u_int32_t));

37 
	$__bam__de
(
dbp
, 
pgno
, 
dx
, 
de
, 
coup
)

38 
DB
 *
dbp
;

39 
db_pgno_t
 
pgno
;

40 
u_t32_t
 
dx
;

41 
de
, *
coup
;

43 
BTREE_CURSOR
 *

;

44 
DB
 *
ldbp
;

45 
DB_ENV
 *
dbv
;

46 
DBC
 *
dbc
;

47 
cou
;

49 
dbv
 = 
dbp
->dbenv;

62 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

63 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

64 
cou
 = 0;

65 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

66 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

67 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

68 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

69 

 = (
BTREE_CURSOR
 *)
dbc
->

;

70 i(

->
pgno
 =pgn&& cp->
dx
 == indx &&

71 !
	`MVCC_SKIP_CURADJ
(
dbc
, 
pgno
)) {

85 i(
de
)

86 
	`F_SET
(

, 
C_DELETED
);

88 
	`F_CLR
(

, 
C_DELETED
);

89 ++
cou
;

92 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

94 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

96 i(
coup
 !
NULL
)

97 *
coup
 = 
cou
;

99 
	}
}

108 
	$__m__de
(
dbp
, 
ro_pgno
, 
foundp
)

109 
DB
 *
dbp
;

110 
db_pgno_t
 
ro_pgno
;

111 *
foundp
;

113 
DB
 *
ldbp
;

114 
DBC
 *
dbc
;

115 
DB_ENV
 *
dbv
;

116 
found
;

118 
dbv
 = 
dbp
->dbenv;

123 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

124 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

125 
found
 = 0;

126 
found
 =0 && 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

127 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

128 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

129 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
)

130 i(
dbc
->

->
ro
 =
ro_pgno
 &&

131 !
	`MVCC_SKIP_CURADJ
(
dbc
, 
ro_pgno
)) {

132 
found
 = 1;

135 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

137 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

139 *
foundp
 = 
found
;

141 
	}
}

150 
	$__bam__di
(
my_dbc
, 
pgno
, 
dx
, 
adju
)

151 
DBC
 *
my_dbc
;

152 
db_pgno_t
 
pgno
;

153 
u_t32_t
 
dx
;

154 
adju
;

156 
DB
 *
dbp
, *
ldbp
;

157 
DB_ENV
 *
dbv
;

158 
DB_LSN
 
l
;

159 
DB_TXN
 *
my_txn
;

160 
DBC
 *
dbc
;

161 
DBC_INTERNAL
 *

;

162 
found
, 
t
;

164 
dbp
 = 
my_dbc
->dbp;

165 
dbv
 = 
dbp
->dbenv;

167 
my_txn
 = 
	`IS_SUBTRANSACTION
(
my_dbc
->
txn
? my_dbc->tx: 
NULL
;

172 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

173 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

174 
found
 = 0;

175 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

176 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

177 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

178 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

179 i(
dbc
->
dbty
 =
DB_RECNO
)

181 

 = 
dbc
->

;

182 i(

->
pgno
 =pgn&& cp->
dx
 >= indx &&

183 (
dbc
 =
my_dbc
 || !
	`MVCC_SKIP_CURADJ
(dbc, 
pgno
))) {

185 
	`DB_ASSERT
(
dbv
, 

->
dx
 !0 || 
adju
 > 0);

190 

->
dx
 +
adju
;

191 i(
my_txn
 !
NULL
 && 
dbc
->
txn
 != my_txn)

192 
found
 = 1;

195 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

197 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

199 i(
found
 !0 && 
	`DBC_LOGGING
(
my_dbc
)) {

200 i((
t
 = 
	`__bam_cudj_log
(
dbp
, 
my_dbc
->
txn
, &
l
, 0,

201 
DB_CA_DI
, 
pgno
, 0, 0, (
u_t32_t
)
adju
, 
dx
, 0)) != 0)

202  (
t
);

206 
	}
}

212 
	$__bam_d_curs
(
dbp
, 
dbc
, 
f
, 
gno
, 
ti
)

213 
DB
 *
dbp
;

214 
DBC
 *
dbc
;

215 
db_pgno_t
 
gno
;

216 
u_t32_t
 
f
, 
ti
;

218 
BTREE_CURSOR
 *

, *
ig_
;

219 
DBC
 *
dbc_nd
;

220 
t
;

222 
ig_
 = (
BTREE_CURSOR
 *)
dbc
->

;

223 
dbc_nd
 = 
NULL
;

234 
	`DB_ASSERT
(
dbp
->
dbv
, 
ig_
->
d
 =
NULL
);

235 i((
t
 = 
	`__dbc_wd
(
dbc
, 
gno
, 
ig_
->
d
, &
dbc_nd
)) != 0)

236  (
t
);

238 

 = (
BTREE_CURSOR
 *)
dbc_nd
->

;

239 

->
pgno
 = 
gno
;

240 

->
dx
 = 
ti
;

242 i(
dbp
->
dup_com
 =
NULL
) {

248 

->
o
 = 
ti
 + 1;

255 i(
	`F_ISSET
(
ig_
, 
C_DELETED
)) {

256 
	`F_SET
(

, 
C_DELETED
);

257 
	`F_CLR
(
ig_
, 
C_DELETED
);

261 
ig_
->
d
 = 
dbc_nd
;

262 
ig_
->
dx
 = 
f
;

264 
	}
}

275 
	$__bam__dup
(
my_dbc
, 
f
, 
gno
, 
fi
, 
gno
, 
ti
)

276 
DBC
 *
my_dbc
;

277 
db_pgno_t
 
gno
, 
gno
;

278 
u_t32_t
 
f
, 
fi
, 
ti
;

280 
BTREE_CURSOR
 *
ig_
;

281 
DB
 *
dbp
, *
ldbp
;

282 
DBC
 *
dbc
;

283 
DB_ENV
 *
dbv
;

284 
DB_LSN
 
l
;

285 
DB_TXN
 *
my_txn
;

286 
found
, 
t
, 
t_t
;

288 
dbp
 = 
my_dbc
->dbp;

289 
dbv
 = 
dbp
->dbenv;

290 
my_txn
 = 
	`IS_SUBTRANSACTION
(
my_dbc
->
txn
? my_dbc->tx: 
NULL
;

291 
t
 = 0;

296 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

297 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

298 
found
 = 0;

299 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

300 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

301 
lo
: 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

302 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

304 
ig_
 = (
BTREE_CURSOR
 *)
dbc
->

;

305 i(
ig_
->
pgno
 !
gno
 || orig_->
dx
 !
fi
 ||

306 
	`MVCC_SKIP_CURADJ
(
dbc
, 
gno
))

313 i(
ig_
->
d
 !
NULL
)

316 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

321 i((
t
 = 
	`__bam_d_curs
(
dbp
,

322 
dbc
, 
f
, 
gno
, 
ti
)) != 0)

323 
r
;

324 i(
my_txn
 !
NULL
 && 
dbc
->
txn
 != my_txn)

325 
found
 = 1;

327 
lo
;

329 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

331 
r
: 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

333 i(
found
 !0 && 
	`DBC_LOGGING
(
my_dbc
)) {

334 i((
t_t
 = 
	`__bam_cudj_log
(
dbp
, 
my_dbc
->
txn
,

335 &
l
, 0, 
DB_CA_DUP
, 
gno
, 
gno
, 0, 
f
, 
fi
, 
ti
)) != 0 &&

336 
t
 == 0)

337 
t
 = 
t_t
;

340  (
t
);

341 
	}
}

353 
	$__bam__undodup
(
dbp
, 
f
, 
gno
, 
fi
, 
ti
)

354 
DB
 *
dbp
;

355 
db_pgno_t
 
gno
;

356 
u_t32_t
 
f
, 
fi
, 
ti
;

358 
BTREE_CURSOR
 *
ig_
;

359 
DB
 *
ldbp
;

360 
DBC
 *
dbc
;

361 
DB_ENV
 *
dbv
;

362 
t
;

364 
dbv
 = 
dbp
->dbenv;

365 
t
 = 0;

370 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

371 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

373 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

374 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

375 
lo
: 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

376 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

377 
ig_
 = (
BTREE_CURSOR
 *)
dbc
->

;

386 i(
ig_
->
pgno
 !
gno
 ||

387 
ig_
->
dx
 !
f
 ||

388 
ig_
->
d
 =
NULL
 || ((
BTREE_CURSOR
 *)

389 
ig_
->
d
->

)->
dx
 !
ti
 ||

390 
	`MVCC_SKIP_CURADJ
(
dbc
, 
gno
))

392 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

393 i((
t
 = 
	`__dbc_o
(
ig_
->
d
)) != 0)

394 
r
;

395 
ig_
->
d
 = 
NULL
;

396 
ig_
->
dx
 = 
fi
;

401 
lo
;

403 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

405 
r
: 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

407  (
t
);

408 
	}
}

417 
	$__bam__rl
(
my_dbc
, 
gno
, 
gno
)

418 
DBC
* 
my_dbc
;

419 
db_pgno_t
 
gno
, 
gno
;

421 
DB
 *
dbp
, *
ldbp
;

422 
DBC
 *
dbc
;

423 
DB_ENV
 *
dbv
;

424 
DB_LSN
 
l
;

425 
DB_TXN
 *
my_txn
;

426 
found
, 
t
;

428 
dbp
 = 
my_dbc
->dbp;

429 
dbv
 = 
dbp
->dbenv;

430 
my_txn
 = 
	`IS_SUBTRANSACTION
(
my_dbc
->
txn
? my_dbc->tx: 
NULL
;

435 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

436 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

437 
found
 = 0;

438 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

439 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

440 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

441 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

442 i(
dbc
->
dbty
 =
DB_RECNO
)

444 i(
dbc
->

->
pgno
 =
gno
 &&

445 !
	`MVCC_SKIP_CURADJ
(
dbc
, 
gno
)) {

446 
dbc
->

->
pgno
 = 
gno
;

451 i(
my_txn
 !
NULL
 && 
dbc
->
txn
 != my_txn)

452 
found
 = 1;

455 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

457 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

459 i(
found
 !0 && 
	`DBC_LOGGING
(
my_dbc
)) {

460 i((
t
 = 
	`__bam_cudj_log
(
dbp
, 
my_dbc
->
txn
,

461 &
l
, 0, 
DB_CA_RSPLIT
, 
gno
, 
gno
, 0, 0, 0, 0)) != 0)

462  (
t
);

465 
	}
}

475 
	$__bam__l
(
my_dbc
, 
gno
, 
gno
, 
gno
, 
l_dx
, 
e
)

476 
DBC
 *
my_dbc
;

477 
db_pgno_t
 
gno
, 
gno
, 
gno
;

478 
u_t32_t
 
l_dx
;

479 
e
;

481 
DB
 *
dbp
, *
ldbp
;

482 
DBC
 *
dbc
;

483 
DBC_INTERNAL
 *

;

484 
DB_ENV
 *
dbv
;

485 
DB_LSN
 
l
;

486 
DB_TXN
 *
my_txn
;

487 
found
, 
t
;

489 
dbp
 = 
my_dbc
->dbp;

490 
dbv
 = 
dbp
->dbenv;

491 
my_txn
 = 
	`IS_SUBTRANSACTION
(
my_dbc
->
txn
? my_dbc->tx: 
NULL
;

503 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

504 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

505 
found
 = 0;

506 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

507 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

508 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

509 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

510 i(
dbc
->
dbty
 =
DB_RECNO
)

512 

 = 
dbc
->

;

513 i(

->
pgno
 =
gno
 &&

514 !
	`MVCC_SKIP_CURADJ
(
dbc
, 
gno
)) {

519 i(
my_txn
 !
NULL
 && 
dbc
->
txn
 != my_txn)

520 
found
 = 1;

521 i(

->
dx
 < 
l_dx
) {

522 i(
e
)

523 

->
pgno
 = 
gno
;

525 

->
pgno
 = 
gno
;

526 

->
dx
 -
l_dx
;

530 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

532 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

534 i(
found
 !0 && 
	`DBC_LOGGING
(
my_dbc
)) {

535 i((
t
 = 
	`__bam_cudj_log
(
dbp
,

536 
my_dbc
->
txn
, &
l
, 0, 
DB_CA_SPLIT
, 
gno
, 
gno
,

537 
e
 ? 
gno
 : 
PGNO_INVALID
, 0, 
l_dx
, 0)) != 0)

538  (
t
);

542 
	}
}

555 
	$__bam__undol
(
dbp
, 
ompgno
, 
tgno
, 
gno
, 
l_dx
)

556 
DB
 *
dbp
;

557 
db_pgno_t
 
ompgno
, 
tgno
, 
gno
;

558 
u_t32_t
 
l_dx
;

560 
DB
 *
ldbp
;

561 
DBC
 *
dbc
;

562 
DB_ENV
 *
dbv
;

563 
DBC_INTERNAL
 *

;

565 
dbv
 = 
dbp
->dbenv;

573 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

574 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

576 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

577 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

578 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

579 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

580 i(
dbc
->
dbty
 =
DB_RECNO
)

582 

 = 
dbc
->

;

583 i(

->
pgno
 =
tgno
 &&

584 !
	`MVCC_SKIP_CURADJ
(
dbc
, 
tgno
)) {

585 

->
pgno
 = 
ompgno
;

586 

->
dx
 +
l_dx
;

587 } i(

->
pgno
 =
gno
 &&

588 !
	`MVCC_SKIP_CURADJ
(
dbc
, 
gno
))

589 

->
pgno
 = 
ompgno
;

591 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

593 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

596 
	}
}

	@../btree/bt_cursor.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/mp.h
"

17 
__bam_bulk
 
__P
((
DBC
 *, 
DBT
 *, 
u_t32_t
));

18 
__bamc_o
 
__P
((
DBC
 *, 
db_pgno_t
, *));

19 
__bamc_d
 
__P
((
DBC
 *));

20 
__bamc_deroy
 
__P
((
DBC
 *));

21 
__bamc_g
 
__P
((
DBC
 *, 
DBT
 *, DBT *, 
u_t32_t
, 
db_pgno_t
 *));

22 
__bamc_gack
 
__P
((
DBC
 *));

23 
__bamc_xt
 
__P
((
DBC
 *, , ));

24 
__bamc_physd
 
__P
((
DBC
 *));

25 
__bamc_ev
 
__P
((
DBC
 *));

26 
__bamc_put
 
__P
((
DBC
 *, 
DBT
 *, DBT *, 
u_t32_t
, 
db_pgno_t
 *));

27 
__bamc_ch
 
__P
((
DBC
 *,

28 
db_pgno_t
, cڡ 
DBT
 *, 
u_t32_t
, *));

29 
__bamc_wrock
 
__P
((
DBC
 *));

30 
__bam_gbh_fddum
 
__P
((
DBC
 *, 
DBT
 *, 
u_t32_t
));

31 
__bam_gbhc
 
__P
((
DBC
 *, 
DBT
 *));

32 
__bam_g_ev
 
__P
((
DBC
 *));

33 
__bam_isd
 
__P
((
DBC
 *, 
db_pgno_t
 *));

47 #unde
ACQUIRE


48 
	#ACQUIRE
(
dbc
, 
mode
, 
gno
, 
lock
, 
gno
, 
g
, 
ags
, 
t
) do { \

49 
DB_MPOOLFILE
 *
__mpf
 = (
dbc
)->
dbp
->
mpf
; \

50 i((
g
!
NULL
) { \

51 
t
 = 
	`__memp_ut
(
__mpf
, 
g
, 
dbc
->
iܙy
); \

52 
g
 = 
NULL
; \

54 
t
 = 0; \

55 i((
t
=0 && 
	`STD_LOCKING
(
dbc
)) \

56 
t
 = 
	`__db_lg
( \

57 
dbc
, 
LCK_COUPLE
, 
gno
, 
mode
, 
ags
, &(
lock
)); \

58 i((
t
) == 0) \

59 
t
 = 
	`__memp_fg
(
__mpf
, &(
gno
), (
dbc
)->
txn
, \

60 0, &(
g
)); \

61 } 0)

	)

64 #unde
ACQUIRE_CUR


65 
	#ACQUIRE_CUR
(
dbc
, 
mode
, 
p
, 
ags
, 
t
) do { \

66 
BTREE_CURSOR
 *
__
 = (BTREE_CURSOR *)(
dbc
)->

; \

67 i(
p
 !
__
->
pgno
) \

68 
__
->
pgno
 = 
PGNO_INVALID
; \

69 
	`ACQUIRE
(
dbc
, 
mode
, 
p
, 
__
->
lock
,, __->
ge
, 
ags
, 
t
); \

70 i((
t
) == 0) { \

71 
__
->
pgno
 = 
p
; \

72 
__
->
lock_mode
 = (
mode
); \

74 } 0)

	)

82 #unde
ACQUIRE_WRITE_LOCK


83 
	#ACQUIRE_WRITE_LOCK
(
dbc
, 
t
) do { \

84 
BTREE_CURSOR
 *
__
 = (BTREE_CURSOR *)(
dbc
)->

; \

85 
t
 = 0; \

86 i(
	`STD_LOCKING
(
dbc
) && \

87 
__
->
lock_mode
 !
DB_LOCK_WRITE
 && \

88 ((
t

	`__db_lg
(
dbc
, \

89 
	`LOCK_ISSET
(
__
->
lock
? 
LCK_COUPLE
 : 0, \

90 
__
->
pgno
, 
DB_LOCK_WRITE
, 0, &__->
lock
)) == 0) \

91 
__
->
lock_mode
 = 
DB_LOCK_WRITE
; \

92 } 0)

	)

95 #unde
DISCARD_CUR


96 
	#DISCARD_CUR
(
dbc
, 
t
) do { \

97 
BTREE_CURSOR
 *
__
 = (BTREE_CURSOR *)(
dbc
)->

; \

98 
DB_MPOOLFILE
 *
__mpf
 = (
dbc
)->
dbp
->
mpf
; \

99 
__t_t
; \

100 i((
__
->
ge
!
NULL
) { \

101 
__t_t
 = 
	`__memp_ut
(
__mpf
, 
__
->
ge
, 
dbc
->
iܙy
);\

102 
__
->
ge
 = 
NULL
; \

104 
__t_t
 = 0; \

105 i(
__t_t
 !0 && (
t
) == 0) \

106 
t
 = 
__t_t
; \

107 
__t_t
 = 
	`__TLPUT
((
dbc
), 
__
->
lock
); \

108 i(
__t_t
 !0 && (
t
) == 0) \

109 
t
 = 
__t_t
; \

110 i((
t
=0 && !
	`LOCK_ISSET
(
__
->
lock
)) \

111 
__
->
lock_mode
 = 
DB_LOCK_NG
; \

112 } 0)

	)

115 #unde
IS_DELETED


116 
	#IS_DELETED
(
dbp
, 
ge
, 
dx
) \

117 
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
ge
, \

118 (
dx
+ (
	`TYPE
(
ge
=
P_LBTREE
 ? 
O_INDX
 : 0))->
ty
)

	)

119 #unde
IS_CUR_DELETED


120 
	#IS_CUR_DELETED
(
dbc
) \

121 
	`IS_DELETED
((
dbc
)->
dbp
, (dbc)->

->
ge
, (dbc)->->
dx
)

	)

131 #unde
IS_DUPLICATE


132 
	#IS_DUPLICATE
(
dbc
, 
i1
, 
i2
) \

133 (
	`P_INP
((
dbc
)->
dbp
,((
PAGE
 *)(dbc)->

->
ge
))[
i1
] == \

134 
	`P_INP
((
dbc
)->
dbp
,((
PAGE
 *)(dbc)->

->
ge
))[
i2
])

	)

135 #unde
IS_CUR_DUPLICATE


136 
	#IS_CUR_DUPLICATE
(
dbc
, 
ig_pgno
, 
ig_dx
) \

137 (
	`F_ISSET
(
dbc
, 
DBC_OPD
) || \

138 (
ig_pgno
 =(
dbc
)->

->
pgno
 && \

139 
	`IS_DUPLICATE
(
dbc
, (dbc)->

->
dx
, 
ig_dx
)))

	)

148 
	$__bamc_
(
dbc
, 
dbty
)

149 
DBC
 *
dbc
;

150 
DBTYPE
 
dbty
;

152 
DB_ENV
 *
dbv
;

153 
t
;

155 
dbv
 = 
dbc
->
dbp
->dbenv;

158 i(
dbc
->

 =
NULL
 && (
t
 =

159 
	`__os_oc
(
dbv
, 1, (
BTREE_CURSOR
), &
dbc
->

)) != 0)

160  (
t
);

163 
dbc
->
o
 = dbc->
c_o
 = 
__dbc_o_
;

164 
dbc
->
cou
 = dbc->
c_cou
 = 
__dbc_cou_
;

165 
dbc
->
d
 = dbc->
c_d
 = 
__dbc_d_
;

166 
dbc
->
dup
 = dbc->
c_dup
 = 
__dbc_dup_
;

167 
dbc
->
g
 = dbc->
c_g
 = 
__dbc_g_
;

168 
dbc
->
pg
 = dbc->
c_pg
 = 
__dbc_pg_
;

169 
dbc
->
put
 = dbc->
c_put
 = 
__dbc_put_
;

170 i(
dbty
 =
DB_BTREE
) {

171 
dbc
->
am_bulk
 = 
__bam_bulk
;

172 
dbc
->
am_o
 = 
__bamc_o
;

173 
dbc
->
am_d
 = 
__bamc_d
;

174 
dbc
->
am_deroy
 = 
__bamc_deroy
;

175 
dbc
->
am_g
 = 
__bamc_g
;

176 
dbc
->
am_put
 = 
__bamc_put
;

177 
dbc
->
am_wrock
 = 
__bamc_wrock
;

179 
dbc
->
am_bulk
 = 
__bam_bulk
;

180 
dbc
->
am_o
 = 
__bamc_o
;

181 
dbc
->
am_d
 = 
__mc_d
;

182 
dbc
->
am_deroy
 = 
__bamc_deroy
;

183 
dbc
->
am_g
 = 
__mc_g
;

184 
dbc
->
am_put
 = 
__mc_put
;

185 
dbc
->
am_wrock
 = 
__bamc_wrock
;

189 
	}
}

198 
	$__bamc_esh
(
dbc
)

199 
DBC
 *
dbc
;

201 
BTREE
 *
t
;

202 
BTREE_CURSOR
 *

;

203 
DB
 *
dbp
;

205 
dbp
 = 
dbc
->dbp;

206 
t
 = 
dbp
->
bt_
;

207 

 = (
BTREE_CURSOR
 *)
dbc
->

;

214 i(

->
ro
 =
PGNO_INVALID
)

215 

->
ro
 = 
t
->
bt_ro
;

217 
	`LOCK_INIT
(

->
lock
);

218 

->
lock_mode
 = 
DB_LOCK_NG
;

220 i(

->

 =
NULL
) {

221 

->

 = cp->
ack
;

222 

->
e
 = cp->
ack
 + (cp->stack) / (cp->stack[0]);

224 
	`BT_STK_CLR
(

);

234 

->
ovsize
 = 
	`B_MINKEY_TO_OVFLSIZE
(

235 
dbp
, 
	`F_ISSET
(
dbc
, 
DBC_OPD
? 2 : 
t
->
bt_mkey
, dbp->
pgsize
);

237 

->
o
 = 
RECNO_OOB
;

238 

->
d
 = 
INVALID_ORDER
;

239 

->
ags
 = 0;

242 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
) ||

243 
dbc
->
dbty
 =
DB_RECNO
 || 
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
)) {

244 
	`F_SET
(

, 
C_RECNUM
);

251 i((
	`F_ISSET
(
dbc
, 
DBC_OPD
&& dbc->
dbty
 =
DB_RECNO
) ||

252 
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
 | 
DB_AM_RENUMBER
))

253 
	`F_SET
(

, 
C_RENUMBER
);

257 
	}
}

264 
	$__bamc_o
(
dbc
, 
ro_pgno
, 
rmro
)

265 
DBC
 *
dbc
;

266 
db_pgno_t
 
ro_pgno
;

267 *
rmro
;

269 
BTREE_CURSOR
 *

, *
_d
, *
_c
;

270 
DB
 *
dbp
;

271 
DBC
 *
dbc_d
, *
dbc_c
;

272 
DB_MPOOLFILE
 *
mpf
;

273 
PAGE
 *
h
;

274 
cdb_lock
, 
cou
, 
t
;

276 
dbp
 = 
dbc
->dbp;

277 
mpf
 = 
dbp
->mpf;

278 

 = (
BTREE_CURSOR
 *)
dbc
->

;

279 
_d
 = (
dbc_d
 = 

->
d
=
NULL
 ?

280 
NULL
 : (
BTREE_CURSOR
 *)
dbc_d
->

;

281 
cdb_lock
 = 
t
 = 0;

340 i(
	`F_ISSET
(

, 
C_DELETED
)) {

341 
dbc_c
 = 
dbc
;

342 
dbc
->
dbty
) {

343 
DB_BTREE
:

344 i((
t
 = 
	`__bam__de
(

345 
dbp
, 

->
pgno
, cp->
dx
, 1, &
cou
)) != 0)

346 
r
;

347 i(
cou
 == 0)

348 
lock
;

349 
de
;

350 
DB_RECNO
:

351 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
))

352 
de
;

354 i((
t
 = 
	`__m__de
(
dbp
, 

->
ro
, &
cou
)) != 0)

355 
r
;

356 i(
cou
 == 0)

357 
lock
;

358 
de
;

359 
DB_HASH
:

360 
DB_QUEUE
:

361 
DB_UNKNOWN
:

363 
t
 = 
	`__db_unknown_ty
(
dbp
->
dbv
,

364 "__bamc_o", 
dbc
->
dbty
);

365 
r
;

369 i(
dbc_d
 =
NULL
)

370 
de
;

372 i(
	`F_ISSET
(
_d
, 
C_DELETED
)) {

377 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
, 0, &
h
)) != 0)

378 
r
;

379 
ro_pgno
 = 
	`GET_BOVERFLOW
(
dbp
, 
h
, 

->
dx
 + 
O_INDX
)->
pgno
;

380 i((
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)) != 0)

381 
r
;

383 
dbc_c
 = 
dbc_d
;

384 
dbc_d
->
dbty
) {

385 
DB_BTREE
:

386 i((
t
 = 
	`__bam__de
(

387 
dbp
, 
_d
->
pgno
, cp_d->
dx
, 1, &
cou
)) != 0)

388 
r
;

389 i(
cou
 == 0)

390 
lock
;

391 
de
;

392 
DB_RECNO
:

393 i((
t
 =

394 
	`__m__de
(
dbp
, 
_d
->
ro
, &
cou
)) != 0)

395 
r
;

396 i(
cou
 == 0)

397 
lock
;

398 
de
;

399 
DB_HASH
:

400 
DB_QUEUE
:

401 
DB_UNKNOWN
:

403 
t
 = 
	`__db_unknown_ty
(

404 
dbp
->
dbv
, "__bamc_o", 
dbc
->
dbty
);

405 
r
;

408 
de
;

410 
lock
: 
_c
 = (
BTREE_CURSOR
 *)
dbc_c
->

;

418 i(
	`CDB_LOCKING
(
dbp
->
dbv
)) {

419 i(
	`F_ISSET
(
dbc
, 
DBC_WRITECURSOR
)) {

420 i((
t
 = 
	`__lock_g
(
dbp
->
dbv
,

421 
dbc
->
lock
, 
DB_LOCK_UPGRADE
, &dbc->
lock_dbt
,

422 
DB_LOCK_WRITE
, &
dbc
->
mylock
)) != 0)

423 
r
;

424 
cdb_lock
 = 1;

426 
de
;

438 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
))

439 
de
;

472 i(
	`STD_LOCKING
(
dbc
))

473 i((
t
 = 
	`__db_lg
(
dbc
,

474 
LCK_COUPLE
, 

->
pgno
, 
DB_LOCK_WRITE
, 0, &->
lock
)) != 0)

475 
r
;

477 
de
:

485 i(
dbc_c
->
dbty
 =
DB_BTREE
) {

486 i((
t
 = 
	`__memp_fg
(
mpf
, &
_c
->
pgno
, 
dbc
->
txn
,

487 
DB_MPOOL_DIRTY
, &
_c
->
ge
)) != 0)

488 
r
;

489 i((
t
 = 
	`__bamc_physd
(
dbc_c
)) != 0)

490 
r
;

497 i(!
	`F_ISSET
(
dbc_c
, 
DBC_OPD
|| 
ro_pgno
 =
PGNO_INVALID
)

498 
de
;

509 i((
t
 = 
	`__memp_fg
(
mpf
, &
ro_pgno
, 
dbc
->
txn
, 0, &
h
)) != 0)

510 
r
;

511 i(
	`NUM_ENT
(
h
) == 0) {

512 
	`DISCARD_CUR
(
dbc_c
, 
t
);

513 i(
t
 != 0)

514 
r
;

515 i((
t
 = 
	`__db_
(
dbc
, 
h
)) != 0)

516 
r
;

518 i((
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)) != 0)

519 
r
;

520 
de
;

535 i(
dbc_d
 !
NULL
) {

536 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
,

537 
DB_MPOOL_DIRTY
, &

->
ge
)) != 0)

538 
r
;

539 i((
t
 = 
	`__bamc_physd
(
dbc
)) != 0)

540 
r
;

542 *
rmro
 = 1;

543 
r
:

544 
de
:

548 i(
dbc_d
 !
NULL
)

549 
	`DISCARD_CUR
(
dbc_d
, 
t
);

550 
	`DISCARD_CUR
(
dbc
, 
t
);

553 i(
cdb_lock
)

554 ()
	`__lock_downgde
(

555 
dbp
->
dbv
, &
dbc
->
mylock
, 
DB_LOCK_IWRITE
, 0);

557  (
t
);

558 
	}
}

565 
	$__bamc_deroy
(
dbc
)

566 
DBC
 *
dbc
;

568 
BTREE_CURSOR
 *

;

570 

 = (
BTREE_CURSOR
 *)
dbc
->

;

573 i(

->

 !->
ack
)

574 
	`__os_
(
dbc
->
dbp
->
dbv
, 

->

);

575 
	`__os_
(
dbc
->
dbp
->
dbv
, 

);

578 
	}
}

587 
	$__bamc_cou
(
dbc
, 

)

588 
DBC
 *
dbc
;

589 
db_o_t
 *

;

591 
BTREE_CURSOR
 *

;

592 
DB
 *
dbp
;

593 
DB_MPOOLFILE
 *
mpf
;

594 
db_dx_t
 
dx
, 
t
;

595 
db_o_t
 
o
;

596 
t
;

598 
dbp
 = 
dbc
->dbp;

599 
mpf
 = 
dbp
->mpf;

600 

 = (
BTREE_CURSOR
 *)
dbc
->

;

607 i(

->
d
 =
NULL
) {

611 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
,

612 0, &

->
ge
)) != 0)

613  (
t
);

619 
dx
 = 

->dx;; indx -
P_INDX
)

620 i(
dx
 == 0 ||

621 !
	`IS_DUPLICATE
(
dbc
, 
dx
, indx - 
P_INDX
))

623 
o
 = 0,

624 
t
 = 
	`NUM_ENT
(

->
ge
- 
P_INDX
;; 
dx
 += P_INDX) {

625 i(!
	`IS_DELETED
(
dbp
, 

->
ge
, 
dx
))

626 ++
o
;

627 i(
dx
 =
t
 ||

628 !
	`IS_DUPLICATE
(
dbc
, 
dx
, indx + 
P_INDX
))

636 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
d
->

->
ro
,

637 
dbc
->
txn
, 0, &

->
ge
)) != 0)

638  (
t
);

649 i(
	`TYPE
(

->
ge
=
P_LDUP
)

650 
o
 = 0, 
dx
 = 0,

651 
t
 = 
	`NUM_ENT
(

->
ge
- 
O_INDX
;; 
dx
 += O_INDX) {

652 i(!
	`IS_DELETED
(
dbp
, 

->
ge
, 
dx
))

653 ++
o
;

654 i(
dx
 =
t
)

658 
o
 = 
	`RE_NREC
(

->
ge
);

661 *

 = 
o
;

663 
t
 = 
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
);

664 

->
ge
 = 
NULL
;

666  (
t
);

667 
	}
}

674 
	$__bamc_d
(
dbc
)

675 
DBC
 *
dbc
;

677 
BTREE_CURSOR
 *

;

678 
DB
 *
dbp
;

679 
DB_MPOOLFILE
 *
mpf
;

680 
cou
, 
t
, 
t_t
;

682 
dbp
 = 
dbc
->dbp;

683 
mpf
 = 
dbp
->mpf;

684 

 = (
BTREE_CURSOR
 *)
dbc
->

;

685 
t
 = 0;

688 i(
	`F_ISSET
(

, 
C_DELETED
))

689  (
DB_KEYEMPTY
);

694 
	`DB_ASSERT
(
dbp
->
dbv
, 

->
ge
 =
NULL
);

705 i(
	`F_ISSET
(

, 
C_RECNUM
)) {

706 i((
t
 = 
	`__bamc_gack
(
dbc
)) != 0)

707 
r
;

708 

->
ge
 = cp->
c
->page;

710 
	`ACQUIRE_CUR
(
dbc
, 
DB_LOCK_WRITE
, 

->
pgno
, 0, 
t
);

711 i(
t
 != 0)

712 
r
;

716 i((
t
 = 
	`__memp_dty
(
mpf
,

717 &

->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

718 
r
;

721 i(
	`DBC_LOGGING
(
dbc
)) {

722 i((
t
 = 
	`__bam_cd_log
(
dbp
, 
dbc
->
txn
, &
	`LSN
(

->
ge
), 0,

723 
	`PGNO
(

->
ge
), &
	`LSN
(->ge), cp->
dx
)) != 0)

724 
r
;

726 
	`LSN_NOT_LOGGED
(
	`LSN
(

->
ge
));

729 i(
	`TYPE
(

->
ge
=
P_LBTREE
)

730 
	`B_DSET
(
	`GET_BKEYDATA
(
dbp
, 

->
ge
, cp->
dx
 + 
O_INDX
)->
ty
);

732 
	`B_DSET
(
	`GET_BKEYDATA
(
dbp
, 

->
ge
, cp->
dx
)->
ty
);

734 
r
:

738 i(
	`F_ISSET
(

, 
C_RECNUM
)) {

739 

->
c
->
ge
 = cp->page;

740 i(
t
 == 0)

741 
t
 = 
	`__bam_adju
(
dbc
, -1);

742 ()
	`__bam_kl
(
dbc
, 0);

744 i(

->
ge
 !
NULL
 &&

745 (
t_t
 = 
	`__memp_ut
(
mpf
,

746 

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

747 
t
 = 
t_t
;

749 

->
ge
 = 
NULL
;

755 i(
t
 == 0)

756 
t
 = 
	`__bam__de
(
dbp
, 

->
pgno
, cp->
dx
, 1, &
cou
);

758  (
t
);

759 
	}
}

769 
	$__bamc_dup
(
ig_dbc
, 
w_dbc
)

770 
DBC
 *
ig_dbc
, *
w_dbc
;

772 
BTREE_CURSOR
 *
ig
, *
w
;

774 
ig
 = (
BTREE_CURSOR
 *)
ig_dbc
->

;

775 
w
 = (
BTREE_CURSOR
 *)
w_dbc
->

;

777 
w
->
ovsize
 = 
ig
->ovflsize;

778 
w
->
o
 = 
ig
->recno;

779 
w
->
ags
 = 
ig
->flags;

782 
	}
}

789 
	$__bamc_g
(
dbc
, 
key
, 
da
, 
ags
, 
pgn
)

790 
DBC
 *
dbc
;

791 
DBT
 *
key
, *
da
;

792 
u_t32_t
 
ags
;

793 
db_pgno_t
 *
pgn
;

795 
BTREE_CURSOR
 *

;

796 
DB
 *
dbp
;

797 
DB_MPOOLFILE
 *
mpf
;

798 
db_pgno_t
 
ig_pgno
;

799 
db_dx_t
 
ig_dx
;

800 
exa
, 
wd
, 
t
;

802 
dbp
 = 
dbc
->dbp;

803 
mpf
 = 
dbp
->mpf;

804 

 = (
BTREE_CURSOR
 *)
dbc
->

;

805 
ig_pgno
 = 

->
pgno
;

806 
ig_dx
 = 

->
dx
;

808 
wd
 = 0;

809 
ags
) {

810 
DB_CURRENT
:

812 i(
	`F_ISSET
(

, 
C_DELETED
)) {

813 
t
 = 
DB_KEYEMPTY
;

814 
r
;

823 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
,

824 0, &

->
ge
)) != 0)

825 
r
;

827 
DB_FIRST
:

828 
wd
 = 1;

829 i((
t
 = 
	`__bamc_ch
(
dbc
,

830 
PGNO_INVALID
, 
NULL
, 
ags
, &
exa
)) != 0)

831 
r
;

833 
DB_GET_BOTH
:

834 
DB_GET_BOTH_RANGE
:

848 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

849 i((
t
 = 
	`__bamc_ch
(

850 
dbc
, 
PGNO_INVALID
, 
da
, 
ags
, &
exa
)) != 0)

851 
r
;

852 i(
ags
 =
DB_GET_BOTH
) {

853 i(!
exa
) {

854 
t
 = 
DB_NOTFOUND
;

855 
r
;

866 i((

->
dx
 =
	`NUM_ENT
(->
ge
) ||

867 
	`IS_CUR_DELETED
(
dbc
)) &&

868 (
t
 = 
	`__bamc_xt
(
dbc
, 1, 0)) != 0)

869 
r
;

871 i((
t
 = 
	`__bamc_ch
(

872 
dbc
, 
PGNO_INVALID
, 
key
, 
ags
, &
exa
)) != 0)

873  (
t
);

874 i(!
exa
) {

875 
t
 = 
DB_NOTFOUND
;

876 
r
;

879 i(
pgn
 !
NULL
 && 
	`__bam_isd
(
dbc
,gnop)) {

880 
wd
 = 1;

883 i((
t
 =

884 
	`__bam_gbh_fddum
(
dbc
, 
da
, 
ags
)) != 0)

885 
r
;

888 
DB_GET_BOTHC
:

889 i((
t
 = 
	`__bam_gbhc
(
dbc
, 
da
)) != 0)

890 
r
;

892 
DB_LAST
:

893 
wd
 = 1;

894 i((
t
 = 
	`__bamc_ch
(
dbc
,

895 
PGNO_INVALID
, 
NULL
, 
ags
, &
exa
)) != 0)

896 
r
;

898 
DB_NEXT
:

899 
wd
 = 1;

900 i(

->
pgno
 =
PGNO_INVALID
) {

901 i((
t
 = 
	`__bamc_ch
(
dbc
,

902 
PGNO_INVALID
, 
NULL
, 
DB_FIRST
, &
exa
)) != 0)

903 
r
;

905 i((
t
 = 
	`__bamc_xt
(
dbc
, 1, 0)) != 0)

906 
r
;

908 
DB_NEXT_DUP
:

909 i((
t
 = 
	`__bamc_xt
(
dbc
, 1, 0)) != 0)

910 
r
;

911 i(!
	`IS_CUR_DUPLICATE
(
dbc
, 
ig_pgno
, 
ig_dx
)) {

912 
t
 = 
DB_NOTFOUND
;

913 
r
;

916 
DB_NEXT_NODUP
:

917 
wd
 = 1;

918 i(

->
pgno
 =
PGNO_INVALID
) {

919 i((
t
 = 
	`__bamc_ch
(
dbc
,

920 
PGNO_INVALID
, 
NULL
, 
DB_FIRST
, &
exa
)) != 0)

921 
r
;

924 i((
t
 = 
	`__bamc_xt
(
dbc
, 1, 0)) != 0)

925 
r
;

926 } 
	`IS_CUR_DUPLICATE
(
dbc
, 
ig_pgno
, 
ig_dx
));

928 
DB_PREV
:

929 
wd
 = 1;

930 i(

->
pgno
 =
PGNO_INVALID
) {

931 i((
t
 = 
	`__bamc_ch
(
dbc
,

932 
PGNO_INVALID
, 
NULL
, 
DB_LAST
, &
exa
)) != 0)

933 
r
;

935 i((
t
 = 
	`__bamc_ev
(
dbc
)) != 0)

936 
r
;

938 
DB_PREV_DUP
:

939 i((
t
 = 
	`__bamc_ev
(
dbc
)) != 0)

940 
r
;

941 i(!
	`IS_CUR_DUPLICATE
(
dbc
, 
ig_pgno
, 
ig_dx
)) {

942 
t
 = 
DB_NOTFOUND
;

943 
r
;

946 
DB_PREV_NODUP
:

947 
wd
 = 1;

948 i(

->
pgno
 =
PGNO_INVALID
) {

949 i((
t
 = 
	`__bamc_ch
(
dbc
,

950 
PGNO_INVALID
, 
NULL
, 
DB_LAST
, &
exa
)) != 0)

951 
r
;

954 i((
t
 = 
	`__bamc_ev
(
dbc
)) != 0)

955 
r
;

956 } 
	`IS_CUR_DUPLICATE
(
dbc
, 
ig_pgno
, 
ig_dx
));

958 
DB_SET
:

959 
DB_SET_RECNO
:

960 
wd
 = 1;

961 i((
t
 = 
	`__bamc_ch
(
dbc
,

962 
PGNO_INVALID
, 
key
, 
ags
, &
exa
)) != 0)

963 
r
;

965 
DB_SET_RANGE
:

966 
wd
 = 1;

967 i((
t
 = 
	`__bamc_ch
(
dbc
,

968 
PGNO_INVALID
, 
key
, 
ags
, &
exa
)) != 0)

969 
r
;

977 i(

->
dx
 =
	`NUM_ENT
(->
ge
|| 
	`IS_CUR_DELETED
(
dbc
))

978 i((
t
 = 
	`__bamc_xt
(
dbc
, 0, 0)) != 0)

979 
r
;

982 
t
 = 
	`__db_unknown_ag
(
dbp
->
dbv
, "__bamc_g", 
ags
);

983 
r
;

990 i(
wd
 && 
pgn
 !
NULL
)

991 ()
	`__bam_isd
(
dbc
, 
pgn
);

993 
r
:

998 i(
	`F_ISSET
(

, 
C_DELETED
) &&

999 (

->
pgno
 !
ig_pgno
 || cp->
dx
 !
ig_dx
))

1000 
	`F_CLR
(

, 
C_DELETED
);

1002  (
t
);

1003 
	}
}

1006 
	$__bam_g_ev
(
dbc
)

1007 
DBC
 *
dbc
;

1009 
BTREE_CURSOR
 *

;

1010 
DBT
 
key
, 
da
;

1011 
db_pgno_t
 
pgno
;

1012 
t
;

1014 i((
t
 = 
	`__bamc_ev
(
dbc
)) != 0)

1015  (
t
);

1017 i(
	`__bam_isd
(
dbc
, &
pgno
)) {

1018 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1019 i((
t
 = 
	`__dbc_wd
(
dbc
, 
pgno
, 

->
d
, &cp->opd)) != 0)

1020  (
t
);

1021 i((
t
 = 

->
d
->
	`am_g
(cp->opd,

1022 &
key
, &
da
, 
DB_LAST
, 
NULL
)) != 0)

1023  (
t
);

1027 
	}
}

1033 
	$__bam_bulk
(
dbc
, 
da
, 
ags
)

1034 
DBC
 *
dbc
;

1035 
DBT
 *
da
;

1036 
u_t32_t
 
ags
;

1038 
BKEYDATA
 *
bk
;

1039 
BOVERFLOW
 *
bo
;

1040 
BTREE_CURSOR
 *

;

1041 
PAGE
 *
pg
;

1042 
db_dx_t
 *
p
, 
dx
, 
pg_keyoff
;

1043 
t32_t
 *
dp
, 
key_off
, *
of
, *
veof
;

1044 
u_t8_t
 *
dbuf
, *
dp
, *

;

1045 
u_t32_t
 
key_size
, 
gesize
, 
size
, 
a
;

1046 
adj
, 
is_key
, 
ed_pg
, 
xt_key
, 
no_dup
, 
c_key
, 
t
;

1048 
t
 = 0;

1049 
key_off
 = 0;

1050 
size
 = 0;

1051 
gesize
 = 
dbc
->
dbp
->
pgsize
;

1052 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1059 
dbuf
 = 
da
->data;

1060 

 = 
dp
 = 
dbuf
;

1063 
a
 = 
da
->
un
;

1064 
a
 -(*
of
);

1067 
dp
 = (
t32_t
 *)((
u_t8_t
 *)
dbuf
 + 
da
->
un
);

1068 
dp
--;

1069 
of
 = 
dp
;

1071 
key_size
 = 0;

1081 i(
dbc
->
dbty
 =
DB_BTREE
) {

1082 
is_key
 = 
	`LF_ISSET
(
DB_MULTIPLE_KEY
) ? 1: 0;

1083 
c_key
 = 0;

1084 
xt_key
 = 
is_key
 && 
	`LF_ISSET
(
DB_OPFLAGS_MASK
!
DB_NEXT_DUP
;

1085 
adj
 = 2;

1087 
is_key
 = 0;

1088 
c_key
 = 
	`LF_ISSET
(
DB_MULTIPLE_KEY
) ? 1 : 0;

1089 
xt_key
 = 
	`LF_ISSET
(
DB_OPFLAGS_MASK
!
DB_NEXT_DUP
;

1090 
adj
 = 1;

1092 
no_dup
 = 
	`LF_ISSET
(
DB_OPFLAGS_MASK
=
DB_NEXT_NODUP
;

1094 
xt_pg
:

1095 
dx
 = 

->indx;

1096 
pg
 = 

->
ge
;

1098 
p
 = 
	`P_INP
(
dbc
->
dbp
, 
pg
);

1100 
ed_pg
 = 1;

1107 
pg_keyoff
 = 0;

1108 i(
is_key
 == 0)

1109 
pg_keyoff
 = 
p
[
dx
];

1112 i(
	`IS_DELETED
(
dbc
->
dbp
, 
pg
, 
dx
)) {

1113 i(
dbc
->
dbty
 !
DB_RECNO
)

1116 

->
o
++;

1122 i(
c_key
 != 0)

1125 
a
 -2 * (*
of
);

1127 i(
a
 > 
da
->
un
)

1128 
back_up
;

1131 *
of
-- = 0;

1132 *
of
-- = 0;

1142 i(
is_key
 && 
pg_keyoff
 !
p
[
dx
]) {

1143 
bk
 = 
	`GET_BKEYDATA
(
dbc
->
dbp
, 
pg
, 
dx
);

1144 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
) {

1145 
bo
 = (
BOVERFLOW
 *)
bk
;

1146 
size
 = 
key_size
 = 
bo
->

;

1147 i(
key_size
 > 
a
)

1148 
g_key_a
;

1149 i((
t
 = 
	`__bam_bulk_ovow
(
dbc
,

1150 
bo
->

, bo->
pgno
, 

)) != 0)

1151  (
t
);

1152 
a
 -
key_size
;

1153 
key_off
 = (
t32_t
)(

 - 
dbuf
);

1154 

 +
key_size
;

1156 i(
ed_pg
) {

1157 
dp
 = 

;

1158 
size
 = 
gesize
 - 
	`HOFFSET
(
pg
);

1159 i(
a
 < 
size
) {

1160 
g_key_a
:

1162 i(
of
 =
dp
) {

1163 
da
->
size
 = (
u_t32_t
)

1164 
	`DB_ALIGN
(
size
 +

1165 
gesize
, 1024);

1167 (
DB_BUFFER_SMALL
);

1175 i(
dx
 != 0)

1176 
dx
 -
P_INDX
;

1178 i((
t
 =

1179 
	`__bam_g_ev
(

1180 
dbc
)) != 0)

1181  (
t
);

1182 
dx
 = 

->indx;

1183 
pg
 = 

->
ge
;

1191 
	`memy
(
dp
,

1192 (
u_t8_t
 *)
pg
 + 
	`HOFFSET
g), 
size
);

1193 
ed_pg
 = 0;

1194 
a
 -
size
;

1195 

 +
size
;

1197 
key_size
 = 
bk
->
n
;

1198 
key_off
 = (
t32_t
)((
p
[
dx
] - 
	`HOFFSET
(
pg
))

1199 + (
dp
 - 
dbuf
+ 
	`SSZA
(
BKEYDATA
, 
da
));

1200 
pg_keyoff
 = 
p
[
dx
];

1208 
a
 -(
is_key
 ? 4 : 2* (*
of
);

1209 i(
c_key
)

1210 
a
 -(*
of
);

1213 i(
a
 > 
da
->
un
)

1214 
back_up
;

1222 
bk
 = 
	`GET_BKEYDATA
(
dbc
->
dbp
, 
pg
, 
dx
 + 
adj
 - 1);

1223 i(
	`B_TYPE
(
bk
->
ty
=
B_DUPLICATE
) {

1224 
bo
 = (
BOVERFLOW
 *)
bk
;

1225 i(
is_key
) {

1226 *
of
-- = (
t32_t
)
key_off
;

1227 *
of
-- = (
t32_t
)
key_size
;

1234 
veof
 = 
of
;

1235 i((
t
 = 
	`__bam_bulk_duis
(
dbc
, 
bo
->
pgno
,

1236 
dbuf
, 
is_key
 ? 
of
 + 
P_INDX
 : 
NULL
,

1237 &
of
, &

, &
a
, 
no_dup
)) != 0) {

1238 i(
t
 =
DB_BUFFER_SMALL
) {

1239 
size
 = 
a
;

1240 
a
 = 0;

1242 i(
of
 =
veof
) {

1243 
of
 += 2;

1244 
back_up
;

1246 
g_a
;

1248  (
t
);

1250 } i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
) {

1251 
bo
 = (
BOVERFLOW
 *)
bk
;

1252 
size
 = 
bo
->

;

1253 i(
size
 > 
a
)

1254 
back_up
;

1255 i((
t
 =

1256 
	`__bam_bulk_ovow
(
dbc
,

1257 
bo
->

, bo->
pgno
, 

)) != 0)

1258  (
t
);

1259 
a
 -
size
;

1260 i(
is_key
) {

1261 *
of
-- = (
t32_t
)
key_off
;

1262 *
of
-- = (
t32_t
)
key_size
;

1263 } i(
c_key
)

1264 *
of
-- = (
t32_t
)

->
o
;

1265 *
of
-- = (
t32_t
)(

 - 
dbuf
);

1266 

 +
size
;

1267 *
of
-- = (
t32_t
)
size
;

1269 i(
ed_pg
) {

1270 
dp
 = 

;

1271 
size
 = 
gesize
 - 
	`HOFFSET
(
pg
);

1272 i(
a
 < 
size
) {

1273 
back_up
:

1278 i(
dx
 >
adj
)

1279 
dx
 -
adj
;

1281 i((
t
 =

1282 
	`__bam_g_ev
(
dbc
)) != 0 &&

1283 
t
 !
DB_NOTFOUND
)

1284  (
t
);

1285 
dx
 = 

->indx;

1286 
pg
 = 

->
ge
;

1288 i(
dbc
->
dbty
 =
DB_RECNO
)

1289 

->
o
--;

1290 
g_a
:

1296 i(
of
 >=

1297 (
is_key
 ? &
dp
[-1] :ndp) ||

1298 
	`F_ISSET
(
dbc
, 
DBC_TRANSIENT
)) {

1299 
da
->
size
 = (
u_t32_t
)

1300 
	`DB_ALIGN
(
size
 +

1301 
da
->
un
 - 
a
, 1024);

1302  (
DB_BUFFER_SMALL
);

1306 
	`memy
(
dp
, (
u_t8_t
 *)
pg
 + 
	`HOFFSET
g), 
size
);

1307 
ed_pg
 = 0;

1308 
a
 -
size
;

1309 

 +
size
;

1315 i(
is_key
) {

1316 *
of
-- = (
t32_t
)
key_off
;

1317 *
of
-- = (
t32_t
)
key_size
;

1318 } i(
c_key
)

1319 *
of
-- = (
t32_t
)

->
o
;

1320 *
of
-- = (
t32_t
)((
p
[
dx
 + 
adj
 - 1] - 
	`HOFFSET
(
pg
))

1321 + (
dp
 - 
dbuf
+ 
	`SSZA
(
BKEYDATA
, 
da
));

1322 *
of
-- = 
bk
->
n
;

1324 i(
dbc
->
dbty
 =
DB_RECNO
)

1325 

->
o
++;

1326 i(
no_dup
) {

1327 
dx
 + 
adj
 < 
	`NUM_ENT
(
pg
) &&

1328 
pg_keyoff
 =
p
[
dx
 + 
adj
])

1329 
dx
 +
adj
;

1335 } (
dx
 +
adj
< 
	`NUM_ENT
(
pg
) &&

1336 (
xt_key
 || 
pg_keyoff
 =
p
[
dx
]));

1339 i(
t
 =0 && 
xt_key
 && 
dx
 >
	`NUM_ENT
(
pg
)) {

1340 

->
dx
 = indx;

1341 
t
 = 
	`__bamc_xt
(
dbc
, 0, 1);

1342 i(
t
 == 0)

1343 
xt_pg
;

1344 i(
t
 !
DB_NOTFOUND
)

1345  (
t
);

1355 i(
t
 =0 && 
dx
 < 
pg
->
s
 &&

1356 
	`F_ISSET
(
dbc
, 
DBC_TRANSIENT
&& 
pg_keyoff
 =
p
[
dx
]) {

1357 
da
->
size
 = (da->
un
 - 
a
) + size;

1358  (
DB_BUFFER_SMALL
);

1365 i(
t
 =
DB_BUFFER_SMALL
 || 
xt_key
 || 
pg_keyoff
 =
p
[
dx
])

1366 

->
dx
 = indx;

1368 

->
dx
 = indx - 
P_INDX
;

1370 i(
c_key
 == 1)

1371 *
of
 = 
RECNO_OOB
;

1373 *
of
 = -1;

1375 
	}
}

1385 
	$__bam_bulk_ovow
(
dbc
, 
n
, 
pgno
, 
dp
)

1386 
DBC
 *
dbc
;

1387 
u_t32_t
 
n
;

1388 
db_pgno_t
 
pgno
;

1389 
u_t8_t
 *
dp
;

1391 
DBT
 
dbt
;

1393 
	`memt
(&
dbt
, 0, (dbt));

1394 
	`F_SET
(&
dbt
, 
DB_DBT_USERMEM
);

1395 
dbt
.
un
 = 
n
;

1396 
dbt
.
da
 = (*)
dp
;

1397  (
	`__db_goff
(
dbc
->
dbp
,

1398 
dbc
->
txn
, &
dbt
, 
n
, 
pgno
, 
NULL
, NULL));

1399 
	}
}

1411 
	$__bam_bulk_duis
(
dbc
, 
pgno
, 
dbuf
, 
keyoff
, 
ofp
, 
d
, 
ap
, 
no_dup
)

1412 
DBC
 *
dbc
;

1413 
db_pgno_t
 
pgno
;

1414 
u_t8_t
 *
dbuf
;

1415 
t32_t
 *
keyoff
, **
ofp
;

1416 
u_t8_t
 **
d
;

1417 
u_t32_t
 *
ap
;

1418 
no_dup
;

1420 
DB
 *
dbp
;

1421 
BKEYDATA
 *
bk
;

1422 
BOVERFLOW
 *
bo
;

1423 
BTREE_CURSOR
 *

;

1424 
DBC
 *
d
;

1425 
DBT
 
key
, 
da
;

1426 
PAGE
 *
pg
;

1427 
db_dx_t
 
dx
, *
p
;

1428 
t32_t
 *
of
;

1429 
u_t32_t
 
gesize
, 
size
, 
a
;

1430 
u_t8_t
 *
dp
, *

;

1431 
f
, 
ed_pg
, 
t
, 
t_t
;

1433 
t
 = 0;

1435 
dbp
 = 
dbc
->dbp;

1436 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1437 
d
 = 

->opd;

1439 i(
d
 =
NULL
) {

1440 i((
t
 = 
	`__dbc_wd
(
dbc
, 
pgno
, 
NULL
, &
d
)) != 0)

1441  (
t
);

1442 

->
d
 = opd;

1443 i((
t
 = 
d
->
	`am_g
(opd,

1444 &
key
, &
da
, 
DB_FIRST
, 
NULL
)) != 0)

1445 
o_d
;

1448 
gesize
 = 
d
->
dbp
->
pgsize
;

1449 

 = (
BTREE_CURSOR
 *)
d
->

;

1450 
a
 = *
ap
;

1452 
of
 = *
ofp
;

1458 

 = 
dp
 = *
d
;

1459 
f
 = 1;

1460 
dx
 = 

->indx;

1464 i((
t
 = 
	`__bamc_xt
(
d
, 0, 0)) != 0)

1466 
pg
 = 

->
ge
;

1467 
dx
 = 

->indx;

1468 
p
 = 
	`P_INP
(
dbp
, 
pg
);

1470 
ed_pg
 = 1;

1473 i(
	`IS_DELETED
(
dbp
, 
pg
, 
dx
))

1474 
ct
;

1475 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
pg
, 
dx
);

1476 
a
 -2 * (*
of
);

1478 i(
f
 =0 && 
keyoff
 !
NULL
)

1479 
a
 -2 * (*
of
);

1482 i(
a
 > *
ap
) {

1483 
t
 = 
DB_BUFFER_SMALL
;

1484 i(
f
 == 1) {

1486 
a
 = -(
t32_t
)space;

1487 
a
 = *
ap
 + space;

1488 i(
ed_pg
)

1489 
a
 +
gesize
 - 
	`HOFFSET
(
pg
);

1493 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
) {

1494 
bo
 = (
BOVERFLOW
 *)
bk
;

1495 
size
 = 
bo
->

;

1496 i(
size
 > 
a
) {

1497 
t
 = 
DB_BUFFER_SMALL
;

1498 
a
 = *
ap
 + 
size
;

1501 i(
f
 =0 && 
keyoff
 !
NULL
) {

1502 *
of
-- = 
keyoff
[0];

1503 *
of
-- = 
keyoff
[-1];

1505 i((
t
 = 
	`__bam_bulk_ovow
(
dbc
,

1506 
bo
->

, bo->
pgno
, 

)) != 0)

1507  (
t
);

1508 
a
 -
size
;

1509 *
of
-- = (
t32_t
)(

 - 
dbuf
);

1510 

 +
size
;

1512 i(
ed_pg
) {

1513 
dp
 = 

;

1514 
size
 = 
gesize
 - 
	`HOFFSET
(
pg
);

1515 i(
a
 < 
size
) {

1516 
t
 = 
DB_BUFFER_SMALL
;

1518 
a
 = *
ap
 + 
size
;

1521 
	`memy
(
dp
,

1522 (
u_t8_t
 *)
pg
 + 
	`HOFFSET
g), 
size
);

1523 
ed_pg
 = 0;

1524 
a
 -
size
;

1525 

 +
size
;

1527 i(
f
 =0 && 
keyoff
 !
NULL
) {

1528 *
of
-- = 
keyoff
[0];

1529 *
of
-- = 
keyoff
[-1];

1531 
size
 = 
bk
->
n
;

1532 *
of
-- = (
t32_t
)((
p
[
dx
] - 
	`HOFFSET
(
pg
))

1533 + (
dp
 - 
dbuf
+ 
	`SSZA
(
BKEYDATA
, 
da
));

1535 *
of
-- = (
t32_t
)
size
;

1536 
f
 = 0;

1537 i(
no_dup
)

1539 
ct
:

1540 
dx
++;

1541 i(
d
->
dbty
 =
DB_RECNO
)

1542 

->
o
++;

1543 } 
dx
 < 
	`NUM_ENT
(
pg
));

1544 i(
no_dup
)

1546 

->
dx
 = indx;

1548 } 
t
 == 0);

1551 *
ap
 = 
a
;

1552 *
ofp
 = 
of
;

1553 *
d
 = 

;

1559 i(
t
 =
DB_BUFFER_SMALL
) {

1560 i(
d
->
dbty
 =
DB_RECNO
) {

1561 i(--

->
o
 == 0)

1562 
o_d
;

1563 } i(
dx
 != 0)

1564 

->
dx
--;

1566 
t_t
 = 
	`__bamc_ev
(
d
);

1567 i(
t_t
 =
DB_NOTFOUND
)

1568 
o_d
;

1569 i(
t_t
 != 0)

1570 
t
 = 
t_t
;

1572 } i(
keyoff
 =
NULL
 && 
t
 =
DB_NOTFOUND
) {

1573 

->
dx
--;

1574 i(
d
->
dbty
 =
DB_RECNO
)

1575 --

->
o
;

1576 } i(
dx
 =0 || 
t
 =
DB_NOTFOUND
) {

1577 
o_d
:

1578 i(
t
 =
DB_NOTFOUND
)

1579 
t
 = 0;

1580 i((
t_t
 = 
	`__dbc_o
(
d
)!0 && 
t
 == 0)

1581 
t
 = 
t_t
;

1582 ((
BTREE_CURSOR
 *)
dbc
->

)->
d
 = 
NULL
;

1584 i(
t
 =
DB_NOTFOUND
)

1585 
t
 = 0;

1587  (
t
);

1588 
	}
}

1595 
	$__bam_gbhc
(
dbc
, 
da
)

1596 
DBC
 *
dbc
;

1597 
DBT
 *
da
;

1599 
BTREE_CURSOR
 *

;

1600 
DB
 *
dbp
;

1601 
DB_MPOOLFILE
 *
mpf
;

1602 
cmp
, 
exa
, 
t
;

1604 
dbp
 = 
dbc
->dbp;

1605 
mpf
 = 
dbp
->mpf;

1606 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1614 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
, 0, &->
ge
)) != 0)

1615  (
t
);

1622 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

1627 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
,

1628 
da
, 

->
ge
, cp->
dx
,

1629 
dbp
->
dup_com
 =
NULL
 ? 
__bam_defcmp
 : dbp->dup_compare,

1630 &
cmp
)) != 0)

1631  (
t
);

1633 i(
cmp
 <= 0)

1634  (
DB_NOTFOUND
);

1637 i((
t
 = 
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
)) != 0)

1638  (
t
);

1639 

->
ge
 = 
NULL
;

1641  (
	`__bamc_ch
(
dbc
,

1642 
PGNO_INVALID
, 
da
, 
DB_GET_BOTH
, &
exa
));

1654 i(

->
dx
 + 
P_INDX
 >
	`NUM_ENT
(->
ge
) ||

1655 !
	`IS_DUPLICATE
(
dbc
, 

->
dx
, cp->dx + 
P_INDX
))

1656  (
DB_NOTFOUND
);

1657 

->
dx
 +
P_INDX
;

1659  (
	`__bam_gbh_fddum
(
dbc
, 
da
, 
DB_GET_BOTH
));

1660 
	}
}

1667 
	$__bam_gbh_fddum
(
dbc
, 
da
, 
ags
)

1668 
DBC
 *
dbc
;

1669 
DBT
 *
da
;

1670 
u_t32_t
 
ags
;

1672 
BTREE_CURSOR
 *

;

1673 
DB
 *
dbp
;

1674 
db_dx_t
 
ba
, 
lim
, 
t
;

1675 
cmp
, 
t
;

1677 
	`COMPQUIET
(
cmp
, 0);

1679 
dbp
 = 
dbc
->dbp;

1680 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1693 i(
dbp
->
dup_com
 =
NULL
) {

1694 ;; 

->
dx
 +
P_INDX
) {

1695 i(!
	`IS_CUR_DELETED
(
dbc
) &&

1696 (
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
da
, 

->
ge
,

1697 

->
dx
 + 
O_INDX
, 
__bam_defcmp
, &
cmp
)) != 0)

1698  (
t
);

1699 i(
cmp
 == 0)

1702 i(

->
dx
 + 
P_INDX
 >
	`NUM_ENT
(->
ge
) ||

1703 !
	`IS_DUPLICATE
(
dbc
, 

->
dx
, cp->dx + 
P_INDX
))

1706  (
DB_NOTFOUND
);

1717 
ba
 = 
t
 = 

->
dx
; < 
	`NUM_ENT
(->
ge
); +
P_INDX
)

1718 i(!
	`IS_DUPLICATE
(
dbc
, 

->
dx
, 
t
))

1720 i(
ba
 =(
t
 - 
P_INDX
)) {

1721 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
da
,

1722 

->
ge
, cp->
dx
 + 
O_INDX
, 
dbp
->
dup_com
, &
cmp
)) != 0)

1723  (
t
);

1724  (
cmp
 == 0 ||

1725 (
cmp
 < 0 && 
ags
 =
DB_GET_BOTH_RANGE
? 0 : 
DB_NOTFOUND
);

1728 
lim
 = (
t
 - 
ba
/ (
db_dx_t
)
P_INDX
;im != 0;im >>= 1) {

1729 

->
dx
 = 
ba
 + ((
lim
 >> 1* 
P_INDX
);

1730 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
da
, 

->
ge
,

1731 

->
dx
 + 
O_INDX
, 
dbp
->
dup_com
, &
cmp
)) != 0)

1732  (
t
);

1733 i(
cmp
 == 0) {

1739 i(!
	`IS_CUR_DELETED
(
dbc
))

1743 i(
cmp
 > 0) {

1744 
ba
 = 

->
dx
 + 
P_INDX
;

1745 --
lim
;

1750 i(
ags
 =
DB_GET_BOTH
)

1751  (
DB_NOTFOUND
);

1758 

->
dx
 = 
ba
;

1759 

->
dx
 < 
t
 && 
	`IS_CUR_DELETED
(
dbc
))

1760 

->
dx
 +
P_INDX
;

1761  (

->
dx
 < 
t
 ? 0 : 
DB_NOTFOUND
);

1762 
	}
}

1769 
	$__bamc_put
(
dbc
, 
key
, 
da
, 
ags
, 
pgn
)

1770 
DBC
 *
dbc
;

1771 
DBT
 *
key
, *
da
;

1772 
u_t32_t
 
ags
;

1773 
db_pgno_t
 *
pgn
;

1775 
BTREE
 *
t
;

1776 
BTREE_CURSOR
 *

;

1777 
DB
 *
dbp
;

1778 
DBT
 
dbt
;

1779 
DB_MPOOLFILE
 *
mpf
;

1780 
db_pgno_t
 
ro_pgno
;

1781 
u_t32_t
 
ii
;

1782 
cmp
, 
exa
, 
own
, 
t
, 
ack
;

1783 *
g
;

1785 
dbp
 = 
dbc
->dbp;

1786 
mpf
 = 
dbp
->mpf;

1787 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1788 
ro_pgno
 = 

->
ro
;

1790 
l
: 
t
 = 
ack
 = 0;

1791 
ags
) {

1792 
DB_CURRENT
:

1793 i(
	`F_ISSET
(

, 
C_DELETED
))

1794  (
DB_NOTFOUND
);

1797 
DB_AFTER
:

1798 
DB_BEFORE
:

1799 
ii
 = 
ags
;

1800 
own
 = 1;

1803 
	`ACQUIRE_WRITE_LOCK
(
dbc
, 
t
);

1804 i(
t
 != 0)

1805 
r
;

1806 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
,

1807 0, &

->
ge
)) != 0)

1808 
r
;

1810 
DB_KEYFIRST
:

1811 
DB_KEYLAST
:

1812 
DB_NODUPDATA
:

1813 
DB_NOOVERWRITE
:

1814 
own
 = 0;

1822 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

1823 i((
t
 = 
	`__bamc_ch
(
dbc
,

1824 
	`F_ISSET
(

, 
C_RECNUM
? cp->
ro
 : 
ro_pgno
,

1825 
da
, 
ags
, &
exa
)) != 0)

1826 
r
;

1827 
ack
 = 1;

1830 i(
exa
) {

1831 i(
	`IS_DELETED
(
dbp
, 

->
ge
, cp->
dx
)) {

1832 
ii
 = 
DB_CURRENT
;

1835 
t
 = 
	`__db_du
(
dbp
, 
ags
);

1836 
r
;

1838 
ii
 = 
DB_BEFORE
;

1851 i((
t
 = 
	`__bamc_ch
(
dbc
,

1852 
	`F_ISSET
(

, 
C_RECNUM
? cp->
ro
 : 
ro_pgno
, 
key
,

1853 
ags
 =
DB_KEYFIRST
 || 
dbp
->
dup_com
 !
NULL
 ?

1854 
DB_KEYFIRST
 : 
DB_KEYLAST
, &
exa
)) != 0)

1855 
r
;

1856 
ack
 = 1;

1862 i(!
exa
) {

1863 
ii
 = 
DB_KEYFIRST
;

1870 } i(
ags
 =
DB_NOOVERWRITE
 && !
	`IS_CUR_DELETED
(
dbc
)) {

1871 i(
pgn
 !
NULL
 && 
	`__bam_isd
(
dbc
,gnop))

1872 
t
 = 
	`__bam_d_exis
(
dbc
, *
pgn
);

1874 
t
 = 
DB_KEYEXIST
;

1875 i(
t
 != 0)

1876 
r
;

1882 i(!
	`F_ISSET
(
dbp
, 
DB_AM_DUP
)) {

1883 
ii
 = 
DB_CURRENT
;

1892 i(
pgn
 !
NULL
 && 
	`__bam_isd
(
dbc
,gnop))

1893 
de
;

1896 i(
dbp
->
dup_com
 =
NULL
) {

1897 i(
ags
 =
DB_KEYFIRST
)

1898 
ii
 = 
DB_BEFORE
;

1900 ;; 

->
dx
 +
P_INDX
)

1901 i(

->
dx
 + 
P_INDX
 >=

1902 
	`NUM_ENT
(

->
ge
) ||

1903 !
	`IS_DUPLICATE
(
dbc
, 

->
dx
,

1904 

->
dx
 + 
P_INDX
)) {

1905 
ii
 = 
DB_AFTER
;

1915 ;; 

->
dx
 +
P_INDX
) {

1916 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
da
, 

->
ge
,

1917 

->
dx
 + 
O_INDX
, 
dbp
->
dup_com
, &
cmp
)) != 0)

1918 
r
;

1919 i(
cmp
 < 0) {

1920 
ii
 = 
DB_BEFORE
;

1925 i(
cmp
 == 0) {

1926 i(
	`IS_DELETED
(
dbp
, 

->
ge
, cp->
dx
)) {

1927 
ii
 = 
DB_CURRENT
;

1930 
t
 = 
	`__db_du
(
dbp
, 
ags
);

1931 
r
;

1934 i(

->
dx
 + 
P_INDX
 >
	`NUM_ENT
(->
ge
) ||

1935 
	`P_INP
(
dbp
, ((
PAGE
 *)

->
ge
))[->
dx
] !=

1936 
	`P_INP
(
dbp
, ((
PAGE
 *)

->
ge
))[->
dx
 + 
P_INDX
]) {

1937 
ii
 = 
DB_AFTER
;

1943 
t
 = 
	`__db_unknown_ag
(
dbp
->
dbv
, "__bamc_put", 
ags
);

1944 
r
;

1947 
t
 = 
	`__bam_iem
(
dbc
, 
key
, 
da
, 
ii
, 0)) {

1950 
DB_NEEDSPLIT
:

1955 i(
ags
 =
DB_AFTER
 ||

1956 
ags
 =
DB_BEFORE
 || fg=
DB_CURRENT
) {

1957 
	`memt
(&
dbt
, 0, (
DBT
));

1958 i((
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
, 

->
ge
, 0,

1959 &
dbt
, &
dbc
->
my_rkey
.
da
, &dbc->my_rkey.
un
)) != 0)

1960 
r
;

1961 
g
 = &
dbt
;

1963 
g
 = 
	`F_ISSET
(
dbc
, 
DBC_OPD
? 
da
 : 
key
;

1972 i(
ack
)

1973 
t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
 | 
STK_NOLOCK
);

1975 
	`DISCARD_CUR
(
dbc
, 
t
);

1976 i(
t
 != 0)

1977 
r
;

1987 i(
own
 == 0) {

1988 

->
pgno
 = 
PGNO_INVALID
;

1989 

->
dx
 = 0;

1993 i((
t
 = 
	`__bam_l
(
dbc
, 
g
, &
ro_pgno
)) != 0)

1994  (
t
);

1996 
l
;

1998 
r
;

2001 
r
:

2002 
de
:

2015 
t
 = 
dbp
->
bt_
;

2016 i(
t
 =0 && 
	`TYPE
(

->
ge
=
P_LBTREE
 &&

2017 (
ags
 =
DB_KEYFIRST
 || fg=
DB_KEYLAST
) &&

2018 !
	`F_ISSET
(

, 
C_RECNUM
) &&

2019 (!
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
) ||

2020 (
	`LOGGING_ON
(
dbp
->
dbv
&& !
	`F_ISSET
(dbp, 
DB_AM_NOT_DURABLE
))) &&

2021 ((
	`NEXT_PGNO
(

->
ge
=
PGNO_INVALID
 &&

2022 

->
dx
 >
	`NUM_ENT
(->
ge
- 
P_INDX
) ||

2023 (
	`PREV_PGNO
(

->
ge
=
PGNO_INVALID
 && cp->
dx
 == 0))) {

2024 
t
->
bt_gno
 = 

->
pgno
;

2025 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
))

2026 
t
->
bt_΢
 = 
	`LSN
(

->
ge
);

2028 
t
->
bt_gno
 = 
PGNO_INVALID
;

2036 i(
ack
 && 
	`BT_STK_POP
(

!
NULL
)

2037 ()
	`__bam_kl
(
dbc
, 0);

2048 
	`F_CLR
(

, 
C_DELETED
);

2049 i(

->
d
 !
NULL
) {

2050 

 = (
BTREE_CURSOR
 *)->
d
->

;

2051 
	`F_CLR
(

, 
C_DELETED
);

2054  (
t
);

2055 
	}
}

2064 
	$__bamc_rg
(
dbc
, 
da
)

2065 
DBC
 *
dbc
;

2066 
DBT
 *
da
;

2068 
BTREE_CURSOR
 *

;

2069 
DB
 *
dbp
;

2070 
DBT
 
dbt
;

2071 
DB_MPOOLFILE
 *
mpf
;

2072 
db_o_t
 
o
;

2073 
exa
, 
t
, 
t_t
;

2075 
dbp
 = 
dbc
->dbp;

2076 
mpf
 = 
dbp
->mpf;

2077 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2084 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
, 0, &->
ge
)) != 0)

2085  (
t
);

2086 
	`memt
(&
dbt
, 0, (
DBT
));

2087 i((
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
, 

->
ge
,

2088 

->
dx
, &
dbt
, &
dbc
->
my_rkey
.
da
, &dbc->my_rkey.
un
)) != 0)

2089 
r
;

2090 
t
 = 
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
);

2091 

->
ge
 = 
NULL
;

2092 i(
t
 != 0)

2093  (
t
);

2095 i((
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
, &
dbt
,

2096 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
,

2097 1, &
o
, &
exa
)) != 0)

2098 
r
;

2100 
t
 = 
	`__db_tcy
(
dbp
->
dbv
, 
da
,

2101 &
o
, eo), &
dbc
->
rda
->
da
, &dbc->rda->
un
);

2104 
r
: i((
t_t
 = 
	`__bam_kl
(
dbc
, 0)!0 && 
t
 == 0)

2105 
t
 = 
t_t
;

2107  (
t
);

2108 
	}
}

2115 
	$__bamc_wrock
(
dbc
)

2116 
DBC
 *
dbc
;

2118 
BTREE_CURSOR
 *

;

2119 
t
;

2121 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2123 i(

->
lock_mode
 =
DB_LOCK_WRITE
)

2132 
	`ACQUIRE_WRITE_LOCK
(
dbc
, 
t
);

2133  (
t
);

2134 
	}
}

2141 
	$__bamc_xt
(
dbc
, 
l_move
, 
ded_okay
)

2142 
DBC
 *
dbc
;

2143 
l_move
, 
ded_okay
;

2145 
BTREE_CURSOR
 *

;

2146 
db_dx_t
 
adju
;

2147 
db_lockmode_t
 
lock_mode
;

2148 
db_pgno_t
 
pgno
;

2149 
t
;

2151 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2152 
t
 = 0;

2161 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

2162 
adju
 = 
O_INDX
;

2163 
lock_mode
 = 
DB_LOCK_NG
;

2165 
adju
 = 
dbc
->
dbty
 =
DB_BTREE
 ? 
P_INDX
 : 
O_INDX
;

2166 
lock_mode
 =

2167 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
;

2169 i(

->
ge
 =
NULL
) {

2170 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 

->
pgno
, 0, 
t
);

2171 i(
t
 != 0)

2172  (
t
);

2175 i(
l_move
)

2176 

->
dx
 +
adju
;

2186 i(

->
dx
 >
	`NUM_ENT
(->
ge
)) {

2187 i((
pgno
 = 
	`NEXT_PGNO
(

->
ge
)=
PGNO_INVALID
)

2188  (
DB_NOTFOUND
);

2190 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 
pgno
, 0, 
t
);

2191 i(
t
 != 0)

2192  (
t
);

2193 

->
dx
 = 0;

2196 i(!
ded_okay
 && 
	`IS_CUR_DELETED
(
dbc
)) {

2197 

->
dx
 +
adju
;

2203 
	}
}

2210 
	$__bamc_ev
(
dbc
)

2211 
DBC
 *
dbc
;

2213 
BTREE_CURSOR
 *

;

2214 
db_dx_t
 
adju
;

2215 
db_lockmode_t
 
lock_mode
;

2216 
db_pgno_t
 
pgno
;

2217 
t
;

2219 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2220 
t
 = 0;

2229 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

2230 
adju
 = 
O_INDX
;

2231 
lock_mode
 = 
DB_LOCK_NG
;

2233 
adju
 = 
dbc
->
dbty
 =
DB_BTREE
 ? 
P_INDX
 : 
O_INDX
;

2234 
lock_mode
 =

2235 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
;

2237 i(

->
ge
 =
NULL
) {

2238 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 

->
pgno
, 0, 
t
);

2239 i(
t
 != 0)

2240  (
t
);

2245 i(

->
dx
 == 0) {

2246 i((
pgno
 =

2247 
	`PREV_PGNO
(

->
ge
)=
PGNO_INVALID
)

2248  (
DB_NOTFOUND
);

2250 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 
pgno
, 0, 
t
);

2251 i(
t
 != 0)

2252  (
t
);

2254 i((

->
dx
 = 
	`NUM_ENT
(->
ge
)) == 0)

2259 

->
dx
 -
adju
;

2260 i(
	`IS_CUR_DELETED
(
dbc
))

2266 
	}
}

2273 
	$__bamc_ch
(
dbc
, 
ro_pgno
, 
key
, 
ags
, 
exap
)

2274 
DBC
 *
dbc
;

2275 
db_pgno_t
 
ro_pgno
;

2276 cڡ 
DBT
 *
key
;

2277 
u_t32_t
 
ags
;

2278 *
exap
;

2280 
BTREE
 *
t
;

2281 
BTREE_CURSOR
 *

;

2282 
DB
 *
dbp
;

2283 
PAGE
 *
h
;

2284 
db_dx_t
 
dx
, *
p
;

2285 
db_pgno_t
 
bt_gno
;

2286 
db_o_t
 
o
;

2287 
u_t32_t
 
sags
;

2288 
cmp
, 
t
, 
t_t
;

2290 
dbp
 = 
dbc
->dbp;

2291 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2292 
t
 = 
dbp
->
bt_
;

2293 
t
 = 0;

2299 
	`DISCARD_CUR
(
dbc
, 
t
);

2300 i(
t
 != 0)

2301  (
t
);

2303 
ags
) {

2304 
DB_FIRST
:

2305 
sags
 = (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_WRITE
 : 
SR_READ
| 
SR_MIN
;

2306 
ch
;

2307 
DB_LAST
:

2308 
sags
 = (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_WRITE
 : 
SR_READ
| 
SR_MAX
;

2309 
ch
;

2310 
DB_SET_RECNO
:

2311 i((
t
 = 
	`__m_gno
(
dbc
, 
key
, &
o
, 0)) != 0)

2312  (
t
);

2313 
sags
 =

2314 (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
| 
SR_EXACT
;

2315 i((
t
 = 
	`__bam_rch
(
dbc
, &
o
, 
sags
, 1, 
exap
)) != 0)

2316  (
t
);

2318 
DB_SET
:

2319 
DB_GET_BOTH
:

2320 
sags
 =

2321 (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
| 
SR_EXACT
;

2322 
ch
;

2323 
DB_GET_BOTH_RANGE
:

2324 
sags
 = (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
);

2325 
ch
;

2326 
DB_SET_RANGE
:

2327 
sags
 =

2328 (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_WRITE
 : 
SR_READ
| 
SR_DUPFIRST
;

2329 
ch
;

2330 
DB_KEYFIRST
:

2331 
DB_NOOVERWRITE
:

2332 
sags
 = 
SR_KEYFIRST
;

2333 
_ch
;

2334 
DB_KEYLAST
:

2335 
DB_NODUPDATA
:

2336 
sags
 = 
SR_KEYLAST
;

2337 
_ch
:

2342 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
))

2343 
ch
;

2354 
bt_gno
 = 
t
->bt_lpgno;

2359 i(
bt_gno
 =
PGNO_INVALID
)

2360 
ch
;

2370 
h
 = 
NULL
;

2371 
	`ACQUIRE_CUR
(
dbc
, 
DB_LOCK_WRITE
, 
bt_gno
, 
DB_LOCK_NOWAIT
, 
t
);

2372 i(
t
 != 0) {

2373 i(
t
 =
DB_LOCK_DEADLOCK
 ||

2374 
t
 =
DB_LOCK_NOTGRANTED
 ||

2375 
t
 =
DB_PAGE_NOTFOUND
)

2376 
t
 = 0;

2377 
_miss
;

2380 
h
 = 

->
ge
;

2381 
p
 = 
	`P_INP
(
dbp
, 
h
);

2387 i(
	`TYPE
(
h
!
P_LBTREE
 || 
	`NUM_ENT
(h) == 0)

2388 
_miss
;

2391 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
) &&

2392 
	`LOG_COMPARE
(&
t
->
bt_΢
, &
	`LSN
(
h
)) != 0)

2393 
_miss
;

2402 i(
h
->
xt_pgno
 =
PGNO_INVALID
) {

2403 
dx
 = 
	`NUM_ENT
(
h
- 
P_INDX
;

2404 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
,

2405 
key
, 
h
, 
dx
, 
t
->
bt_com
, &
cmp
)) != 0)

2406 
_miss
;

2408 i(
cmp
 < 0)

2409 
y_beg
;

2410 i(
cmp
 > 0) {

2411 
dx
 +
P_INDX
;

2412 
_h
;

2422 i(
ags
 =
DB_KEYLAST
)

2423 
_h
;

2425 
dx
 > 0 && 
p
[dx - 
P_INDX
] == inp[indx];

2426 
dx
 -
P_INDX
)

2428 
_h
;

2430 
y_beg
: i(
h
->
ev_pgno
 =
PGNO_INVALID
) {

2431 
dx
 = 0;

2432 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
,

2433 
key
, 
h
, 
dx
, 
t
->
bt_com
, &
cmp
)) != 0)

2434 
_miss
;

2436 i(
cmp
 > 0)

2437 
_miss
;

2438 i(
cmp
 < 0)

2439 
_h
;

2448 i(
ags
 =
DB_KEYFIRST
)

2449 
_h
;

2451 
dx
 < (
db_dx_t
)(
	`NUM_ENT
(
h
- 
P_INDX
) &&

2452 
p
[
dx
] =p[dx + 
P_INDX
];

2453 
dx
 +
P_INDX
)

2455 
_h
;

2457 
_miss
;

2459 
_h
:

2460 *
exap
 = 
cmp
 == 0;

2466 
	`BT_STK_CLR
(

);

2467 
	`BT_STK_ENTER
(
dbp
->
dbv
,

2468 

, 
h
, 
dx
, cp->
lock
, cp->
lock_mode
, 
t
);

2469 i(
t
 != 0)

2470  (
t
);

2473 
_miss
:

2479 
	`DISCARD_CUR
(
dbc
, 
t
);

2480 

->
pgno
 = 
PGNO_INVALID
;

2481 i((
t_t
 = 
	`__LPUT
(
dbc
, 

->
lock
)!0 && 
t
 == 0)

2482 
t
 = 
t_t
;

2483 i(
t
 != 0)

2484  (
t
);

2486 
ch
: i((
t
 = 
	`__bam_ch
(
dbc
, 
ro_pgno
,

2487 
key
, 
sags
, 1, 
NULL
, 
exap
)) != 0)

2488  (
t
);

2491  (
	`__db_unknown_ag
(
dbp
->
dbv
, "__bamc_ch", 
ags
));

2494 

->
ge
 = cp->
c
->page;

2495 

->
pgno
 = cp->
c
->
ge
->pgno;

2496 

->
dx
 = cp->
c
->indx;

2497 

->
lock
 = cp->
c
->lock;

2498 

->
lock_mode
 = cp->
c
->lock_mode;

2501 i(
ags
 =
DB_FIRST
 &&

2502 (
	`NUM_ENT
(

->
ge
=0 || 
	`IS_CUR_DELETED
(
dbc
)))

2503 i((
t
 = 
	`__bamc_xt
(
dbc
, 0, 0)) != 0)

2504  (
t
);

2505 i(
ags
 =
DB_LAST
 &&

2506 (
	`NUM_ENT
(

->
ge
=0 || 
	`IS_CUR_DELETED
(
dbc
)))

2507 i((
t
 = 
	`__bamc_ev
(
dbc
)) != 0)

2508  (
t
);

2511 
	}
}

2518 
	$__bamc_physd
(
dbc
)

2519 
DBC
 *
dbc
;

2521 
BTREE_CURSOR
 *

;

2522 
DB
 *
dbp
;

2523 
DBT
 
key
;

2524 
de_ge
, 
emy_ge
, 
exa
, 
t
;

2526 
dbp
 = 
dbc
->dbp;

2527 
	`memt
(&
key
, 0, (
DBT
));

2528 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2529 
de_ge
 = 
emy_ge
 = 
t
 = 0;

2532 
de_ge
 = 
emy_ge
 =

2533 
	`NUM_ENT
(

->
ge
=(
	`TYPE
(->ge=
P_LBTREE
 ? 2 : 1);

2540 i(
de_ge
 &&

2541 !
	`F_ISSET
(
dbc
, 
DBC_OPD
&& F_ISSET(
dbp
, 
DB_AM_REVSPLITOFF
))

2542 
de_ge
 = 0;

2549 i(
de_ge
 && 

->
pgno
 =->
ro
)

2550 
de_ge
 = 0;

2563 i(
de_ge
) {

2564 i((
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
, 

->
ge
,

2565 0, &
key
, &
dbc
->
my_rkey
.
da
, &dbc->my_rkey.
un
)) != 0)

2566  (
t
);

2584 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

2585 &

->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

2586  (
t
);

2587 i(
	`TYPE
(

->
ge
=
P_LBTREE
) {

2588 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

2589  (
t
);

2590 i(!
emy_ge
)

2591 i((
t
 = 
	`__bam__di
(
dbc
,

2592 
	`PGNO
(

->
ge
), cp->
dx
, -1)) != 0)

2593  (
t
);

2595 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

2596  (
t
);

2599 
	`F_CLR
(

, 
C_DELETED
);

2601 i(!
emy_ge
)

2602 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(

->
ge
), cp->
dx
, -1)) != 0)

2603  (
t
);

2608 i(
	`F_ISSET
(
dbc
->
dbp
, 
DB_AM_READ_UNCOMMITTED
)) {

2609 i((
t
 = 
	`__TLPUT
(
dbc
, 

->
lock
)) != 0)

2610  (
t
);

2611 

->
lock_mode
 = 
DB_LOCK_WWRITE
;

2614 i(!
de_ge
)

2617 
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
, &
key
, 
SR_DEL
, 0, 
NULL
, &
exa
);

2623 i(
t
 == 0)

2624 
	`DISCARD_CUR
(
dbc
, 
t
);

2625 i(
t
 == 0)

2626 
t
 = 
	`__bam_dges
(
dbc
, 1, 0);

2628 ()
	`__bam_kl
(
dbc
, 0);

2630  (
t
);

2631 
	}
}

2638 
	$__bamc_gack
(
dbc
)

2639 
DBC
 *
dbc
;

2641 
BTREE_CURSOR
 *

;

2642 
DB
 *
dbp
;

2643 
DBT
 
dbt
;

2644 
DB_MPOOLFILE
 *
mpf
;

2645 
PAGE
 *
h
;

2646 
exa
, 
t
, 
t_t
;

2648 
dbp
 = 
dbc
->dbp;

2649 
mpf
 = 
dbp
->mpf;

2650 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2657 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
, 0, &
h
)) != 0)

2658  (
t
);

2661 
	`memt
(&
dbt
, 0, (
DBT
));

2662 i((
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
,

2663 
h
, 0, &
dbt
, &
dbc
->
my_rkey
.
da
, &dbc->my_rkey.
un
)) != 0)

2664 
r
;

2667 
exa
 = 0;

2668 
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
,

2669 &
dbt
, 
SR_KEYFIRST
, 1, 
NULL
, &
exa
);

2671 
r
:

2672 i((
t_t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

2673 
t
 = 
t_t
;

2675  (
t
);

2676 
	}
}

2684 
	$__bam_isd
(
dbc
, 
pgn
)

2685 
DBC
 *
dbc
;

2686 
db_pgno_t
 *
pgn
;

2688 
BOVERFLOW
 *
bo
;

2690 i(
	`TYPE
(
dbc
->

->
ge
!
P_LBTREE
)

2693 
bo
 = 
	`GET_BOVERFLOW
(
dbc
->
dbp
,

2694 
dbc
->

->
ge
, dbc->->
dx
 + 
O_INDX
);

2695 i(
	`B_TYPE
(
bo
->
ty
=
B_DUPLICATE
) {

2696 *
pgn
 = 
bo
->
pgno
;

2700 
	}
}

2708 
	$__bam_d_exis
(
dbc
, 
pgno
)

2709 
DBC
 *
dbc
;

2710 
db_pgno_t
 
pgno
;

2712 
PAGE
 *
h
;

2713 
t
;

2715 i((
t
 = 
	`__memp_fg
(
dbc
->
dbp
->
mpf
, &
pgno
, dbc->
txn
, 0, &
h
)) != 0)

2716  (
t
);

2723 i(
	`NUM_ENT
(
h
) == 0)

2724 
t
 = 0;

2726 
t
 = 
DB_KEYEXIST
;

2728 ()
	`__memp_ut
(
dbc
->
dbp
->
mpf
, 
h
, dbc->
iܙy
);

2730  (
t
);

2731 
	}
}

	@../btree/bt_delete.c

44 
	~"db_cfig.h
"

46 
	~"db_t.h
"

47 
	~"dbc/db_ge.h
"

48 
	~"dbc/b.h
"

49 
	~"dbc/lock.h
"

50 
	~"dbc/mp.h
"

59 
	$__bam_dem
(
dbc
, 
h
, 
dx
)

60 
DBC
 *
dbc
;

61 
PAGE
 *
h
;

62 
u_t32_t
 
dx
;

64 
BINTERNAL
 *
bi
;

65 
BKEYDATA
 *
bk
;

66 
DB
 *
dbp
;

67 
u_t32_t
 
nbys
;

68 
t
;

69 
db_dx_t
 *
p
;

71 
dbp
 = 
dbc
->dbp;

72 
p
 = 
	`P_INP
(
dbp
, 
h
);

75 
	`DB_ASSERT
(
dbp
->
dbv
, 
	`IS_DIRTY
(
h
));

77 
	`TYPE
(
h
)) {

78 
P_IBTREE
:

79 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
);

80 
	`B_TYPE
(
bi
->
ty
)) {

81 
B_DUPLICATE
:

82 
B_KEYDATA
:

83 
nbys
 = 
	`BINTERNAL_SIZE
(
bi
->
n
);

85 
B_OVERFLOW
:

86 
nbys
 = 
	`BINTERNAL_SIZE
(
bi
->
n
);

87 i((
t
 =

88 
	`__db_doff
(
dbc
, ((
BOVERFLOW
 *)
bi
->
da
)->
pgno
)) != 0)

89  (
t
);

92  (
	`__db_pgfmt
(
dbp
->
dbv
, 
	`PGNO
(
h
)));

95 
P_IRECNO
:

96 
nbys
 = 
RINTERNAL_SIZE
;

98 
P_LBTREE
:

108 i((
dx
 % 2) == 0) {

115 i(
dx
 + 
P_INDX
 < (
u_t32_t
)
	`NUM_ENT
(
h
) &&

116 
p
[
dx
] =p[dx + 
P_INDX
])

117  (
	`__bam_adjdx
(
dbc
,

118 
h
, 
dx
, indx + 
O_INDX
, 0));

124 i(
dx
 > 0 && 
p
[dx] =p[dx - 
P_INDX
])

125  (
	`__bam_adjdx
(
dbc
,

126 
h
, 
dx
, indx - 
P_INDX
, 0));

129 
P_LDUP
:

130 
P_LRECNO
:

131 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

132 
	`B_TYPE
(
bk
->
ty
)) {

133 
B_DUPLICATE
:

134 
nbys
 = 
BOVERFLOW_SIZE
;

136 
B_OVERFLOW
:

137 
nbys
 = 
BOVERFLOW_SIZE
;

138 i((
t
 = 
	`__db_doff
(

139 
dbc
, (
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
))->
pgno
)) != 0)

140  (
t
);

142 
B_KEYDATA
:

143 
nbys
 = 
	`BKEYDATA_SIZE
(
bk
->
n
);

146  (
	`__db_pgfmt
(
dbp
->
dbv
, 
	`PGNO
(
h
)));

150  (
	`__db_pgfmt
(
dbp
->
dbv
, 
	`PGNO
(
h
)));

154 i((
t
 = 
	`__db_dem
(
dbc
, 
h
, 
dx
, 
nbys
)) != 0)

155  (
t
);

158 
	}
}

167 
	$__bam_adjdx
(
dbc
, 
h
, 
dx
, 
dx_cy
, 
is_
)

168 
DBC
 *
dbc
;

169 
PAGE
 *
h
;

170 
u_t32_t
 
dx
, 
dx_cy
;

171 
is_
;

173 
DB
 *
dbp
;

174 
db_dx_t
 
cy
, *
p
;

175 
t
;

177 
dbp
 = 
dbc
->dbp;

178 
p
 = 
	`P_INP
(
dbp
, 
h
);

181 i(
	`DBC_LOGGING
(
dbc
)) {

182 i((
t
 = 
	`__bam_adj_log
(
dbp
, 
dbc
->
txn
, &
	`LSN
(
h
), 0,

183 
	`PGNO
(
h
), &
	`LSN
(h), 
dx
, 
dx_cy
, (
u_t32_t
)
is_
)) != 0)

184  (
t
);

186 
	`LSN_NOT_LOGGED
(
	`LSN
(
h
));

189 i(
is_
) {

190 
cy
 = 
p
[
dx_cy
];

191 i(
dx
 !
	`NUM_ENT
(
h
))

192 
	`memmove
(&
p
[
dx
 + 
O_INDX
], &inp[indx],

193 (
db_dx_t
* (
	`NUM_ENT
(
h
- 
dx
));

194 
p
[
dx
] = 
cy
;

195 ++
	`NUM_ENT
(
h
);

197 --
	`NUM_ENT
(
h
);

198 i(
dx
 !
	`NUM_ENT
(
h
))

199 
	`memmove
(&
p
[
dx
], &p[dx + 
O_INDX
],

200 (
db_dx_t
* (
	`NUM_ENT
(
h
- 
dx
));

204 
	}
}

213 
	$__bam_dges
(
dbc
, 
u_t
, 
upde
)

214 
DBC
 *
dbc
;

215 
u_t
;

216 
upde
;

218 
BINTERNAL
 *
bi
;

219 
BTREE_CURSOR
 *

;

220 
DB
 *
dbp
;

221 
DBT
 
a
, 
b
;

222 
DB_LOCK
 
c_lock
, 
p_lock
;

223 
DB_MPOOLFILE
 *
mpf
;

224 
EPG
 *
g
, *
ve_
, *
ack_g
;

225 
PAGE
 *
chd
, *

;

226 
db_dx_t
 
nems
;

227 
db_pgno_t
 
pgno
, 
ro_pgno
;

228 
db_o_t
 
rt
;

229 
de
, 
t
, 
t_t
;

231 
dbp
 = 
dbc
->dbp;

232 
mpf
 = 
dbp
->mpf;

233 

 = (
BTREE_CURSOR
 *)
dbc
->

;

234 
nems
 = 0;

235 
pgno
 = 
PGNO_INVALID
;

247 
t
 = 0;

248 i(
u_t
)

249 
ack_g
 = 

->

;

251 
ack_g
 = 

->
c
; sck_g > cp->

; --stack_epg)

252 i(
	`NUM_ENT
(
ack_g
->
ge
) > 1)

254 
g
 = 
ack_g
;

264 i(
	`LEVEL
(

->
c
->
ge
) == 1 &&

265 (
t
 = 
	`__bam_lk
(
dbc
, 

->
c
->
ge
, 
PGNO_INVALID
)) != 0)

266 
disrd
;

276 i((
t
 = 
	`__memp_dty
(
mpf
,

277 &
g
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

278 
disrd
;

279 i((
t
 = 
	`__bam_dem
(
dbc
, 
g
->
ge
,pg->
dx
)) != 0)

280 
disrd
;

281 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
g
->
ge
),pg->
dx
, -1)) != 0)

282 
disrd
;

284 i(
upde
 && 
g
->
dx
 == 0) {

285 
ve_
 = 

->
c
;

286 

->
c
 = 
g
;

287 
t
 = 
	`__bam_pupde
(
dbc
, 
g
->
ge
);

288 

->
c
 = 
ve_
;

289 i(
t
 != 0)

290 
disrd
;

293 
pgno
 = 
	`PGNO
(
g
->
ge
);

294 
nems
 = 
	`NUM_ENT
(
g
->
ge
);

296 
t
 = 
	`__memp_ut
(
mpf
, 
g
->
ge
, 
dbc
->
iܙy
);

297 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

298 
t
 = 
t_t
;

299 i(
t
 != 0)

300 
r_c
;

303 
disrd
: 
g
 = 

->

;pg < 
ack_g
; ++epg) {

304 i((
t_t
 = 
	`__memp_ut
(
mpf
,

305 
g
->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

306 
t
 = 
t_t
;

307 
g
->
ge
 = 
NULL
;

308 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

309 
t
 = 
t_t
;

311 i(
t
 != 0)

312 
r
;

315 ++
g
 <

->
c
) {

316 i((
t
 = 
	`__memp_dty
(
mpf
,

317 &
g
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

318 
r
;

325 i(
	`NUM_ENT
(
g
->
ge
) != 0) {

326 
	`DB_ASSERT
(
dbp
->
dbv
, 
	`LEVEL
(
g
->
ge
) != 1);

328 i((
t
 = 
	`__bam_dem
(
dbc
, 
g
->
ge
,pg->
dx
)) != 0)

329 
r
;

337 i(
	`NUM_ENT
(
g
->
ge
) != 0)

338 
r
;

341 
t
 = 
	`__db_
(
dbc
, 
g
->
ge
);

342 i(

->
ge
 =
g
->page)

343 

->
ge
 = 
NULL
;

344 
g
->
ge
 = 
NULL
;

345 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

346 
t
 = 
t_t
;

347 i(
t
 != 0)

348 
r_c
;

352 
r_c
: ++
g
;

353 
r
: ; 
g
 <

->
c
; ++epg) {

354 i(
g
->
ge
 !
NULL
)

355 ()
	`__memp_ut
(
mpf
,

356 
g
->
ge
, 
dbc
->
iܙy
);

357 ()
	`__TLPUT
(
dbc
, 
g
->
lock
);

359 
	`BT_STK_CLR
(

);

360  (
t
);

362 
	`BT_STK_CLR
(

);

370 
ro_pgno
 = 

->
ro
;

371 i(
pgno
 !
ro_pgno
 || 
nems
 != 1)

374 
de
 = 0; !done;) {

376 

 = 
chd
 = 
NULL
;

377 
	`LOCK_INIT
(
p_lock
);

378 
	`LOCK_INIT
(
c_lock
);

381 
pgno
 = 
ro_pgno
;

382 i((
t
 =

383 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_WRITE
, 0, &
p_lock
)) != 0)

384 

;

385 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
txn
,

386 
DB_MPOOL_DIRTY
, &

)) != 0)

387 

;

389 i(
	`NUM_ENT
(

) != 1)

390 

;

392 
	`TYPE
(

)) {

393 
P_IBTREE
:

398 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 

, 0);

399 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
)

400 i((
t
 = 
	`__db_doff
(
dbc
,

401 ((
BOVERFLOW
 *)
bi
->
da
)->
pgno
)) != 0)

402 

;

403 
pgno
 = 
bi
->pgno;

405 
P_IRECNO
:

406 
pgno
 = 
	`GET_RINTERNAL
(
dbp
, 

, 0)->pgno;

409 

;

413 i((
t
 =

414 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_WRITE
, 0, &
c_lock
)) != 0)

415 

;

416 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
txn
,

417 
DB_MPOOL_DIRTY
, &
chd
)) != 0)

418 

;

421 i(
	`DBC_LOGGING
(
dbc
)) {

422 
	`memt
(&
a
, 0, (a));

423 
a
.
da
 = 
chd
;

424 
a
.
size
 = 
dbp
->
pgsize
;

425 
	`memt
(&
b
, 0, (b));

426 
b
.
da
 = 
	`P_ENTRY
(
dbp
, 

, 0);

427 
b
.
size
 = 
	`TYPE
(

=
P_IRECNO
 ? 
RINTERNAL_SIZE
 :

428 
	`BINTERNAL_SIZE
(((
BINTERNAL
 *)
b
.
da
)->
n
);

429 i((
t
 = 
	`__bam_rl_log
(
dbp
, 
dbc
->
txn
,

430 &
chd
->
l
, 0, 
	`PGNO
(chd), &
a
, PGNO(

),

431 
	`RE_NREC
(

), &
b
, &->
l
)) != 0)

432 

;

434 
	`LSN_NOT_LOGGED
(
chd
->
l
);

447 
	`COMPQUIET
(
rt
, 0);

448 i(
	`F_ISSET
(

, 
C_RECNUM
&& 
	`LEVEL
(
chd
> 
LEAFLEVEL
)

449 
rt
 = 
	`RE_NREC
(

);

450 
	`memy
(

, 
chd
, 
dbp
->
pgsize
);

451 
	`PGNO
(


ro_pgno
;

452 i(
	`F_ISSET
(

, 
C_RECNUM
&& 
	`LEVEL
(
chd
> 
LEAFLEVEL
)

453 
	`RE_NREC_SET
(

, 
rt
);

456 i((
t
 = 
	`__bam__rl
(
dbc
, 
	`PGNO
(
chd
), 
ro_pgno
)) != 0)

457 

;

464 i((
t
 = 
	`__db_
(
dbc
, 
chd
)) != 0) {

465 
chd
 = 
NULL
;

466 

;

468 
chd
 = 
NULL
;

471 

: 
de
 = 1;

473 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
p_lock
)!0 && 
t
 == 0)

474 
t
 = 
t_t
;

475 i(

 !
NULL
 &&

476 (
t_t
 = 
	`__memp_ut
(
mpf
,

477 

, 
dbc
->
iܙy
)!0 && 
t
 == 0)

478 
t
 = 
t_t
;

479 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
c_lock
)!0 && 
t
 == 0)

480 
t
 = 
t_t
;

481 i(
chd
 !
NULL
 &&

482 (
t_t
 = 
	`__memp_ut
(
mpf
,

483 
chd
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

484 
t
 = 
t_t
;

487  (
t
);

488 
	}
}

497 
	$__bam_lk
(
dbc
, 
g
, 
w_pgno
)

498 
DBC
 *
dbc
;

499 
PAGE
 *
g
;

500 
db_pgno_t
 
w_pgno
;

502 
DB
 *
dbp
;

503 
PAGE
 *

, *

;

504 
DB_LOCK
 
l
, 
l
;

505 
DB_LSN
 *
Ƣp
, *
p
, 
t_l
;

506 
DB_MPOOLFILE
 *
mpf
;

507 
t
, 
t_t
;

509 
dbp
 = 
dbc
->dbp;

510 

 = 

 = 
NULL
;

511 
	`LOCK_INIT
(
l
);

512 
	`LOCK_INIT
(
l
);

513 
Ƣp
 = 
p
 = 
NULL
;

514 
mpf
 = 
dbp
->mpf;

515 
t
 = 0;

522 i(
g
->
xt_pgno
 !
PGNO_INVALID
) {

523 i((
t
 = 
	`__db_lg
(
dbc
,

524 0, 
g
->
xt_pgno
, 
DB_LOCK_WRITE
, 0, &
l
)) != 0)

525 
r
;

526 i((
t
 = 
	`__memp_fg
(
mpf
, &
g
->
xt_pgno
, 
dbc
->
txn
,

527 
DB_MPOOL_DIRTY
, &

)) != 0) {

528 
t
 = 
	`__db_pgr
(
dbp
, 
g
->
xt_pgno
,et);

529 
r
;

531 
Ƣp
 = &

->
l
;

533 i(
g
->
ev_pgno
 !
PGNO_INVALID
) {

534 i((
t
 = 
	`__db_lg
(
dbc
,

535 0, 
g
->
ev_pgno
, 
DB_LOCK_WRITE
, 0, &
l
)) != 0)

536 
r
;

537 i((
t
 = 
	`__memp_fg
(
mpf
, &
g
->
ev_pgno
,

538 
dbc
->
txn
, 
DB_MPOOL_DIRTY
, &

)) != 0) {

539 
t
 = 
	`__db_pgr
(
dbp
, 
g
->
ev_pgno
,et);

540 
r
;

542 
p
 = &

->
l
;

546 i(
	`DBC_LOGGING
(
dbc
)) {

547 i((
t
 = 
	`__bam_lk_log
(
dbp
, 
dbc
->
txn
, &
t_l
, 0,

548 
g
->
pgno
, 
w_pgno
,ag->
ev_pgno
, 
p
,

549 
g
->
xt_pgno
, 
Ƣp
)) != 0)

550 
r
;

552 
	`LSN_NOT_LOGGED
(
t_l
);

553 i(

 !
NULL
)

554 

->
l
 = 
t_l
;

555 i(

 !
NULL
)

556 

->
l
 = 
t_l
;

561 i(

 !
NULL
) {

562 i(
w_pgno
 =
PGNO_INVALID
)

563 

->
ev_pgno
 = 
g
->prev_pgno;

565 

->
ev_pgno
 = 
w_pgno
;

566 
t
 = 
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
);

567 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
l
)!0 && 
t
 == 0)

568 
t
 = 
t_t
;

569 i(
t
 != 0)

570 
r
;

573 i(

 !
NULL
) {

574 i(
w_pgno
 =
PGNO_INVALID
)

575 

->
xt_pgno
 = 
g
->next_pgno;

577 

->
xt_pgno
 = 
w_pgno
;

578 
t
 = 
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
);

579 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
l
)!0 && 
t
 == 0)

580 
t
 = 
t_t
;

581 i(
t
 != 0)

582 
r
;

586 
r
: i(

 !
NULL
)

587 ()
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
);

588 ()
	`__TLPUT
(
dbc
, 
l
);

589 i(

 !
NULL
)

590 ()
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
);

591 ()
	`__TLPUT
(
dbc
, 
l
);

592  (
t
);

593 
	}
}

602 
	$__bam_pupde
(
dbc
, 
g
)

603 
DBC
 *
dbc
;

604 
PAGE
 *
g
;

606 
BTREE_CURSOR
 *

;

607 
DB_ENV
 *
dbv
;

608 
EPG
 *
g
;

609 
t
;

611 
dbv
 = 
dbc
->
dbp
->dbenv;

612 

 = (
BTREE_CURSOR
 *)
dbc
->

;

613 
t
 = 0;

621 
g
 = &

->
c
[-1];pg >->

;pg--) {

622 i((
t
 = 
	`__memp_dty
(
dbc
->
dbp
->
mpf
,

623 &
g
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

624  (
t
);

625 i((
t
 = 
	`__bam_dem
(
dbc
, 
g
->
ge
,pg->
dx
)) != 0)

626  (
t
);

627 
g
->
dx
--;

628 i((
t
 = 
	`__bam_p
(
dbc
, 
g
, 0,

629 
g
, 
g
[1].
ge
, 
BPI_NORECNUM
)) != 0) {

630 i(
t
 =
DB_NEEDSPLIT
) {

632 
	`__db_rx
(
dbv
,

634 
dbc
->
dbp
->
ame
, (
u_lg
)
	`PGNO
(
g
->
ge
));

635 
t
 = 
	`__db_nic
(
dbv
, 
EINVAL
);

637  (
t
);

640  (
t
);

641 
	}
}

	@../btree/bt_method.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/qam.h
"

16 
__bam_t_bt_mkey
 
__P
((
DB
 *, 
u_t32_t
));

17 
__bam_t_bt_efix


18 
__P
((
DB
 *, 
	$size_t
(*)(
DB
 *, cڡ 
DBT
 *, const DBT *)));

19 
__m_g__dim
 
	`__P
((
DB
 *, *));

20 
__m_t__dim
 
	`__P
((
DB
 *, ));

21 
__m_t__n
 
	`__P
((
DB
 *, 
u_t32_t
));

22 
__m_t__d
 
	`__P
((
DB
 *, ));

23 
__m_g__sour
 
	`__P
((
DB
 *, const **));

24 
__m_t__sour
 
	`__P
((
DB
 *, const *));

33 
	$__bam_db_
(
dbp
)

34 
DB
 *
dbp
;

36 
BTREE
 *
t
;

37 
t
;

40 i((
t
 = 
	`__os_oc
(
dbp
->
dbv
, 1, (
BTREE
), &
t
)) != 0)

41  (
t
);

42 
dbp
->
bt_
 = 
t
;

44 
t
->
bt_mkey
 = 
DEFMINKEYPAGE
;

45 
t
->
bt_com
 = 
__bam_defcmp
;

46 
t
->
bt_efix
 = 
__bam_defx
;

48 
dbp
->
t_bt_com
 = 
__bam_t_bt_com
;

49 
dbp
->
g_bt_mkey
 = 
__bam_g_bt_mkey
;

50 
dbp
->
t_bt_mkey
 = 
__bam_t_bt_mkey
;

51 
dbp
->
t_bt_efix
 = 
__bam_t_bt_efix
;

53 
t
->
_d
 = ' ';

54 
t
->
_dim
 = '\n';

55 
t
->
_eof
 = 1;

57 
dbp
->
g__dim
 = 
__m_g__dim
;

58 
dbp
->
t__dim
 = 
__m_t__dim
;

59 
dbp
->
g__n
 = 
__m_g__n
;

60 
dbp
->
t__n
 = 
__m_t__n
;

61 
dbp
->
g__d
 = 
__m_g__d
;

62 
dbp
->
t__d
 = 
__m_t__d
;

63 
dbp
->
g__sour
 = 
__m_g__sour
;

64 
dbp
->
t__sour
 = 
__m_t__sour
;

67 
	}
}

76 
	$__bam_db_o
(
dbp
)

77 
DB
 *
dbp
;

79 
BTREE
 *
t
;

81 i((
t
 = 
dbp
->
bt_
=
NULL
)

85 i(
t
->
_
 !
NULL
)

86 ()
	`fo
(
t
->
_
);

89 i(
t
->
_sour
 !
NULL
)

90 
	`__os_
(
dbp
->
dbv
, 
t
->
_sour
);

92 
	`__os_
(
dbp
->
dbv
, 
t
);

93 
dbp
->
bt_
 = 
NULL
;

96 
	}
}

105 
	$__bam_m_ags
(
dbp
, 
ag
, 
outag
)

106 
DB
 *
dbp
;

107 
u_t32_t
 *
ag
, *
outag
;

109 
	`COMPQUIET
(
dbp
, 
NULL
);

111 i(
	`FLD_ISSET
(*
ag
, 
DB_DUP
)) {

112 
	`FLD_SET
(*
outag
, 
DB_AM_DUP
);

113 
	`FLD_CLR
(*
ag
, 
DB_DUP
);

115 i(
	`FLD_ISSET
(*
ag
, 
DB_DUPSORT
)) {

116 
	`FLD_SET
(*
outag
, 
DB_AM_DUP
 | 
DB_AM_DUPSORT
);

117 
	`FLD_CLR
(*
ag
, 
DB_DUPSORT
);

119 i(
	`FLD_ISSET
(*
ag
, 
DB_RECNUM
)) {

120 
	`FLD_SET
(*
outag
, 
DB_AM_RECNUM
);

121 
	`FLD_CLR
(*
ag
, 
DB_RECNUM
);

123 i(
	`FLD_ISSET
(*
ag
, 
DB_REVSPLITOFF
)) {

124 
	`FLD_SET
(*
outag
, 
DB_AM_REVSPLITOFF
);

125 
	`FLD_CLR
(*
ag
, 
DB_REVSPLITOFF
);

127 
	}
}

136 
	$__bam_t_ags
(
dbp
, 
ag
)

137 
DB
 *
dbp
;

138 
u_t32_t
 *
ag
;

140 
u_t32_t
 
ags
;

142 
ags
 = *
ag
;

143 i(
	`LF_ISSET
(
DB_DUP
 | 
DB_DUPSORT
 | 
DB_RECNUM
 | 
DB_REVSPLITOFF
))

144 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_flags");

150 i(
	`LF_ISSET
(
DB_DUP
 | 
DB_DUPSORT
))

151 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
 | 
DB_OK_HASH
);

153 i(
	`LF_ISSET
(
DB_RECNUM
 | 
DB_REVSPLITOFF
))

154 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

157 i(
	`LF_ISSET
(
DB_DUP
 | 
DB_DUPSORT
&& 
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
))

158 
comt
;

161 i(
	`LF_ISSET
(
DB_RECNUM
&& 
	`F_ISSET
(
dbp
, 
DB_AM_DUP
))

162 
comt
;

164 i(
	`LF_ISSET
(
DB_DUPSORT
&& 
dbp
->
dup_com
 =
NULL
)

165 
dbp
->
dup_com
 = 
__bam_defcmp
;

167 
	`__bam_m_ags
(
dbp
, 
ag
, &dbp->
ags
);

170 
comt
:

171  (
	`__db_
(
dbp
->
dbv
, "DB->set_flags", 1));

172 
	}
}

182 
	$__bam_t_bt_com
(
dbp
, 
func
)

183 
DB
 *
dbp
;

184 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

186 
BTREE
 *
t
;

188 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_bt_compare");

189 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

191 
t
 = 
dbp
->
bt_
;

197 
t
->
bt_com
 = 
func
;

198 i(
t
->
bt_efix
 =
__bam_defx
)

199 
t
->
bt_efix
 = 
NULL
;

202 
	}
}

211 
	$__bam_g_bt_mkey
(
dbp
, 
bt_mkeyp
)

212 
DB
 *
dbp
;

213 
u_t32_t
 *
bt_mkeyp
;

215 
BTREE
 *
t
;

217 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

219 
t
 = 
dbp
->
bt_
;

220 *
bt_mkeyp
 = 
t
->
bt_mkey
;

222 
	}
}

229 
	$__bam_t_bt_mkey
(
dbp
, 
bt_mkey
)

230 
DB
 *
dbp
;

231 
u_t32_t
 
bt_mkey
;

233 
BTREE
 *
t
;

235 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_bt_minkey");

236 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

238 
t
 = 
dbp
->
bt_
;

240 i(
bt_mkey
 < 2) {

241 
	`__db_rx
(
dbp
->
dbv
, "minimum bt_minkey value is 2");

242  (
EINVAL
);

245 
t
->
bt_mkey
 = bt_minkey;

247 
	}
}

254 
	$__bam_t_bt_efix
(
dbp
, 
func
)

255 
DB
 *
dbp
;

256 
	$size_t
 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

258 
BTREE
 *
t
;

260 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_bt_prefix");

261 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

263 
t
 = 
dbp
->
bt_
;

265 
t
->
bt_efix
 = 
func
;

267 
	}
}

276 
	$__m_m_ags
(
dbp
, 
ag
, 
outag
)

277 
DB
 *
dbp
;

278 
u_t32_t
 *
ag
, *
outag
;

280 
	`COMPQUIET
(
dbp
, 
NULL
);

282 i(
	`FLD_ISSET
(*
ag
, 
DB_RENUMBER
)) {

283 
	`FLD_SET
(*
outag
, 
DB_AM_RENUMBER
);

284 
	`FLD_CLR
(*
ag
, 
DB_RENUMBER
);

286 i(
	`FLD_ISSET
(*
ag
, 
DB_SNAPSHOT
)) {

287 
	`FLD_SET
(*
outag
, 
DB_AM_SNAPSHOT
);

288 
	`FLD_CLR
(*
ag
, 
DB_SNAPSHOT
);

290 
	}
}

299 
	$__m_t_ags
(
dbp
, 
ag
)

300 
DB
 *
dbp
;

301 
u_t32_t
 *
ag
;

303 
u_t32_t
 
ags
;

305 
ags
 = *
ag
;

306 i(
	`LF_ISSET
(
DB_RENUMBER
 | 
DB_SNAPSHOT
)) {

307 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_flags");

308 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

311 
	`__m_m_ags
(
dbp
, 
ag
, &dbp->
ags
);

313 
	}
}

320 
	$__m_g__dim
(
dbp
, 
_dimp
)

321 
DB
 *
dbp
;

322 *
_dimp
;

324 
BTREE
 *
t
;

326 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

327 
t
 = 
dbp
->
bt_
;

328 *
_dimp
 = 
t
->
_dim
;

330 
	}
}

337 
	$__m_t__dim
(
dbp
, 
_dim
)

338 
DB
 *
dbp
;

339 
_dim
;

341 
BTREE
 *
t
;

343 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_re_delim");

344 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

346 
t
 = 
dbp
->
bt_
;

348 
t
->
_dim
 =e_delim;

349 
	`F_SET
(
dbp
, 
DB_AM_DELIMITER
);

352 
	}
}

361 
	$__m_g__n
(
dbp
, 
_
)

362 
DB
 *
dbp
;

363 
u_t32_t
 *
_
;

365 
BTREE
 *
t
;

366 
QUEUE
 *
q
;

368 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_QUEUE
 | 
DB_OK_RECNO
);

377 i(
dbp
->
ty
 =
DB_QUEUE
) {

378 
q
 = 
dbp
->
q_
;

379 *
_
 = 
q
->
_n
;

381 
t
 = 
dbp
->
bt_
;

382 *
_
 = 
t
->
_n
;

386 
	}
}

393 
	$__m_t__n
(
dbp
, 
_n
)

394 
DB
 *
dbp
;

395 
u_t32_t
 
_n
;

397 
BTREE
 *
t
;

398 
QUEUE
 *
q
;

400 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_re_len");

401 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_QUEUE
 | 
DB_OK_RECNO
);

403 
t
 = 
dbp
->
bt_
;

404 
t
->
_n
 =e_len;

406 
q
 = 
dbp
->
q_
;

407 
q
->
_n
 =e_len;

409 
	`F_SET
(
dbp
, 
DB_AM_FIXEDLEN
);

412 
	}
}

421 
	$__m_g__d
(
dbp
, 
_dp
)

422 
DB
 *
dbp
;

423 *
_dp
;

425 
BTREE
 *
t
;

426 
QUEUE
 *
q
;

428 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_QUEUE
 | 
DB_OK_RECNO
);

437 i(
dbp
->
ty
 =
DB_QUEUE
) {

438 
q
 = 
dbp
->
q_
;

439 *
_dp
 = 
q
->
_d
;

441 
t
 = 
dbp
->
bt_
;

442 *
_dp
 = 
t
->
_d
;

446 
	}
}

453 
	$__m_t__d
(
dbp
, 
_d
)

454 
DB
 *
dbp
;

455 
_d
;

457 
BTREE
 *
t
;

458 
QUEUE
 *
q
;

460 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_re_pad");

461 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_QUEUE
 | 
DB_OK_RECNO
);

463 
t
 = 
dbp
->
bt_
;

464 
t
->
_d
 =e_pad;

466 
q
 = 
dbp
->
q_
;

467 
q
->
_d
 =e_pad;

469 
	`F_SET
(
dbp
, 
DB_AM_PAD
);

472 
	}
}

479 
	$__m_g__sour
(
dbp
, 
_sourp
)

480 
DB
 *
dbp
;

481 cڡ **
_sourp
;

483 
BTREE
 *
t
;

485 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

487 
t
 = 
dbp
->
bt_
;

488 *
_sourp
 = 
t
->
_sour
;

490 
	}
}

497 
	$__m_t__sour
(
dbp
, 
_sour
)

498 
DB
 *
dbp
;

499 cڡ *
_sour
;

501 
BTREE
 *
t
;

503 
	`DB_ILLEGAL_AFTER_OPEN
(
dbp
, "DB->set_re_source");

504 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

506 
t
 = 
dbp
->
bt_
;

508  (
	`__os_rdup
(
dbp
->
dbv
, 
_sour
, &
t
->re_source));

509 
	}
}

	@../btree/bt_open.c

44 
	~"db_cfig.h
"

46 
	~"db_t.h
"

47 
	~"dbc/yo.h
"

48 
	~"dbc/db_ge.h
"

49 
	~"dbc/db_sw.h
"

50 
	~"dbc/b.h
"

51 
	~"dbc/lock.h
"

52 
	~"dbc/log.h
"

53 
	~"dbc/mp.h
"

54 
	~"dbc/f.h
"

56 
__bam__ma
 
__P
((
DB
 *, 
BTMETA
 *, 
db_pgno_t
, 
DB_LSN
 *));

66 
	$__bam_ݒ
(
dbp
, 
txn
, 
me
, 
ba_pgno
, 
ags
)

67 
DB
 *
dbp
;

68 
DB_TXN
 *
txn
;

69 cڡ *
me
;

70 
db_pgno_t
 
ba_pgno
;

71 
u_t32_t
 
ags
;

73 
BTREE
 *
t
;

75 
	`COMPQUIET
(
me
, 
NULL
);

76 
t
 = 
dbp
->
bt_
;

83 i(
t
->
bt_com
 =
__bam_defcmp
 &&->
bt_efix
 !
__bam_defx
) {

84 
	`__db_rx
(
dbp
->
dbv
,

86  (
EINVAL
);

93 i(
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
t
->
bt_mkey
, dbp->
pgsize
) >

94 
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
DEFMINKEYPAGE
, dbp->
pgsize
)) {

95 
	`__db_rx
(
dbp
->
dbv
,

97 (
u_lg
)
t
->
bt_mkey
, (u_lg)
dbp
->
pgsize
);

98  (
EINVAL
);

102  (
	`__bam_ad_ro
(
dbp
, 
txn
, 
ba_pgno
, 
ags
));

103 
	}
}

111 
	$__bam_machk
(
dbp
, 
me
, 
btm
)

112 
DB
 *
dbp
;

113 cڡ *
me
;

114 
BTMETA
 *
btm
;

116 
DB_ENV
 *
dbv
;

117 
u_t32_t
 
vs
;

118 
t
;

120 
dbv
 = 
dbp
->dbenv;

126 
vs
 = 
btm
->
dbma
.
vsi
;

127 i(
	`F_ISSET
(
dbp
, 
DB_AM_SWAP
))

128 
	`M_32_SWAP
(
vs
);

129 
vs
) {

132 
	`__db_rx
(
dbv
,

134 
me
, (
u_lg
)
vs
);

135  (
DB_OLD_VERSION
);

140 
	`__db_rx
(
dbv
,

141 "%s: unsu܋d b vsi: %lu", 
me
, (
u_lg
)
vs
);

142  (
EINVAL
);

146 i(
	`F_ISSET
(
dbp
, 
DB_AM_SWAP
&& (
t
 = 
	`__bam_msw
((
PAGE
 *)
btm
)) != 0)

147  (
t
);

153 i((
t
 =

154 
	`__db_fchk
(
dbv
, "DB->ݒ", 
btm
->
dbma
.
ags
, 
BTM_MASK
)) != 0)

155  (
t
);

157 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_RECNO
)) {

158 i(
dbp
->
ty
 =
DB_BTREE
)

159 
wrg_ty
;

160 
dbp
->
ty
 = 
DB_RECNO
;

161 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

163 i(
dbp
->
ty
 =
DB_RECNO
)

164 
wrg_ty
;

165 
dbp
->
ty
 = 
DB_BTREE
;

166 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

169 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_DUP
))

170 
	`F_SET
(
dbp
, 
DB_AM_DUP
);

172 i(
	`F_ISSET
(
dbp
, 
DB_AM_DUP
)) {

173 
	`__db_rx
(
dbv
,

175 
me
);

176  (
EINVAL
);

179 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_RECNUM
)) {

180 i(
dbp
->
ty
 !
DB_BTREE
)

181 
wrg_ty
;

182 
	`F_SET
(
dbp
, 
DB_AM_RECNUM
);

184 i((
t
 = 
	`__db_fcchk
(
dbv
,

185 "DB->ݒ", 
dbp
->
ags
, 
DB_AM_DUP
, 
DB_AM_RECNUM
)) != 0)

186  (
t
);

188 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
)) {

189 
	`__db_rx
(
dbv
,

191 
me
);

192  (
EINVAL
);

195 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_FIXEDLEN
)) {

196 i(
dbp
->
ty
 !
DB_RECNO
)

197 
wrg_ty
;

198 
	`F_SET
(
dbp
, 
DB_AM_FIXEDLEN
);

200 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
)) {

201 
	`__db_rx
(
dbv
,

203 
me
);

204  (
EINVAL
);

207 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_RENUMBER
)) {

208 i(
dbp
->
ty
 !
DB_RECNO
)

209 
wrg_ty
;

210 
	`F_SET
(
dbp
, 
DB_AM_RENUMBER
);

212 i(
	`F_ISSET
(
dbp
, 
DB_AM_RENUMBER
)) {

213 
	`__db_rx
(
dbv
,

215 
me
);

216  (
EINVAL
);

219 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_SUBDB
))

220 
	`F_SET
(
dbp
, 
DB_AM_SUBDB
);

222 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
)) {

223 
	`__db_rx
(
dbv
,

225 
me
);

226  (
EINVAL
);

229 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_DUPSORT
)) {

230 i(
dbp
->
dup_com
 =
NULL
)

231 
dbp
->
dup_com
 = 
__bam_defcmp
;

232 
	`F_SET
(
dbp
, 
DB_AM_DUPSORT
);

234 i(
dbp
->
dup_com
 !
NULL
) {

235 
	`__db_rx
(
dbv
,

237 
me
);

238  (
EINVAL
);

242 
dbp
->
pgsize
 = 
btm
->
dbma
.
gesize
;

245 
	`memy
(
dbp
->
feid
, 
btm
->
dbma
.
uid
, 
DB_FILE_ID_LEN
);

249 
wrg_ty
:

250 i(
dbp
->
ty
 =
DB_BTREE
)

251 
	`__db_rx
(
dbv
,

254 
	`__db_rx
(
dbv
,

256  (
EINVAL
);

257 
	}
}

266 
	$__bam_ad_ro
(
dbp
, 
txn
, 
ba_pgno
, 
ags
)

267 
DB
 *
dbp
;

268 
DB_TXN
 *
txn
;

269 
db_pgno_t
 
ba_pgno
;

270 
u_t32_t
 
ags
;

272 
BTMETA
 *
ma
;

273 
BTREE
 *
t
;

274 
DBC
 *
dbc
;

275 
DB_LOCK
 
mock
;

276 
DB_MPOOLFILE
 *
mpf
;

277 
t
, 
t_t
;

279 
	`COMPQUIET
(
ags
, 0);

281 
ma
 = 
NULL
;

282 
t
 = 
dbp
->
bt_
;

283 
	`LOCK_INIT
(
mock
);

284 
mpf
 = 
dbp
->mpf;

285 
t
 = 0;

288 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 0)) != 0)

289  (
t
);

292 i((
t
 =

293 
	`__db_lg
(
dbc
, 0, 
ba_pgno
, 
DB_LOCK_READ
, 0, &
mock
)) != 0)

294 
r
;

295 i((
t
 = 
	`__memp_fg
(
mpf
, &
ba_pgno
, 
dbc
->
txn
, 0, &
ma
)) != 0)

296 
r
;

306 i(
ma
->
dbma
.
magic
 =
DB_BTREEMAGIC
) {

307 
t
->
bt_mkey
 = 
ma
->
mkey
;

308 
t
->
_d
 = ()
ma
->re_pad;

309 
t
->
_n
 = 
ma
->re_len;

311 
t
->
bt_ma
 = 
ba_pgno
;

312 
t
->
bt_ro
 = 
ma
->
ro
;

314 
	`DB_ASSERT
(
dbp
->
dbv
,

315 
	`IS_RECOVERING
(
dbp
->
dbv
|| 
	`F_ISSET
(dbp, 
DB_AM_RECOVER
));

327 
t
->
bt_gno
 = 
PGNO_INVALID
;

329 
r
:

330 i(
ma
 !
NULL
 &&

331 (
t_t
 = 
	`__memp_ut
(
mpf
, 
ma
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

332 
t
 = 
t_t
;

333 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

334 
t
 = 
t_t
;

336 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

337 
t
 = 
t_t
;

338  (
t
);

339 
	}
}

348 
	$__bam__ma
(
dbp
, 
ma
, 
pgno
, 
lp
)

349 
DB
 *
dbp
;

350 
BTMETA
 *
ma
;

351 
db_pgno_t
 
pgno
;

352 
DB_LSN
 *
lp
;

354 
DB_ENV
 *
dbv
;

355 
BTREE
 *
t
;

357 
dbv
 = 
dbp
->dbenv;

358 
t
 = 
dbp
->
bt_
;

360 
	`memt
(
ma
, 0, (
BTMETA
));

361 
ma
->
dbma
.
l
 = *
lp
;

362 
ma
->
dbma
.
pgno
 =gno;

363 
ma
->
dbma
.
magic
 = 
DB_BTREEMAGIC
;

364 
ma
->
dbma
.
vsi
 = 
DB_BTREEVERSION
;

365 
ma
->
dbma
.
gesize
 = 
dbp
->
pgsize
;

366 i(
	`F_ISSET
(
dbp
, 
DB_AM_CHKSUM
))

367 
	`FLD_SET
(
ma
->
dbma
.
maags
, 
DBMETA_CHKSUM
);

368 i(
	`F_ISSET
(
dbp
, 
DB_AM_ENCRYPT
)) {

369 
ma
->
dbma
.
y_g
 =

370 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
g
;

371 
	`DB_ASSERT
(
dbv
, 
ma
->
dbma
.
y_g
 != 0);

372 
ma
->
yo_magic
 = ma->
dbma
.
magic
;

374 
ma
->
dbma
.
ty
 = 
P_BTREEMETA
;

375 
ma
->
dbma
.

 = 
PGNO_INVALID
;

376 
ma
->
dbma
.
ϡ_pgno
 = 
pgno
;

377 i(
	`F_ISSET
(
dbp
, 
DB_AM_DUP
))

378 
	`F_SET
(&
ma
->
dbma
, 
BTM_DUP
);

379 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
))

380 
	`F_SET
(&
ma
->
dbma
, 
BTM_FIXEDLEN
);

381 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
))

382 
	`F_SET
(&
ma
->
dbma
, 
BTM_RECNUM
);

383 i(
	`F_ISSET
(
dbp
, 
DB_AM_RENUMBER
))

384 
	`F_SET
(&
ma
->
dbma
, 
BTM_RENUMBER
);

385 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
))

386 
	`F_SET
(&
ma
->
dbma
, 
BTM_SUBDB
);

387 i(
dbp
->
dup_com
 !
NULL
)

388 
	`F_SET
(&
ma
->
dbma
, 
BTM_DUPSORT
);

389 i(
dbp
->
ty
 =
DB_RECNO
)

390 
	`F_SET
(&
ma
->
dbma
, 
BTM_RECNO
);

391 
	`memy
(
ma
->
dbma
.
uid
, 
dbp
->
feid
, 
DB_FILE_ID_LEN
);

393 
ma
->
mkey
 = 
t
->
bt_mkey
;

394 
ma
->
_n
 = 
t
->re_len;

395 
ma
->
_d
 = (
u_t32_t
)
t
->re_pad;

396 
	}
}

411 
	$__bam_w_fe
(
dbp
, 
txn
, 
fhp
, 
me
)

412 
DB
 *
dbp
;

413 
DB_TXN
 *
txn
;

414 
DB_FH
 *
fhp
;

415 cڡ *
me
;

417 
BTMETA
 *
ma
;

418 
DB_ENV
 *
dbv
;

419 
DB_LSN
 
l
;

420 
DB_MPOOLFILE
 *
mpf
;

421 
DB_PGINFO
 
pgfo
;

422 
DBT
 
pdbt
;

423 
PAGE
 *
ro
;

424 
db_pgno_t
 
pgno
;

425 
t
, 
t_t
;

426 *
buf
;

428 
dbv
 = 
dbp
->dbenv;

429 
mpf
 = 
dbp
->mpf;

430 
ro
 = 
NULL
;

431 
ma
 = 
NULL
;

432 
buf
 = 
NULL
;

434 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
)) {

436 
pgno
 = 
PGNO_BASE_MD
;

437 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
txn
,

438 
DB_MPOOL_CREATE
 | 
DB_MPOOL_DIRTY
, &
ma
)) != 0)

439  (
t
);

440 
	`LSN_NOT_LOGGED
(
l
);

441 
	`__bam__ma
(
dbp
, 
ma
, 
PGNO_BASE_MD
, &
l
);

442 
ma
->
ro
 = 1;

443 
ma
->
dbma
.
ϡ_pgno
 = 1;

444 i((
t
 =

445 
	`__db_log_ge
(
dbp
, 
txn
, &
l
, 
pgno
, (
PAGE
 *)
ma
)) != 0)

446 
r
;

447 
t
 = 
	`__memp_ut
(
mpf
, 
ma
, 
dbp
->
iܙy
);

448 
ma
 = 
NULL
;

449 i(
t
 != 0)

450 
r
;

453 
pgno
 = 1;

454 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

455 
txn
, 
DB_MPOOL_CREATE
, &
ro
)) != 0)

456 
r
;

457 
	`P_INIT
(
ro
, 
dbp
->
pgsize
, 1, 
PGNO_INVALID
, PGNO_INVALID,

458 
LEAFLEVEL
, 
dbp
->
ty
 =
DB_RECNO
 ? 
P_LRECNO
 : 
P_LBTREE
);

459 
	`LSN_NOT_LOGGED
(
ro
->
l
);

460 i((
t
 =

461 
	`__db_log_ge
(
dbp
, 
txn
, &
ro
->
l
, 
pgno
,oot)) != 0)

462 
r
;

463 
t
 = 
	`__memp_ut
(
mpf
, 
ro
, 
dbp
->
iܙy
);

464 
ro
 = 
NULL
;

465 i(
t
 != 0)

466 
r
;

468 
	`memt
(&
pdbt
, 0, (pdbt));

471 
pgfo
.
db_gesize
 = 
dbp
->
pgsize
;

472 
pgfo
.
ags
 =

473 
	`F_ISSET
(
dbp
, (
DB_AM_CHKSUM
 | 
DB_AM_ENCRYPT
 | 
DB_AM_SWAP
));

474 
pgfo
.
ty
 = 
dbp
->type;

475 
pdbt
.
da
 = &
pgfo
;

476 
pdbt
.
size
 = (
pgfo
);

477 i((
t
 = 
	`__os_oc
(
dbv
, 1, 
dbp
->
pgsize
, &
buf
)) != 0)

478  (
t
);

479 
ma
 = (
BTMETA
 *)
buf
;

480 
	`LSN_NOT_LOGGED
(
l
);

481 
	`__bam__ma
(
dbp
, 
ma
, 
PGNO_BASE_MD
, &
l
);

482 
ma
->
ro
 = 1;

483 
ma
->
dbma
.
ϡ_pgno
 = 1;

484 i((
t
 = 
	`__db_pgout
(
dbv
, 
PGNO_BASE_MD
, 
ma
, &
pdbt
)) != 0)

485 
r
;

486 i((
t
 = 
	`__f_wre
(
dbv
, 
txn
, 
me
, 
DB_APP_DATA
, 
fhp
,

487 
dbp
->
pgsize
, 0, 0, 
buf
, dbp->pgsize, 1, 
	`F_ISSET
(

488 
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_LOG_NOT_DURABLE
 : 0)) != 0)

489 
r
;

490 
ma
 = 
NULL
;

493 #ifde
DIAGNOSTIC


494 
	`memt
(
buf
, 
CLEAR_BYTE
, 
dbp
->
pgsize
);

496 
ro
 = (
PAGE
 *)
buf
;

497 
	`P_INIT
(
ro
, 
dbp
->
pgsize
, 1, 
PGNO_INVALID
, PGNO_INVALID,

498 
LEAFLEVEL
, 
dbp
->
ty
 =
DB_RECNO
 ? 
P_LRECNO
 : 
P_LBTREE
);

499 
	`LSN_NOT_LOGGED
(
ro
->
l
);

500 i((
t
 = 
	`__db_pgout
(
dbv
, 
ro
->
pgno
,o, &
pdbt
)) != 0)

501 
r
;

502 i((
t
 = 
	`__f_wre
(
dbv
, 
txn
, 
me
, 
DB_APP_DATA
, 
fhp
,

503 
dbp
->
pgsize
, 1, 0, 
buf
, dbp->pgsize, 1, 
	`F_ISSET
(

504 
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_LOG_NOT_DURABLE
 : 0)) != 0)

505 
r
;

506 
ro
 = 
NULL
;

509 
r
: i(
buf
 !
NULL
)

510 
	`__os_
(
dbv
, 
buf
);

512 i(
ma
 !
NULL
 &&

513 (
t_t
 = 
	`__memp_ut
(
mpf
,

514 
ma
, 
dbp
->
iܙy
)!0 && 
t
 == 0)

515 
t
 = 
t_t
;

516 i(
ro
 !
NULL
 &&

517 (
t_t
 = 
	`__memp_ut
(
mpf
,

518 
ro
, 
dbp
->
iܙy
)!0 && 
t
 == 0)

519 
t
 = 
t_t
;

521  (
t
);

522 
	}
}

531 
	$__bam_w_subdb
(
mdbp
, 
dbp
, 
txn
)

532 
DB
 *
mdbp
, *
dbp
;

533 
DB_TXN
 *
txn
;

535 
BTMETA
 *
ma
;

536 
DBC
 *
dbc
;

537 
DB_ENV
 *
dbv
;

538 
DB_LOCK
 
mock
;

539 
DB_LSN
 
l
;

540 
DB_MPOOLFILE
 *
mpf
;

541 
PAGE
 *
ro
;

542 
t
, 
t_t
;

544 
dbv
 = 
mdbp
->dbenv;

545 
mpf
 = 
mdbp
->mpf;

546 
dbc
 = 
NULL
;

547 
ma
 = 
NULL
;

548 
ro
 = 
NULL
;

550 i((
t
 = 
	`__db_curs
(
mdbp
, 
txn
,

551 &
dbc
, 
	`CDB_LOCKING
(
dbv
? 
DB_WRITECURSOR
 : 0)) != 0)

552  (
t
);

555 i((
t
 = 
	`__db_lg
(
dbc
,

556 0, 
dbp
->
ma_pgno
, 
DB_LOCK_WRITE
, 0, &
mock
)) != 0)

557 
r
;

558 i((
t
 = 
	`__memp_fg
(
mpf
, &
dbp
->
ma_pgno
,

559 
txn
, 
DB_MPOOL_CREATE
, &
ma
)) != 0)

560 
r
;

563 
l
 = 
ma
->
dbma
.lsn;

564 
	`__bam__ma
(
dbp
, 
ma
, dbp->
ma_pgno
, &
l
);

565 i((
t
 = 
	`__db_log_ge
(
mdbp
,

566 
txn
, &
ma
->
dbma
.
l
, 
dbp
->
ma_pgno
, (
PAGE
 *)meta)) != 0)

567 
r
;

570 i((
t
 = 
	`__db_w
(
dbc
,

571 
dbp
->
ty
 =
DB_RECNO
 ? 
P_LRECNO
 : 
P_LBTREE
, &
ro
)) != 0)

572 
r
;

573 
ro
->
v
 = 
LEAFLEVEL
;

575 i(
	`DBENV_LOGGING
(
dbv
) &&

576 #i!
	`defed
(
DEBUG_WOP
)

577 
txn
 !
NULL
 &&

580 (
t
 = 
	`__bam_ro_log
(
mdbp
, 
txn
, &
ma
->
dbma
.
l
, 0,

581 
ma
->
dbma
.
pgno
, 
ro
->pgno, &ma->dbma.
l
)) != 0)

582 
r
;

584 
ma
->
ro
 =o->
pgno
;

585 i((
t
 =

586 
	`__db_log_ge
(
mdbp
, 
txn
, &
ro
->
l
,o->
pgno
,oot)) != 0)

587 
r
;

590 i((
t
 = 
	`__memp_ut
(
mpf
, 
ma
, 
dbc
->
iܙy
)) != 0)

591 
r
;

592 
ma
 = 
NULL
;

593 i((
t
 = 
	`__memp_ut
(
mpf
, 
ro
, 
dbc
->
iܙy
)) != 0)

594 
r
;

595 
ro
 = 
NULL
;

596 
r
:

597 i(
ma
 !
NULL
)

598 i((
t_t
 = 
	`__memp_ut
(
mpf
,

599 
ma
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

600 
t
 = 
t_t
;

601 i(
ro
 !
NULL
)

602 i((
t_t
 = 
	`__memp_ut
(
mpf
,

603 
ro
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

604 
t
 = 
t_t
;

605 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

606 
t
 = 
t_t
;

607 i(
dbc
 !
NULL
)

608 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

609 
t
 = 
t_t
;

610  (
t
);

611 
	}
}

	@../btree/bt_put.c

44 
	~"db_cfig.h
"

46 
	~"db_t.h
"

47 
	~"dbc/db_ge.h
"

48 
	~"dbc/b.h
"

49 
	~"dbc/mp.h
"

51 
__bam_bud


52 
__P
((
DBC
 *, 
u_t32_t
, 
DBT
 *, 
PAGE
 *, u_int32_t, u_int32_t));

53 
__bam_dup_check
 
__P
((
DBC
 *, 
u_t32_t
,

54 
PAGE
 *, 
u_t32_t
, u_t32_t, 
db_dx_t
 *));

55 
__bam_dup_cvt
 
__P
((
DBC
 *, 
PAGE
 *, 
u_t32_t
, u_int32_t));

56 
__bam_ovput


57 
__P
((
DBC
 *, 
u_t32_t
, 
db_pgno_t
, 
PAGE
 *, u_t32_t, 
DBT
 *));

58 
u_t32_t


59 
__bam_size
 
__P
((
DB
 *, 
u_t32_t
, 
DBT
 *, 
PAGE
 *, u_int32_t));

68 
	$__bam_iem
(
dbc
, 
key
, 
da
, 

, 
ags
)

69 
DBC
 *
dbc
;

70 
DBT
 *
key
, *
da
;

71 
u_t32_t
 

, 
ags
;

73 
DB_ENV
 *
dbv
;

74 
BKEYDATA
 *
bk
, 
bk_tmp
;

75 
BTREE
 *
t
;

76 
BTREE_CURSOR
 *

;

77 
DB
 *
dbp
;

78 
DBT
 
bk_hdr
, 
tdbt
;

79 
DB_MPOOLFILE
 *
mpf
;

80 
PAGE
 *
h
;

81 
db_dx_t
 
t
, 
dx
;

82 
u_t32_t
 
da_size
, 
have_bys
, 
ed_bys
, 
eded
, 
ges
, 
gea
;

83 
cmp
, 
bigkey
, 
bigda
, 
d
, 
dudju
;

84 
dc
, 
a
, 
t
, 
t_t
, 
was_ded
;

86 
	`COMPQUIET
(
t
, 0);

88 
dbp
 = 
dbc
->dbp;

89 
dbv
 = 
dbp
->dbenv;

90 
mpf
 = 
dbp
->mpf;

91 

 = (
BTREE_CURSOR
 *)
dbc
->

;

92 
t
 = 
dbp
->
bt_
;

93 
h
 = 

->
ge
;

94 
dx
 = 

->indx;

95 
d
 = 
dudju
 = 
a
 = 
was_ded
 = 0;

101 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
) &&

102 
	`F_ISSET
(
da
, 
DB_DBT_PARTIAL
&& da->
size
 !da->
dn
)

103  (
	`__db_c_
(
dbv
, 
da
->
size
, da->
dn
));

113 
da_size
 = 
	`F_ISSET
(
da
, 
DB_DBT_PARTIAL
) ?

114 
	`__bam_size
(
dbp
, 

, 
da
, 
h
, 
dx
: da->
size
;

115 
dc
 = 0;

116 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
)) {

117 i(
da_size
 > 
t
->
_n
)

118  (
	`__db_c_toobig
(
dbv
, 
da_size
, 
t
->
_n
));

121 i(!
	`LF_ISSET
(
BI_DELETED
&& 
da_size
 < 
t
->
_n
) {

122 
dc
 = 1;

123 
da_size
 = 
t
->
_n
;

131 i(
dc
 || 
	`F_ISSET
(
da
, 
DB_DBT_PARTIAL
)) {

132 
tdbt
 = *
da
;

133 i((
t
 =

134 
	`__bam_bud
(
dbc
, 

, &
tdbt
, 
h
, 
dx
, 
da_size
)) != 0)

135  (
t
);

136 
da
 = &
tdbt
;

146 i(

 =
DB_CURRENT
 && 
dbp
->
dup_com
 !
NULL
) {

147 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
da
, 
h
,

148 
dx
 + (
	`TYPE
(
h
=
P_LBTREE
 ? 
O_INDX
 : 0),

149 
dbp
->
dup_com
, &
cmp
)) != 0)

150  (
t
);

151 i(
cmp
 != 0) {

152 
	`__db_rx
(
dbv
,

154  (
EINVAL
);

162 
eded
 = 0;

163 
bigda
 = 
da_size
 > 

->
ovsize
;

164 

) {

165 
DB_KEYFIRST
:

167 
bigkey
 = 
key
->
size
 > 

->
ovsize
;

168 i(
bigkey
)

169 
eded
 +
BOVERFLOW_PSIZE
;

171 
eded
 +
	`BKEYDATA_PSIZE
(
key
->
size
);

172 i(
bigda
)

173 
eded
 +
BOVERFLOW_PSIZE
;

175 
eded
 +
	`BKEYDATA_PSIZE
(
da_size
);

177 
DB_AFTER
:

178 
DB_BEFORE
:

179 
DB_CURRENT
:

190 
bigkey
 = 0;

191 i(

 =
DB_CURRENT
) {

192 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
,

193 
dx
 + (
	`TYPE
(
h
=
P_LBTREE
 ? 
O_INDX
 : 0));

194 i(
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
)

195 
have_bys
 = 
	`BKEYDATA_PSIZE
(
bk
->
n
);

197 
have_bys
 = 
BOVERFLOW_PSIZE
;

198 
ed_bys
 = 0;

200 
have_bys
 = 0;

201 
ed_bys
 = (
db_dx_t
);

203 i(
bigda
)

204 
ed_bys
 +
BOVERFLOW_PSIZE
;

206 
ed_bys
 +
	`BKEYDATA_PSIZE
(
da_size
);

208 i(
have_bys
 < 
ed_bys
)

209 
eded
 +
ed_bys
 - 
have_bys
;

212  (
	`__db_unknown_ag
(
dbv
, "DB->put", 

));

216 i(
	`P_FREESPACE
(
dbp
, 
h
< 
eded
)

217  (
DB_NEEDSPLIT
);

223 i(
	`F_ISSET
(
dbp
, 
DB_AM_DUP
) &&

224 
	`TYPE
(
h
=
P_LBTREE
 && 

 !
DB_KEYFIRST
 &&

225 
	`P_FREESPACE
(
dbp
, 
h
- 
eded
 <dbp->
pgsize
 / 2 &&

226 
	`__bam_dup_check
(
dbc
, 

, 
h
, 
dx
, 
eded
, &
t
)) {

227 
ges
 = 1;

228 
dudju
 = 1;

230 
ges
 = 0;

237 i(
dbc
->
txn
 =
NULL
 && 
mpf
->
m
->
maxpgno
 != 0) {

238 
gea
 = 
	`P_MAXSPACE
(
dbp
, dbp->
pgsize
);

239 i(
bigda
)

240 
ges
 +((
da_size
 - 1/ 
gea
) + 1;

241 i(
bigkey
)

242 
ges
 +((
key
->
size
 - 1/ 
gea
) + 1;

244 i(
ges
 > (
mpf
->
m
->
maxpgno
 - mpf->m->
ϡ_pgno
))

245  (
	`__db_a_r
(
dbp
));

248 i((
t
 = 
	`__memp_dty
(
mpf
, &
h
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

249  (
t
);

250 i(

->
c
->
ge
 == cp->page)

251 

->
c
->
ge
 = 
h
;

252 

->
ge
 = 
h
;

263 

) {

264 
DB_KEYFIRST
:

265 i(
bigkey
) {

266 i((
t
 = 
	`__bam_ovput
(
dbc
,

267 
B_OVERFLOW
, 
PGNO_INVALID
, 
h
, 
dx
, 
key
)) != 0)

268  (
t
);

270 i((
t
 = 
	`__db_pem
(
dbc
, 
h
, 
dx
,

271 
	`BKEYDATA_SIZE
(
key
->
size
), 
NULL
, key)) != 0)

272  (
t
);

274 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
, 1)) != 0)

275  (
t
);

276 ++
dx
;

278 
DB_AFTER
:

279 i(
	`TYPE
(
h
=
P_LBTREE
) {

281 i((
t
 =

282 
	`__bam_adjdx
(
dbc
, 
h
, 
dx
 + 
P_INDX
, indx, 1)) != 0)

283  (
t
);

284 i((
t
 =

285 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
 + 
P_INDX
, 1)) != 0)

286  (
t
);

288 
dx
 += 3;

290 

->
dx
 += 2;

292 ++
dx
;

293 

->
dx
 += 1;

296 
DB_BEFORE
:

297 i(
	`TYPE
(
h
=
P_LBTREE
) {

299 i((
t
 = 
	`__bam_adjdx
(
dbc
, 
h
, 
dx
, indx, 1)) != 0)

300  (
t
);

301 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
, 1)) != 0)

302  (
t
);

304 ++
dx
;

307 
DB_CURRENT
:

315 i((
t
 = 
	`__bam__de
(
dbp
, 
	`PGNO
(
h
), 
dx
, 0, 
NULL
)) != 0)

316  (
t
);

318 i(
	`TYPE
(
h
=
P_LBTREE
)

319 ++
dx
;

320 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

329 i(
	`TYPE
(
h
=
P_LBTREE
 || TYPE(h=
P_LDUP
)

330 
was_ded
 = 
	`B_DISSET
(
bk
->
ty
);

341 i(
bigda
 || 
	`B_TYPE
(
bk
->
ty
!
B_KEYDATA
) {

342 i((
t
 = 
	`__bam_dem
(
dbc
, 
h
, 
dx
)) != 0)

343  (
t
);

344 
d
 = 1;

349 
a
 = 1;

352  (
	`__db_unknown_ag
(
dbv
, "DB->put", 

));

356 i(
bigda
) {

361 
	`DB_ASSERT
(
dbv
, !
	`LF_ISSET
(
BI_DELETED
));

362 
t
 = 
	`__bam_ovput
(
dbc
,

363 
B_OVERFLOW
, 
PGNO_INVALID
, 
h
, 
dx
, 
da
);

365 i(
	`LF_ISSET
(
BI_DELETED
)) {

366 
	`B_TSET_DELETED
(
bk_tmp
.
ty
, 
B_KEYDATA
);

367 
bk_tmp
.
n
 = 
da
->
size
;

368 
bk_hdr
.
da
 = &
bk_tmp
;

369 
bk_hdr
.
size
 = 
	`SSZA
(
BKEYDATA
, 
da
);

370 
t
 = 
	`__db_pem
(
dbc
, 
h
, 
dx
,

371 
	`BKEYDATA_SIZE
(
da
->
size
), &
bk_hdr
, data);

372 } i(
a
)

373 
t
 = 
	`__bam_rem
(
dbc
, 
h
, 
dx
, 
da
);

375 
t
 = 
	`__db_pem
(
dbc
, 
h
, 
dx
,

376 
	`BKEYDATA_SIZE
(
da
->
size
), 
NULL
, data);

378 i(
t
 != 0) {

379 i(
d
 =1 && (
t_t
 =

380 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
 + 1, -1)) != 0) {

381 
	`__db_r
(
dbv
, 
t_t
,

383  (
	`__db_nic
(
dbv
, 
t_t
));

385  (
t
);

392 i(

 !
DB_CURRENT
) {

393 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
, 1)) != 0)

394  (
t
);

395 

->
dx
 = 
	`TYPE
(
h
=
P_LBTREE
 ? indx - 
O_INDX
 : indx;

403 i(
	`F_ISSET
(

, 
C_RECNUM
&& (

 !
DB_CURRENT
 || 
was_ded
))

404 i((
t
 = 
	`__bam_adju
(
dbc
, 1)) != 0)

405  (
t
);

413 i(
dudju
 &&

414 (
t
 = 
	`__bam_dup_cvt
(
dbc
, 
h
, 
dx
 - 
O_INDX
, 
t
)) != 0)

415  (
t
);

418 i(
dbc
->
dbty
 =
DB_RECNO
)

419 
t
->
_modifd
 = 1;

421  (
t
);

422 
	}
}

428 
u_t32_t


429 
	$__bam_size
(
dbp
, 

, 
da
, 
h
, 
dx
)

430 
DB
 *
dbp
;

431 
u_t32_t
 

, 
dx
;

432 
DBT
 *
da
;

433 
PAGE
 *
h
;

435 
BKEYDATA
 *
bk
;

436 
u_t32_t
 
nbys
;

442 i(

 !
DB_CURRENT
)

443  (
da
->
doff
 + da->
size
);

449 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + (
	`TYPE
(h=
P_LBTREE
 ? 
O_INDX
 : 0));

450 
nbys
 =

451 
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 ? ((
BOVERFLOW
 *)bk)->

 : bk->
n
;

453  (
	`__db_size
(
nbys
, 
da
));

454 
	}
}

461 
	$__bam_bud
(
dbc
, 

, 
dbt
, 
h
, 
dx
, 
nbys
)

462 
DBC
 *
dbc
;

463 
u_t32_t
 

, 
dx
, 
nbys
;

464 
DBT
 *
dbt
;

465 
PAGE
 *
h
;

467 
BKEYDATA
 *
bk
, 
tbk
;

468 
BOVERFLOW
 *
bo
;

469 
BTREE
 *
t
;

470 
DB
 *
dbp
;

471 
DBT
 
cy
, *
rda
;

472 
u_t32_t
 
n
, 

;

473 
u_t8_t
 *
p
;

474 
t
;

476 
	`COMPQUIET
(
bo
, 
NULL
);

478 
dbp
 = 
dbc
->dbp;

479 
t
 = 
dbp
->
bt_
;

482 
rda
 = &
dbc
->
my_rda
;

483 i(
rda
->
un
 < 
nbys
) {

484 i((
t
 = 
	`__os_loc
(
dbp
->
dbv
,

485 
nbys
, &
rda
->
da
)) != 0) {

486 
rda
->
un
 = 0;

487 
rda
->
da
 = 
NULL
;

488  (
t
);

490 
rda
->
un
 = 
nbys
;

497 
	`memt
(
rda
->
da
,

498 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? 
t
->
_d
 : 0, 
nbys
);

509 i(!
	`F_ISSET
(
dbt
, 
DB_DBT_PARTIAL
|| 

 !
DB_CURRENT
) {

510 
p
 = (
u_t8_t
 *)
rda
->
da
 + 
dbt
->
doff
;

511 

 = 
dbt
->
doff
;

512 
ur_cy
;

516 i(
dx
 < 
	`NUM_ENT
(
h
)) {

517 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + (
	`TYPE
(h=
P_LBTREE
 ?

518 
O_INDX
 : 0));

519 
bo
 = (
BOVERFLOW
 *)
bk
;

521 
bk
 = &
tbk
;

522 
	`B_TSET
(
bk
->
ty
, 
B_KEYDATA
);

523 
bk
->
n
 = 0;

525 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
) {

530 
	`memt
(&
cy
, 0, (copy));

531 i((
t
 = 
	`__db_goff
(
dbp
, 
dbc
->
txn
, &
cy
, 
bo
->

,

532 
bo
->
pgno
, &
rda
->
da
, &rda->
un
)) != 0)

533  (
t
);

536 

 = 
dbt
->
doff
;

537 
p
 = (
u_t8_t
 *)
rda
->
da
 + 
dbt
->
doff
;

550 i(
bo
->

 > 
dbt
->
doff
 + dbt->
dn
) {

551 
n
 = 
bo
->

 - (
dbt
->
doff
 + dbt->
dn
);

552 i(
dbt
->
dn
 !dbt->
size
)

553 
	`memmove
(
p
 + 
dbt
->
size
, + dbt->
dn
, 
n
);

554 

 +
n
;

558 
	`memy
(
rda
->
da
,

559 
bk
->
da
, 
dbt
->
doff
 > bk->
n
 ? bk->len : dbt->doff);

560 

 = 
dbt
->
doff
;

561 
p
 = (
u_t8_t
 *)
rda
->
da
 + 
dbt
->
doff
;

564 
n
 = 
dbt
->
doff
 + dbt->
dn
;

565 i(
bk
->
n
 >en) {

566 
	`memy
(
p
 + 
dbt
->
size
, 
bk
->
da
 + 
n
, bk->len -en);

567 

 +
bk
->
n
 -en;

571 
ur_cy
:

576 
	`memy
(
p
, 
dbt
->
da
, dbt->
size
);

577 

 +
dbt
->
size
;

580 
rda
->
size
 = 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? 
t
->
_n
 : 

;

581 
rda
->
dn
 = 0;

582 
rda
->
doff
 = 0;

583 
rda
->
ags
 = 0;

584 *
dbt
 = *
rda
;

586 
	}
}

595 
	$__bam_rem
(
dbc
, 
h
, 
dx
, 
da
)

596 
DBC
 *
dbc
;

597 
PAGE
 *
h
;

598 
u_t32_t
 
dx
;

599 
DBT
 *
da
;

601 
BKEYDATA
 *
bk
;

602 
DB
 *
dbp
;

603 
DBT
 
ig
, 

;

604 
db_dx_t
 
t
, 
lo
, 

, 
m
, 
off
, 
efix
, 
suffix
;

605 
t32_t
 
nbys
;

606 
t
;

607 
db_dx_t
 *
p
;

608 
u_t8_t
 *
p
, *
t
;

610 
dbp
 = 
dbc
->dbp;

617 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

620 i(
	`DBC_LOGGING
(
dbc
)) {

626 
m
 = 
da
->
size
 < 
bk
->
n
 ? data->size : bk->len;

627 
efix
 = 0,

628 
p
 = 
bk
->
da
, 
t
 = data->data;

629 
efix
 < 
m
 && *
p
 =*
t
; ++prefix, ++p, ++t)

632 
m
 -
efix
;

633 
suffix
 = 0,

634 
p
 = (
u_t8_t
 *)
bk
->
da
 + bk->
n
 - 1,

635 
t
 = (
u_t8_t
 *)
da
->d+ da->
size
 - 1;

636 
suffix
 < 
m
 && *
p
 =*
t
; ++suffix, --p, --t)

640 
ig
.
da
 = (
u_t8_t
 *)
bk
->d+ 
efix
;

641 
ig
.
size
 = 
bk
->
n
 - (
efix
 + 
suffix
);

642 

.
da
 = (
u_t8_t
 *)da->d+ 
efix
;

643 

.
size
 = 
da
->siz- (
efix
 + 
suffix
);

644 i((
t
 = 
	`__bam__log
(
dbp
, 
dbc
->
txn
, &
	`LSN
(
h
), 0, 
	`PGNO
(h),

645 &
	`LSN
(
h
), (
u_t32_t
)
dx
, (u_t32_t)
	`B_DISSET
(
bk
->
ty
),

646 &
ig
, &

, (
u_t32_t
)
efix
, (u_t32_t)
suffix
)) != 0)

647  (
t
);

649 
	`LSN_NOT_LOGGED
(
	`LSN
(
h
));

655 
p
 = 
	`P_INP
(
dbp
, 
h
);

656 
p
 = (
u_t8_t
 *)
h
 + 
	`HOFFSET
(h);

657 
t
 = (
u_t8_t
 *)
bk
;

665 
lo
 = 
	`BKEYDATA_SIZE
(
bk
->
n
);

666 

 = (
db_dx_t
)
	`BKEYDATA_SIZE
(
da
->
size
);

667 i(
lo
 !

) {

668 
nbys
 = 
lo
 - 

;

669 i(
p
 =
t
)

670 
p
[
dx
] +
nbys
;

672 
	`memmove
(
p
 + 
nbys
,, (
size_t
)(
t
 -));

675 
off
 = 
p
[
dx
];

676 
t
 = 0; c < 
	`NUM_ENT
(
h
); ++cnt)

677 i(
p
[
t
] <
off
)

678 
p
[
t
] +
nbys
;

682 
	`HOFFSET
(
h
+
nbys
;

683 
t
 +
nbys
;

687 
bk
 = (
BKEYDATA
 *)
t
;

688 
	`B_TSET
(
bk
->
ty
, 
B_KEYDATA
);

689 
bk
->
n
 = 
da
->
size
;

690 
	`memy
(
bk
->
da
, da->da, da->
size
);

693 
	}
}

700 
	$__bam_dup_check
(
dbc
, 

, 
h
, 
dx
, 
sz
, 

)

701 
DBC
 *
dbc
;

702 
u_t32_t
 

;

703 
PAGE
 *
h
;

704 
u_t32_t
 
dx
, 
sz
;

705 
db_dx_t
 *

;

707 
BKEYDATA
 *
bk
;

708 
DB
 *
dbp
;

709 
db_dx_t
 
t
, 
f
, *
p
;

711 
dbp
 = 
dbc
->dbp;

712 
p
 = 
	`P_INP
(
dbp
, 
h
);

718 
dx
 > 0 && 
p
[dx] =p[dx - 
P_INDX
])

719 
dx
 -
P_INDX
;

722 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

723 
sz
 +
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
 ?

724 
	`BKEYDATA_PSIZE
(
bk
->
n
: 
BOVERFLOW_PSIZE
;

727 
f
 = 
dx
;

736 
t
 = 

 =
DB_CURRENT
 ? 0 : 1;

737 
f
 = 
dx
;

738 
dx
 < 
	`NUM_ENT
(
h
&& 
p
[
f
] == inp[indx];

739 ++
t
, 
dx
 +
P_INDX
) {

740 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
);

741 
sz
 +
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
 ?

742 
	`BKEYDATA_PSIZE
(
bk
->
n
: 
BOVERFLOW_PSIZE
;

752 i(
t
 == 1)

761 i(
sz
 < 
dbp
->
pgsize
 / 4)

764 *

 = 
t
;

766 
	}
}

773 
	$__bam_dup_cvt
(
dbc
, 
h
, 
dx
, 
t
)

774 
DBC
 *
dbc
;

775 
PAGE
 *
h
;

776 
u_t32_t
 
dx
, 
t
;

778 
BKEYDATA
 *
bk
;

779 
DB
 *
dbp
;

780 
DBT
 
hdr
;

781 
DB_MPOOLFILE
 *
mpf
;

782 
PAGE
 *
dp
;

783 
db_dx_t
 
dx
, 
ddx
, 
f
, *
p
;

784 
t
, 
t_t
;

786 
dbp
 = 
dbc
->dbp;

787 
mpf
 = 
dbp
->mpf;

788 
p
 = 
	`P_INP
(
dbp
, 
h
);

791 
dx
 > 0 && 
p
[dx] =p[dx - 
P_INDX
])

792 
dx
 -
P_INDX
;

795 i((
t
 = 
	`__db_w
(
dbc
,

796 
dbp
->
dup_com
 =
NULL
 ? 
P_LRECNO
 : 
P_LDUP
, &
dp
)) != 0)

797  (
t
);

798 
	`P_INIT
(
dp
, 
dbp
->
pgsize
, dp->
pgno
,

799 
PGNO_INVALID
, PGNO_INVALID, 
LEAFLEVEL
, 
	`TYPE
(
dp
));

806 
	`memt
(&
hdr
, 0, (hdr));

807 
f
 = 
dx
;

808 
ddx
 = 
dx
;

809 
dx
 = 0;

812 i((
t
 = 
	`__bam__dup
(
dbc
, 
f
,

813 
	`PGNO
(
h
), 
dx
, PGNO(
dp
), 
dx
)) != 0)

814 
r
;

825 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
ddx
 + 1);

826 
hdr
.
da
 = 
bk
;

827 
hdr
.
size
 = 
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
 ?

828 
	`BKEYDATA_SIZE
(
bk
->
n
: 
BOVERFLOW_SIZE
;

829 i(
dbp
->
dup_com
 =
NULL
 && 
	`B_DISSET
(
bk
->
ty
)) {

835 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

836 (
t
 = 
	`__db_doff
(
dbc
,

837 (
	`GET_BOVERFLOW
(
dbp
, 
h
, 
ddx
 + 1))->
pgno
)) != 0)

838 
r
;

840 i((
t
 = 
	`__db_pem
(

841 
dbc
, 
dp
, 
dx
, 
hdr
.
size
, &hdr, 
NULL
)) != 0)

842 
r
;

843 ++
dx
;

846 i(
t
 != 1) {

847 i((
t
 = 
	`__bam_adjdx
(
dbc
,

848 
h
, 
ddx
, 
f
 + 1, 0)) != 0)

849 
r
;

851 
ddx
++;

854 i((
t
 = 
	`__db_dem
(
dbc
, 
h
, 
ddx
, 
hdr
.
size
)) != 0)

855 
r
;

856 
dx
 +
P_INDX
;

857 } --
t
);

860 i((
t
 = 
	`__bam_ovput
(
dbc
,

861 
B_DUPLICATE
, 
dp
->
pgno
, 
h
, 
f
 + 1, 
NULL
)) != 0)

862 
r
;

865 
t
 = 
	`__bam__di
(
dbc
,

866 
	`PGNO
(
h
), 
f
 + 
P_INDX
, ()(f + P_INDX - 
dx
));

868 
r
: i((
t_t
 = 
	`__memp_ut
(
mpf
, 
dp
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

869 
t
 = 
t_t
;

871  (
t
);

872 
	}
}

880 
	$__bam_ovput
(
dbc
, 
ty
, 
pgno
, 
h
, 
dx
, 
em
)

881 
DBC
 *
dbc
;

882 
u_t32_t
 
ty
, 
dx
;

883 
db_pgno_t
 
pgno
;

884 
PAGE
 *
h
;

885 
DBT
 *
em
;

887 
BOVERFLOW
 
bo
;

888 
DBT
 
hdr
;

889 
t
;

891 
	`UMRW_SET
(
bo
.
unud1
);

892 
	`B_TSET
(
bo
.
ty
,ype);

893 
	`UMRW_SET
(
bo
.
unud2
);

900 i(
ty
 =
B_OVERFLOW
) {

901 i((
t
 = 
	`__db_poff
(
dbc
, 
em
, &
bo
.
pgno
)) != 0)

902  (
t
);

903 
bo
.

 = 
em
->
size
;

905 
bo
.
pgno
 =gno;

906 
bo
.

 = 0;

910 
	`memt
(&
hdr
, 0, (hdr));

911 
hdr
.
da
 = &
bo
;

912 
hdr
.
size
 = 
BOVERFLOW_SIZE
;

913  (
	`__db_pem
(
dbc
, 
h
, 
dx
, 
BOVERFLOW_SIZE
, &
hdr
, 
NULL
));

914 
	}
}

	@../btree/bt_rec.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/log.h
"

16 
	~"dbc/mp.h
"

18 
	#IS_BTREE_PAGE
(
g
) \

19 (
	`TYPE
(
g
=
P_IBTREE
 || \

20 
	`TYPE
(
g
=
P_LBTREE
 || TYPEag=
P_LDUP
)

	)

30 
	$__bam_l_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

31 
DB_ENV
 *
dbv
;

32 
DBT
 *
db
;

33 
DB_LSN
 *
lp
;

34 
db_cs
 

;

35 *
fo
;

37 
__bam_l_gs
 *
gp
;

38 
DB
 *
fe_dbp
;

39 
DBC
 *
dbc
;

40 
DB_MPOOLFILE
 *
mpf
;

41 
PAGE
 *
_
, *

, *

, *

, *
_
, *

, *

;

42 
db_pgno_t
 
pgno
, 
ro_pgno
;

43 
u_t32_t
 
y
;

44 
cmp
, 
l_upde
, 
p_upde
, 
r_upde
, 
rc
, 
t
, 
ro٥l
, 
t_t
;

46 
	`REC_PRINT
(
__bam_l_t
);

48 
mpf
 = 
NULL
;

49 
_
 = 

 = 

 = 

 = 
_
 = 

 = 
NULL
;

50 

 = 
NULL
;

52 
	`REC_INTRO
(
__bam_l_ad
, 1, 0);

68 i((
t
 = 
	`__os_mloc
(
dbv
, 
gp
->
pg
.
size
, &

)) != 0)

69 
out
;

70 
	`memy
(

, 
gp
->
pg
.
da
,rgp->pg.
size
);

72 
pgno
 = 
	`PGNO
(

);

73 
ro_pgno
 = 
gp
->root_pgno;

74 
ro٥l
 = 
ro_pgno
 !
PGNO_INVALID
;

75 
	`REC_FGET
(
mpf
, 
gp
->

, &

, 
right
);

76 
right
: 
	`REC_FGET
(
mpf
, 
gp
->right, &

, 
do
);

78 
do
: i(
	`DB_REDO
(

)) {

79 
l_upde
 = 
r_upde
 = 
p_upde
 = 0;

86 i(
ro٥l
) {

87 
	`REC_FGET
(
mpf
, 
ro_pgno
, &

, 
do_
);

88 
cmp
 =

89 
	`LOG_COMPARE
(&
	`LSN
(

), &LSN(
gp
->
pg
.
da
));

90 
	`CHECK_LSN
(
dbv
, 

,

91 
cmp
, &
	`LSN
(

), &LSN(
gp
->
pg
.
da
));

92 
p_upde
 = 
cmp
 == 0;

95 
do_
: i(

 !
NULL
) {

96 
cmp
 = 
	`LOG_COMPARE
(&
	`LSN
(

), &
gp
->
΢
);

97 
	`CHECK_LSN
(
dbv
, 

, 
cmp
, &
	`LSN
(

), &
gp
->
΢
);

98 i(
cmp
 == 0)

99 
l_upde
 = 1;

102 i(

 !
NULL
) {

103 
cmp
 = 
	`LOG_COMPARE
(&
	`LSN
(

), &
gp
->

);

104 
	`CHECK_LSN
(
dbv
, 

, 
cmp
, &
	`LSN
(

), &
gp
->

);

105 i(
cmp
 == 0)

106 
r_upde
 = 1;

109 i(!
p_upde
 && !
l_upde
 && !
r_upde
)

110 
check_xt
;

113 i((
t
 = 
	`__os_mloc
(
dbv
, 
fe_dbp
->
pgsize
, &
_
)) != 0 ||

114 (
t
 = 
	`__os_mloc
(
dbv
, 
fe_dbp
->
pgsize
, &
_
)) != 0)

115 
out
;

116 i(
ro٥l
) {

117 
	`P_INIT
(
_
, 
fe_dbp
->
pgsize
, 
gp
->

,

118 
PGNO_INVALID
,

119 
	`ISINTERNAL
(

? 
PGNO_INVALID
 : 
gp
->
right
,

120 
	`LEVEL
(

), 
	`TYPE
(sp));

121 
	`P_INIT
(
_
, 
fe_dbp
->
pgsize
, 
gp
->
right
,

122 
	`ISINTERNAL
(

? 
PGNO_INVALID
 : 
gp
->

,

123 
PGNO_INVALID
, 
	`LEVEL
(

), 
	`TYPE
(sp));

125 
	`P_INIT
(
_
, 
fe_dbp
->
pgsize
, 
	`PGNO
(

),

126 
	`ISINTERNAL
(

? 
PGNO_INVALID
 : 
	`PREV_PGNO
(sp),

127 
	`ISINTERNAL
(

? 
PGNO_INVALID
 : 
gp
->
right
,

128 
	`LEVEL
(

), 
	`TYPE
(sp));

129 
	`P_INIT
(
_
, 
fe_dbp
->
pgsize
, 
gp
->
right
,

130 
	`ISINTERNAL
(

? 
PGNO_INVALID
 : sp->
pgno
,

131 
	`ISINTERNAL
(

? 
PGNO_INVALID
 : 
	`NEXT_PGNO
(sp),

132 
	`LEVEL
(

), 
	`TYPE
(sp));

136 i((
t
 = 
	`__bam_cy
(
fe_dbp
, 

, 
_
, 0, 
gp
->
dx
)) != 0 ||

137 (
t
 = 
	`__bam_cy
(
fe_dbp
, 

, 
_
, 
gp
->
dx
,

138 
	`NUM_ENT
(

))) != 0)

139 
out
;

141 i(
l_upde
) {

142 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

143 
	`memy
(

, 
_
, 
fe_dbp
->
pgsize
);

144 

->
l
 = *
lp
;

145 i((
t
 =

146 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)) != 0)

147 
out
;

148 

 = 
NULL
;

151 i(
r_upde
) {

152 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

153 
	`memy
(

, 
_
, 
fe_dbp
->
pgsize
);

154 

->
l
 = *
lp
;

155 i((
t
 =

156 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)) != 0)

157 
out
;

158 

 = 
NULL
;

167 i(
ro٥l
 && 
p_upde
) {

168 i(
	`IS_BTREE_PAGE
(

)) {

169 
y
 = 
P_IBTREE
;

170 
rc
 = 
gp
->
ags
 & 
SPL_NRECS
 ? 1 : 0;

172 
y
 = 
P_IRECNO
;

173 
rc
 = 1;

176 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

177 
	`P_INIT
(

, 
fe_dbp
->
pgsize
, 
ro_pgno
,

178 
PGNO_INVALID
, PGNO_INVALID, 
_
->
v
 + 1, 
y
);

179 
	`RE_NREC_SET
(

, 
rc
 ? 
	`__bam_tٮ
(
fe_dbp
, 
_
) +

180 
	`__bam_tٮ
(
fe_dbp
, 
_
) : 0);

182 

->
l
 = *
lp
;

183 i((
t
 =

184 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)) != 0)

185 
out
;

186 

 = 
NULL
;

189 
check_xt
:

196 i(!
ro٥l
 && 
gp
->
gno
 !
PGNO_INVALID
) {

197 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
gno
, 
NULL
,

198 0, &

)) != 0) {

199 i(
t
 !
DB_PAGE_NOTFOUND


200 #ide
HAVE_FTRUNCATE


201 || 
	`DB_REDO
(

)

204 
t
 = 
	`__db_pgr
(

205 
fe_dbp
, 
gp
->
gno
, 
t
);

206 
out
;

208 
de
;

210 
cmp
 = 
	`LOG_COMPARE
(&
	`LSN
(

), &
gp
->
Ƣ
);

211 
	`CHECK_LSN
(
dbv
, 

, 
cmp
, &
	`LSN
(

), &
gp
->
Ƣ
);

212 i(
cmp
 == 0) {

213 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

214 
	`PREV_PGNO
(


gp
->
right
;

215 

->
l
 = *
lp
;

216 i((
t
 = 
	`__memp_ut
(
mpf
,

217 

, 
fe_dbp
->
iܙy
)) != 0)

218 
out
;

219 

 = 
NULL
;

230 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
NULL
,

231 
DB_MPOOL_EDIT
, &

)) != 0) {

232 

 = 
NULL
;

233 
undo
;

235 i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

236 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

237 
	`memy
(

, 
gp
->
pg
.
da
,rgp->pg.
size
);

238 i((
t
 =

239 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)) != 0)

240 
out
;

241 

 = 
NULL
;

252 
undo
: i((
ro٥l
 && 

 !
NULL
|| 

 != NULL) {

253 i(
ro٥l
 && 

 !
NULL
 &&

254 
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

255 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

256 

->
l
 = 
gp
->
΢
;

257 i((
t
 = 
	`__memp_ut
(
mpf
,

258 

, 
fe_dbp
->
iܙy
)) != 0)

259 
out
;

260 

 = 
NULL
;

262 i(

 !
NULL
 &&

263 
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

264 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

265 

->
l
 = 
gp
->

;

266 i((
t
 = 
	`__memp_ut
(
mpf
,

267 

, 
fe_dbp
->
iܙy
)) != 0)

268 
out
;

269 

 = 
NULL
;

281 i(!
ro٥l
 && 
gp
->
gno
 !
PGNO_INVALID
) {

282 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
gno
, 
NULL
,

283 
DB_MPOOL_EDIT
, &

)) != 0) {

284 

 = 
NULL
;

285 
de
;

287 i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

288 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &

);

289 
	`PREV_PGNO
(


gp
->

;

290 

->
l
 = 
gp
->
Ƣ
;

291 i(
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
))

292 
out
;

293 

 = 
NULL
;

298 
de
: *
lp
 = 
gp
->
ev_l
;

299 
t
 = 0;

301 
out
:

302 i(

 !
NULL
 &&

303 (
t_t
 = 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)!0 && 
t
 == 0)

304 
t
 = 
t_t
;

305 i(

 !
NULL
 &&

306 (
t_t
 = 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)!0 && 
t
 == 0)

307 
t
 = 
t_t
;

308 i(

 !
NULL
 &&

309 (
t_t
 = 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)!0 && 
t
 == 0)

310 
t
 = 
t_t
;

311 i(

 !
NULL
 &&

312 (
t_t
 = 
	`__memp_ut
(
mpf
, 

, 
fe_dbp
->
iܙy
)!0 && 
t
 == 0)

313 
t
 = 
t_t
;

316 i(
_
 !
NULL
)

317 
	`__os_
(
dbv
, 
_
);

318 i(
_
 !
NULL
)

319 
	`__os_
(
dbv
, 
_
);

320 i(

 !
NULL
)

321 
	`__os_
(
dbv
, 

);

323 
REC_CLOSE
;

324 
	}
}

334 
	$__bam_rl_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

335 
DB_ENV
 *
dbv
;

336 
DBT
 *
db
;

337 
DB_LSN
 *
lp
;

338 
db_cs
 

;

339 *
fo
;

341 
__bam_rl_gs
 *
gp
;

342 
DB
 *
fe_dbp
;

343 
DBC
 *
dbc
;

344 
DB_LSN
 
cy_l
;

345 
DB_MPOOLFILE
 *
mpf
;

346 
PAGE
 *
g
;

347 
db_pgno_t
 
pgno
, 
ro_pgno
;

348 
db_o_t
 
rt
;

349 
cmp_n
, 
cmp_p
, 
t
;

351 
g
 = 
NULL
;

352 
	`REC_PRINT
(
__bam_rl_t
);

353 
	`REC_INTRO
(
__bam_rl_ad
, 1, 1);

356 
pgno
 = 
ro_pgno
 = 
gp
->root_pgno;

357 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
NULL
,

358 0, &
g
)) != 0) {

359 i(
t
 !
DB_PAGE_NOTFOUND


360 #ide
HAVE_FTRUNCATE


361 || 
	`DB_REDO
(

)

364 
t
 = 
	`__db_pgr
(
fe_dbp
, 
pgno
,et);

365 
out
;

367 
do_ge
;

370 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

371 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
rol
);

372 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
rol
);

373 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

381 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

382 
rt
 = 
	`RE_NREC
(
g
);

383 
	`memy
(
g
, 
gp
->
pgdbt
.
da
,rgp->pgdbt.
size
);

384 i(
	`LEVEL
(
g
> 
LEAFLEVEL
)

385 
	`RE_NREC_SET
(
g
, 
rt
);

386 
g
->
pgno
 = 
ro_pgno
;

387 
g
->
l
 = *
lp
;

388 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

390 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

391 
	`P_INIT
(
g
, 
fe_dbp
->
pgsize
, 
ro_pgno
,

392 
gp
->
ec
, 
PGNO_INVALID
, 
g
->
v
 + 1,

393 
	`IS_BTREE_PAGE
(
g
? 
P_IBTREE
 : 
P_IRECNO
);

394 i((
t
 = 
	`__db_pem
(
dbc
, 
g
, 0,

395 
gp
->
roْt
.
size
, &gp->roْt, 
NULL
)) != 0)

396 
out
;

397 
g
->
l
 = 
gp
->
rol
;

399 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
)) != 0)

400 
out
;

402 
do_ge
:

408 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

409 0, &
g
)) != 0) {

410 i(
t
 !
DB_PAGE_NOTFOUND


411 #ide
HAVE_FTRUNCATE


412 || 
	`DB_REDO
(

)

415 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

416 
out
;

418 
de
;

420 ()
	`__ua_memy
(&
cy_l
, &
	`LSN
(
gp
->
pgdbt
.
da
), (
DB_LSN
));

421 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

422 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
cy_l
);

423 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
cy_l
);

424 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

426 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

427 
g
->
l
 = *
lp
;

428 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

430 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

431 
	`memy
(
g
, 
gp
->
pgdbt
.
da
,rgp->pgdbt.
size
);

433 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
)) != 0)

434 
out
;

435 
g
 = 
NULL
;

437 
de
: *
lp
 = 
gp
->
ev_l
;

438 
t
 = 0;

440 
out
: i(
g
 !
NULL
)

441 ()
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
);

442 
REC_CLOSE
;

443 
	}
}

453 
	$__bam_adj_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

454 
DB_ENV
 *
dbv
;

455 
DBT
 *
db
;

456 
DB_LSN
 *
lp
;

457 
db_cs
 

;

458 *
fo
;

460 
__bam_adj_gs
 *
gp
;

461 
DB
 *
fe_dbp
;

462 
DBC
 *
dbc
;

463 
DB_MPOOLFILE
 *
mpf
;

464 
PAGE
 *
g
;

465 
cmp_n
, 
cmp_p
, 
t
;

467 
g
 = 
NULL
;

468 
	`REC_PRINT
(
__bam_adj_t
);

469 
	`REC_INTRO
(
__bam_adj_ad
, 1, 1);

472 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

473 0, &
g
)) != 0) {

474 i(
t
 !
DB_PAGE_NOTFOUND


475 #ide
HAVE_FTRUNCATE


476 || 
	`DB_REDO
(

)

479 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

480 
out
;

482 
de
;

485 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

486 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

487 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

488 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

490 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

491 i((
t
 = 
	`__bam_adjdx
(
dbc
,

492 
g
, 
gp
->
dx
,rgp->
dx_cy
,rgp->
is_
)) != 0)

493 
out
;

495 
	`LSN
(
g
*
lp
;

496 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

498 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

499 i((
t
 = 
	`__bam_adjdx
(
dbc
,

500 
g
, 
gp
->
dx
,rgp->
dx_cy
, !gp->
is_
)) != 0)

501 
out
;

503 
	`LSN
(
g

gp
->
l
;

505 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
)) != 0)

506 
out
;

507 
g
 = 
NULL
;

509 
de
: *
lp
 = 
gp
->
ev_l
;

510 
t
 = 0;

512 
out
: i(
g
 !
NULL
)

513 ()
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
);

514 
REC_CLOSE
;

515 
	}
}

526 
	$__bam_dju_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

527 
DB_ENV
 *
dbv
;

528 
DBT
 *
db
;

529 
DB_LSN
 *
lp
;

530 
db_cs
 

;

531 *
fo
;

533 
__bam_dju_gs
 *
gp
;

534 
DB
 *
fe_dbp
;

535 
DBC
 *
dbc
;

536 
DB_MPOOLFILE
 *
mpf
;

537 
PAGE
 *
g
;

538 
cmp_n
, 
cmp_p
, 
t
;

540 
g
 = 
NULL
;

541 
	`REC_PRINT
(
__bam_dju_t
);

542 
	`REC_INTRO
(
__bam_dju_ad
, 1, 0);

545 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

546 0, &
g
)) != 0) {

547 i(
t
 !
DB_PAGE_NOTFOUND


548 #ide
HAVE_FTRUNCATE


549 || 
	`DB_REDO
(

)

552 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

553 
out
;

555 
de
;

558 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

559 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

560 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

561 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

563 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

564 i(
	`IS_BTREE_PAGE
(
g
)) {

565 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 +=

566 
gp
->
adju
;

567 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

568 
	`RE_NREC_ADJ
(
g
, 
gp
->
adju
);

570 
	`GET_RINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 +=

571 
gp
->
adju
;

572 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

573 
	`RE_NREC_ADJ
(
g
, 
gp
->
adju
);

576 
	`LSN
(
g
*
lp
;

577 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

579 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

580 i(
	`IS_BTREE_PAGE
(
g
)) {

581 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 -=

582 
gp
->
adju
;

583 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

584 
	`RE_NREC_ADJ
(
g
, -(
gp
->
adju
));

586 
	`GET_RINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 -=

587 
gp
->
adju
;

588 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

589 
	`RE_NREC_ADJ
(
g
, -(
gp
->
adju
));

591 
	`LSN
(
g

gp
->
l
;

593 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

594 
out
;

595 
g
 = 
NULL
;

597 
de
: *
lp
 = 
gp
->
ev_l
;

598 
t
 = 0;

600 
out
: i(
g
 !
NULL
)

601 ()
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
);

602 
REC_CLOSE
;

603 
	}
}

613 
	$__bam_cd_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

614 
DB_ENV
 *
dbv
;

615 
DBT
 *
db
;

616 
DB_LSN
 *
lp
;

617 
db_cs
 

;

618 *
fo
;

620 
__bam_cd_gs
 *
gp
;

621 
DB
 *
fe_dbp
;

622 
DBC
 *
dbc
;

623 
DB_MPOOLFILE
 *
mpf
;

624 
PAGE
 *
g
;

625 
u_t32_t
 
dx
;

626 
cmp_n
, 
cmp_p
, 
t
;

628 
g
 = 
NULL
;

629 
	`REC_PRINT
(
__bam_cd_t
);

630 
	`REC_INTRO
(
__bam_cd_ad
, 1, 0);

633 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

634 0, &
g
)) != 0) {

635 i(
t
 !
DB_PAGE_NOTFOUND


636 #ide
HAVE_FTRUNCATE


637 || 
	`DB_REDO
(

)

640 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

641 
out
;

643 
de
;

646 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

647 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

648 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

649 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

651 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

652 
dx
 = 
gp
->dx + (
	`TYPE
(
g
=
P_LBTREE
 ? 
O_INDX
 : 0);

653 
	`B_DSET
(
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
)->
ty
);

655 
	`LSN
(
g
*
lp
;

656 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

658 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

659 
dx
 = 
gp
->dx + (
	`TYPE
(
g
=
P_LBTREE
 ? 
O_INDX
 : 0);

660 
	`B_DCLR
(
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
)->
ty
);

662 i((
t
 = 
	`__bam__de
(

663 
fe_dbp
, 
gp
->
pgno
,rgp->
dx
, 0, 
NULL
)) != 0)

664 
out
;

666 
	`LSN
(
g

gp
->
l
;

668 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

669 
out
;

670 
g
 = 
NULL
;

672 
de
: *
lp
 = 
gp
->
ev_l
;

673 
t
 = 0;

675 
out
: i(
g
 !
NULL
)

676 ()
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
);

677 
REC_CLOSE
;

678 
	}
}

688 
	$__bam__cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

689 
DB_ENV
 *
dbv
;

690 
DBT
 *
db
;

691 
DB_LSN
 *
lp
;

692 
db_cs
 

;

693 *
fo
;

695 
__bam__gs
 *
gp
;

696 
BKEYDATA
 *
bk
;

697 
DB
 *
fe_dbp
;

698 
DBC
 *
dbc
;

699 
DBT
 
dbt
;

700 
DB_MPOOLFILE
 *
mpf
;

701 
PAGE
 *
g
;

702 
cmp_n
, 
cmp_p
, 
t
;

703 
u_t8_t
 *
p
;

705 
g
 = 
NULL
;

706 
	`REC_PRINT
(
__bam__t
);

707 
	`REC_INTRO
(
__bam__ad
, 1, 1);

710 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

711 0, &
g
)) != 0) {

712 i(
t
 !
DB_PAGE_NOTFOUND


713 #ide
HAVE_FTRUNCATE


714 || 
	`DB_REDO
(

)

717 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

718 
out
;

720 
de
;

722 
bk
 = 
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
gp
->
dx
);

724 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

725 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

726 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

727 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

733 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

734 
	`memt
(&
dbt
, 0, (dbt));

735 
dbt
.
size
 = 
gp
->
efix
 +rgp->
suffix
 +rgp->

.size;

736 i((
t
 = 
	`__os_mloc
(
dbv
, 
dbt
.
size
, &dbt.
da
)) != 0)

737 
out
;

738 
p
 = 
dbt
.
da
;

739 
	`memy
(
p
, 
bk
->
da
, 
gp
->
efix
);

740 
p
 +
gp
->
efix
;

741 
	`memy
(
p
, 
gp
->

.
da
,rgp->.
size
);

742 
p
 +
gp
->

.
size
;

743 
	`memy
(
p
, 
bk
->
da
 + (bk->
n
 - 
gp
->
suffix
),rgp->suffix);

745 
t
 = 
	`__bam_rem
(
dbc
, 
g
, 
gp
->
dx
, &
dbt
);

746 
	`__os_
(
dbv
, 
dbt
.
da
);

747 i(
t
 != 0)

748 
out
;

750 
	`LSN
(
g
*
lp
;

751 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

757 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

758 
	`memt
(&
dbt
, 0, (dbt));

759 
dbt
.
size
 = 
gp
->
efix
 +rgp->
suffix
 +rgp->
ig
.size;

760 i((
t
 = 
	`__os_mloc
(
dbv
, 
dbt
.
size
, &dbt.
da
)) != 0)

761 
out
;

762 
p
 = 
dbt
.
da
;

763 
	`memy
(
p
, 
bk
->
da
, 
gp
->
efix
);

764 
p
 +
gp
->
efix
;

765 
	`memy
(
p
, 
gp
->
ig
.
da
,rgp->ig.
size
);

766 
p
 +
gp
->
ig
.
size
;

767 
	`memy
(
p
, 
bk
->
da
 + (bk->
n
 - 
gp
->
suffix
),rgp->suffix);

769 
t
 = 
	`__bam_rem
(
dbc
, 
g
, 
gp
->
dx
, &
dbt
);

770 
	`__os_
(
dbv
, 
dbt
.
da
);

771 i(
t
 != 0)

772 
out
;

775 i(
gp
->
isded
)

776 
	`B_DSET
(
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ty
);

778 
	`LSN
(
g

gp
->
l
;

780 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
)) != 0)

781 
out
;

782 
g
 = 
NULL
;

784 
de
: *
lp
 = 
gp
->
ev_l
;

785 
t
 = 0;

787 
out
: i(
g
 !
NULL
)

788 ()
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
);

789 
REC_CLOSE
;

790 
	}
}

800 
	$__bam_ro_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

801 
DB_ENV
 *
dbv
;

802 
DBT
 *
db
;

803 
DB_LSN
 *
lp
;

804 
db_cs
 

;

805 *
fo
;

807 
__bam_ro_gs
 *
gp
;

808 
BTMETA
 *
ma
;

809 
DB
 *
fe_dbp
;

810 
DBC
 *
dbc
;

811 
DB_MPOOLFILE
 *
mpf
;

812 
cmp_n
, 
cmp_p
, 
t
;

814 
ma
 = 
NULL
;

815 
	`REC_PRINT
(
__bam_ro_t
);

816 
	`REC_INTRO
(
__bam_ro_ad
, 0, 0);

818 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
ma_pgno
, 
NULL
,

819 0, &
ma
)) != 0) {

820 i(
t
 !
DB_PAGE_NOTFOUND


821 #ide
HAVE_FTRUNCATE


822 || 
	`DB_REDO
(

)

825 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
ma_pgno
,et);

826 
out
;

828 
de
;

831 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
ma
));

832 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
ma
), &
gp
->
ma_l
);

833 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
ma
), &
gp
->
ma_l
);

834 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

836 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
ma
);

837 
ma
->
ro
 = 
gp
->
ro_pgno
;

838 
ma
->
dbma
.
l
 = *
lp
;

839 ((
BTREE
 *)
fe_dbp
->
bt_
)->
bt_ro
 = 
ma
->
ro
;

840 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

842 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
ma
);

843 
ma
->
dbma
.
l
 = 
gp
->
ma_l
;

845 i((
t
 = 
	`__memp_ut
(
mpf
, 
ma
, 
fe_dbp
->
iܙy
)) != 0)

846 
out
;

847 
ma
 = 
NULL
;

849 
de
: *
lp
 = 
gp
->
ev_l
;

850 
t
 = 0;

852 
out
: i(
ma
 !
NULL
)

853 ()
	`__memp_ut
(
mpf
, 
ma
, 
fe_dbp
->
iܙy
);

854 
REC_CLOSE
;

855 
	}
}

866 
	$__bam_cudj_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

867 
DB_ENV
 *
dbv
;

868 
DBT
 *
db
;

869 
DB_LSN
 *
lp
;

870 
db_cs
 

;

871 *
fo
;

873 
__bam_cudj_gs
 *
gp
;

874 
DB
 *
fe_dbp
;

875 
DBC
 *
dbc
;

876 
DB_MPOOLFILE
 *
mpf
;

877 
t
;

879 
	`COMPQUIET
(
mpf
, 
NULL
);

881 
	`REC_PRINT
(
__bam_cudj_t
);

882 
	`REC_INTRO
(
__bam_cudj_ad
, 0, 1);

884 
t
 = 0;

885 i(

 !
DB_TXN_ABORT
)

886 
de
;

888 
gp
->
mode
) {

889 
DB_CA_DI
:

890 i((
t
 = 
	`__bam__di
(
dbc
, 
gp
->
om_pgno
,

891 
gp
->
om_dx
, -(rgp->
f_dx
)) != 0)

892 
out
;

894 
DB_CA_DUP
:

895 i((
t
 = 
	`__bam__undodup
(
fe_dbp
, 
gp
->
f_dx
,

896 
gp
->
om_pgno
,rgp->
om_dx
,rgp->
to_dx
)) != 0)

897 
out
;

900 
DB_CA_RSPLIT
:

901 i((
t
 =

902 
	`__bam__rl
(
dbc
, 
gp
->
to_pgno
,rgp->
om_pgno
)) != 0)

903 
out
;

906 
DB_CA_SPLIT
:

907 i((
t
 = 
	`__bam__undol
(
fe_dbp
, 
gp
->
om_pgno
,

908 
gp
->
to_pgno
,rgp->
_pgno
,rgp->
om_dx
)) != 0)

909 
out
;

913 
de
: *
lp
 = 
gp
->
ev_l
;

914 
out
: 
REC_CLOSE
;

915 
	}
}

926 
	$__bam_rcudj_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

927 
DB_ENV
 *
dbv
;

928 
DBT
 *
db
;

929 
DB_LSN
 *
lp
;

930 
db_cs
 

;

931 *
fo
;

933 
__bam_rcudj_gs
 *
gp
;

934 
BTREE_CURSOR
 *

;

935 
DB
 *
fe_dbp
;

936 
DBC
 *
dbc
, *
rdbc
;

937 
DB_MPOOLFILE
 *
mpf
;

938 
t
, 
t_t
;

940 
	`COMPQUIET
(
mpf
, 
NULL
);

941 
rdbc
 = 
NULL
;

943 
	`REC_PRINT
(
__bam_rcudj_t
);

944 
	`REC_INTRO
(
__bam_rcudj_ad
, 0, 1);

946 
t
 = 
t_t
 = 0;

948 i(

 !
DB_TXN_ABORT
)

949 
de
;

961 i((
t
 = 
	`__db_curs_t
(
fe_dbp
,

962 
NULL
, 
DB_RECNO
, 
gp
->
ro
, 0, 
DB_LOCK_INVALIDID
, &
rdbc
)) != 0)

963 
out
;

965 

 = (
BTREE_CURSOR
 *)
rdbc
->

;

966 
	`F_SET
(

, 
C_RENUMBER
);

967 

->
o
 = 
gp
->recno;

969 
gp
->
mode
) {

970 
CA_DELETE
:

975 
	`F_SET
(

, 
C_DELETED
);

976 
	`F_SET
(

, 
C_RENUMBER
);

977 

->
d
 = 
gp
->order;

978 i((
t
 = 
	`__m_
(
rdbc
, 
CA_ICURRENT
, 
NULL
)) != 0)

979 
out
;

981 
CA_IAFTER
:

982 
CA_IBEFORE
:

983 
CA_ICURRENT
:

988 
	`F_CLR
(

, 
C_DELETED
);

989 

->
d
 = 
INVALID_ORDER
;

990 i((
t
 = 
	`__m_
(
rdbc
, 
CA_DELETE
, 
NULL
)) != 0)

991 
out
;

995 
de
: *
lp
 = 
gp
->
ev_l
;

996 
out
: i(
rdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
dbc)!0 && 
t
 == 0)

997 
t
 = 
t_t
;

998 
REC_CLOSE
;

999 
	}
}

1009 
	$__bam_lk_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

1010 
DB_ENV
 *
dbv
;

1011 
DBT
 *
db
;

1012 
DB_LSN
 *
lp
;

1013 
db_cs
 

;

1014 *
fo
;

1016 
__bam_lk_gs
 *
gp
;

1017 
DB
 *
fe_dbp
;

1018 
DBC
 *
dbc
;

1019 
DB_MPOOLFILE
 *
mpf
;

1020 
PAGE
 *
g
;

1021 
cmp_n
, 
cmp_p
, 
t
;

1023 
g
 = 
NULL
;

1024 
	`REC_PRINT
(
__bam_lk_t
);

1025 
	`REC_INTRO
(
__bam_lk_ad
, 1, 0);

1033 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
xt
, 
NULL
,

1034 0, &
g
)) != 0) {

1035 i(
t
 !
DB_PAGE_NOTFOUND


1036 #ide
HAVE_FTRUNCATE


1037 || 
	`DB_REDO
(

)

1040 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
xt
,et);

1041 
out
;

1043 
ev
;

1046 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1047 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_xt
);

1048 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_xt
);

1049 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1051 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1052 i(
gp
->
w_pgno
 =
PGNO_INVALID
)

1053 
g
->
ev_pgno
 = 
gp
->
ev
;

1055 
g
->
ev_pgno
 = 
gp
->
w_pgno
;

1057 
g
->
l
 = *
lp
;

1058 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

1060 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1061 
g
->
ev_pgno
 = 
gp
->
pgno
;

1063 
g
->
l
 = 
gp
->
l_xt
;

1066 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1067 
out
;

1068 
g
 = 
NULL
;

1070 
ev
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->ev, 
NULL
,

1071 0, &
g
)) != 0) {

1072 i(
t
 !
DB_PAGE_NOTFOUND


1073 #ide
HAVE_FTRUNCATE


1074 || 
	`DB_REDO
(

)

1077 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
ev
,et);

1078 
out
;

1080 
de
;

1083 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_ev
);

1084 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_ev
);

1085 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1087 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1088 i(
gp
->
w_pgno
 =
PGNO_INVALID
)

1089 
g
->
xt_pgno
 = 
gp
->
xt
;

1091 
g
->
xt_pgno
 = 
gp
->
w_pgno
;

1093 
g
->
l
 = *
lp
;

1094 } i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
)=0 && 
	`DB_UNDO
(

)) {

1096 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1097 
g
->
xt_pgno
 = 
gp
->
pgno
;

1098 
g
->
l
 = 
gp
->
l_ev
;

1101 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1102 
out
;

1103 
g
 = 
NULL
;

1105 
de
: *
lp
 = 
gp
->
ev_l
;

1106 
t
 = 0;

1108 
out
: i(
g
 !
NULL
)

1109 ()
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
);

1110 
REC_CLOSE
;

1111 
	}
}

1121 
	$__bam_mge_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

1122 
DB_ENV
 *
dbv
;

1123 
DBT
 *
db
;

1124 
DB_LSN
 *
lp
;

1125 
db_cs
 

;

1126 *
fo
;

1128 
__bam_mge_gs
 *
gp
;

1129 
BKEYDATA
 *
bk
;

1130 
DB
 *
fe_dbp
;

1131 
DBC
 *
dbc
;

1132 
DB_MPOOLFILE
 *
mpf
;

1133 
PAGE
 *
g
;

1134 
db_dx_t
 
dx
, *
np
, *
pp
;

1135 
u_t32_t
 
size
;

1136 
u_t8_t
 *
bp
;

1137 
cmp_n
, 
cmp_p
, 
i
, 
t
;

1139 
	`REC_PRINT
(
__bam_mge_t
);

1140 
	`REC_INTRO
(
__bam_mge_ad
, 1, 1);

1142 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

1143 0, &
g
)) != 0) {

1144 i(
t
 !
DB_PAGE_NOTFOUND


1145 #ide
HAVE_FTRUNCATE


1146 || 
	`DB_REDO
(

)

1149 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1150 
out
;

1152 
xt
;

1155 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1156 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1157 
	`CHECK_LSN
(
fe_dbp
->
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1159 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1164 
	`DB_ASSERT
(
dbv
, 
gp
->
hdr
.
size
 =0 || 
	`NUM_ENT
(
g
) == 0);

1165 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

1166 i(
gp
->
hdr
.
size
 != 0) {

1167 
	`P_INIT
(
g
, 
fe_dbp
->
pgsize
,ag->
pgno
,

1168 
	`PREV_PGNO
(
gp
->
hdr
.
da
),

1169 
	`NEXT_PGNO
(
gp
->
hdr
.
da
),

1170 
	`LEVEL
(
gp
->
hdr
.
da
), 
	`TYPE
(argp->hdr.data));

1172 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1173 
	`OV_REF
(
g
OV_REF(
gp
->
hdr
.
da
);

1174 
	`OV_LEN
(
g
OV_LEN(
gp
->
hdr
.
da
);

1175 
bp
 = (
u_t8_t
 *
g
 + 
	`P_OVERHEAD
(
fe_dbp
);

1176 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1179 
bp
 = (
u_t8_t
 *)
g
 +

1180 (
db_dx_t
)(
	`HOFFSET
(
g
- 
gp
->
da
.
size
);

1181 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1184 
pp
 = 
	`P_INP
(
fe_dbp
, 
g
+ 
	`NUM_ENT
(pagep);

1185 
np
 = 
gp
->
d
.
da
;

1186 
i
 = 0;

1187 
i
 < ()(
gp
->
d
.
size
 / (*
np
)); i++)

1188 *
pp
++ = *
np
++

1189 - (
fe_dbp
->
pgsize
 - 
	`HOFFSET
(
g
));

1190 
	`HOFFSET
(
g
-
gp
->
da
.
size
;

1191 
	`NUM_ENT
(
g
+
i
;

1193 
g
->
l
 = *
lp
;

1194 } i(
cmp_n
 =0 && !
	`DB_REDO
(

)) {

1201 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

1202 
i
 = 0; i < ()(
gp
->
d
.
size
 / (*
np
)); i++) {

1203 
dx
 = 
	`NUM_ENT
(
g
) - 1;

1204 i(
	`P_INP
(
fe_dbp
, 
g
)[
dx
] ==

1205 
	`P_INP
(
fe_dbp
, 
g
)[
dx
 - 
P_INDX
]) {

1206 
	`NUM_ENT
(
g
)--;

1209 
	`TYPE
(
g
)) {

1210 
P_LBTREE
:

1211 
P_LRECNO
:

1212 
P_LDUP
:

1213 
bk
 = 
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
);

1214 
size
 = 
	`BITEM_SIZE
(
bk
);

1217 
P_IBTREE
:

1218 
size
 = 
	`BINTERNAL_SIZE
(

1219 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
dx
)->
n
);

1221 
P_IRECNO
:

1222 
size
 = 
RINTERNAL_SIZE
;

1226 
t
 = 
	`__db_pgfmt
(
dbv
, 
	`PGNO
(
g
));

1227 
out
;

1229 i((
t
 =

1230 
	`__db_dem
(
dbc
, 
g
, 
dx
, 
size
)) != 0)

1231 
out
;

1233 i(
gp
->
d
.
size
 == 0)

1234 
	`HOFFSET
(
g

fe_dbp
->
pgsize
;

1235 
g
->
l
 = 
gp
->lsn;

1238 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
)) != 0)

1239 
out
;

1241 
xt
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
gno
, 
NULL
,

1242 0, &
g
)) != 0) {

1243 i(
t
 !
DB_PAGE_NOTFOUND


1244 #ide
HAVE_FTRUNCATE


1245 || 
	`DB_REDO
(

)

1248 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1249 
out
;

1251 
de
;

1254 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1255 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
Ƣ
);

1256 
	`CHECK_LSN
(
fe_dbp
->
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
Ƣ
);

1258 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1260 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

1261 
	`HOFFSET
(
g

fe_dbp
->
pgsize
;

1262 
	`NUM_ENT
(
g
) = 0;

1263 
g
->
l
 = *
lp
;

1264 } i(
cmp_n
 =0 && !
	`DB_REDO
(

)) {

1266 
	`REC_DIRTY
(
mpf
, 
dbc
->
iܙy
, &
g
);

1267 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1268 
	`OV_REF
(
g
OV_REF(
gp
->
hdr
.
da
);

1269 
	`OV_LEN
(
g
OV_LEN(
gp
->
hdr
.
da
);

1270 
bp
 = (
u_t8_t
 *
g
 + 
	`P_OVERHEAD
(
fe_dbp
);

1271 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1273 
bp
 = (
u_t8_t
 *)
g
 +

1274 (
db_dx_t
)(
	`HOFFSET
(
g
- 
gp
->
da
.
size
);

1275 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1278 
pp
 = 
	`P_INP
(
fe_dbp
, 
g
+ 
	`NUM_ENT
(pagep);

1279 
np
 = 
gp
->
d
.
da
;

1280 
i
 = 0;

1281 
i
 < ()(
gp
->
d
.
size
 / (*
np
)); i++)

1282 *
pp
++ = *
np
++;

1283 
	`HOFFSET
(
g
-
gp
->
da
.
size
;

1284 
	`NUM_ENT
(
g

i
;

1286 
g
->
l
 = 
gp
->
Ƣ
;

1289 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
dbc
->
iܙy
)) != 0)

1290 
out
;

1291 
de
:

1292 *
lp
 = 
gp
->
ev_l
;

1293 
t
 = 0;

1295 
out
: 
REC_CLOSE
;

1296 
	}
}

1306 
	$__bam_pgno_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

1307 
DB_ENV
 *
dbv
;

1308 
DBT
 *
db
;

1309 
DB_LSN
 *
lp
;

1310 
db_cs
 

;

1311 *
fo
;

1313 
BINTERNAL
 *
bi
;

1314 
__bam_pgno_gs
 *
gp
;

1315 
DB
 *
fe_dbp
;

1316 
DBC
 *
dbc
;

1317 
DB_MPOOLFILE
 *
mpf
;

1318 
PAGE
 *
g
, *
ag
;

1319 
db_pgno_t
 *
pgn
;

1320 
cmp_n
, 
cmp_p
, 
t
;

1322 
	`REC_PRINT
(
__bam_pgno_t
);

1323 
	`REC_INTRO
(
__bam_pgno_ad
, 1, 0);

1325 
	`REC_FGET
(
mpf
, 
gp
->
pgno
, &
g
, 
de
);

1327 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1328 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1329 
	`CHECK_LSN
(
fe_dbp
->
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1331 i((
cmp_p
 =0 && 
	`DB_REDO
(

)|| (
cmp_n
 == 0 && !DB_REDO(op))) {

1332 
	`TYPE
(
g
)) {

1333 
P_IBTREE
:

1339 
bi
 = 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
);

1340 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
) {

1341 
	`REC_FGET
(
mpf
, 
gp
->
gno
, &
ag
, 
out
);

1343 i(
	`TYPE
(
ag
=
P_OVERFLOW
)

1344 
pgn
 =

1345 &((
BOVERFLOW
 *)(
bi
->
da
))->
pgno
;

1347 
pgn
 = &
bi
->
pgno
;

1348 i((
t
 = 
	`__memp_ut
(
mpf
,

1349 
ag
, 
fe_dbp
->
iܙy
)) != 0)

1350 
out
;

1353 
pgn
 = &
bi
->
pgno
;

1355 
P_IRECNO
:

1356 
pgn
 =

1357 &
	`GET_RINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
pgno
;

1360 
pgn
 =

1361 &
	`GET_BOVERFLOW
(
fe_dbp
, 
g
, 
gp
->
dx
)->
pgno
;

1365 i(
	`DB_REDO
(

)) {

1367 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1368 *
pgn
 = 
gp
->
gno
;

1369 
g
->
l
 = *
lp
;

1371 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1372 *
pgn
 = 
gp
->
gno
;

1373 
g
->
l
 = 
gp
->lsn;

1377 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1378 
out
;

1380 
de
:

1381 *
lp
 = 
gp
->
ev_l
;

1382 
t
 = 0;

1384 
out
: 
REC_CLOSE
;

1385 
	}
}

1395 
	$__bam_lk_43_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

1396 
DB_ENV
 *
dbv
;

1397 
DBT
 *
db
;

1398 
DB_LSN
 *
lp
;

1399 
db_cs
 

;

1400 *
fo
;

1402 
__bam_lk_43_gs
 *
gp
;

1403 
DB
 *
fe_dbp
;

1404 
DBC
 *
dbc
;

1405 
DB_MPOOLFILE
 *
mpf
;

1406 
PAGE
 *
g
;

1407 
cmp_n
, 
cmp_p
, 
modifd
, 
t
;

1409 
g
 = 
NULL
;

1410 
	`REC_PRINT
(
__bam_lk_43_t
);

1411 
	`REC_INTRO
(
__bam_lk_43_ad
, 1, 0);

1419 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
, 0, &
g
)) != 0) {

1420 i(
t
 !
DB_PAGE_NOTFOUND


1421 #ide
HAVE_FTRUNCATE


1422 || 
	`DB_REDO
(

)

1425 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1426 
out
;

1428 
xt2
;

1431 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1432 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1433 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1435 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1436 
g
->
l
 = *
lp
;

1437 } i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
)=0 && 
	`DB_UNDO
(

)) {

1439 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1440 
g
->
xt_pgno
 = 
gp
->
xt
;

1441 
g
->
ev_pgno
 = 
gp
->
ev
;

1442 
g
->
l
 = 
gp
->lsn;

1444 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1445 
out
;

1446 
g
 = 
NULL
;

1448 
xt2
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
xt
, 
NULL
, 0, &
g
)) != 0) {

1449 i(
t
 !
DB_PAGE_NOTFOUND


1450 #ide
HAVE_FTRUNCATE


1451 || 
	`DB_REDO
(

)

1454 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
xt
,et);

1455 
out
;

1457 
ev
;

1460 
modifd
 = 0;

1461 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1462 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_xt
);

1463 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_xt
);

1464 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1466 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1467 
g
->
ev_pgno
 = 
gp
->
ev
;

1468 
modifd
 = 1;

1469 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

1471 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1472 
g
->
ev_pgno
 = 
gp
->
pgno
;

1473 
modifd
 = 1;

1475 i(
modifd
) {

1476 i(
	`DB_UNDO
(

))

1477 
g
->
l
 = 
gp
->
l_xt
;

1479 
g
->
l
 = *
lp
;

1481 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1482 
out
;

1483 
g
 = 
NULL
;

1485 
ev
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->ev, 
NULL
, 0, &
g
)) != 0) {

1486 i(
t
 !
DB_PAGE_NOTFOUND


1487 #ide
HAVE_FTRUNCATE


1488 || 
	`DB_REDO
(

)

1491 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
ev
,et);

1492 
out
;

1494 
de
;

1497 
modifd
 = 0;

1498 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_ev
);

1499 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_ev
);

1500 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1502 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1503 
g
->
xt_pgno
 = 
gp
->
xt
;

1504 
modifd
 = 1;

1505 } i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
)=0 && 
	`DB_UNDO
(

)) {

1507 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

1508 
g
->
xt_pgno
 = 
gp
->
pgno
;

1509 
modifd
 = 1;

1511 i(
modifd
) {

1512 i(
	`DB_UNDO
(

))

1513 
g
->
l
 = 
gp
->
l_ev
;

1515 
g
->
l
 = *
lp
;

1517 i((
t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1518 
out
;

1519 
g
 = 
NULL
;

1521 
de
: *
lp
 = 
gp
->
ev_l
;

1522 
t
 = 0;

1524 
out
: i(
g
 !
NULL
)

1525 ()
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
);

1526 
REC_CLOSE
;

1527 
	}
}

	@../btree/bt_reclaim.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/lock.h
"

23 
	$__bam_aim
(
dbp
, 
txn
)

24 
DB
 *
dbp
;

25 
DB_TXN
 *
txn
;

27 
DBC
 *
dbc
;

28 
DB_LOCK
 
ma_lock
;

29 
t
, 
t_t
;

32 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 0)) != 0)

33  (
t
);

36 i((
t
 = 
	`__db_lg
(
dbc
,

37 0, 
PGNO_BASE_MD
, 
DB_LOCK_WRITE
, 0, &
ma_lock
)) != 0)

38 
r
;

41 
	`F_SET
(
dbc
, 
DBC_DONTLOCK
);

44 
t
 = 
	`__bam_av
(
dbc
,

45 
DB_LOCK_WRITE
, 
dbc
->

->
ro
, 
__db_aim_back
, dbc);

47 
	`__TLPUT
(
dbc
, 
ma_lock
);

49 
r
: i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

50 
t
 = 
t_t
;

52  (
t
);

53 
	}
}

62 
	$__bam_un
(
dbc
, 
coup
)

63 
DBC
 *
dbc
;

64 
u_t32_t
 *
coup
;

66 
db_unc_m
 
unc
;

67 
t
;

69 
unc
.
cou
 = 0;

70 
unc
.
dbc
 = dbc;

73 
t
 = 
	`__bam_av
(
dbc
,

74 
DB_LOCK_WRITE
, 
dbc
->

->
ro
, 
__db_un_back
, &
unc
);

76 i(
coup
 !
NULL
)

77 *
coup
 = 
unc
.
cou
;

79  (
t
);

80 
	}
}

	@../btree/bt_recno.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/mp.h
"

17 
__m_add
 
__P
((
DBC
 *, 
db_o_t
 *, 
DBT
 *, 
u_t32_t
, u_int32_t));

18 
__m_sour
 
__P
((
DB
 *));

19 
__m_d
 
__P
((
DBC
 *, 
db_o_t
));

20 
__m_upde
 
__P
((
DBC
 *, 
db_o_t
, ));

39 
	#CD_SET
(

) { \

40 i(
	`F_ISSET
(

, 
C_RENUMBER
)) \

41 
	`F_SET
(

, 
C_DELETED
); \

42 }

	)

43 
	#CD_CLR
(

) { \

44 i(
	`F_ISSET
(

, 
C_RENUMBER
)) { \

45 
	`F_CLR
(

, 
C_DELETED
); \

46 

->
d
 = 
INVALID_ORDER
; \

48 }

	)

49 
	#CD_ISSET
(

) \

50 (
	`F_ISSET
(

, 
C_RENUMBER
&& F_ISSET(, 
C_DELETED
? 1 : 0)

	)

59 
	#C_LESSTHAN
(
1
, 
2
) \

60 (((
1
)->
o
 < (
2
)->recno) || \

61 (((
1
)->
o
 =(
2
)->recno) && \

62 ((
	`CD_ISSET
((
1
)&& CD_ISSET((
2
)&& (1)->
d
 < (cp2)->order) || \

63 (
	`CD_ISSET
((
1
)&& !CD_ISSET((
2
))))))

	)

69 
	#C_EQUAL
(
1
, 
2
) \

70 ((
1
)->
o
 =(
2
)->&& 
	`CD_ISSET
((cp1)) == CD_ISSET((cp2)) && \

71 (!
	`CD_ISSET
((
1
)|| (1)->
d
 =(
2
)->d))

	)

76 
	#CURADJ_LOG
(
dbc
) \

77 (
	`DBC_LOGGING
((
dbc
)&& (dbc)->
txn
 !
NULL
 && (dbc)->txn->

 !NULL)

	)

83 
	#STACK_TO_CURSOR
(

, 
t
) { \

84 
__t_t
; \

85 (

)->
ge
 = ()->
c
->page; \

86 (

)->
pgno
 = ()->
c
->
ge
->pgno; \

87 (

)->
dx
 = ()->
c
->indx; \

88 i((
__t_t
 = 
	`__TLPUT
(
dbc
, (

)->
lock
)!0 && (
t
) == 0) \

89 
t
 = 
__t_t
; \

90 (

)->
lock
 = ()->
c
->lock; \

91 (

)->
lock_mode
 = ()->
c
->lock_mode; \

92 }

	)

102 
	$__m_ݒ
(
dbp
, 
txn
, 
me
, 
ba_pgno
, 
ags
)

103 
DB
 *
dbp
;

104 
DB_TXN
 *
txn
;

105 cڡ *
me
;

106 
db_pgno_t
 
ba_pgno
;

107 
u_t32_t
 
ags
;

109 
BTREE
 *
t
;

110 
DBC
 *
dbc
;

111 
t
, 
t_t
;

113 
	`COMPQUIET
(
me
, 
NULL
);

114 
t
 = 
dbp
->
bt_
;

117 i((
t
 = 
	`__bam_ad_ro
(
dbp
, 
txn
, 
ba_pgno
, 
ags
)) != 0)

118  (
t
);

128 i(
t
->
_sour
 !
NULL
 && (
t
 = 
	`__m_sour
(
dbp
)) != 0)

129  (
t
);

132 i(
	`F_ISSET
(
dbp
, 
DB_AM_SNAPSHOT
)) {

134 i((
t
 = 
	`__db_curs
(
dbp
, 
NULL
, &
dbc
, 0)) != 0)

135  (
t
);

138 i((
t
 = 
	`__m_upde
(
dbc
,

139 
DB_MAX_RECORDS
, 0)!0 && 
t
 =
DB_NOTFOUND
)

140 
t
 = 0;

143 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

144 
t
 = 
t_t
;

147  (
t
);

148 
	}
}

157 
	$__m_nd
(
dbc
, 
key
, 
da
)

158 
DBC
 *
dbc
;

159 
DBT
 *
key
, *
da
;

161 
BTREE_CURSOR
 *

;

162 
t
;

164 

 = (
BTREE_CURSOR
 *)
dbc
->

;

171 
t
 = 
	`__m_upde
(
dbc
, 
DB_MAX_RECORDS
, 0);

172 i(
t
 =0 || =
DB_NOTFOUND
)

173 
t
 = 
	`__m_add
(
dbc
, &

->
o
, 
da
, 
DB_APPEND
, 0);

176 i(
t
 =0 && 
key
 !
NULL
)

177 
t
 = 
	`__db_tcy
(
dbc
->
dbp
->
dbv
, 
key
, &

->
o
,

178 (

->
o
), &
dbc
->
rkey
->
da
, &dbc->rkey->
un
);

180  (
t
);

181 
	}
}

190 
	$__mc_d
(
dbc
)

191 
DBC
 *
dbc
;

193 
BKEYDATA
 
bk
;

194 
BTREE
 *
t
;

195 
BTREE_CURSOR
 *

;

196 
DB
 *
dbp
;

197 
DB_LSN
 
l
;

198 
DBT
 
hdr
, 
da
;

199 
exa
, 
nc
, 
t
, 
ack
, 
t_t
;

201 
dbp
 = 
dbc
->dbp;

202 

 = (
BTREE_CURSOR
 *)
dbc
->

;

203 
t
 = 
dbp
->
bt_
;

204 
ack
 = 0;

217 i(
	`CD_ISSET
(

))

218  (
DB_KEYEMPTY
);

221 i((
t
 = 
	`__bam_rch
(
dbc
, &

->
o
, 
SR_DELETE
, 1, &
exa
)) != 0)

222 
r
;

223 i(!
exa
) {

224 
t
 = 
DB_NOTFOUND
;

225 
r
;

227 
ack
 = 1;

230 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
,

231 &

->
c
->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

232 
r
;

233 
	`STACK_TO_CURSOR
(

, 
t
);

234 i(
t
 != 0)

235 
r
;

248 i(
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 

->
ge
, cp->
dx
)->
ty
)) {

249 
t
 = 
DB_KEYEMPTY
;

250 
r
;

253 i(
	`F_ISSET
(

, 
C_RENUMBER
)) {

255 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

256 
r
;

257 i((
t
 = 
	`__bam_adju
(
dbc
, -1)) != 0)

258 
r
;

259 i((
t
 = 
	`__m_
(
dbc
, 
CA_DELETE
, &
nc
)) != 0)

260 
r
;

261 i(
nc
 > 0 &&

262 
	`CURADJ_LOG
(
dbc
&& (
t
 = 
	`__bam_rcudj_log
(
dbp
, dbc->
txn
,

263 &
l
, 0, 
CA_DELETE
, 

->
ro
, cp->
o
, cp->
d
)) != 0)

264 
r
;

279 i(
	`NUM_ENT
(

->
ge
=0 && 
	`PGNO
(->ge!->
ro
) {

284 
t
 = 
	`__bam_dges
(
dbc
, 0, 0);

290 
ack
 = 0;

291 

->
ge
 = 
NULL
;

295 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

296 
r
;

298 
	`B_TSET_DELETED
(
bk
.
ty
, 
B_KEYDATA
);

299 
bk
.
n
 = 0;

300 
	`DB_INIT_DBT
(
hdr
, &
bk
, 
	`SSZA
(
BKEYDATA
, 
da
));

301 
	`DB_INIT_DBT
(
da
, "", 0);

302 i((
t
 = 
	`__db_pem
(
dbc
,

303 

->
ge
, cp->
dx
, 
	`BKEYDATA_SIZE
(0), &
hdr
, &
da
)) != 0)

304 
r
;

307 
t
->
_modifd
 = 1;

309 
r
: i(
ack
 && (
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
)!0 && 
t
 == 0)

310 
t
 = 
t_t
;

312  (
t
);

313 
	}
}

323 
	$__mc_g
(
dbc
, 
key
, 
da
, 
ags
, 
pgn
)

324 
DBC
 *
dbc
;

325 
DBT
 *
key
, *
da
;

326 
u_t32_t
 
ags
;

327 
db_pgno_t
 *
pgn
;

329 
BTREE_CURSOR
 *

;

330 
DB
 *
dbp
;

331 
cmp
, 
exa
, 
t
;

333 
	`COMPQUIET
(
pgn
, 
NULL
);

335 
dbp
 = 
dbc
->dbp;

336 

 = (
BTREE_CURSOR
 *)
dbc
->

;

338 
	`LF_CLR
(
DB_MULTIPLE
|
DB_MULTIPLE_KEY
);

339 
y
: 
ags
) {

340 
DB_CURRENT
:

346 i(
	`CD_ISSET
(

))

347  (
DB_KEYEMPTY
);

349 
DB_NEXT_DUP
:

356 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
))

357  (
DB_NOTFOUND
);

359 
DB_NEXT_NODUP
:

365 
DB_NEXT
:

366 
ags
 = 
DB_NEXT
;

372 i(
	`CD_ISSET
(

)) {

376 
	`CD_CLR
(

);

380 i(

->
o
 !
RECNO_OOB
) {

381 ++

->
o
;

385 
DB_FIRST
:

386 
ags
 = 
DB_NEXT
;

387 

->
o
 = 1;

389 
DB_PREV_DUP
:

396 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
))

397  (
DB_NOTFOUND
);

399 
DB_PREV_NODUP
:

405 
DB_PREV
:

406 
ags
 = 
DB_PREV
;

407 i(

->
o
 !
RECNO_OOB
) {

408 i(

->
o
 == 1) {

409 
t
 = 
DB_NOTFOUND
;

410 
r
;

412 --

->
o
;

416 
DB_LAST
:

417 
ags
 = 
DB_PREV
;

418 i(((
t
 = 
	`__m_upde
(
dbc
,

419 
DB_MAX_RECORDS
, 0)!0&& 
t
 !
DB_NOTFOUND
)

420 
r
;

421 i((
t
 = 
	`__bam_ecs
(
dbc
, &

->
o
)) != 0)

422 
r
;

423 i(

->
o
 == 0) {

424 
t
 = 
DB_NOTFOUND
;

425 
r
;

428 
DB_GET_BOTHC
:

438 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

439 

->
o
++;

442 
t
 = 
DB_NOTFOUND
;

443 
r
;

445 
DB_GET_BOTH
:

446 
DB_GET_BOTH_RANGE
:

453 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

454 

->
o
 = 1;

458 
DB_SET
:

459 
DB_SET_RANGE
:

460 i((
t
 = 
	`__m_gno
(
dbc
, 
key
, &

->
o
, 0)) != 0)

461 
r
;

464 
t
 = 
	`__db_unknown_ag
(
dbp
->
dbv
, "__mc_g", 
ags
);

465 
r
;

477 i((
ags
 =
DB_NEXT
 || fg=
DB_CURRENT
&& ((
t
 =

478 
	`__m_upde
(
dbc
, 

->
o
, 0)!0&& 
t
 !
DB_NOTFOUND
)

479 
r
;

481 ;; ++

->
o
) {

483 i((
t
 = 
	`__bam_rch
(
dbc
, &

->
o
,

484 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
,

485 1, &
exa
)) != 0)

486 
r
;

487 i(!
exa
) {

488 
t
 = 
DB_NOTFOUND
;

489 
r
;

493 
	`STACK_TO_CURSOR
(

, 
t
);

494 i(
t
 != 0)

495 
r
;

506 i(
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 

->
ge
, cp->
dx
)->
ty
))

507 
ags
) {

508 
DB_NEXT
:

509 
DB_PREV
:

510 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

511 
y
;

512 
DB_GET_BOTH
:

513 
DB_GET_BOTH_RANGE
:

521 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

522 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

525 
t
 = 
DB_NOTFOUND
;

526 
r
;

528 
t
 = 
DB_KEYEMPTY
;

529 
r
;

532 i(
ags
 =
DB_GET_BOTH
 ||

533 
ags
 =
DB_GET_BOTHC
 || fg=
DB_GET_BOTH_RANGE
) {

534 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
da
,

535 

->
ge
, cp->
dx
, 
__bam_defcmp
, &
cmp
)) != 0)

536  (
t
);

537 i(
cmp
 == 0)

539 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

540 
t
 = 
DB_NOTFOUND
;

541 
r
;

543 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

549 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
&& !F_ISSET(
key
, 
DB_DBT_ISSET
)) {

550 
t
 = 
	`__db_tcy
(
dbp
->
dbv
,

551 
key
, &

->
o
, (cp->recno),

552 &
dbc
->
rkey
->
da
, &dbc->rkey->
un
);

553 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

557 
r
: 
	`CD_CLR
(

);

559  (
t
);

560 
	}
}

569 
	$__mc_put
(
dbc
, 
key
, 
da
, 
ags
, 
pgn
)

570 
DBC
 *
dbc
;

571 
DBT
 *
key
, *
da
;

572 
u_t32_t
 
ags
;

573 
db_pgno_t
 *
pgn
;

575 
BTREE_CURSOR
 *

;

576 
DB
 *
dbp
;

577 
DB_ENV
 *
dbv
;

578 
DB_LSN
 
l
;

579 
u_t32_t
 
iiags
;

580 
exa
, 
nc
, 
t
, 
t_t
;

581 *
g
;

583 
	`COMPQUIET
(
pgn
, 
NULL
);

585 
dbp
 = 
dbc
->dbp;

586 
dbv
 = 
dbp
->dbenv;

587 

 = (
BTREE_CURSOR
 *)
dbc
->

;

596 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
))

597 
ags
) {

598 
DB_KEYFIRST
:

599 

->
o
 = 1;

600 
ags
 = 
DB_BEFORE
;

602 
DB_KEYLAST
:

603 i((
t
 = 
	`__m_add
(
dbc
,

604 &

->
o
, 
da
, 
DB_APPEND
, 0)) != 0)

605  (
t
);

606 i(
	`CURADJ_LOG
(
dbc
) &&

607 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0,

608 
CA_ICURRENT
, 

->
ro
, cp->
o
, cp->
d
)) != 0)

609  (
t
);

620 i(
ags
 =
DB_KEYFIRST
 ||

621 
ags
 =
DB_KEYLAST
 || fg=
DB_NOOVERWRITE
) {

622 
t
 = 
	`__m_gno
(
dbc
, 
key
, &

->
o
, 1);

623 i(
t
 =0 || =
DB_NOTFOUND
)

624 
t
 = 
	`__m_add
(
dbc
, &

->
o
, 
da
, 
ags
, 0);

625  (
t
);

636 i(
	`CD_ISSET
(

))

637 
iiags
 = 
DB_BEFORE
;

639 
iiags
 = 
ags
;

641 
l
: i((
t
 = 
	`__bam_rch
(
dbc
, &

->
o
, 
SR_INSERT
, 1, &
exa
)) != 0)

642 
r
;

647 
	`DB_ASSERT
(
dbv
, 
exa
 || 
	`CD_ISSET
(

));

650 
	`STACK_TO_CURSOR
(

, 
t
);

651 i(
t
 != 0)

652 
r
;

654 
t
 = 
	`__bam_iem
(
dbc
, 
key
, 
da
, 
iiags
, 0);

655 
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

657 i(
t_t
 !0 && (
t
 =0 || =
DB_NEEDSPLIT
))

658 
t
 = 
t_t
;

659 i(
t
 =
DB_NEEDSPLIT
) {

660 
g
 = &

->
o
;

661 i((
t
 = 
	`__bam_l
(
dbc
, 
g
, 
NULL
)) != 0)

662 
r
;

663 
l
;

665 i(
t
 != 0)

666 
r
;

668 
ags
) {

669 
DB_AFTER
:

670 i((
t
 = 
	`__m_
(
dbc
, 
CA_IAFTER
, &
nc
)) != 0)

671 
r
;

678 i(
iiags
 =
DB_AFTER
)

679 ++

->
o
;

682 i(
nc
 > 0 && 
	`CURADJ_LOG
(
dbc
) &&

683 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0, 
CA_IAFTER
,

684 

->
ro
, cp->
o
, cp->
d
)) != 0)

685 
r
;

687 
DB_BEFORE
:

688 i((
t
 = 
	`__m_
(
dbc
, 
CA_IBEFORE
, &
nc
)) != 0)

689 
r
;

690 --

->
o
;

693 i(
nc
 > 0 && 
	`CURADJ_LOG
(
dbc
) &&

694 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0, 
CA_IBEFORE
,

695 

->
ro
, cp->
o
, cp->
d
)) != 0)

696 
r
;

698 
DB_CURRENT
:

704 i(!
	`CD_ISSET
(

))

708 i((
t
 = 
	`__m_
(
dbc
, 
CA_ICURRENT
, &
nc
)) != 0)

709 
r
;

710 i(
nc
 > 0 && 
	`CURADJ_LOG
(
dbc
) &&

711 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0,

712 
CA_ICURRENT
, 

->
ro
, cp->
o
, cp->
d
)) != 0)

713 
r
;

720 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
) &&

721 (
ags
 =
DB_AFTER
 || fg=
DB_BEFORE
&& 
key
 !
NULL
)

722 
t
 = 
	`__db_tcy
(
dbv
, 
key
, &

->
o
,

723 (

->
o
), &
dbc
->
rkey
->
da
, &dbc->rkey->
un
);

726 
r
: 
	`CD_CLR
(

);

728  (
t
);

729 
	}
}

738 
	$__m_
(
dbc_g
, 

, 
foundp
)

739 
DBC
 *
dbc_g
;

740 
_o_g
 

;

741 *
foundp
;

743 
BTREE_CURSOR
 *

, *
_g
;

744 
DB
 *
dbp
, *
ldbp
;

745 
DB_ENV
 *
dbv
;

746 
DBC
 *
dbc
;

747 
db_o_t
 
o
;

748 
u_t32_t
 
d
;

749 
adjued
, 
found
;

751 
dbp
 = 
dbc_g
->dbp;

752 
dbv
 = 
dbp
->dbenv;

753 
_g
 = (
BTREE_CURSOR
 *)
dbc_g
->

;

754 
o
 = 
_g
->recno;

760 
	`DB_ASSERT
(
dbv
, 
	`F_ISSET
(
_g
, 
C_RENUMBER
));

762 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

772 i(

 =
CA_DELETE
) {

773 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

774 
d
 = 1;

775 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

776 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

777 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

778 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

779 

 = (
BTREE_CURSOR
 *)
dbc
->

;

780 i(
_g
->
ro
 =

->root &&

781 
o
 =

->&& 
	`CD_ISSET
(cp) &&

782 
d
 <

->order &&

783 !
	`MVCC_SKIP_CURADJ
(
dbc
, 

->
ro
))

784 
d
 = 

->order + 1;

786 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

789 
d
 = 
INVALID_ORDER
;

792 
	`FIND_FIRST_DB_MATCH
(
dbv
, 
dbp
, 
ldbp
);

793 
found
 = 0;

794 
ldbp
 !
NULL
 &&dbp->
adj_feid
 =
dbp
->adj_fileid;

795 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

796 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

797 
	`TAILQ_FOREACH
(
dbc
, &
ldbp
->
aive_queue
, 
lks
) {

798 

 = (
BTREE_CURSOR
 *)
dbc
->

;

799 i(
_g
->
ro
 !

->root ||

800 
	`MVCC_SKIP_CURADJ
(
dbc
, 

->
ro
))

802 ++
found
;

803 
adjued
 = 0;

804 

) {

805 
CA_DELETE
:

806 i(
o
 < 

->recno) {

807 --

->
o
;

812 i(
o
 =

->&& 
	`CD_ISSET
(cp))

813 

->
d
 += order;

814 } i(
o
 =

->recno &&

815 !
	`CD_ISSET
(

)) {

816 
	`CD_SET
(

);

817 

->
d
 = order;

820 
CA_IBEFORE
:

825 i(
	`C_EQUAL
(
_g
, 

)) {

826 ++

->
o
;

827 
adjued
 = 1;

829 

;

830 
CA_ICURRENT
:

842 
	`DB_ASSERT
(
dbv
, 
	`CD_ISSET
(
_g
));

843 i(
	`C_EQUAL
(
_g
, 

)) {

844 
	`CD_CLR
(

);

848 
CA_IAFTER
:

849 

: i(!
adjued
 && 
	`C_LESSTHAN
(
_g
, 

)) {

850 ++

->
o
;

851 
adjued
 = 1;

853 i(
o
 =

->&& 
adjued
)

862 

->
d
 -(
_g
->order - 1);

866 
	`MUTEX_UNLOCK
(
dbp
->
dbv
, dbp->
mux
);

868 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

870 i(
foundp
 !
NULL
)

871 *
foundp
 = 
found
;

873 
	}
}

882 
	$__m_gno
(
dbc
, 
key
, 
p
, 
n_
)

883 
DBC
 *
dbc
;

884 cڡ 
DBT
 *
key
;

885 
db_o_t
 *
p
;

886 
n_
;

888 
DB
 *
dbp
;

889 
db_o_t
 
o
;

891 
dbp
 = 
dbc
->dbp;

894 i((
o
 = *(
db_o_t
 *)
key
->
da
) == 0) {

895 
	`__db_rx
(
dbp
->
dbv
, "illegalecordumber of 0");

896  (
EINVAL
);

898 i(
p
 !
NULL
)

899 *
p
 = 
o
;

905  (
dbc
->
dbty
 =
DB_RECNO
 ?

906 
	`__m_upde
(
dbc
, 
o
, 
n_
) : 0);

907 
	}
}

914 
	$__m_upde
(
dbc
, 
o
, 
n_
)

915 
DBC
 *
dbc
;

916 
db_o_t
 
o
;

917 
n_
;

919 
BTREE
 *
t
;

920 
DB
 *
dbp
;

921 
DBT
 *
rda
;

922 
db_o_t
 
ecs
;

923 
t
;

925 
dbp
 = 
dbc
->dbp;

926 
t
 = 
dbp
->
bt_
;

932 i(!
n_
 && 
t
->
_eof
)

939 i((
t
 = 
	`__bam_ecs
(
dbc
, &
ecs
)) != 0)

940  (
t
);

941 i(!
t
->
_eof
 && 
o
 > 
ecs
) {

942 i((
t
 = 
	`__m_d
(
dbc
, 
o
)!0 && !
DB_NOTFOUND
)

943  (
t
);

944 i((
t
 = 
	`__bam_ecs
(
dbc
, &
ecs
)) != 0)

945  (
t
);

952 i(!
n_
 || 
o
 <
ecs
 + 1)

955 
rda
 = &
dbc
->
my_rda
;

956 
rda
->
ags
 = 0;

957 
rda
->
size
 = 0;

959 
o
 > ++
ecs
)

960 i((
t
 = 
	`__m_add
(
dbc
,

961 &
ecs
, 
rda
, 0, 
BI_DELETED
)) != 0)

962  (
t
);

964 
	}
}

971 
	$__m_sour
(
dbp
)

972 
DB
 *
dbp
;

974 
DB_ENV
 *
dbv
;

975 
BTREE
 *
t
;

976 *
sour
;

977 
t
;

979 
dbv
 = 
dbp
->dbenv;

980 
t
 = 
dbp
->
bt_
;

983 i((
t
 = 
	`__db_ame
(
dbv
,

984 
DB_APP_DATA
, 
t
->
_sour
, 0, 
NULL
, &
sour
)) != 0)

985  (
t
);

986 
	`__os_
(
dbv
, 
t
->
_sour
);

987 
t
->
_sour
 = 
sour
;

995 i((
t
->
_
 = 
	`fݒ
->
_sour
, "rb")=
NULL
) {

996 
t
 = 
	`__os_g_o
();

997 
	`__db_r
(
dbv
, 
t
, "%s", 
t
->
_sour
);

998  (
t
);

1001 
t
->
_eof
 = 0;

1003 
	}
}

1012 
	$__m_wreback
(
dbp
)

1013 
DB
 *
dbp
;

1015 
BTREE
 *
t
;

1016 
DB_ENV
 *
dbv
;

1017 
DBC
 *
dbc
;

1018 
DBT
 
key
, 
da
;

1019 
FILE
 *

;

1020 
db_o_t
 
keyno
;

1021 
t
, 
t_t
;

1022 
u_t8_t
 
dim
, *
d
;

1024 
t
 = 
dbp
->
bt_
;

1025 
dbv
 = 
dbp
->dbenv;

1026 

 = 
NULL
;

1027 
d
 = 
NULL
;

1030 i(!
t
->
_modifd
)

1034 i(
t
->
_sour
 =
NULL
) {

1035 
t
->
_modifd
 = 0;

1045 
	`memt
(&
key
, 0, (key));

1046 
key
.
size
 = (
db_o_t
);

1047 
key
.
da
 = &
keyno
;

1048 
	`memt
(&
da
, 0, (data));

1049 
	`F_SET
(&
da
, 
DB_DBT_REALLOC
);

1052 i((
t
 = 
	`__db_curs
(
dbp
, 
NULL
, &
dbc
, 0)) != 0)

1053  (
t
);

1076 i((
t
 =

1077 
	`__m_upde
(
dbc
, 
DB_MAX_RECORDS
, 0)!0 && 
t
 !
DB_NOTFOUND
)

1078 
r
;

1083 i(
t
->
_
 !
NULL
) {

1084 i(
	`fo
(
t
->
_
) != 0) {

1085 
t
 = 
	`__os_g_o
();

1086 
	`__db_r
(
dbv
, 
t
, "%s", 
t
->
_sour
);

1087 
r
;

1089 
t
->
_
 = 
NULL
;

1091 i((

 = 
	`fݒ
(
t
->
_sour
, "wb")=
NULL
) {

1092 
t
 = 
	`__os_g_o
();

1093 
	`__db_r
(
dbv
, 
t
, "%s", 
t
->
_sour
);

1094 
r
;

1101 
dim
 = 
t
->
_dim
;

1102 
keyno
 = 1;; ++keyno) {

1103 
t
 = 
	`__db_g
(
dbp
, 
NULL
, &
key
, &
da
, 0)) {

1105 i(
da
.
size
 != 0 &&

1106 
	`fwre
(
da
.da, 1, da.
size
, 

) != data.size)

1107 
wre_r
;

1109 
DB_KEYEMPTY
:

1110 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
)) {

1111 i(
d
 =
NULL
) {

1112 i((
t
 = 
	`__os_mloc
(

1113 
dbv
, 
t
->
_n
, &
d
)) != 0)

1114 
r
;

1115 
	`memt
(
d
, 
t
->
_d
,->
_n
);

1117 i(
	`fwre
(
d
, 1, 
t
->
_n
, 

) !=->re_len)

1118 
wre_r
;

1121 
DB_NOTFOUND
:

1122 
t
 = 0;

1123 
de
;

1125 
r
;

1127 i(!
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
) &&

1128 
	`fwre
(&
dim
, 1, 1, 

) != 1) {

1129 
wre_r
: 
t
 = 
	`__os_g_o
();

1130 
	`__db_r
(
dbv
, 
t
,

1131 "%s: wredbackg fe", 
t
->
_sour
);

1132 
r
;

1136 
r
:

1137 
de
:

1138 i(

 !
NULL
 && 
	`fo
(fp) != 0) {

1139 
t_t
 = 
	`__os_g_o
();

1140 
	`__db_r
(
dbv
, 
t_t
, "%s", 
t
->
_sour
);

1141 i(
t
 == 0)

1142 
t
 = 
t_t
;

1146 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

1147 
t
 = 
t_t
;

1150 i(
da
.d!
NULL
)

1151 
	`__os_u
(
dbv
, 
da
.data);

1152 i(
d
 !
NULL
)

1153 
	`__os_
(
dbv
, 
d
);

1155 i(
t
 == 0)

1156 
t
->
_modifd
 = 0;

1158  (
t
);

1159 
	}
}

1166 
	$__m_d
(
dbc
, 
t
)

1167 
DBC
 *
dbc
;

1168 
db_o_t
 
t
;

1170 
BTREE
 *
t
;

1171 
DB
 *
dbp
;

1172 
DBT
 
da
, *
rda
;

1173 
db_o_t
 
o
;

1174 
size_t
 
n
;

1175 
ch
, 
t
, 
was_modifd
;

1177 
t
 = 
dbc
->
dbp
->
bt_
;

1178 
dbp
 = 
dbc
->dbp;

1179 
was_modifd
 = 
t
->
_modifd
;

1181 i((
t
 = 
	`__bam_ecs
(
dbc
, &
o
)) != 0)

1182  (
t
);

1189 
n
 = 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? 
t
->
_n
 : 256;

1190 
rda
 = &
dbc
->
my_rkey
;

1191 i(
rda
->
un
 < 
n
) {

1192 i((
t
 = 
	`__os_loc
(

1193 
dbp
->
dbv
, 
n
, &
rda
->
da
)) != 0) {

1194 
rda
->
un
 = 0;

1195 
rda
->
da
 = 
NULL
;

1196  (
t
);

1198 
rda
->
un
 = (
u_t32_t
)
n
;

1201 
	`memt
(&
da
, 0, (data));

1202 
o
 < 
t
) {

1203 
da
.d
rda
->data;

1204 
da
.
size
 = 0;

1205 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
))

1206 
n
 = 
t
->
_n
;en > 0; --len) {

1207 i((
ch
 = 
	`fgc
(
t
->
_
)=
EOF
) {

1208 i(
da
.
size
 == 0)

1209 
eof
;

1212 ((
u_t8_t
 *)
da
.da)[da.
size
++] = 
ch
;

1216 i((
ch
 = 
	`fgc
(
t
->
_
)=
EOF
) {

1217 i(
da
.
size
 == 0)

1218 
eof
;

1221 i(
ch
 =
t
->
_dim
)

1224 ((
u_t8_t
 *)
da
.da)[da.
size
++] = 
ch
;

1225 i(
da
.
size
 =
rda
->
un
) {

1226 i((
t
 = 
	`__os_loc
(
dbp
->
dbv
,

1227 
rda
->
un
 *= 2,

1228 &
rda
->
da
)) != 0) {

1229 
rda
->
un
 = 0;

1230 
rda
->
da
 = 
NULL
;

1231  (
t
);

1233 
da
.d
rda
->data;

1244 i(
t
->
_ϡ
 >
o
) {

1245 ++
o
;

1246 i((
t
 = 
	`__m_add
(
dbc
, &
o
, &
da
, 0, 0)) != 0)

1247 
r
;

1249 ++
t
->
_ϡ
;

1253 
eof
: 
t
->
_eof
 = 1;

1254 
t
 = 
DB_NOTFOUND
;

1256 
r
: i(!
was_modifd
)

1257 
t
->
_modifd
 = 0;

1259  (
t
);

1260 
	}
}

1267 
	$__m_add
(
dbc
, 

, 
da
, 
ags
, 
bi_ags
)

1268 
DBC
 *
dbc
;

1269 
db_o_t
 *

;

1270 
DBT
 *
da
;

1271 
u_t32_t
 
ags
, 
bi_ags
;

1273 
BTREE_CURSOR
 *

;

1274 
exa
, 
t
, 
ack
, 
t_t
;

1276 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1278 
y
:

1279 i((
t
 = 
	`__bam_rch
(
dbc
, 

,

1280 
SR_INSERT
 | (
ags
 =
DB_APPEND
 ? 
SR_APPEND
 : 0), 1, &
exa
)) != 0)

1281  (
t
);

1282 
ack
 = 1;

1285 
	`STACK_TO_CURSOR
(

, 
t
);

1286 i(
t
 != 0)

1287 
r
;

1289 i(
exa
 && 
ags
 =
DB_NOOVERWRITE
 && !
	`CD_ISSET
(

) &&

1290 !
	`B_DISSET
(
	`GET_BKEYDATA
(
dbc
->
dbp
, 

->
ge
, cp->
dx
)->
ty
)) {

1291 
t
 = 
DB_KEYEXIST
;

1292 
r
;

1299 i(
ags
 =
DB_APPEND
 && 
dbc
->
dbp
->
db_nd_o
 !
NULL
 &&

1300 (
t
 = 
dbc
->
dbp
->
	`db_nd_o
(dbc->dbp, 
da
, *

)) != 0)

1301 
r
;

1310 
t
 = 
	`__bam_iem
(
dbc
,

1311 
NULL
, 
da
, 
exa
 ? 
DB_CURRENT
 : 
DB_BEFORE
, 
bi_ags
)) {

1329 
DB_NEEDSPLIT
:

1331 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

1332 
ack
 = 0;

1334 i((
t
 = 
	`__bam_l
(
dbc
, 

, 
NULL
)) != 0)

1335 
r
;

1337 
y
;

1340 
r
;

1343 
r
: i(
ack
 && (
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
)!0 && 
t
 == 0)

1344 
t
 = 
t_t
;

1346  (
t
);

1347 
	}
}

	@../btree/bt_rsearch.c

41 
	~"db_cfig.h
"

43 
	~"db_t.h
"

44 
	~"dbc/db_ge.h
"

45 
	~"dbc/b.h
"

46 
	~"dbc/lock.h
"

47 
	~"dbc/mp.h
"

56 
	$__bam_rch
(
dbc
, 

, 
ags
, 

, 
exap
)

57 
DBC
 *
dbc
;

58 
db_o_t
 *

;

59 
u_t32_t
 
ags
;

60 

, *
exap
;

62 
BINTERNAL
 *
bi
;

63 
BTREE_CURSOR
 *

;

64 
DB
 *
dbp
;

65 
DB_LOCK
 
lock
;

66 
DB_MPOOLFILE
 *
mpf
;

67 
PAGE
 *
h
;

68 
RINTERNAL
 *
ri
;

69 
db_dx_t
 
adju
, 
dofft
, 
dx
, 
t
;

70 
db_lockmode_t
 
lock_mode
;

71 
db_pgno_t
 
pg
;

72 
db_o_t
 
o
, 
t_o
, 
tٮ
;

73 
t
, 
ack
, 
t_t
;

75 
dbp
 = 
dbc
->dbp;

76 
mpf
 = 
dbp
->mpf;

77 

 = (
BTREE_CURSOR
 *)
dbc
->

;

78 
h
 = 
NULL
;

80 
	`BT_STK_CLR
(

);

98 i((
t
 = 
	`__bam_g_ro
(
dbc
, 

->
ro
, 

, 
ags
, &
ack
)) != 0)

99  (
t
);

100 
lock_mode
 = 

->
c
->lock_mode;

101 
lock
 = 

->
c
->lock;

102 
h
 = 

->
c
->
ge
;

104 
	`BT_STK_CLR
(

);

117 
tٮ
 = 
	`RE_NREC
(
h
);

118 i(
	`LF_ISSET
(
SR_APPEND
)) {

119 *
exap
 = 0;

120 *

 = 
o
 = 
tٮ
 + 1;

122 
o
 = *

;

123 i(
o
 <
tٮ
)

124 *
exap
 = 1;

126 *
exap
 = 0;

127 i(!
	`LF_ISSET
(
SR_PAST_EOF
|| 
o
 > 
tٮ
 + 1) {

136 
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
);

137 i((
t_t
 =

138 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

139 
t
 = 
t_t
;

140  (
t
 =0 ? 
DB_NOTFOUND
 :et);

151 
tٮ
 = 0;;) {

152 
	`TYPE
(
h
)) {

153 
P_LBTREE
:

154 
P_LDUP
:

155 
o
 -
tٮ
;

160 i(
	`TYPE
(
h
=
P_LBTREE
) {

161 
adju
 = 
P_INDX
;

162 
dofft
 = 
O_INDX
;

164 
adju
 = 
O_INDX
;

165 
dofft
 = 0;

167 
t_o
 = 0, 
dx
 = 0;; indx +
adju
) {

168 i(
dx
 >
	`NUM_ENT
(
h
)) {

169 *
exap
 = 0;

170 i(!
	`LF_ISSET
(
SR_PAST_EOF
) ||

171 
o
 > 
t_o
 + 1) {

172 
t
 = 
	`__memp_ut
(
mpf
,

173 
h
, 
dbc
->
iܙy
);

174 
h
 = 
NULL
;

175 i((
t_t
 = 
	`__TLPUT
(
dbc
,

176 
lock
)!0 && 
t
 == 0)

177 
t
 = 
t_t
;

178 i(
t
 == 0)

179 
t
 = 
DB_NOTFOUND
;

180 
r
;

183 i(!
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
,

184 
dx
 + 
dofft
)->
ty
) &&

185 ++
t_o
 =
o
)

190 
	`BT_STK_ENTER
(
dbp
->
dbv
,

191 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

192 i(
t
 != 0)

193 
r
;

195 
P_IBTREE
:

196 
dx
 = 0, 
t
 = 
	`NUM_ENT
(
h
);;) {

197 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
);

198 i(++
dx
 =
t
 || 
tٮ
 + 
bi
->
ecs
 >
o
)

200 
tٮ
 +
bi
->
ecs
;

202 
pg
 = 
bi
->
pgno
;

204 
P_LRECNO
:

205 
o
 -
tٮ
;

208 --
o
;

209 
	`BT_STK_ENTER
(
dbp
->
dbv
,

210 

, 
h
, 
o
, 
lock
, 
lock_mode
, 
t
);

211 i(
t
 != 0)

212 
r
;

214 
P_IRECNO
:

215 
dx
 = 0, 
t
 = 
	`NUM_ENT
(
h
);;) {

216 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
dx
);

217 i(++
dx
 =
t
 || 
tٮ
 + 
ri
->
ecs
 >
o
)

219 
tٮ
 +
ri
->
ecs
;

221 
pg
 = 
ri
->
pgno
;

224  (
	`__db_pgfmt
(
dbp
->
dbv
, 
h
->
pgno
));

226 --
dx
;

229 i(

 =
	`LEVEL
(
h
)) {

230 
	`BT_STK_ENTER
(
dbp
->
dbv
,

231 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

232 i(
t
 != 0)

233 
r
;

236 i(
ack
) {

237 
	`BT_STK_PUSH
(
dbp
->
dbv
,

238 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

239 i(
t
 != 0)

240 
r
;

241 
h
 = 
NULL
;

243 
lock_mode
 = 
DB_LOCK_WRITE
;

244 i((
t
 =

245 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

246 
r
;

253 i((
	`LF_ISSET
(
SR_PARENT
) &&

254 (
u_t8_t
)(

 + 1>(u_t8_t)(
	`LEVEL
(
h
) - 1)) ||

255 (
	`LEVEL
(
h
- 1=
LEAFLEVEL
)

256 
ack
 = 1;

258 i((
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)) != 0)

259 
r
;

260 
h
 = 
NULL
;

262 
lock_mode
 = 
ack
 &&

263 
	`LF_ISSET
(
SR_WRITE
? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
;

264 i((
t
 = 
	`__db_lg
(
dbc
,

265 
LCK_COUPLE_ALWAYS
, 
pg
, 
lock_mode
, 0, &
lock
)) != 0) {

271 ()
	`__LPUT
(
dbc
, 
lock
);

272 
r
;

276 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
, 
dbc
->
txn
, 0, &
h
)) != 0)

277 
r
;

281 
r
: i(
h
 !
NULL
 &&

282 (
t_t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

283 
t
 = 
t_t
;

285 
	`BT_STK_POP
(

);

286 
	`__bam_kl
(
dbc
, 0);

288  (
t
);

289 
	}
}

298 
	$__bam_adju
(
dbc
, 
adju
)

299 
DBC
 *
dbc
;

300 
t32_t
 
adju
;

302 
BTREE_CURSOR
 *

;

303 
DB
 *
dbp
;

304 
DB_MPOOLFILE
 *
mpf
;

305 
EPG
 *
g
;

306 
PAGE
 *
h
;

307 
db_pgno_t
 
ro_pgno
;

308 
t
;

310 
dbp
 = 
dbc
->dbp;

311 
mpf
 = 
dbp
->mpf;

312 

 = (
BTREE_CURSOR
 *)
dbc
->

;

313 
ro_pgno
 = 

->
ro
;

316 
g
 = 

->

;pg <->
c
; ++epg) {

317 
h
 = 
g
->
ge
;

318 i(
	`TYPE
(
h
=
P_IBTREE
 || TYPE(h=
P_IRECNO
) {

319 i((
t
 = 
	`__memp_dty
(
mpf
,

320 &
h
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

321  (
t
);

322 
g
->
ge
 = 
h
;

323 i(
	`DBC_LOGGING
(
dbc
)) {

324 i((
t
 = 
	`__bam_dju_log
(
dbp
, 
dbc
->
txn
,

325 &
	`LSN
(
h
), 0, 
	`PGNO
(h), &LSN(h),

326 (
u_t32_t
)
g
->
dx
, 
adju
,

327 
	`PGNO
(
h
=
ro_pgno
 ?

328 
CAD_UPDATEROOT
 : 0)) != 0)

329  (
t
);

331 
	`LSN_NOT_LOGGED
(
	`LSN
(
h
));

333 i(
	`TYPE
(
h
=
P_IBTREE
)

334 
	`GET_BINTERNAL
(
dbp
, 
h
, 
g
->
dx
)->
ecs
 +=

335 
adju
;

337 
	`GET_RINTERNAL
(
dbp
, 
h
, 
g
->
dx
)->
ecs
 +=

338 
adju
;

340 i(
	`PGNO
(
h
=
ro_pgno
)

341 
	`RE_NREC_ADJ
(
h
, 
adju
);

345 
	}
}

354 
	$__bam_ecs
(
dbc
, 
p
)

355 
DBC
 *
dbc
;

356 
db_o_t
 *
p
;

358 
DB
 *
dbp
;

359 
DB_LOCK
 
lock
;

360 
DB_MPOOLFILE
 *
mpf
;

361 
PAGE
 *
h
;

362 
db_pgno_t
 
pgno
;

363 
t
, 
t_t
;

365 
dbp
 = 
dbc
->dbp;

366 
mpf
 = 
dbp
->mpf;

368 
pgno
 = 
dbc
->

->
ro
;

369 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_READ
, 0, &
lock
)) != 0)

370  (
t
);

371 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
txn
, 0, &
h
)) != 0)

372  (
t
);

374 *
p
 = 
	`RE_NREC
(
h
);

376 
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
);

377 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

378 
t
 = 
t_t
;

380  (
t
);

381 
	}
}

389 
db_o_t


390 
	$__bam_tٮ
(
dbp
, 
h
)

391 
DB
 *
dbp
;

392 
PAGE
 *
h
;

394 
db_o_t
 
ecs
;

395 
db_dx_t
 
dx
, 
t
;

397 
ecs
 = 0;

398 
t
 = 
	`NUM_ENT
(
h
);

400 
	`TYPE
(
h
)) {

401 
P_LBTREE
:

403 
dx
 = 0; indx < 
t
; indx +
P_INDX
)

404 i(!
	`B_DISSET
(

405 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->
ty
))

406 ++
ecs
;

408 
P_LDUP
:

410 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

411 i(!
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
)->
ty
))

412 ++
ecs
;

414 
P_IBTREE
:

415 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

416 
ecs
 +
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
)->nrecs;

418 
P_LRECNO
:

419 
ecs
 = 
	`NUM_ENT
(
h
);

421 
P_IRECNO
:

422 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

423 
ecs
 +
	`GET_RINTERNAL
(
dbp
, 
h
, 
dx
)->nrecs;

427  (
ecs
);

428 
	}
}

	@../btree/bt_search.c

44 
	~"db_cfig.h
"

46 
	~"db_t.h
"

47 
	~"dbc/db_ge.h
"

48 
	~"dbc/b.h
"

49 
	~"dbc/lock.h
"

50 
	~"dbc/mp.h
"

60 
	$__bam_g_ro
(
dbc
, 
pg
, 
ev
, 
ags
, 
ack
)

61 
DBC
 *
dbc
;

62 
db_pgno_t
 
pg
;

63 
ev
;

64 
u_t32_t
 
ags
;

65 *
ack
;

67 
BTREE_CURSOR
 *

;

68 
DB
 *
dbp
;

69 
DB_LOCK
 
lock
;

70 
DB_MPOOLFILE
 *
mpf
;

71 
PAGE
 *
h
;

72 
db_lockmode_t
 
lock_mode
;

73 
t
, 
t_t
;

75 
dbp
 = 
dbc
->dbp;

76 
mpf
 = 
dbp
->mpf;

77 

 = (
BTREE_CURSOR
 *)
dbc
->

;

87 
y_aga
:

88 *
ack
 = 
	`LF_ISSET
(
SR_STACK
) &&

89 (
dbc
->
dbty
 =
DB_RECNO
 || 
	`F_ISSET
(

, 
C_RECNUM
));

90 
lock_mode
 = 
DB_LOCK_READ
;

91 i(*
ack
 ||

92 
	`LF_ISSET
(
SR_DEL
|| (LF_ISSET(
SR_NEXT
&& LF_ISSET(
SR_WRITE
)))

93 
lock_mode
 = 
DB_LOCK_WRITE
;

94 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

95  (
t
);

96 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
, 
dbc
->
txn
, 0, &
h
)) != 0) {

98 ()
	`__LPUT
(
dbc
, 
lock
);

99  (
t
);

110 i(!*
ack
 &&

111 ((
	`LF_ISSET
(
SR_PARENT
&& (
u_t8_t
)(
ev
 + 1>
	`LEVEL
(
h
)) ||

112 (
	`LF_ISSET
(
SR_WRITE
&& 
	`LEVEL
(
h
=
LEAFLEVEL
) ||

113 (
	`LF_ISSET
(
SR_START
&& 
ev
 =
	`LEVEL
(
h
)))) {

114 i(!
	`STD_LOCKING
(
dbc
))

115 
no_lock
;

116 
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
);

117 i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

118 
t
 = 
t_t
;

119 i(
t
 != 0)

120  (
t
);

121 
lock_mode
 = 
DB_LOCK_WRITE
;

122 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

123  (
t
);

124 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
, 
dbc
->
txn
, 0, &
h
)) != 0) {

126 ()
	`__LPUT
(
dbc
, 
lock
);

127  (
t
);

129 i(!((
	`LF_ISSET
(
SR_PARENT
) &&

130 (
u_t8_t
)(
ev
 + 1>
	`LEVEL
(
h
)) ||

131 (
	`LF_ISSET
(
SR_WRITE
&& 
	`LEVEL
(
h
=
LEAFLEVEL
) ||

132 (
	`LF_ISSET
(
SR_START
&& 
ev
 =
	`LEVEL
(
h
)))) {

134 
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
);

135 i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

136 
t
 = 
t_t
;

137 i(
t
 != 0)

138  (
t
);

139 
y_aga
;

141 
no_lock
: *
ack
 = 1;

143 
	`BT_STK_ENTER
(
dbp
->
dbv
, 

, 
h
, 0, 
lock
, 
lock_mode
, 
t
);

145  (
t
);

146 
	}
}

156 
	$__bam_ch
(
dbc
, 
ro_pgno
, 
key
, 
ags
, 
ev
, 

, 
exap
)

157 
DBC
 *
dbc
;

158 
db_pgno_t
 
ro_pgno
;

159 cڡ 
DBT
 *
key
;

160 
u_t32_t
 
ags
;

161 
ev
, *
exap
;

162 
db_o_t
 *

;

164 
BTREE
 *
t
;

165 
BTREE_CURSOR
 *

;

166 
DB
 *
dbp
;

167 
DB_ENV
 *
dbv
;

168 
DB_LOCK
 
lock
;

169 
DB_MPOOLFILE
 *
mpf
;

170 
PAGE
 *
h
;

171 
db_dx_t
 
ba
, 
i
, 
dx
, *
p
, 
lim
;

172 
db_lockmode_t
 
lock_mode
;

173 
db_pgno_t
 
pg
;

174 
db_o_t
 
o
;

175 
adju
, 
cmp
, 
dofft
, 
t
, 
ack
, 
t_t
;

176 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

178 
dbp
 = 
dbc
->dbp;

179 
dbv
 = 
dbp
->dbenv;

180 
mpf
 = 
dbp
->mpf;

181 

 = (
BTREE_CURSOR
 *)
dbc
->

;

182 
h
 = 
NULL
;

183 
t
 = 
dbp
->
bt_
;

184 
o
 = 0;

186 
	`BT_STK_CLR
(

);

197 i(
ro_pgno
 =
PGNO_INVALID
)

198 
ro_pgno
 = 

->
ro
;

199 i((
t
 = 
	`__bam_g_ro
(
dbc
, 
ro_pgno
, 
ev
, 
ags
, &
ack
)) != 0)

200  (
t
);

201 
lock_mode
 = 

->
c
->lock_mode;

202 
lock
 = 

->
c
->lock;

203 
h
 = 

->
c
->
ge
;

205 
	`BT_STK_CLR
(

);

208 
func
 = 
	`F_ISSET
(
dbc
, 
DBC_OPD
) ?

209 (
dbp
->
dup_com
 =
NULL
 ? 
__bam_defcmp
 : dbp->dup_compare) :

210 
t
->
bt_com
;

213 
p
 = 
	`P_INP
(
dbp
, 
h
);

214 
adju
 = 
	`TYPE
(
h
=
P_LBTREE
 ? 
P_INDX
 : 
O_INDX
;

215 i(
	`LF_ISSET
(
SR_MIN
 | 
SR_MAX
)) {

216 i(
	`LF_ISSET
(
SR_MIN
|| 
	`NUM_ENT
(
h
) == 0)

217 
dx
 = 0;

218 i(
	`TYPE
(
h
=
P_LBTREE
)

219 
dx
 = 
	`NUM_ENT
(
h
) - 2;

221 
dx
 = 
	`NUM_ENT
(
h
) - 1;

223 i(
	`LEVEL
(
h
=
LEAFLEVEL
 ||

224 (!
	`LF_ISSET
(
SR_START
&& 
	`LEVEL
(
h
=
ev
)) {

225 i(
	`LF_ISSET
(
SR_NEXT
))

226 
g_xt
;

227 
found
;

229 
xt
;

238 
	`DB_BINARY_SEARCH_FOR
(
ba
, 
lim
, 
h
, 
adju
) {

239 
	`DB_BINARY_SEARCH_INCR
(
dx
, 
ba
, 
lim
, 
adju
);

240 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
txn
, 
key
,

241 
h
, 
dx
, 
func
, &
cmp
)) != 0)

242 
r
;

243 i(
cmp
 == 0) {

244 i(
	`LEVEL
(
h
=
LEAFLEVEL
 ||

245 (!
	`LF_ISSET
(
SR_START
) &&

246 
	`LEVEL
(
h
=
ev
)) {

247 i(
	`LF_ISSET
(
SR_NEXT
))

248 
g_xt
;

249 
found
;

251 
xt
;

253 i(
cmp
 > 0)

254 
	`DB_BINARY_SEARCH_SHIFT_BASE
(
dx
, 
ba
,

255 
lim
, 
adju
);

266 i(
	`LEVEL
(
h
=
LEAFLEVEL
 ||

267 (!
	`LF_ISSET
(
SR_START
&& 
	`LEVEL
(
h
=
ev
)) {

268 *
exap
 = 0;

270 i(
	`LF_ISSET
(
SR_EXACT
)) {

271 
t
 = 
DB_NOTFOUND
;

272 
r
;

275 i(
	`LF_ISSET
(
SR_STK_ONLY
)) {

276 
	`BT_STK_NUM
(
dbv
, 

, 
h
, 
ba
, 
t
);

277 i((
t_t
 =

278 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

279 
t
 = 
t_t
;

280 i((
t_t
 = 
	`__memp_ut
(
mpf
,

281 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

282 
t
 = 
t_t
;

283  (
t
);

285 i(
	`LF_ISSET
(
SR_NEXT
)) {

286 
g_xt
:

290 i(
	`PGNO
(
h
=
ro_pgno
) {

291 
t
 = 
DB_NOTFOUND
;

292 
r
;

300 i((
t
 = 
	`__LPUT
(
dbc
, 
lock
)) != 0)

301 
r
;

302 i((
t
 =

303 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)) != 0)

304 
r
;

305 
h
 = 
NULL
;

306 
	`LF_SET
(
SR_MIN
);

307 
	`LF_CLR
(
SR_NEXT
);

308 
dx
 = 

->

->indx + 1;

309 i(
dx
 =
	`NUM_ENT
(

->

->
ge
)) {

310 
t
 = 
DB_NOTFOUND
;

311 

->
c
++;

312 
r
;

314 
h
 = 

->

->
ge
;

315 

->

->
ge
 = 
NULL
;

316 
lock
 = 

->

->lock;

317 
	`LOCK_INIT
(

->

->
lock
);

318 i((
t
 = 
	`__bam_kl
(
dbc
, 
STK_NOLOCK
)) != 0)

319 
r
;

320 
ack
 = 1;

321 
xt
;

332 i(
	`LF_ISSET
(
SR_DEL
&& 

->
c
 =->

)

333 

->
c
++;

334 
	`BT_STK_ENTER
(
dbv
, 

, 
h
, 
ba
, 
lock
, 
lock_mode
, 
t
);

335 i(
t
 != 0)

336 
r
;

346 
dx
 = 
ba
 > 0 ? ba - 
O_INDX
 : base;

352 
xt
: i(

 !
NULL
)

353 
i
 = 0; i < 
dx
; ++i)

354 
o
 +
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
)->
ecs
;

356 
pg
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
)->
pgno
;

359 i(
	`LF_ISSET
(
SR_START
&& 
ev
 =
	`LEVEL
(
h
))

360 
ack
 = 1;

362 i(
	`LF_ISSET
(
SR_STK_ONLY
)) {

363 i(
ev
 =
	`LEVEL
(
h
)) {

364 
	`BT_STK_NUM
(
dbv
, 

, 
h
, 
dx
, 
t
);

365 i((
t_t
 =

366 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

367 
t
 = 
t_t
;

368 i((
t_t
 = 
	`__memp_ut
(
mpf
,

369 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

370 
t
 = 
t_t
;

371  (
t
);

373 
	`BT_STK_NUMPUSH
(
dbv
, 

, 
h
, 
dx
, 
t
);

374 ()
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
);

375 
h
 = 
NULL
;

376 i((
t
 = 
	`__db_lg
(
dbc
,

377 
LCK_COUPLE_ALWAYS
, 
pg
, 
lock_mode
, 0, &
lock
)) != 0) {

383 ()
	`__LPUT
(
dbc
, 
lock
);

384  (
t
);

386 } i(
ack
) {

388 i(
	`LF_ISSET
(
SR_PARENT
&& 
ev
 =
	`LEVEL
(
h
)) {

389 
	`BT_STK_ENTER
(
dbv
,

390 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

391 i(
t
 != 0)

392 
r
;

395 i(
	`LF_ISSET
(
SR_DEL
&& 
	`NUM_ENT
(
h
) > 1) {

400 

->
c
--;

401 i((
t
 = 
	`__bam_kl
(
dbc
, 
STK_NOLOCK
)) != 0)

402 
r
;

403 
ack
 = 0;

404 
do_d
;

406 
	`BT_STK_PUSH
(
dbv
,

407 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

408 i(
t
 != 0)

409 
r
;

410 
h
 = 
NULL
;

412 
lock_mode
 = 
DB_LOCK_WRITE
;

413 i((
t
 =

414 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

415 
r
;

422 i((
	`LF_ISSET
(
SR_PARENT
) &&

423 (
u_t8_t
)(
ev
 + 1>(
	`LEVEL
(
h
) - 1)) ||

424 (
	`LEVEL
(
h
- 1=
LEAFLEVEL
)

425 
ack
 = 1;

439 i(!
	`LF_ISSET
(
SR_DEL
 | 
SR_NEXT
)) {

440 i((
t
 =

441 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)) != 0)

442 
r
;

443 
lock_xt
;

446 i((
	`LF_ISSET
(
SR_DEL
&& 
	`NUM_ENT
(
h
) == 1)) {

447 
ack
 = 1;

448 
	`LF_SET
(
SR_WRITE
);

450 

->
c
++;

452 
	`BT_STK_PUSH
(
dbv
, 

, 
h
,

453 
dx
, 
lock
, 
lock_mode
, 
t
);

454 i(
t
 != 0)

455 
r
;

456 
	`LOCK_INIT
(
lock
);

467 
do_d
: i(

->
c
->
ge
 !
NULL
) {

468 i(
	`LF_ISSET
(
SR_NEXT
) &&

469 
dx
 =
	`NUM_ENT
(
h
) - 1)

470 

->
c
++;

471 i((
t
 =

472 
	`__bam_kl
(
dbc
, 
STK_NOLOCK
)) != 0)

473 
r
;

476 
	`BT_STK_ENTER
(
dbv
, 

,

477 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

478 i(
t
 != 0)

479 
r
;

480 
	`LOCK_INIT
(
lock
);

483 
lock_xt
: 
h
 = 
NULL
;

485 i(
ack
 && 
	`LF_ISSET
(
SR_WRITE
))

486 
lock_mode
 = 
DB_LOCK_WRITE
;

487 i((
t
 = 
	`__db_lg
(
dbc
,

488 
LCK_COUPLE_ALWAYS
, 
pg
, 
lock_mode
, 0, &
lock
)) != 0) {

494 ()
	`__LPUT
(
dbc
, 
lock
);

495 i(
	`LF_ISSET
(
SR_DEL
 | 
SR_NEXT
))

496 

->
c
++;

497 
r
;

500 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
, 
dbc
->
txn
, 0, &
h
)) != 0)

501 
r
;

505 
found
: *
exap
 = 1;

517 i(
	`TYPE
(
h
=
P_LBTREE
 && 
	`NUM_ENT
(h> 
P_INDX
) {

518 i(
	`LF_ISSET
(
SR_DUPLAST
))

519 
dx
 < (
db_dx_t
)(
	`NUM_ENT
(
h
- 
P_INDX
) &&

520 
p
[
dx
] =p[dx + 
P_INDX
])

521 
dx
 +
P_INDX
;

522 i(
	`LF_ISSET
(
SR_DUPFIRST
))

523 
dx
 > 0 &&

524 
p
[
dx
] =p[dx - 
P_INDX
])

525 
dx
 -
P_INDX
;

534 
	`DB_ASSERT
(
dbv
, 

 =
NULL
 || 
	`LF_ISSET
(
SR_DELNO
));

535 i(
	`LF_ISSET
(
SR_DELNO
)) {

536 
dofft
 = 
	`TYPE
(
h
=
P_LBTREE
 ? 
O_INDX
 : 0;

537 i(
	`LF_ISSET
(
SR_DUPLAST
))

538 
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
,

539 
h
, 
dx
 + 
dofft
)->
ty
) && indx > 0 &&

540 
p
[
dx
] =p[dx - 
adju
])

541 
dx
 -
adju
;

543 
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
,

544 
h
, 
dx
 + 
dofft
)->
ty
) &&

545 
dx
 < (
db_dx_t
)(
	`NUM_ENT
(
h
- 
adju
) &&

546 
p
[
dx
] =p[dx + 
adju
])

547 
dx
 +
adju
;

553 i(
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
dofft
)->
ty
)) {

554 
t
 = 
DB_NOTFOUND
;

555 
r
;

564 i(

 !
NULL
) {

565 
	`DB_ASSERT
(
dbv
, 
	`TYPE
(
h
=
P_LBTREE
);

567 
i
 = 0; i < 
dx
; i +
P_INDX
)

568 i(!
	`B_DISSET
(

569 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
 + 
O_INDX
)->
ty
))

570 ++
o
;

573 *

 = 
o
 + 1;

577 i(
	`LF_ISSET
(
SR_STK_ONLY
)) {

578 
	`BT_STK_NUM
(
dbv
, 

, 
h
, 
dx
, 
t
);

579 i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

580 
t
 = 
t_t
;

581 i((
t_t
 =

582 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

583 
t
 = 
t_t
;

585 i(
	`LF_ISSET
(
SR_DEL
&& 

->
c
 =->

)

586 

->
c
++;

587 
	`BT_STK_ENTER
(
dbv
, 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

589 i(
t
 != 0)

590 
r
;

594 
r
: i(
h
 !
NULL
 && (
t_t
 =

595 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

596 
t
 = 
t_t
;

599 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

600 
t
 = 
t_t
;

602 
	`BT_STK_POP
(

);

603 
	`__bam_kl
(
dbc
, 0);

605  (
t
);

606 
	}
}

615 
	$__bam_kl
(
dbc
, 
ags
)

616 
DBC
 *
dbc
;

617 
u_t32_t
 
ags
;

619 
BTREE_CURSOR
 *

;

620 
DB
 *
dbp
;

621 
DB_MPOOLFILE
 *
mpf
;

622 
EPG
 *
g
;

623 
t
, 
t_t
;

625 
dbp
 = 
dbc
->dbp;

626 
mpf
 = 
dbp
->mpf;

627 

 = (
BTREE_CURSOR
 *)
dbc
->

;

635 
t
 = 0, 
g
 = 

->

;pg <->
c
; ++epg) {

636 i(
g
->
ge
 !
NULL
) {

637 i(
	`LF_ISSET
(
STK_CLRDBC
&& 

->
ge
 =
g
->page) {

638 

->
ge
 = 
NULL
;

639 
	`LOCK_INIT
(

->
lock
);

641 i((
t_t
 = 
	`__memp_ut
(
mpf
,

642 
g
->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

643 
t
 = 
t_t
;

651 
g
->
ge
 = 
NULL
;

658 i(
	`LF_ISSET
(
STK_PGONLY
))

660 i(
	`LF_ISSET
(
STK_NOLOCK
)) {

661 i((
t_t
 = 
	`__LPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

662 
t
 = 
t_t
;

664 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

665 
t
 = 
t_t
;

669 i(!
	`LF_ISSET
(
STK_PGONLY
))

670 
	`BT_STK_CLR
(

);

672  (
t
);

673 
	}
}

682 
	$__bam_kgrow
(
dbv
, 

)

683 
DB_ENV
 *
dbv
;

684 
BTREE_CURSOR
 *

;

686 
EPG
 *
p
;

687 
size_t
 
s
;

688 
t
;

690 
s
 = 

->
e
 - cp->

;

692 i((
t
 = 
	`__os_oc
(
dbv
, 
s
 * 2, (
EPG
), &
p
)) != 0)

693  (
t
);

694 
	`memy
(
p
, 

->

, 
s
 * (
EPG
));

695 i(

->

 !->
ack
)

696 
	`__os_
(
dbv
, 

->

);

697 

->

 = 
p
;

698 

->
c
 = 
p
 + 
s
;

699 

->
e
 = 
p
 + 
s
 * 2;

701 
	}
}

	@../btree/bt_split.c

41 
	~"db_cfig.h
"

43 
	~"db_t.h
"

44 
	~"dbc/db_ge.h
"

45 
	~"dbc/lock.h
"

46 
	~"dbc/mp.h
"

47 
	~"dbc/b.h
"

49 
__bam_bro
 
__P
((
DBC
 *, 
PAGE
 *, 
u_t32_t
, PAGE *, PAGE *));

50 
__bam_ge
 
__P
((
DBC
 *, 
EPG
 *, EPG *));

51 
__bam_pl
 
__P
((
DBC
 *, 
EPG
 *, 
PAGE
 *, PAGE *, 
db_dx_t
 *));

52 
__bam_ro
 
__P
((
DBC
 *, 
EPG
 *));

53 
__m_ro
 
__P
((
DBC
 *, 
PAGE
 *, PAGE *, PAGE *));

62 
	$__bam_l
(
dbc
, 
g
, 
ro_pgn
)

63 
DBC
 *
dbc
;

64 *
g
;

65 
db_pgno_t
 *
ro_pgn
;

67 
BTREE_CURSOR
 *

;

68 um { 
UP
, 
DOWN
 } 
d
;

69 
db_pgno_t
 
ro_pgno
;

70 
exa
, 
v
, 
t
;

72 

 = (
BTREE_CURSOR
 *)
dbc
->

;

73 
ro_pgno
 = 

->
ro
;

102 
d
 = 
UP
, 
v
 = 
LEAFLEVEL
;; dir == UP ? ++level : --level) {

106 i((
t
 = (
dbc
->
dbty
 =
DB_BTREE
 ?

107 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
,

108 
g
, 
SR_WRPAIR
, 
v
, 
NULL
, &
exa
) :

109 
	`__bam_rch
(
dbc
,

110 (
db_o_t
 *)
g
, 
SR_WRPAIR
, 
v
, &
exa
))) != 0)

113 i(
ro_pgn
 !
NULL
)

114 *
ro_pgn
 = 

->
c
[0].
ge
->
pgno
 =
ro_pgno
 ?

115 
ro_pgno
 : 

->
c
[-1].
ge
->
pgno
;

122 i(2 * 
	`B_MAXSIZEONPAGE
(

->
ovsize
)

123 <(
db_dx_t
)
	`P_FREESPACE
(
dbc
->
dbp
, 

->
c
[0].
ge
)) {

124 
	`__bam_kl
(
dbc
, 
STK_NOLOCK
);

127 
t
 = 

->
c
[0].
ge
->
pgno
 =
ro_pgno
 ?

128 
	`__bam_ro
(
dbc
, &

->
c
[0]) :

129 
	`__bam_ge
(
dbc
, &

->
c
[-1], &cp->csp[0]);

130 
	`BT_STK_CLR
(

);

132 
t
) {

135 i(
v
 =
LEAFLEVEL
)

139 i(
d
 =
UP
)

140 
d
 = 
DOWN
;

142 
DB_NEEDSPLIT
:

149 i(
d
 =
DOWN
)

150 
d
 = 
UP
;

153 
r
;

157 
r
: i(
ro_pgn
 !
NULL
)

158 *
ro_pgn
 = 

->
ro
;

159  (
t
);

160 
	}
}

167 
	$__bam_ro
(
dbc
, 

)

168 
DBC
 *
dbc
;

169 
EPG
 *

;

171 
DB
 *
dbp
;

172 
DBT
 
log_dbt
;

173 
DB_LSN
 
log_l
;

174 
DB_MPOOLFILE
 *
mpf
;

175 
PAGE
 *

, *

;

176 
db_dx_t
 
l
;

177 
u_t32_t
 
ags
;

178 
t
, 
t_t
;

180 
dbp
 = 
dbc
->dbp;

181 
mpf
 = 
dbp
->mpf;

182 

 = 

 = 
NULL
;

185 i(

->
ge
->
v
 >
MAXBTREELEVEL
) {

186 
	`__db_rx
(
dbp
->
dbv
,

187 "Tomy bevs: %d", 

->
ge
->
v
);

188 
t
 = 
ENOSPC
;

189 
r
;

192 i((
t
 = 
	`__memp_dty
(
mpf
,

193 &

->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

194 
r
;

197 i((
t
 = 
	`__db_w
(
dbc
, 
	`TYPE
(

->
ge
), &

)) != 0 ||

198 (
t
 = 
	`__db_w
(
dbc
, 
	`TYPE
(

->
ge
), &

)) != 0)

199 
r
;

200 
	`P_INIT
(

, 
dbp
->
pgsize
,p->
pgno
,

201 
PGNO_INVALID
, 
	`ISINTERNAL
(

->
ge
? PGNO_INVALID : 

->
pgno
,

202 

->
ge
->
v
, 
	`TYPE
(cp->page));

203 
	`P_INIT
(

, 
dbp
->
pgsize
,p->
pgno
,

204 
	`ISINTERNAL
(

->
ge
? 
PGNO_INVALID
 : 

->
pgno
, PGNO_INVALID,

205 

->
ge
->
v
, 
	`TYPE
(cp->page));

208 i((
t
 = 
	`__bam_pl
(
dbc
, 

, 

, 

, &
l
)) != 0)

209 
r
;

212 i(
	`DBC_LOGGING
(
dbc
)) {

213 
	`memt
(&
log_dbt
, 0, (log_dbt));

214 
log_dbt
.
da
 = 

->
ge
;

215 
log_dbt
.
size
 = 
dbp
->
pgsize
;

216 
	`ZERO_LSN
(
log_l
);

217 
ags
 = 
	`F_ISSET
(

218 (
BTREE_CURSOR
 *)
dbc
->

, 
C_RECNUM
? 
SPL_NRECS
 : 0;

219 i((
t
 = 
	`__bam_l_log
(
dbp
,

220 
dbc
->
txn
, &
	`LSN
(

->
ge
), 0, 
	`PGNO
(

), &LSNp), PGNO(

),

221 &
	`LSN
(

), (
u_t32_t
)
	`NUM_ENT
(

), 0, &
log_l
,

222 
dbc
->

->
ro
, &
log_dbt
, 
ags
)) != 0)

223 
r
;

225 
	`LSN_NOT_LOGGED
(
	`LSN
(

->
ge
));

226 
	`LSN
(

LSN(

->
ge
);

227 
	`LSN
(

LSN(

->
ge
);

230 i((
t
 = (
dbc
->
dbty
 =
DB_RECNO
 ?

231 
	`__m_ro
(
dbc
, 

->
ge
, 

, 

) :

232 
	`__bam_bro
(
dbc
, 

->
ge
, 
l
, 

, 

))) != 0)

233 
r
;

236 
t
 = 
	`__bam__l
(
dbc
, 

->
ge
->
pgno
, 

->pgno, 

->pgno, 
l
, 1);

239 
r
: i((
t_t
 =

240 
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

241 
t
 = 
t_t
;

242 i((
t_t
 = 
	`__TLPUT
(
dbc
, 

->
lock
)!0 && 
t
 == 0)

243 
t
 = 
t_t
;

244 i(

 !
NULL
 &&

245 (
t_t
 = 
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
)!0 && 
t
 == 0)

246 
t
 = 
t_t
;

247 i(

 !
NULL
 &&

248 (
t_t
 = 
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
)!0 && 
t
 == 0)

249 
t
 = 
t_t
;

251  (
t
);

252 
	}
}

259 
	$__bam_ge
(
dbc
, 

, 

)

260 
DBC
 *
dbc
;

261 
EPG
 *

, *

;

263 
BTREE_CURSOR
 *
bc
;

264 
DBT
 
log_dbt
;

265 
DB_LSN
 
log_l
;

266 
DB
 *
dbp
;

267 
DB_LOCK
 
lock
, 
lock
;

268 
DB_MPOOLFILE
 *
mpf
;

269 
DB_LSN
 
ve_l
;

270 
PAGE
 *

, *

, *
loc_
, *

;

271 
db_dx_t
 
l
;

272 
u_t32_t
 
ags
;

273 
t
, 
t_t
;

275 
dbp
 = 
dbc
->dbp;

276 
mpf
 = 
dbp
->mpf;

277 
loc_
 = 

 = 

 = 

 = 
NULL
;

278 
	`LOCK_INIT
(
lock
);

279 
	`LOCK_INIT
(
lock
);

280 
t
 = -1;

302 i((
t
 = 
	`__os_mloc
(
dbp
->
dbv
, dbp->
pgsize
 * 2, &

)) != 0)

303 
r
;

304 
	`P_INIT
(

, 
dbp
->
pgsize
, 
	`PGNO
(

->
ge
),

305 
	`ISINTERNAL
(

->
ge
? 
PGNO_INVALID
 : 
	`PREV_PGNO
(cp->page),

306 
	`ISINTERNAL
(

->
ge
? 
PGNO_INVALID
 : 0,

307 

->
ge
->
v
, 
	`TYPE
(cp->page));

309 

 = (
PAGE
 *)((
u_t8_t
 *)

 + 
dbp
->
pgsize
);

310 
	`P_INIT
(

, 
dbp
->
pgsize
, 0,

311 
	`ISINTERNAL
(

->
ge
? 
PGNO_INVALID
 : 
	`PGNO
(cp->page),

312 
	`ISINTERNAL
(

->
ge
? 
PGNO_INVALID
 : 
	`NEXT_PGNO
(cp->page),

313 

->
ge
->
v
, 
	`TYPE
(cp->page));

325 i((
t
 = 
	`__bam_pl
(
dbc
, 

, 

, 

, &
l
)) != 0)

326 
r
;

334 i((
t
 = 
	`__bam_p
(
dbc
, 

, 
l
, 

, 

, 
BPI_SPACEONLY
)) != 0)

335 
r
;

348 i(
	`ISLEAF
(

->
ge
&& 
	`NEXT_PGNO
(->ge!
PGNO_INVALID
) {

349 i((
t
 = 
	`__db_lg
(
dbc
,

350 0, 
	`NEXT_PGNO
(

->
ge
), 
DB_LOCK_WRITE
, 0, &
lock
)) != 0)

351 
r
;

352 i((
t
 = 
	`__memp_fg
(
mpf
, &
	`NEXT_PGNO
(

->
ge
),

353 
dbc
->
txn
, 
DB_MPOOL_DIRTY
, &

)) != 0)

354 
r
;

361 i((
t
 = 
	`__db_w
(
dbc
, 
	`TYPE
(

->
ge
), &
loc_
)) != 0)

362 
r
;

373 i((
t
 = 
	`__db_lg
(
dbc
,

374 0, 
	`PGNO
(
loc_
), 
DB_LOCK_WRITE
, 0, &
lock
)) != 0)

375 
r
;

382 
	`PGNO
(


	`NEXT_PGNO
(

PGNO(
loc_
);

384 i((
t
 = 
	`__memp_dty
(
mpf
,

385 &

->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0)

386 
r
;

389 i((
t
 = 
	`__memp_dty
(
mpf
,

390 &

->
ge
, 
dbc
->
txn
, dbc->
iܙy
, 0)) != 0 ||

391 (
t
 = 
	`__bam_p
(
dbc
, 

, 
l
, 

, 

, 0)) != 0)

392 
r
;

394 
bc
 = (
BTREE_CURSOR
 *)
dbc
->

;

396 i(
	`DBC_LOGGING
(
dbc
)) {

397 
	`memt
(&
log_dbt
, 0, (log_dbt));

398 
log_dbt
.
da
 = 

->
ge
;

399 
log_dbt
.
size
 = 
dbp
->
pgsize
;

400 i(

 =
NULL
)

401 
	`ZERO_LSN
(
log_l
);

402 
ags
 = 
	`F_ISSET
(
bc
, 
C_RECNUM
? 
SPL_NRECS
 : 0;

403 i((
t
 = 
	`__bam_l_log
(
dbp
, 
dbc
->
txn
, &
	`LSN
(

->
ge
), 0,

404 
	`PGNO
(

->
ge
), &
	`LSN
(->ge), PGNO(
loc_
),

405 &
	`LSN
(
loc_
), (
u_t32_t
)
	`NUM_ENT
(

),

406 

 =
NULL
 ? 0 : 
	`PGNO
(tp),

407 

 =
NULL
 ? &
log_l
 : &
	`LSN
(tp),

408 
PGNO_INVALID
, &
log_dbt
, 
ags
)) != 0)

409 
r
;

412 
	`LSN_NOT_LOGGED
(
	`LSN
(

->
ge
));

415 
	`LSN
(
loc_
LSN(

->
ge
);

416 
	`LSN
(

LSN(

->
ge
);

417 
	`LSN
(

LSN(

->
ge
);

418 i(

 !
NULL
)

419 
	`LSN
(

LSN(

->
ge
);

431 
ve_l
 = 
loc_
->
l
;

432 
	`memy
(
loc_
, 

, 
	`LOFFSET
(
dbp
,p));

433 
	`memy
((
u_t8_t
 *)
loc_
 + 
	`HOFFSET
(

),

434 (
u_t8_t
 *)

 + 
	`HOFFSET
p), 
dbp
->
pgsize
 - HOFFSET(rp));

435 
loc_
->
l
 = 
ve_l
;

437 
ve_l
 = 

->
ge
->
l
;

438 
	`memy
(

->
ge
, 

, 
	`LOFFSET
(
dbp
,p));

439 
	`memy
((
u_t8_t
 *)

->
ge
 + 
	`HOFFSET
(

),

440 (
u_t8_t
 *)

 + 
	`HOFFSET
p), 
dbp
->
pgsize
 - HOFFSET(lp));

441 

->
ge
->
l
 = 
ve_l
;

444 i(

 !
NULL
)

445 
	`PREV_PGNO
(


	`PGNO
(

);

448 i((
t
 = 
	`__bam__l
(
dbc
,

449 
	`PGNO
(

->
ge
), PGNO(->ge), PGNO(

), 
l
, 0)) != 0)

450 
r
;

452 
	`__os_
(
dbp
->
dbv
, 

);

460 i((
t_t
 =

461 
	`__memp_ut
(
mpf
, 
loc_
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

462 
t
 = 
t_t
;

463 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

464 
t
 = 
t_t
;

465 i((
t_t
 =

466 
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

467 
t
 = 
t_t
;

468 i((
t_t
 = 
	`__TLPUT
(
dbc
, 

->
lock
)!0 && 
t
 == 0)

469 
t
 = 
t_t
;

470 i((
t_t
 =

471 
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

472 
t
 = 
t_t
;

473 i((
t_t
 = 
	`__TLPUT
(
dbc
, 

->
lock
)!0 && 
t
 == 0)

474 
t
 = 
t_t
;

475 i(

 !
NULL
) {

476 i((
t_t
 =

477 
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
)!0 && 
t
 == 0)

478 
t
 = 
t_t
;

479 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

480 
t
 = 
t_t
;

482  (
t
);

484 
r
: i(

 !
NULL
)

485 
	`__os_
(
dbp
->
dbv
, 

);

486 i(
loc_
 !
NULL
)

487 ()
	`__memp_ut
(
mpf
, 
loc_
, 
dbc
->
iܙy
);

488 i(

 !
NULL
)

489 ()
	`__memp_ut
(
mpf
, 

, 
dbc
->
iܙy
);

492 ()
	`__LPUT
(
dbc
, 
lock
);

493 ()
	`__LPUT
(
dbc
, 
lock
);

495 ()
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
);

496 i(
t
 =
DB_NEEDSPLIT
)

497 ()
	`__LPUT
(
dbc
, 

->
lock
);

499 ()
	`__TLPUT
(
dbc
, 

->
lock
);

501 ()
	`__memp_ut
(
mpf
, 

->
ge
, 
dbc
->
iܙy
);

502 i(
t
 =
DB_NEEDSPLIT
)

503 ()
	`__LPUT
(
dbc
, 

->
lock
);

505 ()
	`__TLPUT
(
dbc
, 

->
lock
);

507  (
t
);

508 
	}
}

515 
	$__bam_bro
(
dbc
, 
rop
, 
l
, 

, 

)

516 
DBC
 *
dbc
;

517 
u_t32_t
 
l
;

518 
PAGE
 *
rop
, *

, *

;

520 
BINTERNAL
 
bi
, 
bi0
, *
chd_bi
;

521 
BKEYDATA
 *
chd_bk
;

522 
BOVERFLOW
 
bo
, *
chd_bo
;

523 
BTREE_CURSOR
 *

;

524 
DB
 *
dbp
;

525 
DBT
 
hdr
, 
hdr0
, 
da
;

526 
db_pgno_t
 
ro_pgno
;

527 
t
;

529 
dbp
 = 
dbc
->dbp;

530 

 = (
BTREE_CURSOR
 *)
dbc
->

;

531 
chd_bo
 = 
NULL
;

532 
da
.d
NULL
;

534 
	`TYPE
(
rop
)) {

535 
P_IBTREE
:

537 
chd_bi
 = 
	`GET_BINTERNAL
(
dbp
, 
rop
, 
l
);

538 
	`B_TYPE
(
chd_bi
->
ty
)) {

539 
B_KEYDATA
:

540 
bi
.
n
 = 
chd_bi
->len;

541 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

542 
bi
.
pgno
 = 

->pgno;

543 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

544 i((
t
 = 
	`__os_mloc
(
dbp
->
dbv
,

545 
chd_bi
->
n
, &
da
.data)) != 0)

546  (
t
);

547 
	`memy
(
da
.da, 
chd_bi
->da, chd_bi->
n
);

548 
da
.
size
 = 
chd_bi
->
n
;

550 
B_OVERFLOW
:

552 
chd_bo
 = (
BOVERFLOW
 *)
chd_bi
->
da
;

553 
	`memt
(&
bo
, 0, (bo));

554 
bo
.
ty
 = 
B_OVERFLOW
;

555 
bo
.

 = 
chd_bo
->tlen;

556 
bo
.
pgno
 = 
chd_bo
->pgno;

557 
bi
.
n
 = 
BOVERFLOW_SIZE
;

558 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

559 
bi
.
pgno
 = 

->pgno;

560 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

561 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

563 
B_DUPLICATE
:

565 
pgfmt
;

568 
P_LDUP
:

569 
P_LBTREE
:

571 
chd_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
rop
, 
l
);

572 
	`B_TYPE
(
chd_bk
->
ty
)) {

573 
B_KEYDATA
:

574 
bi
.
n
 = 
chd_bk
->len;

575 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

576 
bi
.
pgno
 = 

->pgno;

577 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

578 i((
t
 = 
	`__os_mloc
(
dbp
->
dbv
,

579 
chd_bk
->
n
, &
da
.data)) != 0)

580  (
t
);

581 
	`memy
(
da
.da, 
chd_bk
->da, chd_bk->
n
);

582 
da
.
size
 = 
chd_bk
->
n
;

584 
B_OVERFLOW
:

586 
chd_bo
 = (
BOVERFLOW
 *)
chd_bk
;

587 
	`memt
(&
bo
, 0, (bo));

588 
bo
.
ty
 = 
B_OVERFLOW
;

589 
bo
.

 = 
chd_bo
->tlen;

590 
	`memt
(&
hdr
, 0, (hdr));

591 i((
t
 = 
	`__db_goff
(
dbp
,

592 
dbc
->
txn
, &
hdr
, 
chd_bo
->

,

593 
chd_bo
->
pgno
, &
hdr
.
da
, &hdr.
size
)) == 0)

594 
t
 = 
	`__db_poff
(
dbc
, &
hdr
, &
bo
.
pgno
);

596 i(
hdr
.
da
 !
NULL
)

597 
	`__os_
(
dbp
->
dbv
, 
hdr
.
da
);

598 i(
t
 != 0)

599  (
t
);

601 
bi
.
n
 = 
BOVERFLOW_SIZE
;

602 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

603 
bi
.
pgno
 = 

->pgno;

604 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

605 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

607 
B_DUPLICATE
:

609 
pgfmt
;

613 
pgfmt
:  (
	`__db_pgfmt
(
dbp
->
dbv
, 

->
pgno
));

620 
ro_pgno
 = 

->
ro
;

621 
	`P_INIT
(
rop
, 
dbp
->
pgsize
,

622 
ro_pgno
, 
PGNO_INVALID
, PGNO_INVALID, 

->
v
 + 1, 
P_IBTREE
);

629 
	`memt
(&
bi0
, 0, (bi0));

630 
bi0
.
n
 = 0;

631 
	`B_TSET
(
bi0
.
ty
, 
B_KEYDATA
);

632 
bi0
.
pgno
 = 

->pgno;

633 i(
	`F_ISSET
(

, 
C_RECNUM
)) {

634 
bi0
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

635 
	`RE_NREC_SET
(
rop
, 
bi0
.
ecs
);

636 
bi
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

637 
	`RE_NREC_ADJ
(
rop
, 
bi
.
ecs
);

639 
	`DB_SET_DBT
(
hdr0
, &
bi0
, 
	`SSZA
(
BINTERNAL
, 
da
));

640 i((
t
 = 
	`__db_pem
(
dbc
,

641 
rop
, 0, 
	`BINTERNAL_SIZE
(0), &
hdr0
, 
NULL
)) != 0)

642 
r
;

643 
t
 = 
	`__db_pem
(
dbc
, 
rop
, 1, 
	`BINTERNAL_SIZE
(
da
.
size
), &
hdr
, &data);

645 
r
: i(
da
.d!
NULL
 && 
chd_bo
 == NULL)

646 
	`__os_
(
dbp
->
dbv
, 
da
.data);

647  (
t
);

648 
	}
}

655 
	$__m_ro
(
dbc
, 
rop
, 

, 

)

656 
DBC
 *
dbc
;

657 
PAGE
 *
rop
, *

, *

;

659 
DB
 *
dbp
;

660 
DBT
 
hdr
;

661 
RINTERNAL
 
ri
;

662 
db_pgno_t
 
ro_pgno
;

663 
t
;

665 
dbp
 = 
dbc
->dbp;

666 
ro_pgno
 = 
dbc
->

->
ro
;

669 
	`P_INIT
(
rop
, 
dbp
->
pgsize
,

670 
ro_pgno
, 
PGNO_INVALID
, PGNO_INVALID, 

->
v
 + 1, 
P_IRECNO
);

673 
	`DB_SET_DBT
(
hdr
, &
ri
, 
RINTERNAL_SIZE
);

676 
ri
.
pgno
 = 

->pgno;

677 
ri
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

678 i((
t
 = 
	`__db_pem
(
dbc
, 
rop
, 0, 
RINTERNAL_SIZE
, &
hdr
, 
NULL
)) != 0)

679  (
t
);

680 
	`RE_NREC_SET
(
rop
, 
ri
.
ecs
);

681 
ri
.
pgno
 = 

->pgno;

682 
ri
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

683 i((
t
 = 
	`__db_pem
(
dbc
, 
rop
, 1, 
RINTERNAL_SIZE
, &
hdr
, 
NULL
)) != 0)

684  (
t
);

685 
	`RE_NREC_ADJ
(
rop
, 
ri
.
ecs
);

687 
	}
}

697 
	$__bam_p
(
dbc
, 

, 
l
, 
lchd
, 
rchd
, 
ags
)

698 
DBC
 *
dbc
;

699 
EPG
 *

;

700 
u_t32_t
 
l
;

701 
PAGE
 *
lchd
, *
rchd
;

702 
ags
;

704 
BINTERNAL
 
bi
, *
chd_bi
;

705 
BKEYDATA
 *
chd_bk
, *
tmp_bk
;

706 
BOVERFLOW
 
bo
, *
chd_bo
;

707 
BTREE
 *
t
;

708 
BTREE_CURSOR
 *

;

709 
DB
 *
dbp
;

710 
DBT
 
a
, 
b
, 
hdr
, 
da
;

711 
EPG
 *
chd
;

712 
PAGE
 *
age
;

713 
RINTERNAL
 
ri
;

714 
db_dx_t
 
off
;

715 
db_o_t
 
ecs
;

716 
	`size_t
 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

717 
u_t32_t
 
n
, 
nbys
, 
nksize
;

718 
t
;

720 
dbp
 = 
dbc
->dbp;

721 

 = (
BTREE_CURSOR
 *)
dbc
->

;

722 
t
 = 
dbp
->
bt_
;

723 
age
 = 

->
ge
;

724 
chd
 = 

 + 1;

727 
ecs
 = 
	`F_ISSET
(

, 
C_RECNUM
) &&

728 !
	`LF_ISSET
(
BPI_SPACEONLY
? 
	`__bam_tٮ
(
dbp
, 
rchd
) : 0;

743 
off
 = 

->
dx
 + 
O_INDX
;

757 
	`TYPE
(
chd
->
ge
)) {

758 
P_IBTREE
:

759 
chd_bi
 = 
	`GET_BINTERNAL
(
dbp
, 
chd
->
ge
, 
l
);

760 
nbys
 = 
	`BINTERNAL_PSIZE
(
chd_bi
->
n
);

762 i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

763  (
DB_NEEDSPLIT
);

764 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

767 
	`B_TYPE
(
chd_bi
->
ty
)) {

768 
B_KEYDATA
:

770 
	`memt
(&
bi
, 0, (bi));

771 
bi
.
n
 = 
chd_bi
->len;

772 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

773 
bi
.
pgno
 = 
rchd
->pgno;

774 
bi
.
ecs
 =recs;

775 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

776 
	`DB_SET_DBT
(
da
, 
chd_bi
->da, chd_bi->
n
);

777 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

778 
	`BINTERNAL_SIZE
(
chd_bi
->
n
), &
hdr
, &
da
)) != 0)

779  (
t
);

781 
B_OVERFLOW
:

783 
chd_bo
 = (
BOVERFLOW
 *)
chd_bi
->
da
;

784 
	`memt
(&
bo
, 0, (bo));

785 
bo
.
ty
 = 
B_OVERFLOW
;

786 
bo
.

 = 
chd_bo
->tlen;

787 
bo
.
pgno
 = 
chd_bo
->pgno;

788 
bi
.
n
 = 
BOVERFLOW_SIZE
;

789 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

790 
bi
.
pgno
 = 
rchd
->pgno;

791 
bi
.
ecs
 =recs;

792 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

793 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

794 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

795 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
), &
hdr
, &
da
)) != 0)

796  (
t
);

798 
B_DUPLICATE
:

800 
pgfmt
;

803 
P_LDUP
:

804 
P_LBTREE
:

805 
chd_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
chd
->
ge
, 
l
);

806 
	`B_TYPE
(
chd_bk
->
ty
)) {

807 
B_KEYDATA
:

808 
nbys
 = 
	`BINTERNAL_PSIZE
(
chd_bk
->
n
);

809 
nksize
 = 
chd_bk
->
n
;

833 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

834 i(
dbp
->
dup_com
 =
__bam_defcmp
)

835 
func
 = 
__bam_defx
;

837 
func
 = 
NULL
;

839 
func
 = 
t
->
bt_efix
;

840 i(
func
 =
NULL
)

841 
nݻfix
;

842 
tmp_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
lchd
, 
	`NUM_ENT
(lchild) -

843 (
	`TYPE
(
lchd
=
P_LDUP
 ? 
O_INDX
 : 
P_INDX
));

844 i(
	`B_TYPE
(
tmp_bk
->
ty
!
B_KEYDATA
)

845 
nݻfix
;

846 
	`DB_SET_DBT
(
a
, 
tmp_bk
->
da
,mp_bk->
n
);

847 
	`DB_SET_DBT
(
b
, 
chd_bk
->
da
, chd_bk->
n
);

848 
nksize
 = (
u_t32_t
)
	`func
(
dbp
, &
a
, &
b
);

849 i((
n
 = 
	`BINTERNAL_PSIZE
(
nksize
)< 
nbys
)

850 
nbys
 = 
n
;

852 
nksize
 = 
chd_bk
->
n
;

854 
nݻfix
: i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

855  (
DB_NEEDSPLIT
);

856 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

859 
	`memt
(&
bi
, 0, (bi));

860 
bi
.
n
 = 
nksize
;

861 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

862 
bi
.
pgno
 = 
rchd
->pgno;

863 
bi
.
ecs
 =recs;

864 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

865 
	`DB_SET_DBT
(
da
, 
chd_bk
->da, 
nksize
);

866 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

867 
	`BINTERNAL_SIZE
(
nksize
), &
hdr
, &
da
)) != 0)

868  (
t
);

870 
B_OVERFLOW
:

871 
nbys
 = 
	`BINTERNAL_PSIZE
(
BOVERFLOW_SIZE
);

873 i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

874  (
DB_NEEDSPLIT
);

875 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

879 
chd_bo
 = (
BOVERFLOW
 *)
chd_bk
;

880 
	`memt
(&
bo
, 0, (bo));

881 
bo
.
ty
 = 
B_OVERFLOW
;

882 
bo
.

 = 
chd_bo
->tlen;

883 
	`memt
(&
hdr
, 0, (hdr));

884 i((
t
 = 
	`__db_goff
(
dbp
,

885 
dbc
->
txn
, &
hdr
, 
chd_bo
->

,

886 
chd_bo
->
pgno
, &
hdr
.
da
, &hdr.
size
)) == 0)

887 
t
 = 
	`__db_poff
(
dbc
, &
hdr
, &
bo
.
pgno
);

889 i(
hdr
.
da
 !
NULL
)

890 
	`__os_
(
dbp
->
dbv
, 
hdr
.
da
);

891 i(
t
 != 0)

892  (
t
);

894 
	`memt
(&
bi
, 0, (bi));

895 
bi
.
n
 = 
BOVERFLOW_SIZE
;

896 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

897 
bi
.
pgno
 = 
rchd
->pgno;

898 
bi
.
ecs
 =recs;

899 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

900 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

901 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

902 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
), &
hdr
, &
da
)) != 0)

903  (
t
);

906 
B_DUPLICATE
:

908 
pgfmt
;

911 
P_IRECNO
:

912 
P_LRECNO
:

913 
nbys
 = 
RINTERNAL_PSIZE
;

915 i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

916  (
DB_NEEDSPLIT
);

917 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

921 
	`DB_SET_DBT
(
hdr
, &
ri
, 
RINTERNAL_SIZE
);

922 
ri
.
pgno
 = 
rchd
->pgno;

923 
ri
.
ecs
 =recs;

924 i((
t
 = 
	`__db_pem
(
dbc
,

925 
age
, 
off
, 
RINTERNAL_SIZE
, &
hdr
, 
NULL
)) != 0)

926  (
t
);

929 
pgfmt
:  (
	`__db_pgfmt
(
dbp
->
dbv
, 
	`PGNO
(
chd
->
ge
)));

936 i(
	`F_ISSET
(

, 
C_RECNUM
&& !
	`LF_ISSET
(
BPI_NORECNUM
)) {

938 i(
	`DBC_LOGGING
(
dbc
)) {

939 i((
t
 = 
	`__bam_dju_log
(
dbp
, 
dbc
->
txn
,

940 &
	`LSN
(
age
), 0, 
	`PGNO
(ppage), &LSN(ppage),

941 

->
dx
, -(
t32_t
)
ecs
, 0)) != 0)

942  (
t
);

944 
	`LSN_NOT_LOGGED
(
	`LSN
(
age
));

947 i(
dbc
->
dbty
 =
DB_RECNO
)

948 
	`GET_RINTERNAL
(
dbp
, 
age
, 

->
dx
)->
ecs
 -=recs;

950 
	`GET_BINTERNAL
(
dbp
, 
age
, 

->
dx
)->
ecs
 -=recs;

954 
	}
}

961 
	$__bam_pl
(
dbc
, 

, 

, 

, 
lt
)

962 
DBC
 *
dbc
;

963 
EPG
 *

;

964 
PAGE
 *

, *

;

965 
db_dx_t
 *
lt
;

967 
DB
 *
dbp
;

968 
PAGE
 *

;

969 
db_dx_t
 
hf
, *
p
, 
nbys
, 
off
, 
lp
, 
t
;

970 
adju
, 
t
, 
iag
, 
isbigkey
, 
t
;

972 
dbp
 = 
dbc
->dbp;

973 

 = 

->
ge
;

974 
p
 = 
	`P_INP
(
dbp
, 

);

975 
adju
 = 
	`TYPE
(

=
P_LBTREE
 ? 
P_INDX
 : 
O_INDX
;

1010 
off
 = 0;

1011 i(
	`NEXT_PGNO
(

=
PGNO_INVALID
 && 

->
dx
 >
	`NUM_ENT
p- 
adju
)

1012 
off
 = 
	`NUM_ENT
(

- 
adju
;

1013 i(
	`PREV_PGNO
(

=
PGNO_INVALID
 && 

->
dx
 == 0)

1014 
off
 = 
adju
;

1015 i(
off
 != 0)

1016 
st
;

1039 
t
 = 
	`NUM_ENT
(

- 
adju
;

1040 
hf
 = (
dbp
->
pgsize
 - 
	`HOFFSET
(

)) / 2;

1041 
nbys
 = 0, 
off
 = 0; of< 
t
 &&by< 
hf
; ++off)

1042 
	`TYPE
(

)) {

1043 
P_IBTREE
:

1044 i(
	`B_TYPE
(

1045 
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
ty
=
B_KEYDATA
)

1046 
nbys
 +
	`BINTERNAL_SIZE
(

1047 
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
n
);

1049 
nbys
 +
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
);

1051 
P_LBTREE
:

1052 i(
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1053 
B_KEYDATA
)

1054 
nbys
 +
	`BKEYDATA_SIZE
(
	`GET_BKEYDATA
(
dbp
,

1055 

, 
off
)->
n
);

1057 
nbys
 +
BOVERFLOW_SIZE
;

1059 ++
off
;

1061 
P_LDUP
:

1062 
P_LRECNO
:

1063 i(
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1064 
B_KEYDATA
)

1065 
nbys
 +
	`BKEYDATA_SIZE
(
	`GET_BKEYDATA
(
dbp
,

1066 

, 
off
)->
n
);

1068 
nbys
 +
BOVERFLOW_SIZE
;

1070 
P_IRECNO
:

1071 
nbys
 +
RINTERNAL_SIZE
;

1074  (
	`__db_pgfmt
(
dbp
->
dbv
, 

->
pgno
));

1076 
st
: 
lp
 = 
off
;

1084 
	`TYPE
(

)) {

1085 
P_IBTREE
:

1086 
iag
 = 1;

1087 
isbigkey
 =

1088 
	`B_TYPE
(
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
ty
!
B_KEYDATA
;

1090 
P_LBTREE
:

1091 
P_LDUP
:

1092 
iag
 = 0;

1093 
isbigkey
 = 
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) !=

1094 
B_KEYDATA
;

1097 
iag
 = 
isbigkey
 = 0;

1099 i(
isbigkey
)

1100 
t
 = 1; cnt <= 3; ++cnt) {

1101 
off
 = 
lp
 + 
t
 * 
adju
;

1102 i(
off
 < (
db_dx_t
)
	`NUM_ENT
(

) &&

1103 ((
iag
 && 
	`B_TYPE
(

1104 
	`GET_BINTERNAL
(
dbp
, 

,
off
)->
ty
=
B_KEYDATA
) ||

1105 
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1106 
B_KEYDATA
)) {

1107 
lp
 = 
off
;

1110 i(
lp
 <(
db_dx_t
)(
t
 * 
adju
))

1112 
off
 = 
lp
 - 
t
 * 
adju
;

1113 i(
iag
 ? 
	`B_TYPE
(

1114 
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
ty
=
B_KEYDATA
 :

1115 
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1116 
B_KEYDATA
) {

1117 
lp
 = 
off
;

1128 i(
	`TYPE
(

=
P_LBTREE
 &&

1129 
p
[
lp
] =p[l- 
adju
])

1130 
t
 = 1;; ++cnt) {

1131 
off
 = 
lp
 + 
t
 * 
adju
;

1132 i(
off
 < 
	`NUM_ENT
(

) &&

1133 
p
[
lp
] !p[
off
]) {

1134 
lp
 = 
off
;

1137 i(
lp
 <(
db_dx_t
)(
t
 * 
adju
))

1139 
off
 = 
lp
 - 
t
 * 
adju
;

1140 i(
p
[
lp
] !p[
off
]) {

1141 
lp
 = 
off
 + 
adju
;

1147 i((
t
 = 
	`__bam_cy
(
dbp
, 

, 

, 0, 
lp
)) != 0)

1148  (
t
);

1149 i((
t
 = 
	`__bam_cy
(
dbp
, 

, 

, 
lp
, 
	`NUM_ENT
(pp))) != 0)

1150  (
t
);

1152 *
lt
 = 
lp
;

1154 
	}
}

1163 
	$__bam_cy
(
dbp
, 

, 

, 
nxt
, 

)

1164 
DB
 *
dbp
;

1165 
PAGE
 *

, *

;

1166 
u_t32_t
 
nxt
, 

;

1168 
BINTERNAL
 

;

1169 
db_dx_t
 *
cp
, 
nbys
, 
off
, *
pp
;

1171 
cp
 = 
	`P_INP
(
dbp
, 

);

1172 
pp
 = 
	`P_INP
(
dbp
, 

);

1176 
off
 = 0; 
nxt
 < 

; ++nxt, ++
	`NUM_ENT
(

), ++off) {

1177 
	`TYPE
(

)) {

1178 
P_IBTREE
:

1179 i(
off
 =0 && 
nxt
 != 0)

1180 
nbys
 = 
	`BINTERNAL_SIZE
(0);

1181 i(
	`B_TYPE
(

1182 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->
ty
=
B_KEYDATA
)

1183 
nbys
 = 
	`BINTERNAL_SIZE
(

1184 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->
n
);

1186 
nbys
 = 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
);

1188 
P_LBTREE
:

1193 i(
off
 !0 && (
nxt
 % 
P_INDX
) == 0 &&

1194 
pp
[
nxt
] =pp[nx- 
P_INDX
]) {

1195 
cp
[
off
] = cp[of- 
P_INDX
];

1199 
P_LDUP
:

1200 
P_LRECNO
:

1201 i(
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
nxt
)->
ty
) ==

1202 
B_KEYDATA
)

1203 
nbys
 = 
	`BKEYDATA_SIZE
(
	`GET_BKEYDATA
(
dbp
,

1204 

, 
nxt
)->
n
);

1206 
nbys
 = 
BOVERFLOW_SIZE
;

1208 
P_IRECNO
:

1209 
nbys
 = 
RINTERNAL_SIZE
;

1212  (
	`__db_pgfmt
(
dbp
->
dbv
, 

->
pgno
));

1214 
cp
[
off
] = 
	`HOFFSET
(

-
nbys
;

1215 i(
off
 =0 && 
nxt
 !0 && 
	`TYPE
(

=
P_IBTREE
) {

1216 

.
n
 = 0;

1217 

.
ty
 = 
B_KEYDATA
;

1218 

.
pgno
 = 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->pgno;

1219 

.
ecs
 = 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->nrecs;

1220 
	`memy
(
	`P_ENTRY
(
dbp
, 

, 
off
), &

, 
nbys
);

1223 
	`memy
(
	`P_ENTRY
(
dbp
, 

, 
off
),

1224 
	`P_ENTRY
(
dbp
, 

, 
nxt
), 
nbys
);

1227 
	}
}

	@../btree/bt_stat.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/mp.h
"

17 #ifde
HAVE_STATISTICS


25 
	$__bam_
(
dbc
, 
p
, 
ags
)

26 
DBC
 *
dbc
;

27 *
p
;

28 
u_t32_t
 
ags
;

30 
BTMETA
 *
ma
;

31 
BTREE
 *
t
;

32 
BTREE_CURSOR
 *

;

33 
DB
 *
dbp
;

34 
DB_BTREE_STAT
 *

;

35 
DB_ENV
 *
dbv
;

36 
DB_LOCK
 
lock
, 
mock
;

37 
DB_MPOOLFILE
 *
mpf
;

38 
PAGE
 *
h
;

39 
db_pgno_t
 
pgno
;

40 
t
, 
t_t
, 
wre_ma
;

42 
dbp
 = 
dbc
->dbp;

43 
dbv
 = 
dbp
->dbenv;

45 
ma
 = 
NULL
;

46 
t
 = 
dbp
->
bt_
;

47 

 = 
NULL
;

48 
	`LOCK_INIT
(
mock
);

49 
	`LOCK_INIT
(
lock
);

50 
mpf
 = 
dbp
->mpf;

51 
h
 = 
NULL
;

52 
t
 = 
wre_ma
 = 0;

54 

 = (
BTREE_CURSOR
 *)
dbc
->

;

57 i((
t
 = 
	`__os_umloc
(
dbv
, (*

), &sp)) != 0)

58 
r
;

59 
	`memt
(

, 0, (*sp));

62 
pgno
 = 
PGNO_BASE_MD
;

63 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_READ
, 0, &
mock
)) != 0)

64 
r
;

65 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
txn
, 0, &
ma
)) != 0)

66 
r
;

68 i(
ags
 =
DB_FAST_STAT
)

69 
ma_ly
;

72 

->
bt_
 = 0, 
pgno
 = 
ma
->
dbma
.

;gn!
PGNO_INVALID
;) {

73 ++

->
bt_
;

75 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
txn
, 0, &
h
)) != 0)

76 
r
;

78 
pgno
 = 
h
->
xt_pgno
;

79 i((
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)) != 0)

80 
r
;

81 
h
 = 
NULL
;

85 
pgno
 = 

->
ro
;

86 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_READ
, 0, &
lock
)) != 0)

87 
r
;

88 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
txn
, 0, &
h
)) != 0)

89 
r
;

92 

->
bt_vs
 = 
h
->
v
;

95 
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
);

96 
h
 = 
NULL
;

97 i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

98 
t
 = 
t_t
;

99 i(
t
 != 0)

100 
r
;

103 i((
t
 = 
	`__bam_av
(
dbc
,

104 
DB_LOCK_READ
, 

->
ro
, 
__bam__back
, 

)) != 0)

105 
r
;

111 
wre_ma
 = !
	`F_ISSET
(
dbp
, 
DB_AM_RDONLY
) &&

112 (!
	`MULTIVERSION
(
dbp
|| 
dbc
->
txn
 !
NULL
);

113 
ma_ly
:

114 i(
t
->
bt_ma
 !
PGNO_BASE_MD
 || 
wre_ma
) {

115 
t
 = 
	`__memp_ut
(
mpf
, 
ma
, 
dbc
->
iܙy
);

116 
ma
 = 
NULL
;

117 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

118 
t
 = 
t_t
;

119 i(
t
 != 0)

120 
r
;

122 i((
t
 = 
	`__db_lg
(
dbc
,

123 0, 
t
->
bt_ma
, 
wre_ma
 ? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
,

124 0, &
mock
)) != 0)

125 
r
;

126 i((
t
 = 
	`__memp_fg
(
mpf
, &
t
->
bt_ma
, 
dbc
->
txn
,

127 
wre_ma
 ? 
DB_MPOOL_DIRTY
 : 0, &
ma
)) != 0)

128 
r
;

130 i(
ags
 =
DB_FAST_STAT
) {

131 i(
dbp
->
ty
 =
DB_RECNO
 ||

132 (
dbp
->
ty
 =
DB_BTREE
 && 
	`F_ISSET
(dbp, 
DB_AM_RECNUM
))) {

133 i((
t
 = 
	`__db_lg
(
dbc
, 0,

134 

->
ro
, 
DB_LOCK_READ
, 0, &
lock
)) != 0)

135 
r
;

136 i((
t
 = 
	`__memp_fg
(
mpf
, &

->
ro
, 
dbc
->
txn
,

137 0, &
h
)) != 0)

138 
r
;

140 

->
bt_nkeys
 = 
	`RE_NREC
(
h
);

142 

->
bt_nkeys
 = 
ma
->
dbma
.
key_cou
;

144 

->
bt_nda
 = 
dbp
->
ty
 =
DB_RECNO
 ?

145 

->
bt_nkeys
 : 
ma
->
dbma
.
cd_cou
;

149 

->
bt_maags
 = 
ma
->
dbma
.
ags
;

150 

->
bt_mkey
 = 
ma
->
mkey
;

151 

->
bt__n
 = 
ma
->
_n
;

152 

->
bt__d
 = 
ma
->
_d
;

160 i((
t
 = 
	`__memp_g_ϡ_pgno
(
dbp
->
mpf
, &
pgno
)) != 0)

161 
r
;

162 

->
bt_get
 = 
pgno
 + 1;

163 

->
bt_gesize
 = 
ma
->
dbma
.
gesize
;

164 

->
bt_magic
 = 
ma
->
dbma
.
magic
;

165 

->
bt_vsi
 = 
ma
->
dbma
.
vsi
;

167 i(
wre_ma
 != 0) {

168 
ma
->
dbma
.
key_cou
 = 

->
bt_nkeys
;

169 
ma
->
dbma
.
cd_cou
 = 

->
bt_nda
;

172 *(
DB_BTREE_STAT
 **)
p
 = 

;

174 
r
:

175 i((
t_t
 = 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

176 
t
 = 
t_t
;

177 i(
h
 !
NULL
 &&

178 (
t_t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

179 
t
 = 
t_t
;

182 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

183 
t
 = 
t_t
;

184 i(
ma
 !
NULL
 &&

185 (
t_t
 = 
	`__memp_ut
(
mpf
, 
ma
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

186 
t
 = 
t_t
;

188 i(
t
 !0 && 

 !
NULL
) {

189 
	`__os_u
(
dbv
, 

);

190 *(
DB_BTREE_STAT
 **)
p
 = 
NULL
;

193  (
t
);

194 
	}
}

203 
	$__bam__t
(
dbc
, 
ags
)

204 
DBC
 *
dbc
;

205 
u_t32_t
 
ags
;

207 cڡ 
FN
 

[] = {

208 { 
BTM_DUP
, "duplicates" },

209 { 
BTM_RECNO
, "recno" },

210 { 
BTM_RECNUM
, "record-numbers" },

211 { 
BTM_FIXEDLEN
, "fixed-length" },

212 { 
BTM_RENUMBER
, "renumber" },

213 { 
BTM_SUBDB
, "multiple-databases" },

214 { 
BTM_DUPSORT
, "sorted duplicates" },

215 { 0, 
NULL
 }

217 
DB
 *
dbp
;

218 
DB_BTREE_STAT
 *

;

219 
DB_ENV
 *
dbv
;

220 
ld
, 
t
;

221 cڡ *
s
;

223 
dbp
 = 
dbc
->dbp;

224 
dbv
 = 
dbp
->dbenv;

226 i((
t
 = 
	`__bam_
(
dbc
, &

, 
	`LF_ISSET
(
DB_FAST_STAT
))) != 0)

227  (
t
);

229 i(
	`LF_ISSET
(
DB_STAT_ALL
)) {

230 
	`__db_msg
(
dbv
, "%s", 
	`DB_GLOBAL
(
db_le
));

231 
	`__db_msg
(
dbv
, "Default Btree/Recno database information:");

234 
	`__db_msg
(
dbv
, "%lx\tB maginumb", (
u_lg
)

->
bt_magic
);

235 
	`__db_msg
(
dbv
, "%lu\tB vsiڂumb", (
u_lg
)

->
bt_vsi
);

237 ()
	`__db_g_ld
(
dbp
, &
ld
);

238 
ld
) {

240 
s
 = "Little-endian";

243 
s
 = "Big-endian";

246 
s
 = "Unrecognized byte order";

249 
	`__db_msg
(
dbv
, "%s\tBy ord", 
s
);

250 
	`__db_ags
(
dbv
, 
NULL
, 

->
bt_maags
, 

, NULL, "\tFlags");

251 i(
dbp
->
ty
 =
DB_BTREE
)

252 
	`__db_dl
(
dbv
, "Mimum keyr-ge", (
u_lg
)

->
bt_mkey
);

253 i(
dbp
->
ty
 =
DB_RECNO
) {

254 
	`__db_dl
(
dbv
,

255 "Fixed-ngthecd size", (
u_lg
)

->
bt__n
);

256 
	`__db_msg
(
dbv
,

257 "%#x\tFixed-ngthecdad", (
u_t
)

->
bt__d
);

259 
	`__db_dl
(
dbv
,

260 "Undlyg dabaagsize", (
u_lg
)

->
bt_gesize
);

261 i(
dbp
->
ty
 =
DB_BTREE
)

262 
	`__db_dl
(
dbv
, "Overflow key/data size",

263 ((
BTREE_CURSOR
 *)
dbc
->

)->
ovsize
);

264 
	`__db_dl
(
dbv
, "Numb ovh", (
u_lg
)

->
bt_vs
);

265 
	`__db_dl
(
dbv
, 
dbp
->
ty
 =
DB_BTREE
 ?

267 "Numb ocdh", (
u_lg
)

->
bt_nkeys
);

268 
	`__db_dl
(
dbv
,

269 "Numb odemh", (
u_lg
)

->
bt_nda
);

271 
	`__db_dl
(
dbv
,

272 "Numb o iȷges", (
u_lg
)

->
bt_t_pg
);

273 
	`__db_dl_p
(
dbv
,

275 (
u_lg
)

->
bt_t_pg
,

276 
	`DB_PCT_PG
(

->
bt_t_pg
, sp->
bt_t_pg
, sp->
bt_gesize
), "ff");

278 
	`__db_dl
(
dbv
,

279 "Numb oges", (
u_lg
)

->
bt_af_pg
);

280 
	`__db_dl_p
(
dbv
, "Number of bytes free inreeeafages",

281 (
u_lg
)

->
bt_af_pg
, 
	`DB_PCT_PG
(

282 

->
bt_af_pg
, sp->
bt_af_pg
, sp->
bt_gesize
), "ff");

284 
	`__db_dl
(
dbv
,

285 "Numb o duiages", (
u_lg
)

->
bt_dup_pg
);

286 
	`__db_dl_p
(
dbv
,

288 (
u_lg
)

->
bt_dup_pg
,

289 
	`DB_PCT_PG
(

->
bt_dup_pg
, sp->
bt_dup_pg
, sp->
bt_gesize
), "ff");

291 
	`__db_dl
(
dbv
,

292 "Numb o ovowages", (
u_lg
)

->
bt_ov_pg
);

293 
	`__db_dl_p
(
dbv
, "Number of bytes free inree overflowages",

294 (
u_lg
)

->
bt_ov_pg
, 
	`DB_PCT_PG
(

295 

->
bt_ov_pg
, sp->
bt_ov_pg
, sp->
bt_gesize
), "ff");

296 
	`__db_dl
(
dbv
, "Numb oemyages", (
u_lg
)

->
bt_emy_pg
);

298 
	`__db_dl
(
dbv
, "Numb ogeځh䓆i", (
u_lg
)

->
bt_
);

300 
	`__os_u
(
dbv
, 

);

303 
	}
}

312 
	$__bam__back
(
dbp
, 
h
, 
cook
, 
pu
)

313 
DB
 *
dbp
;

314 
PAGE
 *
h
;

315 *
cook
;

316 *
pu
;

318 
DB_BTREE_STAT
 *

;

319 
db_dx_t
 
dx
, *
p
, 
t
;

320 
u_t8_t
 
ty
;

322 

 = 
cook
;

323 *
pu
 = 0;

324 
t
 = 
	`NUM_ENT
(
h
);

325 
p
 = 
	`P_INP
(
dbp
, 
h
);

327 
	`TYPE
(
h
)) {

328 
P_IBTREE
:

329 
P_IRECNO
:

330 ++

->
bt_t_pg
;

331 

->
bt_t_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

333 
P_LBTREE
:

334 i(
t
 == 0)

335 ++

->
bt_emy_pg
;

338 
dx
 = 0; indx < 
t
; indx +
P_INDX
) {

339 
ty
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->type;

341 i(
	`B_DISSET
(
ty
))

345 i(
dx
 + 
P_INDX
 >
t
 ||

346 
p
[
dx
] !p[dx + 
P_INDX
])

347 ++

->
bt_nkeys
;

350 i(
	`B_TYPE
(
ty
!
B_DUPLICATE
)

351 ++

->
bt_nda
;

354 ++

->
bt_af_pg
;

355 

->
bt_af_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

357 
P_LRECNO
:

358 i(
t
 == 0)

359 ++

->
bt_emy_pg
;

365 i(
dbp
->
ty
 =
DB_RECNO
) {

370 i(
	`F_ISSET
(
dbp
, 
DB_AM_RENUMBER
)) {

371 

->
bt_nkeys
 +
t
;

372 

->
bt_nda
 +
t
;

374 
dx
 = 0; indx < 
t
; indx +
O_INDX
) {

375 
ty
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
)->type;

376 i(!
	`B_DISSET
(
ty
)) {

377 ++

->
bt_nda
;

378 ++

->
bt_nkeys
;

382 ++

->
bt_af_pg
;

383 

->
bt_af_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

385 

->
bt_nda
 +
t
;

387 ++

->
bt_dup_pg
;

388 

->
bt_dup_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

391 
P_LDUP
:

392 i(
t
 == 0)

393 ++

->
bt_emy_pg
;

396 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

397 i(!
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
)->
ty
))

398 ++

->
bt_nda
;

400 ++

->
bt_dup_pg
;

401 

->
bt_dup_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

403 
P_OVERFLOW
:

404 ++

->
bt_ov_pg
;

405 

->
bt_ov_pg
 +
	`P_OVFLSPACE
(
dbp
, dbp->
pgsize
, 
h
);

408  (
	`__db_pgfmt
(
dbp
->
dbv
, 
h
->
pgno
));

411 
	}
}

420 
	$__bam_t_curs
(
dbc
)

421 
DBC
 *
dbc
;

423 cڡ 
FN
 

[] = {

424 { 
C_DELETED
, "C_DELETED" },

425 { 
C_RECNUM
, "C_RECNUM" },

426 { 
C_RENUMBER
, "C_RENUMBER" },

427 { 0, 
NULL
 }

429 
DB_ENV
 *
dbv
;

430 
BTREE_CURSOR
 *

;

432 
dbv
 = 
dbc
->
dbp
->dbenv;

433 

 = (
BTREE_CURSOR
 *)
dbc
->

;

435 
	`STAT_ULONG
("Ovow size", 

->
ovsize
);

436 i(
dbc
->
dbty
 =
DB_RECNO
)

437 
	`STAT_ULONG
("Reo", 

->
o
);

438 
	`STAT_ULONG
("Ord", 

->
d
);

439 
	`__db_ags
(
dbv
, 
NULL
, 

->
ags
, 

, NULL, "\tInternal Flags");

440 
	}
}

445 
	$__bam_
(
dbc
, 
p
, 
ags
)

446 
DBC
 *
dbc
;

447 *
p
;

448 
u_t32_t
 
ags
;

450 
	`COMPQUIET
(
p
, 
NULL
);

451 
	`COMPQUIET
(
ags
, 0);

453  (
	`__db__n_but
(
dbc
->
dbp
->
dbv
));

454 
	}
}

457 
	$__bam__t
(
dbc
, 
ags
)

458 
DBC
 *
dbc
;

459 
u_t32_t
 
ags
;

461 
	`COMPQUIET
(
ags
, 0);

463  (
	`__db__n_but
(
dbc
->
dbp
->
dbv
));

464 
	}
}

467 #ide
HAVE_BREW


476 
	$__bam_key_nge
(
dbc
, 
dbt
, 
kp
, 
ags
)

477 
DBC
 *
dbc
;

478 
DBT
 *
dbt
;

479 
DB_KEY_RANGE
 *
kp
;

480 
u_t32_t
 
ags
;

482 
BTREE_CURSOR
 *

;

483 
EPG
 *

;

484 

;

485 
exa
, 
t
;

487 
	`COMPQUIET
(
ags
, 0);

489 i((
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
,

490 
dbt
, 
SR_STK_ONLY
, 1, 
NULL
, &
exa
)) != 0)

491  (
t
);

493 

 = (
BTREE_CURSOR
 *)
dbc
->

;

494 
kp
->
ss
 = kp->
g
 = 0.0;

496 

 = 1.0;

499 

->
c
->
s
 /= 2;

500 

->
c
->
dx
 /= 2;

501 

 = 

->; s<->
c
; ++sp) {

510 i(

->
dx
 == 0)

511 
kp
->
g
 +

 * (

->
s
 - 1)/sp->entries;

512 i(

->
dx
 =->
s
)

513 
kp
->
ss
 +

;

515 
kp
->
ss
 +

 * 

->
dx
 / sp->
s
;

516 
kp
->
g
 +

 *

517 ((

->
s
 - sp->
dx
) - 1) / sp->entries;

519 

 *1.0/

->
s
;

527 i(
exa
)

528 
kp
->
equ
 = 

;

530 i(
kp
->
ss
 != 1)

531 
kp
->
g
 +

;

532 
kp
->
equ
 = 0;

535 
	`BT_STK_CLR
(

);

538 
	}
}

549 
	$__bam_av
(
dbc
, 
mode
, 
ro_pgno
, 
back
, 
cook
)

550 
DBC
 *
dbc
;

551 
db_lockmode_t
 
mode
;

552 
db_pgno_t
 
ro_pgno
;

553 (*
back
)
	`__P
((
DB
 *, 
PAGE
 *, *, *));

554 *
cook
;

556 
BINTERNAL
 *
bi
;

557 
BKEYDATA
 *
bk
;

558 
DB
 *
dbp
;

559 
DB_LOCK
 
lock
;

560 
DB_MPOOLFILE
 *
mpf
;

561 
PAGE
 *
h
;

562 
RINTERNAL
 *
ri
;

563 
db_dx_t
 
dx
, *
p
;

564 
ady_put
, 
t
, 
t_t
;

566 
dbp
 = 
dbc
->dbp;

567 
mpf
 = 
dbp
->mpf;

568 
ady_put
 = 0;

570 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
ro_pgno
, 
mode
, 0, &
lock
)) != 0)

571  (
t
);

572 i((
t
 = 
	`__memp_fg
(
mpf
, &
ro_pgno
, 
dbc
->
txn
, 0, &
h
)) != 0) {

573 ()
	`__TLPUT
(
dbc
, 
lock
);

574  (
t
);

577 
	`TYPE
(
h
)) {

578 
P_IBTREE
:

579 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
O_INDX
) {

580 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
);

581 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
 &&

582 (
t
 = 
	`__db_av_big
(
dbp
,

583 ((
BOVERFLOW
 *)
bi
->
da
)->
pgno
, 
dbc
->
txn
,

584 
back
, 
cook
)) != 0)

585 
r
;

586 i((
t
 = 
	`__bam_av
(

587 
dbc
, 
mode
, 
bi
->
pgno
, 
back
, 
cook
)) != 0)

588 
r
;

591 
P_IRECNO
:

592 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
O_INDX
) {

593 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
dx
);

594 i((
t
 = 
	`__bam_av
(

595 
dbc
, 
mode
, 
ri
->
pgno
, 
back
, 
cook
)) != 0)

596 
r
;

599 
P_LBTREE
:

600 
p
 = 
	`P_INP
(
dbp
, 
h
);

601 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
P_INDX
) {

602 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

603 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

604 (
dx
 + 
P_INDX
 >
	`NUM_ENT
(
h
) ||

605 
p
[
dx
] !p[dx + 
P_INDX
])) {

606 i((
t
 = 
	`__db_av_big
(
dbp
,

607 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->
pgno
,

608 
dbc
->
txn
, 
back
, 
cook
)) != 0)

609 
r
;

611 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
);

612 i(
	`B_TYPE
(
bk
->
ty
=
B_DUPLICATE
 &&

613 (
t
 = 
	`__bam_av
(
dbc
, 
mode
,

614 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->
pgno
,

615 
back
, 
cook
)) != 0)

616 
r
;

617 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

618 (
t
 = 
	`__db_av_big
(
dbp
,

619 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->
pgno
,

620 
dbc
->
txn
, 
back
, 
cook
)) != 0)

621 
r
;

624 
P_LDUP
:

625 
P_LRECNO
:

626 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
O_INDX
) {

627 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

628 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

629 (
t
 = 
	`__db_av_big
(
dbp
,

630 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->
pgno
, 
dbc
->
txn
,

631 
back
, 
cook
)) != 0)

632 
r
;

636  (
	`__db_pgfmt
(
dbp
->
dbv
, 
h
->
pgno
));

639 
t
 = 
	`back
(
dbp
, 
h
, 
cook
, &
ady_put
);

641 
r
: i(!
ady_put
 &&

642 (
t_t
 = 
	`__memp_ut
(
mpf
, 
h
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

643 
t
 = 
t_t
;

644 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

645 
t
 = 
t_t
;

647  (
t
);

648 
	}
}

	@../btree/bt_upgrade.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_upgde.h
"

14 
	~"dbc/b.h
"

23 
	$__bam_30_bma
(
dbp
, 
_me
, 
buf
)

24 
DB
 *
dbp
;

25 *
_me
;

26 
u_t8_t
 *
buf
;

28 
BTMETA30
 *
wma
;

29 
BTMETA2X
 *
dma
;

30 
DB_ENV
 *
dbv
;

31 
t
;

33 
dbv
 = 
dbp
->dbenv;

35 
wma
 = (
BTMETA30
 *)
buf
;

36 
dma
 = (
BTMETA2X
 *)
buf
;

44 
wma
->
_d
 = 
dma
->re_pad;

45 
wma
->
_n
 = 
dma
->re_len;

46 
wma
->
mkey
 = 
dma
->minkey;

47 
wma
->
maxkey
 = 
dma
->maxkey;

48 
wma
->
dbma
.

 = 
dma
->free;

49 
wma
->
dbma
.
ags
 = 
dma
->flags;

50 
wma
->
dbma
.
ty
 = 
P_BTREEMETA
;

52 
wma
->
dbma
.
vsi
 = 7;

54 i((
t
 = 
	`__os_feid
(
dbv
, 
_me
, 1, 
buf
 + 36)) != 0)

55  (
t
);

57 
wma
->
ro
 = 1;

60 
	}
}

70 
	$__bam_31_bma
(
dbp
, 
_me
, 
ags
, 
fhp
, 
h
, 
dtyp
)

71 
DB
 *
dbp
;

72 *
_me
;

73 
u_t32_t
 
ags
;

74 
DB_FH
 *
fhp
;

75 
PAGE
 *
h
;

76 *
dtyp
;

78 
BTMETA31
 *
wma
;

79 
BTMETA30
 *
dma
;

81 
	`COMPQUIET
(
dbp
, 
NULL
);

82 
	`COMPQUIET
(
_me
, 
NULL
);

83 
	`COMPQUIET
(
fhp
, 
NULL
);

85 
wma
 = (
BTMETA31
 *)
h
;

86 
dma
 = (
BTMETA30
 *)
h
;

93 
wma
->
ro
 = 
dma
->root;

94 
wma
->
_d
 = 
dma
->re_pad;

95 
wma
->
_n
 = 
dma
->re_len;

96 
wma
->
mkey
 = 
dma
->minkey;

97 
wma
->
maxkey
 = 
dma
->maxkey;

98 
	`memmove
(
wma
->
dbma
.
uid
,

99 
dma
->
dbma
.
uid
, (oldmeta->dbmeta.uid));

100 
wma
->
dbma
.
ags
 = 
dma
->dbmeta.flags;

101 
wma
->
dbma
.
cd_cou
 = 0;

102 
wma
->
dbma
.
key_cou
 = 0;

103 
	`ZERO_LSN
(
wma
->
dbma
.
unud3
);

106 
wma
->
dbma
.
vsi
 = 8;

109 i(
	`LF_ISSET
(
DB_DUPSORT
))

110 
	`F_SET
(&
wma
->
dbma
, 
BTM_DUPSORT
);

112 *
dtyp
 = 1;

114 
	}
}

124 
	$__bam_31_lb
(
dbp
, 
_me
, 
ags
, 
fhp
, 
h
, 
dtyp
)

125 
DB
 *
dbp
;

126 *
_me
;

127 
u_t32_t
 
ags
;

128 
DB_FH
 *
fhp
;

129 
PAGE
 *
h
;

130 *
dtyp
;

132 
BKEYDATA
 *
bk
;

133 
db_pgno_t
 
pgno
;

134 
db_dx_t
 
dx
;

135 
t
;

137 
t
 = 0;

138 
dx
 = 
O_INDX
; indx < 
	`NUM_ENT
(
h
); indx +
P_INDX
) {

139 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
);

140 i(
	`B_TYPE
(
bk
->
ty
=
B_DUPLICATE
) {

141 
pgno
 = 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->pgno;

142 i((
t
 = 
	`__db_31_offdup
(
dbp
, 
_me
, 
fhp
,

143 
	`LF_ISSET
(
DB_DUPSORT
? 1 : 0, &
pgno
)) != 0)

145 i(
pgno
 !
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->pgno) {

146 *
dtyp
 = 1;

147 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->
pgno
 =gno;

152  (
t
);

153 
	}
}

	@../btree/bt_verify.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_vify.h
"

14 
	~"dbc/b.h
"

15 
	~"dbc/mp.h
"

17 
__bam__gda
 
__P
((
DB
 *, 
PAGE
 *, 
u_t32_t
, , 
DBT
 *, *));

18 
__bam_vrfy_p
 
__P
((
DB
 *, 
VRFY_DBINFO
 *, 
PAGE
 *, 
db_pgno_t
,

19 
db_dx_t
 *, 
u_t32_t
));

20 
__bam_vrfy_d
 
__P
((
DB
 *, 
PAGE
 *, 
BINTERNAL
 *,

21 
BINTERNAL
 *, (*)(
DB
 *, cڡ 
DBT
 *, cڡ DBT *), 
u_t32_t
));

22 
__m_vrfy_p
 
	`__P
((
DB
 *, 
VRFY_DBINFO
 *, 
PAGE
 *, 
db_pgno_t
,

23 
db_dx_t
 *, 
u_t32_t
));

33 
	$__bam_vrfy_ma
(
dbp
, 
vdp
, 
ma
, 
pgno
, 
ags
)

34 
DB
 *
dbp
;

35 
VRFY_DBINFO
 *
vdp
;

36 
BTMETA
 *
ma
;

37 
db_pgno_t
 
pgno
;

38 
u_t32_t
 
ags
;

40 
DB_ENV
 *
dbv
;

41 
VRFY_PAGEINFO
 *
p
;

42 
isbad
, 
t_t
, 
t
;

43 
db_dx_t
 
ovsize
;

45 
dbv
 = 
dbp
->dbenv;

46 
isbad
 = 0;

48 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

49  (
t
);

60 i(!
	`F_ISSET
(
p
, 
VRFY_INCOMPLETE
) &&

61 (
t
 = 
	`__db_vrfy_ma
(
dbp
, 
vdp
, &
ma
->
dbma
, 
pgno
, 
ags
)) != 0) {

62 i(
t
 =
DB_VERIFY_BAD
)

63 
isbad
 = 1;

65 
r
;

71 
ovsize
 = 
ma
->
mkey
 > 0 ?

72 
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
ma
->
mkey
, dbp->
pgsize
) : 0;

74 i(
ma
->
mkey
 < 2 ||

75 
ovsize
 > 
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
DEFMINKEYPAGE
, dbp->
pgsize
)) {

76 
p
->
bt_mkey
 = 0;

77 
isbad
 = 1;

78 
	`EPRINT
((
dbv
,

80 (
u_lg
)
pgno
, (u_lg)
ma
->
mkey
));

82 
p
->
bt_mkey
 = 
ma
->
mkey
;

85 
p
->
_d
 = 
ma
->re_pad;

86 
p
->
_n
 = 
ma
->re_len;

93 
p
->
ro
 = 0;

94 i(
ma
->
ro
 =
PGNO_INVALID
 ||

95 
ma
->
ro
 =
pgno
 || !
	`IS_VALID_PGNO
(meta->root) ||

96 (
pgno
 =
PGNO_BASE_MD
 && 
ma
->
ro
 != 1)) {

97 
isbad
 = 1;

98 
	`EPRINT
((
dbv
,

100 (
u_lg
)
pgno
, (u_lg)
ma
->
ro
));

102 
p
->
ro
 = 
ma
->root;

105 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_RENUMBER
))

106 
	`F_SET
(
p
, 
VRFY_IS_RRECNO
);

108 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_SUBDB
)) {

113 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_DUP
&& 
pgno
 =
PGNO_BASE_MD
) {

114 
isbad
 = 1;

115 
	`EPRINT
((
dbv
,

117 (
u_lg
)
pgno
));

119 
	`F_SET
(
p
, 
VRFY_HAS_SUBDBS
);

122 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_DUP
))

123 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

124 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_DUPSORT
))

125 
	`F_SET
(
p
, 
VRFY_HAS_DUPSORT
);

126 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_RECNUM
))

127 
	`F_SET
(
p
, 
VRFY_HAS_RECNUMS
);

128 i(
	`F_ISSET
(
p
, 
VRFY_HAS_RECNUMS
&& F_ISSET՝, 
VRFY_HAS_DUPS
)) {

129 
	`EPRINT
((
dbv
,

131 (
u_lg
)
pgno
));

132 
isbad
 = 1;

135 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_RECNO
)) {

136 
	`F_SET
(
p
, 
VRFY_IS_RECNO
);

137 
dbp
->
ty
 = 
DB_RECNO
;

138 } i(
	`F_ISSET
(
p
, 
VRFY_IS_RRECNO
)) {

139 
isbad
 = 1;

140 
	`EPRINT
((
dbv
,

142 (
u_lg
)
pgno
));

145 i(
	`F_ISSET
(
p
, 
VRFY_IS_RECNO
&& F_ISSET՝, 
VRFY_HAS_DUPS
)) {

146 
	`EPRINT
((
dbv
,

148 (
u_lg
)
pgno
));

149 
isbad
 = 1;

152 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_FIXEDLEN
))

153 
	`F_SET
(
p
, 
VRFY_IS_FIXEDLEN
);

154 i(
p
->
_n
 > 0) {

159 
isbad
 = 1;

160 
	`EPRINT
((
dbv
,

162 (
u_lg
)
pgno
, (u_lg)
p
->
_n
));

170 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0 && 
t
 == 0)

171 
t
 = 
t_t
;

172 i(
	`LF_ISSET
(
DB_SALVAGE
) &&

173 (
t_t
 = 
	`__db_lvage_mkde
(
vdp
, 
pgno
)!0 && 
t
 == 0)

174 
t
 = 
t_t
;

175  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

176 
	}
}

186 
	$__m_vrfy_af
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)

187 
DB
 *
dbp
;

188 
VRFY_DBINFO
 *
vdp
;

189 
PAGE
 *
h
;

190 
db_pgno_t
 
pgno
;

191 
u_t32_t
 
ags
;

193 
BKEYDATA
 *
bk
;

194 
DB_ENV
 *
dbv
;

195 
VRFY_PAGEINFO
 *
p
;

196 
db_dx_t
 
i
;

197 
t
, 
t_t
, 
isbad
;

198 
u_t32_t
 
_n_guess
, 
n
;

200 
dbv
 = 
dbp
->dbenv;

201 
isbad
 = 0;

203 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

204  (
t
);

206 i(
	`TYPE
(
h
!
P_LRECNO
) {

207 
t
 = 
	`__db_unknown_th
(
dbv
, "__ram_vrfy_leaf");

208 
r
;

215 i((
t
 = 
	`__db_vrfy_dage
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)) != 0) {

216 i(
t
 =
DB_VERIFY_BAD
)

217 
isbad
 = 1;

219 
r
;

226 i((
t
 = 
	`__bam_vrfy_p
(
dbp
,

227 
vdp
, 
h
, 
pgno
, &
p
->
s
, 
ags
)) != 0)

228 
r
;

230 i(
	`F_ISSET
(
p
, 
VRFY_HAS_DUPS
)) {

231 
	`EPRINT
((
dbv
,

232 "Pag%lu: Redaba hadups", (
u_lg
)
pgno
));

233 
t
 = 
DB_VERIFY_BAD
;

234 
r
;

243 
_n_guess
 = 0;

244 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

245 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

247 i(
	`B_DISSET
(
bk
->
ty
))

249 i(
bk
->
ty
 =
B_OVERFLOW
)

250 
n
 = ((
BOVERFLOW
 *)
bk
)->

;

251 i(
bk
->
ty
 =
B_KEYDATA
)

252 
n
 = 
bk
->len;

254 
isbad
 = 1;

255 
	`EPRINT
((
dbv
,

257 (
u_lg
)
pgno
, (u_lg)
i
));

260 i(
_n_guess
 == 0)

261 
_n_guess
 = 
n
;

268 i(
_n_guess
 !
n
) {

269 
_n_guess
 = 0;

273 
p
->
_n
 = 
_n_guess
;

276 
p
->
c_t
 = 
	`NUM_ENT
(
h
);

278 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0 && 
t
 == 0)

279 
t
 = 
t_t
;

280  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

281 
	}
}

291 
	$__bam_vrfy
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)

292 
DB
 *
dbp
;

293 
VRFY_DBINFO
 *
vdp
;

294 
PAGE
 *
h
;

295 
db_pgno_t
 
pgno
;

296 
u_t32_t
 
ags
;

298 
DB_ENV
 *
dbv
;

299 
VRFY_PAGEINFO
 *
p
;

300 
t
, 
t_t
, 
isbad
;

302 
dbv
 = 
dbp
->dbenv;

303 
isbad
 = 0;

305 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

306  (
t
);

308 
	`TYPE
(
h
)) {

309 
P_IBTREE
:

310 
P_IRECNO
:

311 
P_LBTREE
:

312 
P_LDUP
:

315 
t
 = 
	`__db_unknown_th
(
dbv
, "__bam_vrfy");

316 
r
;

323 i((
t
 = 
	`__db_vrfy_dage
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)) != 0) {

324 i(
t
 =
DB_VERIFY_BAD
)

325 
isbad
 = 1;

327 
r
;

337 
p
->
c_t
 = 
	`RE_NREC
(
h
);

342 i(
	`TYPE
(
h
=
P_IRECNO
) {

343 i((
t
 = 
	`__m_vrfy_p
(
dbp
,

344 
vdp
, 
h
, 
pgno
, &
p
->
s
, 
ags
)) != 0)

345 
r
;

346 } i((
t
 = 
	`__bam_vrfy_p
(
dbp
,

347 
vdp
, 
h
, 
pgno
, &
p
->
s
, 
ags
)) != 0) {

348 i(
t
 =
DB_VERIFY_BAD
)

349 
isbad
 = 1;

351 
r
;

352 
	`EPRINT
((
dbv
,

354 (
u_lg
)
pgno
));

355 } i(!
	`LF_ISSET
(
DB_NOORDERCHK
&& (
t
 =

356 
	`__bam_vrfy_emd
(
dbp
, 
vdp
, 
h
, 
pgno
, 0, 0, 0, 
ags
)) != 0) {

362 i(
t
 =
DB_VERIFY_BAD
)

363 
isbad
 = 1;

365 
r
;

368 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0 && 
t
 == 0)

369 
t
 = 
t_t
;

370  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

371 
	}
}

381 
	$__m_vrfy_p
(
dbp
, 
vdp
, 
h
, 
pgno
, 
r
, 
ags
)

382 
DB
 *
dbp
;

383 
VRFY_DBINFO
 *
vdp
;

384 
PAGE
 *
h
;

385 
db_pgno_t
 
pgno
;

386 
db_dx_t
 *
r
;

387 
u_t32_t
 
ags
;

389 
DB_ENV
 *
dbv
;

390 
RINTERNAL
 *
ri
;

391 
VRFY_CHILDINFO
 
chd
;

392 
VRFY_PAGEINFO
 *
p
;

393 
t
, 
t_t
, 
isbad
;

394 
u_t32_t
 
himk
, 
i
, 
offt
, 
rs
;

395 
db_dx_t
 *
p
;

396 
u_t8_t
 *
gayout
, *
p
;

398 
dbv
 = 
dbp
->dbenv;

399 
isbad
 = 0;

400 
	`memt
(&
chd
, 0, (
VRFY_CHILDINFO
));

401 
rs
 = 0;

402 
gayout
 = 
NULL
;

404 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

405  (
t
);

407 i(
	`TYPE
(
h
!
P_IRECNO
) {

408 
t
 = 
	`__db_unknown_th
(
dbv
, "__ram_vrfy_inp");

409 
r
;

412 
himk
 = 
dbp
->
pgsize
;

413 i((
t
 = 
	`__os_mloc
(
dbv
, 
dbp
->
pgsize
, &
gayout
)) != 0)

414 
r
;

415 
	`memt
(
gayout
, 0, 
dbp
->
pgsize
);

416 
p
 = 
	`P_INP
(
dbp
, 
h
);

417 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

418 i((
u_t8_t
 *)
p
 + 
i
 >(u_t8_*)
h
 + 
himk
) {

419 
	`EPRINT
((
dbv
,

421 (
u_lg
)
pgno
, (u_lg)
i
));

422 
t
 = 
DB_VERIFY_BAD
;

423 
r
;

425 
offt
 = 
p
[
i
];

431 i(
offt
 <(
u_t32_t
)((
u_t8_t
 *)
p
 + 
i
 -

432 (
u_t8_t
 *)
h
) ||

433 
offt
 > (
u_t32_t
)(
dbp
->
pgsize
 - 
RINTERNAL_SIZE
)) {

434 
isbad
 = 1;

435 
	`EPRINT
((
dbv
,

437 (
u_lg
)
pgno
, (u_lg)
offt
, (u_lg)
i
));

442 i(
offt
 < 
himk
)

443 
himk
 = 
offt
;

445 
rs
++;

448 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
i
);

449 i(
gayout
[
offt
] == 0) {

450 
gayout
[
offt
] = 1;

451 
chd
.
pgno
 = 
ri
->pgno;

452 
chd
.
ty
 = 
V_RECNO
;

453 
chd
.
ecs
 = 
ri
->nrecs;

454 i((
t
 = 
	`__db_vrfy_chdput
(
vdp
, 
pgno
, &
chd
)) != 0)

455 
r
;

457 
	`EPRINT
((
dbv
,

459 (
u_lg
)
pgno
, (u_lg)
offt
));

460 
isbad
 = 1;

464 
p
 = 
gayout
 + 
himk
;

465 
p
 < 
gayout
 + 
dbp
->
pgsize
;

466 
p
 +
RINTERNAL_SIZE
)

467 i(*
p
 != 1) {

468 
	`EPRINT
((
dbv
,

470 (
u_lg
)
pgno
, (u_lg)(
p
 - 
gayout
)));

471 
isbad
 = 1;

474 i((
db_dx_t
)
himk
 !
	`HOFFSET
(
h
)) {

475 
	`EPRINT
((
dbv
,

477 (
u_lg
)
pgno
, (u_lg)(
	`HOFFSET
(
h
)), (u_lg)
himk
));

478 
isbad
 = 1;

481 *
r
 = 
rs
;

483 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0 && 
t
 == 0)

484 
t
 = 
t_t
;

485 i(
gayout
 !
NULL
)

486 
	`__os_
(
dbv
, 
gayout
);

487  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

488 
	}
}

490 um { 
	mVRFY_ITEM_NOTSET
=0, 
	mVRFY_ITEM_BEGIN
, 
	mVRFY_ITEM_END
 } 
	tVRFY_ITEM
;

498 
	$__bam_vrfy_p
(
dbp
, 
vdp
, 
h
, 
pgno
, 
r
, 
ags
)

499 
DB
 *
dbp
;

500 
VRFY_DBINFO
 *
vdp
;

501 
PAGE
 *
h
;

502 
db_pgno_t
 
pgno
;

503 
db_dx_t
 *
r
;

504 
u_t32_t
 
ags
;

506 
BKEYDATA
 *
bk
;

507 
BOVERFLOW
 *
bo
;

508 
DB_ENV
 *
dbv
;

509 
VRFY_CHILDINFO
 
chd
;

510 
VRFY_ITEM
 *
gayout
;

511 
VRFY_PAGEINFO
 *
p
;

512 
u_t32_t
 
himk
, 
offt
;

516 
u_t32_t
 
i
, 
doff
, 
rs
;

517 
isbad
, 
em
, 
isdupem
, 
t
, 
t_t
;

519 
dbv
 = 
dbp
->dbenv;

520 
isbad
 = 
isdupem
 = 0;

521 
rs
 = 0;

522 
	`memt
(&
chd
, 0, (
VRFY_CHILDINFO
));

523 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

524  (
t
);

526 
	`TYPE
(
h
)) {

527 
P_IBTREE
:

528 
P_LBTREE
:

529 
P_LDUP
:

530 
P_LRECNO
:

538 i(
	`LF_ISSET
(
DB_SALVAGE
))

540 
t
 = 
	`__db_unknown_th
(
dbv
, "__bam_vrfy_inp");

541 
r
;

555 
himk
 = 
dbp
->
pgsize
;

556 i((
t
 = 
	`__os_oc
(

557 
dbv
, 
dbp
->
pgsize
, (
gayout
[0]), &pagelayout)) != 0)

558 
r
;

559 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

560 
t
 = 
	`__db_vrfy_pem
(
dbp
,

561 
h
, 
pgno
, 
i
, 1, 
ags
, &
himk
, &
offt
)) {

564 
DB_VERIFY_BAD
:

565 
isbad
 = 1;

567 
DB_VERIFY_FATAL
:

568 
isbad
 = 1;

569 
r
;

571 
	`DB_ASSERT
(
dbv
, 
t
 != 0);

582 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

583 i(
gayout
[
offt
] =
VRFY_ITEM_NOTSET
)

584 
gayout
[
offt
] = 
VRFY_ITEM_BEGIN
;

585 i(
gayout
[
offt
] =
VRFY_ITEM_BEGIN
) {

592 i((
i
 % 
P_INDX
 =0&& (
	`TYPE
(
h
=
P_LBTREE
)) {

594 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

597 
rs
++;

603 
isdupem
 = 1;

605 
isbad
 = 1;

606 
	`EPRINT
((
dbv
, "Page %lu: duplicated item %lu",

607 (
u_lg
)
pgno
, (u_lg)
i
));

618 
	`B_TYPE
(
bk
->
ty
)) {

619 
B_KEYDATA
:

620 i(
	`TYPE
(
h
=
P_IBTREE
)

622 
doff
 = 
offt
 + 
	`BINTERNAL_SIZE
(
bk
->
n
) - 1;

624 
doff
 = 
offt
 + 
	`BKEYDATA_SIZE
(
bk
->
n
) - 1;

626 
B_DUPLICATE
:

631 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

633 
B_OVERFLOW
:

639 
doff
 = 
offt
 +

640 ((
	`TYPE
(
h
=
P_IBTREE
) ?

641 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
) :

642 
BOVERFLOW_SIZE
) - 1;

649 
doff
 = 
offt
 + 
	`BKEYDATA_SIZE
(0) - 1;

657 i(
isdupem
 && 
gayout
[
doff
] !
VRFY_ITEM_END
) {

658 
	`EPRINT
((
dbv
, "Page %lu: duplicated item %lu",

659 (
u_lg
)
pgno
, (u_lg)
i
));

660 
isbad
 = 1;

661 } i(
gayout
[
doff
] =
VRFY_ITEM_NOTSET
)

662 
gayout
[
doff
] = 
VRFY_ITEM_END
;

663 
isdupem
 = 0;

669 i(
	`B_DISSET
(
bk
->
ty
&& 
	`TYPE
(
h
!
P_LRECNO
) {

670 
isbad
 = 1;

671 
	`EPRINT
((
dbv
, "Page %lu: item %lu marked deleted",

672 (
u_lg
)
pgno
, (u_lg)
i
));

679 
	`B_TYPE
(
bk
->
ty
)) {

680 
B_KEYDATA
:

687 
B_DUPLICATE
:

688 i(
	`TYPE
(
h
=
P_IBTREE
) {

689 
isbad
 = 1;

690 
	`EPRINT
((
dbv
,

692 (
u_lg
)
pgno
, (u_lg)
i
));

694 } i(
	`TYPE
(
h
=
P_LRECNO
) {

695 
isbad
 = 1;

696 
	`EPRINT
((
dbv
,

698 (
u_lg
)
pgno
, (u_lg)
i
));

702 
B_OVERFLOW
:

703 
bo
 = (
	`TYPE
(
h
=
P_IBTREE
) ?

704 (
BOVERFLOW
 *)(((
BINTERNAL
 *)
bk
)->
da
) :

705 (
BOVERFLOW
 *)
bk
;

707 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
)

709 i(
bo
->

 > 
dbp
->
pgsize
 * 
vdp
->
ϡ_pgno
) {

710 
isbad
 = 1;

711 
	`EPRINT
((
dbv
,

713 (
u_lg
)
pgno
,

714 (
u_lg
)
bo
->

, (u_lg)
i
));

719 i(!
	`IS_VALID_PGNO
(
bo
->
pgno
) || bo->pgno ==gno ||

720 
bo
->
pgno
 =
PGNO_INVALID
) {

721 
isbad
 = 1;

722 
	`EPRINT
((
dbv
,

724 (
u_lg
)
pgno
, (u_lg)
i
, (u_lg)
bo
->pgno));

729 
chd
.
pgno
 = 
bo
->pgno;

730 
chd
.
ty
 = (
	`B_TYPE
(
bk
->ty=
B_OVERFLOW
 ?

731 
V_OVERFLOW
 : 
V_DUPLICATE
);

732 
chd
.

 = 
bo
->tlen;

733 i((
t
 = 
	`__db_vrfy_chdput
(
vdp
, 
pgno
, &
chd
)) != 0)

734 
r
;

737 
isbad
 = 1;

738 
	`EPRINT
((
dbv
, "Page %lu: item %lu of invalidype %lu",

739 (
u_lg
)
pgno
, (u_lg)
i
, (u_lg)
	`B_TYPE
(
bk
->
ty
)));

748 
em
 = 0;

749 
i
 = 
himk
; i < 
dbp
->
pgsize
; i++)

750 i(
em
 == 0)

751 
gayout
[
i
]) {

752 
VRFY_ITEM_NOTSET
:

754 i(
i
 !
	`DB_ALIGN
(i, (
u_t32_t
)))

757 
isbad
 = 1;

758 
	`EPRINT
((
dbv
,

760 (
u_lg
)
pgno
, (u_lg)
i
));

762 ; 
gayout
[
i
 + 1] =
VRFY_ITEM_NOTSET
 &&

763 (
size_t
)(
i
 + 1< 
dbp
->
pgsize
; i++)

766 
VRFY_ITEM_BEGIN
:

768 i(
i
 !
	`DB_ALIGN
(i, (
u_t32_t
))) {

769 
isbad
 = 1;

770 
	`EPRINT
((
dbv
,

772 (
u_lg
)
pgno
, (u_lg)
i
));

774 
em
 = 1;

775 
rs
++;

777 
VRFY_ITEM_END
:

783 
isbad
 = 1;

784 
	`EPRINT
((
dbv
,

786 (
u_lg
)
pgno
, (u_lg)
i
));

790 
gayout
[
i
]) {

791 
VRFY_ITEM_NOTSET
:

794 
VRFY_ITEM_END
:

796 
em
 = 0;

798 
VRFY_ITEM_BEGIN
:

803 
isbad
 = 1;

804 
	`EPRINT
((
dbv
,

806 (
u_lg
)
pgno
, (u_lg)
i
));

810 
	`__os_
(
dbv
, 
gayout
);

813 i((
db_dx_t
)
himk
 !
	`HOFFSET
(
h
)) {

814 
	`EPRINT
((
dbv
, "Page %lu: bad HOFFSET %lu,ppearso be %lu",

815 (
u_lg
)
pgno
, (u_lg)
	`HOFFSET
(
h
), (u_lg)
himk
));

816 
isbad
 = 1;

819 
r
: i(
r
 !
NULL
)

820 *
r
 = 
rs
;

822 i((
t_t
 = 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0 && 
t
 == 0)

823 
t
 = 
t_t
;

825  ((
isbad
 =1 && 
t
 =0? 
DB_VERIFY_BAD
 :et);

826 
	}
}

845 
	$__bam_vrfy_emd
(
dbp
, 
vdp
, 
h
, 
pgno
, 
rs
, 
ovok
, 
hasdups
, 
ags
)

846 
DB
 *
dbp
;

847 
VRFY_DBINFO
 *
vdp
;

848 
PAGE
 *
h
;

849 
db_pgno_t
 
pgno
;

850 
u_t32_t
 
rs
;

851 
ovok
, 
hasdups
;

852 
u_t32_t
 
ags
;

854 
BINTERNAL
 *
bi
;

855 
BKEYDATA
 *
bk
;

856 
BOVERFLOW
 *
bo
;

857 
BTREE
 *
bt
;

858 
DBT
 
db
, 
dbtb
, 
dup_1
, 
dup_2
, *
p1
, *
p2
, *
tmp
;

859 
DB_ENV
 *
dbv
;

860 
VRFY_PAGEINFO
 *
p
;

861 
db_dx_t
 
i
, *
p
;

862 
adj
, 
cmp
, 
dup_1
, 
dup_2
, 
isbad
, 
t
, 
t_t
;

863 (*
dupfunc

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

864 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

865 *
buf1
, *
buf2
, *
tmpbuf
;

872 i(
vdp
 !
NULL
) {

873 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

874  (
t
);

875 
rs
 = 
p
->
s
;

877 
p
 = 
NULL
;

879 
dbv
 = 
dbp
->dbenv;

880 
t
 = 
isbad
 = 0;

881 
bo
 = 
NULL
;

883 
	`memt
(&
db
, 0, (
DBT
));

884 
	`F_SET
(&
db
, 
DB_DBT_REALLOC
);

886 
	`memt
(&
dbtb
, 0, (
DBT
));

887 
	`F_SET
(&
dbtb
, 
DB_DBT_REALLOC
);

889 
buf1
 = 
buf2
 = 
NULL
;

891 
	`DB_ASSERT
(
dbv
, !
	`LF_ISSET
(
DB_NOORDERCHK
));

893 
dupfunc
 = (
dbp
->
dup_com
 =
NULL
? 
__bam_defcmp
 : dbp->dup_compare;

894 i(
	`TYPE
(
h
=
P_LDUP
)

895 
func
 = 
dupfunc
;

897 
func
 = 
__bam_defcmp
;

898 i(
dbp
->
bt_
 !
NULL
) {

899 
bt
 = (
BTREE
 *)
dbp
->
bt_
;

900 i(
bt
->
bt_com
 !
NULL
)

901 
func
 = 
bt
->
bt_com
;

910 
p1
 = &
db
;

911 
p2
 = &
dbtb
;

923 
p
 = 
	`P_INP
(
dbp
, 
h
);

924 
adj
 = (
	`TYPE
(
h
=
P_LBTREE
? 
P_INDX
 : 
O_INDX
;

925 
i
 = (
	`TYPE
(
h
=
P_IBTREE
? 1 : 0; i < 
rs
; i +
adj
) {

929 
tmp
 = 
p1
;

930 
p1
 = 
p2
;

931 
p2
 = 
tmp
;

932 
tmpbuf
 = 
buf1
;

933 
buf1
 = 
buf2
;

934 
buf2
 = 
tmpbuf
;

939 
	`TYPE
(
h
)) {

940 
P_IBTREE
:

941 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
);

942 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
) {

943 
bo
 = (
BOVERFLOW
 *)(
bi
->
da
);

944 
ovow
;

946 
p2
->
da
 = 
bi
->data;

947 
p2
->
size
 = 
bi
->
n
;

961 i(
i
 =0 && 
bi
->
n
 != 0) {

962 
isbad
 = 1;

963 
	`EPRINT
((
dbv
,

965 (
u_lg
)
pgno
));

969 
P_LBTREE
:

970 
P_LDUP
:

971 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

972 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
) {

973 
bo
 = (
BOVERFLOW
 *)
bk
;

974 
ovow
;

976 
p2
->
da
 = 
bk
->data;

977 
p2
->
size
 = 
bk
->
n
;

985 
t
 = 
	`__db_unknown_th
(
dbv
, "__bam_vrfy_itemorder");

986 
r
;

1000 
ovow
: i(!
ovok
) {

1001 
	`F_SET
(
p
, 
VRFY_INCOMPLETE
);

1002 
r
;

1014 
p2
->
da
 = 
buf2
;

1015 i((
t
 = 
	`__db_goff
(
dbp
, 
NULL
,

1016 
p2
, 
bo
->

, bo->
pgno
, 
NULL
, NULL)) != 0) {

1017 
isbad
 = 1;

1018 
	`EPRINT
((
dbv
,

1020 (
u_lg
)
pgno
, (u_lg)
t
, (u_lg)
i
));

1023 
buf2
 = 
p2
->
da
;

1027 i(
p1
->
da
 !
NULL
 && 
p2
->data != NULL) {

1028 
cmp
 = 
p
[
i
] =p[- 
adj
] ? 0 : 
	`func
(
dbp
, 
p1
, 
p2
);

1031 i(
cmp
 > 0) {

1032 
isbad
 = 1;

1033 
	`EPRINT
((
dbv
,

1035 (
u_lg
)
pgno
, (u_lg)
i
));

1037 } i(
cmp
 == 0) {

1038 i(
p
[
i
] !p[- 
adj
]) {

1039 
	`EPRINT
((
dbv
,

1041 (
u_lg
)
pgno
, (u_lg)
i
));

1042 
isbad
 = 1;

1050 i(
p
 !
NULL
)

1051 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

1052 i(
hasdups
 == 0) {

1053 
isbad
 = 1;

1054 
	`EPRINT
((
dbv
,

1056 (
u_lg
)
pgno
));

1071 i(
	`TYPE
(
h
=
P_LBTREE
) {

1076 i(
i
 + 1 >(
db_dx_t
)
rs
)

1086 i(((
t
 = 
	`__bam__gda
(
dbp
,

1087 
h
, 
i
 - 1, 
ovok
, &
dup_1
,

1088 &
dup_1
)) != 0) ||

1089 ((
t
 = 
	`__bam__gda
(
dbp
,

1090 
h
, 
i
 + 1, 
ovok
, &
dup_2
,

1091 &
dup_2
)) != 0))

1092 
r
;

1100 i(
dup_1
.
da
 =
NULL
 ||

1101 
dup_2
.
da
 =
NULL
) {

1102 
	`DB_ASSERT
(
dbv
, !
ovok
);

1103 
	`F_SET
(
p
, 
VRFY_INCOMPLETE
);

1104 
r
;

1113 i(
	`dupfunc
(
dbp
, &
dup_1
, &
dup_2
) > 0)

1114 
	`F_SET
(
p
, 
VRFY_DUPS_UNSORTED
);

1116 i(
dup_1
)

1117 
	`__os_u
(
dbv
, 
dup_1
.
da
);

1118 i(
dup_2
)

1119 
	`__os_u
(
dbv
, 
dup_2
.
da
);

1125 
r
: i(
p
 !
NULL
 && ((
t_t
 =

1126 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0&& 
t
 == 0)

1127 
t
 = 
t_t
;

1129 i(
buf1
 !
NULL
)

1130 
	`__os_u
(
dbv
, 
buf1
);

1131 i(
buf2
 !
NULL
)

1132 
	`__os_u
(
dbv
, 
buf2
);

1134  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

1135 
	}
}

1146 
	$__bam_vrfy_ruu
(
dbp
, 
vdp
, 
ma_pgno
, 
ags
)

1147 
DB
 *
dbp
;

1148 
VRFY_DBINFO
 *
vdp
;

1149 
db_pgno_t
 
ma_pgno
;

1150 
u_t32_t
 
ags
;

1152 
DB
 *
pgt
;

1153 
DB_ENV
 *
dbv
;

1154 
VRFY_PAGEINFO
 *
m
, *
r
;

1155 
db_pgno_t
 
ro
, 
p
;

1156 
t_t
, 
t
;

1157 
u_t32_t
 
ecs
, 
v
, 
n
, 
ags
;

1159 
dbv
 = 
dbp
->dbenv;

1160 
m
 = 
r
 = 0;

1161 
pgt
 = 
vdp
->pgset;

1163 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
ma_pgno
, &
m
)) != 0)

1164  (
t
);

1166 i((
t
 = 
	`__db_vrfy_pgt_g
(
pgt
, 
ma_pgno
, (*)&
p
)) != 0)

1167 
r
;

1168 i(
p
 != 0) {

1169 
	`EPRINT
((
dbv
,

1171 (
u_lg
)
ma_pgno
));

1172 
t
 = 
DB_VERIFY_BAD
;

1173 
r
;

1175 i((
t
 = 
	`__db_vrfy_pgt_c
(
pgt
, 
ma_pgno
)) != 0)

1176 
r
;

1178 
ro
 = 
m
->root;

1180 i(
ro
 == 0) {

1181 
	`EPRINT
((
dbv
,

1183 (
u_lg
)
ma_pgno
));

1184 
t
 = 
DB_VERIFY_BAD
;

1185 
r
;

1188 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
ro
, &
r
)) != 0)

1189 
r
;

1191 
r
->
ty
) {

1192 
P_IBTREE
:

1193 
P_LBTREE
:

1194 
ags
 = 
ags
 | 
ST_TOPLEVEL
;

1195 i(
	`F_ISSET
(
m
, 
VRFY_HAS_DUPS
))

1196 
ags
 |
ST_DUPOK
;

1197 i(
	`F_ISSET
(
m
, 
VRFY_HAS_DUPSORT
))

1198 
ags
 |
ST_DUPSORT
;

1199 i(
	`F_ISSET
(
m
, 
VRFY_HAS_RECNUMS
))

1200 
ags
 |
ST_RECNUM
;

1201 
t
 = 
	`__bam_vrfy_sub
(
dbp
,

1202 
vdp
, 
ro
, 
NULL
, NULL, 
ags
, NULL, NULL, NULL);

1204 
P_IRECNO
:

1205 
P_LRECNO
:

1206 
ags
 = 
ags
 | 
ST_RECNUM
 | 
ST_IS_RECNO
 | 
ST_TOPLEVEL
;

1207 i(
m
->
_n
 > 0)

1208 
ags
 |
ST_RELEN
;

1209 i((
t
 = 
	`__bam_vrfy_sub
(
dbp
, 
vdp
,

1210 
ro
, 
NULL
, NULL, 
ags
, &
v
, &
ecs
, &
n
)) != 0)

1211 
r
;

1218 i(
m
->
_n
 > 0 && 
n
 > 0 && mip->re_len !=elen) {

1219 
	`EPRINT
((
dbv
,

1221 (
u_lg
)
ma_pgno
, (u_lg)
n
));

1222 
t
 = 
DB_VERIFY_BAD
;

1223 
r
;

1225 
t
 = 0;

1227 
P_LDUP
:

1228 
	`EPRINT
((
dbv
,

1230 (
u_lg
)
ma_pgno
));

1231 
t
 = 
DB_VERIFY_BAD
;

1234 
	`EPRINT
((
dbv
,

1236 (
u_lg
)
ma_pgno
, (u_lg)
r
->
ty
));

1237 
t
 = 
DB_VERIFY_BAD
;

1241 
r
: i(
m
 !
NULL
 && ((
t_t
 =

1242 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
m
)!0&& 
t
 == 0)

1243 
t
 = 
t_t
;

1244 i(
r
 !
NULL
 && ((
t_t
 =

1245 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
r
)!0&& 
t
 == 0)

1246 
t
 = 
t_t
;

1247  (
t
);

1248 
	}
}

1261 
	$__bam_vrfy_sub
(
dbp
, 
vdp
, 
pgno
, 
l
, 
r
, 
ags
, 
vp
, 
ec
, 

)

1262 
DB
 *
dbp
;

1263 
VRFY_DBINFO
 *
vdp
;

1264 
db_pgno_t
 
pgno
;

1265 *
l
, *
r
;

1266 
u_t32_t
 
ags
, *
vp
, *
ec
, *

;

1268 
BINTERNAL
 *
li
, *
ri
;

1269 
DB
 *
pgt
;

1270 
DBC
 *
cc
;

1271 
DB_ENV
 *
dbv
;

1272 
DB_MPOOLFILE
 *
mpf
;

1273 
PAGE
 *
h
;

1274 
VRFY_CHILDINFO
 *
chd
;

1275 
VRFY_PAGEINFO
 *
p
;

1276 
db_dx_t
 
i
;

1277 
db_pgno_t
 
xt_pgno
, 
ev_pgno
;

1278 
db_o_t
 
chd_ecs
, 
ecs
;

1279 
u_t32_t
 
chd_v
, 
chd_n
, 
j
, 
v
, 
n
, 
ags
;

1280 
u_t8_t
 
af_ty
;

1281 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

1282 
isbad
, 
p
, 
t
, 
t_t
, 
tv
;

1284 i(
vp
 !
NULL
)

1285 *
vp
 = 0;

1286 i(
ec
 !
NULL
)

1287 *
ec
 = 0;

1289 
dbv
 = 
dbp
->dbenv;

1290 
mpf
 = 
dbp
->mpf;

1291 
h
 = 
NULL
;

1292 
xt_pgno
 = 
ev_pgno
 = 
PGNO_INVALID
;

1293 
ecs
 = 0;

1294 
n
 = 0;

1295 
af_ty
 = 
P_INVALID
;

1296 
isbad
 = 
t
 = 0;

1299 i(!
	`LF_ISSET
(
DB_SALVAGE
))

1300 
	`__db_vrfy_ru_edback
(
dbp
, 
vdp
);

1302 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

1303  (
t
);

1305 
cc
 = 
NULL
;

1306 
v
 = 
p
->
bt_v
;

1308 
tv
 = 
	`LF_ISSET
(
ST_TOPLEVEL
) ? 1 : 0;

1309 
	`LF_CLR
(
ST_TOPLEVEL
);

1321 i(
tv
) {

1327 
ev_pgno
 = 
vdp
->prev_pgno;

1328 
xt_pgno
 = 
vdp
->next_pgno;

1329 
af_ty
 = 
vdp
->leaf_type;

1330 
vdp
->
xt_pgno
 = vdp->
ev_pgno
 = 
PGNO_INVALID
;

1331 
vdp
->
af_ty
 = 
P_INVALID
;

1359 
p
->
ty
) {

1360 
P_LRECNO
:

1361 
P_LDUP
:

1362 
P_LBTREE
:

1369 i(
vdp
->
af_ty
 =
P_INVALID
) {

1375 
vdp
->
af_ty
 = 
p
->
ty
;

1376 i(
p
->
ev_pgno
 !
PGNO_INVALID
)

1377 
bad_ev
;

1383 i(
p
->
ty
 !
vdp
->
af_ty
) {

1384 
isbad
 = 1;

1385 
	`EPRINT
((
dbv
,

1387 (
u_lg
)
p
->
pgno
, (u_lg->
ty
,

1388 (
u_lg
)
vdp
->
af_ty
));

1395 i(!
	`F_ISSET
(
vdp
, 
VRFY_LEAFCHAIN_BROKEN
)) {

1396 i(
p
->
pgno
 !
vdp
->
xt_pgno
) {

1397 
isbad
 = 1;

1398 
	`EPRINT
((
dbv
,

1400 (
u_lg
)
vdp
->
ev_pgno
,

1401 (
u_lg
)
vdp
->
xt_pgno
,

1402 (
u_lg
)
p
->
pgno
));

1404 i(
p
->
ev_pgno
 !
vdp
->prev_pgno) {

1405 
bad_ev
: 
isbad
 = 1;

1406 
	`EPRINT
((
dbv
,

1408 (
u_lg
)
p
->
pgno
,

1409 (
u_lg
)
p
->
ev_pgno
,

1410 (
u_lg
)
vdp
->
ev_pgno
));

1414 
vdp
->
ev_pgno
 = 
p
->
pgno
;

1415 
vdp
->
xt_pgno
 = 
p
->next_pgno;

1416 
	`F_CLR
(
vdp
, 
VRFY_LEAFCHAIN_BROKEN
);

1422 i((
t
 = 
	`__db_vrfy_chdcurs
(
vdp
, &
cc
)) != 0)

1423 
r
;

1424 
t
 = 
	`__db_vrfy_cct
(
cc
, 
pgno
, &
chd
);et == 0;

1425 
t
 = 
	`__db_vrfy_cext
(
cc
, &
chd
))

1426 i(
chd
->
ty
 =
V_OVERFLOW
 &&

1427 (
t
 = 
	`__db_vrfy_ov_ruu
(
dbp
, 
vdp
,

1428 
chd
->
pgno
, chd->

,

1429 
ags
 | 
ST_OVFL_LEAF
)) != 0) {

1430 i(
t
 =
DB_VERIFY_BAD
)

1431 
isbad
 = 1;

1433 
de
;

1436 i((
t
 = 
	`__db_vrfy_cco
(
cc
)) != 0)

1437 
r
;

1438 
cc
 = 
NULL
;

1441 i(
p
->
ty
 =
P_LRECNO
) {

1442 i(!
	`LF_ISSET
(
ST_IS_RECNO
) &&

1443 !(
	`LF_ISSET
(
ST_DUPOK
&& !LF_ISSET(
ST_DUPSORT
))) {

1444 
isbad
 = 1;

1445 
	`EPRINT
((
dbv
,

1447 (
u_lg
)
pgno
));

1448 
de
;

1450 
af
;

1451 } i(
	`LF_ISSET
(
ST_IS_RECNO
)) {

1456 
isbad
 = 1;

1457 
	`EPRINT
((
dbv
,

1459 (
u_lg
)
pgno
));

1460 
de
;

1464 i(
p
->
ty
 =
P_LDUP
)

1465 
af
;

1470 i(
	`F_ISSET
(
p
, 
VRFY_HAS_DUPS
)) {

1472 i(!
	`LF_ISSET
(
ST_DUPOK
)) {

1473 
isbad
 = 1;

1474 
	`EPRINT
((
dbv
,

1476 (
u_lg
)
pgno
));

1482 i((
t
 =

1483 
	`__db_vrfy_chdcurs
(
vdp
, &
cc
)) != 0)

1484 
r
;

1485 
t
 = 
	`__db_vrfy_cct
(
cc
, 
pgno
, &
chd
);

1486 
t
 == 0;

1487 
t
 = 
	`__db_vrfy_cext
(
cc
, &
chd
)) {

1488 
ags
 = 
ags
 | 
ST_RECNUM
 | 
ST_DUPSET
;

1490 i(
chd
->
ty
 =
V_DUPLICATE
) {

1491 i((
t
 = 
	`__db_vrfy_duy
(

1492 
dbp
, 
vdp
, 
chd
->
pgno
,

1493 
ags
)) != 0) {

1494 
isbad
 = 1;

1498 i((
t
 = 
	`__bam_vrfy_sub
(

1499 
dbp
, 
vdp
, 
chd
->
pgno
, 
NULL
,

1500 
NULL
, 
ags
 | 
ST_TOPLEVEL
,

1501 
NULL
, NULL, NULL)) != 0) {

1502 i(
t
 ==

1503 
DB_VERIFY_BAD
)

1504 
isbad
 = 1;

1506 
r
;

1511 i((
t
 = 
	`__db_vrfy_cco
(
cc
)) != 0)

1512 
r
;

1513 
cc
 = 
NULL
;

1519 i(
	`F_ISSET
(
p
, 
VRFY_DUPS_UNSORTED
) &&

1520 
	`LF_ISSET
(
ST_DUPSORT
)) {

1521 
isbad
 = 1;

1522 
	`EPRINT
((
dbv
,

1524 (
u_lg
)
pgno
));

1528 
af
;

1529 
P_IBTREE
:

1530 
P_IRECNO
:

1545 i(
	`F_ISSET
(
p
, 
VRFY_IS_ALLZEROES
))

1546 
	`ZEROPG_ERR_PRINT
(
dbv
, 
pgno
, "btree orecnoage");

1548 
	`EPRINT
((
dbv
,

1550 (
u_lg
)
pgno
, (u_lg)
p
->
ty
));

1559 
	`F_SET
(
vdp
, 
VRFY_LEAFCHAIN_BROKEN
);

1561 
t
 = 
DB_VERIFY_BAD
;

1562 
r
;

1570 i((
t
 = 
	`__db_vrfy_chdcurs
(
vdp
, &
cc
)) != 0)

1571 
r
;

1572 
t
 = 
	`__db_vrfy_cct
(
cc
, 
pgno
, &
chd
);et == 0;

1573 
t
 = 
	`__db_vrfy_cext
(
cc
, &
chd
))

1574 i(
chd
->
ty
 =
V_RECNO
) {

1575 i(
p
->
ty
 !
P_IRECNO
) {

1576 
t
 = 
	`__db_unknown_th
(

1577 
dbv
, "__bam_vrfy_subtree");

1578 
r
;

1580 i((
t
 = 
	`__bam_vrfy_sub
(
dbp
, 
vdp
, 
chd
->
pgno
,

1581 
NULL
, NULL, 
ags
, &
chd_v
, &
chd_ecs
,

1582 &
chd_n
)) != 0) {

1583 i(
t
 =
DB_VERIFY_BAD
)

1584 
isbad
 = 1;

1586 
de
;

1589 i(
	`LF_ISSET
(
ST_RELEN
)) {

1590 i(
n
 == 0)

1591 
n
 = 
chd_n
;

1596 i(
chd_n
 > 0 &&

1597 
n
 !
chd_n
) {

1598 
isbad
 = 1;

1599 
	`EPRINT
((
dbv
,

1601 (
u_lg
)
chd
->
pgno
,

1602 (
u_lg
)
chd_n
));

1604 i(

)

1605 *

 = 
n
;

1607 i(
	`LF_ISSET
(
ST_RECNUM
)) {

1608 i(
chd
->
ecs
 !
chd_ecs
) {

1609 
isbad
 = 1;

1610 
	`EPRINT
((
dbv
,

1612 (
u_lg
)
chd
->
pgno
,

1613 (
u_lg
)
chd_ecs
,

1614 (
u_lg
)
chd
->
ecs
));

1616 
ecs
 +
chd_ecs
;

1618 i(
isbad
 =0 && 
v
 !
chd_v
 + 1) {

1619 
isbad
 = 1;

1620 
	`EPRINT
((
dbv
,

1622 (
u_lg
)
chd
->
pgno
, (u_lg)
chd_v
,

1623 (
u_lg
)(
v
 - 1)));

1625 } i(
chd
->
ty
 =
V_OVERFLOW
) {

1645 
	`DB_ASSERT
(
dbv
, 
chd
->
ft
 >= 1);

1651 i(
chd
->
ft
 > 2) {

1652 
isbad
 = 1;

1653 
	`EPRINT
((
dbv
,

1655 (
u_lg
)
pgno
, (u_lg)
chd
->pgno));

1657 
j
 = 0; j < 
chd
->
ft
; j++)

1658 i((
t
 = 
	`__db_vrfy_ov_ruu
(
dbp
,

1659 
vdp
, 
chd
->
pgno
, chd->

,

1660 
ags
)) != 0) {

1661 i(
t
 =
DB_VERIFY_BAD
)

1662 
isbad
 = 1;

1664 
de
;

1668 i((
t
 = 
	`__db_vrfy_cco
(
cc
)) != 0)

1669 
r
;

1670 
cc
 = 
NULL
;

1673 i(
p
->
ty
 =
P_IRECNO
)

1674 
de
;

1686 i(
h
 =
NULL
 && (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, NULL, 0, &h)) != 0)

1687 
r
;

1688 
i
 = 0; i < 
p
->
s
; i +
O_INDX
) {

1689 
li
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
);

1690 
ri
 = (
i
 + 
O_INDX
 < 
p
->
s
) ?

1691 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
 + 
O_INDX
: 
r
;

1697 i((
t
 = 
	`__bam_vrfy_sub
(
dbp
, 
vdp
, 
li
->
pgno
,

1698 
i
 =0 ? 
NULL
 : 
li
, 
ri
, 
ags
, &
chd_v
,

1699 &
chd_ecs
, 
NULL
)) != 0) {

1700 i(
t
 =
DB_VERIFY_BAD
)

1701 
isbad
 = 1;

1703 
de
;

1706 i(
	`LF_ISSET
(
ST_RECNUM
)) {

1712 
ecs
 +
chd_ecs
;

1718 i(
li
->
ecs
 !
chd_ecs
) {

1719 
isbad
 = 1;

1720 
	`EPRINT
((
dbv
,

1722 (
u_lg
)
pgno
, (u_lg)
i
, (u_lg)
li
->
ecs
,

1723 (
u_lg
)
chd_ecs
));

1727 i(
v
 !
chd_v
 + 1) {

1728 
isbad
 = 1;

1729 
	`EPRINT
((
dbv
,

1731 (
u_lg
)
li
->
pgno
,

1732 (
u_lg
)
chd_v
, (u_lg)(
v
 - 1)));

1737 
af
: 
v
 = 
LEAFLEVEL
;

1738 i(
	`LF_ISSET
(
ST_RECNUM
))

1739 
ecs
 = 
p
->
c_t
;

1749 i(
	`LF_ISSET
(
ST_RELEN
&& 

)

1750 *

 = 
p
->
_n
;

1752 
de
: i(
	`F_ISSET
(
p
, 
VRFY_INCOMPLETE
&& 
isbad
 =0 && 
t
 == 0) {

1759 i(
h
 =
NULL
 &&

1760 (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
NULL
, 0, &
h
)) != 0)

1761 
r
;

1762 i((
t
 = 
	`__bam_vrfy_emd
(
dbp
,

1763 
vdp
, 
h
, 
pgno
, 0, 1, 0, 
ags
)) != 0)

1764 
r
;

1765 
	`F_CLR
(
p
, 
VRFY_INCOMPLETE
);

1778 i(
isbad
 =0 && 
t
 == 0) {

1779 i(
h
 =
NULL
 &&

1780 (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
NULL
, 0, &
h
)) != 0)

1781 
r
;

1783 i(
	`NUM_ENT
(
h
=0 && 
	`ISINTERNAL
(h)) {

1784 
isbad
 = 1;

1785 
	`EPRINT
((
dbv
,

1787 (
u_lg
)
pgno
));

1788 
r
;

1797 i(
isbad
 =0 && 
t
 =0 && !
	`LF_ISSET
(
DB_NOORDERCHK
) &&

1798 
p
->
ty
 !
P_IRECNO
 &&->ty !
P_LRECNO
) {

1799 i(
h
 =
NULL
 &&

1800 (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
NULL
, 0, &
h
)) != 0)

1801 
r
;

1809 
func
 = 
	`LF_ISSET
(
ST_DUPSET
? 
dbp
->
dup_com
 :

1810 ((
BTREE
 *)
dbp
->
bt_
)->
bt_com
;

1811 i(
func
 =
NULL
)

1812 
func
 = 
__bam_defcmp
;

1814 i((
t
 = 
	`__bam_vrfy_d
(

1815 
dbp
, 
h
, 
l
, 
r
, 
func
, 
ags
)) != 0) {

1816 i(
t
 =
DB_VERIFY_BAD
)

1817 
isbad
 = 1;

1819 
r
;

1829 i(
	`LF_ISSET
(
ST_RECNUM
&& 
ecs
 !
p
->
c_t
 && 
tv
) {

1830 
isbad
 = 1;

1831 
	`EPRINT
((
dbv
,

1833 (
u_lg
)
pgno
, (u_lg)
ecs
, (u_lg)
p
->
c_t
));

1836 i(
vp
)

1837 *
vp
 = 
v
;

1838 i(
ec
)

1839 *
ec
 = 
ecs
;

1841 
pgt
 = 
vdp
->pgset;

1842 i((
t
 = 
	`__db_vrfy_pgt_g
(
pgt
, 
pgno
, &
p
)) != 0)

1843 
r
;

1844 i(
p
 != 0) {

1845 
isbad
 = 1;

1846 
	`EPRINT
((
dbv
, "Pag%lu:kedwi", (
u_lg
)
pgno
));

1847 } i((
t
 = 
	`__db_vrfy_pgt_c
(
pgt
, 
pgno
)) != 0)

1848 
r
;

1850 i(
tv
)

1855 i(
vdp
->
xt_pgno
 !
PGNO_INVALID
) {

1856 
isbad
 = 1;

1857 
	`EPRINT
((
dbv
, "Page %lu: unterminatedeaf chain",

1858 (
u_lg
)
vdp
->
ev_pgno
));

1861 
r
: i(
tv
) {

1863 
vdp
->
xt_pgno
 =ext_pgno;

1864 
vdp
->
ev_pgno
 =rev_pgno;

1865 
vdp
->
af_ty
 =eaf_type;

1868 i(
h
 !
NULL
 && (
t_t
 =

1869 
	`__memp_ut
(
mpf
, 
h
, 
DB_PRIORITY_UNCHANGED
)!0 && 
t
 == 0)

1870 
t
 = 
t_t
;

1871 i((
t_t
 = 
	`__db_vrfy_puagefo
(
dbv
, 
vdp
, 
p
)!0 && 
t
 == 0)

1872 
t
 = 
t_t
;

1873 i(
cc
 !
NULL
 && ((
t_t
 = 
	`__db_vrfy_cco
(cc)!0&& 
t
 == 0)

1874 
t
 = 
t_t
;

1875  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

1876 
	}
}

1892 
	$__bam_vrfy_d
(
dbp
, 
h
, 

, 

, 
func
, 
ags
)

1893 
DB
 *
dbp
;

1894 
PAGE
 *
h
;

1895 
BINTERNAL
 *

, *

;

1896 (*
func

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *));

1897 
u_t32_t
 
ags
;

1899 
BOVERFLOW
 *
bo
;

1900 
DB_ENV
 *
dbv
;

1901 
DBT
 
dbt
;

1902 
db_dx_t
 
ϡ
;

1903 
t
, 
cmp
;

1905 
dbv
 = 
dbp
->dbenv;

1906 
	`memt
(&
dbt
, 0, (
DBT
));

1907 
	`F_SET
(&
dbt
, 
DB_DBT_MALLOC
);

1908 
t
 = 0;

1915 i(
	`NUM_ENT
(
h
) == 0)

1918 
	`TYPE
(
h
)) {

1919 
P_IBTREE
:

1920 
P_LDUP
:

1921 
ϡ
 = 
	`NUM_ENT
(
h
- 
O_INDX
;

1923 
P_LBTREE
:

1924 
ϡ
 = 
	`NUM_ENT
(
h
- 
P_INDX
;

1927  (
	`__db_unknown_th
(
dbv
, "__bam_vrfy_treeorder"));

1943 i(

 !
NULL
 && 
	`TYPE
(
h
!
P_IBTREE
) {

1944 i(

->
ty
 =
B_KEYDATA
) {

1945 
dbt
.
da
 = 

->data;

1946 
dbt
.
size
 = 

->
n
;

1947 } i(

->
ty
 =
B_OVERFLOW
) {

1948 
bo
 = (
BOVERFLOW
 *)

->
da
;

1949 i((
t
 = 
	`__db_goff
(
dbp
, 
NULL
, &
dbt
,

1950 
bo
->

, bo->
pgno
, 
NULL
, NULL)) != 0)

1951  (
t
);

1954 
	`__db_unknown_th
(
dbv
, "__bam_vrfy_treeorder"));

1957 i((
t
 = 
	`__bam_cmp
(
dbp
, 
NULL
, &
dbt
, 
h
, 0, 
func
, &
cmp
)) == 0) {

1958 i(
cmp
 > 0) {

1959 
	`EPRINT
((
dbv
,

1961 (
u_lg
)
	`PGNO
(
h
)));

1962 
t
 = 
DB_VERIFY_BAD
;

1965 
	`EPRINT
((
dbv
,

1967 (
u_lg
)
	`PGNO
(
h
)));

1969 i(
dbt
.
da
 !

->data)

1970 
	`__os_u
(
dbv
, 
dbt
.
da
);

1971 i(
t
 != 0)

1972  (
t
);

1975 i(

 !
NULL
) {

1976 i(

->
ty
 =
B_KEYDATA
) {

1977 
dbt
.
da
 = 

->data;

1978 
dbt
.
size
 = 

->
n
;

1979 } i(

->
ty
 =
B_OVERFLOW
) {

1980 
bo
 = (
BOVERFLOW
 *)

->
da
;

1981 i((
t
 = 
	`__db_goff
(
dbp
, 
NULL
, &
dbt
,

1982 
bo
->

, bo->
pgno
, 
NULL
, NULL)) != 0)

1983  (
t
);

1986 
	`__db_unknown_th
(
dbv
, "__bam_vrfy_treeorder"));

1989 i((
t
 = 
	`__bam_cmp
(
dbp
, 
NULL
, &
dbt
,

1990 
h
, 
ϡ
, 
func
, &
cmp
)) == 0) {

1991 i(
cmp
 < 0) {

1992 
	`EPRINT
((
dbv
,

1994 (
u_lg
)
	`PGNO
(
h
)));

1995 
t
 = 
DB_VERIFY_BAD
;

1998 
	`EPRINT
((
dbv
,

2000 (
u_lg
)
	`PGNO
(
h
)));

2002 i(
dbt
.
da
 !

->data)

2003 
	`__os_u
(
dbv
, 
dbt
.
da
);

2006  (
t
);

2007 
	}
}

2019 
	$__bam_lvage
(
dbp
, 
vdp
, 
pgno
, 
pgty
, 
h
, 
hd
, 
back
, 
key
, 
ags
)

2020 
DB
 *
dbp
;

2021 
VRFY_DBINFO
 *
vdp
;

2022 
db_pgno_t
 
pgno
;

2023 
u_t32_t
 
pgty
;

2024 
PAGE
 *
h
;

2025 *
hd
;

2026 (*
back

	`__P
((*, const *));

2027 
DBT
 *
key
;

2028 
u_t32_t
 
ags
;

2030 
BKEYDATA
 *
bk
;

2031 
BOVERFLOW
 *
bo
;

2032 
DBT
 
dbt
, 
unknown_key
, 
unknown_da
;

2033 
DB_ENV
 *
dbv
;

2034 
VRFY_ITEM
 *
pgm
;

2035 
db_dx_t
 
i
, 
ϡ
, 
beg
, 
d
, *
p
;

2036 
u_t32_t
 
himk
;

2037 *
ovbuf
;

2038 
t
, 
t_t
, 
t2_t
;

2040 
dbv
 = 
dbp
->dbenv;

2041 
ovbuf
 = 
pgm
 = 
NULL
;

2042 
p
 = 
	`P_INP
(
dbp
, 
h
);

2044 
	`memt
(&
dbt
, 0, (
DBT
));

2045 
dbt
.
ags
 = 
DB_DBT_REALLOC
;

2047 
	`DB_INIT_DBT
(
unknown_key
, "UNKNOWN_KEY", ("UNKNOWN_KEY") - 1);

2048 
	`DB_INIT_DBT
(
unknown_da
, "UNKNOWN_DATA", ("UNKNOWN_DATA") - 1);

2054 i((
t
 = 
	`__os_mloc
(
dbv
, 
dbp
->
pgsize
, &
ovbuf
)) != 0)

2055 
r
;

2057 i(
	`LF_ISSET
(
DB_AGGRESSIVE
&& (
t
 =

2058 
	`__os_oc
(
dbv
, 
dbp
->
pgsize
, (
pgm
[0]), &pgmap)) != 0)

2059 
r
;

2068 
himk
 = 
dbp
->
pgsize
;

2069 
i
 = 0, 
ϡ
 = 
UINT16_MAX
;; i +
O_INDX
) {

2071 i(!
	`LF_ISSET
(
DB_AGGRESSIVE
&& 
i
 >
	`NUM_ENT
(
h
))

2075 
t_t
 =

2076 
	`__db_vrfy_pem
(
dbp
, 
h
, 
pgno
, 
i
, 1, 
ags
, &
himk
, 
NULL
);

2078 i(
t_t
 != 0) {

2084 i(
pgty
 =
P_LBTREE
 && 
i
 % 
P_INDX
 == 1 &&

2085 
ϡ
 =
i
 - 1 && (
t2_t
 = 
	`__db_vrfy_dbt
(

2086 &
unknown_da
,

2087 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2088 i(
t
 == 0)

2089 
t
 = 
t2_t
;

2090 
r
;

2099 i(
t_t
 =
DB_VERIFY_FATAL
) {

2100 i(
i
 < 
	`NUM_ENT
(
h
&& 
t
 == 0)

2101 
t
 = 
DB_VERIFY_BAD
;

2113 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

2114 i(!
	`LF_ISSET
(
DB_AGGRESSIVE
&& 
	`B_DISSET
(
bk
->
ty
))

2122 i(
pgty
 =
P_LBTREE
 && 
i
 % 
P_INDX
 == 1 &&

2123 
ϡ
 !
i
 - 1 && (
t_t
 = 
	`__db_vrfy_dbt
(

2124 &
unknown_key
, 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2125 i(
t
 == 0)

2126 
t
 = 
t_t
;

2127 
r
;

2129 
ϡ
 = 
i
;

2137 i(
key
 !
NULL
 && (
i
 !0 || !
	`LF_ISSET
(
SA_SKIPFIRSTKEY
)))

2138 i((
t_t
 = 
	`__db_vrfy_dbt
(
key
,

2139 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2140 i(
t
 == 0)

2141 
t
 = 
t_t
;

2142 
r
;

2145 
beg
 = 
p
[
i
];

2146 
	`B_TYPE
(
bk
->
ty
)) {

2147 
B_DUPLICATE
:

2148 
d
 = 
beg
 + 
BOVERFLOW_SIZE
 - 1;

2156 i(
pgty
 !
P_LBTREE
)

2159 
bo
 = (
BOVERFLOW
 *)
bk
;

2167 i(!
	`IS_VALID_PGNO
(
bo
->
pgno
|| (
i
 % 
P_INDX
 == 0)) {

2169 i((
t_t
 = 
	`__db_vrfy_dbt
(&
unknown_key
,

2170 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2171 i(
t
 == 0)

2172 
t
 = 
t_t
;

2173 
r
;

2179 i((
t_t
 = 
	`__db_lvage_due
(
dbp
,

2180 
vdp
, 
bo
->
pgno
, &
dbt
, 
hd
, 
back
,

2181 
ags
 | 
SA_SKIPFIRSTKEY
)!0 && 
t
 == 0)

2182 
t
 = 
t_t
;

2185 
B_KEYDATA
:

2186 
d
 = (
db_dx_t
)
	`DB_ALIGN
(

2187 
beg
 + 
bk
->
n
, (
u_t32_t
)) - 1;

2188 
dbt
.
da
 = 
bk
->data;

2189 
dbt
.
size
 = 
bk
->
n
;

2190 i((
t_t
 = 
	`__db_vrfy_dbt
(&
dbt
,

2191 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2192 i(
t
 == 0)

2193 
t
 = 
t_t
;

2194 
r
;

2197 
B_OVERFLOW
:

2198 
d
 = 
beg
 + 
BOVERFLOW_SIZE
 - 1;

2199 
bo
 = (
BOVERFLOW
 *)
bk
;

2202 i((
t_t
 = 
	`__db__goff
(
dbp
, 
vdp
,

2203 
bo
->
pgno
, &
dbt
, &
ovbuf
, 
ags
)!0 && 
t
 == 0)

2204 
t
 = 
t_t
;

2205 i((
t_t
 = 
	`__db_vrfy_dbt
(

2206 
t_t
 =0 ? &
dbt
 : &
unknown_key
,

2207 0, " ", 
hd
, 
back
, 0, 
vdp
)!0 && 
t
 == 0)

2208 
t
 = 
t_t
;

2215 
t_t
 = 
	`__db_unknown_th
(
dbv
, "__bam_salvage");

2216 i(
t
 == 0)

2217 
t
 = 
t_t
;

2218 
r
;

2227 i(
	`LF_ISSET
(
DB_AGGRESSIVE
)) {

2228 
pgm
[
beg
] = 
VRFY_ITEM_BEGIN
;

2229 
pgm
[
d
] = 
VRFY_ITEM_END
;

2233 
r
: i(
pgm
 !
NULL
)

2234 
	`__os_
(
dbv
, 
pgm
);

2235 i(
ovbuf
 !
NULL
)

2236 
	`__os_
(
dbv
, 
ovbuf
);

2239 i((
t_t
 = 
	`__db_lvage_mkde
(
vdp
, 
pgno
)!0 && 
t
 == 0)

2240 
t
 = 
t_t
;

2242  (
t
);

2243 
	}
}

2254 
	$__bam_lvage_wkdupt
(
dbp
, 
vdp
, 
h
, 
key
, 
hd
, 
back
, 
ags
)

2255 
DB
 *
dbp
;

2256 
VRFY_DBINFO
 *
vdp
;

2257 
PAGE
 *
h
;

2258 
DBT
 *
key
;

2259 *
hd
;

2260 (*
back

	`__P
((*, const *));

2261 
u_t32_t
 
ags
;

2263 
DB_ENV
 *
dbv
;

2264 
RINTERNAL
 *
ri
;

2265 
BINTERNAL
 *
bi
;

2266 
t
, 
t_t
;

2267 
db_dx_t
 
i
;

2269 
dbv
 = 
dbp
->dbenv;

2270 
t
 = 0;

2272 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

2273 
	`TYPE
(
h
)) {

2274 
P_IBTREE
:

2275 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
);

2276 i((
t_t
 = 
	`__db_lvage_due
(
dbp
,

2277 
vdp
, 
bi
->
pgno
, 
key
, 
hd
, 
back
, 
ags
)) != 0)

2278 
t
 = 
t_t
;

2280 
P_IRECNO
:

2281 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
i
);

2282 i((
t_t
 = 
	`__db_lvage_due
(
dbp
,

2283 
vdp
, 
ri
->
pgno
, 
key
, 
hd
, 
back
, 
ags
)) != 0)

2284 
t
 = 
t_t
;

2287  (
	`__db_unknown_th
(

2288 
dbv
, "__bam_salvage_walkdupint"));

2291 
ags
 &~
	`LF_ISSET
(
SA_SKIPFIRSTKEY
);

2294  (
t
);

2295 
	}
}

2315 
	$__bam_ma2pgt
(
dbp
, 
vdp
, 
btma
, 
ags
, 
pgt
)

2316 
DB
 *
dbp
;

2317 
VRFY_DBINFO
 *
vdp
;

2318 
BTMETA
 *
btma
;

2319 
u_t32_t
 
ags
;

2320 
DB
 *
pgt
;

2322 
BINTERNAL
 *
bi
;

2323 
DB_MPOOLFILE
 *
mpf
;

2324 
PAGE
 *
h
;

2325 
RINTERNAL
 *
ri
;

2326 
db_pgno_t
 
cut
, 
p
;

2327 
r_t
, 
t
;

2329 
	`DB_ASSERT
(
dbp
->
dbv
, 
pgt
 !
NULL
);

2331 
mpf
 = 
dbp
->mpf;

2332 
h
 = 
NULL
;

2333 
t
 = 
r_t
 = 0;

2335 
cut
 = 
btma
->
ro
;;) {

2336 i(!
	`IS_VALID_PGNO
(
cut
|| cu=
	`PGNO
(
btma
)) {

2337 
r_t
 = 
DB_VERIFY_BAD
;

2338 
r
;

2340 i((
t
 = 
	`__memp_fg
(
mpf
, &
cut
, 
NULL
, 0, &
h
)) != 0) {

2341 
r_t
 = 
t
;

2342 
r
;

2345 
	`TYPE
(
h
)) {

2346 
P_IBTREE
:

2347 
P_IRECNO
:

2348 i((
t
 = 
	`__bam_vrfy
(
dbp
,

2349 
vdp
, 
h
, 
cut
, 
ags
 | 
DB_NOORDERCHK
)) != 0) {

2350 
r_t
 = 
t
;

2351 
r
;

2353 i(
	`TYPE
(
h
=
P_IBTREE
) {

2354 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 0);

2355 
cut
 = 
bi
->
pgno
;

2357 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 0);

2358 
cut
 = 
ri
->
pgno
;

2361 
P_LBTREE
:

2362 
P_LRECNO
:

2363 
av
;

2365 
r_t
 = 
DB_VERIFY_BAD
;

2366 
r
;

2369 i((
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
DB_PRIORITY_UNCHANGED
)) != 0)

2370 
r_t
 = 
t
;

2371 
h
 = 
NULL
;

2378 
av
:

2379 
	`IS_VALID_PGNO
(
cut
&& cu!
PGNO_INVALID
) {

2380 i(
h
 =
NULL
 &&

2381 (
t
 = 
	`__memp_fg
(
mpf
, &
cut
, 
NULL
, 0, &
h
)) != 0) {

2382 
r_t
 = 
t
;

2386 i((
t
 = 
	`__db_vrfy_pgt_g
(
pgt
, 
cut
, (*)&
p
)) != 0)

2387 
r
;

2389 i(
p
 != 0) {

2397 i((
t
 = 
	`__db_vrfy_pgt_c
(
pgt
, 
cut
)) != 0)

2398 
r
;

2400 
cut
 = 
	`NEXT_PGNO
(
h
);

2401 i((
t
 = 
	`__memp_ut
(
mpf
, 
h
, 
DB_PRIORITY_UNCHANGED
)) != 0)

2402 
r_t
 = 
t
;

2403 
h
 = 
NULL
;

2406 
r
: i(
h
 !
NULL
)

2407 ()
	`__memp_ut
(
mpf
, 
h
, 
DB_PRIORITY_UNCHANGED
);

2409  (
t
 =0 ? 
r_t
 :et);

2410 
	}
}

2421 
	$__bam__gda
(
dbp
, 
h
, 
i
, 
ovok
, 
dbt
, 
db
)

2422 
DB
 *
dbp
;

2423 
PAGE
 *
h
;

2424 
u_t32_t
 
i
;

2425 
ovok
;

2426 
DBT
 *
dbt
;

2427 *
db
;

2429 
BKEYDATA
 *
bk
;

2430 
BOVERFLOW
 *
bo
;

2432 
	`memt
(
dbt
, 0, (
DBT
));

2433 *
db
 = 0;

2435 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

2436 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
) {

2437 i(!
ovok
)

2440 
bo
 = (
BOVERFLOW
 *)
bk
;

2441 
	`F_SET
(
dbt
, 
DB_DBT_MALLOC
);

2443 *
db
 = 1;

2444  (
	`__db_goff
(
dbp
, 
NULL
, 
dbt
,

2445 
bo
->

, bo->
pgno
, 
NULL
, NULL));

2447 
dbt
->
da
 = 
bk
->data;

2448 
dbt
->
size
 = 
bk
->
n
;

2452 
	}
}

	@../btree/btree_auto.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_dich.h
"

9 
	~"dbc/db_am.h
"

10 
	~"dbc/b.h
"

11 
	~"dbc/log.h
"

12 
	~"dbc/txn.h
"

20 
	$__bam_l_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 

, 
΢
, 
right
, 

, 
dx
,

21 
gno
, 
Ƣ
, 
ro_pgno
, 
pg
, 
ags
)

22 
DB
 *
dbp
;

23 
DB_TXN
 *
tx
;

24 
DB_LSN
 *
t_lp
;

25 
u_t32_t
 
ags
;

26 
db_pgno_t
 

;

27 
DB_LSN
 * 
΢
;

28 
db_pgno_t
 
right
;

29 
DB_LSN
 * 

;

30 
u_t32_t
 
dx
;

31 
db_pgno_t
 
gno
;

32 
DB_LSN
 * 
Ƣ
;

33 
db_pgno_t
 
ro_pgno
;

34 cڡ 
DBT
 *
pg
;

35 
u_t32_t
 
ags
;

37 
DBT
 
logc
;

38 
DB_ENV
 *
dbv
;

39 
DB_TXNLOGREC
 *

;

40 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

41 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

42 
u_t
 
ad
;

43 
u_t8_t
 *
bp
;

44 
is_dub
, 
t
;

46 
dbv
 = 
dbp
->dbenv;

47 
	`COMPQUIET
(

, 
NULL
);

49 
y
 = 
DB___bam_l
;

50 
ad
 = 0;

51 
p
 = 
t_lp
;

53 
t
 = 0;

55 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

56 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

57 i(
tx
 =
NULL
)

59 
is_dub
 = 0;

61 
is_dub
 = 1;

63 i(
tx
 =
NULL
) {

64 
txn_num
 = 0;

65 
lp
 = &
nu_l
;

66 
nu_l
.
fe
 =u_l.
offt
 = 0;

68 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

69 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

70  (
t
);

77 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

78 
txn_num
 = 
tx
->
txnid
;

81 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

82 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

83 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

84  (
t
);

86 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

87 + (
u_t32_t
)

88 + (
u_t32_t
)

89 + (*
΢
)

90 + (
u_t32_t
)

91 + (*

)

92 + (
u_t32_t
)

93 + (
u_t32_t
)

94 + (*
Ƣ
)

95 + (
u_t32_t
)

96 + (
u_t32_t
+ (
pg
 =
NULL
 ? 0 :g->
size
)

97 + (
u_t32_t
);

98 i(
	`CRYPTO_ON
(
dbv
)) {

99 
ad
 =

100 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

101 
logc
.
size
 +
ad
;

104 i(
is_dub
 || 
tx
 =
NULL
) {

105 i((
t
 =

106 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

107  (
t
);

109 i((
t
 = 
	`__os_mloc
(
dbv
,

110 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

111  (
t
);

112 #ifde
DIAGNOSTIC


113 i((
t
 =

114 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

115 
	`__os_
(
dbv
, 

);

116  (
t
);

119 
logc
.
da
 = 

->data;

122 i(
ad
 > 0)

123 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

125 
bp
 = 
logc
.
da
;

127 
	`memy
(
bp
, &
y
, (rectype));

128 
bp
 +(
y
);

130 
	`memy
(
bp
, &
txn_num
, (txn_num));

131 
bp
 +(
txn_num
);

133 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

134 
bp
 +(
DB_LSN
);

136 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

137 
	`memy
(
bp
, &
ump
, (uinttmp));

138 
bp
 +(
ump
);

140 
ump
 = (
u_t32_t
)

;

141 
	`memy
(
bp
, &
ump
, (uinttmp));

142 
bp
 +(
ump
);

144 i(
΢
 !
NULL
) {

145 i(
tx
 !
NULL
) {

146 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

147 i(
	`LOG_COMPARE
(
΢
, &

->
l
>0 && (
t
 =

148 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
΢
) != 0))

149  (
t
);

151 
	`memy
(
bp
, 
΢
, (*llsn));

153 
	`memt
(
bp
, 0, (*
΢
));

154 
bp
 +(*
΢
);

156 
ump
 = (
u_t32_t
)
right
;

157 
	`memy
(
bp
, &
ump
, (uinttmp));

158 
bp
 +(
ump
);

160 i(

 !
NULL
) {

161 i(
tx
 !
NULL
) {

162 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

163 i(
	`LOG_COMPARE
(

, &

->
l
>0 && (
t
 =

164 
	`__log_check_ge_l
(
dbv
, 
dbp
, 

) != 0))

165  (
t
);

167 
	`memy
(
bp
, 

, (*rlsn));

169 
	`memt
(
bp
, 0, (*

));

170 
bp
 +(*

);

172 
ump
 = (
u_t32_t
)
dx
;

173 
	`memy
(
bp
, &
ump
, (uinttmp));

174 
bp
 +(
ump
);

176 
ump
 = (
u_t32_t
)
gno
;

177 
	`memy
(
bp
, &
ump
, (uinttmp));

178 
bp
 +(
ump
);

180 i(
Ƣ
 !
NULL
) {

181 i(
tx
 !
NULL
) {

182 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

183 i(
	`LOG_COMPARE
(
Ƣ
, &

->
l
>0 && (
t
 =

184 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
Ƣ
) != 0))

185  (
t
);

187 
	`memy
(
bp
, 
Ƣ
, (*nlsn));

189 
	`memt
(
bp
, 0, (*
Ƣ
));

190 
bp
 +(*
Ƣ
);

192 
ump
 = (
u_t32_t
)
ro_pgno
;

193 
	`memy
(
bp
, &
ump
, (uinttmp));

194 
bp
 +(
ump
);

196 i(
pg
 =
NULL
) {

197 
zo
 = 0;

198 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

199 
bp
 +(
u_t32_t
);

201 
	`memy
(
bp
, &
pg
->
size
, (pg->size));

202 
bp
 +(
pg
->
size
);

203 
	`memy
(
bp
, 
pg
->
da
,g->
size
);

204 
bp
 +
pg
->
size
;

207 
ump
 = (
u_t32_t
)
ags
;

208 
	`memy
(
bp
, &
ump
, (uinttmp));

209 
bp
 +(
ump
);

211 
	`DB_ASSERT
(
dbv
,

212 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

214 i(
is_dub
 || 
tx
 =
NULL
) {

215 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

216 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

217 *
lp
 = *
p
;

218 i(
p
 !
t_lp
)

219 *
t_lp
 = *
p
;

222 
t
 = 0;

223 #ifde
DIAGNOSTIC


228 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

229 
y
 |
DB_debug_FLAG
;

230 
	`memy
(
logc
.
da
, &
y
, (rectype));

232 i(!
	`IS_REP_CLIENT
(
dbv
))

233 
t
 = 
	`__log_put
(
dbv
,

234 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

236 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

237 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

238 
	`LSN_NOT_LOGGED
(*
t_lp
);

241 #ifde
LOG_DIAGNOSTIC


242 i(
t
 != 0)

243 ()
	`__bam_l_t
(
dbv
,

244 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

247 #ifde
DIAGNOSTIC


248 
	`__os_
(
dbv
, 
logc
.
da
);

250 i(
is_dub
 || 
tx
 =
NULL
)

251 
	`__os_
(
dbv
, 
logc
.
da
);

253  (
t
);

254 
	}
}

260 
	$__bam_l_ad
(
dbv
, 
cbuf
, 
g
)

261 
DB_ENV
 *
dbv
;

262 *
cbuf
;

263 
__bam_l_gs
 **
g
;

265 
__bam_l_gs
 *
gp
;

266 
u_t32_t
 
ump
;

267 
u_t8_t
 *
bp
;

268 
t
;

270 i((
t
 = 
	`__os_mloc
(
dbv
,

271 (
__bam_l_gs
+ (
DB_TXN
), &
gp
)) != 0)

272  (
t
);

273 
bp
 = 
cbuf
;

274 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

275 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

277 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

278 
bp
 +(
gp
->
ty
);

280 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

281 
bp
 +(
gp
->
tx
->
txnid
);

283 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

284 
bp
 +(
DB_LSN
);

286 
	`memy
(&
ump
, 
bp
, (uinttmp));

287 
gp
->
feid
 = (
t32_t
)
ump
;

288 
bp
 +(
ump
);

290 
	`memy
(&
ump
, 
bp
, (uinttmp));

291 
gp
->

 = (
db_pgno_t
)
ump
;

292 
bp
 +(
ump
);

294 
	`memy
(&
gp
->
΢
, 
bp
, (argp->llsn));

295 
bp
 +(
gp
->
΢
);

297 
	`memy
(&
ump
, 
bp
, (uinttmp));

298 
gp
->
right
 = (
db_pgno_t
)
ump
;

299 
bp
 +(
ump
);

301 
	`memy
(&
gp
->

, 
bp
, (argp->rlsn));

302 
bp
 +(
gp
->

);

304 
	`memy
(&
ump
, 
bp
, (uinttmp));

305 
gp
->
dx
 = (
u_t32_t
)
ump
;

306 
bp
 +(
ump
);

308 
	`memy
(&
ump
, 
bp
, (uinttmp));

309 
gp
->
gno
 = (
db_pgno_t
)
ump
;

310 
bp
 +(
ump
);

312 
	`memy
(&
gp
->
Ƣ
, 
bp
, (argp->nlsn));

313 
bp
 +(
gp
->
Ƣ
);

315 
	`memy
(&
ump
, 
bp
, (uinttmp));

316 
gp
->
ro_pgno
 = (
db_pgno_t
)
ump
;

317 
bp
 +(
ump
);

319 
	`memt
(&
gp
->
pg
, 0, (argp->pg));

320 
	`memy
(&
gp
->
pg
.
size
, 
bp
, (
u_t32_t
));

321 
bp
 +(
u_t32_t
);

322 
gp
->
pg
.
da
 = 
bp
;

323 
bp
 +
gp
->
pg
.
size
;

325 
	`memy
(&
ump
, 
bp
, (uinttmp));

326 
gp
->
ags
 = (
u_t32_t
)
ump
;

327 
bp
 +(
ump
);

329 *
g
 = 
gp
;

331 
	}
}

339 
	$__bam_rl_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
pgdbt
, 
ro_pgno
, 
ec
, 
roْt
,

340 
rol
)

341 
DB
 *
dbp
;

342 
DB_TXN
 *
tx
;

343 
DB_LSN
 *
t_lp
;

344 
u_t32_t
 
ags
;

345 
db_pgno_t
 
pgno
;

346 cڡ 
DBT
 *
pgdbt
;

347 
db_pgno_t
 
ro_pgno
;

348 
db_pgno_t
 
ec
;

349 cڡ 
DBT
 *
roْt
;

350 
DB_LSN
 * 
rol
;

352 
DBT
 
logc
;

353 
DB_ENV
 *
dbv
;

354 
DB_TXNLOGREC
 *

;

355 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

356 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

357 
u_t
 
ad
;

358 
u_t8_t
 *
bp
;

359 
is_dub
, 
t
;

361 
dbv
 = 
dbp
->dbenv;

362 
	`COMPQUIET
(

, 
NULL
);

364 
y
 = 
DB___bam_rl
;

365 
ad
 = 0;

366 
p
 = 
t_lp
;

368 
t
 = 0;

370 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

371 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

372 i(
tx
 =
NULL
)

374 
is_dub
 = 0;

376 
is_dub
 = 1;

378 i(
tx
 =
NULL
) {

379 
txn_num
 = 0;

380 
lp
 = &
nu_l
;

381 
nu_l
.
fe
 =u_l.
offt
 = 0;

383 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

384 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

385  (
t
);

392 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

393 
txn_num
 = 
tx
->
txnid
;

396 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

397 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

398 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

399  (
t
);

401 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

402 + (
u_t32_t
)

403 + (
u_t32_t
)

404 + (
u_t32_t
+ (
pgdbt
 =
NULL
 ? 0 :gdbt->
size
)

405 + (
u_t32_t
)

406 + (
u_t32_t
)

407 + (
u_t32_t
+ (
roْt
 =
NULL
 ? 0 :oْt->
size
)

408 + (*
rol
);

409 i(
	`CRYPTO_ON
(
dbv
)) {

410 
ad
 =

411 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

412 
logc
.
size
 +
ad
;

415 i(
is_dub
 || 
tx
 =
NULL
) {

416 i((
t
 =

417 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

418  (
t
);

420 i((
t
 = 
	`__os_mloc
(
dbv
,

421 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

422  (
t
);

423 #ifde
DIAGNOSTIC


424 i((
t
 =

425 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

426 
	`__os_
(
dbv
, 

);

427  (
t
);

430 
logc
.
da
 = 

->data;

433 i(
ad
 > 0)

434 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

436 
bp
 = 
logc
.
da
;

438 
	`memy
(
bp
, &
y
, (rectype));

439 
bp
 +(
y
);

441 
	`memy
(
bp
, &
txn_num
, (txn_num));

442 
bp
 +(
txn_num
);

444 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

445 
bp
 +(
DB_LSN
);

447 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

448 
	`memy
(
bp
, &
ump
, (uinttmp));

449 
bp
 +(
ump
);

451 
ump
 = (
u_t32_t
)
pgno
;

452 
	`memy
(
bp
, &
ump
, (uinttmp));

453 
bp
 +(
ump
);

455 i(
pgdbt
 =
NULL
) {

456 
zo
 = 0;

457 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

458 
bp
 +(
u_t32_t
);

460 
	`memy
(
bp
, &
pgdbt
->
size
, (pgdbt->size));

461 
bp
 +(
pgdbt
->
size
);

462 
	`memy
(
bp
, 
pgdbt
->
da
,gdbt->
size
);

463 
bp
 +
pgdbt
->
size
;

466 
ump
 = (
u_t32_t
)
ro_pgno
;

467 
	`memy
(
bp
, &
ump
, (uinttmp));

468 
bp
 +(
ump
);

470 
ump
 = (
u_t32_t
)
ec
;

471 
	`memy
(
bp
, &
ump
, (uinttmp));

472 
bp
 +(
ump
);

474 i(
roْt
 =
NULL
) {

475 
zo
 = 0;

476 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

477 
bp
 +(
u_t32_t
);

479 
	`memy
(
bp
, &
roْt
->
size
, (rootent->size));

480 
bp
 +(
roْt
->
size
);

481 
	`memy
(
bp
, 
roْt
->
da
,oْt->
size
);

482 
bp
 +
roْt
->
size
;

485 i(
rol
 !
NULL
) {

486 i(
tx
 !
NULL
) {

487 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

488 i(
	`LOG_COMPARE
(
rol
, &

->
l
>0 && (
t
 =

489 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
rol
) != 0))

490  (
t
);

492 
	`memy
(
bp
, 
rol
, (*rootlsn));

494 
	`memt
(
bp
, 0, (*
rol
));

495 
bp
 +(*
rol
);

497 
	`DB_ASSERT
(
dbv
,

498 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

500 i(
is_dub
 || 
tx
 =
NULL
) {

501 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

502 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

503 *
lp
 = *
p
;

504 i(
p
 !
t_lp
)

505 *
t_lp
 = *
p
;

508 
t
 = 0;

509 #ifde
DIAGNOSTIC


514 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

515 
y
 |
DB_debug_FLAG
;

516 
	`memy
(
logc
.
da
, &
y
, (rectype));

518 i(!
	`IS_REP_CLIENT
(
dbv
))

519 
t
 = 
	`__log_put
(
dbv
,

520 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

522 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

523 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

524 
	`LSN_NOT_LOGGED
(*
t_lp
);

527 #ifde
LOG_DIAGNOSTIC


528 i(
t
 != 0)

529 ()
	`__bam_rl_t
(
dbv
,

530 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

533 #ifde
DIAGNOSTIC


534 
	`__os_
(
dbv
, 
logc
.
da
);

536 i(
is_dub
 || 
tx
 =
NULL
)

537 
	`__os_
(
dbv
, 
logc
.
da
);

539  (
t
);

540 
	}
}

546 
	$__bam_rl_ad
(
dbv
, 
cbuf
, 
g
)

547 
DB_ENV
 *
dbv
;

548 *
cbuf
;

549 
__bam_rl_gs
 **
g
;

551 
__bam_rl_gs
 *
gp
;

552 
u_t32_t
 
ump
;

553 
u_t8_t
 *
bp
;

554 
t
;

556 i((
t
 = 
	`__os_mloc
(
dbv
,

557 (
__bam_rl_gs
+ (
DB_TXN
), &
gp
)) != 0)

558  (
t
);

559 
bp
 = 
cbuf
;

560 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

561 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

563 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

564 
bp
 +(
gp
->
ty
);

566 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

567 
bp
 +(
gp
->
tx
->
txnid
);

569 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

570 
bp
 +(
DB_LSN
);

572 
	`memy
(&
ump
, 
bp
, (uinttmp));

573 
gp
->
feid
 = (
t32_t
)
ump
;

574 
bp
 +(
ump
);

576 
	`memy
(&
ump
, 
bp
, (uinttmp));

577 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

578 
bp
 +(
ump
);

580 
	`memt
(&
gp
->
pgdbt
, 0, (argp->pgdbt));

581 
	`memy
(&
gp
->
pgdbt
.
size
, 
bp
, (
u_t32_t
));

582 
bp
 +(
u_t32_t
);

583 
gp
->
pgdbt
.
da
 = 
bp
;

584 
bp
 +
gp
->
pgdbt
.
size
;

586 
	`memy
(&
ump
, 
bp
, (uinttmp));

587 
gp
->
ro_pgno
 = (
db_pgno_t
)
ump
;

588 
bp
 +(
ump
);

590 
	`memy
(&
ump
, 
bp
, (uinttmp));

591 
gp
->
ec
 = (
db_pgno_t
)
ump
;

592 
bp
 +(
ump
);

594 
	`memt
(&
gp
->
roْt
, 0, (argp->rootent));

595 
	`memy
(&
gp
->
roْt
.
size
, 
bp
, (
u_t32_t
));

596 
bp
 +(
u_t32_t
);

597 
gp
->
roْt
.
da
 = 
bp
;

598 
bp
 +
gp
->
roْt
.
size
;

600 
	`memy
(&
gp
->
rol
, 
bp
, (argp->rootlsn));

601 
bp
 +(
gp
->
rol
);

603 *
g
 = 
gp
;

605 
	}
}

613 
	$__bam_adj_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
dx_cy
, 
is_
)

614 
DB
 *
dbp
;

615 
DB_TXN
 *
tx
;

616 
DB_LSN
 *
t_lp
;

617 
u_t32_t
 
ags
;

618 
db_pgno_t
 
pgno
;

619 
DB_LSN
 * 
l
;

620 
u_t32_t
 
dx
;

621 
u_t32_t
 
dx_cy
;

622 
u_t32_t
 
is_
;

624 
DBT
 
logc
;

625 
DB_ENV
 *
dbv
;

626 
DB_TXNLOGREC
 *

;

627 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

628 
u_t32_t
 
ump
, 
y
, 
txn_num
;

629 
u_t
 
ad
;

630 
u_t8_t
 *
bp
;

631 
is_dub
, 
t
;

633 
dbv
 = 
dbp
->dbenv;

634 
	`COMPQUIET
(

, 
NULL
);

636 
y
 = 
DB___bam_adj
;

637 
ad
 = 0;

638 
p
 = 
t_lp
;

640 
t
 = 0;

642 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

643 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

644 i(
tx
 =
NULL
)

646 
is_dub
 = 0;

648 
is_dub
 = 1;

650 i(
tx
 =
NULL
) {

651 
txn_num
 = 0;

652 
lp
 = &
nu_l
;

653 
nu_l
.
fe
 =u_l.
offt
 = 0;

655 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

656 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

657  (
t
);

664 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

665 
txn_num
 = 
tx
->
txnid
;

668 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

669 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

670 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

671  (
t
);

673 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

674 + (
u_t32_t
)

675 + (
u_t32_t
)

676 + (*
l
)

677 + (
u_t32_t
)

678 + (
u_t32_t
)

679 + (
u_t32_t
);

680 i(
	`CRYPTO_ON
(
dbv
)) {

681 
ad
 =

682 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

683 
logc
.
size
 +
ad
;

686 i(
is_dub
 || 
tx
 =
NULL
) {

687 i((
t
 =

688 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

689  (
t
);

691 i((
t
 = 
	`__os_mloc
(
dbv
,

692 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

693  (
t
);

694 #ifde
DIAGNOSTIC


695 i((
t
 =

696 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

697 
	`__os_
(
dbv
, 

);

698  (
t
);

701 
logc
.
da
 = 

->data;

704 i(
ad
 > 0)

705 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

707 
bp
 = 
logc
.
da
;

709 
	`memy
(
bp
, &
y
, (rectype));

710 
bp
 +(
y
);

712 
	`memy
(
bp
, &
txn_num
, (txn_num));

713 
bp
 +(
txn_num
);

715 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

716 
bp
 +(
DB_LSN
);

718 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

719 
	`memy
(
bp
, &
ump
, (uinttmp));

720 
bp
 +(
ump
);

722 
ump
 = (
u_t32_t
)
pgno
;

723 
	`memy
(
bp
, &
ump
, (uinttmp));

724 
bp
 +(
ump
);

726 i(
l
 !
NULL
) {

727 i(
tx
 !
NULL
) {

728 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

729 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

730 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

731  (
t
);

733 
	`memy
(
bp
, 
l
, (*lsn));

735 
	`memt
(
bp
, 0, (*
l
));

736 
bp
 +(*
l
);

738 
ump
 = (
u_t32_t
)
dx
;

739 
	`memy
(
bp
, &
ump
, (uinttmp));

740 
bp
 +(
ump
);

742 
ump
 = (
u_t32_t
)
dx_cy
;

743 
	`memy
(
bp
, &
ump
, (uinttmp));

744 
bp
 +(
ump
);

746 
ump
 = (
u_t32_t
)
is_
;

747 
	`memy
(
bp
, &
ump
, (uinttmp));

748 
bp
 +(
ump
);

750 
	`DB_ASSERT
(
dbv
,

751 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

753 i(
is_dub
 || 
tx
 =
NULL
) {

754 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

755 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

756 *
lp
 = *
p
;

757 i(
p
 !
t_lp
)

758 *
t_lp
 = *
p
;

761 
t
 = 0;

762 #ifde
DIAGNOSTIC


767 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

768 
y
 |
DB_debug_FLAG
;

769 
	`memy
(
logc
.
da
, &
y
, (rectype));

771 i(!
	`IS_REP_CLIENT
(
dbv
))

772 
t
 = 
	`__log_put
(
dbv
,

773 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

775 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

776 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

777 
	`LSN_NOT_LOGGED
(*
t_lp
);

780 #ifde
LOG_DIAGNOSTIC


781 i(
t
 != 0)

782 ()
	`__bam_adj_t
(
dbv
,

783 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

786 #ifde
DIAGNOSTIC


787 
	`__os_
(
dbv
, 
logc
.
da
);

789 i(
is_dub
 || 
tx
 =
NULL
)

790 
	`__os_
(
dbv
, 
logc
.
da
);

792  (
t
);

793 
	}
}

799 
	$__bam_adj_ad
(
dbv
, 
cbuf
, 
g
)

800 
DB_ENV
 *
dbv
;

801 *
cbuf
;

802 
__bam_adj_gs
 **
g
;

804 
__bam_adj_gs
 *
gp
;

805 
u_t32_t
 
ump
;

806 
u_t8_t
 *
bp
;

807 
t
;

809 i((
t
 = 
	`__os_mloc
(
dbv
,

810 (
__bam_adj_gs
+ (
DB_TXN
), &
gp
)) != 0)

811  (
t
);

812 
bp
 = 
cbuf
;

813 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

814 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

816 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

817 
bp
 +(
gp
->
ty
);

819 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

820 
bp
 +(
gp
->
tx
->
txnid
);

822 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

823 
bp
 +(
DB_LSN
);

825 
	`memy
(&
ump
, 
bp
, (uinttmp));

826 
gp
->
feid
 = (
t32_t
)
ump
;

827 
bp
 +(
ump
);

829 
	`memy
(&
ump
, 
bp
, (uinttmp));

830 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

831 
bp
 +(
ump
);

833 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

834 
bp
 +(
gp
->
l
);

836 
	`memy
(&
ump
, 
bp
, (uinttmp));

837 
gp
->
dx
 = (
u_t32_t
)
ump
;

838 
bp
 +(
ump
);

840 
	`memy
(&
ump
, 
bp
, (uinttmp));

841 
gp
->
dx_cy
 = (
u_t32_t
)
ump
;

842 
bp
 +(
ump
);

844 
	`memy
(&
ump
, 
bp
, (uinttmp));

845 
gp
->
is_
 = (
u_t32_t
)
ump
;

846 
bp
 +(
ump
);

848 *
g
 = 
gp
;

850 
	}
}

857 
	$__bam_dju_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
adju
, 
ags
)

858 
DB
 *
dbp
;

859 
DB_TXN
 *
tx
;

860 
DB_LSN
 *
t_lp
;

861 
u_t32_t
 
ags
;

862 
db_pgno_t
 
pgno
;

863 
DB_LSN
 * 
l
;

864 
u_t32_t
 
dx
;

865 
t32_t
 
adju
;

866 
u_t32_t
 
ags
;

868 
DBT
 
logc
;

869 
DB_ENV
 *
dbv
;

870 
DB_TXNLOGREC
 *

;

871 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

872 
u_t32_t
 
ump
, 
y
, 
txn_num
;

873 
u_t
 
ad
;

874 
u_t8_t
 *
bp
;

875 
is_dub
, 
t
;

877 
dbv
 = 
dbp
->dbenv;

878 
	`COMPQUIET
(

, 
NULL
);

880 
y
 = 
DB___bam_dju
;

881 
ad
 = 0;

882 
p
 = 
t_lp
;

884 
t
 = 0;

886 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

887 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

888 i(
tx
 =
NULL
)

890 
is_dub
 = 0;

892 
is_dub
 = 1;

894 i(
tx
 =
NULL
) {

895 
txn_num
 = 0;

896 
lp
 = &
nu_l
;

897 
nu_l
.
fe
 =u_l.
offt
 = 0;

899 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

900 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

901  (
t
);

908 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

909 
txn_num
 = 
tx
->
txnid
;

912 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

913 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

914 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

915  (
t
);

917 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

918 + (
u_t32_t
)

919 + (
u_t32_t
)

920 + (*
l
)

921 + (
u_t32_t
)

922 + (
u_t32_t
)

923 + (
u_t32_t
);

924 i(
	`CRYPTO_ON
(
dbv
)) {

925 
ad
 =

926 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

927 
logc
.
size
 +
ad
;

930 i(
is_dub
 || 
tx
 =
NULL
) {

931 i((
t
 =

932 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

933  (
t
);

935 i((
t
 = 
	`__os_mloc
(
dbv
,

936 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

937  (
t
);

938 #ifde
DIAGNOSTIC


939 i((
t
 =

940 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

941 
	`__os_
(
dbv
, 

);

942  (
t
);

945 
logc
.
da
 = 

->data;

948 i(
ad
 > 0)

949 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

951 
bp
 = 
logc
.
da
;

953 
	`memy
(
bp
, &
y
, (rectype));

954 
bp
 +(
y
);

956 
	`memy
(
bp
, &
txn_num
, (txn_num));

957 
bp
 +(
txn_num
);

959 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

960 
bp
 +(
DB_LSN
);

962 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

963 
	`memy
(
bp
, &
ump
, (uinttmp));

964 
bp
 +(
ump
);

966 
ump
 = (
u_t32_t
)
pgno
;

967 
	`memy
(
bp
, &
ump
, (uinttmp));

968 
bp
 +(
ump
);

970 i(
l
 !
NULL
) {

971 i(
tx
 !
NULL
) {

972 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

973 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

974 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

975  (
t
);

977 
	`memy
(
bp
, 
l
, (*lsn));

979 
	`memt
(
bp
, 0, (*
l
));

980 
bp
 +(*
l
);

982 
ump
 = (
u_t32_t
)
dx
;

983 
	`memy
(
bp
, &
ump
, (uinttmp));

984 
bp
 +(
ump
);

986 
ump
 = (
u_t32_t
)
adju
;

987 
	`memy
(
bp
, &
ump
, (uinttmp));

988 
bp
 +(
ump
);

990 
ump
 = (
u_t32_t
)
ags
;

991 
	`memy
(
bp
, &
ump
, (uinttmp));

992 
bp
 +(
ump
);

994 
	`DB_ASSERT
(
dbv
,

995 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

997 i(
is_dub
 || 
tx
 =
NULL
) {

998 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

999 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1000 *
lp
 = *
p
;

1001 i(
p
 !
t_lp
)

1002 *
t_lp
 = *
p
;

1005 
t
 = 0;

1006 #ifde
DIAGNOSTIC


1011 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1012 
y
 |
DB_debug_FLAG
;

1013 
	`memy
(
logc
.
da
, &
y
, (rectype));

1015 i(!
	`IS_REP_CLIENT
(
dbv
))

1016 
t
 = 
	`__log_put
(
dbv
,

1017 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1019 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1020 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1021 
	`LSN_NOT_LOGGED
(*
t_lp
);

1024 #ifde
LOG_DIAGNOSTIC


1025 i(
t
 != 0)

1026 ()
	`__bam_dju_t
(
dbv
,

1027 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1030 #ifde
DIAGNOSTIC


1031 
	`__os_
(
dbv
, 
logc
.
da
);

1033 i(
is_dub
 || 
tx
 =
NULL
)

1034 
	`__os_
(
dbv
, 
logc
.
da
);

1036  (
t
);

1037 
	}
}

1044 
	$__bam_dju_ad
(
dbv
, 
cbuf
, 
g
)

1045 
DB_ENV
 *
dbv
;

1046 *
cbuf
;

1047 
__bam_dju_gs
 **
g
;

1049 
__bam_dju_gs
 *
gp
;

1050 
u_t32_t
 
ump
;

1051 
u_t8_t
 *
bp
;

1052 
t
;

1054 i((
t
 = 
	`__os_mloc
(
dbv
,

1055 (
__bam_dju_gs
+ (
DB_TXN
), &
gp
)) != 0)

1056  (
t
);

1057 
bp
 = 
cbuf
;

1058 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1059 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1061 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1062 
bp
 +(
gp
->
ty
);

1064 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1065 
bp
 +(
gp
->
tx
->
txnid
);

1067 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1068 
bp
 +(
DB_LSN
);

1070 
	`memy
(&
ump
, 
bp
, (uinttmp));

1071 
gp
->
feid
 = (
t32_t
)
ump
;

1072 
bp
 +(
ump
);

1074 
	`memy
(&
ump
, 
bp
, (uinttmp));

1075 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1076 
bp
 +(
ump
);

1078 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

1079 
bp
 +(
gp
->
l
);

1081 
	`memy
(&
ump
, 
bp
, (uinttmp));

1082 
gp
->
dx
 = (
u_t32_t
)
ump
;

1083 
bp
 +(
ump
);

1085 
	`memy
(&
ump
, 
bp
, (uinttmp));

1086 
gp
->
adju
 = (
t32_t
)
ump
;

1087 
bp
 +(
ump
);

1089 
	`memy
(&
ump
, 
bp
, (uinttmp));

1090 
gp
->
ags
 = (
u_t32_t
)
ump
;

1091 
bp
 +(
ump
);

1093 *
g
 = 
gp
;

1095 
	}
}

1102 
	$__bam_cd_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
)

1103 
DB
 *
dbp
;

1104 
DB_TXN
 *
tx
;

1105 
DB_LSN
 *
t_lp
;

1106 
u_t32_t
 
ags
;

1107 
db_pgno_t
 
pgno
;

1108 
DB_LSN
 * 
l
;

1109 
u_t32_t
 
dx
;

1111 
DBT
 
logc
;

1112 
DB_ENV
 *
dbv
;

1113 
DB_TXNLOGREC
 *

;

1114 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1115 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1116 
u_t
 
ad
;

1117 
u_t8_t
 *
bp
;

1118 
is_dub
, 
t
;

1120 
dbv
 = 
dbp
->dbenv;

1121 
	`COMPQUIET
(

, 
NULL
);

1123 
y
 = 
DB___bam_cd
;

1124 
ad
 = 0;

1125 
p
 = 
t_lp
;

1127 
t
 = 0;

1129 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1130 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1131 i(
tx
 =
NULL
)

1133 
is_dub
 = 0;

1135 
is_dub
 = 1;

1137 i(
tx
 =
NULL
) {

1138 
txn_num
 = 0;

1139 
lp
 = &
nu_l
;

1140 
nu_l
.
fe
 =u_l.
offt
 = 0;

1142 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1143 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1144  (
t
);

1151 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1152 
txn_num
 = 
tx
->
txnid
;

1155 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1156 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1157 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1158  (
t
);

1160 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1161 + (
u_t32_t
)

1162 + (
u_t32_t
)

1163 + (*
l
)

1164 + (
u_t32_t
);

1165 i(
	`CRYPTO_ON
(
dbv
)) {

1166 
ad
 =

1167 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1168 
logc
.
size
 +
ad
;

1171 i(
is_dub
 || 
tx
 =
NULL
) {

1172 i((
t
 =

1173 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1174  (
t
);

1176 i((
t
 = 
	`__os_mloc
(
dbv
,

1177 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1178  (
t
);

1179 #ifde
DIAGNOSTIC


1180 i((
t
 =

1181 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1182 
	`__os_
(
dbv
, 

);

1183  (
t
);

1186 
logc
.
da
 = 

->data;

1189 i(
ad
 > 0)

1190 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1192 
bp
 = 
logc
.
da
;

1194 
	`memy
(
bp
, &
y
, (rectype));

1195 
bp
 +(
y
);

1197 
	`memy
(
bp
, &
txn_num
, (txn_num));

1198 
bp
 +(
txn_num
);

1200 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1201 
bp
 +(
DB_LSN
);

1203 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1204 
	`memy
(
bp
, &
ump
, (uinttmp));

1205 
bp
 +(
ump
);

1207 
ump
 = (
u_t32_t
)
pgno
;

1208 
	`memy
(
bp
, &
ump
, (uinttmp));

1209 
bp
 +(
ump
);

1211 i(
l
 !
NULL
) {

1212 i(
tx
 !
NULL
) {

1213 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1214 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

1215 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

1216  (
t
);

1218 
	`memy
(
bp
, 
l
, (*lsn));

1220 
	`memt
(
bp
, 0, (*
l
));

1221 
bp
 +(*
l
);

1223 
ump
 = (
u_t32_t
)
dx
;

1224 
	`memy
(
bp
, &
ump
, (uinttmp));

1225 
bp
 +(
ump
);

1227 
	`DB_ASSERT
(
dbv
,

1228 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1230 i(
is_dub
 || 
tx
 =
NULL
) {

1231 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1232 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1233 *
lp
 = *
p
;

1234 i(
p
 !
t_lp
)

1235 *
t_lp
 = *
p
;

1238 
t
 = 0;

1239 #ifde
DIAGNOSTIC


1244 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1245 
y
 |
DB_debug_FLAG
;

1246 
	`memy
(
logc
.
da
, &
y
, (rectype));

1248 i(!
	`IS_REP_CLIENT
(
dbv
))

1249 
t
 = 
	`__log_put
(
dbv
,

1250 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1252 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1253 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1254 
	`LSN_NOT_LOGGED
(*
t_lp
);

1257 #ifde
LOG_DIAGNOSTIC


1258 i(
t
 != 0)

1259 ()
	`__bam_cd_t
(
dbv
,

1260 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1263 #ifde
DIAGNOSTIC


1264 
	`__os_
(
dbv
, 
logc
.
da
);

1266 i(
is_dub
 || 
tx
 =
NULL
)

1267 
	`__os_
(
dbv
, 
logc
.
da
);

1269  (
t
);

1270 
	}
}

1276 
	$__bam_cd_ad
(
dbv
, 
cbuf
, 
g
)

1277 
DB_ENV
 *
dbv
;

1278 *
cbuf
;

1279 
__bam_cd_gs
 **
g
;

1281 
__bam_cd_gs
 *
gp
;

1282 
u_t32_t
 
ump
;

1283 
u_t8_t
 *
bp
;

1284 
t
;

1286 i((
t
 = 
	`__os_mloc
(
dbv
,

1287 (
__bam_cd_gs
+ (
DB_TXN
), &
gp
)) != 0)

1288  (
t
);

1289 
bp
 = 
cbuf
;

1290 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1291 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1293 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1294 
bp
 +(
gp
->
ty
);

1296 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1297 
bp
 +(
gp
->
tx
->
txnid
);

1299 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1300 
bp
 +(
DB_LSN
);

1302 
	`memy
(&
ump
, 
bp
, (uinttmp));

1303 
gp
->
feid
 = (
t32_t
)
ump
;

1304 
bp
 +(
ump
);

1306 
	`memy
(&
ump
, 
bp
, (uinttmp));

1307 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1308 
bp
 +(
ump
);

1310 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

1311 
bp
 +(
gp
->
l
);

1313 
	`memy
(&
ump
, 
bp
, (uinttmp));

1314 
gp
->
dx
 = (
u_t32_t
)
ump
;

1315 
bp
 +(
ump
);

1317 *
g
 = 
gp
;

1319 
	}
}

1327 
	$__bam__log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
isded
, 
ig
,

1328 

, 
efix
, 
suffix
)

1329 
DB
 *
dbp
;

1330 
DB_TXN
 *
tx
;

1331 
DB_LSN
 *
t_lp
;

1332 
u_t32_t
 
ags
;

1333 
db_pgno_t
 
pgno
;

1334 
DB_LSN
 * 
l
;

1335 
u_t32_t
 
dx
;

1336 
u_t32_t
 
isded
;

1337 cڡ 
DBT
 *
ig
;

1338 cڡ 
DBT
 *

;

1339 
u_t32_t
 
efix
;

1340 
u_t32_t
 
suffix
;

1342 
DBT
 
logc
;

1343 
DB_ENV
 *
dbv
;

1344 
DB_TXNLOGREC
 *

;

1345 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1346 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

1347 
u_t
 
ad
;

1348 
u_t8_t
 *
bp
;

1349 
is_dub
, 
t
;

1351 
dbv
 = 
dbp
->dbenv;

1352 
	`COMPQUIET
(

, 
NULL
);

1354 
y
 = 
DB___bam_
;

1355 
ad
 = 0;

1356 
p
 = 
t_lp
;

1358 
t
 = 0;

1360 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1361 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1362 i(
tx
 =
NULL
)

1364 
is_dub
 = 0;

1366 
is_dub
 = 1;

1368 i(
tx
 =
NULL
) {

1369 
txn_num
 = 0;

1370 
lp
 = &
nu_l
;

1371 
nu_l
.
fe
 =u_l.
offt
 = 0;

1373 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1374 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1375  (
t
);

1382 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1383 
txn_num
 = 
tx
->
txnid
;

1386 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1387 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1388 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1389  (
t
);

1391 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1392 + (
u_t32_t
)

1393 + (
u_t32_t
)

1394 + (*
l
)

1395 + (
u_t32_t
)

1396 + (
u_t32_t
)

1397 + (
u_t32_t
+ (
ig
 =
NULL
 ? 0 : orig->
size
)

1398 + (
u_t32_t
+ (

 =
NULL
 ? 0 :l->
size
)

1399 + (
u_t32_t
)

1400 + (
u_t32_t
);

1401 i(
	`CRYPTO_ON
(
dbv
)) {

1402 
ad
 =

1403 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1404 
logc
.
size
 +
ad
;

1407 i(
is_dub
 || 
tx
 =
NULL
) {

1408 i((
t
 =

1409 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1410  (
t
);

1412 i((
t
 = 
	`__os_mloc
(
dbv
,

1413 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1414  (
t
);

1415 #ifde
DIAGNOSTIC


1416 i((
t
 =

1417 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1418 
	`__os_
(
dbv
, 

);

1419  (
t
);

1422 
logc
.
da
 = 

->data;

1425 i(
ad
 > 0)

1426 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1428 
bp
 = 
logc
.
da
;

1430 
	`memy
(
bp
, &
y
, (rectype));

1431 
bp
 +(
y
);

1433 
	`memy
(
bp
, &
txn_num
, (txn_num));

1434 
bp
 +(
txn_num
);

1436 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1437 
bp
 +(
DB_LSN
);

1439 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1440 
	`memy
(
bp
, &
ump
, (uinttmp));

1441 
bp
 +(
ump
);

1443 
ump
 = (
u_t32_t
)
pgno
;

1444 
	`memy
(
bp
, &
ump
, (uinttmp));

1445 
bp
 +(
ump
);

1447 i(
l
 !
NULL
) {

1448 i(
tx
 !
NULL
) {

1449 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1450 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

1451 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

1452  (
t
);

1454 
	`memy
(
bp
, 
l
, (*lsn));

1456 
	`memt
(
bp
, 0, (*
l
));

1457 
bp
 +(*
l
);

1459 
ump
 = (
u_t32_t
)
dx
;

1460 
	`memy
(
bp
, &
ump
, (uinttmp));

1461 
bp
 +(
ump
);

1463 
ump
 = (
u_t32_t
)
isded
;

1464 
	`memy
(
bp
, &
ump
, (uinttmp));

1465 
bp
 +(
ump
);

1467 i(
ig
 =
NULL
) {

1468 
zo
 = 0;

1469 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

1470 
bp
 +(
u_t32_t
);

1472 
	`memy
(
bp
, &
ig
->
size
, (orig->size));

1473 
bp
 +(
ig
->
size
);

1474 
	`memy
(
bp
, 
ig
->
da
, orig->
size
);

1475 
bp
 +
ig
->
size
;

1478 i(

 =
NULL
) {

1479 
zo
 = 0;

1480 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

1481 
bp
 +(
u_t32_t
);

1483 
	`memy
(
bp
, &

->
size
, (repl->size));

1484 
bp
 +(

->
size
);

1485 
	`memy
(
bp
, 

->
da
,l->
size
);

1486 
bp
 +

->
size
;

1489 
ump
 = (
u_t32_t
)
efix
;

1490 
	`memy
(
bp
, &
ump
, (uinttmp));

1491 
bp
 +(
ump
);

1493 
ump
 = (
u_t32_t
)
suffix
;

1494 
	`memy
(
bp
, &
ump
, (uinttmp));

1495 
bp
 +(
ump
);

1497 
	`DB_ASSERT
(
dbv
,

1498 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1500 i(
is_dub
 || 
tx
 =
NULL
) {

1501 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1502 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1503 *
lp
 = *
p
;

1504 i(
p
 !
t_lp
)

1505 *
t_lp
 = *
p
;

1508 
t
 = 0;

1509 #ifde
DIAGNOSTIC


1514 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1515 
y
 |
DB_debug_FLAG
;

1516 
	`memy
(
logc
.
da
, &
y
, (rectype));

1518 i(!
	`IS_REP_CLIENT
(
dbv
))

1519 
t
 = 
	`__log_put
(
dbv
,

1520 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1522 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1523 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1524 
	`LSN_NOT_LOGGED
(*
t_lp
);

1527 #ifde
LOG_DIAGNOSTIC


1528 i(
t
 != 0)

1529 ()
	`__bam__t
(
dbv
,

1530 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1533 #ifde
DIAGNOSTIC


1534 
	`__os_
(
dbv
, 
logc
.
da
);

1536 i(
is_dub
 || 
tx
 =
NULL
)

1537 
	`__os_
(
dbv
, 
logc
.
da
);

1539  (
t
);

1540 
	}
}

1546 
	$__bam__ad
(
dbv
, 
cbuf
, 
g
)

1547 
DB_ENV
 *
dbv
;

1548 *
cbuf
;

1549 
__bam__gs
 **
g
;

1551 
__bam__gs
 *
gp
;

1552 
u_t32_t
 
ump
;

1553 
u_t8_t
 *
bp
;

1554 
t
;

1556 i((
t
 = 
	`__os_mloc
(
dbv
,

1557 (
__bam__gs
+ (
DB_TXN
), &
gp
)) != 0)

1558  (
t
);

1559 
bp
 = 
cbuf
;

1560 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1561 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1563 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1564 
bp
 +(
gp
->
ty
);

1566 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1567 
bp
 +(
gp
->
tx
->
txnid
);

1569 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1570 
bp
 +(
DB_LSN
);

1572 
	`memy
(&
ump
, 
bp
, (uinttmp));

1573 
gp
->
feid
 = (
t32_t
)
ump
;

1574 
bp
 +(
ump
);

1576 
	`memy
(&
ump
, 
bp
, (uinttmp));

1577 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1578 
bp
 +(
ump
);

1580 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

1581 
bp
 +(
gp
->
l
);

1583 
	`memy
(&
ump
, 
bp
, (uinttmp));

1584 
gp
->
dx
 = (
u_t32_t
)
ump
;

1585 
bp
 +(
ump
);

1587 
	`memy
(&
ump
, 
bp
, (uinttmp));

1588 
gp
->
isded
 = (
u_t32_t
)
ump
;

1589 
bp
 +(
ump
);

1591 
	`memt
(&
gp
->
ig
, 0, (argp->orig));

1592 
	`memy
(&
gp
->
ig
.
size
, 
bp
, (
u_t32_t
));

1593 
bp
 +(
u_t32_t
);

1594 
gp
->
ig
.
da
 = 
bp
;

1595 
bp
 +
gp
->
ig
.
size
;

1597 
	`memt
(&
gp
->

, 0, (argp->repl));

1598 
	`memy
(&
gp
->

.
size
, 
bp
, (
u_t32_t
));

1599 
bp
 +(
u_t32_t
);

1600 
gp
->

.
da
 = 
bp
;

1601 
bp
 +
gp
->

.
size
;

1603 
	`memy
(&
ump
, 
bp
, (uinttmp));

1604 
gp
->
efix
 = (
u_t32_t
)
ump
;

1605 
bp
 +(
ump
);

1607 
	`memy
(&
ump
, 
bp
, (uinttmp));

1608 
gp
->
suffix
 = (
u_t32_t
)
ump
;

1609 
bp
 +(
ump
);

1611 *
g
 = 
gp
;

1613 
	}
}

1620 
	$__bam_ro_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
ma_pgno
, 
ro_pgno
, 
ma_l
)

1621 
DB
 *
dbp
;

1622 
DB_TXN
 *
tx
;

1623 
DB_LSN
 *
t_lp
;

1624 
u_t32_t
 
ags
;

1625 
db_pgno_t
 
ma_pgno
;

1626 
db_pgno_t
 
ro_pgno
;

1627 
DB_LSN
 * 
ma_l
;

1629 
DBT
 
logc
;

1630 
DB_ENV
 *
dbv
;

1631 
DB_TXNLOGREC
 *

;

1632 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1633 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1634 
u_t
 
ad
;

1635 
u_t8_t
 *
bp
;

1636 
is_dub
, 
t
;

1638 
dbv
 = 
dbp
->dbenv;

1639 
	`COMPQUIET
(

, 
NULL
);

1641 
y
 = 
DB___bam_ro
;

1642 
ad
 = 0;

1643 
p
 = 
t_lp
;

1645 
t
 = 0;

1647 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1648 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1649 i(
tx
 =
NULL
)

1651 
is_dub
 = 0;

1653 
is_dub
 = 1;

1655 i(
tx
 =
NULL
) {

1656 
txn_num
 = 0;

1657 
lp
 = &
nu_l
;

1658 
nu_l
.
fe
 =u_l.
offt
 = 0;

1660 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1661 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1662  (
t
);

1669 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1670 
txn_num
 = 
tx
->
txnid
;

1673 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1674 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1675 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1676  (
t
);

1678 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1679 + (
u_t32_t
)

1680 + (
u_t32_t
)

1681 + (
u_t32_t
)

1682 + (*
ma_l
);

1683 i(
	`CRYPTO_ON
(
dbv
)) {

1684 
ad
 =

1685 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1686 
logc
.
size
 +
ad
;

1689 i(
is_dub
 || 
tx
 =
NULL
) {

1690 i((
t
 =

1691 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1692  (
t
);

1694 i((
t
 = 
	`__os_mloc
(
dbv
,

1695 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1696  (
t
);

1697 #ifde
DIAGNOSTIC


1698 i((
t
 =

1699 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1700 
	`__os_
(
dbv
, 

);

1701  (
t
);

1704 
logc
.
da
 = 

->data;

1707 i(
ad
 > 0)

1708 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1710 
bp
 = 
logc
.
da
;

1712 
	`memy
(
bp
, &
y
, (rectype));

1713 
bp
 +(
y
);

1715 
	`memy
(
bp
, &
txn_num
, (txn_num));

1716 
bp
 +(
txn_num
);

1718 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1719 
bp
 +(
DB_LSN
);

1721 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1722 
	`memy
(
bp
, &
ump
, (uinttmp));

1723 
bp
 +(
ump
);

1725 
ump
 = (
u_t32_t
)
ma_pgno
;

1726 
	`memy
(
bp
, &
ump
, (uinttmp));

1727 
bp
 +(
ump
);

1729 
ump
 = (
u_t32_t
)
ro_pgno
;

1730 
	`memy
(
bp
, &
ump
, (uinttmp));

1731 
bp
 +(
ump
);

1733 i(
ma_l
 !
NULL
) {

1734 i(
tx
 !
NULL
) {

1735 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1736 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

1737 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ma_l
) != 0))

1738  (
t
);

1740 
	`memy
(
bp
, 
ma_l
, (*meta_lsn));

1742 
	`memt
(
bp
, 0, (*
ma_l
));

1743 
bp
 +(*
ma_l
);

1745 
	`DB_ASSERT
(
dbv
,

1746 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1748 i(
is_dub
 || 
tx
 =
NULL
) {

1749 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1750 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1751 *
lp
 = *
p
;

1752 i(
p
 !
t_lp
)

1753 *
t_lp
 = *
p
;

1756 
t
 = 0;

1757 #ifde
DIAGNOSTIC


1762 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1763 
y
 |
DB_debug_FLAG
;

1764 
	`memy
(
logc
.
da
, &
y
, (rectype));

1766 i(!
	`IS_REP_CLIENT
(
dbv
))

1767 
t
 = 
	`__log_put
(
dbv
,

1768 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1770 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1771 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1772 
	`LSN_NOT_LOGGED
(*
t_lp
);

1775 #ifde
LOG_DIAGNOSTIC


1776 i(
t
 != 0)

1777 ()
	`__bam_ro_t
(
dbv
,

1778 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1781 #ifde
DIAGNOSTIC


1782 
	`__os_
(
dbv
, 
logc
.
da
);

1784 i(
is_dub
 || 
tx
 =
NULL
)

1785 
	`__os_
(
dbv
, 
logc
.
da
);

1787  (
t
);

1788 
	}
}

1794 
	$__bam_ro_ad
(
dbv
, 
cbuf
, 
g
)

1795 
DB_ENV
 *
dbv
;

1796 *
cbuf
;

1797 
__bam_ro_gs
 **
g
;

1799 
__bam_ro_gs
 *
gp
;

1800 
u_t32_t
 
ump
;

1801 
u_t8_t
 *
bp
;

1802 
t
;

1804 i((
t
 = 
	`__os_mloc
(
dbv
,

1805 (
__bam_ro_gs
+ (
DB_TXN
), &
gp
)) != 0)

1806  (
t
);

1807 
bp
 = 
cbuf
;

1808 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1809 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1811 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1812 
bp
 +(
gp
->
ty
);

1814 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1815 
bp
 +(
gp
->
tx
->
txnid
);

1817 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1818 
bp
 +(
DB_LSN
);

1820 
	`memy
(&
ump
, 
bp
, (uinttmp));

1821 
gp
->
feid
 = (
t32_t
)
ump
;

1822 
bp
 +(
ump
);

1824 
	`memy
(&
ump
, 
bp
, (uinttmp));

1825 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1826 
bp
 +(
ump
);

1828 
	`memy
(&
ump
, 
bp
, (uinttmp));

1829 
gp
->
ro_pgno
 = (
db_pgno_t
)
ump
;

1830 
bp
 +(
ump
);

1832 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

1833 
bp
 +(
gp
->
ma_l
);

1835 *
g
 = 
gp
;

1837 
	}
}

1845 
	$__bam_cudj_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
mode
, 
om_pgno
, 
to_pgno
, 
_pgno
, 
f_dx
,

1846 
om_dx
, 
to_dx
)

1847 
DB
 *
dbp
;

1848 
DB_TXN
 *
tx
;

1849 
DB_LSN
 *
t_lp
;

1850 
u_t32_t
 
ags
;

1851 
db__mode
 
mode
;

1852 
db_pgno_t
 
om_pgno
;

1853 
db_pgno_t
 
to_pgno
;

1854 
db_pgno_t
 
_pgno
;

1855 
u_t32_t
 
f_dx
;

1856 
u_t32_t
 
om_dx
;

1857 
u_t32_t
 
to_dx
;

1859 
DBT
 
logc
;

1860 
DB_ENV
 *
dbv
;

1861 
DB_TXNLOGREC
 *

;

1862 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1863 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1864 
u_t
 
ad
;

1865 
u_t8_t
 *
bp
;

1866 
is_dub
, 
t
;

1868 
dbv
 = 
dbp
->dbenv;

1869 
	`COMPQUIET
(

, 
NULL
);

1871 
y
 = 
DB___bam_cudj
;

1872 
ad
 = 0;

1873 
p
 = 
t_lp
;

1875 
t
 = 0;

1877 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1878 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1879 i(
tx
 =
NULL
)

1881 
is_dub
 = 0;

1883 
is_dub
 = 1;

1885 i(
tx
 =
NULL
) {

1886 
txn_num
 = 0;

1887 
lp
 = &
nu_l
;

1888 
nu_l
.
fe
 =u_l.
offt
 = 0;

1890 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1891 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1892  (
t
);

1899 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1900 
txn_num
 = 
tx
->
txnid
;

1903 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1904 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1905 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1906  (
t
);

1908 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1909 + (
u_t32_t
)

1910 + (
u_t32_t
)

1911 + (
u_t32_t
)

1912 + (
u_t32_t
)

1913 + (
u_t32_t
)

1914 + (
u_t32_t
)

1915 + (
u_t32_t
)

1916 + (
u_t32_t
);

1917 i(
	`CRYPTO_ON
(
dbv
)) {

1918 
ad
 =

1919 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1920 
logc
.
size
 +
ad
;

1923 i(
is_dub
 || 
tx
 =
NULL
) {

1924 i((
t
 =

1925 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1926  (
t
);

1928 i((
t
 = 
	`__os_mloc
(
dbv
,

1929 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1930  (
t
);

1931 #ifde
DIAGNOSTIC


1932 i((
t
 =

1933 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1934 
	`__os_
(
dbv
, 

);

1935  (
t
);

1938 
logc
.
da
 = 

->data;

1941 i(
ad
 > 0)

1942 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1944 
bp
 = 
logc
.
da
;

1946 
	`memy
(
bp
, &
y
, (rectype));

1947 
bp
 +(
y
);

1949 
	`memy
(
bp
, &
txn_num
, (txn_num));

1950 
bp
 +(
txn_num
);

1952 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1953 
bp
 +(
DB_LSN
);

1955 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1956 
	`memy
(
bp
, &
ump
, (uinttmp));

1957 
bp
 +(
ump
);

1959 
ump
 = (
u_t32_t
)
mode
;

1960 
	`memy
(
bp
, &
ump
, (uinttmp));

1961 
bp
 +(
ump
);

1963 
ump
 = (
u_t32_t
)
om_pgno
;

1964 
	`memy
(
bp
, &
ump
, (uinttmp));

1965 
bp
 +(
ump
);

1967 
ump
 = (
u_t32_t
)
to_pgno
;

1968 
	`memy
(
bp
, &
ump
, (uinttmp));

1969 
bp
 +(
ump
);

1971 
ump
 = (
u_t32_t
)
_pgno
;

1972 
	`memy
(
bp
, &
ump
, (uinttmp));

1973 
bp
 +(
ump
);

1975 
ump
 = (
u_t32_t
)
f_dx
;

1976 
	`memy
(
bp
, &
ump
, (uinttmp));

1977 
bp
 +(
ump
);

1979 
ump
 = (
u_t32_t
)
om_dx
;

1980 
	`memy
(
bp
, &
ump
, (uinttmp));

1981 
bp
 +(
ump
);

1983 
ump
 = (
u_t32_t
)
to_dx
;

1984 
	`memy
(
bp
, &
ump
, (uinttmp));

1985 
bp
 +(
ump
);

1987 
	`DB_ASSERT
(
dbv
,

1988 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1990 i(
is_dub
 || 
tx
 =
NULL
) {

1991 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1992 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1993 *
lp
 = *
p
;

1994 i(
p
 !
t_lp
)

1995 *
t_lp
 = *
p
;

1998 
t
 = 0;

1999 #ifde
DIAGNOSTIC


2004 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2005 
y
 |
DB_debug_FLAG
;

2006 
	`memy
(
logc
.
da
, &
y
, (rectype));

2008 i(!
	`IS_REP_CLIENT
(
dbv
))

2009 
t
 = 
	`__log_put
(
dbv
,

2010 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2012 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2013 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2014 
	`LSN_NOT_LOGGED
(*
t_lp
);

2017 #ifde
LOG_DIAGNOSTIC


2018 i(
t
 != 0)

2019 ()
	`__bam_cudj_t
(
dbv
,

2020 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2023 #ifde
DIAGNOSTIC


2024 
	`__os_
(
dbv
, 
logc
.
da
);

2026 i(
is_dub
 || 
tx
 =
NULL
)

2027 
	`__os_
(
dbv
, 
logc
.
da
);

2029  (
t
);

2030 
	}
}

2036 
	$__bam_cudj_ad
(
dbv
, 
cbuf
, 
g
)

2037 
DB_ENV
 *
dbv
;

2038 *
cbuf
;

2039 
__bam_cudj_gs
 **
g
;

2041 
__bam_cudj_gs
 *
gp
;

2042 
u_t32_t
 
ump
;

2043 
u_t8_t
 *
bp
;

2044 
t
;

2046 i((
t
 = 
	`__os_mloc
(
dbv
,

2047 (
__bam_cudj_gs
+ (
DB_TXN
), &
gp
)) != 0)

2048  (
t
);

2049 
bp
 = 
cbuf
;

2050 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2051 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2053 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2054 
bp
 +(
gp
->
ty
);

2056 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2057 
bp
 +(
gp
->
tx
->
txnid
);

2059 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2060 
bp
 +(
DB_LSN
);

2062 
	`memy
(&
ump
, 
bp
, (uinttmp));

2063 
gp
->
feid
 = (
t32_t
)
ump
;

2064 
bp
 +(
ump
);

2066 
	`memy
(&
ump
, 
bp
, (uinttmp));

2067 
gp
->
mode
 = (
db__mode
)
ump
;

2068 
bp
 +(
ump
);

2070 
	`memy
(&
ump
, 
bp
, (uinttmp));

2071 
gp
->
om_pgno
 = (
db_pgno_t
)
ump
;

2072 
bp
 +(
ump
);

2074 
	`memy
(&
ump
, 
bp
, (uinttmp));

2075 
gp
->
to_pgno
 = (
db_pgno_t
)
ump
;

2076 
bp
 +(
ump
);

2078 
	`memy
(&
ump
, 
bp
, (uinttmp));

2079 
gp
->
_pgno
 = (
db_pgno_t
)
ump
;

2080 
bp
 +(
ump
);

2082 
	`memy
(&
ump
, 
bp
, (uinttmp));

2083 
gp
->
f_dx
 = (
u_t32_t
)
ump
;

2084 
bp
 +(
ump
);

2086 
	`memy
(&
ump
, 
bp
, (uinttmp));

2087 
gp
->
om_dx
 = (
u_t32_t
)
ump
;

2088 
bp
 +(
ump
);

2090 
	`memy
(&
ump
, 
bp
, (uinttmp));

2091 
gp
->
to_dx
 = (
u_t32_t
)
ump
;

2092 
bp
 +(
ump
);

2094 *
g
 = 
gp
;

2096 
	}
}

2103 
	$__bam_rcudj_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
mode
, 
ro
, 
o
, 
d
)

2104 
DB
 *
dbp
;

2105 
DB_TXN
 *
tx
;

2106 
DB_LSN
 *
t_lp
;

2107 
u_t32_t
 
ags
;

2108 
_o_g
 
mode
;

2109 
db_pgno_t
 
ro
;

2110 
db_o_t
 
o
;

2111 
u_t32_t
 
d
;

2113 
DBT
 
logc
;

2114 
DB_ENV
 *
dbv
;

2115 
DB_TXNLOGREC
 *

;

2116 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2117 
u_t32_t
 
ump
, 
y
, 
txn_num
;

2118 
u_t
 
ad
;

2119 
u_t8_t
 *
bp
;

2120 
is_dub
, 
t
;

2122 
dbv
 = 
dbp
->dbenv;

2123 
	`COMPQUIET
(

, 
NULL
);

2125 
y
 = 
DB___bam_rcudj
;

2126 
ad
 = 0;

2127 
p
 = 
t_lp
;

2129 
t
 = 0;

2131 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2132 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2133 i(
tx
 =
NULL
)

2135 
is_dub
 = 0;

2137 
is_dub
 = 1;

2139 i(
tx
 =
NULL
) {

2140 
txn_num
 = 0;

2141 
lp
 = &
nu_l
;

2142 
nu_l
.
fe
 =u_l.
offt
 = 0;

2144 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2145 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2146  (
t
);

2153 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2154 
txn_num
 = 
tx
->
txnid
;

2157 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

2158 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2159 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2160  (
t
);

2162 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2163 + (
u_t32_t
)

2164 + (
u_t32_t
)

2165 + (
u_t32_t
)

2166 + (
u_t32_t
)

2167 + (
u_t32_t
);

2168 i(
	`CRYPTO_ON
(
dbv
)) {

2169 
ad
 =

2170 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2171 
logc
.
size
 +
ad
;

2174 i(
is_dub
 || 
tx
 =
NULL
) {

2175 i((
t
 =

2176 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2177  (
t
);

2179 i((
t
 = 
	`__os_mloc
(
dbv
,

2180 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2181  (
t
);

2182 #ifde
DIAGNOSTIC


2183 i((
t
 =

2184 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2185 
	`__os_
(
dbv
, 

);

2186  (
t
);

2189 
logc
.
da
 = 

->data;

2192 i(
ad
 > 0)

2193 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2195 
bp
 = 
logc
.
da
;

2197 
	`memy
(
bp
, &
y
, (rectype));

2198 
bp
 +(
y
);

2200 
	`memy
(
bp
, &
txn_num
, (txn_num));

2201 
bp
 +(
txn_num
);

2203 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2204 
bp
 +(
DB_LSN
);

2206 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2207 
	`memy
(
bp
, &
ump
, (uinttmp));

2208 
bp
 +(
ump
);

2210 
ump
 = (
u_t32_t
)
mode
;

2211 
	`memy
(
bp
, &
ump
, (uinttmp));

2212 
bp
 +(
ump
);

2214 
ump
 = (
u_t32_t
)
ro
;

2215 
	`memy
(
bp
, &
ump
, (uinttmp));

2216 
bp
 +(
ump
);

2218 
ump
 = (
u_t32_t
)
o
;

2219 
	`memy
(
bp
, &
ump
, (uinttmp));

2220 
bp
 +(
ump
);

2222 
ump
 = (
u_t32_t
)
d
;

2223 
	`memy
(
bp
, &
ump
, (uinttmp));

2224 
bp
 +(
ump
);

2226 
	`DB_ASSERT
(
dbv
,

2227 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2229 i(
is_dub
 || 
tx
 =
NULL
) {

2230 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2231 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2232 *
lp
 = *
p
;

2233 i(
p
 !
t_lp
)

2234 *
t_lp
 = *
p
;

2237 
t
 = 0;

2238 #ifde
DIAGNOSTIC


2243 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2244 
y
 |
DB_debug_FLAG
;

2245 
	`memy
(
logc
.
da
, &
y
, (rectype));

2247 i(!
	`IS_REP_CLIENT
(
dbv
))

2248 
t
 = 
	`__log_put
(
dbv
,

2249 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2251 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2252 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2253 
	`LSN_NOT_LOGGED
(*
t_lp
);

2256 #ifde
LOG_DIAGNOSTIC


2257 i(
t
 != 0)

2258 ()
	`__bam_rcudj_t
(
dbv
,

2259 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2262 #ifde
DIAGNOSTIC


2263 
	`__os_
(
dbv
, 
logc
.
da
);

2265 i(
is_dub
 || 
tx
 =
NULL
)

2266 
	`__os_
(
dbv
, 
logc
.
da
);

2268  (
t
);

2269 
	}
}

2276 
	$__bam_rcudj_ad
(
dbv
, 
cbuf
, 
g
)

2277 
DB_ENV
 *
dbv
;

2278 *
cbuf
;

2279 
__bam_rcudj_gs
 **
g
;

2281 
__bam_rcudj_gs
 *
gp
;

2282 
u_t32_t
 
ump
;

2283 
u_t8_t
 *
bp
;

2284 
t
;

2286 i((
t
 = 
	`__os_mloc
(
dbv
,

2287 (
__bam_rcudj_gs
+ (
DB_TXN
), &
gp
)) != 0)

2288  (
t
);

2289 
bp
 = 
cbuf
;

2290 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2291 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2293 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2294 
bp
 +(
gp
->
ty
);

2296 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2297 
bp
 +(
gp
->
tx
->
txnid
);

2299 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2300 
bp
 +(
DB_LSN
);

2302 
	`memy
(&
ump
, 
bp
, (uinttmp));

2303 
gp
->
feid
 = (
t32_t
)
ump
;

2304 
bp
 +(
ump
);

2306 
	`memy
(&
ump
, 
bp
, (uinttmp));

2307 
gp
->
mode
 = (
_o_g
)
ump
;

2308 
bp
 +(
ump
);

2310 
	`memy
(&
ump
, 
bp
, (uinttmp));

2311 
gp
->
ro
 = (
db_pgno_t
)
ump
;

2312 
bp
 +(
ump
);

2314 
	`memy
(&
ump
, 
bp
, (uinttmp));

2315 
gp
->
o
 = (
db_o_t
)
ump
;

2316 
bp
 +(
ump
);

2318 
	`memy
(&
ump
, 
bp
, (uinttmp));

2319 
gp
->
d
 = (
u_t32_t
)
ump
;

2320 
bp
 +(
ump
);

2322 *
g
 = 
gp
;

2324 
	}
}

2331 
	$__bam_lk_43_ad
(
dbv
, 
cbuf
, 
g
)

2332 
DB_ENV
 *
dbv
;

2333 *
cbuf
;

2334 
__bam_lk_43_gs
 **
g
;

2336 
__bam_lk_43_gs
 *
gp
;

2337 
u_t32_t
 
ump
;

2338 
u_t8_t
 *
bp
;

2339 
t
;

2341 i((
t
 = 
	`__os_mloc
(
dbv
,

2342 (
__bam_lk_43_gs
+ (
DB_TXN
), &
gp
)) != 0)

2343  (
t
);

2344 
bp
 = 
cbuf
;

2345 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2346 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2348 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2349 
bp
 +(
gp
->
ty
);

2351 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2352 
bp
 +(
gp
->
tx
->
txnid
);

2354 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2355 
bp
 +(
DB_LSN
);

2357 
	`memy
(&
ump
, 
bp
, (uinttmp));

2358 
gp
->
feid
 = (
t32_t
)
ump
;

2359 
bp
 +(
ump
);

2361 
	`memy
(&
ump
, 
bp
, (uinttmp));

2362 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2363 
bp
 +(
ump
);

2365 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

2366 
bp
 +(
gp
->
l
);

2368 
	`memy
(&
ump
, 
bp
, (uinttmp));

2369 
gp
->
ev
 = (
db_pgno_t
)
ump
;

2370 
bp
 +(
ump
);

2372 
	`memy
(&
gp
->
l_ev
, 
bp
, (argp->lsn_prev));

2373 
bp
 +(
gp
->
l_ev
);

2375 
	`memy
(&
ump
, 
bp
, (uinttmp));

2376 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2377 
bp
 +(
ump
);

2379 
	`memy
(&
gp
->
l_xt
, 
bp
, (argp->lsn_next));

2380 
bp
 +(
gp
->
l_xt
);

2382 *
g
 = 
gp
;

2384 
	}
}

2392 
	$__bam_lk_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
w_pgno
, 
ev
, 
l_ev
, 
xt
,

2393 
l_xt
)

2394 
DB
 *
dbp
;

2395 
DB_TXN
 *
tx
;

2396 
DB_LSN
 *
t_lp
;

2397 
u_t32_t
 
ags
;

2398 
db_pgno_t
 
pgno
;

2399 
db_pgno_t
 
w_pgno
;

2400 
db_pgno_t
 
ev
;

2401 
DB_LSN
 * 
l_ev
;

2402 
db_pgno_t
 
xt
;

2403 
DB_LSN
 * 
l_xt
;

2405 
DBT
 
logc
;

2406 
DB_ENV
 *
dbv
;

2407 
DB_TXNLOGREC
 *

;

2408 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2409 
u_t32_t
 
ump
, 
y
, 
txn_num
;

2410 
u_t
 
ad
;

2411 
u_t8_t
 *
bp
;

2412 
is_dub
, 
t
;

2414 
dbv
 = 
dbp
->dbenv;

2415 
	`COMPQUIET
(

, 
NULL
);

2417 
y
 = 
DB___bam_lk
;

2418 
ad
 = 0;

2419 
p
 = 
t_lp
;

2421 
t
 = 0;

2423 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2424 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2425 i(
tx
 =
NULL
)

2427 
is_dub
 = 0;

2429 
is_dub
 = 1;

2431 i(
tx
 =
NULL
) {

2432 
txn_num
 = 0;

2433 
lp
 = &
nu_l
;

2434 
nu_l
.
fe
 =u_l.
offt
 = 0;

2436 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2437 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2438  (
t
);

2445 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2446 
txn_num
 = 
tx
->
txnid
;

2449 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

2450 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2451 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2452  (
t
);

2454 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2455 + (
u_t32_t
)

2456 + (
u_t32_t
)

2457 + (
u_t32_t
)

2458 + (
u_t32_t
)

2459 + (*
l_ev
)

2460 + (
u_t32_t
)

2461 + (*
l_xt
);

2462 i(
	`CRYPTO_ON
(
dbv
)) {

2463 
ad
 =

2464 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2465 
logc
.
size
 +
ad
;

2468 i(
is_dub
 || 
tx
 =
NULL
) {

2469 i((
t
 =

2470 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2471  (
t
);

2473 i((
t
 = 
	`__os_mloc
(
dbv
,

2474 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2475  (
t
);

2476 #ifde
DIAGNOSTIC


2477 i((
t
 =

2478 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2479 
	`__os_
(
dbv
, 

);

2480  (
t
);

2483 
logc
.
da
 = 

->data;

2486 i(
ad
 > 0)

2487 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2489 
bp
 = 
logc
.
da
;

2491 
	`memy
(
bp
, &
y
, (rectype));

2492 
bp
 +(
y
);

2494 
	`memy
(
bp
, &
txn_num
, (txn_num));

2495 
bp
 +(
txn_num
);

2497 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2498 
bp
 +(
DB_LSN
);

2500 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2501 
	`memy
(
bp
, &
ump
, (uinttmp));

2502 
bp
 +(
ump
);

2504 
ump
 = (
u_t32_t
)
pgno
;

2505 
	`memy
(
bp
, &
ump
, (uinttmp));

2506 
bp
 +(
ump
);

2508 
ump
 = (
u_t32_t
)
w_pgno
;

2509 
	`memy
(
bp
, &
ump
, (uinttmp));

2510 
bp
 +(
ump
);

2512 
ump
 = (
u_t32_t
)
ev
;

2513 
	`memy
(
bp
, &
ump
, (uinttmp));

2514 
bp
 +(
ump
);

2516 i(
l_ev
 !
NULL
) {

2517 i(
tx
 !
NULL
) {

2518 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

2519 i(
	`LOG_COMPARE
(
l_ev
, &

->
l
>0 && (
t
 =

2520 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l_ev
) != 0))

2521  (
t
);

2523 
	`memy
(
bp
, 
l_ev
, (*lsn_prev));

2525 
	`memt
(
bp
, 0, (*
l_ev
));

2526 
bp
 +(*
l_ev
);

2528 
ump
 = (
u_t32_t
)
xt
;

2529 
	`memy
(
bp
, &
ump
, (uinttmp));

2530 
bp
 +(
ump
);

2532 i(
l_xt
 !
NULL
) {

2533 i(
tx
 !
NULL
) {

2534 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

2535 i(
	`LOG_COMPARE
(
l_xt
, &

->
l
>0 && (
t
 =

2536 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l_xt
) != 0))

2537  (
t
);

2539 
	`memy
(
bp
, 
l_xt
, (*lsn_next));

2541 
	`memt
(
bp
, 0, (*
l_xt
));

2542 
bp
 +(*
l_xt
);

2544 
	`DB_ASSERT
(
dbv
,

2545 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2547 i(
is_dub
 || 
tx
 =
NULL
) {

2548 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2549 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2550 *
lp
 = *
p
;

2551 i(
p
 !
t_lp
)

2552 *
t_lp
 = *
p
;

2555 
t
 = 0;

2556 #ifde
DIAGNOSTIC


2561 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2562 
y
 |
DB_debug_FLAG
;

2563 
	`memy
(
logc
.
da
, &
y
, (rectype));

2565 i(!
	`IS_REP_CLIENT
(
dbv
))

2566 
t
 = 
	`__log_put
(
dbv
,

2567 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2569 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2570 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2571 
	`LSN_NOT_LOGGED
(*
t_lp
);

2574 #ifde
LOG_DIAGNOSTIC


2575 i(
t
 != 0)

2576 ()
	`__bam_lk_t
(
dbv
,

2577 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2580 #ifde
DIAGNOSTIC


2581 
	`__os_
(
dbv
, 
logc
.
da
);

2583 i(
is_dub
 || 
tx
 =
NULL
)

2584 
	`__os_
(
dbv
, 
logc
.
da
);

2586  (
t
);

2587 
	}
}

2593 
	$__bam_lk_ad
(
dbv
, 
cbuf
, 
g
)

2594 
DB_ENV
 *
dbv
;

2595 *
cbuf
;

2596 
__bam_lk_gs
 **
g
;

2598 
__bam_lk_gs
 *
gp
;

2599 
u_t32_t
 
ump
;

2600 
u_t8_t
 *
bp
;

2601 
t
;

2603 i((
t
 = 
	`__os_mloc
(
dbv
,

2604 (
__bam_lk_gs
+ (
DB_TXN
), &
gp
)) != 0)

2605  (
t
);

2606 
bp
 = 
cbuf
;

2607 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2608 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2610 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2611 
bp
 +(
gp
->
ty
);

2613 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2614 
bp
 +(
gp
->
tx
->
txnid
);

2616 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2617 
bp
 +(
DB_LSN
);

2619 
	`memy
(&
ump
, 
bp
, (uinttmp));

2620 
gp
->
feid
 = (
t32_t
)
ump
;

2621 
bp
 +(
ump
);

2623 
	`memy
(&
ump
, 
bp
, (uinttmp));

2624 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2625 
bp
 +(
ump
);

2627 
	`memy
(&
ump
, 
bp
, (uinttmp));

2628 
gp
->
w_pgno
 = (
db_pgno_t
)
ump
;

2629 
bp
 +(
ump
);

2631 
	`memy
(&
ump
, 
bp
, (uinttmp));

2632 
gp
->
ev
 = (
db_pgno_t
)
ump
;

2633 
bp
 +(
ump
);

2635 
	`memy
(&
gp
->
l_ev
, 
bp
, (argp->lsn_prev));

2636 
bp
 +(
gp
->
l_ev
);

2638 
	`memy
(&
ump
, 
bp
, (uinttmp));

2639 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2640 
bp
 +(
ump
);

2642 
	`memy
(&
gp
->
l_xt
, 
bp
, (argp->lsn_next));

2643 
bp
 +(
gp
->
l_xt
);

2645 *
g
 = 
gp
;

2647 
	}
}

2655 
	$__bam_mge_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
gno
, 
Ƣ
, 
hdr
,

2656 
da
, 
d
)

2657 
DB
 *
dbp
;

2658 
DB_TXN
 *
tx
;

2659 
DB_LSN
 *
t_lp
;

2660 
u_t32_t
 
ags
;

2661 
db_pgno_t
 
pgno
;

2662 
DB_LSN
 * 
l
;

2663 
db_pgno_t
 
gno
;

2664 
DB_LSN
 * 
Ƣ
;

2665 cڡ 
DBT
 *
hdr
;

2666 cڡ 
DBT
 *
da
;

2667 cڡ 
DBT
 *
d
;

2669 
DBT
 
logc
;

2670 
DB_ENV
 *
dbv
;

2671 
DB_TXNLOGREC
 *

;

2672 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2673 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

2674 
u_t
 
ad
;

2675 
u_t8_t
 *
bp
;

2676 
is_dub
, 
t
;

2678 
dbv
 = 
dbp
->dbenv;

2679 
	`COMPQUIET
(

, 
NULL
);

2681 
y
 = 
DB___bam_mge
;

2682 
ad
 = 0;

2683 
p
 = 
t_lp
;

2685 
t
 = 0;

2687 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2688 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2689 i(
tx
 =
NULL
)

2691 
is_dub
 = 0;

2693 
is_dub
 = 1;

2695 i(
tx
 =
NULL
) {

2696 
txn_num
 = 0;

2697 
lp
 = &
nu_l
;

2698 
nu_l
.
fe
 =u_l.
offt
 = 0;

2700 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2701 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2702  (
t
);

2709 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2710 
txn_num
 = 
tx
->
txnid
;

2713 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

2714 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2715 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2716  (
t
);

2718 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2719 + (
u_t32_t
)

2720 + (
u_t32_t
)

2721 + (*
l
)

2722 + (
u_t32_t
)

2723 + (*
Ƣ
)

2724 + (
u_t32_t
+ (
hdr
 =
NULL
 ? 0 : hdr->
size
)

2725 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
)

2726 + (
u_t32_t
+ (
d
 =
NULL
 ? 0 : ind->
size
);

2727 i(
	`CRYPTO_ON
(
dbv
)) {

2728 
ad
 =

2729 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2730 
logc
.
size
 +
ad
;

2733 i(
is_dub
 || 
tx
 =
NULL
) {

2734 i((
t
 =

2735 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2736  (
t
);

2738 i((
t
 = 
	`__os_mloc
(
dbv
,

2739 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2740  (
t
);

2741 #ifde
DIAGNOSTIC


2742 i((
t
 =

2743 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2744 
	`__os_
(
dbv
, 

);

2745  (
t
);

2748 
logc
.
da
 = 

->data;

2751 i(
ad
 > 0)

2752 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2754 
bp
 = 
logc
.
da
;

2756 
	`memy
(
bp
, &
y
, (rectype));

2757 
bp
 +(
y
);

2759 
	`memy
(
bp
, &
txn_num
, (txn_num));

2760 
bp
 +(
txn_num
);

2762 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2763 
bp
 +(
DB_LSN
);

2765 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2766 
	`memy
(
bp
, &
ump
, (uinttmp));

2767 
bp
 +(
ump
);

2769 
ump
 = (
u_t32_t
)
pgno
;

2770 
	`memy
(
bp
, &
ump
, (uinttmp));

2771 
bp
 +(
ump
);

2773 i(
l
 !
NULL
) {

2774 i(
tx
 !
NULL
) {

2775 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

2776 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

2777 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

2778  (
t
);

2780 
	`memy
(
bp
, 
l
, (*lsn));

2782 
	`memt
(
bp
, 0, (*
l
));

2783 
bp
 +(*
l
);

2785 
ump
 = (
u_t32_t
)
gno
;

2786 
	`memy
(
bp
, &
ump
, (uinttmp));

2787 
bp
 +(
ump
);

2789 i(
Ƣ
 !
NULL
) {

2790 i(
tx
 !
NULL
) {

2791 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

2792 i(
	`LOG_COMPARE
(
Ƣ
, &

->
l
>0 && (
t
 =

2793 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
Ƣ
) != 0))

2794  (
t
);

2796 
	`memy
(
bp
, 
Ƣ
, (*nlsn));

2798 
	`memt
(
bp
, 0, (*
Ƣ
));

2799 
bp
 +(*
Ƣ
);

2801 i(
hdr
 =
NULL
) {

2802 
zo
 = 0;

2803 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

2804 
bp
 +(
u_t32_t
);

2806 
	`memy
(
bp
, &
hdr
->
size
, (hdr->size));

2807 
bp
 +(
hdr
->
size
);

2808 
	`memy
(
bp
, 
hdr
->
da
, hdr->
size
);

2809 
bp
 +
hdr
->
size
;

2812 i(
da
 =
NULL
) {

2813 
zo
 = 0;

2814 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

2815 
bp
 +(
u_t32_t
);

2817 
	`memy
(
bp
, &
da
->
size
, (data->size));

2818 
bp
 +(
da
->
size
);

2819 
	`memy
(
bp
, 
da
->da, da->
size
);

2820 
bp
 +
da
->
size
;

2823 i(
d
 =
NULL
) {

2824 
zo
 = 0;

2825 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

2826 
bp
 +(
u_t32_t
);

2828 
	`memy
(
bp
, &
d
->
size
, (ind->size));

2829 
bp
 +(
d
->
size
);

2830 
	`memy
(
bp
, 
d
->
da
, ind->
size
);

2831 
bp
 +
d
->
size
;

2834 
	`DB_ASSERT
(
dbv
,

2835 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2837 i(
is_dub
 || 
tx
 =
NULL
) {

2838 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2839 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2840 *
lp
 = *
p
;

2841 i(
p
 !
t_lp
)

2842 *
t_lp
 = *
p
;

2845 
t
 = 0;

2846 #ifde
DIAGNOSTIC


2851 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2852 
y
 |
DB_debug_FLAG
;

2853 
	`memy
(
logc
.
da
, &
y
, (rectype));

2855 i(!
	`IS_REP_CLIENT
(
dbv
))

2856 
t
 = 
	`__log_put
(
dbv
,

2857 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2859 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2860 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2861 
	`LSN_NOT_LOGGED
(*
t_lp
);

2864 #ifde
LOG_DIAGNOSTIC


2865 i(
t
 != 0)

2866 ()
	`__bam_mge_t
(
dbv
,

2867 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2870 #ifde
DIAGNOSTIC


2871 
	`__os_
(
dbv
, 
logc
.
da
);

2873 i(
is_dub
 || 
tx
 =
NULL
)

2874 
	`__os_
(
dbv
, 
logc
.
da
);

2876  (
t
);

2877 
	}
}

2883 
	$__bam_mge_ad
(
dbv
, 
cbuf
, 
g
)

2884 
DB_ENV
 *
dbv
;

2885 *
cbuf
;

2886 
__bam_mge_gs
 **
g
;

2888 
__bam_mge_gs
 *
gp
;

2889 
u_t32_t
 
ump
;

2890 
u_t8_t
 *
bp
;

2891 
t
;

2893 i((
t
 = 
	`__os_mloc
(
dbv
,

2894 (
__bam_mge_gs
+ (
DB_TXN
), &
gp
)) != 0)

2895  (
t
);

2896 
bp
 = 
cbuf
;

2897 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2898 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2900 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2901 
bp
 +(
gp
->
ty
);

2903 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2904 
bp
 +(
gp
->
tx
->
txnid
);

2906 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2907 
bp
 +(
DB_LSN
);

2909 
	`memy
(&
ump
, 
bp
, (uinttmp));

2910 
gp
->
feid
 = (
t32_t
)
ump
;

2911 
bp
 +(
ump
);

2913 
	`memy
(&
ump
, 
bp
, (uinttmp));

2914 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2915 
bp
 +(
ump
);

2917 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

2918 
bp
 +(
gp
->
l
);

2920 
	`memy
(&
ump
, 
bp
, (uinttmp));

2921 
gp
->
gno
 = (
db_pgno_t
)
ump
;

2922 
bp
 +(
ump
);

2924 
	`memy
(&
gp
->
Ƣ
, 
bp
, (argp->nlsn));

2925 
bp
 +(
gp
->
Ƣ
);

2927 
	`memt
(&
gp
->
hdr
, 0, (argp->hdr));

2928 
	`memy
(&
gp
->
hdr
.
size
, 
bp
, (
u_t32_t
));

2929 
bp
 +(
u_t32_t
);

2930 
gp
->
hdr
.
da
 = 
bp
;

2931 
bp
 +
gp
->
hdr
.
size
;

2933 
	`memt
(&
gp
->
da
, 0, (argp->data));

2934 
	`memy
(&
gp
->
da
.
size
, 
bp
, (
u_t32_t
));

2935 
bp
 +(
u_t32_t
);

2936 
gp
->
da
.d
bp
;

2937 
bp
 +
gp
->
da
.
size
;

2939 
	`memt
(&
gp
->
d
, 0, (argp->ind));

2940 
	`memy
(&
gp
->
d
.
size
, 
bp
, (
u_t32_t
));

2941 
bp
 +(
u_t32_t
);

2942 
gp
->
d
.
da
 = 
bp
;

2943 
bp
 +
gp
->
d
.
size
;

2945 *
g
 = 
gp
;

2947 
	}
}

2955 
	$__bam_pgno_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
gno
, 
gno
)

2956 
DB
 *
dbp
;

2957 
DB_TXN
 *
tx
;

2958 
DB_LSN
 *
t_lp
;

2959 
u_t32_t
 
ags
;

2960 
db_pgno_t
 
pgno
;

2961 
DB_LSN
 * 
l
;

2962 
u_t32_t
 
dx
;

2963 
db_pgno_t
 
gno
;

2964 
db_pgno_t
 
gno
;

2966 
DBT
 
logc
;

2967 
DB_ENV
 *
dbv
;

2968 
DB_TXNLOGREC
 *

;

2969 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2970 
u_t32_t
 
ump
, 
y
, 
txn_num
;

2971 
u_t
 
ad
;

2972 
u_t8_t
 *
bp
;

2973 
is_dub
, 
t
;

2975 
dbv
 = 
dbp
->dbenv;

2976 
	`COMPQUIET
(

, 
NULL
);

2978 
y
 = 
DB___bam_pgno
;

2979 
ad
 = 0;

2980 
p
 = 
t_lp
;

2982 
t
 = 0;

2984 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2985 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2986 i(
tx
 =
NULL
)

2988 
is_dub
 = 0;

2990 
is_dub
 = 1;

2992 i(
tx
 =
NULL
) {

2993 
txn_num
 = 0;

2994 
lp
 = &
nu_l
;

2995 
nu_l
.
fe
 =u_l.
offt
 = 0;

2997 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2998 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2999  (
t
);

3006 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

3007 
txn_num
 = 
tx
->
txnid
;

3010 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

3011 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

3012 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

3013  (
t
);

3015 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

3016 + (
u_t32_t
)

3017 + (
u_t32_t
)

3018 + (*
l
)

3019 + (
u_t32_t
)

3020 + (
u_t32_t
)

3021 + (
u_t32_t
);

3022 i(
	`CRYPTO_ON
(
dbv
)) {

3023 
ad
 =

3024 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

3025 
logc
.
size
 +
ad
;

3028 i(
is_dub
 || 
tx
 =
NULL
) {

3029 i((
t
 =

3030 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

3031  (
t
);

3033 i((
t
 = 
	`__os_mloc
(
dbv
,

3034 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

3035  (
t
);

3036 #ifde
DIAGNOSTIC


3037 i((
t
 =

3038 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

3039 
	`__os_
(
dbv
, 

);

3040  (
t
);

3043 
logc
.
da
 = 

->data;

3046 i(
ad
 > 0)

3047 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

3049 
bp
 = 
logc
.
da
;

3051 
	`memy
(
bp
, &
y
, (rectype));

3052 
bp
 +(
y
);

3054 
	`memy
(
bp
, &
txn_num
, (txn_num));

3055 
bp
 +(
txn_num
);

3057 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

3058 
bp
 +(
DB_LSN
);

3060 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

3061 
	`memy
(
bp
, &
ump
, (uinttmp));

3062 
bp
 +(
ump
);

3064 
ump
 = (
u_t32_t
)
pgno
;

3065 
	`memy
(
bp
, &
ump
, (uinttmp));

3066 
bp
 +(
ump
);

3068 i(
l
 !
NULL
) {

3069 i(
tx
 !
NULL
) {

3070 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

3071 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

3072 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

3073  (
t
);

3075 
	`memy
(
bp
, 
l
, (*lsn));

3077 
	`memt
(
bp
, 0, (*
l
));

3078 
bp
 +(*
l
);

3080 
ump
 = (
u_t32_t
)
dx
;

3081 
	`memy
(
bp
, &
ump
, (uinttmp));

3082 
bp
 +(
ump
);

3084 
ump
 = (
u_t32_t
)
gno
;

3085 
	`memy
(
bp
, &
ump
, (uinttmp));

3086 
bp
 +(
ump
);

3088 
ump
 = (
u_t32_t
)
gno
;

3089 
	`memy
(
bp
, &
ump
, (uinttmp));

3090 
bp
 +(
ump
);

3092 
	`DB_ASSERT
(
dbv
,

3093 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

3095 i(
is_dub
 || 
tx
 =
NULL
) {

3096 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

3097 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

3098 *
lp
 = *
p
;

3099 i(
p
 !
t_lp
)

3100 *
t_lp
 = *
p
;

3103 
t
 = 0;

3104 #ifde
DIAGNOSTIC


3109 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

3110 
y
 |
DB_debug_FLAG
;

3111 
	`memy
(
logc
.
da
, &
y
, (rectype));

3113 i(!
	`IS_REP_CLIENT
(
dbv
))

3114 
t
 = 
	`__log_put
(
dbv
,

3115 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

3117 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

3118 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

3119 
	`LSN_NOT_LOGGED
(*
t_lp
);

3122 #ifde
LOG_DIAGNOSTIC


3123 i(
t
 != 0)

3124 ()
	`__bam_pgno_t
(
dbv
,

3125 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

3128 #ifde
DIAGNOSTIC


3129 
	`__os_
(
dbv
, 
logc
.
da
);

3131 i(
is_dub
 || 
tx
 =
NULL
)

3132 
	`__os_
(
dbv
, 
logc
.
da
);

3134  (
t
);

3135 
	}
}

3141 
	$__bam_pgno_ad
(
dbv
, 
cbuf
, 
g
)

3142 
DB_ENV
 *
dbv
;

3143 *
cbuf
;

3144 
__bam_pgno_gs
 **
g
;

3146 
__bam_pgno_gs
 *
gp
;

3147 
u_t32_t
 
ump
;

3148 
u_t8_t
 *
bp
;

3149 
t
;

3151 i((
t
 = 
	`__os_mloc
(
dbv
,

3152 (
__bam_pgno_gs
+ (
DB_TXN
), &
gp
)) != 0)

3153  (
t
);

3154 
bp
 = 
cbuf
;

3155 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

3156 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

3158 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

3159 
bp
 +(
gp
->
ty
);

3161 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

3162 
bp
 +(
gp
->
tx
->
txnid
);

3164 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

3165 
bp
 +(
DB_LSN
);

3167 
	`memy
(&
ump
, 
bp
, (uinttmp));

3168 
gp
->
feid
 = (
t32_t
)
ump
;

3169 
bp
 +(
ump
);

3171 
	`memy
(&
ump
, 
bp
, (uinttmp));

3172 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

3173 
bp
 +(
ump
);

3175 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

3176 
bp
 +(
gp
->
l
);

3178 
	`memy
(&
ump
, 
bp
, (uinttmp));

3179 
gp
->
dx
 = (
u_t32_t
)
ump
;

3180 
bp
 +(
ump
);

3182 
	`memy
(&
ump
, 
bp
, (uinttmp));

3183 
gp
->
gno
 = (
db_pgno_t
)
ump
;

3184 
bp
 +(
ump
);

3186 
	`memy
(&
ump
, 
bp
, (uinttmp));

3187 
gp
->
gno
 = (
db_pgno_t
)
ump
;

3188 
bp
 +(
ump
);

3190 *
g
 = 
gp
;

3192 
	}
}

3199 
	$__bam__cov
(
dbv
, 
dbp
, 
dbsiz
)

3200 
DB_ENV
 *
dbv
;

3201 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

3202 
size_t
 *
dbsiz
;

3204 
t
;

3206 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3207 
__bam_l_cov
, 
DB___bam_l
)) != 0)

3208  (
t
);

3209 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3210 
__bam_rl_cov
, 
DB___bam_rl
)) != 0)

3211  (
t
);

3212 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3213 
__bam_adj_cov
, 
DB___bam_adj
)) != 0)

3214  (
t
);

3215 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3216 
__bam_dju_cov
, 
DB___bam_dju
)) != 0)

3217  (
t
);

3218 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3219 
__bam_cd_cov
, 
DB___bam_cd
)) != 0)

3220  (
t
);

3221 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3222 
__bam__cov
, 
DB___bam_
)) != 0)

3223  (
t
);

3224 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3225 
__bam_ro_cov
, 
DB___bam_ro
)) != 0)

3226  (
t
);

3227 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3228 
__bam_cudj_cov
, 
DB___bam_cudj
)) != 0)

3229  (
t
);

3230 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3231 
__bam_rcudj_cov
, 
DB___bam_rcudj
)) != 0)

3232  (
t
);

3233 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3234 
__bam_lk_cov
, 
DB___bam_lk
)) != 0)

3235  (
t
);

3236 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3237 
__bam_mge_cov
, 
DB___bam_mge
)) != 0)

3238  (
t
);

3239 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3240 
__bam_pgno_cov
, 
DB___bam_pgno
)) != 0)

3241  (
t
);

3243 
	}
}

	@../btree/btree_autop.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_dich.h
"

9 
	~"dbc/db_am.h
"

10 
	~"dbc/b.h
"

11 
	~"dbc/log.h
"

12 
	~"dbc/txn.h
"

19 
	$__bam_l_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

20 
DB_ENV
 *
dbv
;

21 
DBT
 *
db
;

22 
DB_LSN
 *
lp
;

23 
db_cs
 
nud2
;

24 *
nud3
;

26 
__bam_l_gs
 *
gp
;

27 
u_t32_t
 
i
;

28 
ch
;

29 
t
;

31 
nud2
 = 
DB_TXN_PRINT
;

32 
nud3
 = 
NULL
;

34 i((
t
 = 
	`__bam_l_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

35  (
t
);

36 ()
	`tf
(

38 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

39 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

40 (
u_lg
)
gp
->
ty
,

41 (
u_lg
)
gp
->
tx
->
txnid
,

42 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

43 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

44 ()
	`tf
("\e: %lu\n", (
u_lg
)
gp
->

);

45 ()
	`tf
("\tllsn: [%lu][%lu]\n",

46 (
u_lg
)
gp
->
΢
.
fe
, (u_lgrgp->΢.
offt
);

47 ()
	`tf
("\ight: %lu\n", (
u_lg
)
gp
->
right
);

48 ()
	`tf
("\trlsn: [%lu][%lu]\n",

49 (
u_lg
)
gp
->

.
fe
, (u_lgrgp->.
offt
);

50 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

51 ()
	`tf
("\pgno: %lu\n", (
u_lg
)
gp
->
gno
);

52 ()
	`tf
("\tnlsn: [%lu][%lu]\n",

53 (
u_lg
)
gp
->
Ƣ
.
fe
, (u_lgrgp->Ƣ.
offt
);

54 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
ro_pgno
);

55 ()
	`tf
("\tpg: ");

56 
i
 = 0; i < 
gp
->
pg
.
size
; i++) {

57 
ch
 = ((
u_t8_t
 *)
gp
->
pg
.
da
)[
i
];

58 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

60 ()
	`tf
("\n");

61 ()
	`tf
("\tags: %lu\n", (
u_lg
)
gp
->
ags
);

62 ()
	`tf
("\n");

63 
	`__os_
(
dbv
, 
gp
);

65 
	}
}

72 
	$__bam_rl_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

73 
DB_ENV
 *
dbv
;

74 
DBT
 *
db
;

75 
DB_LSN
 *
lp
;

76 
db_cs
 
nud2
;

77 *
nud3
;

79 
__bam_rl_gs
 *
gp
;

80 
u_t32_t
 
i
;

81 
ch
;

82 
t
;

84 
nud2
 = 
DB_TXN_PRINT
;

85 
nud3
 = 
NULL
;

87 i((
t
 = 
	`__bam_rl_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

88  (
t
);

89 ()
	`tf
(

91 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

92 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

93 (
u_lg
)
gp
->
ty
,

94 (
u_lg
)
gp
->
tx
->
txnid
,

95 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

96 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

97 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

98 ()
	`tf
("\tpgdbt: ");

99 
i
 = 0; i < 
gp
->
pgdbt
.
size
; i++) {

100 
ch
 = ((
u_t8_t
 *)
gp
->
pgdbt
.
da
)[
i
];

101 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

103 ()
	`tf
("\n");

104 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
ro_pgno
);

105 ()
	`tf
("\c: %lu\n", (
u_lg
)
gp
->
ec
);

106 ()
	`tf
("\trootent: ");

107 
i
 = 0; i < 
gp
->
roْt
.
size
; i++) {

108 
ch
 = ((
u_t8_t
 *)
gp
->
roْt
.
da
)[
i
];

109 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

111 ()
	`tf
("\n");

112 ()
	`tf
("\trootlsn: [%lu][%lu]\n",

113 (
u_lg
)
gp
->
rol
.
fe
, (u_lgrgp->rol.
offt
);

114 ()
	`tf
("\n");

115 
	`__os_
(
dbv
, 
gp
);

117 
	}
}

124 
	$__bam_adj_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

125 
DB_ENV
 *
dbv
;

126 
DBT
 *
db
;

127 
DB_LSN
 *
lp
;

128 
db_cs
 
nud2
;

129 *
nud3
;

131 
__bam_adj_gs
 *
gp
;

132 
t
;

134 
nud2
 = 
DB_TXN_PRINT
;

135 
nud3
 = 
NULL
;

137 i((
t
 = 
	`__bam_adj_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

138  (
t
);

139 ()
	`tf
(

141 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

142 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

143 (
u_lg
)
gp
->
ty
,

144 (
u_lg
)
gp
->
tx
->
txnid
,

145 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

146 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

147 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

148 ()
	`tf
("\tlsn: [%lu][%lu]\n",

149 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

150 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

151 ()
	`tf
("\tdx_cy: %lu\n", (
u_lg
)
gp
->
dx_cy
);

152 ()
	`tf
("\tis_: %lu\n", (
u_lg
)
gp
->
is_
);

153 ()
	`tf
("\n");

154 
	`__os_
(
dbv
, 
gp
);

156 
	}
}

163 
	$__bam_dju_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

164 
DB_ENV
 *
dbv
;

165 
DBT
 *
db
;

166 
DB_LSN
 *
lp
;

167 
db_cs
 
nud2
;

168 *
nud3
;

170 
__bam_dju_gs
 *
gp
;

171 
t
;

173 
nud2
 = 
DB_TXN_PRINT
;

174 
nud3
 = 
NULL
;

176 i((
t
 = 
	`__bam_dju_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

177  (
t
);

178 ()
	`tf
(

180 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

181 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

182 (
u_lg
)
gp
->
ty
,

183 (
u_lg
)
gp
->
tx
->
txnid
,

184 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

185 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

186 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

187 ()
	`tf
("\tlsn: [%lu][%lu]\n",

188 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

189 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

190 ()
	`tf
("\dju: %ld\n", ()
gp
->
adju
);

191 ()
	`tf
("\tags: %lu\n", (
u_lg
)
gp
->
ags
);

192 ()
	`tf
("\n");

193 
	`__os_
(
dbv
, 
gp
);

195 
	}
}

202 
	$__bam_cd_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

203 
DB_ENV
 *
dbv
;

204 
DBT
 *
db
;

205 
DB_LSN
 *
lp
;

206 
db_cs
 
nud2
;

207 *
nud3
;

209 
__bam_cd_gs
 *
gp
;

210 
t
;

212 
nud2
 = 
DB_TXN_PRINT
;

213 
nud3
 = 
NULL
;

215 i((
t
 = 
	`__bam_cd_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

216  (
t
);

217 ()
	`tf
(

219 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

220 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

221 (
u_lg
)
gp
->
ty
,

222 (
u_lg
)
gp
->
tx
->
txnid
,

223 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

224 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

225 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

226 ()
	`tf
("\tlsn: [%lu][%lu]\n",

227 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

228 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

229 ()
	`tf
("\n");

230 
	`__os_
(
dbv
, 
gp
);

232 
	}
}

239 
	$__bam__t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

240 
DB_ENV
 *
dbv
;

241 
DBT
 *
db
;

242 
DB_LSN
 *
lp
;

243 
db_cs
 
nud2
;

244 *
nud3
;

246 
__bam__gs
 *
gp
;

247 
u_t32_t
 
i
;

248 
ch
;

249 
t
;

251 
nud2
 = 
DB_TXN_PRINT
;

252 
nud3
 = 
NULL
;

254 i((
t
 = 
	`__bam__ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

255  (
t
);

256 ()
	`tf
(

258 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

259 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

260 (
u_lg
)
gp
->
ty
,

261 (
u_lg
)
gp
->
tx
->
txnid
,

262 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

263 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

264 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

265 ()
	`tf
("\tlsn: [%lu][%lu]\n",

266 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

267 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

268 ()
	`tf
("\tisded: %lu\n", (
u_lg
)
gp
->
isded
);

269 ()
	`tf
("\torig: ");

270 
i
 = 0; i < 
gp
->
ig
.
size
; i++) {

271 
ch
 = ((
u_t8_t
 *)
gp
->
ig
.
da
)[
i
];

272 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

274 ()
	`tf
("\n");

275 ()
	`tf
("\trepl: ");

276 
i
 = 0; i < 
gp
->

.
size
; i++) {

277 
ch
 = ((
u_t8_t
 *)
gp
->

.
da
)[
i
];

278 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

280 ()
	`tf
("\n");

281 ()
	`tf
("\fix: %lu\n", (
u_lg
)
gp
->
efix
);

282 ()
	`tf
("\tsuffix: %lu\n", (
u_lg
)
gp
->
suffix
);

283 ()
	`tf
("\n");

284 
	`__os_
(
dbv
, 
gp
);

286 
	}
}

293 
	$__bam_ro_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

294 
DB_ENV
 *
dbv
;

295 
DBT
 *
db
;

296 
DB_LSN
 *
lp
;

297 
db_cs
 
nud2
;

298 *
nud3
;

300 
__bam_ro_gs
 *
gp
;

301 
t
;

303 
nud2
 = 
DB_TXN_PRINT
;

304 
nud3
 = 
NULL
;

306 i((
t
 = 
	`__bam_ro_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

307  (
t
);

308 ()
	`tf
(

310 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

311 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

312 (
u_lg
)
gp
->
ty
,

313 (
u_lg
)
gp
->
tx
->
txnid
,

314 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

315 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

316 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

317 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
ro_pgno
);

318 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

319 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

320 ()
	`tf
("\n");

321 
	`__os_
(
dbv
, 
gp
);

323 
	}
}

330 
	$__bam_cudj_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

331 
DB_ENV
 *
dbv
;

332 
DBT
 *
db
;

333 
DB_LSN
 *
lp
;

334 
db_cs
 
nud2
;

335 *
nud3
;

337 
__bam_cudj_gs
 *
gp
;

338 
t
;

340 
nud2
 = 
DB_TXN_PRINT
;

341 
nud3
 = 
NULL
;

343 i((
t
 = 
	`__bam_cudj_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

344  (
t
);

345 ()
	`tf
(

347 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

348 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

349 (
u_lg
)
gp
->
ty
,

350 (
u_lg
)
gp
->
tx
->
txnid
,

351 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

352 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

353 ()
	`tf
("\tmode: %ld\n", ()
gp
->
mode
);

354 ()
	`tf
("\tom_pgno: %lu\n", (
u_lg
)
gp
->
om_pgno
);

355 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
to_pgno
);

356 ()
	`tf
("\e_pgno: %lu\n", (
u_lg
)
gp
->
_pgno
);

357 ()
	`tf
("\tf_dx: %lu\n", (
u_lg
)
gp
->
f_dx
);

358 ()
	`tf
("\tom_dx: %lu\n", (
u_lg
)
gp
->
om_dx
);

359 ()
	`tf
("\o_dx: %lu\n", (
u_lg
)
gp
->
to_dx
);

360 ()
	`tf
("\n");

361 
	`__os_
(
dbv
, 
gp
);

363 
	}
}

370 
	$__bam_rcudj_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

371 
DB_ENV
 *
dbv
;

372 
DBT
 *
db
;

373 
DB_LSN
 *
lp
;

374 
db_cs
 
nud2
;

375 *
nud3
;

377 
__bam_rcudj_gs
 *
gp
;

378 
t
;

380 
nud2
 = 
DB_TXN_PRINT
;

381 
nud3
 = 
NULL
;

383 i((
t
 = 
	`__bam_rcudj_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

384  (
t
);

385 ()
	`tf
(

387 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

388 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

389 (
u_lg
)
gp
->
ty
,

390 (
u_lg
)
gp
->
tx
->
txnid
,

391 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

392 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

393 ()
	`tf
("\tmode: %ld\n", ()
gp
->
mode
);

394 ()
	`tf
("\o: %ld\n", ()
gp
->
ro
);

395 ()
	`tf
("\eo: %ld\n", ()
gp
->
o
);

396 ()
	`tf
("\td: %lu\n", (
u_lg
)
gp
->
d
);

397 ()
	`tf
("\n");

398 
	`__os_
(
dbv
, 
gp
);

400 
	}
}

407 
	$__bam_lk_43_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

408 
DB_ENV
 *
dbv
;

409 
DBT
 *
db
;

410 
DB_LSN
 *
lp
;

411 
db_cs
 
nud2
;

412 *
nud3
;

414 
__bam_lk_43_gs
 *
gp
;

415 
t
;

417 
nud2
 = 
DB_TXN_PRINT
;

418 
nud3
 = 
NULL
;

420 i((
t
 = 
	`__bam_lk_43_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

421  (
t
);

422 ()
	`tf
(

424 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

425 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

426 (
u_lg
)
gp
->
ty
,

427 (
u_lg
)
gp
->
tx
->
txnid
,

428 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

429 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

430 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

431 ()
	`tf
("\tlsn: [%lu][%lu]\n",

432 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

433 ()
	`tf
("\v: %lu\n", (
u_lg
)
gp
->
ev
);

434 ()
	`tf
("\tlsn_prev: [%lu][%lu]\n",

435 (
u_lg
)
gp
->
l_ev
.
fe
, (u_lgrgp->l_ev.
offt
);

436 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

437 ()
	`tf
("\tlsn_next: [%lu][%lu]\n",

438 (
u_lg
)
gp
->
l_xt
.
fe
, (u_lgrgp->l_xt.
offt
);

439 ()
	`tf
("\n");

440 
	`__os_
(
dbv
, 
gp
);

442 
	}
}

449 
	$__bam_lk_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

450 
DB_ENV
 *
dbv
;

451 
DBT
 *
db
;

452 
DB_LSN
 *
lp
;

453 
db_cs
 
nud2
;

454 *
nud3
;

456 
__bam_lk_gs
 *
gp
;

457 
t
;

459 
nud2
 = 
DB_TXN_PRINT
;

460 
nud3
 = 
NULL
;

462 i((
t
 = 
	`__bam_lk_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

463  (
t
);

464 ()
	`tf
(

466 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

467 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

468 (
u_lg
)
gp
->
ty
,

469 (
u_lg
)
gp
->
tx
->
txnid
,

470 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

471 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

472 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

473 ()
	`tf
("\ew_pgno: %lu\n", (
u_lg
)
gp
->
w_pgno
);

474 ()
	`tf
("\v: %lu\n", (
u_lg
)
gp
->
ev
);

475 ()
	`tf
("\tlsn_prev: [%lu][%lu]\n",

476 (
u_lg
)
gp
->
l_ev
.
fe
, (u_lgrgp->l_ev.
offt
);

477 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

478 ()
	`tf
("\tlsn_next: [%lu][%lu]\n",

479 (
u_lg
)
gp
->
l_xt
.
fe
, (u_lgrgp->l_xt.
offt
);

480 ()
	`tf
("\n");

481 
	`__os_
(
dbv
, 
gp
);

483 
	}
}

490 
	$__bam_mge_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

491 
DB_ENV
 *
dbv
;

492 
DBT
 *
db
;

493 
DB_LSN
 *
lp
;

494 
db_cs
 
nud2
;

495 *
nud3
;

497 
__bam_mge_gs
 *
gp
;

498 
u_t32_t
 
i
;

499 
ch
;

500 
t
;

502 
nud2
 = 
DB_TXN_PRINT
;

503 
nud3
 = 
NULL
;

505 i((
t
 = 
	`__bam_mge_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

506  (
t
);

507 ()
	`tf
(

509 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

510 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

511 (
u_lg
)
gp
->
ty
,

512 (
u_lg
)
gp
->
tx
->
txnid
,

513 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

514 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

515 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

516 ()
	`tf
("\tlsn: [%lu][%lu]\n",

517 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

518 ()
	`tf
("\pgno: %lu\n", (
u_lg
)
gp
->
gno
);

519 ()
	`tf
("\tnlsn: [%lu][%lu]\n",

520 (
u_lg
)
gp
->
Ƣ
.
fe
, (u_lgrgp->Ƣ.
offt
);

521 ()
	`tf
("\thdr: ");

522 
i
 = 0; i < 
gp
->
hdr
.
size
; i++) {

523 
ch
 = ((
u_t8_t
 *)
gp
->
hdr
.
da
)[
i
];

524 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

526 ()
	`tf
("\n");

527 ()
	`tf
("\tdata: ");

528 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

529 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

530 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

532 ()
	`tf
("\n");

533 ()
	`tf
("\tind: ");

534 
i
 = 0; i < 
gp
->
d
.
size
; i++) {

535 
ch
 = ((
u_t8_t
 *)
gp
->
d
.
da
)[
i
];

536 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

538 ()
	`tf
("\n");

539 ()
	`tf
("\n");

540 
	`__os_
(
dbv
, 
gp
);

542 
	}
}

549 
	$__bam_pgno_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

550 
DB_ENV
 *
dbv
;

551 
DBT
 *
db
;

552 
DB_LSN
 *
lp
;

553 
db_cs
 
nud2
;

554 *
nud3
;

556 
__bam_pgno_gs
 *
gp
;

557 
t
;

559 
nud2
 = 
DB_TXN_PRINT
;

560 
nud3
 = 
NULL
;

562 i((
t
 = 
	`__bam_pgno_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

563  (
t
);

564 ()
	`tf
(

566 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

567 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

568 (
u_lg
)
gp
->
ty
,

569 (
u_lg
)
gp
->
tx
->
txnid
,

570 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

571 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

572 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

573 ()
	`tf
("\tlsn: [%lu][%lu]\n",

574 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

575 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

576 ()
	`tf
("\tgno: %lu\n", (
u_lg
)
gp
->
gno
);

577 ()
	`tf
("\pgno: %lu\n", (
u_lg
)
gp
->
gno
);

578 ()
	`tf
("\n");

579 
	`__os_
(
dbv
, 
gp
);

581 
	}
}

588 
	$__bam__t
(
dbv
, 
dbp
, 
dbsiz
)

589 
DB_ENV
 *
dbv
;

590 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

591 
size_t
 *
dbsiz
;

593 
t
;

595 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

596 
__bam_l_t
, 
DB___bam_l
)) != 0)

597  (
t
);

598 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

599 
__bam_rl_t
, 
DB___bam_rl
)) != 0)

600  (
t
);

601 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

602 
__bam_adj_t
, 
DB___bam_adj
)) != 0)

603  (
t
);

604 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

605 
__bam_dju_t
, 
DB___bam_dju
)) != 0)

606  (
t
);

607 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

608 
__bam_cd_t
, 
DB___bam_cd
)) != 0)

609  (
t
);

610 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

611 
__bam__t
, 
DB___bam_
)) != 0)

612  (
t
);

613 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

614 
__bam_ro_t
, 
DB___bam_ro
)) != 0)

615  (
t
);

616 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

617 
__bam_cudj_t
, 
DB___bam_cudj
)) != 0)

618  (
t
);

619 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

620 
__bam_rcudj_t
, 
DB___bam_rcudj
)) != 0)

621  (
t
);

622 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

623 
__bam_lk_t
, 
DB___bam_lk
)) != 0)

624  (
t
);

625 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

626 
__bam_mge_t
, 
DB___bam_mge
)) != 0)

627  (
t
);

628 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

629 
__bam_pgno_t
, 
DB___bam_pgno
)) != 0)

630  (
t
);

632 
	}
}

	@../build_vxworks/db_archive/db_archive.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 
db_chive_ma
 
__P
((, *[]));

19 
db_chive_uge
 
__P
(());

20 
db_chive_vsi_check
 
__P
(());

22 cڡ *
	gogme
;

25 
	$db_chive
(
gs
)

26 *
gs
;

28 
gc
;

29 **
gv
;

31 
	`__db_ut_g
("db_chive", 
gs
, &
gc
, &
gv
);

32  (
	`db_chive_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

33 
	}
}

35 
	~<dio.h
>

36 
	#ERROR_RETURN
 
ERROR


	)

39 
	$db_chive_ma
(
gc
, 
gv
)

40 
gc
;

41 *
gv
[];

43 
*
ݏrg
;

44 

td
, 
__db_gt_t
;

45 
DB_ENV
 *
dbv
;

46 
u_t32_t
 
ags
;

47 
ch
, 
exv
, 
t
, 
vbo
;

48 **
fe
, *
home
, **
li
, *
sswd
;

50 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

51 
ogme
 = 
gv
[0];

53 ++
ogme
;

55 i((
t
 = 
	`db_chive_vsi_check
()) != 0)

56  (
t
);

58 
dbv
 = 
NULL
;

59 
ags
 = 0;

60 
exv
 = 
vbo
 = 0;

61 
home
 = 
sswd
 = 
NULL
;

62 
fe
 = 
li
 = 
NULL
;

63 
__db_gt_t
 = 1;

64 (
ch
 = 
	`gt
(
gc
, 
gv
, "adh:lP:sVv")!
EOF
)

65 
ch
) {

67 
	`LF_SET
(
DB_ARCH_ABS
);

70 
	`LF_SET
(
DB_ARCH_REMOVE
);

73 
home
 = 
ݏrg
;

76 
	`LF_SET
(
DB_ARCH_LOG
);

79 
sswd
 = 
	`rdup
(
ݏrg
);

80 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

81 i(
sswd
 =
NULL
) {

82 
	`rtf
(
dr
, "%s: strdup: %s\n",

83 
ogme
, 
	`
(
o
));

84  (
EXIT_FAILURE
);

88 
	`LF_SET
(
DB_ARCH_DATA
);

91 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

92  (
EXIT_SUCCESS
);

100 
vbo
 = 1;

104  (
	`db_chive_uge
());

106 
gc
 -
td
;

107 
gv
 +
td
;

109 i(
gc
 != 0)

110  (
	`db_chive_uge
());

113 
	`__db_ut_sig
();

119 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

120 
	`rtf
(
dr
,

121 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

122 
shutdown
;

125 
dbv
->
	`t_rfe
(dbv, 
dr
);

126 
dbv
->
	`t_fx
(dbv, 
ogme
);

128 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

129 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

130 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

131 
shutdown
;

137 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

138 (
t
 =
DB_VERSION_MISMATCH
 ||

139 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_CREATE
 |

140 
DB_INIT_LOG
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0)) != 0)) {

141 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

142 
shutdown
;

146 i((
t
 = 
dbv
->
	`log_chive
(dbv, &
li
, 
ags
)) != 0) {

147 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_archive");

148 
shutdown
;

152 i(
li
 !
NULL
) {

153 
fe
 = 
li
; *f!
NULL
; ++file)

154 
	`tf
("%s\n", *
fe
);

155 
	`
(
li
);

159 
shutdown
: 
exv
 = 1;

161 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

162 
exv
 = 1;

163 
	`rtf
(
dr
,

164 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

167 i(
sswd
 !
NULL
)

168 
	`
(
sswd
);

171 
	`__db_ut_signd
();

173  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

174 
	}
}

177 
	$db_chive_uge
()

179 ()
	`rtf
(
dr
,

180 "uge: %[-adlsVv] [-h home] [-Passwd]\n", 
ogme
);

181  (
EXIT_FAILURE
);

182 
	}
}

185 
	$db_chive_vsi_check
()

187 
v_maj
, 
v_m
, 
v_tch
;

190 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

191 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

192 
	`rtf
(
dr
,

194 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

195 
v_maj
, 
v_m
);

196  (
EXIT_FAILURE
);

199 
	}
}

	@../build_vxworks/db_checkpoint/db_checkpoint.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 
db_checkpot_ma
 
__P
((, *[]));

19 
db_checkpot_uge
 
__P
(());

20 
db_checkpot_vsi_check
 
__P
(());

22 cڡ *
	gogme
;

25 
	$db_checkpot
(
gs
)

26 *
gs
;

28 
gc
;

29 **
gv
;

31 
	`__db_ut_g
("db_checkpot", 
gs
, &
gc
, &
gv
);

32  (
	`db_checkpot_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

33 
	}
}

35 
	~<dio.h
>

36 
	#ERROR_RETURN
 
ERROR


	)

39 
	$db_checkpot_ma
(
gc
, 
gv
)

40 
gc
;

41 *
gv
[];

43 
*
ݏrg
;

44 

td
, 
__db_gt_t
;

45 
DB_ENV
 *
dbv
;

46 
time_t
 
now
;

47 
gv
;

48 
u_t32_t
 
ags
, 
kbys
, 
mus
, 
cds
;

49 
ch
, 
exv
, 

, 
t
, 
vbo
;

50 *
home
, *
logfe
, *
sswd
, 
time_buf
[
CTIME_BUFLEN
];

52 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

53 
ogme
 = 
gv
[0];

55 ++
ogme
;

57 i((
t
 = 
	`db_checkpot_vsi_check
()) != 0)

58  (
t
);

65 
	#MAX_UINT32_T
 2147483647

	)

67 
dbv
 = 
NULL
;

68 
kbys
 = 
mus
 = 0;

69 
exv
 = 

 = 
vbo
 = 0;

70 
ags
 = 0;

71 
home
 = 
logfe
 = 
sswd
 = 
NULL
;

72 
__db_gt_t
 = 1;

73 (
ch
 = 
	`gt
(
gc
, 
gv
, "1h:k:L:P:p:Vv")!
EOF
)

74 
ch
) {

76 

 = 1;

77 
ags
 = 
DB_FORCE
;

80 
home
 = 
ݏrg
;

83 i(
	`__db_glg
(
NULL
, 
ogme
,

84 
ݏrg
, 1, ()
MAX_UINT32_T
, &
gv
))

85  (
EXIT_FAILURE
);

86 
kbys
 = (
u_t32_t
)
gv
;

89 
logfe
 = 
ݏrg
;

92 
sswd
 = 
	`rdup
(
ݏrg
);

93 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

94 i(
sswd
 =
NULL
) {

95 
	`rtf
(
dr
, "%s: strdup: %s\n",

96 
ogme
, 
	`
(
o
));

97  (
EXIT_FAILURE
);

101 i(
	`__db_glg
(
NULL
, 
ogme
,

102 
ݏrg
, 1, ()
MAX_UINT32_T
, &
gv
))

103  (
EXIT_FAILURE
);

104 
mus
 = (
u_t32_t
)
gv
;

107 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

108  (
EXIT_SUCCESS
);

110 
vbo
 = 1;

114  (
	`db_checkpot_uge
());

116 
gc
 -
td
;

117 
gv
 +
td
;

119 i(
gc
 != 0)

120  (
	`db_checkpot_uge
());

122 i(

 =0 && 
kbys
 =0 && 
mus
 == 0) {

123 ()
	`rtf
(
dr
,

125 
ogme
);

126  (
	`db_checkpot_uge
());

130 
	`__db_ut_sig
();

133 i(
logfe
 !
NULL
 && 
	`__db_ut_logt
(
ogme
,ogfile))

134 
shutdown
;

140 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

141 
	`rtf
(
dr
,

142 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

143 
shutdown
;

146 
dbv
->
	`t_rfe
(dbv, 
dr
);

147 
dbv
->
	`t_fx
(dbv, 
ogme
);

149 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

150 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

151 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

152 
shutdown
;

159 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

160 (!

 || 
t
 =
DB_VERSION_MISMATCH
 ||

161 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

162 
DB_CREATE
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0)) != 0)) {

163 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

164 
shutdown
;

172 
cds
 = 
kbys
 !0 ? 30 : 
mus
 * 60;

173 !
	`__db_ut_ued
()) {

174 i(
vbo
) {

175 ()
	`time
(&
now
);

176 
dbv
->
	`rx
(dbenv,

177 "checkpobeg: %s", 
	`__db_ime
(&
now
, 
time_buf
));

180 i((
t
 = 
dbv
->
	`txn_checkpot
(dbenv,

181 
kbys
, 
mus
, 
ags
)) != 0) {

182 
dbv
->
	`r
(dbv, 
t
, "txn_checkpoint");

183 
shutdown
;

186 i(
vbo
) {

187 ()
	`time
(&
now
);

188 
dbv
->
	`rx
(dbenv,

189 "checkpocome: %s", 
	`__db_ime
(&
now
, 
time_buf
));

192 i(

)

195 
	`__os_p
(
dbv
, 
cds
, 0);

199 
shutdown
: 
exv
 = 1;

203 i(
logfe
 !
NULL
)

204 ()
	`move
(
logfe
);

207 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

208 
exv
 = 1;

209 
	`rtf
(
dr
,

210 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

213 i(
sswd
 !
NULL
)

214 
	`
(
sswd
);

217 
	`__db_ut_signd
();

219  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

220 
	}
}

223 
	$db_checkpot_uge
()

225 ()
	`rtf
(
dr
, "uge: %[-1Vv]\n\t%s\n", 
ogme
,

227  (
EXIT_FAILURE
);

228 
	}
}

231 
	$db_checkpot_vsi_check
()

233 
v_maj
, 
v_m
, 
v_tch
;

236 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

237 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

238 
	`rtf
(
dr
,

240 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

241 
v_maj
, 
v_m
);

242  (
EXIT_FAILURE
);

245 
	}
}

	@../build_vxworks/db_deadlock/db_deadlock.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 
db_ddlock_ma
 
__P
((, *[]));

19 
db_ddlock_uge
 
__P
(());

20 
db_ddlock_vsi_check
 
__P
(());

22 cڡ *
	gogme
;

25 
	$db_ddlock
(
gs
)

26 *
gs
;

28 
gc
;

29 **
gv
;

31 
	`__db_ut_g
("db_ddlock", 
gs
, &
gc
, &
gv
);

32  (
	`db_ddlock_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

33 
	}
}

35 
	~<dio.h
>

36 
	#ERROR_RETURN
 
ERROR


	)

39 
	$db_ddlock_ma
(
gc
, 
gv
)

40 
gc
;

41 *
gv
[];

43 
*
ݏrg
;

44 

td
, 
__db_gt_t
;

45 
DB_ENV
 *
dbv
;

46 
u_t32_t
 
y
;

47 
time_t
 
now
;

48 
u_lg
 
cs
, 
ucs
;

49 
jeed
, 
ch
, 
exv
, 
t
, 
vbo
;

50 *
home
, *
logfe
, *
sswd
, *
r
, 
time_buf
[
CTIME_BUFLEN
];

52 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

53 
ogme
 = 
gv
[0];

55 ++
ogme
;

57 i((
t
 = 
	`db_ddlock_vsi_check
()) != 0)

58  (
t
);

60 
dbv
 = 
NULL
;

61 
y
 = 
DB_LOCK_DEFAULT
;

62 
home
 = 
logfe
 = 
sswd
 = 
NULL
;

63 
cs
 = 
ucs
 = 0;

64 
exv
 = 
vbo
 = 0;

65 
__db_gt_t
 = 1;

66 (
ch
 = 
	`gt
(
gc
, 
gv
, "a:h:L:P:t:Vv")!
EOF
)

67 
ch
) {

69 
ݏrg
[0]) {

71 
y
 = 
DB_LOCK_EXPIRE
;

74 
y
 = 
DB_LOCK_MAXLOCKS
;

77 
y
 = 
DB_LOCK_MINLOCKS
;

80 
y
 = 
DB_LOCK_OLDEST
;

83 
y
 = 
DB_LOCK_MAXWRITE
;

86 
y
 = 
DB_LOCK_MINWRITE
;

89 
y
 = 
DB_LOCK_YOUNGEST
;

92  (
	`db_ddlock_uge
());

95 i(
ݏrg
[1] != '\0')

96  (
	`db_ddlock_uge
());

99 
home
 = 
ݏrg
;

102 
logfe
 = 
ݏrg
;

105 
sswd
 = 
	`rdup
(
ݏrg
);

106 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

107 i(
sswd
 =
NULL
) {

108 
	`rtf
(
dr
, "%s: strdup: %s\n",

109 
ogme
, 
	`
(
o
));

110  (
EXIT_FAILURE
);

114 i((
r
 = 
	`rchr
(
ݏrg
, '.')!
NULL
) {

115 *
r
++ = '\0';

116 i(*
r
 !'\0' && 
	`__db_gulg
(

117 
NULL
, 
ogme
, 
r
, 0, 
LONG_MAX
, &
ucs
))

118  (
EXIT_FAILURE
);

120 i(*
ݏrg
 !'\0' && 
	`__db_gulg
(

121 
NULL
, 
ogme
, 
ݏrg
, 0, 
LONG_MAX
, &
cs
))

122  (
EXIT_FAILURE
);

123 i(
cs
 =0 && 
ucs
 == 0)

124  (
	`db_ddlock_uge
());

128 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

129  (
EXIT_SUCCESS
);

131 
vbo
 = 1;

135  (
	`db_ddlock_uge
());

137 
gc
 -
td
;

138 
gv
 +
td
;

140 i(
gc
 != 0)

141  (
	`db_ddlock_uge
());

144 
	`__db_ut_sig
();

147 i(
logfe
 !
NULL
 && 
	`__db_ut_logt
(
ogme
,ogfile))

148 
shutdown
;

154 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

155 
	`rtf
(
dr
,

156 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

157 
shutdown
;

160 
dbv
->
	`t_rfe
(dbv, 
dr
);

161 
dbv
->
	`t_fx
(dbv, 
ogme
);

163 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

164 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

165 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

166 
shutdown
;

169 i(
vbo
) {

170 ()
dbv
->
	`t_vbo
(dbv, 
DB_VERB_DEADLOCK
, 1);

171 ()
dbv
->
	`t_vbo
(dbv, 
DB_VERB_WAITSFOR
, 1);

175 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0) {

176 
dbv
->
	`r
(dbv, 
t
, "open");

177 
shutdown
;

180 !
	`__db_ut_ued
()) {

181 i(
vbo
) {

182 ()
	`time
(&
now
);

183 
dbv
->
	`rx
(dbenv,

184 "rušg%.24s", 
	`__db_ime
(&
now
, 
time_buf
));

187 i((
t
 =

188 
dbv
->
	`lock_de
(dbv, 0, 
y
, &
jeed
)) != 0) {

189 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->lock_detect");

190 
shutdown
;

192 i(
vbo
)

193 
dbv
->
	`rx
(dbv, "jeed %docks", 
jeed
);

196 i(
cs
 =0 && 
ucs
 == 0)

198 
	`__os_p
(
dbv
, 
cs
, 
ucs
);

202 
shutdown
: 
exv
 = 1;

206 i(
logfe
 !
NULL
)

207 ()
	`move
(
logfe
);

210 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

211 
exv
 = 1;

212 
	`rtf
(
dr
,

213 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

216 i(
sswd
 !
NULL
)

217 
	`
(
sswd
);

220 
	`__db_ut_signd
();

222  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

223 
	}
}

226 
	$db_ddlock_uge
()

228 ()
	`rtf
(
dr
,

229 "uge: %[-Vv] [-| m | | o | W | w | y]\n\t%s\n", 
ogme
,

231  (
EXIT_FAILURE
);

232 
	}
}

235 
	$db_ddlock_vsi_check
()

237 
v_maj
, 
v_m
, 
v_tch
;

240 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

241 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

242 
	`rtf
(
dr
,

244 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

245 
v_maj
, 
v_m
);

246  (
EXIT_FAILURE
);

249 
	}
}

	@../build_vxworks/db_dump/db_dump.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_am.h
"

15 #ide
lt


16 cڡ 
	gcyright
[] =

20 
db_dump_db_
 
__P
((
DB_ENV
 *, *, , 
u_t32_t
, *));

21 
db_dump_dump_sub
 
__P
((
DB_ENV
 *, 
DB
 *, *, , ));

22 
db_dump_ma
 
__P
((, *[]));

23 
db_dump_show_subs
 
__P
((
DB
 *));

24 
db_dump_uge
 
__P
(());

25 
db_dump_vsi_check
 
__P
(());

27 cڡ *
	gogme
;

30 
	$db_dump
(
gs
)

31 *
gs
;

33 
gc
;

34 **
gv
;

36 
	`__db_ut_g
("db_dump", 
gs
, &
gc
, &
gv
);

37  (
	`db_dump_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

38 
	}
}

40 
	~<dio.h
>

41 
	#ERROR_RETURN
 
ERROR


	)

44 
	$db_dump_ma
(
gc
, 
gv
)

45 
gc
;

46 *
gv
[];

48 
*
ݏrg
;

49 

td
, 
__db_gt_t
;

50 
DB_ENV
 *
dbv
;

51 
DB
 *
dbp
;

52 
u_t32_t
 
che
;

53 
ch
;

54 
exv
, 
keyag
, 
lag
, 
nag
, 
pag
, 
ive
;

55 
t
, 
Rag
, 
rag
, 
size
;

56 *
dt
, *
home
, *
sswd
, *
subme
;

58 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

59 
ogme
 = 
gv
[0];

61 ++
ogme
;

63 i((
t
 = 
	`db_dump_vsi_check
()) != 0)

64  (
t
);

66 
dbv
 = 
NULL
;

67 
dbp
 = 
NULL
;

68 
exv
 = 
lag
 = 
nag
 = 
pag
 = 
rag
 = 
Rag
 = 0;

69 
keyag
 = 0;

70 
che
 = 
MEGABYTE
;

71 
ive
 = 0;

72 
dt
 = 
home
 = 
sswd
 = 
subme
 = 
NULL
;

73 
__db_gt_t
 = 1;

74 (
ch
 = 
	`gt
(
gc
, 
gv
, "d:f:h:klNpP:rRs:V")!
EOF
)

75 
ch
) {

77 
dt
 = 
ݏrg
;

80 i(
	`eݒ
(
ݏrg
, "w", 
dout
=
NULL
) {

81 
	`rtf
(
dr
, "%s: %s:eopen: %s\n",

82 
ogme
, 
ݏrg
, 
	`
(
o
));

83  (
EXIT_FAILURE
);

87 
home
 = 
ݏrg
;

90 
keyag
 = 1;

93 
lag
 = 1;

96 
nag
 = 1;

99 
sswd
 = 
	`rdup
(
ݏrg
);

100 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

101 i(
sswd
 =
NULL
) {

102 
	`rtf
(
dr
, "%s: strdup: %s\n",

103 
ogme
, 
	`
(
o
));

104  (
EXIT_FAILURE
);

108 
pag
 = 1;

111 
subme
 = 
ݏrg
;

114 
Rag
 = 1;

118 
rag
 = 1;

121 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

122  (
EXIT_SUCCESS
);

125  (
	`db_dump_uge
());

127 
gc
 -
td
;

128 
gv
 +
td
;

130 i(
gc
 != 1)

131  (
	`db_dump_uge
());

133 i(
dt
 !
NULL
 && 
pag
) {

134 
	`rtf
(
dr
,

136 
ogme
);

137  (
EXIT_FAILURE
);

139 i(
lag
 && 
subme
 !
NULL
) {

140 
	`rtf
(
dr
,

142 
ogme
);

143  (
EXIT_FAILURE
);

146 i(
keyag
 && 
rag
) {

147 
	`rtf
(
dr
, "%s: %s",

149 
ogme
);

150  (
EXIT_FAILURE
);

153 i(
subme
 !
NULL
 && 
rag
) {

154 
	`rtf
(
dr
, "%s: %s",

156 
ogme
);

157  (
EXIT_FAILURE
);

161 
	`__db_ut_sig
();

167 
y
: i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

168 
	`rtf
(
dr
,

169 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

170 
r
;

173 
dbv
->
	`t_rfe
(dbv, 
dr
);

174 
dbv
->
	`t_fx
(dbv, 
ogme
);

175 i(
nag
) {

176 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOLOCKING
, 1)) != 0) {

177 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOLOCKING");

178 
r
;

180 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOPANIC
, 1)) != 0) {

181 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOPANIC");

182 
r
;

185 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

186 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

187 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

188 
r
;

192 i(
	`db_dump_db_
(
dbv
, 
home
, 
rag
, 
che
, &
ive
) != 0)

193 
r
;

196 i((
t
 = 
	`db_
(&
dbp
, 
dbv
, 0)) != 0) {

197 
dbv
->
	`r
(dbv, 
t
, "db_create");

198 
r
;

205 i(
rag
) {

207 
t
 = 
dbp
->
	`vify
(dbp, 
gv
[0], 
NULL
, 
dout
,

208 
DB_SALVAGE
 |

209 (
Rag
 ? 
DB_AGGRESSIVE
 : 0) |

210 (
pag
 ? 
DB_PRINTABLE
 : 0));

211 
dbp
 = 
NULL
;

212 i(
t
 != 0)

213 
r
;

214 
de
;

217 i((
t
 = 
dbp
->
	`ݒ
(dbp, 
NULL
,

218 
gv
[0], 
subme
, 
DB_UNKNOWN
, 
DB_RDONLY
, 0)) != 0) {

219 
dbp
->
	`r
(dbp, 
t
, "ݒ: %s", 
gv
[0]);

220 
r
;

222 i(
ive
 != 0) {

223 i((
t
 = 
	`__db_ut_che
(
dbp
, &
che
, &
size
)) != 0)

224 
r
;

225 i(
size
) {

226 ()
dbp
->
	`o
(dbp, 0);

227 
dbp
 = 
NULL
;

229 ()
dbv
->
	`o
(dbenv, 0);

230 
dbv
 = 
NULL
;

231 
y
;

235 i(
dt
 !
NULL
) {

236 i((
t
 = 
	`__db_dume
(
dbp
, 
NULL
, 
dt
, NULL)) != 0) {

237 
dbp
->
	`r
(dbp, 
t
, "__db_dume: %s", 
gv
[0]);

238 
r
;

240 } i(
lag
) {

241 i(
dbp
->
	`g_muɝ
(dbp)) {

242 i(
	`db_dump_show_subs
(
dbp
))

243 
r
;

245 
dbp
->
	`rx
(dbp,

246 "%s: d۠n cڏ muɝ dabas", 
gv
[0]);

247 
r
;

250 i(
subme
 =
NULL
 && 
dbp
->
	`g_muɝ
(dbp)) {

251 i(
	`db_dump_dump_sub
(
dbv
, 
dbp
, 
gv
[0], 
pag
, 
keyag
))

252 
r
;

254 i(
dbp
->
	`dump
(dbp, 
NULL
,

255 
__db__back
, 
dout
, 
pag
, 
keyag
))

256 
r
;

260 
r
: 
exv
 = 1;

262 
de
: i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 0)) != 0) {

263 
exv
 = 1;

264 
dbv
->
	`r
(dbv, 
t
, "close");

266 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

267 
exv
 = 1;

268 
	`rtf
(
dr
,

269 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

272 i(
sswd
 !
NULL
)

273 
	`
(
sswd
);

276 
	`__db_ut_signd
();

278  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

279 
	}
}

286 
	$db_dump_db_
(
dbv
, 
home
, 
is_lvage
, 
che
, 
is_iv
)

287 
DB_ENV
 *
dbv
;

288 *
home
;

289 
is_lvage
;

290 
u_t32_t
 
che
;

291 *
is_iv
;

293 
t
;

313 *
is_iv
 = 0;

314 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

315 
DB_USE_ENVIRON
 | (
is_lvage
 ? 
DB_INIT_MPOOL
 : 0), 0)) == 0)

317 i(
t
 =
DB_VERSION_MISMATCH
)

318 
r
;

330 *
is_iv
 = 1;

331 i((
t
 = 
dbv
->
	`t_chesize
(dbv, 0, 
che
, 1)) == 0 &&

332 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

333 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0)) == 0)

337 
r
: 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

339 
	}
}

346 
	$db_dump_dump_sub
(
dbv
, 
_dbp
, 
_me
, 
pag
, 
keyag
)

347 
DB_ENV
 *
dbv
;

348 
DB
 *
_dbp
;

349 *
_me
;

350 
pag
, 
keyag
;

352 
DB
 *
dbp
;

353 
DBC
 *
db
;

354 
DBT
 
key
, 
da
;

355 
t
;

356 *
subdb
;

362 i((
t
 = 
_dbp
->
	`curs
լt_dbp, 
NULL
, &
db
, 0)) != 0) {

363 
dbv
->
	`r
(dbv, 
t
, "DB->cursor");

367 
	`memt
(&
key
, 0, (key));

368 
	`memt
(&
da
, 0, (data));

369 (
t
 = 
db
->
	`g
(db, &
key
, &
da
,

370 
DB_IGNORE_LEASE
 | 
DB_NEXT
)) == 0) {

372 i((
subdb
 = 
	`mloc
(
key
.
size
 + 1)=
NULL
) {

373 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

376 
	`memy
(
subdb
, 
key
.
da
, key.
size
);

377 
subdb
[
key
.
size
] = '\0';

380 i((
t
 = 
	`db_
(&
dbp
, 
dbv
, 0)) != 0) {

381 
dbv
->
	`r
(dbv, 
t
, "db_create");

382 
	`
(
subdb
);

385 i((
t
 = 
dbp
->
	`ݒ
(dbp, 
NULL
,

386 
_me
, 
subdb
, 
DB_UNKNOWN
, 
DB_RDONLY
, 0)) != 0)

387 
dbp
->
	`r
(dbp, 
t
,

388 "DB->ݒ: %s:%s", 
_me
, 
subdb
);

389 i(
t
 =0 && 
dbp
->
	`dump
(

390 
dbp
, 
subdb
, 
__db__back
, 
dout
, 
pag
, 
keyag
))

391 
t
 = 1;

392 ()
dbp
->
	`o
(dbp, 0);

393 
	`
(
subdb
);

394 i(
t
 != 0)

397 i(
t
 !
DB_NOTFOUND
) {

398 
_dbp
->
	`r
լt_dbp, 
t
, "DBcursor->get");

402 i((
t
 = 
db
->
	`o
(dbcp)) != 0) {

403 
_dbp
->
	`r
լt_dbp, 
t
, "DBcursor->close");

408 
	}
}

415 
	$db_dump_show_subs
(
dbp
)

416 
DB
 *
dbp
;

418 
DBC
 *
db
;

419 
DBT
 
key
, 
da
;

420 
t
;

426 i((
t
 = 
dbp
->
	`curs
(dbp, 
NULL
, &
db
, 0)) != 0) {

427 
dbp
->
	`r
(dbp, 
t
, "DB->cursor");

431 
	`memt
(&
key
, 0, (key));

432 
	`memt
(&
da
, 0, (data));

433 (
t
 = 
db
->
	`g
(db, &
key
, &
da
,

434 
DB_IGNORE_LEASE
 | 
DB_NEXT
)) == 0) {

435 i((
t
 = 
dbp
->
dbv
->
	`dbt
(

436 &
key
, 1, 
NULL
, 
dout
, 
__db__back
, 0)) != 0) {

437 
dbp
->
	`rx
(dbp, 
NULL
);

441 i(
t
 !
DB_NOTFOUND
) {

442 
dbp
->
	`r
(dbp, 
t
, "DBcursor->get");

446 i((
t
 = 
db
->
	`o
(dbcp)) != 0) {

447 
dbp
->
	`r
(dbp, 
t
, "DBcursor->close");

451 
	}
}

458 
	$db_dump_uge
()

460 ()
	`rtf
(
dr
, "usage: %s [-klNprRV]\n\t%s\n",

461 
ogme
,

463  (
EXIT_FAILURE
);

464 
	}
}

467 
	$db_dump_vsi_check
()

469 
v_maj
, 
v_m
, 
v_tch
;

472 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

473 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

474 
	`rtf
(
dr
,

476 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

477 
v_maj
, 
v_m
);

478  (
EXIT_FAILURE
);

481 
	}
}

	@../build_vxworks/db_hotbackup/db_hotbackup.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/log.h
"

13 
	~"dbc/db_ge.h
"

14 
	~"dbc/qam.h
"

16 #ide
lt


17 cڡ 
	gcyright
[] =

21 
	ewhich_ݒ
 { 
	mOPEN_ORIGINAL
, 
	mOPEN_HOT_BACKUP
 };

23 
db_hbackup_backup_d_n
 
__P
((
DB_ENV
 *, *, *, *, , ));

24 
db_hbackup_da_cy
 
__P
((
DB_ENV
 *, *, *, *, ));

25 
db_hbackup_v_
 
__P
((
DB_ENV
 **,

26 *, **, ***, *, 
which_ݒ
));

27 
db_hbackup_ma
 
__P
((, *[]));

28 
db_hbackup_ad_da_d
 
__P
((
DB_ENV
 *, *, *, *, , ));

29 
db_hbackup_ad_log_d
 
__P
((
DB_ENV
 *, *, *, *, *, , ));

30 
db_hbackup_uge
 
__P
(());

31 
db_hbackup_vsi_check
 
__P
(());

33 cڡ *
	gogme
;

36 
	$db_hbackup
(
gs
)

37 *
gs
;

39 
gc
;

40 **
gv
;

42 
	`__db_ut_g
("db_hbackup", 
gs
, &
gc
, &
gv
);

43  (
	`db_hbackup_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

44 
	}
}

46 
	~<dio.h
>

47 
	#ERROR_RETURN
 
ERROR


	)

50 
	$db_hbackup_ma
(
gc
, 
gv
)

51 
gc
;

52 *
gv
[];

54 
*
ݏrg
;

55 

td
, 
__db_gt_t
;

56 
time_t
 
now
;

57 
DB_ENV
 *
dbv
;

58 
u_t
 
da_t
, 
da_xt
;

59 
ch
, 
checkpot
, 
cy_m
, 
db_cfig
, 
exv
;

60 
move_max
, 
t
, 
upde
, 
vbo
;

61 *
backup_d
, **
da_d
, **
d
, *
home
, *
log_d
, *
sswd
;

62 
home_buf
[
DB_MAXPATHLEN
], 
time_buf
[
CTIME_BUFLEN
];

74 
	`tbuf
(
dout
, 
NULL
);

76 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

77 
ogme
 = 
gv
[0];

79 ++
ogme
;

81 i((
t
 = 
	`db_hbackup_vsi_check
()) != 0)

82  (
t
);

84 
checkpot
 = 
db_cfig
 = 
da_t
 =

85 
da_xt
 = 
exv
 = 
upde
 = 
vbo
 = 0;

86 
da_d
 = 
NULL
;

87 
backup_d
 = 
home
 = 
sswd
 = 
NULL
;

88 
log_d
 = 
NULL
;

89 
cy_m
 = 
move_max
 = 0;

90 
__db_gt_t
 = 1;

91 (
ch
 = 
	`gt
(
gc
, 
gv
, "b:cDd:h:l:P:uVv")!
EOF
)

92 
ch
) {

94 
backup_d
 = 
ݏrg
;

97 
checkpot
 = 1;

100 
db_cfig
 = 1;

107 i(
da_d
 =
NULL
 || 
da_xt
 >
da_t
 - 2) {

108 
da_t
 = data_cnt == 0 ? 20 : data_cnt * 2;

109 i((
da_d
 = 
	`loc
(data_dir,

110 
da_t
 * (*
da_d
))=
NULL
) {

111 
	`rtf
(
dr
, "%s: %s\n",

112 
ogme
, 
	`
(
o
));

113  (
EXIT_FAILURE
);

116 
da_d
[
da_xt
++] = 
ݏrg
;

119 
home
 = 
ݏrg
;

122 
log_d
 = 
ݏrg
;

125 
sswd
 = 
	`rdup
(
ݏrg
);

126 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

127 i(
sswd
 =
NULL
) {

128 
	`rtf
(
dr
, "%s: strdup: %s\n",

129 
ogme
, 
	`
(
o
));

130  (
EXIT_FAILURE
);

134 
upde
 = 1;

137 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

138  (
EXIT_SUCCESS
);

140 
vbo
 = 1;

144  (
	`db_hbackup_uge
());

146 
gc
 -
td
;

147 
gv
 +
td
;

149 i(
gc
 != 0)

150  (
	`db_hbackup_uge
());

153 i(
da_d
 !
NULL
) {

154 
da_d
[
da_xt
] = 
NULL
;

159 i(
checkpot
 == 1) {

160 
	`rtf
(
dr
,

161 "%s: cn scify -dnd -c\n", 
ogme
);

162  (
	`db_hbackup_uge
());

166 i(
db_cfig
 && (
da_d
 !
NULL
 || 
log_d
 != NULL)) {

167 
	`rtf
(
dr
,

168 "%s: cn scify -Dnd -d o-l\n", 
ogme
);

169  (
	`db_hbackup_uge
());

173 
	`__db_ut_sig
();

182 i(
home
 =
NULL
) {

183 
home
 = 
home_buf
;

184 i((
t
 = 
	`__os_gv
(

185 
NULL
, "DB_HOME", &
home
, (
home_buf
))) != 0) {

186 
	`rtf
(
dr
,

188 
ogme
, 
	`db_
(
t
));

189  (
EXIT_FAILURE
);

195 i(
home
 =
NULL
) {

196 
	`rtf
(
dr
,

197 "%s:sour dabanvmecifd\n", 
ogme
);

198  (
	`db_hbackup_uge
());

200 i(
backup_d
 =
NULL
) {

201 
	`rtf
(
dr
,

202 "%s:؏rg backudey scifd\n", 
ogme
);

203  (
	`db_hbackup_uge
());

206 i(
vbo
) {

207 ()
	`time
(&
now
);

208 
	`tf
("%s: hot backup startedt %s",

209 
ogme
, 
	`__db_ime
(&
now
, 
time_buf
));

213 i(
	`db_hbackup_v_
(&
dbv
, 
home
,

214 (
db_cfig
 || 
log_d
 !
NULL
) ? &log_dir : NULL,

215 
db_cfig
 ? &
da_d
 : 
NULL
,

216 
sswd
, 
OPEN_ORIGINAL
) != 0)

217 
shutdown
;

219 i(
db_cfig
 && 
	`__os_abh
(
log_d
)) {

220 
	`rtf
(
dr
,

222 
ogme
);

223 
shutdown
;

230 i(
checkpot
) {

231 i(
vbo
)

232 
	`tf
("%s: %s: f checkpot\n", 
ogme
, 
home
);

233 i((
t
 =

234 
dbv
->
	`txn_checkpot
(dbv, 0, 0, 
DB_FORCE
)) != 0) {

235 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->txn_checkpoint");

236 
shutdown
;

238 i(!
upde
) {

239 i(
vbo
)

240 
	`tf
("%s: %s:emove unnecessaryog files\n",

241 
ogme
, 
home
);

242 i((
t
 = 
dbv
->
	`log_chive
(dbenv,

243 
NULL
, 
DB_ARCH_REMOVE
)) != 0) {

244 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_archive");

245 
shutdown
;

256 ()
	`__os_mkd
(
NULL
, 
backup_d
, 
	`__db_omode
("rwx------"));

267 i(
db_cfig
 && 
log_d
 !
NULL
 &&

268 
	`db_hbackup_backup_d_n
(

269 
dbv
, 
backup_d
, 
log_d
, &
move_max
, 
upde
, 
vbo
) != 0)

270 
shutdown
;

271 i(
	`db_hbackup_backup_d_n
(
dbv
,

272 
backup_d
, 
NULL
, &
move_max
, 
upde
, 
vbo
) != 0)

273 
shutdown
;

280 i(!
upde
) {

281 i(
	`db_hbackup_ad_da_d
(
dbv
, 
home
,

282 
backup_d
, 
home
, 
vbo
, 
db_cfig
) != 0)

283 
shutdown
;

284 i(
da_d
 !
NULL
)

285 
d
 = 
da_d
; *d !
NULL
; ++dir) {

291 i(
db_cfig
 && 
	`__os_abh
(*
d
)) {

292 
	`rtf
(
dr
,

294 
ogme
, *
d
);

295 
shutdown
;

297 i(
	`db_hbackup_ad_da_d
(
dbv
, 
home
,

298 
backup_d
, *
d
, 
vbo
, 
db_cfig
) != 0)

299 
shutdown
;

310 i(
	`db_hbackup_ad_log_d
(
dbv
, 
db_cfig
 ? 
home
 : 
NULL
, 
backup_d
,

311 
log_d
 =
NULL
 ? 
home
 :og_d, &
cy_m
, 
upde
, 
vbo
) != 0)

312 
shutdown
;

320 i(
upde
 && 
move_max
 < 
cy_m
 &&

321 !(
move_max
 =0 && 
cy_m
 == 1)) {

322 
	`rtf
(
dr
,

324 
ogme
, 
move_max
);

325 
	`rtf
(
dr
,

327 
ogme
, 
cy_m
);

328 
shutdown
;

332 i((
t
 = 
dbv
->
	`o
(dbenv, 0)) != 0) {

333 
	`rtf
(
dr
,

334 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

335 
dbv
 = 
NULL
;

336 
shutdown
;

339 i(
vbo
)

340 
	`tf
("%s: %s:un catastrophicecovery\n",

341 
ogme
, 
backup_d
);

342 i(
	`db_hbackup_v_
(

343 &
dbv
, 
backup_d
, 
NULL
, NULL, 
sswd
, 
OPEN_HOT_BACKUP
) != 0)

344 
shutdown
;

349 i(
vbo
)

350 
	`tf
("%s: %s:emove unnecessaryog files\n",

351 
ogme
, 
backup_d
);

352 i((
t
 =

353 
dbv
->
	`log_chive
(dbv, 
NULL
, 
DB_ARCH_REMOVE
)) != 0) {

354 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_archive");

355 
shutdown
;

359 
shutdown
: 
exv
 = 1;

361 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

362 
exv
 = 1;

363 
	`rtf
(
dr
,

364 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

367 i(
exv
 == 0) {

368 i(
vbo
) {

369 ()
	`time
(&
now
);

370 
	`tf
("%s: hot backup completedt %s",

371 
ogme
, 
	`__db_ime
(&
now
, 
time_buf
));

374 
	`rtf
(
dr
, "%s: HOT BACKUP FAILED!\n", 
ogme
);

378 
	`__db_ut_signd
();

380  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

382 
	}
}

389 
	$db_hbackup_v_
(
dbvp
, 
home
, 
log_dp
, 
da_dp
, 
sswd
, 
which
)

390 
DB_ENV
 **
dbvp
;

391 *
home
, **
log_dp
, ***
da_dp
, *
sswd
;

392 
which_ݒ
 
which
;

394 
DB_ENV
 *
dbv
;

395 
t
;

397 *
dbvp
 = 
NULL
;

402 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

403 
	`rtf
(
dr
,

404 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

408 
dbv
->
	`t_rfe
(dbv, 
dr
);

409 
	`tbuf
(
dr
, 
NULL
);

410 
dbv
->
	`t_fx
(dbv, 
ogme
);

416 i(
log_dp
 !
NULL
 && *log_dirp != NULL &&

417 (
t
 = 
dbv
->
	`t_lg_d
(dbv, *
log_dp
)) != 0) {

418 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->t_lg_d: %s", *
log_dp
);

423 i(
sswd
 !
NULL
 &&

424 (
t
 = 
dbv
->
	`t_y
(dbv, 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

425 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->set_encrypt");

429 
which
) {

430 
OPEN_ORIGINAL
:

436 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

437 (
t
 =
DB_VERSION_MISMATCH
 ||

438 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_CREATE
 |

439 
DB_INIT_LOG
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
,

441 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->ݒ: %s", 
home
);

444 i(
log_dp
 !
NULL
 && *log_dirp == NULL)

445 ()
dbv
->
	`g_lg_d
(dbv, (cڡ **)
log_dp
);

446 i(
da_dp
 !
NULL
 && *data_dirp == NULL)

447 ()
dbv
->
	`g_da_ds
(

448 
dbv
, (cڡ ***)
da_dp
);

450 
OPEN_HOT_BACKUP
:

457 i((
t
 =

458 
dbv
->
	`t_chesize
(dbenv, 0, 64 * 1024 * 10, 0)) != 0) {

459 
dbv
->
	`r
(dbenv,

460 
t
, "DB_ENV->t_chesize: %s", 
home
);

463 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_CREATE
 |

464 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
 |

465 
DB_RECOVER_FATAL
 | 
DB_USE_ENVIRON
, 0)) != 0) {

466 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->ݒ: %s", 
home
);

472 *
dbvp
 = 
dbv
;

474 
	}
}

481 
	$db_hbackup_backup_d_n
(
dbv
, 
backup_d
, 
log_d
, 
move_maxp
, 
upde
, 
vbo
)

482 
DB_ENV
 *
dbv
;

483 *
backup_d
, *
log_d
;

484 *
move_maxp
, 
upde
, 
vbo
;

486 
t
, 
ft
, 
t
, 
v
;

487 **
mes
, *
d
, 
buf
[
DB_MAXPATHLEN
], 
th
[DB_MAXPATHLEN];

490 i(
log_d
 !
NULL
) {

491 i((
size_t
)
	`tf
(
buf
, (buf), "%s%c%s",

492 
backup_d
, 
PATH_SEPARATOR
[0] ,
log_d
>(
buf
)) {

493 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

494 
backup_d
, 
PATH_SEPARATOR
[0] ,
log_d
);

497 
d
 = 
buf
;

499 
d
 = 
backup_d
;

502 i((
t
 = 
	`__os_dli
(
dbv
, 
d
, &
mes
, &
ft
)) != 0) {

503 i(
log_d
 !
NULL
 && !
upde
)

505 
dbv
->
	`r
(dbv, 
t
, "%s: deyd", 
d
);

508 
t
 = 
ft
; --cnt >= 0;) {

512 i(
	`cmp
(
mes
[
t
], 
LFPREFIX
, (LFPREFIX) - 1)) {

513 i(
upde
)

517 
v
 = 
	`oi
(
mes
[
t
] + (
LFPREFIX
) - 1);

518 i(*
move_maxp
 < 
v
)

519 *
move_maxp
 = 
v
;

521 i((
size_t
)
	`tf
(
th
, (path), "%s%c%s",

522 
d
, 
PATH_SEPARATOR
[0], 
mes
[
t
]>(
th
)) {

523 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

524 
d
, 
PATH_SEPARATOR
[0], 
mes
[
t
]);

527 i(
vbo
)

528 
	`tf
("%s:emovg %s\n", 
ogme
, 
th
);

529 i(
	`__os_uƚk
(
dbv
, 
th
) != 0)

533 
	`__os_d
(
dbv
, 
mes
, 
ft
);

535 i(
vbo
 && *
move_maxp
 != 0)

536 
	`tf
("%s: highestumberedog fileemoved: %d\n",

537 
ogme
, *
move_maxp
);

540 
	}
}

547 
	$db_hbackup_ad_da_d
(
dbv
, 
home
, 
backup_d
, 
d
, 
vbo
, 
db_cfig
)

548 
DB_ENV
 *
dbv
;

549 *
home
, *
backup_d
, *
d
;

550 
vbo
, 
db_cfig
;

552 
t
, 
ft
, 
t
;

553 *
bd
, **
mes
;

554 
buf
[
DB_MAXPATHLEN
], 
bbuf
[DB_MAXPATHLEN];

556 
bd
 = 
backup_d
;

557 i(
db_cfig
 && 
d
 !
home
) {

559 i((
size_t
)(
t
 = 
	`tf
(
bbuf
, (bbuf), "%s%c%s%c",

560 
backup_d
, 
PATH_SEPARATOR
[0],

561 
d
, 
PATH_SEPARATOR
[0])>(
buf
)) {

562 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

563 
backup_d
, 
PATH_SEPARATOR
[0], 
d
);

566 
bd
 = 
bbuf
;

569 i((
t
 = 
dbv
->
	`t_rmed_d
(

570 
dbv
, 
	`__db_omode
("rwx------"), 0)) != 0 ||

571 (
t
 = 
	`__db_mkth
(
dbv
, 
bd
)) != 0) {

572 
dbv
->
	`r
(dbv, 
t
, "%s: cn ce", 
bd
);

576 
bd
[
t
 - 1] = '\0';

579 i((
size_t
)
	`tf
(
buf
, (buf),

580 "%s%c%s", 
home
, 
PATH_SEPARATOR
[0], 
d
>(
buf
)) {

581 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

582 
home
, 
PATH_SEPARATOR
[0], 
d
);

585 
d
 = 
buf
;

588 i((
t
 = 
	`__os_dli
(
dbv
, 
d
, &
mes
, &
ft
)) != 0) {

589 
dbv
->
	`r
(dbv, 
t
, "%s: deyd", 
d
);

592 
t
 = 
ft
; --cnt >= 0;) {

597 i(!
	`cmp
(
mes
[
t
], 
LFPREFIX
, (LFPREFIX) - 1))

599 i(!
	`cmp
(
mes
[
t
],

600 
DB_REGION_PREFIX
, (DB_REGION_PREFIX) - 1) &&

601 
	`cmp
(
mes
[
t
],

602 
QUEUE_EXTENT_PREFIX
, (QUEUE_EXTENT_PREFIX) - 1))

608 i(!
db_cfig
 &&

609 !
	`cmp
(
mes
[
t
], "DB_CONFIG", ("DB_CONFIG")))

613 i(
	`db_hbackup_da_cy
(
dbv
, 
mes
[
t
], 
d
, 
bd
, 
vbo
) != 0)

617 
	`__os_d
(
dbv
, 
mes
, 
ft
);

620 
	}
}

629 
	$db_hbackup_ad_log_d
(
dbv
, 
home
, 
backup_d
, 
log_d
, 
cy_mp
, 
upde
, 
vbo
)

630 
DB_ENV
 *
dbv
;

631 *
home
, *
backup_d
, *
log_d
;

632 *
cy_mp
, 
upde
, 
vbo
;

634 
u_t32_t
 
aag
;

635 
t
, 
t
, 
v
;

636 **
beg
, **
mes
, *
backupd
, *
logd
;

637 
om
[
DB_MAXPATHLEN
], 
to
[DB_MAXPATHLEN];

639 i(
home
 !
NULL
 && 
log_d
 != NULL) {

640 i((
size_t
)
	`tf
(
om
, (from), "%s%c%s",

641 
home
, 
PATH_SEPARATOR
[0], 
log_d
>(
om
)) {

642 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

643 
home
, 
PATH_SEPARATOR
[0], 
log_d
);

646 
logd
 = 
	`rdup
(
om
);

647 i((
size_t
)(
t
 = 
	`tf
(
to
, (to),

648 "%s%c%s%c", 
backup_d
, 
PATH_SEPARATOR
[0],

649 
log_d
, 
PATH_SEPARATOR
[0])>(
to
)) {

650 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

651 
backup_d
, 
PATH_SEPARATOR
[0], 
log_d
);

654 
backupd
 = 
	`rdup
(
to
);

657 i((
t
 = 
dbv
->
	`t_rmed_d
(

658 
dbv
, 
	`__db_omode
("rwx------"), 0)) != 0 ||

659 (
t
 = 
	`__db_mkth
(
dbv
, 
backupd
)) != 0) {

660 
dbv
->
	`r
(dbv, 
t
, "%s: cn ce", 
backupd
);

664 
backupd
[
t
 - 1] = '\0';

666 
backupd
 = 
backup_d
;

667 
logd
 = 
log_d
;

670 
aga
: 
aag
 = 
DB_ARCH_LOG
;

676 i(
upde
)

677 
aag
 = 0;

679 i((
t
 = 
dbv
->
	`log_chive
(dbv, &
mes
, 
aag
)) != 0) {

680 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_archive");

683 i(
mes
 =
NULL
)

684 
de
;

685 
beg
 = 
mes
;

686 ; *
mes
 !
NULL
;ames++) {

688 
v
 = 
	`oi
(*
mes
 + (
LFPREFIX
) - 1);

689 i(*
cy_mp
 =0 || *cy_m> 
v
)

690 *
cy_mp
 = 
v
;

692 i((
size_t
)
	`tf
(
om
, (from), "%s%c%s",

693 
logd
, 
PATH_SEPARATOR
[0], *
mes
>(
om
)) {

694 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

695 
logd
, 
PATH_SEPARATOR
[0], *
mes
);

707 i(
upde
) {

708 i((
size_t
)
	`tf
(
to
, (to), "%s%c%s",

709 
backupd
, 
PATH_SEPARATOR
[0], *
mes
>(
to
)) {

710 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

711 
backupd
, 
PATH_SEPARATOR
[0], *
mes
);

714 i(
	`__os_me
(
dbv
, 
om
, 
to
, 1) == 0) {

715 i(
vbo
)

716 
	`tf
("%s: moving %so %s\n",

717 
ogme
, 
om
, 
to
);

723 i(
	`db_hbackup_da_cy
(
dbv
, *
mes
, 
logd
, 
backupd
, 
vbo
) != 0)

726 i(
upde
) {

727 i(
vbo
)

728 
	`tf
("%s:emovg %s\n", 
ogme
, 
om
);

729 i((
t
 = 
	`__os_uƚk
(
dbv
, 
om
)) != 0) {

730 
dbv
->
	`r
(dbv, 
t
,

731 "uƚk o%ed", 
om
);

738 
	`
(
beg
);

739 
de
: i(
upde
) {

740 
upde
 = 0;

741 
aga
;

744 i(
vbo
 && *
cy_mp
 != 0)

745 
	`tf
("%s:owestumberedog file copied: %d\n",

746 
ogme
, *
cy_mp
);

747 i(
logd
 !
log_d
)

748 
	`
(
logd
);

749 i(
backupd
 !
backup_d
)

750 
	`
(
backupd
);

753 
	}
}

760 
	$db_hbackup_da_cy
(
dbv
, 
fe
, 
om_d
, 
to_d
, 
vbo
)

761 
DB_ENV
 *
dbv
;

762 *
fe
, *
om_d
, *
to_d
;

763 
vbo
;

765 
DB_FH
 *
rfhp
, *
wfhp
;

766 
size_t
 

, 
nw
;

767 
t
;

768 *
buf
;

770 
t
 = 0;

771 
rfhp
 = 
wfhp
 = 
NULL
;

773 i(
vbo
)

774 
	`tf
("%s: cyg %s%c%t%s%c%s\n", 
ogme
, 
om_d
,

775 
PATH_SEPARATOR
[0], 
fe
, 
to_d
, PATH_SEPARATOR[0], file);

787 i((
buf
 = 
	`mloc
(
MEGABYTE
)=
NULL
) {

788 
dbv
->
	`r
(dbenv,

789 
o
, "%lu buf㸮loti", (
u_lg
)
MEGABYTE
);

794 i(
	`tf
(
buf
, 
MEGABYTE
, "%s%c%s",

795 
om_d
, 
PATH_SEPARATOR
[0], 
fe
>
MEGABYTE
) {

796 
dbv
->
	`rx
(dbenv,

797 "%s%c%s:holg", 
om_d
, 
PATH_SEPARATOR
[0], 
fe
);

798 
r
;

800 i((
t
 = 
	`__os_ݒ
(
dbv
, 
buf
, 0, 
DB_OSO_RDONLY
, 0, &
rfhp
)) != 0) {

801 
dbv
->
	`r
(dbv, 
t
, "%s", 
buf
);

802 
r
;

806 i(
	`tf
(
buf
, 
MEGABYTE
, "%s%c%s",

807 
to_d
, 
PATH_SEPARATOR
[0], 
fe
>
MEGABYTE
) {

808 
dbv
->
	`rx
(dbenv,

809 "%s%c%s:holg", 
to_d
, 
PATH_SEPARATOR
[0], 
fe
);

810 
r
;

812 i((
t
 = 
	`__os_ݒ
(
dbv
, 
buf
, 0,

813 
DB_OSO_CREATE
 | 
DB_OSO_TRUNC
, 
	`__db_omode
(
OWNER_RW
), &
wfhp
)) != 0) {

814 
dbv
->
	`r
(dbv, 
t
, "%s", 
buf
);

815 
r
;

819 (
t
 = 
	`__os_ad
(
dbv
, 
rfhp
, 
buf
, 
MEGABYTE
, &

)) == 0 &&

820 

 > 0)

821 i((
t
 = 
	`__os_wre
(
dbv
, 
wfhp
, 
buf
, 

, &
nw
)) != 0)

825 
r
: 
t
 = 1;

827 i(
buf
 !
NULL
)

828 
	`
(
buf
);

830 i(
rfhp
 !
NULL
 && 
	`__os_ohd
(
dbv
,fhp) != 0)

831 
t
 = 1;

834 i(
wfhp
 !
NULL
) {

835 i(
	`__os_fsync
(
dbv
, 
wfhp
) != 0)

836 
t
 = 1;

837 i(
	`__os_ohd
(
dbv
, 
wfhp
) != 0)

838 
t
 = 1;

840  (
t
);

841 
	}
}

844 
	$db_hbackup_uge
()

846 ()
	`rtf
(
dr
, "uge: %[-cDuVv]\n\t%s\n", 
ogme
,

848  (
EXIT_FAILURE
);

849 
	}
}

852 
	$db_hbackup_vsi_check
()

854 
v_maj
, 
v_m
, 
v_tch
;

857 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

858 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

859 
	`rtf
(
dr
,

861 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

862 
v_maj
, 
v_m
);

863  (
EXIT_FAILURE
);

866 
	}
}

	@../build_vxworks/db_load/db_load.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_am.h
"

15 #ide
lt


16 cڡ 
	gcyright
[] =

21 cڡ *
	mogme
;

22 *
	mhdrbuf
;

23 
u_lg
 
	mlo
;

24 
u_lg
 
	migle
;

25 
	mdoda
;

26 
	mdofe
;

27 
	mvsi
;

28 *
	mhome
;

29 *
	msswd
;

30 
	mive
;

31 
u_t32_t
 
	mche
;

32 } 
	tLDG
;

34 
db_ld_badd
 
__P
((
DB_ENV
 *));

35 
db_ld_badnum
 
__P
((
DB_ENV
 *));

36 
db_ld_cfigu
 
__P
((
DB_ENV
 *, 
DB
 *, **, **, *));

37 
db_ld_cvb
 
__P
((
DB_ENV
 *, *, **));

38 
db_ld_db_
 
__P
((
DB_ENV
 *, *, 
u_t32_t
, *));

39 
db_ld_dbt_rdump
 
__P
((
DB_ENV
 *, 
DBT
 *));

40 
db_ld_dbt_rt
 
__P
((
DB_ENV
 *, 
DBT
 *));

41 
db_ld_dbt_eo
 
__P
((
DB_ENV
 *, 
DBT
 *, ));

42 
db_ld_dbt_to_o
 
__P
((
DB_ENV
 *, 
DBT
 *, 
db_o_t
 *));

43 
db_ld_v_
 
__P
((
DB_ENV
 **, 
LDG
 *));

44 
db_ld_ld
 
__P
((
DB_ENV
 *, *, 
DBTYPE
, **, 
u_t
, 
LDG
 *, *));

45 
db_ld_ma
 
__P
((, *[]));

46 
db_ld_rhd
 
__P
((
DB_ENV
 *, 
DB
 *, 
DBTYPE
 *, **, *, *));

47 
db_ld_uge
 
__P
(());

48 
db_ld_vsi_check
 
__P
(());

50 cڡ *
	gogme
;

52 
	#G
(
f
((
LDG
 *)
dbv
->
p_ive
)->
	)
f

55 
	#LDF_NOHEADER
 0x01

	)

56 
	#LDF_NOOVERWRITE
 0x02

	)

57 
	#LDF_PASSWORD
 0x04

	)

60 
	$db_ld
(
gs
)

61 *
gs
;

63 
gc
;

64 **
gv
;

66 
	`__db_ut_g
("db_ld", 
gs
, &
gc
, &
gv
);

67  (
	`db_ld_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

68 
	}
}

70 
	~<dio.h
>

71 
	#ERROR_RETURN
 
ERROR


	)

74 
	$db_ld_ma
(
gc
, 
gv
)

75 
gc
;

76 *
gv
[];

78 um { 
NOTSET
, 
FILEID_RESET
, 
LSN_RESET
, 
STANDARD_LOAD
 } 
mode
;

79 
*
ݏrg
;

80 

td
, 
__db_gt_t
;

81 
DBTYPE
 
dbty
;

82 
DB_ENV
 *
dbv
;

83 
LDG
 
ldg
;

84 
u_t
 
ldf
;

85 
ch
, 
exied
, 
exv
, 
t
;

86 **
i
, **
p
;

88 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

89 
ogme
 = 
gv
[0];

91 ++
ogme
;

93 i((
t
 = 
	`db_ld_vsi_check
()) != 0)

94  (
t
);

96 
ldg
.
ogme
 =rogname;

97 
ldg
.
lo
 = 0;

98 
ldg
.
doda
 =dg.
dofe
 = 0;

99 
ldg
.
vsi
 = 1;

100 
ldg
.
che
 = 
MEGABYTE
;

101 
ldg
.
hdrbuf
 = 
NULL
;

102 
ldg
.
home
 = 
NULL
;

103 
ldg
.
sswd
 = 
NULL
;

105 
mode
 = 
NOTSET
;

106 
ldf
 = 0;

107 
exv
 = 
exied
 = 0;

108 
dbty
 = 
DB_UNKNOWN
;

111 i((
p
 = 
i
 =

112 (**)
	`oc
((
size_t
)
gc
 + 1, (*))=
NULL
) {

113 
	`rtf
(
dr
, "%s: %s\n", 
ldg
.
ogme
, 
	`
(
ENOMEM
));

114  (
EXIT_FAILURE
);

124 
__db_gt_t
 = 1;

125 (
ch
 = 
	`gt
(
gc
, 
gv
, "c:f:h:nP:r:Tt:V")!
EOF
)

126 
ch
) {

128 i(
mode
 !
NOTSET
 && mod!
STANDARD_LOAD
)

129  (
	`db_ld_uge
());

130 
mode
 = 
STANDARD_LOAD
;

132 *
p
++ = 
ݏrg
;

135 i(
mode
 !
NOTSET
 && mod!
STANDARD_LOAD
)

136  (
	`db_ld_uge
());

137 
mode
 = 
STANDARD_LOAD
;

139 i(
	`eݒ
(
ݏrg
, "r", 
d
=
NULL
) {

140 
	`rtf
(
dr
, "%s: %s:eopen: %s\n",

141 
ldg
.
ogme
, 
ݏrg
, 
	`
(
o
));

142  (
EXIT_FAILURE
);

146 
ldg
.
home
 = 
ݏrg
;

149 i(
mode
 !
NOTSET
 && mod!
STANDARD_LOAD
)

150  (
	`db_ld_uge
());

151 
mode
 = 
STANDARD_LOAD
;

153 
ldf
 |
LDF_NOOVERWRITE
;

156 
ldg
.
sswd
 = 
	`rdup
(
ݏrg
);

157 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

158 i(
ldg
.
sswd
 =
NULL
) {

159 
	`rtf
(
dr
, "%s: strdup: %s\n",

160 
ldg
.
ogme
, 
	`
(
o
));

161  (
EXIT_FAILURE
);

163 
ldf
 |
LDF_PASSWORD
;

166 i(
mode
 =
STANDARD_LOAD
)

167  (
	`db_ld_uge
());

168 i(
	`rcmp
(
ݏrg
, "lsn") == 0)

169 
mode
 = 
LSN_RESET
;

170 i(
	`rcmp
(
ݏrg
, "fileid") == 0)

171 
mode
 = 
FILEID_RESET
;

173  (
	`db_ld_uge
());

176 i(
mode
 !
NOTSET
 && mod!
STANDARD_LOAD
)

177  (
	`db_ld_uge
());

178 
mode
 = 
STANDARD_LOAD
;

180 
ldf
 |
LDF_NOHEADER
;

183 i(
mode
 !
NOTSET
 && mod!
STANDARD_LOAD
)

184  (
	`db_ld_uge
());

185 
mode
 = 
STANDARD_LOAD
;

187 i(
	`rcmp
(
ݏrg
, "btree") == 0) {

188 
dbty
 = 
DB_BTREE
;

191 i(
	`rcmp
(
ݏrg
, "hash") == 0) {

192 
dbty
 = 
DB_HASH
;

195 i(
	`rcmp
(
ݏrg
, "recno") == 0) {

196 
dbty
 = 
DB_RECNO
;

199 i(
	`rcmp
(
ݏrg
, "queue") == 0) {

200 
dbty
 = 
DB_QUEUE
;

203  (
	`db_ld_uge
());

205 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

206  (
EXIT_SUCCESS
);

209  (
	`db_ld_uge
());

211 
gc
 -
td
;

212 
gv
 +
td
;

214 i(
gc
 != 1)

215  (
	`db_ld_uge
());

218 
	`__db_ut_sig
();

224 i(
	`db_ld_v_
(&
dbv
, &
ldg
) != 0)

225 
shutdown
;

228 
mode
) {

229 
FILEID_RESET
:

230 
exv
 = 
dbv
->
	`feid_t
(

231 
dbv
, 
gv
[0], 
ldf
 & 
LDF_PASSWORD
 ? 
DB_ENCRYPT
 : 0);

233 
LSN_RESET
:

234 
exv
 = 
dbv
->
	`l_t
(

235 
dbv
, 
gv
[0], 
ldf
 & 
LDF_PASSWORD
 ? 
DB_ENCRYPT
 : 0);

237 
NOTSET
:

238 
STANDARD_LOAD
:

239 !
ldg
.
dofe
)

240 i(
	`db_ld_ld
(
dbv
, 
gv
[0], 
dbty
, 
i
, 
ldf
,

241 &
ldg
, &
exied
) != 0)

242 
shutdown
;

247 
shutdown
: 
exv
 = 1;

249 i((
t
 = 
dbv
->
	`o
(dbenv, 0)) != 0) {

250 
exv
 = 1;

251 
	`rtf
(
dr
,

252 "%s: dbv->o: %s\n", 
ldg
.
ogme
, 
	`db_
(
t
));

256 
	`__db_ut_signd
();

257 
	`
(
i
);

258 i(
ldg
.
sswd
 !
NULL
)

259 
	`
(
ldg
.
sswd
);

268  (
exv
 =0 ? (
exied
 == 0 ? 0 : 1) : 2);

269 
	}
}

276 
	$db_ld_ld
(
dbv
, 
me
, 
gty
, 
i
, 
ags
, 
ldg
, 
exiedp
)

277 
DB_ENV
 *
dbv
;

278 *
me
, **
i
;

279 
DBTYPE
 
gty
;

280 
u_t
 
ags
;

281 
LDG
 *
ldg
;

282 *
exiedp
;

284 
DB
 *
dbp
;

285 
DBT
 
key
, 
rkey
, 
da
, *
adp
, *
wr
;

286 
DBTYPE
 
dbty
;

287 
DB_TXN
 *
xn
, *
txn
;

288 
db_o_t
 
o
, 
deo
;

289 
u_t32_t
 
put_ags
;

290 
ascii_o
, 
checkt
, 
hexkeys
, 
keyag
, 
keys
, 
size
, 
t
, 
rv
;

291 *
subdb
;

293 
put_ags
 = 
	`LF_ISSET
(
LDF_NOOVERWRITE
? 
DB_NOOVERWRITE
 : 0;

294 
	`G
(
doda
) = 0;

296 
subdb
 = 
NULL
;

297 
xn
 = 
txn
 = 
NULL
;

298 
	`memt
(&
key
, 0, (
DBT
));

299 
	`memt
(&
da
, 0, (
DBT
));

300 
	`memt
(&
rkey
, 0, (
DBT
));

302 
y_db
:

303 
dbty
 = 
DB_UNKNOWN
;

304 
keys
 = -1;

305 
hexkeys
 = -1;

306 
keyag
 = -1;

309 i((
t
 = 
	`db_
(&
dbp
, 
dbv
, 0)) != 0) {

310 
dbv
->
	`r
(dbv, 
t
, "db_create");

311 
r
;

315 i(
	`LF_ISSET
(
LDF_NOHEADER
)) {

316 
checkt
 = 1;

317 
dbty
 = 
gty
;

319 i(
	`db_ld_rhd
(
dbv
,

320 
dbp
, &
dbty
, &
subdb
, &
checkt
, &
keys
) != 0)

321 
r
;

322 i(
	`G
(
dofe
))

323 
de
;

331 i(
	`db_ld_cfigu
(
dbv
, 
dbp
, 
i
, &
subdb
, &
keyag
))

332 
r
;

334 i(
keys
 != 1) {

335 i(
keyag
 == 1) {

336 
dbp
->
	`r
(dbp, 
EINVAL
, "No keys specified in file");

337 
r
;

340 i(
keyag
 == 0) {

341 
dbp
->
	`r
(dbp, 
EINVAL
, "Keys specified in file");

342 
r
;

345 
keyag
 = 1;

347 i(
dbty
 =
DB_BTREE
 || dbty =
DB_HASH
) {

348 i(
keyag
 == 0)

349 
dbp
->
	`r
(dbp,

350 
EINVAL
, "Btreend Hash must specify keys");

352 
keyag
 = 1;

355 i(
gty
 !
DB_UNKNOWN
) {

357 i(
dbty
 =
DB_RECNO
 || dbty =
DB_QUEUE
)

358 i(
keyag
 !1 && 
gty
 !
DB_RECNO
 &&

359 
gty
 !
DB_QUEUE
) {

360 
dbv
->
	`rx
(dbenv,

362 
r
;

364 
dbty
 = 
gty
;

367 i(
dbty
 =
DB_UNKNOWN
) {

368 
dbv
->
	`rx
(dbenv, "no databaseype specified");

369 
r
;

372 i(
keyag
 == -1)

373 
keyag
 = 0;

383 
hexkeys
 = (
	`G
(
vsi
>3 && 
keyag
 =1 && 
checkt
 == 0);

385 i(
keyag
 =1 && (
dbty
 =
DB_RECNO
 || dbty =
DB_QUEUE
))

386 
ascii_o
 = 1;

388 
ascii_o
 = 0;

391 i(
	`LF_ISSET
(
LDF_PASSWORD
) &&

392 (
t
 = 
dbp
->
	`t_ags
(dbp, 
DB_ENCRYPT
)) != 0) {

393 
dbp
->
	`r
(dbp, 
t
, "DB->set_flags: DB_ENCRYPT");

394 
r
;

398 
S
 
iti
-
ecific
 
b
 
comris
 

 
hash
 
funis
 
he
.

399 
F
 
exame
:

401 i((
t
 = 
dbp
->
	`t_bt_com
(dbp, 
lol_comris_func
)) != 0) {

402 
dbp
->
	`r
(dbp, 
t
, "DB->set_bt_compare");

403 
r
;

405 i((
t
 = 
dbp
->
	`t_h_hash
(dbp, 
lol_hash_func
)) != 0) {

406 
dbp
->
	`r
(dbp, 
t
, "DB->set_h_hash");

407 
r
;

412 i((
t
 = 
dbp
->
	`ݒ
(dbp, 
NULL
, 
me
, 
subdb
, 
dbty
,

413 
DB_CREATE
 | (
	`TXN_ON
(
dbv
? 
DB_AUTO_COMMIT
 : 0),

414 
	`__db_omode
("rw-rw-rw-"))) != 0) {

415 
dbp
->
	`r
(dbp, 
t
, "DB->ݒ: %s", 
me
);

416 
r
;

418 i(
ldg
->
ive
 != 0) {

419 i((
t
 = 
	`__db_ut_che
(
dbp
, &
ldg
->
che
, &
size
)) != 0)

420 
r
;

421 i(
size
) {

422 i((
t
 = 
dbp
->
	`o
(dbp, 0)) != 0)

423 
r
;

424 
dbp
 = 
NULL
;

425 i((
t
 = 
dbv
->
	`o
(dbenv, 0)) != 0)

426 
r
;

427 i((
t
 = 
	`db_ld_v_
(&
dbv
, 
ldg
)) != 0)

428 
r
;

429 
y_db
;

434 
adp
 = 
wr
 = &
key
;

435 i(
dbty
 =
DB_RECNO
 || dbty =
DB_QUEUE
) {

436 
key
.
size
 = (
o
);

437 i(
keyag
) {

438 
key
.
da
 = &
deo
;

439 i(
checkt
) {

440 
adp
 = &
rkey
;

441 
key_da
;

444 
key
.
da
 = &
o
;

446 
key_da
: i((
adp
->
da
 = 
	`mloc
ԗdp->
un
 = 1024)=
NULL
) {

447 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

448 
r
;

450 i((
da
.d
	`mloc
(da.
un
 = 1024)=
NULL
) {

451 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

452 
r
;

455 i(
	`TXN_ON
(
dbv
) &&

456 (
t
 = 
dbv
->
	`txn_beg
(dbv, 
NULL
, &
txn
, 0)) != 0)

457 
r
;

460 
o
 = 1; !
	`__db_ut_ued
(); ++recno) {

461 i(!
keyag
) {

462 i(
checkt
) {

463 i(
	`db_ld_dbt_rt
(
dbv
, &
da
))

464 
r
;

466 i(
	`db_ld_dbt_rdump
(
dbv
, &
da
))

467 
r
;

470 i(
checkt
) {

471 i(
	`db_ld_dbt_rt
(
dbv
, 
adp
))

472 
r
;

473 i(
ascii_o
 &&

474 
	`db_ld_dbt_to_o
(
dbv
, 
adp
, &
deo
) != 0)

475 
r
;

477 i(!
	`G
(
doda
&& 
	`db_ld_dbt_rt
(
dbv
, &
da
))

478 
odd_cou
;

480 i(
ascii_o
) {

481 i(
	`db_ld_dbt_eo
(
dbv
, 
adp
, 
hexkeys
))

482 
r
;

484 i(
	`db_ld_dbt_rdump
(
dbv
, 
adp
))

485 
r
;

487 i(!
	`G
(
doda
&& 
	`db_ld_dbt_rdump
(
dbv
, &
da
)) {

488 
odd_cou
: 
dbv
->
	`rx
(dbenv,

490 
r
;

494 i(
	`G
(
doda
))

496 
y
: i(
txn
 !
NULL
)

497 i((
t
 = 
dbv
->
	`txn_beg
(dbv, 
txn
, &
xn
, 0)) != 0)

498 
r
;

499 
t
 = 
dbp
->
	`put
(dbp, 
xn
, 
wr
, &
da
, 
put_ags
)) {

501 i(
xn
 !
NULL
) {

502 i((
t
 =

503 
xn
->
	`comm
(xn, 
DB_TXN_NOSYNC
)) != 0)

504 
r
;

505 
xn
 = 
NULL
;

508 
DB_KEYEXIST
:

509 *
exiedp
 = 1;

510 
dbv
->
	`rx
(dbenv,

512 
me
,

513 !
keyag
 ? 
o
 :ecno * 2 - 1);

515 ()
dbv
->
	`dbt
(&
key
,

516 
checkt
, 0, 
dr
, 
__db__back
, 0);

518 
DB_LOCK_DEADLOCK
:

520 i(
xn
 !
NULL
) {

521 i((
t
 = 
xn
->
	`abt
(ctxn)) != 0)

522 
r
;

523 
xn
 = 
NULL
;

524 
y
;

528 
dbv
->
	`r
(dbv, 
t
, 
NULL
);

529 i(
xn
 !
NULL
) {

530 ()
xn
->
	`abt
(ctxn);

531 
xn
 = 
NULL
;

533 
r
;

535 i(
xn
 !
NULL
) {

536 i((
t
 = 
xn
->
	`abt
(ctxn)) != 0)

537 
r
;

538 
xn
 = 
NULL
;

541 
de
: 
rv
 = 0;

542 
	`DB_ASSERT
(
dbv
, 
xn
 =
NULL
);

543 i(
txn
 !
NULL
 && (
t
 =xn->
	`comm
(txn, 0)) != 0) {

544 
txn
 = 
NULL
;

545 
r
;

549 
r
: 
rv
 = 1;

550 
	`DB_ASSERT
(
dbv
, 
xn
 =
NULL
);

551 i(
txn
 !
NULL
)

552 ()
txn
->
	`abt
(txn);

556 i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 0)) != 0) {

557 
dbv
->
	`r
(dbv, 
t
, "DB->close");

558 
rv
 = 1;

561 i(
	`G
(
hdrbuf
!
NULL
)

562 
	`
(
	`G
(
hdrbuf
));

563 
	`G
(
hdrbuf

NULL
;

565 i(
subdb
 !
NULL
)

566 
	`
(
subdb
);

567 i(
dbty
 !
DB_RECNO
 && dbty !
DB_QUEUE
 && 
key
.
da
 !
NULL
)

568 
	`
(
key
.
da
);

569 i(
rkey
.
da
 !
NULL
)

570 
	`
(
rkey
.
da
);

571 
	`
(
da
.data);

573  (
rv
);

574 
	}
}

581 
	$db_ld_v_
(
dbvp
, 
ldg
)

582 
DB_ENV
 **
dbvp
;

583 
LDG
 *
ldg
;

585 
DB_ENV
 *
dbv
;

586 
t
;

588 i((
t
 = 
	`db_v_
(
dbvp
, 0)) != 0) {

589 
	`rtf
(
dr
,

590 "%s: db_v_: %s\n", 
ldg
->
ogme
, 
	`db_
(
t
));

591  (
t
);

593 
dbv
 = *
dbvp
;

594 
dbv
->
	`t_rfe
(dbv, 
dr
);

595 
dbv
->
	`t_fx
(dbv, 
ldg
->
ogme
);

596 i(
ldg
->
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

597 
ldg
->
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

598 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

599  (
t
);

601 i((
t
 = 
	`db_ld_db_
(
dbv
, 
ldg
->
home
,dg->
che
, &ldg->
ive
)) != 0)

602  (
t
);

603 
dbv
->
p_ive
 = 
ldg
;

606 
	}
}

613 
	$db_ld_db_
(
dbv
, 
home
, 
che
, 
is_ive
)

614 
DB_ENV
 *
dbv
;

615 *
home
;

616 
u_t32_t
 
che
;

617 *
is_ive
;

619 
u_t32_t
 
ags
;

620 
t
;

622 *
is_ive
 = 0;

624 
ags
 = 
DB_USE_ENVIRON
 |

625 
DB_INIT_LOCK
 | 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
;

626 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
ags
, 0)) == 0)

628 i(
t
 =
DB_VERSION_MISMATCH
)

629 
r
;

643 
	`LF_CLR
(
DB_INIT_LOCK
 | 
DB_INIT_LOG
 | 
DB_INIT_TXN
);

644 
	`LF_SET
(
DB_CREATE
 | 
DB_PRIVATE
);

645 *
is_ive
 = 1;

646 i((
t
 = 
dbv
->
	`t_chesize
(dbv, 0, 
che
, 1)) != 0) {

647 
dbv
->
	`r
(dbv, 
t
, "set_cachesize");

650 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
ags
, 0)) == 0)

654 
r
: 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

656 
	}
}

658 
	#FLAG
(
me
, 
vue
, 
keywd
, 
ag
) \

659 i(
	`rcmp
(
me
, 
keywd
) == 0) { \

660 *
vue
) { \

662 i((
t
 = 
dbp
->
	`t_ags
(dbp, 
ag
)) != 0) { \

663 
dbp
->
	`r
(dbp, 
t
, "%s: set_flags: %s", \

664 
	`G
(
ogme
), 
me
); \

665 
r
; \

671 
	`db_ld_badnum
(
dbv
); \

672 
r
; \

675 }

	)

676 
	#NUMBER
(
me
, 
vue
, 
keywd
, 
func
, 
t
) \

677 i(
	`rcmp
(
me
, 
keywd
) == 0) { \

678 i((
t
 = 
	`__db_glg
(
dbv
, \

679 
NULL
, 
vue
, 0, 
LONG_MAX
, &
v
)) != 0 || \

680 (
t
 = 
dbp
->
	`func
(dbp, (
t
)
v
)) != 0) \

681 
m
; \

683 }

	)

684 
	#STRING
(
me
, 
vue
, 
keywd
, 
func
) \

685 i(
	`rcmp
(
me
, 
keywd
) == 0) { \

686 i((
t
 = 
dbp
->
	`func
(dbp, 
vue
[0])) != 0) \

687 
m
; \

689 }

	)

696 
	#CONFIGURATION_LIST_COMPARE
 \

697 
	`NUMBER
(
me
, 
vue
, "bt_mkey", 
t_bt_mkey
, 
u_t32_t
); \

698 
	`FLAG
(
me
, 
vue
, "chksum", 
DB_CHKSUM
); \

699 
	`NUMBER
(
me
, 
vue
, "db_ld", 
t_ld
, ); \

700 
	`NUMBER
(
me
, 
vue
, "db_gesize", 
t_gesize
, 
u_t32_t
); \

701 
	`FLAG
(
me
, 
vue
, "duis", 
DB_DUP
); \

702 
	`FLAG
(
me
, 
vue
, "dupst", 
DB_DUPSORT
); \

703 
	`NUMBER
(
me
, 
vue
, "exsize", 
t_q_exsize
, 
u_t32_t
); \

704 
	`NUMBER
(
me
, 
vue
, "h_f", 
t_h_f
, 
u_t32_t
); \

705 
	`NUMBER
(
me
, 
vue
, "h_m", 
t_h_m
, 
u_t32_t
); \

706 
	`NUMBER
(
me
, 
vue
, "_n", 
t__n
, 
u_t32_t
); \

707 
	`STRING
(
me
, 
vue
, "_d", 
t__d
); \

708 
	`FLAG
(
me
, 
vue
, "um", 
DB_RECNUM
); \

709 
	`FLAG
(
me
, 
vue
, "numb", 
DB_RENUMBER
)

	)

716 
	$db_ld_cfigu
(
dbv
, 
dbp
, 
p
, 
subdbp
, 
key
)

717 
DB_ENV
 *
dbv
;

718 
DB
 *
dbp
;

719 **
p
, **
subdbp
;

720 *
key
;

722 
v
;

723 
t
, 
vech
;

724 *
me
, *
vue
;

726 ; (
me
 = *
p
!
NULL
; *--
vue
 = 
vech
, ++clp) {

727 i((
vue
 = 
	`rchr
(
me
, '=')=
NULL
) {

728 
dbp
->
	`rx
(dbp,

732 
vech
 = *
vue
;

733 *
vue
++ = '\0';

735 i(
	`rcmp
(
me
, "database") == 0 ||

736 
	`rcmp
(
me
, "subdatabase") == 0) {

737 i(*
subdbp
 !
NULL
)

738 
	`
(*
subdbp
);

739 i((*
subdbp
 = 
	`rdup
(
vue
)=
NULL
) {

740 
dbp
->
	`r
(dbp, 
ENOMEM
, 
NULL
);

745 i(
	`rcmp
(
me
, "keys") == 0) {

746 i(
	`rcmp
(
vue
, "1") == 0)

747 *
key
 = 1;

748 i(
	`rcmp
(
vue
, "0") == 0)

749 *
key
 = 0;

751 
	`db_ld_badnum
(
dbv
);

757 
CONFIGURATION_LIST_COMPARE
;

759 
dbp
->
	`rx
(dbp,

760 "unknowcommd-lcfiguti keywd \"%s\"", 
me
);

765 
m
:

766 
dbp
->
	`r
(dbp, 
t
, "%s: %s=%s", 
	`G
(
ogme
), 
me
, 
vue
);

767 
r
:  (1);

768 
	}
}

775 
	$db_ld_rhd
(
dbv
, 
dbp
, 
dbtyp
, 
subdbp
, 
check
, 
key
)

776 
DB_ENV
 *
dbv
;

777 
DB
 *
dbp
;

778 
DBTYPE
 *
dbtyp
;

779 **
subdbp
;

780 *
check
, *
key
;

782 
size_t
 
bu
, 
l
, 
t
;

783 
v
;

784 
ch
, 
f
, 
hdr
, 
t
;

785 *
buf
, *
me
, *
p
, *
vue
;

787 *
dbtyp
 = 
DB_UNKNOWN
;

788 *
check
 = 0;

789 
me
 = 
NULL
;

795 
bu
 = 4096;

796 i(
	`G
(
hdrbuf
=
NULL
) {

797 
hdr
 = 0;

798 i((
buf
 = 
	`mloc
(
bu
)=
NULL
)

799 
memr
;

800 
	`G
(
hdrbuf

buf
;

801 
	`G
(
igle
G(
lo
);

803 
hdr
 = 1;

804 
buf
 = 
	`G
(
hdrbuf
);

805 
	`G
(
lo
G(
igle
);

808 
t
 = 0;

809 
f
 = 1;; first = 0) {

810 ++
	`G
(
lo
);

813 
l
 = 0;

814 
buf
 = &
	`G
(
hdrbuf
)[
t
];

815 i(
hdr
 == 0) {

817 i((
ch
 = 
	`gch
()=
EOF
) {

818 i(!
f
 || 
	`
(
d
))

819 
badfmt
;

820 
	`G
(
dofe
) = 1;

827 i(
l
 + 
t
 =
bu
) {

828 
	`G
(
hdrbuf
) =

829 
	`loc
(
	`G
(
hdrbuf
), 
bu
 *= 2);

830 i(
	`G
(
hdrbuf
=
NULL
)

831 
memr
;

832 
buf
 = &
	`G
(
hdrbuf
)[
t
];

835 i(
ch
 == '\n')

838 
buf
[
l
++] = 
ch
;

840 i(
	`G
(
dofe
) == 1)

842 
buf
[
l
++] = '\0';

844 
l
 = 
	`
(
buf
) + 1;

845 
t
 +
l
;

847 i(
me
 !
NULL
) {

848 
	`
(
me
);

849 
me
 = 
NULL
;

852 i((
me
 = 
	`rdup
(
buf
)=
NULL
)

853 
memr
;

854 i((
p
 = 
	`rchr
(
me
, '=')=
NULL
)

855 
badfmt
;

856 *
p
++ = '\0';

858 
vue
 = 
p
--;

860 i(
me
[0] == '\0')

861 
badfmt
;

870 i(
	`rcmp
(
me
, "database") == 0 ||

871 
	`rcmp
(
me
, "subdatabase") == 0) {

872 i((
t
 = 
	`db_ld_cvb
(
dbv
, 
vue
, 
subdbp
)) != 0) {

873 
dbp
->
	`r
(dbp, 
t
, "erroreading dbame");

874 
r
;

880 i(
vue
[0] == '\0')

881 
badfmt
;

883 i(
	`rcmp
(
me
, "HEADER") == 0)

885 i(
	`rcmp
(
me
, "VERSION") == 0) {

890 
	`G
(
vsi

	`oi
(
vue
);

892 i(
	`G
(
vsi
) > 3) {

893 
dbp
->
	`rx
(dbp,

895 
	`G
(
lo
), G(
vsi
));

896 
r
;

900 i(
	`rcmp
(
me
, "format") == 0) {

901 i(
	`rcmp
(
vue
, "bytevalue") == 0) {

902 *
check
 = 0;

905 i(
	`rcmp
(
vue
, "print") == 0) {

906 *
check
 = 1;

909 
badfmt
;

911 i(
	`rcmp
(
me
, "type") == 0) {

912 i(
	`rcmp
(
vue
, "btree") == 0) {

913 *
dbtyp
 = 
DB_BTREE
;

916 i(
	`rcmp
(
vue
, "hash") == 0) {

917 *
dbtyp
 = 
DB_HASH
;

920 i(
	`rcmp
(
vue
, "recno") == 0) {

921 *
dbtyp
 = 
DB_RECNO
;

924 i(
	`rcmp
(
vue
, "queue") == 0) {

925 *
dbtyp
 = 
DB_QUEUE
;

928 
dbp
->
	`rx
(dbp, "l%lu: unknowty", 
	`G
(
lo
));

929 
r
;

931 i(
	`rcmp
(
me
, "keys") == 0) {

932 i(
	`rcmp
(
vue
, "1") == 0)

933 *
key
 = 1;

934 i(
	`rcmp
(
vue
, "0") == 0)

935 *
key
 = 0;

937 
	`db_ld_badnum
(
dbv
);

938 
r
;

943 
CONFIGURATION_LIST_COMPARE
;

945 
dbp
->
	`rx
(dbp,

947 
me
);

948 
r
;

950 
t
 = 0;

953 
m
: 
dbp
->
	`r
(dbp, 
t
, "%s: %s=%s", 
	`G
(
ogme
), 
me
, 
vue
);

954 
t
 = 1;

957 
badfmt
: 
dbp
->
	`rx
(dbp, "l%lu: uxed fm", 
	`G
(
lo
));

958 
t
 = 1;

961 
memr
: 
dbp
->
	`rx
(dbp, "unableollocate memory");

962 
r
: 
t
 = 1;

964 i(
me
 !
NULL
)

965 
	`
(
me
);

966  (
t
);

967 
	}
}

976 
	#DIGITIZE
(
e
, 
v1
, 
v2
) { \

977 
_v1
, 
_v2
; \

978 
_v1
 = (
v1
); \

979 
_v2
 = (
v2
); \

980 i((
_v1
> 'f' || (
_v2
) > 'f') \

981  (
	`db_ld_badd
(
dbv
)); \

982 (
e
) = \

983 ((
_v1
) == '0' ? 0 : \

984 ((
_v1
) == '1' ? 1 : \

985 ((
_v1
) == '2' ? 2 : \

986 ((
_v1
) == '3' ? 3 : \

987 ((
_v1
) == '4' ? 4 : \

988 ((
_v1
) == '5' ? 5 : \

989 ((
_v1
) == '6' ? 6 : \

990 ((
_v1
) == '7' ? 7 : \

991 ((
_v1
) == '8' ? 8 : \

992 ((
_v1
) == '9' ? 9 : \

993 ((
_v1
) == 'a' ? 10 : \

994 ((
_v1
) == 'b' ? 11 : \

995 ((
_v1
) == 'c' ? 12 : \

996 ((
_v1
) == 'd' ? 13 : \

997 ((
_v1
) == 'e' ? 14 : 15))))))))))))))) << 4 | \

998 ((
_v2
) == '0' ? 0 : \

999 ((
_v2
) == '1' ? 1 : \

1000 ((
_v2
) == '2' ? 2 : \

1001 ((
_v2
) == '3' ? 3 : \

1002 ((
_v2
) == '4' ? 4 : \

1003 ((
_v2
) == '5' ? 5 : \

1004 ((
_v2
) == '6' ? 6 : \

1005 ((
_v2
) == '7' ? 7 : \

1006 ((
_v2
) == '8' ? 8 : \

1007 ((
_v2
) == '9' ? 9 : \

1008 ((
_v2
) == 'a' ? 10 : \

1009 ((
_v2
) == 'b' ? 11 : \

1010 ((
_v2
) == 'c' ? 12 : \

1011 ((
_v2
) == 'd' ? 13 : \

1012 ((
_v2
) == 'e' ? 14 : 15))))))))))))))); \

1013 }

	)

1029 
	$db_ld_cvb
(
dbv
, 
r
, 
out
)

1030 
DB_ENV
 *
dbv
;

1031 *
r
, **
out
;

1033 *
outr
;

1042 i((
outr
 = 
	`mloc
(
	`
(
r
+ 1)=
NULL
)

1043  (
ENOMEM
);

1045 *
out
 = 
outr
;

1047  ; *
r
 != '\0'; instr++)

1048 i(*
r
 == '\\') {

1049 i(*++
r
 == '\\') {

1050 *
outr
++ = '\\';

1053 
	`DIGITIZE
(*
outr
++, *
r
, *++instr);

1055 *
outr
++ = *
r
;

1057 *
outr
 = '\0';

1060 
	}
}

1067 
	$db_ld_dbt_rt
(
dbv
, 
db
)

1068 
DB_ENV
 *
dbv
;

1069 
DBT
 *
db
;

1071 
u_t32_t
 
n
;

1072 
u_t8_t
 *
p
;

1073 
c1
, 
c2
, 
es
, 
f
;

1074 
buf
[32];

1076 ++
	`G
(
lo
);

1078 
f
 = 1;

1079 
es
 = 0;

1080 
p
 = 
db
->
da
, 
n
 = 0; (
c1
 = 
	`gch
()) != '\n';) {

1081 i(
c1
 =
EOF
) {

1082 i(
n
 == 0) {

1083 
	`G
(
dofe
G(
doda
) = 1;

1086  (
	`db_ld_badd
(
dbv
));

1088 i(
f
) {

1089 
f
 = 0;

1090 i(
	`G
(
vsi
) > 1) {

1091 i(
c1
 != ' ') {

1092 
buf
[0] = 
c1
;

1093 i(
	`fgs
(
buf
 + 1,

1094 (
buf
- 1, 
d
=
NULL
 ||

1095 
	`rcmp
(
buf
, "DATA=END\n") != 0)

1096  (
	`db_ld_badd
(
dbv
));

1097 
	`G
(
doda
) = 1;

1103 i(
es
) {

1104 i(
c1
 != '\\') {

1105 i((
c2
 = 
	`gch
()=
EOF
)

1106  (
	`db_ld_badd
(
dbv
));

1107 
	`DIGITIZE
(
c1
, c1, 
c2
);

1109 
es
 = 0;

1111 i(
c1
 == '\\') {

1112 
es
 = 1;

1115 i(
n
 >
db
->
un
 - 10) {

1116 
db
->
un
 *= 2;

1117 i((
db
->
da
 =

1118 
	`loc
(
db
->
da
, db->
un
)=
NULL
) {

1119 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

1122 
p
 = (
u_t8_t
 *)
db
->
da
 + 
n
;

1124 ++
n
;

1125 *
p
++ = 
c1
;

1127 
db
->
size
 = 
n
;

1130 
	}
}

1137 
	$db_ld_dbt_rdump
(
dbv
, 
db
)

1138 
DB_ENV
 *
dbv
;

1139 
DBT
 *
db
;

1141 
u_t32_t
 
n
;

1142 
u_t8_t
 *
p
;

1143 
c1
, 
c2
, 
f
;

1144 
buf
[32];

1146 ++
	`G
(
lo
);

1148 
f
 = 1;

1149 
p
 = 
db
->
da
, 
n
 = 0; (
c1
 = 
	`gch
()) != '\n';) {

1150 i(
c1
 =
EOF
) {

1151 i(
n
 == 0) {

1152 
	`G
(
dofe
G(
doda
) = 1;

1155  (
	`db_ld_badd
(
dbv
));

1157 i(
f
) {

1158 
f
 = 0;

1159 i(
	`G
(
vsi
) > 1) {

1160 i(
c1
 != ' ') {

1161 
buf
[0] = 
c1
;

1162 i(
	`fgs
(
buf
 + 1,

1163 (
buf
- 1, 
d
=
NULL
 ||

1164 
	`rcmp
(
buf
, "DATA=END\n") != 0)

1165  (
	`db_ld_badd
(
dbv
));

1166 
	`G
(
doda
) = 1;

1172 i((
c2
 = 
	`gch
()=
EOF
)

1173  (
	`db_ld_badd
(
dbv
));

1174 i(
n
 >
db
->
un
 - 10) {

1175 
db
->
un
 *= 2;

1176 i((
db
->
da
 =

1177 
	`loc
(
db
->
da
, db->
un
)=
NULL
) {

1178 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

1181 
p
 = (
u_t8_t
 *)
db
->
da
 + 
n
;

1183 ++
n
;

1184 
	`DIGITIZE
(*
p
++, 
c1
, 
c2
);

1186 
db
->
size
 = 
n
;

1189 
	}
}

1196 
	$db_ld_dbt_eo
(
dbv
, 
db
, 
ishex
)

1197 
DB_ENV
 *
dbv
;

1198 
DBT
 *
db
;

1199 
ishex
;

1201 
buf
[32], *
p
, *
q
;

1202 
u_lg
 
o
;

1204 ++
	`G
(
lo
);

1206 i(
	`fgs
(
buf
, (buf), 
d
=
NULL
) {

1207 
	`G
(
dofe
G(
doda
) = 1;

1211 i(
	`rcmp
(
buf
, "DATA=END\n") == 0) {

1212 
	`G
(
doda
) = 1;

1216 i(
buf
[0] != ' ')

1217 
r
;

1223 i(
ishex
) {

1224 
p
 = 
q
 = 
buf
 + 1; *q != '\0' && *q != '\n';) {

1232 i(*
q
++ != '3')

1233 
r
;

1234 i(*
q
 == '\n' || *q == '\0')

1235 
r
;

1236 *
p
++ = *
q
++;

1238 *
p
 = '\0';

1241 i(
	`__db_gulg
(
dbv
, 
	`G
(
ogme
), 
buf
 + 1, 0, 0, &
o
))

1242 
r
;

1244 *((
db_o_t
 *)
db
->
da

o
;

1245 
db
->
size
 = (
db_o_t
);

1248 
r
:  (
	`db_ld_badd
(
dbv
));

1249 
	}
}

1252 
	$db_ld_dbt_to_o
(
dbv
, 
dbt
, 

)

1253 
DB_ENV
 *
dbv
;

1254 
DBT
 *
dbt
;

1255 
db_o_t
 *

;

1257 
buf
[32];

1259 
	`memy
(
buf
, 
dbt
->
da
, dbt->
size
);

1260 
buf
[
dbt
->
size
] = '\0';

1262  (
	`__db_gulg
(
dbv
, 
	`G
(
ogme
), 
buf
, 0, 0, (
u_lg
 *)

));

1263 
	}
}

1270 
	$db_ld_badnum
(
dbv
)

1271 
DB_ENV
 *
dbv
;

1273 
dbv
->
	`rx
(dbenv,

1275 
	}
}

1282 
	$db_ld_badd
(
dbv
)

1283 
DB_ENV
 *
dbv
;

1285 
dbv
->
	`rx
(dbenv, "unexpectednd of input data or key/dataair");

1287 
	}
}

1294 
	$db_ld_uge
()

1296 ()
	`rtf
(
dr
, "uge: %%s\n\t%s\n", 
ogme
,

1299 ()
	`rtf
(
dr
, "usage: %s %s\n",

1300 
ogme
, "-rsn | fileid [-h home] [-Password] db_file");

1301  (
EXIT_FAILURE
);

1302 
	}
}

1305 
	$db_ld_vsi_check
()

1307 
v_maj
, 
v_m
, 
v_tch
;

1310 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

1311 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

1312 
	`rtf
(
dr
,

1314 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

1315 
v_maj
, 
v_m
);

1316  (
EXIT_FAILURE
);

1319 
	}
}

	@../build_vxworks/db_printlog/db_printlog.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/f.h
"

15 
	~"dbc/hash.h
"

16 
	~"dbc/log.h
"

17 
	~"dbc/qam.h
"

18 
	~"dbc/txn.h
"

20 #ide
lt


21 cڡ 
	gcyright
[] =

25 
db_og_v__t
 
__P
((
DB_ENV
 *, 
u_t32_t
,

26 (***)(
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *), 
size_t
 *));

27 
db_og_v__t_42
 
	`__P
((
DB_ENV
 *,

28 (***)(
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *), 
size_t
 *));

29 
db_og_v__t_43
 
	`__P
((
DB_ENV
 *,

30 (***)(
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *), 
size_t
 *));

31 
db_og_v__t_45
 
	`__P
((
DB_ENV
 *,

32 (***)(
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *), 
size_t
 *));

33 
db_og_l_g
 
	`__P
((*, 
DB_LSN
 *));

34 
db_og_ma
 
	`__P
((, *[]));

35 
db_og_ݒ_p_db
 
	`__P
((
DB_ENV
 *, 
DB
 **, 
DBC
 **));

36 
db_og_t_p_cd
 
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
));

37 
db_og_uge
 
	`__P
(());

38 
db_og_vsi_check
 
	`__P
(());

40 cڡ *
ogme
;

43 
	$db_og
(
gs
)

44 *
gs
;

46 
gc
;

47 **
gv
;

49 
	`__db_ut_g
("db_og", 
gs
, &
gc
, &
gv
);

50  (
	`db_og_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

51 
	}
}

53 
	~<dio.h
>

54 
	#ERROR_RETURN
 
ERROR


	)

57 
	$db_og_ma
(
gc
, 
gv
)

58 
gc
;

59 *
gv
[];

61 
*
ݏrg
;

62 

td
, 
__db_gt_t
;

63 
DB
 *
dbp
;

64 
DBC
 *
dbc
;

65 
DBT
 
da
, 
keydbt
;

66 
DB_ENV
 *
dbv
;

67 
DB_LOGC
 *
logc
;

68 
DB_LSN
 
key
, 
t
, 

, 
v
;

69 
size_t
 
dbsize
;

70 
u_t32_t
 
logcag
, 
wvsi
, 
vsi
;

71 
ch
, 
cmp
, 
exv
, 
nag
, 
rag
, 
t
, 
pag
;

72 (**
db

	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

73 *
home
, *
sswd
;

75 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

76 
ogme
 = 
gv
[0];

78 ++
ogme
;

80 i((
t
 = 
	`db_og_vsi_check
()) != 0)

81  (
t
);

83 
dbp
 = 
NULL
;

84 
dbc
 = 
NULL
;

85 
dbv
 = 
NULL
;

86 
logc
 = 
NULL
;

87 
	`ZERO_LSN
(
t
);

88 
	`ZERO_LSN
(

);

89 
dbsize
 = 0;

90 
exv
 = 
nag
 = 
rag
 = 
pag
 = 0;

91 
db
 = 
NULL
;

92 
home
 = 
sswd
 = 
NULL
;

94 
__db_gt_t
 = 1;

95 (
ch
 = 
	`gt
(
gc
, 
gv
, "b:e:h:NP:rRV")!
EOF
)

96 
ch
) {

99 i(
	`db_og_l_g
(
ݏrg
, &
t
))

100  (
	`db_og_uge
());

104 i(
	`db_og_l_g
(
ݏrg
, &

))

105  (
	`db_og_uge
());

108 
home
 = 
ݏrg
;

111 
nag
 = 1;

114 
sswd
 = 
	`rdup
(
ݏrg
);

115 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

116 i(
sswd
 =
NULL
) {

117 
	`rtf
(
dr
, "%s: strdup: %s\n",

118 
ogme
, 
	`
(
o
));

119  (
EXIT_FAILURE
);

123 
rag
 = 1;

126 
pag
 = 1;

129 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

130  (
EXIT_SUCCESS
);

133  (
	`db_og_uge
());

135 
gc
 -
td
;

136 
gv
 +
td
;

138 i(
gc
 > 0)

139  (
	`db_og_uge
());

142 
	`__db_ut_sig
();

148 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

149 
	`rtf
(
dr
,

150 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

151 
shutdown
;

154 
dbv
->
	`t_rfe
(dbv, 
dr
);

155 
dbv
->
	`t_fx
(dbv, 
ogme
);

157 i(
nag
) {

158 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOLOCKING
, 1)) != 0) {

159 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOLOCKING");

160 
shutdown
;

162 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOPANIC
, 1)) != 0) {

163 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOPANIC");

164 
shutdown
;

168 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

169 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

170 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

171 
shutdown
;

178 i((
t
 = 
dbv
->
	`t_p_dich
(dbv, 
db_og_t_p_cd
)) != 0) {

179 
dbv
->
	`r
(dbv, 
t
, "app_dispatch");

180 
shutdown
;

190 i(
pag
) {

191 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

192 
DB_INIT_MPOOL
 | 
DB_USE_ENVIRON
, 0)) != 0 &&

193 (
t
 =
DB_VERSION_MISMATCH
 ||

194 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

195 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0))

197 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

198 
shutdown
;

200 } i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

201 (
t
 =
DB_VERSION_MISMATCH
 ||

202 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

203 
DB_CREATE
 | 
DB_INIT_LOG
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0)) != 0)) {

204 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

205 
shutdown
;

209 i(
pag
) {

210 i((
t
 = 
	`db_og_ݒ_p_db
(
dbv
, &
dbp
, &
dbc
)) != 0)

211 
shutdown
;

212 } i((
t
 = 
dbv
->
	`log_curs
(dbv, &
logc
, 0)) != 0) {

213 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_cursor");

214 
shutdown
;

217 i(
	`IS_ZERO_LSN
(
t
)) {

218 
	`memt
(&
keydbt
, 0, (keydbt));

219 
logcag
 = 
rag
 ? 
DB_PREV
 : 
DB_NEXT
;

221 
key
 = 
t
;

222 
logcag
 = 
DB_SET
;

224 
	`memt
(&
da
, 0, (data));

232 i(
pag
)

233 
vsi
 = 
DB_LOGVERSION
;

235 
vsi
 = 0;

236 
	`ZERO_LSN
(
v
);

239 i(
pag
 &&

240 (
t
 = 
	`db_og_v__t
(
dbv
, 
vsi
, &
db
, &
dbsize
)) != 0) {

241 
dbv
->
	`r
(dbv, 
t
, "callback: initialization");

242 
shutdown
;

244 ; !
	`__db_ut_ued
(); 
logcag
 = 
rag
 ? 
DB_PREV
 : 
DB_NEXT
) {

245 i(
pag
) {

246 
t
 = 
dbc
->
	`g
(dbc, &
keydbt
, &
da
, 
logcag
);

247 i(
t
 == 0)

248 
key
 = ((
REP_CONTROL
 *)
keydbt
.
da
)->
l
;

250 
t
 = 
logc
->
	`g
ogc, &
key
, &
da
, 
logcag
);

251 i(
t
 != 0) {

252 i(
t
 =
DB_NOTFOUND
)

254 
dbv
->
	`r
(dbenv,

255 
t
, 
pag
 ? "DBC->get" : "DB_LOGC->get");

256 
shutdown
;

262 i(!
	`IS_ZERO_LSN
(

)) {

263 
cmp
 = 
	`LOG_COMPARE
(&
key
, &

);

264 i((
rag
 && 
cmp
 < 0) || (!rflag && cmp > 0))

267 i(!
pag
 && 
key
.
fe
 !
v
.file) {

273 i((
t
 = 
logc
->
	`vsi
ogc, &
wvsi
, 0)) != 0) {

274 
dbv
->
	`r
(dbv, 
t
, "DB_LOGC->version");

275 
shutdown
;

277 i(
vsi
 !
wvsi
) {

278 
vsi
 = 
wvsi
;

279 i((
t
 = 
	`db_og_v__t
(
dbv
, 
vsi
,

280 &
db
, &
dbsize
)) != 0) {

281 
dbv
->
	`r
(dbv, 
t
,

283 
shutdown
;

288 
t
 = 
	`__db_dich
(
dbv
,

289 
db
, 
dbsize
, &
da
, &
key
, 
DB_TXN_PRINT
, 
NULL
);

295 ()
	`fush
(
dout
);

297 i(
t
 != 0) {

298 
dbv
->
	`r
(dbv, 
t
, "tx: dispatch");

299 
shutdown
;

304 
shutdown
: 
exv
 = 1;

306 i(
logc
 !
NULL
 && (
t
 =ogc->
	`o
(logc, 0)) != 0)

307 
exv
 = 1;

309 i(
dbc
 !
NULL
 && (
t
 = dbc->
	`o
(dbc)) != 0)

310 
exv
 = 1;

312 i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 0)) != 0)

313 
exv
 = 1;

320 i(
db
 !
NULL
)

321 
	`__os_
(
dbv
, 
db
);

322 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

323 
exv
 = 1;

324 
	`rtf
(
dr
,

325 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

328 i(
sswd
 !
NULL
)

329 
	`
(
sswd
);

332 
	`__db_ut_signd
();

334  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

335 
	}
}

341 
	$db_og_v__t
(
dbv
, 
vsi
, 
dbp
, 
dbsiz
)

342 
DB_ENV
 *
dbv
;

343 
u_t32_t
 
vsi
;

344 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

345 
size_t
 *
dbsiz
;

347 
t
;

354 i((
t
 = 
	`db_og_v__t_45
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

355  (
t
);

357 
vsi
) {

365 
DB_LOGVERSION_46
:

366 
DB_LOGVERSION_45
:

367 
DB_LOGVERSION_44
:

368 
t
 = 0;

370 
DB_LOGVERSION_43
:

371 
t
 = 
	`db_og_v__t_43
(
dbv
, 
dbp
, 
dbsiz
);

373 
DB_LOGVERSION_42
:

374 
t
 = 
	`db_og_v__t_42
(
dbv
, 
dbp
, 
dbsiz
);

377 
	`__db_rx
(
dbv
, "Unknowvsi %lu", (
u_lg
)
vsi
);

378 
t
 = 
EINVAL
;

381  (
t
);

382 
	}
}

385 
	$db_og_v__t_42
(
dbv
, 
dbp
, 
dbsiz
)

386 
DB_ENV
 *
dbv
;

387 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

388 
size_t
 *
dbsiz
;

390 
t
;

392 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

393 
__db_lk_42_t
, 
DB___db_lk_42
)) != 0)

394 
r
;

395 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

396 
__db_pg_loc_42_t
, 
DB___db_pg_loc_42
)) != 0)

397 
r
;

398 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

399 
__db_pg__42_t
, 
DB___db_pg__42
)) != 0)

400 
r
;

401 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

402 
__db_pg_da_42_t
, 
DB___db_pg_da_42
)) != 0)

403 
r
;

404 #i
HAVE_HASH


405 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

406 
__ham_magroup_42_t
, 
DB___ham_magroup_42
)) != 0)

407 
r
;

408 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

409 
__ham_grouoc_42_t
, 
DB___ham_grouoc_42
)) != 0)

410 
r
;

412 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

413 
__txn_ckp_42_t
, 
DB___txn_ckp_42
)) != 0)

414 
r
;

415 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

416 
__txn_g_42_t
, 
DB___txn_g_42
)) != 0)

417 
r
;

418 
r
:

419  (
t
);

420 
	}
}

423 
	$db_og_v__t_43
(
dbv
, 
dbp
, 
dbsiz
)

424 
DB_ENV
 *
dbv
;

425 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

426 
size_t
 *
dbsiz
;

428 
t
;

430 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

431 
__bam_lk_43_t
, 
DB___bam_lk_43
)) != 0)

432 
r
;

436 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

437 
__txn_g_42_t
, 
DB___txn_g_42
)) != 0)

438 
r
;

439 
r
:

440  (
t
);

441 
	}
}

448 
	$db_og_v__t_45
(
dbv
, 
dbp
, 
dbsiz
)

449 
DB_ENV
 *
dbv
;

450 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

451 
size_t
 *
dbsiz
;

453 
t
;

455 i((
t
 = 
	`__bam__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

456 
r
;

457 i((
t
 = 
	`__d__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

458 
r
;

459 i((
t
 = 
	`__db__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

460 
r
;

461 i((
t
 = 
	`__dbg__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

462 
r
;

463 i((
t
 = 
	`__f__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

464 
r
;

465 #ifde
HAVE_HASH


466 i((
t
 = 
	`__ham__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

467 
r
;

469 #ifde
HAVE_QUEUE


470 i((
t
 = 
	`__qam__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

471 
r
;

473 i((
t
 = 
	`__txn__t
(
dbv
, 
dbp
, 
dbsiz
)) != 0)

474 
r
;

475 
r
:

476  (
t
);

477 
	}
}

480 
	$db_og_uge
()

482 
	`rtf
(
dr
, "uge: %%s\n", 
ogme
,

484  (
EXIT_FAILURE
);

485 
	}
}

488 
	$db_og_vsi_check
()

490 
v_maj
, 
v_m
, 
v_tch
;

493 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

494 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

495 
	`rtf
(
dr
,

497 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

498 
v_maj
, 
v_m
);

499  (
EXIT_FAILURE
);

502 
	}
}

506 
	$db_og_t_p_cd
(
dbv
, 
dbt
, 
lp
, 

)

507 
DB_ENV
 *
dbv
;

508 
DBT
 *
dbt
;

509 
DB_LSN
 *
lp
;

510 
db_cs
 

;

512 
ch
;

513 
u_t32_t
 
i
, 
y
;

515 
	`DB_ASSERT
(
dbv
, 

 =
DB_TXN_PRINT
);

517 
	`COMPQUIET
(
dbv
, 
NULL
);

518 
	`COMPQUIET
(

, 
DB_TXN_PRINT
);

524 
	`memy
(&
y
, 
dbt
->
da
, (rectype));

531 
	`tf
("[%lu][%lu]application specificecord:ec: %lu\n",

532 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
, (u_lg)
y
);

533 
	`tf
("\tdata: ");

534 
i
 = 0; i < 
dbt
->
size
; i++) {

535 
ch
 = ((
u_t8_t
 *)
dbt
->
da
)[
i
];

536 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

538 
	`tf
("\n\n");

541 
	}
}

544 
	$db_og_ݒ_p_db
(
dbv
, 
db
, 
db
)

545 
DB_ENV
 *
dbv
;

546 
DB
 **
db
;

547 
DBC
 **
db
;

549 
t
;

551 
DB
 *
dbp
;

552 *
db
 = 
NULL
;

553 *
db
 = 
NULL
;

555 i((
t
 = 
	`db_
(
db
, 
dbv
, 0)) != 0) {

556 
dbv
->
	`r
(dbv, 
t
, "db_create");

557  (
t
);

560 
dbp
 = *
db
;

561 i((
t
 =

562 
dbp
->
	`ݒ
(dbp, 
NULL
, 
REPDBNAME
, NULL, 
DB_BTREE
, 0, 0)) != 0) {

563 
dbv
->
	`r
(dbv, 
t
, "DB->open");

564 
r
;

567 i((
t
 = 
dbp
->
	`curs
(dbp, 
NULL
, 
db
, 0)) != 0) {

568 
dbv
->
	`r
(dbv, 
t
, "DB->cursor");

569 
r
;

574 
r
: i(*
db
 !
NULL
)

575 ()(*
db
)->
	`o
(*dbpp, 0);

576  (
t
);

577 
	}
}

584 
	$db_og_l_g
(
g
, 
lp
)

585 *
g
;

586 
DB_LSN
 *
lp
;

588 
u_lg
 
uv
;

589 *
p
;

594 i((
p
 = 
	`rchr
(
g
, '/')=
NULL
)

596 *
p
 = '\0';

598 i(
	`__db_gulg
(
NULL
, 
ogme
, 
g
, 0, 
UINT32_MAX
, &
uv
))

600 
lp
->
fe
 = 
uv
;

601 i(
	`__db_gulg
(
NULL
, 
ogme
, 
p
 + 1, 0, 
UINT32_MAX
, &
uv
))

603 
lp
->
offt
 = 
uv
;

605 
	}
}

	@../build_vxworks/db_recover/db_recover.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 
db_cov_edback
 
__P
((
DB_ENV
 *, , ));

19 
db_cov_ma
 
__P
((, *[]));

20 
db_cov_ad_timeamp
 
__P
((*, 
time_t
 *));

21 
db_cov_uge
 
__P
(());

22 
db_cov_vsi_check
 
__P
(());

24 cڡ *
	gogme
;

25 
	gwle_eded
;

28 
	$db_cov
(
gs
)

29 *
gs
;

31 
gc
;

32 **
gv
;

34 
	`__db_ut_g
("db_cov", 
gs
, &
gc
, &
gv
);

35  (
	`db_cov_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

36 
	}
}

38 
	~<dio.h
>

39 
	#ERROR_RETURN
 
ERROR


	)

42 
	$db_cov_ma
(
gc
, 
gv
)

43 
gc
;

44 *
gv
[];

46 
*
ݏrg
;

47 

td
, 
__db_gt_t
;

48 
DB_ENV
 *
dbv
;

49 
time_t
 
timeamp
;

50 
u_t32_t
 
ags
;

51 
ch
, 
exv
, 
l_cov
, 
t
, 
_v
, 
t_edback
, 
vbo
;

52 *
home
, *
sswd
;

54 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

55 
ogme
 = 
gv
[0];

57 ++
ogme
;

59 i((
t
 = 
	`db_cov_vsi_check
()) != 0)

60  (
t
);

62 
home
 = 
sswd
 = 
NULL
;

63 
timeamp
 = 0;

64 
exv
 = 
l_cov
 = 
_v
 = 
t_edback
 = 
vbo
 = 0;

65 
__db_gt_t
 = 1;

66 (
ch
 = 
	`gt
(
gc
, 
gv
, "fh:P:t:Vv")!
EOF
)

67 
ch
) {

69 
l_cov
 = 1;

72 
_v
 = 1;

75 
t_edback
 = 1;

78 
home
 = 
ݏrg
;

81 
sswd
 = 
	`rdup
(
ݏrg
);

82 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

83 i(
sswd
 =
NULL
) {

84 
	`rtf
(
dr
, "%s: strdup: %s\n",

85 
ogme
, 
	`
(
o
));

86  (
EXIT_FAILURE
);

90 i((
t
 = 
	`db_cov_ad_timeamp
(
ݏrg
, &
timeamp
)) != 0)

91  (
t
);

94 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

95  (
EXIT_SUCCESS
);

97 
vbo
 = 1;

101  (
	`db_cov_uge
());

103 
gc
 -
td
;

104 
gv
 +
td
;

106 i(
gc
 != 0)

107  (
	`db_cov_uge
());

110 
	`__db_ut_sig
();

116 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

117 
	`rtf
(
dr
,

118 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

119  (
EXIT_FAILURE
);

121 
dbv
->
	`t_rfe
(dbv, 
dr
);

122 
dbv
->
	`t_fx
(dbv, 
ogme
);

123 i(
t_edback
)

124 ()
dbv
->
	`t_edback
(dbv, 
db_cov_edback
);

125 i(
vbo
)

126 ()
dbv
->
	`t_vbo
(dbv, 
DB_VERB_RECOVERY
, 1);

127 i(
timeamp
 &&

128 (
t
 = 
dbv
->
	`t_tx_timeamp
(dbv, &
timeamp
)) != 0) {

129 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->set_timestamp");

130 
shutdown
;

133 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

134 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

135 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

136 
shutdown
;

151 
ags
 = 0;

152 
	`LF_SET
(
DB_CREATE
 | 
DB_INIT_LOG
 |

153 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_USE_ENVIRON
);

154 
	`LF_SET
(
l_cov
 ? 
DB_RECOVER_FATAL
 : 
DB_RECOVER
);

155 
	`LF_SET
(
_v
 ? 
DB_INIT_LOCK
 : 
DB_PRIVATE
);

156 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
ags
, 0)) != 0) {

157 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

158 
shutdown
;

162 
shutdown
: 
exv
 = 1;

166 i(
wle_eded
)

167 
	`tf
("\n");

170 i((
t
 = 
dbv
->
	`o
(dbenv, 0)) != 0) {

171 
exv
 = 1;

172 
	`rtf
(
dr
,

173 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

175 i(
sswd
 !
NULL
)

176 
	`
(
sswd
);

179 
	`__db_ut_signd
();

181  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

182 
	}
}

189 
	$db_cov_edback
(
dbv
, 
code
, 
r
)

190 
DB_ENV
 *
dbv
;

191 
code
;

192 
r
;

194 
	`COMPQUIET
(
dbv
, 
NULL
);

196 i(
code
 =
DB_RECOVER
) {

197 
	`tf
("\ecovy %d%% come", 
r
);

198 ()
	`fush
(
dout
);

199 
wle_eded
 = 1;

201 
	}
}

203 
	#ATOI2
(

(r)[0] - '0'* 10 + (r)[1] - '0'); (+2;

	)

237 
	$db_cov_ad_timeamp
(
g
, 
tim
)

238 *
g
;

239 
time_t
 *
tim
;

241 
tm
 *
t
;

242 
time_t
 
now
;

243 
yrt
;

244 *
p
;

246 ()
	`time
(&
now
);

247 i((
t
 = 
	`loime
(&
now
)=
NULL
) {

248 
	`rtf
(
dr
,

249 "%s:oime: %s\n", 
ogme
, 
	`
(
o
));

250  (
EXIT_FAILURE
);

253 i((
p
 = 
	`rchr
(
g
, '.')=
NULL
)

254 
t
->
tm_c
 = 0;

256 i(
	`
(
p
 + 1) != 2)

257 

;

258 *
p
++ = '\0';

259 
t
->
tm_c
 = 
	`ATOI2
(
p
);

262 
yrt
 = 0;

263 
	`
(
g
)) {

265 
t
->
tm_yr
 = 
	`ATOI2
(
g
);

266 
t
->
tm_yr
 *= 100;

267 
yrt
 = 1;

270 i(
yrt
) {

271 
yrt
 = 
	`ATOI2
(
g
);

272 
t
->
tm_yr
 +
yrt
;

274 
yrt
 = 
	`ATOI2
(
g
);

275 i(
yrt
 < 69)

276 
t
->
tm_yr
 = 
yrt
 + 2000;

278 
t
->
tm_yr
 = 
yrt
 + 1900;

280 
t
->
tm_yr
 -= 1900;

283 
t
->
tm_m
 = 
	`ATOI2
(
g
);

284 --
t
->
tm_m
;

285 
t
->
tm_mday
 = 
	`ATOI2
(
g
);

286 
t
->
tm_hour
 = 
	`ATOI2
(
g
);

287 
t
->
tm_m
 = 
	`ATOI2
(
g
);

290 

;

293 
t
->
tm_isd
 = -1;

295 *
tim
 = 
	`mktime
(
t
);

296 i(*
tim
 == -1) {

297 

: 
	`rtf
(
dr
,

299 
ogme
);

300  (
EXIT_FAILURE
);

303 
	}
}

306 
	$db_cov_uge
()

308 ()
	`rtf
(
dr
, "uge: %%s\n", 
ogme
,

310  (
EXIT_FAILURE
);

311 
	}
}

314 
	$db_cov_vsi_check
()

316 
v_maj
, 
v_m
, 
v_tch
;

319 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

320 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

321 
	`rtf
(
dr
,

323 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

324 
v_maj
, 
v_m
);

325  (
EXIT_FAILURE
);

328 
	}
}

	@../build_vxworks/db_stat/db_stat.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 um { 
	mT_NOTSET
, 
	mT_DB
,

19 
	mT_ENV
, 
	mT_LOCK
, 
	mT_LOG
, 
	mT_MPOOL
, 
	mT_MUTEX
, 
	mT_REP
, 
	mT_TXN
 } 
	t_t
;

21 
db__db_
 
__P
((
DB_ENV
 *, *, 
_t
, 
u_t32_t
, *));

22 
db__ma
 
__P
((, *[]));

23 
db__uge
 
__P
(());

24 
db__vsi_check
 
__P
(());

26 cڡ *
	gogme
;

29 
	$db_
(
gs
)

30 *
gs
;

32 
gc
;

33 **
gv
;

35 
	`__db_ut_g
("db_", 
gs
, &
gc
, &
gv
);

36  (
	`db__ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

37 
	}
}

39 
	~<dio.h
>

40 
	#ERROR_RETURN
 
ERROR


	)

43 
	$db__ma
(
gc
, 
gv
)

44 
gc
;

45 *
gv
[];

47 
*
ݏrg
;

48 

td
, 
__db_gt_t
;

49 
DB_ENV
 *
dbv
;

50 
DB
 *
dbp
;

51 
_t
 
y
;

52 
u_t32_t
 
che
, 
ags
;

53 
ch
, 
exv
;

54 
nag
, 
ive
, 
size
, 
t
;

55 *
db
, *
home
, *
p
, *
sswd
, *
subdb
;

57 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

58 
ogme
 = 
gv
[0];

60 ++
ogme
;

62 i((
t
 = 
	`db__vsi_check
()) != 0)

63  (
t
);

65 
dbv
 = 
NULL
;

66 
dbp
 = 
NULL
;

67 
y
 = 
T_NOTSET
;

68 
che
 = 
MEGABYTE
;

69 
exv
 = 
ags
 = 
nag
 = 
ive
 = 0;

70 
db
 = 
home
 = 
sswd
 = 
subdb
 = 
NULL
;

72 
__db_gt_t
 = 1;

73 (
ch
 = 
	`gt
(
gc
,

74 
gv
, "C:cd:Eefgh:L:lM:mNP:R:rs:tVxX:Z")!
EOF
)

75 
ch
) {

77 i(
y
 !
T_NOTSET
 &&ty !
T_LOCK
)

78 
gcombo
;

79 
y
 = 
T_LOCK
;

80 i(
ch
 != 'c')

81 
p
 = 
ݏrg
; *p; ++p)

82 *
p
) {

84 
	`LF_SET
(
DB_STAT_ALL
);

87 
	`LF_SET
(
DB_STAT_LOCK_CONF
);

90 
	`LF_SET
(
DB_STAT_LOCK_LOCKERS
);

95 
	`LF_SET
(
DB_STAT_LOCK_OBJECTS
);

98 
	`LF_SET
(
DB_STAT_LOCK_PARAMS
);

101  (
	`db__uge
());

105 i(
y
 !
T_NOTSET
 &&ty !
T_DB
)

106 
gcombo
;

107 
y
 = 
T_DB
;

108 
db
 = 
ݏrg
;

111 i(
y
 !
T_NOTSET
 &&ty !
T_ENV
)

112 
gcombo
;

113 
y
 = 
T_ENV
;

114 
	`LF_SET
(
DB_STAT_SUBSYSTEM
);

115 i(
ch
 == 'E')

116 
	`LF_SET
(
DB_STAT_ALL
);

119 i(
y
 !
T_NOTSET
 &&ty !
T_DB
)

120 
gcombo
;

121 
y
 = 
T_DB
;

122 
	`LF_SET
(
DB_FAST_STAT
);

125 
home
 = 
ݏrg
;

128 i(
y
 !
T_NOTSET
 &&ty !
T_LOG
)

129 
gcombo
;

130 
y
 = 
T_LOG
;

131 i(
ch
 != 'l')

132 
p
 = 
ݏrg
; *p; ++p)

133 *
p
) {

135 
	`LF_SET
(
DB_STAT_ALL
);

138  (
	`db__uge
());

142 i(
y
 !
T_NOTSET
 &&ty !
T_MPOOL
)

143 
gcombo
;

144 
y
 = 
T_MPOOL
;

145 i(
ch
 != 'm')

146 
p
 = 
ݏrg
; *p; ++p)

147 *
p
) {

149 
	`LF_SET
(
DB_STAT_ALL
);

152 
	`LF_SET
(
DB_STAT_MEMP_HASH
);

157  (
	`db__uge
());

161 
nag
 = 1;

164 
sswd
 = 
	`rdup
(
ݏrg
);

165 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

166 i(
sswd
 =
NULL
) {

167 
	`rtf
(
dr
, "%s: strdup: %s\n",

168 
ogme
, 
	`
(
o
));

169  (
EXIT_FAILURE
);

173 i(
y
 !
T_NOTSET
 &&ty !
T_REP
)

174 
gcombo
;

175 
y
 = 
T_REP
;

176 i(
ch
 != 'r')

177 
p
 = 
ݏrg
; *p; ++p)

178 *
p
) {

180 
	`LF_SET
(
DB_STAT_ALL
);

183  (
	`db__uge
());

187 i(
y
 !
T_NOTSET
 &&ty !
T_DB
)

188 
gcombo
;

189 
y
 = 
T_DB
;

190 
subdb
 = 
ݏrg
;

193 i(
y
 !
T_NOTSET
) {

194 
gcombo
: 
	`rtf
(
dr
,

196 
ogme
);

197  (
	`db__uge
());

199 
y
 = 
T_TXN
;

202 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

203  (
EXIT_SUCCESS
);

205 i(
y
 !
T_NOTSET
 &&ty !
T_MUTEX
)

206 
gcombo
;

207 
y
 = 
T_MUTEX
;

208 i(
ch
 != 'x')

209 
p
 = 
ݏrg
; *p; ++p)

210 *
p
) {

212 
	`LF_SET
(
DB_STAT_ALL
);

215  (
	`db__uge
());

219 
	`LF_SET
(
DB_STAT_CLEAR
);

223  (
	`db__uge
());

225 
gc
 -
td
;

226 
gv
 +
td
;

228 
y
) {

229 
T_DB
:

230 i(
db
 =
NULL
)

231  (
	`db__uge
());

233 
T_ENV
:

234 
T_LOCK
:

235 
T_LOG
:

236 
T_MPOOL
:

237 
T_MUTEX
:

238 
T_REP
:

239 
T_TXN
:

241 
T_NOTSET
:

242  (
	`db__uge
());

246 
	`__db_ut_sig
();

252 
y
: i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

253 
	`rtf
(
dr
,

254 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

255 
r
;

258 
dbv
->
	`t_rfe
(dbv, 
dr
);

259 
dbv
->
	`t_fx
(dbv, 
ogme
);

261 i(
nag
) {

262 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOLOCKING
, 1)) != 0) {

263 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOLOCKING");

264 
r
;

266 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOPANIC
, 1)) != 0) {

267 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOPANIC");

268 
r
;

272 i(
sswd
 !
NULL
 &&

273 (
t
 = 
dbv
->
	`t_y
(dbv, 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

274 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

275 
r
;

279 i(
	`db__db_
(
dbv
, 
home
, 
y
, 
che
, &
ive
) != 0)

280 
r
;

282 
y
) {

283 
T_DB
:

285 i((
t
 = 
	`db_
(&
dbp
, 
dbv
, 0)) != 0) {

286 
dbv
->
	`r
(dbv, 
t
, "db_create");

287 
r
;

299 
dbv
->
	`t_rfe
(dbv, 
NULL
);

300 
t
 = 
dbp
->
	`ݒ
(dbp, 
NULL
, 
db
, 
subdb
, 
DB_UNKNOWN
, 0, 0);

301 
dbv
->
	`t_rfe
(dbv, 
dr
);

302 i(
t
 !0 && (
dbp
->
	`ݒ
(

303 
dbp
, 
NULL
, 
db
, 
subdb
, 
DB_UNKNOWN
, 
DB_RDONLY
, 0)) != 0) {

304 
dbv
->
	`r
(dbv, 
t
, "DB->ݒ: %s", 
db
);

305 
r
;

309 i(
ive
) {

310 i((
t
 = 
	`__db_ut_che
(
dbp
, &
che
, &
size
)) != 0)

311 
r
;

312 i(
size
) {

313 ()
dbp
->
	`o
(dbp, 
DB_NOSYNC
);

314 
dbp
 = 
NULL
;

316 ()
dbv
->
	`o
(dbenv, 0);

317 
dbv
 = 
NULL
;

318 
y
;

322 i(
dbp
->
	`_t
(dbp, 
ags
))

323 
r
;

325 
T_ENV
:

326 i(
dbv
->
	`_t
(dbv, 
ags
))

327 
r
;

329 
T_LOCK
:

330 i(
dbv
->
	`lock__t
(dbv, 
ags
))

331 
r
;

333 
T_LOG
:

334 i(
dbv
->
	`log__t
(dbv, 
ags
))

335 
r
;

337 
T_MPOOL
:

338 i(
dbv
->
	`memp__t
(dbv, 
ags
))

339 
r
;

341 
T_MUTEX
:

342 i(
dbv
->
	`mux__t
(dbv, 
ags
))

343 
r
;

345 
T_REP
:

346 #ifde
HAVE_REPLICATION_THREADS


347 i(
dbv
->
	`pmgr__t
(dbv, 
ags
))

348 
r
;

350 i(
dbv
->
	`p__t
(dbv, 
ags
))

351 
r
;

353 
T_TXN
:

354 i(
dbv
->
	`txn__t
(dbv, 
ags
))

355 
r
;

357 
T_NOTSET
:

358 
dbv
->
	`rx
(dbenv, "Unknown statistics flag");

359 
r
;

363 
r
: 
exv
 = 1;

365 i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 
DB_NOSYNC
)) != 0) {

366 
exv
 = 1;

367 
dbv
->
	`r
(dbv, 
t
, "close");

369 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

370 
exv
 = 1;

371 
	`rtf
(
dr
,

372 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

375 i(
sswd
 !
NULL
)

376 
	`
(
sswd
);

379 
	`__db_ut_signd
();

381  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

382 
	}
}

389 
	$db__db_
(
dbv
, 
home
, 
y
, 
che
, 
is_ive
)

390 
DB_ENV
 *
dbv
;

391 *
home
;

392 
_t
 
y
;

393 
u_t32_t
 
che
;

394 *
is_ive
;

396 
u_t32_t
 
oags
;

397 
t
;

409 *
is_ive
 = 0;

410 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) == 0)

412 i(
t
 =
DB_VERSION_MISMATCH
)

413 
r
;

414 i(
y
 !
T_DB
 &&ty !
T_LOG
) {

415 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open%s%s",

416 
home
 =
NULL
 ? "" : ": ", home == NULL ? "" : home);

430 i((
t
 = 
dbv
->
	`t_chesize
(dbv, 0, 
che
, 1)) != 0) {

431 
dbv
->
	`r
(dbv, 
t
, "set_cachesize");

434 *
is_ive
 = 1;

435 
oags
 = 
DB_CREATE
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
;

436 i(
y
 =
T_DB
)

437 
oags
 |
DB_INIT_MPOOL
;

438 i(
y
 =
T_LOG
)

439 
oags
 |
DB_INIT_LOG
;

440 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
oags
, 0)) == 0)

444 
r
: 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

446 
	}
}

449 
	$db__uge
()

451 
	`rtf
(
dr
, "uge: %%s\n", 
ogme
,

453 
	`rtf
(
dr
, "uge: %%s\n\t%s\n", 
ogme
,

456  (
EXIT_FAILURE
);

457 
	}
}

460 
	$db__vsi_check
()

462 
v_maj
, 
v_m
, 
v_tch
;

465 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

466 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

467 
	`rtf
(
dr
,

469 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

470 
v_maj
, 
v_m
);

471  (
EXIT_FAILURE
);

474 
	}
}

	@../build_vxworks/db_upgrade/db_upgrade.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 
db_upgde_ma
 
__P
((, *[]));

19 
db_upgde_uge
 
__P
(());

20 
db_upgde_vsi_check
 
__P
(());

22 cڡ *
	gogme
;

25 
	$db_upgde
(
gs
)

26 *
gs
;

28 
gc
;

29 **
gv
;

31 
	`__db_ut_g
("db_upgde", 
gs
, &
gc
, &
gv
);

32  (
	`db_upgde_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

33 
	}
}

35 
	~<dio.h
>

36 
	#ERROR_RETURN
 
ERROR


	)

39 
	$db_upgde_ma
(
gc
, 
gv
)

40 
gc
;

41 *
gv
[];

43 
*
ݏrg
;

44 

td
, 
__db_gt_t
;

45 
DB
 *
dbp
;

46 
DB_ENV
 *
dbv
;

47 
u_t32_t
 
ags
;

48 
ch
, 
exv
, 
nag
, 
t
, 
t_t
, 
vbo
;

49 *
home
, *
sswd
;

51 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

52 
ogme
 = 
gv
[0];

54 ++
ogme
;

56 i((
t
 = 
	`db_upgde_vsi_check
()) != 0)

57  (
t
);

59 
dbv
 = 
NULL
;

60 
ags
 = 
nag
 = 
vbo
 = 0;

61 
exv
 = 0;

62 
home
 = 
sswd
 = 
NULL
;

63 
__db_gt_t
 = 1;

64 (
ch
 = 
	`gt
(
gc
, 
gv
, "h:NP:sVv")!
EOF
)

65 
ch
) {

67 
home
 = 
ݏrg
;

70 
nag
 = 1;

73 
sswd
 = 
	`rdup
(
ݏrg
);

74 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

75 i(
sswd
 =
NULL
) {

76 
	`rtf
(
dr
, "%s: strdup: %s\n",

77 
ogme
, 
	`
(
o
));

78  (
EXIT_FAILURE
);

82 
	`LF_SET
(
DB_DUPSORT
);

85 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

86  (
EXIT_SUCCESS
);

88 
vbo
 = 1;

92  (
	`db_upgde_uge
());

94 
gc
 -
td
;

95 
gv
 +
td
;

97 i(
gc
 <= 0)

98  (
	`db_upgde_uge
());

101 
	`__db_ut_sig
();

107 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

108 
	`rtf
(
dr
, "%s: db_env_create: %s\n",

109 
ogme
, 
	`db_
(
t
));

110 
shutdown
;

113 
dbv
->
	`t_rfe
(dbv, 
dr
);

114 
dbv
->
	`t_fx
(dbv, 
ogme
);

116 i(
nag
) {

117 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOLOCKING
, 1)) != 0) {

118 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOLOCKING");

119 
shutdown
;

121 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOPANIC
, 1)) != 0) {

122 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOPANIC");

123 
shutdown
;

127 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

128 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

129 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

130 
shutdown
;

137 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

138 (
t
 =
DB_VERSION_MISMATCH
 ||

139 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

140 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
,

142 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

143 
shutdown
;

146 ; !
	`__db_ut_ued
(&& 
gv
[0] !
NULL
; ++argv) {

147 i((
t
 = 
	`db_
(&
dbp
, 
dbv
, 0)) != 0) {

148 
	`rtf
(
dr
,

149 "%s: db_: %s\n", 
ogme
, 
	`db_
(
t
));

150 
shutdown
;

152 
dbp
->
	`t_rfe
(dbp, 
dr
);

153 
dbp
->
	`t_fx
(dbp, 
ogme
);

154 i((
t
 = 
dbp
->
	`upgde
(dbp, 
gv
[0], 
ags
)) != 0)

155 
dbp
->
	`r
(dbp, 
t
, "DB->upgde: %s", 
gv
[0]);

156 i((
t_t
 = 
dbp
->
	`o
(dbp, 0)!0 && 
t
 == 0) {

157 
dbv
->
	`r
(dbv, 
t
, "DB->o: %s", 
gv
[0]);

158 
t
 = 
t_t
;

160 i(
t
 != 0)

161 
shutdown
;

166 i(
vbo
)

167 
	`tf
("%s: %s upgraded successfully\n",

168 
ogme
, 
gv
[0]);

172 
shutdown
: 
exv
 = 1;

174 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

175 
exv
 = 1;

176 
	`rtf
(
dr
,

177 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

180 i(
sswd
 !
NULL
)

181 
	`
(
sswd
);

184 
	`__db_ut_signd
();

186  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

187 
	}
}

190 
	$db_upgde_uge
()

192 
	`rtf
(
dr
, "uge: %%s\n", 
ogme
,

194  (
EXIT_FAILURE
);

195 
	}
}

198 
	$db_upgde_vsi_check
()

200 
v_maj
, 
v_m
, 
v_tch
;

203 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

204 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

205 
	`rtf
(
dr
,

207 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

208 
v_maj
, 
v_m
);

209  (
EXIT_FAILURE
);

212 
	}
}

	@../build_vxworks/db_verify/db_verify.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #ide
lt


14 cڡ 
	gcyright
[] =

18 
db_vify_ma
 
__P
((, *[]));

19 
db_vify_uge
 
__P
(());

20 
db_vify_vsi_check
 
__P
(());

22 cڡ *
	gogme
;

25 
	$db_vify
(
gs
)

26 *
gs
;

28 
gc
;

29 **
gv
;

31 
	`__db_ut_g
("db_vify", 
gs
, &
gc
, &
gv
);

32  (
	`db_vify_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

33 
	}
}

35 
	~<dio.h
>

36 
	#ERROR_RETURN
 
ERROR


	)

39 
	$db_vify_ma
(
gc
, 
gv
)

40 
gc
;

41 *
gv
[];

43 
*
ݏrg
;

44 

td
, 
__db_gt_t
;

45 
DB
 *
dbp
, *
dbp1
;

46 
DB_ENV
 *
dbv
;

47 
u_t32_t
 
ags
, 
che
;

48 
ch
, 
exv
, 
nag
, 
ive
;

49 
qut
, 
size
, 
t
;

50 *
home
, *
sswd
;

52 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

53 
ogme
 = 
gv
[0];

55 ++
ogme
;

57 i((
t
 = 
	`db_vify_vsi_check
()) != 0)

58  (
t
);

60 
dbv
 = 
NULL
;

61 
dbp
 = 
NULL
;

62 
che
 = 
MEGABYTE
;

63 
exv
 = 
nag
 = 
qut
 = 0;

64 
ags
 = 0;

65 
home
 = 
sswd
 = 
NULL
;

66 
__db_gt_t
 = 1;

67 (
ch
 = 
	`gt
(
gc
, 
gv
, "h:NoP:quV")!
EOF
)

68 
ch
) {

70 
home
 = 
ݏrg
;

73 
nag
 = 1;

76 
sswd
 = 
	`rdup
(
ݏrg
);

77 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

78 i(
sswd
 =
NULL
) {

79 
	`rtf
(
dr
, "%s: strdup: %s\n",

80 
ogme
, 
	`
(
o
));

81  (
EXIT_FAILURE
);

85 
	`LF_SET
(
DB_NOORDERCHK
);

88 
qut
 = 1;

91 
	`LF_SET
(
DB_UNREF
);

94 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

95  (
EXIT_SUCCESS
);

98  (
	`db_vify_uge
());

100 
gc
 -
td
;

101 
gv
 +
td
;

103 i(
gc
 <= 0)

104  (
	`db_vify_uge
());

107 
	`__db_ut_sig
();

113 
y
: i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

114 
	`rtf
(
dr
,

115 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

116 
shutdown
;

119 i(!
qut
) {

120 
dbv
->
	`t_rfe
(dbv, 
dr
);

121 
dbv
->
	`t_fx
(dbv, 
ogme
);

124 i(
nag
) {

125 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOLOCKING
, 1)) != 0) {

126 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOLOCKING");

127 
shutdown
;

129 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOPANIC
, 1)) != 0) {

130 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOPANIC");

131 
shutdown
;

135 i(
sswd
 !
NULL
 &&

136 (
t
 = 
dbv
->
	`t_y
(dbv, 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

137 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

138 
shutdown
;

145 
ive
 = 0;

146 i((
t
 =

147 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_INIT_MPOOL
 | 
DB_USE_ENVIRON
, 0)) != 0) {

148 i(
t
 !
DB_VERSION_MISMATCH
) {

149 i((
t
 =

150 
dbv
->
	`t_chesize
(dbv, 0, 
che
, 1)) != 0) {

151 
dbv
->
	`r
(dbv, 
t
, "set_cachesize");

152 
shutdown
;

154 
ive
 = 1;

155 
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_CREATE
 |

156 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0);

158 i(
t
 != 0) {

159 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

160 
shutdown
;

169 ; !
	`__db_ut_ued
(&& 
gv
[0] !
NULL
; ++argv) {

170 i((
t
 = 
	`db_
(&
dbp
, 
dbv
, 0)) != 0) {

171 
dbv
->
	`r
(dbv, 
t
, "%s: db_", 
ogme
);

172 
shutdown
;

175 i(
	`TXN_ON
(
dbv
) &&

176 (
t
 = 
dbp
->
	`t_ags
(dbp, 
DB_TXN_NOT_DURABLE
)) != 0) {

177 
dbv
->
	`r
(

178 
dbv
, 
t
, "%s: db_t_ags", 
ogme
);

179 
shutdown
;

190 i(
ive
) {

191 i((
t
 = 
	`db_
(&
dbp1
, 
dbv
, 0)) != 0) {

192 
dbv
->
	`r
(

193 
dbv
, 
t
, "%s: db_", 
ogme
);

194 
shutdown
;

197 i(
	`TXN_ON
(
dbv
&& (
t
 =

198 
dbp1
->
	`t_ags
(dbp1, 
DB_TXN_NOT_DURABLE
)) != 0) {

199 
dbv
->
	`r
(

200 
dbv
, 
t
, "%s: db_t_ags", 
ogme
);

201 
shutdown
;

204 
t
 = 
dbp1
->
	`ݒ
(dbp1,

205 
NULL
, 
gv
[0], NULL, 
DB_UNKNOWN
, 
DB_RDONLY
, 0);

215 i(
t
 == 0) {

216 i(
	`__db_ut_che
(

217 
dbp1
, &
che
, &
size
) == 0 &&esize) {

218 ()
dbp1
->
	`o
(dbp1, 0);

219 ()
dbp
->
	`o
(dbp, 0);

220 
dbp
 = 
NULL
;

222 ()
dbv
->
	`o
(dbenv, 0);

223 
dbv
 = 
NULL
;

224 
y
;

227 ()
dbp1
->
	`o
(dbp1, 0);

231 
t
 = 
dbp
->
	`vify
(dbp, 
gv
[0], 
NULL
, NULL, 
ags
);

232 
dbp
 = 
NULL
;

233 i(
t
 != 0)

234 
shutdown
;

238 
shutdown
: 
exv
 = 1;

241 i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 0)) != 0) {

242 
exv
 = 1;

243 
dbv
->
	`r
(dbv, 
t
, "close");

245 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

246 
exv
 = 1;

247 
	`rtf
(
dr
,

248 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

251 i(
sswd
 !
NULL
)

252 
	`
(
sswd
);

255 
	`__db_ut_signd
();

257  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

258 
	}
}

261 
	$db_vify_uge
()

263 
	`rtf
(
dr
, "uge: %%s\n", 
ogme
,

265  (
EXIT_FAILURE
);

266 
	}
}

269 
	$db_vify_vsi_check
()

271 
v_maj
, 
v_m
, 
v_tch
;

274 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

275 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

276 
	`rtf
(
dr
,

278 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

279 
v_maj
, 
v_m
);

280  (
EXIT_FAILURE
);

283 
	}
}

	@../build_vxworks/dbdemo/dbdemo.c

9 
	~<sys/tys.h
>

11 
	~<dio.h
>

12 
	~<dlib.h
>

13 
	~<rg.h
>

15 #ifde
_WIN32


16 

gt
(, * const *, const *);

18 
	~<unid.h
>

21 
	~<db_cfig.h
>

22 
	~<db_t.h
>

24 
	#DATABASE
 "acss.db"

	)

25 
dbdemo_ma
 
__P
((, *[]));

26 
dbdemo_uge
 
__P
(());

29 
	$dbdemo
(
gs
)

30 *
gs
;

32 
gc
;

33 **
gv
;

35 
	`__db_ut_g
("dbdemo", 
gs
, &
gc
, &
gv
);

36  (
	`dbdemo_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

37 
	}
}

39 
	~<dio.h
>

40 
	#ERROR_RETURN
 
ERROR


	)

43 
	$dbdemo_ma
(
gc
, 
gv
)

44 
gc
;

45 *
gv
[];

47 

td
, 
__db_gt_t
;

48 
DB
 *
dbp
;

49 
DBC
 *
db
;

50 
DBT
 
key
, 
da
;

51 
size_t
 
n
;

52 
ch
, 
t
, 
rag
;

53 *
daba
, *
p
, *
t
, 
buf
[1024], 
rbuf
[1024];

54 cڡ *
ogme
 = "dbdemo";

56 
rag
 = 0;

57 
__db_gt_t
 = 1;

58 (
ch
 = 
	`gt
(
gc
, 
gv
, "r")!
EOF
)

59 
ch
) {

61 
rag
 = 1;

65  (
	`dbdemo_uge
());

67 
gc
 -
td
;

68 
gv
 +
td
;

71 
daba
 = *
gv
 =
NULL
 ? 
DATABASE
 :rgv[0];

74 i(
rag
)

75 ()
	`move
(
daba
);

78 i((
t
 = 
	`db_
(&
dbp
, 
NULL
, 0)) != 0) {

79 
	`rtf
(
dr
,

80 "%s: db_: %s\n", 
ogme
, 
	`db_
(
t
));

81  (
EXIT_FAILURE
);

83 
dbp
->
	`t_rfe
(dbp, 
dr
);

84 
dbp
->
	`t_fx
(dbp, 
ogme
);

85 i((
t
 = 
dbp
->
	`t_gesize
(dbp, 1024)) != 0) {

86 
dbp
->
	`r
(dbp, 
t
, "set_pagesize");

87 
r1
;

89 i((
t
 = 
dbp
->
	`t_chesize
(dbp, 0, 32 * 1024, 0)) != 0) {

90 
dbp
->
	`r
(dbp, 
t
, "set_cachesize");

91 
r1
;

93 i((
t
 = 
dbp
->
	`ݒ
(dbp,

94 
NULL
, 
daba
, NULL, 
DB_BTREE
, 
DB_CREATE
, 0664)) != 0) {

95 
dbp
->
	`r
(dbp, 
t
, "%s: on", 
daba
);

96 
r1
;

103 
	`memt
(&
key
, 0, (
DBT
));

104 
	`memt
(&
da
, 0, (
DBT
));

106 
	`tf
("input> ");

107 
	`fush
(
dout
);

108 i(
	`fgs
(
buf
, (buf), 
d
=
NULL
)

110 i(
	`rcmp
(
buf
, "exit\n") == 0 || strcmp(buf, "quit\n") == 0)

112 i((
n
 = 
	`
(
buf
)) <= 1)

114 
t
 = 
rbuf
, 
p
 = 
buf
 + (
n
 - 2); >= buf;)

115 *
t
++ = *
p
--;

116 *
t
++ = '\0';

118 
key
.
da
 = 
buf
;

119 
da
.d
rbuf
;

120 
da
.
size
 = 
key
.siz(
u_t32_t
)
n
 - 1;

122 
t
 =

123 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 
DB_NOOVERWRITE
)) {

127 
dbp
->
	`r
(dbp, 
t
, "DB->put");

128 i(
t
 !
DB_KEYEXIST
)

129 
r1
;

133 
	`tf
("\n");

136 i((
t
 = 
dbp
->
	`curs
(dbp, 
NULL
, &
db
, 0)) != 0) {

137 
dbp
->
	`r
(dbp, 
t
, "DB->cursor");

138 
r1
;

142 
	`memt
(&
key
, 0, (key));

143 
	`memt
(&
da
, 0, (data));

146 (
t
 = 
db
->
	`g
(db, &
key
, &
da
, 
DB_NEXT
)) == 0)

147 
	`tf
("%.*s : %.*s\n",

148 ()
key
.
size
, (*)key.
da
,

149 ()
da
.
size
, (*)data.data);

150 i(
t
 !
DB_NOTFOUND
) {

151 
dbp
->
	`r
(dbp, 
t
, "DBcursor->get");

152 
r2
;

156 i((
t
 = 
db
->
	`o
(dbcp)) != 0) {

157 
dbp
->
	`r
(dbp, 
t
, "DBcursor->close");

158 
r1
;

160 i((
t
 = 
dbp
->
	`o
(dbp, 0)) != 0) {

161 
	`rtf
(
dr
,

162 "%s: DB->o: %s\n", 
ogme
, 
	`db_
(
t
));

163  (
EXIT_FAILURE
);

165  (
EXIT_SUCCESS
);

167 
r2
: ()
db
->
	`o
(dbcp);

168 
r1
: ()
dbp
->
	`o
(dbp, 0);

169  (
EXIT_FAILURE
);

170 
	}
}

173 
	$dbdemo_uge
()

175 ()
	`rtf
(
dr
, "usage:x_access [-r] [database]\n");

176  (
EXIT_FAILURE
);

177 
	}
}

	@../build_windows/dbkill.cpp

24 
	~<wdows.h
>

25 
	~<dio.h
>

26 
	~<dlib.h
>

27 
	~<lims.h
>

35 
	$my
(*
s
, 
ba
)

37 
su
 = 0;

38 
ch
;

39 
sign
 = 1;

40 i(
ba
 == 0)

41 
ba
 = 10;

42 i(
ba
 != 10 && base != 16)

43  
LONG_MAX
;

44 (
ch
 = *
s
++) != '\0') {

45 i(
ch
 == '-') {

46 
sign
 = -sign;

48 i(
ch
 >= '0' && ch <= '9') {

49 
su
 =esu * 
ba
 + (
ch
 - '0');

51 i(
ch
 == 'x' || ch == 'X') {

53 
ba
 = 16;

55 i(
ba
 =16 && 
ch
 >= 'a' && ch <= 'f') {

56 
su
 =esu * 
ba
 + (
ch
 - 'a' + 10);

58 i(
ba
 =16 && 
ch
 >= 'A' && ch <= 'F') {

59 
su
 =esu * 
ba
 + (
ch
 - 'A' + 10);

62 i(
sign
 > 1)

63  
LONG_MAX
;

65  
LONG_MIN
;

68  
sign
 * 
su
;

69 
	}
}

72 
	$uge_ex
()

74 
	`rtf
(
dr
, "Usage: kill [ -sig ]id\n");

75 
	`rtf
(
dr
, " for win32, sig must be or 0, 15 (TERM)\n");

76 
	`ex
(
EXIT_FAILURE
);

77 
	}
}

80 
	$ma
(
gc
, **
gv
)

82 
HANDLE
 
hPross
 ;

83 
DWORD
 
acssag
;

84 
pid
;

85 
sig
 = 15;

87 i(
gc
 > 2) {

88 i(
gv
[1][0] != '-')

89 
	`uge_ex
();

91 i(
	`rcmp
(
gv
[1], "-TERM") == 0)

92 
sig
 = 15;

97 
sig
 = 
	`oi
(&
gv
[1][1]);

98 i(
sig
 < 0)

99 
	`uge_ex
();

101 
gc
--;

102 
gv
++;

104 i(
gc
 < 2)

105 
	`uge_ex
();

107 
pid
 = 
	`my
(
gv
[1], 10);

109 i(
pid
 =
LONG_MAX
 ||id =
LONG_MIN
)

110 
	`uge_ex
();

112 i(
sig
 == 0)

113 
acssag
 = 
PROCESS_QUERY_INFORMATION
 | 
PROCESS_VM_READ
;

115 
acssag
 = 
STANDARD_RIGHTS_REQUIRED
 | 
PROCESS_TERMINATE
;

116 
hPross
 = 
	`OnPross
(
acssag
, 
FALSE
, 
pid
);

117 i(
hPross
 =
NULL
) {

118 
	`rtf
(
dr
, "dbkl: %s:suchross\n", 
gv
[1]);

119 
	`ex
(
EXIT_FAILURE
);

121 i(
sig
 == 0)

122 
	`ex
(
EXIT_SUCCESS
);

123 i(!
	`TmePross
(
hPross
, 99)) {

124 
DWORD
 
r
 = 
	`GLaE
();

125 
	`rtf
(
dr
,

126 "dbkl: cn kȴoss: %d (0x%lx)\n", 
r
,rr);

127 
	`ex
(
EXIT_FAILURE
);

129  
EXIT_SUCCESS
;

130 
	}
}

	@../build_windows/libdb.def

1 ; 
DO
 
NOT
 
	gEDIT
: 
automiy
 
but
 
by
 
di
/
s_wdows
.

3 
EXPORTS


4 
db_
 @1

5 
db_v_
 @2

6 
db_qu_
 @3

7 
db_
 @4

8 
db_vsi
 @5

9 
db_xa_swch
 @6

10 
log_com
 @7

11 
__db_add_covy
 @8

12 
__db_dbm_o
 @9

13 
__db_dbm_de
 @10

14 
__db_dbm_tch
 @11

15 
__db_dbm_fkey
 @12

16 
__db_dbm_
 @13

17 
__db_dbm_xtkey
 @14

18 
__db_dbm_e
 @15

19 
__db_g_ags_
 @16

20 
__db_g_q_ags_
 @17

21 
__db_h
 @18

22 
__db_hderoy
 @19

23 
__db_hch
 @20

24 
__db_ldme
 @21

25 
__db_ndbm_
 @22

26 
__db_ndbm_o
 @23

27 
__db_ndbm_de
 @24

28 
__db_ndbm_do
 @25

29 
__db_ndbm_r
 @26

30 
__db_ndbm_tch
 @27

31 
__db_ndbm_fkey
 @28

32 
__db_ndbm_xtkey
 @29

33 
__db_ndbm_ݒ
 @30

34 
__db_ndbm_go
 @31

35 
__db_ndbm_rdly
 @32

36 
__db_ndbm_e
 @33

37 
__db_nic
 @34

38 
__db_w32_mux_lock
 @35

39 
__db_w32_mux_uock
 @36

40 
__ham_func2
 @37

41 
__ham_func3
 @38

42 
__ham_func4
 @39

43 
__ham_func5
 @40

44 
__ham_
 @41

45 
__lock_id_t
 @42

46 
__os_oc
 @43

47 
__os_ohd
 @44

48 
__os_d
 @45

49 
__os_dli
 @46

50 
__os_
 @47

51 
__os_fsync
 @48

52 
__os_g_sy
 @49

53 
__os_gv
 @50

54 
__os_iofo
 @51

55 
__os_mloc
 @52

56 
__os_mkd
 @53

57 
__os_ݒ
 @54

58 
__os_ݒhd
 @55

59 
__os_posix_r
 @56

60 
__os_ad
 @57

61 
__os_loc
 @58

62 
__os_me
 @59

63 
__os_rdup
 @60

64 
__os_umloc
 @61

65 
__os_uƚk
 @62

66 
__os_wre
 @63

67 
__txn_id_t
 @64

68 
__bam_adj_ad
 @65

69 
__bam_dju_ad
 @66

70 
__bam_cd_ad
 @67

71 
__bam_cudj_ad
 @68

72 
__bam_mge_ad
 @69

73 
__bam_pg
 @70

74 
__bam_pgno_ad
 @71

75 
__bam_pgout
 @72

76 
__bam_rcudj_ad
 @73

77 
__bam_lk_43_ad
 @74

78 
__bam_lk_ad
 @75

79 
__bam__ad
 @76

80 
__bam_ro_ad
 @77

81 
__bam_rl_ad
 @78

82 
__bam_l_ad
 @79

83 
__cfig_l
 @80

84 
__d_mem__ad
 @81

85 
__d_mem_move_ad
 @82

86 
__d_mem_me_ad
 @83

87 
__d_masub_ad
 @84

88 
__db_addm_ad
 @85

89 
__db_big_ad
 @86

90 
__db_cksum_ad
 @87

91 
__db_ime
 @88

92 
__db_debug_ad
 @89

93 
__db_dich
 @90

94 
__db_dl
 @91

95 
__db_dume
 @92

96 
__db_r
 @93

97 
__db_rx
 @94

98 
__db_glg
 @95

99 
__db_gulg
 @96

100 
__db_glob_vues
 @97

101 
__db_isbigdn
 @98

102 
__db_mkth
 @99

103 
__db_msg
 @100

104 
__db_no_ad
 @101

105 
__db_omode
 @102

106 
__db_ovf_ad
 @103

107 
__db_pg_loc_42_ad
 @104

108 
__db_pg_loc_ad
 @105

109 
__db_pg__42_ad
 @106

110 
__db_pg__ad
 @107

111 
__db_pg_da_42_ad
 @108

112 
__db_pg_da_ad
 @109

113 
__db_pg__ad
 @110

114 
__db_pg_w_ad
 @111

115 
__db_pg_e_ad
 @112

116 
__db_pg_st_ad
 @113

117 
__db_pg
 @114

118 
__db_pgout
 @115

119 
__db__back
 @116

120 
__db_lk_42_ad
 @117

121 
__db_h
 @118

122 
__db__
 @119

123 
__db__t_
 @120

124 
__db_ut_che
 @121

125 
__db_ut_ued
 @122

126 
__db_ut_logt
 @123

127 
__db_ut_sig
 @124

128 
__db_ut_signd
 @125

129 
__db_vify_
 @126

130 
__dbg_gi_ad
 @127

131 
__f__ad
 @128

132 
__f_fe_move_ad
 @129

133 
__f_move_ad
 @130

134 
__f_me_ad
 @131

135 
__f_wre_ad
 @132

136 
__ham_chgpg_ad
 @133

137 
__ham_cyge_ad
 @134

138 
__ham_cudj_ad
 @135

139 
__ham_g_ma
 @136

140 
__ham_grouoc_42_ad
 @137

141 
__ham_grouoc_ad
 @138

142 
__ham_sd_ad
 @139

143 
__ham_magroup_42_ad
 @140

144 
__ham_magroup_ad
 @141

145 
__ham_wge_ad
 @142

146 
__ham_pg
 @143

147 
__ham_pgout
 @144

148 
__ham_a_ma
 @145

149 
__ham_a_ad
 @146

150 
__ham_lda_ad
 @147

151 
__lock_li_t
 @148

152 
__log__
 @149

153 
__mux_t_wa_fo
 @150

154 
__os_abh
 @151

155 
__os_exis
 @152

156 
__os_g_o
 @153

157 
__os_gtime
 @154

158 
__os_id
 @155

159 
__os_mfe
 @156

160 
__os_ek
 @157

161 
__os_t_o
 @158

162 
__os_p
 @159

163 
__os_
 @160

164 
__os_u
 @161

165 
__os_unmfe
 @162

166 
__os_yld
 @163

167 
__qam_add_ad
 @164

168 
__qam_d_ad
 @165

169 
__qam_dext_ad
 @166

170 
__qam_cf_ad
 @167

171 
__qam_mvr_ad
 @168

172 
__qam_pg_out
 @169

173 
__p__t
 @170

174 
__txn_chd_ad
 @171

175 
__txn_ckp_42_ad
 @172

176 
__txn_ckp_ad
 @173

177 
__txn_cye_ad
 @174

178 
__txn_g_42_ad
 @175

179 
__txn_g_ad
 @176

180 
__txn_xa_g_ad
 @177

	@../build_windows/libdb.rc

1 1 
VERSIONINFO


2 
	gFILEVERSION
 4,0,6,21

3 
	gPRODUCTVERSION
 4,0,6,21

4 
	gFILEFLAGSMASK
 0x3fL

5 #ifde
_DEBUG


6 
	gFILEFLAGS
 0x1L

8 
	gFILEFLAGS
 0x0L

10 
	gFILEOS
 0x4L

11 
	gFILETYPE
 0x2L

12 
	gFILESUBTYPE
 0x0L

14 
BEGIN


15 
	gBLOCK
 "StringFileInfo"

16 
BEGIN


17 
	gBLOCK
 "040904b0"

18 
BEGIN


19 
	gVALUE
 "CompanyName", "Oracle\0"

20 
	gVALUE
 "FileDescription", "Berkeley DB 4.6 DLL\0"

21 
	gVALUE
 "FileVersion", "4.6.21\0"

22 
	gVALUE
 "InternalName", "libdb46.dll\0"

23 
	gVALUE
 "LegalCopyright", "Copyright  Oracle 1997,2007\0"

24 
	gVALUE
 "OriginalFilename", "libdb46.dll\0"

25 
	gVALUE
 "ProductName", "Oracleibdb\0"

26 
	gVALUE
 "ProductVersion", "4.6.21\0"

27 
END


28 
END


29 
	gBLOCK
 "VarFileInfo"

30 
BEGIN


31 
	gVALUE
 "Translation", 0x409, 1200

32 
END


33 
	gEND


	@../build_windows/libdb_tcl.def

1 ; 
	g$Id
: 
libdb_t
.
def
,
	gv
 12.0 2004/11/17 03:48:15 
boic
 
Exp
 
$


3 
DESCRIPTION
 'Berkeley DB TCL interface Library'

4 
EXPORTS


5 
Db_t_In


6 
_NameToP


	@../clib/atoi.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

46 
	$oi
(
r
)

47 cڡ *
r
;

49  ()
	`
(
r
, (**)
NULL
, 10);

50 
	}
}

	@../clib/atol.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

46 
	$
(
r
)

47 cڡ *
r
;

49  
	`
(
r
, (**)
NULL
, 10);

50 
	}
}

	@../clib/ctime.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
	$__db_ime
(
tod
, 
time_buf
)

21 cڡ 
time_t
 *
tod
;

22 *
time_buf
;

24 
time_buf
[
CTIME_BUFLEN
 - 1] = '\0';

32 #i
	`defed
(
HAVE_CTIME_R_3ARG
)

33 ()
	`ime_r
(
tod
, 
time_buf
, 
CTIME_BUFLEN
);

34 #i
	`defed
(
HAVE_CTIME_R
)

35 ()
	`ime_r
(
tod
, 
time_buf
);

37 ()
	`y
(
time_buf
, 
	`ime
(
tod
), 
CTIME_BUFLEN
 - 1);

39  (
time_buf
);

40 
	}
}

	@../clib/getaddrinfo.c

9 
	~"db_cfig.h
"

11 
	#__INCLUDE_NETWORKING
 1

	)

12 
	~"db_t.h
"

29 
	$__db_gaddrfo
(
dbv
, 
nodame
, 
pt
, 
rvme
, 
hts
, 
s
)

30 
DB_ENV
 *
dbv
;

31 cڡ *
nodame
, *
rvme
;

32 
u_t
 
pt
;

33 cڡ 
ADDRINFO
 *
hts
;

34 
ADDRINFO
 **
s
;

36 #ifde
HAVE_GETADDRINFO


37 
t
;

39 i((
t
 = 
	`gaddrfo
(
nodame
, 
rvme
, 
hts
, 
s
)) == 0)

42 
	`__db_rx
(
dbv
, "%s(%u): hostookup failed: %s",

43 
nodame
 =
NULL
 ? "" :odame, 
pt
,

44 #ifde
DB_WIN32


45 
	`gai_A
(
t
));

47 
	`gai_
(
t
));

49  (
	`__os_posix_r
(
t
));

51 
ADDRINFO
 *
sw
;

52 
hot
 *
hoaddr
;

53 
sockaddr_
 
s
;

54 
u_t32_t
 
tmddr
;

55 
t
;

57 
	`COMPQUIET
(
hts
, 
NULL
);

58 
	`COMPQUIET
(
rvme
, 
NULL
);

61 #idef 
INADDR_NONE


62 
	#INADDR_NONE
 ((
u_lg
)0xffffffff)

	)

69 
	`memt
(&
s
, 0, (sin));

70 
s
.
s_my
 = 
AF_INET
;

71 i(
nodame
) {

72 i(
nodame
[0] == '\0')

73 
s
.
s_addr
.
s_addr
 = 
	`htl
(
INADDR_ANY
);

74 i((
tmddr
 = 
	`_addr
(
nodame
)!
INADDR_NONE
) {

75 
s
.
s_addr
.
s_addr
 = 
tmddr
;

77 
hoaddr
 = 
	`ghobyme
(
nodame
);

78 i(
hoaddr
 =
NULL
) {

79 #ifde
DB_WIN32


80 
t
 = 
	`__os_g_Ë
();

81 
	`__db_sy
(
dbv
, 
t
,

83 
nodame
 =
NULL
 ? "" :odame, 
pt
);

84  (
	`__os_posix_r
(
t
));

97 #ifde
HAVE_HSTRERROR


98 
	`__db_rx
(
dbv
,

100 
nodame
 =
NULL
 ? "" :odame, 
pt
,

101 
	`h
(
h_o
));

103 
	`__db_rx
(
dbv
,

105 
nodame
 =
NULL
 ? "" :odame, 
pt
,

106 
h_o
);

108 
h_o
) {

109 
HOST_NOT_FOUND
:

110 
NO_DATA
:

111  (
EHOSTUNREACH
);

112 
TRY_AGAIN
:

113  (
EAGAIN
);

114 
NO_RECOVERY
:

116  (
EFAULT
);

121 
	`memy
(&(
s
.
s_addr
),

122 
hoaddr
->
h_addr
, (
size_t
)hoaddr->
h_ngth
);

125 
s
.
s_addr
.
s_addr
 = 
	`htl
(
INADDR_ANY
);

126 
s
.
s_pt
 = 
	`hts
((
u_t16_t
)
pt
);

128 i((
t
 = 
	`__os_oc
(
dbv
, 1, (
ADDRINFO
), &
sw
)) != 0)

129  (
t
);

130 i((
t
 = 
	`__os_mloc
(
dbv
, (
s
), &
sw
->
ai_addr
)) != 0) {

131 
	`__os_
(
dbv
, 
sw
);

132  (
t
);

135 
sw
->
ai_my
 = 
AF_INET
;

136 
sw
->
ai_oc
 = 
IPPROTO_TCP
;

137 
sw
->
ai_sockty
 = 
SOCK_STREAM
;

138 
sw
->
ai_add
 = (
s
);

139 
	`memy
(
sw
->
ai_addr
, &
s
, (sin));

140 *
s
 = 
sw
;

144 
	}
}

154 
	$__db_addrfo
(
dbv
, 
ai
)

155 
DB_ENV
 *
dbv
;

156 
ADDRINFO
 *
ai
;

158 #ifde
HAVE_GETADDRINFO


159 
	`COMPQUIET
(
dbv
, 
NULL
);

161 
	`addrfo
(
ai
);

163 
ADDRINFO
 *
xt
, *
tmddr
;

165 
xt
 = 
ai
;ex!
NULL
;ex
tmddr
) {

166 i(
xt
->
ai_nme
 !
NULL
)

167 
	`__os_
(
dbv
, 
xt
->
ai_nme
);

169 i(
xt
->
ai_addr
 !
NULL
)

170 
	`__os_
(
dbv
, 
xt
->
ai_addr
);

172 
tmddr
 = 
xt
->
ai_xt
;

173 
	`__os_
(
dbv
, 
xt
);

176 
	}
}

	@../clib/getcwd.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

41 #ifde
HAVE_SYSTEM_INCLUDE_FILES


42 #i
HAVE_DIRENT_H


43 
	~<dt.h
>

44 
	#NAMLEN
(
dt

	`
((dt)->
d_me
)

	)

46 
	#dt
 
de


	)

47 
	#NAMLEN
(
dt
(dt)->
d_mn


	)

48 #i
HAVE_SYS_NDIR_H


49 
	~<sys/nd.h
>

51 #i
HAVE_SYS_DIR_H


52 
	~<sys/d.h
>

54 #i
HAVE_NDIR_H


55 
	~<nd.h
>

60 
	#ISDOT
(
dp
) \

61 (
dp
->
d_me
[0] == '.' && (dp->d_name[1] == '\0' || \

62 (
dp
->
d_me
[1] ='.' && dp->d_me[2] ='\0')))

	)

64 #ide
dfd


65 
	#dfd
(
dp
((dp)->
dd_fd
)

	)

77 
	$gcwd
(

, 
size
)

78 *

;

79 
size_t
 
size
;

81 
dt
 *
dp
;

82 
DIR
 *
d
;

83 
dev_t
 
dev
;

84 
o_t
 
o
;

85 
f
;

86 *
b
, *
bup
;

87 

 
s
;

88 
dev_t
 
ro_dev
;

89 
o_t
 
ro_o
;

90 
size_t
 
size
, 
upsize
;

91 
t
, 
ve_o
;

92 *
t
, *
eup
, *
up
;

99 i(

) {

100 
size
 = 0;

101 i(!
size
) {

102 
	`__os_t_o
(
EINVAL
);

103  (
NULL
);

105 i(
size
 == 1) {

106 
	`__os_t_o
(
ERANGE
);

107  (
NULL
);

109 
t
 = 

 + 
size
;

111 i((
t
 =

112 
	`__os_mloc
(
NULL
, 
size
 = 1024 - 4, &

)) != 0) {

113 
	`__os_t_o
(
t
);

114  (
NULL
);

116 
t
 = 

 + 
size
;

118 
b
 = 
t
 - 1;

119 *
b
 = '\0';

126 i((
t
 = 
	`__os_mloc
(
NULL
, 
upsize
 = 1024 - 4, &
up
)) != 0)

127 
r
;

128 
eup
 = 
up
 + 1024;

129 
bup
 = 
up
;

130 
up
[0] = '.';

131 
up
[1] = '\0';

134 i(
	`
("/", &
s
))

135 
r
;

136 
ro_dev
 = 
s
.
_dev
;

137 
ro_o
 = 
s
.
_o
;

139 
	`__os_t_o
(0);

141 
f
 = 1;; first = 0) {

143 i(
	`l
(
up
, &
s
))

144 
r
;

147 
o
 = 
s
.
_o
;

148 
dev
 = 
s
.
_dev
;

151 i(
ro_dev
 =
dev
 && 
ro_o
 =
o
) {

152 *--
b
 = 
PATH_SEPARATOR
[0];

158 
	`bcy
(
b
, 

, 
t
 - bpt);

159 
	`__os_
(
NULL
, 
up
);

160  (

);

168 i(
bup
 + 3 + 
MAXNAMLEN
 + 1 >
eup
) {

169 i(
	`__os_loc
(
NULL
, 
upsize
 *2, &
up
) != 0)

170 
r
;

171 
bup
 = 
up
;

172 
eup
 = 
up
 + 
upsize
;

174 *
bup
++ = '.';

175 *
bup
++ = '.';

176 *
bup
 = '\0';

179 i(!(
d
 = 
	`ݒd
(
up
)|| 
	`f
(
	`dfd
(d), &
s
))

180 
r
;

183 *
bup
++ = 
PATH_SEPARATOR
[0];

190 
ve_o
 = 0;

191 i(
s
.
_dev
 =
dev
) {

193 i(!(
dp
 = 
	`add
(
d
)))

194 
nfound
;

195 i(
dp
->
d_fo
 =
o
)

200 i(!(
dp
 = 
	`add
(
d
)))

201 
nfound
;

202 i(
	`ISDOT
(
dp
))

204 
	`bcy
(
dp
->
d_me
, 
bup
, dp->
d_mn
 + 1);

207 i(
	`l
(
up
, &
s
)) {

208 i(
ve_o
 == 0)

209 
ve_o
 = 
	`__os_g_o
();

210 
	`__os_t_o
(0);

213 i(
s
.
_dev
 =
dev
 && s.
_o
 =
o
)

221 i(
b
 - 

 < 
dp
->
d_mn
 + (
f
 ? 1 : 2)) {

222 
size_t
 
n
, 
off
;

224 i(!
size
) {

225 
	`__os_t_o
(
ERANGE
);

226 
r
;

228 
off
 = 
b
 - 

;

229 
n
 = 
t
 - 
b
;

230 i(
	`__os_loc
(
NULL
, 
size
 *2, &

) != 0)

231 
r
;

232 
b
 = 

 + 
off
;

233 
t
 = 

 + 
size
;

234 
	`bcy
(
b
, 
t
 - 
n
,en);

235 
b
 = 
t
 - 
n
;

237 i(!
f
)

238 *--
b
 = 
PATH_SEPARATOR
[0];

239 
b
 -
dp
->
d_mn
;

240 
	`bcy
(
dp
->
d_me
, 
b
, dp->
d_mn
);

241 ()
	`od
(
d
);

244 *
bup
 = '\0';

247 
nfound
:

253 i(
	`__os_g_o_t_zo
() == 0)

254 
	`__os_t_o
(
ve_o
 =0 ? 
ENOENT
 : save_errno);

256 
r
:

257 i(
size
)

258 
	`__os_
(
NULL
, 

);

259 
	`__os_
(
NULL
, 
up
);

260  (
NULL
);

261 
	}
}

	@../clib/getopt.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

41 
	g__db_gt_t
;

43 
	g݋
 = 1,

44 
	gtd
 = 1,

45 
	gtt
,

46 
	g݌et
;

47 *
	gݏrg
;

49 #unde
BADCH


50 
	#BADCH
 ()'?'

	)

51 #unde
BADARG


52 
	#BADARG
 ()':'

	)

53 #unde
EMSG


54 
	#EMSG
 ""

	)

65 
	$gt
(
rgc
, 
rgv
, 
or
)

66 
rgc
;

67 * cڡ *
rgv
;

68 cڡ *
or
;

70 *
ogme
;

71 *
a
 = 
EMSG
;

72 *
i
;

78 i(
__db_gt_t
) {

79 
__db_gt_t
 = 0;

81 
݋
 = 
td
 = 1;

82 
tt
 = 
݌et
 = 0;

83 
ݏrg
 = 
NULL
;

84 
ogme
 = 
NULL
;

85 
a
 = 
EMSG
;

87 i(!
ogme
) {

88 i((
ogme
 = 
	`__db_h
(*
rgv
)=
NULL
)

89 
ogme
 = *
rgv
;

91 ++
ogme
;

94 i(
݌et
 || !*
a
) {

95 
݌et
 = 0;

96 i(
td
 >
rgc
 || *(
a
 = 
rgv
[optind]) != '-') {

97 
a
 = 
EMSG
;

98  (
EOF
);

100 i(
a
[1] && *++place == '-') {

101 ++
td
;

102 
a
 = 
EMSG
;

103  (
EOF
);

106 i((
tt
 = ()*
a
++) == ()':' ||

107 !(
i
 = 
	`rchr
(
or
, 
tt
))) {

112 i(
tt
 == ()'-')

113  (
EOF
);

114 i(!*
a
)

115 ++
td
;

116 i(
݋
 && *
or
 != ':')

117 ()
	`rtf
(
dr
,

118 "%s: ieg oi -- %c\n", 
ogme
, 
tt
);

119  (
BADCH
);

121 i(*++
i
 != ':') {

122 
ݏrg
 = 
NULL
;

123 i(!*
a
)

124 ++
td
;

127 i(*
a
)

128 
ݏrg
 = 
a
;

129 i(
rgc
 <++
td
) {

130 
a
 = 
EMSG
;

131 i(*
or
 == ':')

132  (
BADARG
);

133 i(
݋
)

134 ()
	`rtf
(
dr
,

136 
ogme
, 
tt
);

137  (
BADCH
);

140 
ݏrg
 = 
rgv
[
td
];

141 
a
 = 
EMSG
;

142 ++
td
;

144  (
tt
);

145 
	}
}

	@../clib/isalpha.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

21 
	$iha
(
c
)

22 
c
;

27  ((
c
 >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ? 1 : 0);

28 
	}
}

	@../clib/isdigit.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

21 
	$isdig
(
c
)

22 
c
;

27  (
c
 >= '0' && c <= '9' ? 1 : 0);

28 
	}
}

	@../clib/isprint.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

21 
	$irt
(
c
)

22 
c
;

27  ((
c
 >= ' ' && c <= '~') ? 1 : 0);

28 
	}
}

	@../clib/isspace.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

21 
	$isa
(
c
)

22 
c
;

24  (
c
 == '\t' || c == '\n' ||

25 
c
 == '\v' || c == '\f' || c == '\r' || c == ' ' ? 1 : 0);

26 
	}
}

	@../clib/memcmp.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

49 
	$memcmp
(
s1
, 
s2
, 
n
)

50 cڡ *
s1
, *
s2
;

51 
size_t
 
n
;

53 i(
n
 != 0) {

54 *
p1
 = (*)
s1
,

55 *
p2
 = (*)
s2
;

57 i(*
p1
++ !*
p2
++)

58  (*--
p1
 - *--
p2
);

59 } --
n
 != 0);

62 
	}
}

	@../clib/memmove.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

45 
	twd
;

47 #unde
wsize


48 
	#wsize
 (
wd
)

	)

49 #unde
wmask


50 
	#wmask
 (
wsize
 - 1)

	)

57 #ifde
MEMCOPY


64 
	$memy
(
d0
, 
c0
, 
ngth
)

66 #ifde
MEMMOVE


73 
	$memmove
(
d0
, 
c0
, 
ngth
)

76 
	$bcy
(
c0
, 
d0
, 
ngth
)

79 *
d0
;

80 cڡ *
c0
;

81 
size_t
 
ngth
;

83 *
d
 = 
d0
;

84 cڡ *
c
 = 
c0
;

85 
size_t
 
t
;

87 i(
ngth
 =0 || 
d
 =
c
)

88 
de
;

93 #unde
TLOOP


94 
	#TLOOP
(
s
i(
t

	`TLOOP1
(s)

	)

95 #unde
TLOOP1


96 
	#TLOOP1
(
s
d{ s; } --
t
)

	)

98 i(()
d
 < ()
c
) {

102 
t
 = (
size_t
)
c
;

103 i((
t
 | (
size_t
)
d
& 
wmask
) {

108 i((
t
 ^ (
size_t
)
d
& 
wmask
 || 
ngth
 < 
wsize
)

109 
t
 = 
ngth
;

111 
t
 = 
wsize
 - (& 
wmask
);

112 
ngth
 -
t
;

113 
	`TLOOP1
(*
d
++ = *
c
++);

118 
t
 = 
ngth
 / 
wsize
;

119 
	`TLOOP
(*(
wd
 *)
d
 = *(wd *)
c
; sr+
wsize
; dst += wsize);

120 
t
 = 
ngth
 & 
wmask
;

121 
	`TLOOP
(*
d
++ = *
c
++);

128 
c
 +
ngth
;

129 
d
 +
ngth
;

130 
t
 = (
size_t
)
c
;

131 i((
t
 | (
size_t
)
d
& 
wmask
) {

132 i((
t
 ^ (
size_t
)
d
& 
wmask
 || 
ngth
 <
wsize
)

133 
t
 = 
ngth
;

135 
t
 &
wmask
;

136 
ngth
 -
t
;

137 
	`TLOOP1
(*--
d
 = *--
c
);

139 
t
 = 
ngth
 / 
wsize
;

140 
	`TLOOP
(
c
 -
wsize
; 
d
 -wsize; *(
wd
 *)dst = *(word *)src);

141 
t
 = 
ngth
 & 
wmask
;

142 
	`TLOOP
(*--
d
 = *--
c
);

144 
de
:

145 #i
	`defed
(
MEMCOPY
|| defed(
MEMMOVE
)

146  (
d0
);

150 
	}
}

	@../clib/printf.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 #ide
HAVE_PRINTF


22 #ifde
STDC_HEADERS


23 
	$tf
(cڡ *
fmt
, ...)

25 
	$tf
(
fmt
, 
va_i
)

26 cڡ *
fmt
;

27 
va_d


30 
va_li
 

;

31 
size_t
 
n
;

32 
buf
[2048];

34 #ifde
STDC_HEADERS


35 
	`va_t
(

, 
fmt
);

37 
	`va_t
(

);

39 
n
 = (
size_t
)
	`vtf
(
buf
, (buf), 
fmt
, 

);

40 #ifde
HAVE_BREW


45 i(
n
 > 0 && <(
buf
) && buf[len - 1] == '\0')

46 --
n
;

49 
	`va_d
(

);

55  (
	`fwre
(

56 
buf
, (), (
size_t
)
n
, 
dout
) ==en ? ()len: -1);

57 
	}
}

67 #ide
HAVE_PRINTF


69 #ifde
STDC_HEADERS


70 
	$rtf
(
FILE
 *

, cڡ *
fmt
, ...)

72 
	$rtf
(

, 
fmt
, 
va_i
)

73 
FILE
 *

;

74 cڡ *
fmt
;

75 
va_d


78 
va_li
 

;

79 
size_t
 
n
;

80 
buf
[2048];

82 #ifde
STDC_HEADERS


83 
	`va_t
(

, 
fmt
);

85 
	`va_t
(

);

87 
n
 = 
	`vtf
(
buf
, (buf), 
fmt
, 

);

88 #ifde
HAVE_BREW


93 i(
n
 > 0 && <(
buf
) && buf[len - 1] == '\0')

94 --
n
;

97 
	`va_d
(

);

103  (
	`fwre
(

104 
buf
, (), (
size_t
)
n
, 

) ==en ? ()len: -1);

105 
	}
}

115 #ide
HAVE_PRINTF


117 
	$vrtf
(

, 
fmt
, 

)

118 
FILE
 *

;

119 cڡ *
fmt
;

120 
va_li
 

;

122 
size_t
 
n
;

123 
buf
[2048];

125 
n
 = 
	`vtf
(
buf
, (buf), 
fmt
, 

);

126 #ifde
HAVE_BREW


131 i(
n
 > 0 && <(
buf
) && buf[len - 1] == '\0')

132 --
n
;

139  (
	`fwre
(

140 
buf
, (), (
size_t
)
n
, 

) ==en ? ()len: -1);

141 
	}
}

	@../clib/qsort.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

41 *
med3
 
__P
((*,

43 
swfunc
 
	`__P
((*, *, , ));

45 
	#m
(
a
, 
b
< (b? : 
	)
b

50 
	#swcode
(
TYPE
, 
rmi
, 
rmj
, 
n
) { \

51 
i
 = (
n
/  (
TYPE
); \

52 
TYPE
 *
pi
 = (TYPE *(
rmi
); \

53 
TYPE
 *
pj
 = (TYPE *(
rmj
); \

55 
TYPE
 
t
 = *
pi
; \

56 *
pi
++ = *
pj
; \

57 *
pj
++ = 
t
; \

58 } --
i
 > 0); \

59 
	}

	)
}

61 
	#SWAPINIT
(
a
, 
es

swty
 = ((*)a - (*)0) % () || \

62 
es
 % (? 2 :=()? 0 : 1;

	)

64 
le
 

65 
	$swfunc
(
a
, 
b
, 
n
, 
swty
)

66 *
a
, *
b
;

67 
n
, 
swty
;

69 if(
swty
 <= 1)

70 
	`swcode
(, 
a
, 
b
, 
n
)

72 
	`swcode
(, 
a
, 
b
, 
n
)

73 
	}
}

75 
	#sw
(
a
, 
b
) \

76 i(
swty
 == 0) { \

77 
t
 = *(*)(
a
); \

78 *(*)(
a
*(*)(
b
); \

79 *(*)(
b

t
; \

81 
	`swfunc
(
a
, 
b
, 
es
, 
swty
)

	)

83 
	#vecsw
(
a
, 
b
, 
n
i(> 0
	`swfunc
, b,, 
swty
)

	)

85 
le
 *

86 
	$med3
(
a
, 
b
, 
c
, 
cmp
)

87 *
a
, *
b
, *
c
;

88 (*
cmp
)(const *, const *);

90  
	`cmp
(
a
, 
b
) < 0 ?

91 (
	`cmp
(
b
, 
c
< 0 ? b : (cmp(
a
, c) < 0 ? c : ))

92 :(
	`cmp
(
b
, 
c
> 0 ? b : (cmp(
a
, c) < 0 ? : c ));

93 
	}
}

102 
	$qst
(
a
, 
n
, 
es
, 
cmp
)

103 *
a
;

104 
size_t
 
n
, 
es
;

105 (*
cmp

	`__P
((const *, const *));

107 *

, *
pb
, *
pc
, *
pd
, *

, *
pm
, *

;

108 
d
, 
r
, 
swty
, 
sw_t
;

110 
lo
: 
	`SWAPINIT
(
a
, 
es
);

111 
sw_t
 = 0;

112 i(
n
 < 7) {

113 
pm
 = (*)
a
 + 
es
;m < (* + 
n
 *s;m +=s)

114 

 = 
pm
;> (*)
a
 && 
	`cmp
- 
es
,l) > 0;

115 

 -
es
)

116 
	`sw
(

,- 
es
);

119 
pm
 = (*)
a
 + (
n
 / 2* 
es
;

120 i(
n
 > 7) {

121 

 = 
a
;

122 

 = (*)
a
 + (
n
 - 1* 
es
;

123 i(
n
 > 40) {

124 
d
 = (
n
 / 8* 
es
;

125 

 = 
	`med3
l,+ 
d
,+ 2 * d, 
cmp
);

126 
pm
 = 
	`med3
m - 
d
,m,m + d, 
cmp
);

127 

 = 
	`med3
- 2 * 
d
,- d,n, 
cmp
);

129 
pm
 = 
	`med3
(

,m, 

, 
cmp
);

131 
	`sw
(
a
, 
pm
);

132 

 = 
pb
 = (*)
a
 + 
es
;

134 
pc
 = 
pd
 = (*)
a
 + (
n
 - 1* 
es
;

136 
pb
 <
pc
 && (
r
 = 
	`cmp
b, 
a
)) <= 0) {

137 i(
r
 == 0) {

138 
sw_t
 = 1;

139 
	`sw
(

, 
pb
);

140 

 +
es
;

142 
pb
 +
es
;

144 
pb
 <
pc
 && (
r
 = 
	`cmp
c, 
a
)) >= 0) {

145 i(
r
 == 0) {

146 
sw_t
 = 1;

147 
	`sw
(
pc
, 
pd
);

148 
pd
 -
es
;

150 
pc
 -
es
;

152 i(
pb
 > 
pc
)

154 
	`sw
(
pb
, 
pc
);

155 
sw_t
 = 1;

156 
pb
 +
es
;

157 
pc
 -
es
;

159 i(
sw_t
 == 0) {

160 
pm
 = (*)
a
 + 
es
;m < (* + 
n
 *s;m +=s)

161 

 = 
pm
;> (*)
a
 && 
	`cmp
- 
es
,l) > 0;

162 

 -
es
)

163 
	`sw
(

,- 
es
);

167 

 = (*)
a
 + 
n
 * 
es
;

168 
r
 = 
	`m
(

 - (*)
a
, 
pb
 -a);

169 
	`vecsw
(
a
, 
pb
 - 
r
,);

170 
r
 = 
	`m
(()(
pd
 - 
pc
), ()(

 -d - 
es
));

171 
	`vecsw
(
pb
, 

 - 
r
,);

172 i((
r
 = ()(
pb
 - 

)> ()
es
)

173 
	`qst
(
a
, 
r
 / 
es
,s, 
cmp
);

174 i((
r
 = ()(
pd
 - 
pc
)> ()
es
) {

176 
a
 = 

 - 
r
;

177 
n
 = 
r
 / 
es
;

178 
lo
;

181 
	}
}

	@../clib/raise.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

22 
	$i
(
s
)

23 
s
;

25  (
	`kl
(
	`gpid
(), 
s
));

26 
	}
}

	@../clib/rand.c

4 
	~"db_cfig.h
"

6 
	~"db_t.h
"

16 
	$nd
()

18 
	`DB_GLOBAL
(
nd_xt
) = DB_GLOBAL(rand_next) * 1103515245 + 12345;

19  ((
	`DB_GLOBAL
(
nd_xt
)/65536) % 32768;

20 
	}
}

22 
	$d
(
ed
)

24 
	`DB_GLOBAL
(
nd_xt

ed
;

25 
	}
}

	@../clib/snprintf.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #i!
defed
(
HAVE_SNPRINTF
|| !defed(
HAVE_VSNPRINTF
)

14 
rtf_ovow
 
__P
(());

15 
rtf_tcht
 
__P
(());

26 #ide
HAVE_SNPRINTF


28 #ifde
STDC_HEADERS


29 
	$tf
(*
r
, 
size_t
 
n
, cڡ *
fmt
, ...)

31 
	$tf
(
r
, 
n
, 
fmt
, 
va_i
)

32 *
r
;

33 
size_t
 
n
;

34 cڡ *
fmt
;

35 
va_d


38 
t_cht
 = -1;

39 
va_li
 

;

40 
size_t
 
n
;

42 i(
t_cht
 == -1)

43 
t_cht
 = 
	`rtf_tcht
();

45 #ifde
STDC_HEADERS


46 
	`va_t
(

, 
fmt
);

48 
	`va_t
(

);

50 
n
 = (
size_t
)
	`vrtf
(
r
, 
fmt
, 

);

51 i(
t_cht
)

52 
n
 = 
	`
(
r
);

54 
	`va_d
(

);

56 i(
n
 >
n
) {

57 
	`rtf_ovow
();

60  (()
n
);

61 
	}
}

72 #ide
HAVE_VSNPRINTF


74 
	$vtf
(
r
, 
n
, 
fmt
, 

)

75 *
r
;

76 
size_t
 
n
;

77 cڡ *
fmt
;

78 
va_li
 

;

80 
t_cht
 = -1;

81 
size_t
 
n
;

83 i(
t_cht
 == -1)

84 
t_cht
 = 
	`rtf_tcht
();

86 
n
 = (
size_t
)
	`vrtf
(
r
, 
fmt
, 

);

87 i(
t_cht
)

88 
n
 = 
	`
(
r
);

90 i(
n
 >
n
) {

91 
	`rtf_ovow
();

94  (()
n
);

95 
	}
}

98 #i!
defed
(
HAVE_SNPRINTF
|| !defed(
HAVE_VSNPRINTF
)

100 
	$rtf_ovow
()

112 
	#OVERFLOW_ERROR
 " bufovow,rosded\n"

	)

113 #idef 
STDERR_FILENO


114 
	#STDERR_FILENO
 2

	)

116 ()
	`wre
(
STDERR_FILENO
, 
OVERFLOW_ERROR
, (OVERFLOW_ERROR) - 1);

119 
	`ex
(1);

122 
	`__os_abt
();

125 
	}
}

128 
	$rtf_tcht
()

130 
t_cht
;

131 
buf
[10];

142 
t_cht
 =

143 ()
	`rtf
(
buf
, "123") != 3 ||

144 ()
	`rtf
(
buf
, "123456789") != 9 ||

145 ()
	`rtf
(
buf
, "1234") != 4;

147  (
t_cht
);

148 
	}
}

	@../clib/strcasecmp.c

36 
	~"db_cfig.h
"

38 
	~"db_t.h
"

49 
	$rcmp
(
s1
, 
s2
)

50 cڡ *
s1
, *
s2
;

52 
u_ch
 
s1ch
, 
s2ch
;

55 
s1ch
 = *
s1
++;

56 
s2ch
 = *
s2
++;

57 i(
s1ch
 >= 'A' && s1ch <= 'Z')

58 
s1ch
 += 32;

59 i(
s2ch
 >= 'A' && s2ch <= 'Z')

60 
s2ch
 += 32;

61 i(
s1ch
 !
s2ch
)

62  (
s1ch
 - 
s2ch
);

63 i(
s1ch
 == '\0')

67 
	}
}

78 
	$cmp
(
s1
, 
s2
, 
n
)

79 cڡ *
s1
, *
s2
;

80 
size_t
 
n
;

82 
u_ch
 
s1ch
, 
s2ch
;

84 ; 
n
 != 0; --n) {

85 
s1ch
 = *
s1
++;

86 
s2ch
 = *
s2
++;

87 i(
s1ch
 >= 'A' && s1ch <= 'Z')

88 
s1ch
 += 32;

89 i(
s2ch
 >= 'A' && s2ch <= 'Z')

90 
s2ch
 += 32;

91 i(
s1ch
 !
s2ch
)

92  (
s1ch
 - 
s2ch
);

93 i(
s1ch
 == '\0')

97 
	}
}

	@../clib/strcat.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

46 
	$rt
(*
s
, cڡ *
nd
)

48 *
ve
 = 
s
;

50 ; *
s
; ++s);

51 (*
s
++ = *
nd
++));

52 (
ve
);

53 
	}
}

	@../clib/strchr.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

45 *
	$rchr
(cڡ *
p
, 
ch
)

47 
c
;

49 
c
 = 
ch
;

50 ;; ++
p
) {

51 i(*
p
 =
c
)

52  ((*)
p
);

53 i(*
p
 == '\0')

54  (
NULL
);

57 
	}
}

	@../clib/strdup.c

36 
	~"db_cfig.h
"

38 
	~"db_t.h
"

48 
	$rdup
(
r
)

49 cڡ *
r
;

51 
size_t
 
n
;

52 *
cy
;

54 
n
 = 
	`
(
r
) + 1;

55 i(!(
cy
 = 
	`mloc
((
u_t
)
n
)))

56  (
NULL
);

57 
	`memy
(
cy
, 
r
, 
n
);

58  (
cy
);

59 
	}
}

	@../clib/strerror.c

72 
	~"db_cfig.h
"

74 
	~"db_t.h
"

85 
	$
(
num
)

86 
num
;

88 
	#ERRSTR
(
v
, 
s
) do { \

89 i(
num
 =(
v
)) \

90  (
s
); \

91 } 0)

	)

92 
	`ERRSTR
(0, "Undefinedrror: 0");

93 
	`ERRSTR
(
EPERM
, "Operationotermitted");

94 
	`ERRSTR
(
ENOENT
, "No such file or directory");

95 
	`ERRSTR
(
ESRCH
, "No suchrocess");

96 
	`ERRSTR
(
EINTR
, "Interrupted system call");

97 
	`ERRSTR
(
EIO
, "Input/outputrror");

98 
	`ERRSTR
(
ENXIO
, "Deviceot configured");

99 
	`ERRSTR
(
E2BIG
, "Argumentistooong");

100 
	`ERRSTR
(
ENOEXEC
, "Exec formatrror");

101 
	`ERRSTR
(
EBADF
, "Bad file descriptor");

102 
	`ERRSTR
(
ECHILD
, "No childrocesses");

103 
	`ERRSTR
(
EDEADLK
, "Resource deadlockvoided");

104 
	`ERRSTR
(
ENOMEM
, "Cannotllocate memory");

105 
	`ERRSTR
(
EACCES
, "Permission denied");

106 
	`ERRSTR
(
EFAULT
, "Badddress");

107 
	`ERRSTR
(
ENOTBLK
, "Block deviceequired");

108 
	`ERRSTR
(
EBUSY
, "Device busy");

109 
	`ERRSTR
(
EEXIST
, "Filexists");

110 
	`ERRSTR
(
EXDEV
, "Cross-deviceink");

111 
	`ERRSTR
(
ENODEV
, "Operationot supported by device");

112 
	`ERRSTR
(
ENOTDIR
, "Not directory");

113 
	`ERRSTR
(
EISDIR
, "Is directory");

114 
	`ERRSTR
(
EINVAL
, "Invalidrgument");

115 
	`ERRSTR
(
ENFILE
, "Too many open files in system");

116 
	`ERRSTR
(
EMFILE
, "Too many open files");

117 
	`ERRSTR
(
ENOTTY
, "Inappropriate ioctl for device");

118 
	`ERRSTR
(
ETXTBSY
, "Text file busy");

119 
	`ERRSTR
(
EFBIG
, "Fileooarge");

120 
	`ERRSTR
(
ENOSPC
, "No spaceeft on device");

121 
	`ERRSTR
(
ESPIPE
, "Illegal seek");

122 
	`ERRSTR
(
EROFS
, "Read-only file system");

123 
	`ERRSTR
(
EMLINK
, "Too manyinks");

124 
	`ERRSTR
(
EPIPE
, "Brokenipe");

127 
	`ERRSTR
(
EDOM
, "Numericalrgument out of domain");

128 
	`ERRSTR
(
ERANGE
, "Resultooarge");

131 
	`ERRSTR
(
EAGAIN
, "Resourceemporarily unavailable");

132 
	`ERRSTR
(
EWOULDBLOCK
, "Resourceemporarily unavailable");

133 
	`ERRSTR
(
EINPROGRESS
, "Operationow inrogress");

134 
	`ERRSTR
(
EALREADY
, "Operationlready inrogress");

137 
	`ERRSTR
(
ENOTSOCK
, "Socket operation onon-socket");

138 
	`ERRSTR
(
EDESTADDRREQ
, "Destinationddressequired");

139 
	`ERRSTR
(
EMSGSIZE
, "Messageooong");

140 
	`ERRSTR
(
EPROTOTYPE
, "Protocol wrongype for socket");

141 
	`ERRSTR
(
ENOPROTOOPT
, "Protocolotvailable");

142 
	`ERRSTR
(
EPROTONOSUPPORT
, "Protocolot supported");

143 
	`ERRSTR
(
ESOCKTNOSUPPORT
, "Socketypeot supported");

144 
	`ERRSTR
(
EOPNOTSUPP
, "Operationot supported");

145 
	`ERRSTR
(
EPFNOSUPPORT
, "Protocol familyot supported");

146 
	`ERRSTR
(
EAFNOSUPPORT
, "Address familyot supported byrotocol family");

147 
	`ERRSTR
(
EADDRINUSE
, "Addresslready in use");

148 
	`ERRSTR
(
EADDRNOTAVAIL
, "Can'tssignequestedddress");

151 
	`ERRSTR
(
ENETDOWN
, "Network is down");

152 
	`ERRSTR
(
ENETUNREACH
, "Network is unreachable");

153 
	`ERRSTR
(
ENETRESET
, "Network dropped connection oneset");

154 
	`ERRSTR
(
ECONNABORTED
, "Software caused connectionbort");

155 
	`ERRSTR
(
ECONNRESET
, "Connectioneset byeer");

156 
	`ERRSTR
(
ENOBUFS
, "No buffer spacevailable");

157 
	`ERRSTR
(
EISCONN
, "Socket islready connected");

158 
	`ERRSTR
(
ENOTCONN
, "Socket isot connected");

159 
	`ERRSTR
(
ESHUTDOWN
, "Can't sendfter socket shutdown");

160 
	`ERRSTR
(
ETOOMANYREFS
, "Too manyeferences: can't splice");

161 
	`ERRSTR
(
ETIMEDOUT
, "Operationimed out");

162 
	`ERRSTR
(
ECONNREFUSED
, "Connectionefused");

164 
	`ERRSTR
(
ELOOP
, "Too manyevels of symbolicinks");

165 
	`ERRSTR
(
ENAMETOOLONG
, "Fileameooong");

168 
	`ERRSTR
(
EHOSTDOWN
, "Host is down");

169 
	`ERRSTR
(
EHOSTUNREACH
, "Noouteo host");

170 
	`ERRSTR
(
ENOTEMPTY
, "Directoryotmpty");

173 
	`ERRSTR
(
EPROCLIM
, "Too manyrocesses");

174 
	`ERRSTR
(
EUSERS
, "Too many users");

175 
	`ERRSTR
(
EDQUOT
, "Disc quotaxceeded");

178 
	`ERRSTR
(
ESTALE
, "Stale NFS file handle");

179 
	`ERRSTR
(
EREMOTE
, "Too manyevels ofemote inath");

180 
	`ERRSTR
(
EBADRPC
, "RPC struct is bad");

181 
	`ERRSTR
(
ERPCMISMATCH
, "RPC version wrong");

182 
	`ERRSTR
(
EPROGUNAVAIL
, "RPCrog.otvail");

183 
	`ERRSTR
(
EPROGMISMATCH
, "Program version wrong");

184 
	`ERRSTR
(
EPROCUNAVAIL
, "Badrocedure forrogram");

186 
	`ERRSTR
(
ENOLCK
, "Noocksvailable");

187 
	`ERRSTR
(
ENOSYS
, "Functionot implemented");

188 
	`ERRSTR
(
EFTYPE
, "Inappropriate fileype or format");

189 #ifde
EAUTH


190 
	`ERRSTR
(
EAUTH
, "Authenticationrror");

192 #ifde
ENEEDAUTH


193 
	`ERRSTR
(
ENEEDAUTH
, "Needuthenticator");

195 
	`ERRSTR
(
EIDRM
, "Identifieremoved");

196 
	`ERRSTR
(
ENOMSG
, "No message of desiredype");

197 #ifde
EOVERFLOW


198 
	`ERRSTR
(
EOVERFLOW
, "Valueooargeo be stored in dataype");

200 
	`ERRSTR
(
ECANCELED
, "Operation canceled");

201 
	`ERRSTR
(
EILSEQ
, "Illegal byte sequence");

202 #ifde
ENOATTR


203 
	`ERRSTR
(
ENOATTR
, "Attributeot found");

207 #ifde
EDOOFUS


208 
	`ERRSTR
(
EDOOFUS
, "Programmingrror");

211 #ifde
EBADMSG


212 
	`ERRSTR
(
EBADMSG
, "Bad message");

214 #ifde
EMULTIHOP


215 
	`ERRSTR
(
EMULTIHOP
, "Multihopttempted");

217 #ifde
ENOLINK


218 
	`ERRSTR
(
ENOLINK
, "Link has been severed");

220 #ifde
EPROTO


221 
	`ERRSTR
(
EPROTO
, "Protocolrror");

224  (
	`__db_unknown_r
(
num
));

225 
	}
}

	@../clib/strncat.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

53 
	$t
(*
d
, cڡ *
c
, 
size_t
 
n
)

55 i(
n
 != 0) {

56 *
d
 = 
d
;

57 cڡ *
s
 = 
c
;

59 *
d
 != 0)

60 
d
++;

62 i((*
d
 = *
s
++) == 0)

64 
d
++;

65 } --
n
 != 0);

66 *
d
 = 0;

68  (
d
);

69 
	}
}

	@../clib/strncmp.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

46 
	$cmp
(
s1
, 
s2
, 
n
)

47 cڡ *
s1
, *
s2
;

48 
size_t
 
n
;

51 i(
n
 == 0)

54 i(*
s1
 !*
s2
++)

55  (*(cڡ *)
s1
 -

56 *(cڡ *)(
s2
 - 1));

57 i(*
s1
++ == 0)

59 } --
n
 != 0);

61 
	}
}

	@../clib/strrchr.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

45 *
	$chr
(cڡ *
p
, 
ch
)

47 *
ve
;

48 
c
;

50 
c
 = 
ch
;

51 
ve
 = 
NULL
;; ++
p
) {

52 i(*
p
 =
c
)

53 
ve
 = (*)
p
;

54 i(*
p
 == '\0')

55  (
ve
);

58 
	}
}

	@../clib/strsep.c

34 
	~"db_cfig.h
"

36 
	~"db_t.h
"

54 
	$rp
(
rgp
, 
dim
)

55 **
rgp
;

56 cڡ *
dim
;

58 *
s
;

59 cڡ *
p
;

60 
c
, 
sc
;

61 *
tok
;

63 i((
s
 = *
rgp
=
NULL
)

64  (
NULL
);

65 
tok
 = 
s
;;) {

66 
c
 = *
s
++;

67 
p
 = 
dim
;

69 i((
sc
 = *
p
++=
c
) {

70 i(
c
 == 0)

71 
s
 = 
NULL
;

73 
s
[-1] = 0;

74 *
rgp
 = 
s
;

75  (
tok
);

77 } 
sc
 != 0);

80 
	}
}

	@../clib/strtol.c

36 
	~"db_cfig.h
"

38 
	~"db_t.h
"

51 
	$
(
Ō
, 
dr
, 
ba
)

52 cڡ * 
Ō
;

53 ** 
dr
;

54 
ba
;

56 cڡ *
s
;

57 
acc
;

58 
c
;

59 
cutoff
;

60 
g
, 
y
, 
cuim
;

67 
s
 = 
Ō
;

69 
c
 = *
s
++;

70 } 
	`isa
(()
c
));

71 i(
c
 == '-') {

72 
g
 = 1;

73 
c
 = *
s
++;

75 
g
 = 0;

76 i(
c
 == '+')

77 
c
 = *
s
++;

79 i((
ba
 == 0 || base == 16) &&

80 
c
 ='0' && (*
s
 == 'x' || *s == 'X')) {

81 
c
 = 
s
[1];

82 
s
 += 2;

83 
ba
 = 16;

85 i(
ba
 == 0)

86 
ba
 = 
c
 == '0' ? 8 : 10;

87 
acc
 = 
y
 = 0;

88 i(
ba
 < 2 || base > 36)

89 
nocv
;

108 
cutoff
 = 
g
 ? ()-(
LONG_MIN
 + 
LONG_MAX
) + LONG_MAX

109 : 
LONG_MAX
;

110 
cuim
 = 
cutoff
 % 
ba
;

111 
cutoff
 /
ba
;

112  ; ; 
c
 = *
s
++) {

113 i(
c
 >= '0' && c <= '9')

114 
c
 -= '0';

115 i(
c
 >= 'A' && c <= 'Z')

116 
c
 -= 'A' - 10;

117 i(
c
 >= 'a' && c <= 'z')

118 
c
 -= 'a' - 10;

121 i(
c
 >
ba
)

123 i(
y
 < 0 || 
acc
 > 
cutoff
 || (ac=cutof&& 
c
 > 
cuim
))

124 
y
 = -1;

126 
y
 = 1;

127 
acc
 *
ba
;

128 
acc
 +
c
;

131 i(
y
 < 0) {

132 
acc
 = 
g
 ? 
LONG_MIN
 : 
LONG_MAX
;

133 
o
 = 
ERANGE
;

134 } i(!
y
) {

135 
nocv
:

136 
o
 = 
EINVAL
;

137 } i(
g
)

138 
acc
 = -()acc;

139 i(
dr
 !
NULL
)

140 *
dr
 = (*)(
y
 ? 
s
 - 1 : 
Ō
);

141  (
acc
);

142 
	}
}

	@../clib/strtoul.c

36 
	~"db_cfig.h
"

38 
	~"db_t.h
"

51 
	$oul
(
Ō
, 
dr
, 
ba
)

52 cڡ * 
Ō
;

53 ** 
dr
;

54 
ba
;

56 cڡ *
s
;

57 
acc
;

58 
c
;

59 
cutoff
;

60 
g
, 
y
, 
cuim
;

65 
s
 = 
Ō
;

67 
c
 = *
s
++;

68 } 
	`isa
(()
c
));

69 i(
c
 == '-') {

70 
g
 = 1;

71 
c
 = *
s
++;

73 
g
 = 0;

74 i(
c
 == '+')

75 
c
 = *
s
++;

77 i((
ba
 == 0 || base == 16) &&

78 
c
 ='0' && (*
s
 == 'x' || *s == 'X')) {

79 
c
 = 
s
[1];

80 
s
 += 2;

81 
ba
 = 16;

83 i(
ba
 == 0)

84 
ba
 = 
c
 == '0' ? 8 : 10;

85 
acc
 = 
y
 = 0;

86 i(
ba
 < 2 || base > 36)

87 
nocv
;

89 
cutoff
 = 
ULONG_MAX
 / 
ba
;

90 
cuim
 = 
ULONG_MAX
 % 
ba
;

91  ; ; 
c
 = *
s
++) {

92 i(
c
 >= '0' && c <= '9')

93 
c
 -= '0';

94 i(
c
 >= 'A' && c <= 'Z')

95 
c
 -= 'A' - 10;

96 i(
c
 >= 'a' && c <= 'z')

97 
c
 -= 'a' - 10;

100 i(
c
 >
ba
)

102 i(
y
 < 0 || 
acc
 > 
cutoff
 || (ac=cutof&& 
c
 > 
cuim
))

103 
y
 = -1;

105 
y
 = 1;

106 
acc
 *
ba
;

107 
acc
 +
c
;

110 i(
y
 < 0) {

111 
acc
 = 
ULONG_MAX
;

112 
o
 = 
ERANGE
;

113 } i(!
y
) {

114 
nocv
:

115 
o
 = 
EINVAL
;

116 } i(
g
)

117 
acc
 = -acc;

118 i(
dr
 !
NULL
)

119 *
dr
 = (*)(
y
 ? 
s
 - 1 : 
Ō
);

120  (
acc
);

121 
	}
}

	@../common/crypto_stub.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

25 
	$__yo_gi_
(
dbv
)

26 
DB_ENV
 *
dbv
;

28 
REGENV
 *
nv
;

29 
REGINFO
 *
f
;

30 
t
;

32 
f
 = 
dbv
->
gfo
;

33 
nv
 = 
f
->
imy
;

34 
	`MUTEX_LOCK
(
dbv
, 
nv
->
mtx_gv
);

35 
t
 = !(
nv
->
ch_off
 =
INVALID_ROFF
);

36 
	`MUTEX_UNLOCK
(
dbv
, 
nv
->
mtx_gv
);

38 i(
t
 == 0)

41 
	`__db_rx
(
dbv
,

43  (
DB_OPNOTSUP
);

44 
	}
}

	@../common/db_byteorder.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

23 
	$__db_isbigdn
()

26 
l
;

27 
c
[()];

28 } 
u
;

30 
u
.
l
 = 1;

31  (
u
.
c
[() - 1] == 1);

32 
	}
}

42 
	$__db_byd
(
dbv
, 
ld
)

43 
DB_ENV
 *
dbv
;

44 
ld
;

46 
is_bigdn
;

48 
is_bigdn
 = 
	`__db_isbigdn
();

50 
ld
) {

54 i(
is_bigdn
)

55  (
DB_SWAPBYTES
);

58 i(!
is_bigdn
)

59  (
DB_SWAPBYTES
);

62 
	`__db_rx
(
dbv
,

64  (
EINVAL
);

67 
	}
}

	@../common/db_err.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_am.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/log.h
"

16 
	~"dbc/mp.h
"

17 
	~"dbc/txn.h
"

19 
__db_msg
 
__P
((cڡ 
DB_ENV
 *, cڡ *, 
va_li
));

20 
__db_msgfe
 
__P
((cڡ 
DB_ENV
 *, cڡ *, 
va_li
));

29 
	$__db_fchk
(
dbv
, 
me
, 
ags
, 
ok_ags
)

30 
DB_ENV
 *
dbv
;

31 cڡ *
me
;

32 
u_t32_t
 
ags
, 
ok_ags
;

34  (
	`LF_ISSET
(~
ok_ags
? 
	`__db_
(
dbv
, 
me
, 0) : 0);

35 
	}
}

45 
	$__db_fcchk
(
dbv
, 
me
, 
ags
, 
ag1
, 
ag2
)

46 
DB_ENV
 *
dbv
;

47 cڡ *
me
;

48 
u_t32_t
 
ags
, 
ag1
, 
ag2
;

50  (
	`LF_ISSET
(
ag1
) &&

51 
	`LF_ISSET
(
ag2
? 
	`__db_
(
dbv
, 
me
, 1) : 0);

52 
	}
}

61 
	$__db_
(
dbv
, 
me
, 
iscombo
)

62 cڡ 
DB_ENV
 *
dbv
;

63 cڡ *
me
;

64 
iscombo
;

66 
	`__db_rx
(
dbv
, "illegal flag %sspecifiedo %s",

67 
iscombo
 ? "combi " : "", 
me
);

68  (
EINVAL
);

69 
	}
}

78 
	$__db_l
(
dbv
, 
me
)

79 cڡ 
DB_ENV
 *
dbv
;

80 cڡ *
me
;

82 
	`__db_rx
(
dbv
,

84 
me
);

85  (
EINVAL
);

86 
	}
}

95 
	$__db_pgr
(
dbp
, 
pgno
, 
rv
)

96 
DB
 *
dbp
;

97 
db_pgno_t
 
pgno
;

98 
rv
;

105 
	`__db_rx
(
dbp
->
dbv
,

106 "ubˁ/vg%lu", (
u_lg
)
pgno
);

107  (
	`__db_nic
(
dbp
->
dbv
, 
rv
));

108 
	}
}

117 
	$__db_pgfmt
(
dbv
, 
pgno
)

118 
DB_ENV
 *
dbv
;

119 
db_pgno_t
 
pgno
;

121 
	`__db_rx
(
dbv
, "g%lu: iegagty ofm", (
u_lg
)
pgno
);

122  (
	`__db_nic
(
dbv
, 
EINVAL
));

123 
	}
}

125 #ifde
DIAGNOSTIC


135 
	$__db_as
(
dbv
, 
e
, 
fe
, 
le
)

136 
DB_ENV
 *
dbv
;

137 cڡ *
e
, *
fe
;

138 
le
;

140 
	`__db_rx
(
dbv
, "as fau: %s/%d: \"%s\"", 
fe
, 
le
, 
e
);

142 
	`__os_abt
();

144 
	}
}

154 
	$__db_nic_msg
(
dbv
)

155 
DB_ENV
 *
dbv
;

157 
t
;

159 
t
 = 
DB_RUNRECOVERY
;

161 
	`__db_rx
(
dbv
, "PANIC: fatalegionrror detected;unecovery");

163 i(
dbv
->
db_nic
 !
NULL
)

164 
dbv
->
	`db_nic
(dbv, 
t
);

165 
	`DB_EVENT
(
dbv
, 
DB_EVENT_PANIC
, &
t
);

167  (
t
);

168 
	}
}

177 
	$__db_nic
(
dbv
, 
rv
)

178 
DB_ENV
 *
dbv
;

179 
rv
;

181 i(
dbv
 !
NULL
) {

182 
	`__v_nic_t
(
dbv
, 1);

184 
	`__db_r
(
dbv
, 
rv
, "PANIC");

186 i(
dbv
->
db_nic
 !
NULL
)

187 
dbv
->
	`db_nic
(dbv, 
rv
);

188 
	`DB_EVENT
(
dbv
, 
DB_EVENT_PANIC
, &
rv
);

191 #i
	`defed
(
DIAGNOSTIC
&& !defed(
CONFIG_TEST
)

199 
	`__os_abt
();

208  (
DB_RUNRECOVERY
);

209 
	}
}

218 
	$db_
(
r
)

219 
r
;

221 *
p
;

223 i(
r
 == 0)

225 i(
r
 > 0) {

226 i((
p
 = 
	`
(
r
)!
NULL
)

227  (
p
);

228  (
	`__db_unknown_r
(
r
));

238 
r
) {

239 
DB_BUFFER_SMALL
:

242 
DB_DONOTINDEX
:

244 
DB_KEYEMPTY
:

246 
DB_KEYEXIST
:

248 
DB_LOCK_DEADLOCK
:

251 
DB_LOCK_NOTGRANTED
:

253 
DB_LOG_BUFFER_FULL
:

255 
DB_NOSERVER
:

257 
DB_NOSERVER_HOME
:

259 
DB_NOSERVER_ID
:

261 
DB_NOTFOUND
:

263 
DB_OLD_VERSION
:

265 
DB_PAGE_NOTFOUND
:

267 
DB_REP_DUPMASTER
:

269 
DB_REP_HANDLE_DEAD
:

271 
DB_REP_HOLDELECTION
:

273 
DB_REP_IGNORE
:

275 
DB_REP_ISPERM
:

277 
DB_REP_JOIN_FAILURE
:

280 
DB_REP_LEASE_EXPIRED
:

283 
DB_REP_LOCKOUT
:

286 
DB_REP_NEWSITE
:

288 
DB_REP_NOTPERM
:

290 
DB_REP_UNAVAIL
:

292 
DB_RUNRECOVERY
:

294 
DB_SECONDARY_BAD
:

297 
DB_VERIFY_BAD
:

299 
DB_VERSION_MISMATCH
:

306  (
	`__db_unknown_r
(
r
));

307 
	}
}

316 
	$__db_unknown_r
(
r
)

317 
r
;

330 ()
	`tf
(
	`DB_GLOBAL
(
r_buf
),

331 (
	`DB_GLOBAL
(
r_buf
)), "Unknowr: %d", 
r
);

332  (
	`DB_GLOBAL
(
r_buf
));

333 
	}
}

343 #ifde
STDC_HEADERS


344 
	$__db_sy
(cڡ 
DB_ENV
 *
dbv
, 
r
, cڡ *
fmt
, ...)

346 
	$__db_sy
(
dbv
, 
r
, 
fmt
, 
va_i
)

347 cڡ 
DB_ENV
 *
dbv
;

348 
r
;

349 cڡ *
fmt
;

350 
va_d


358 
	`DB_REAL_ERR
(
dbv
, 
r
, 
DB_ERROR_SYSTEM
, 0, 
fmt
);

359 
	}
}

369 #ifde
STDC_HEADERS


370 
	$__db_r
(cڡ 
DB_ENV
 *
dbv
, 
r
, cڡ *
fmt
, ...)

372 
	$__db_r
(
dbv
, 
r
, 
fmt
, 
va_i
)

373 cڡ 
DB_ENV
 *
dbv
;

374 
r
;

375 cڡ *
fmt
;

376 
va_d


383 
	`DB_REAL_ERR
(
dbv
, 
r
, 
DB_ERROR_SET
, 0, 
fmt
);

384 
	}
}

394 #ifde
STDC_HEADERS


395 
	$__db_rx
(cڡ 
DB_ENV
 *
dbv
, cڡ *
fmt
, ...)

397 
	$__db_rx
(
dbv
, 
fmt
, 
va_i
)

398 cڡ 
DB_ENV
 *
dbv
;

399 cڡ *
fmt
;

400 
va_d


407 
	`DB_REAL_ERR
(
dbv
, 0, 
DB_ERROR_NOT_SET
, 0, 
fmt
);

408 
	}
}

418 
	$__db_r
(
dbv
, 
r
, 
r_t
, 
fmt
, 

)

419 cڡ 
DB_ENV
 *
dbv
;

420 
r
;

421 
db_r_t_t
 
r_t
;

422 cڡ *
fmt
;

423 
va_li
 

;

425 *
p
;

426 
buf
[2048];

427 
sysbuf
[1024];

429 
p
 = 
buf
;

430 i(
fmt
 !
NULL
)

431 
p
 +
	`vtf
(
buf
, (buf), 
fmt
, 

);

432 i(
r_t
 !
DB_ERROR_NOT_SET
)

433 
p
 +
	`tf
(p,

434 (
buf
- (
size_t
)(
p
 - buf), ": %s",

435 
r_t
 =
DB_ERROR_SET
 ? 
	`db_
(
r
) :

436 
	`__os_
(
r
, 
sysbuf
, (sysbuf)));

438 
dbv
->
	`db_r
(dbv, dbv->
db_fx
, 
buf
);

439 
	}
}

449 
	$__db_rfe
(
dbv
, 
r
, 
r_t
, 
fmt
, 

)

450 cڡ 
DB_ENV
 *
dbv
;

451 
r
;

452 
db_r_t_t
 
r_t
;

453 cڡ *
fmt
;

454 
va_li
 

;

456 
FILE
 *

;

457 
sysbuf
[1024];

459 

 = 
dbv
 =
NULL
 ||

460 
dbv
->
db_rfe
 =
NULL
 ? 
dr
 : dbenv->db_errfile;

462 i(
dbv
 !
NULL
 && dbv->
db_fx
 != NULL)

463 ()
	`rtf
(

, "%s: ", 
dbv
->
db_fx
);

464 i(
fmt
 !
NULL
) {

465 ()
	`vrtf
(

, 
fmt
, 

);

466 i(
r_t
 !
DB_ERROR_NOT_SET
)

467 ()
	`rtf
(

, ": ");

469 i(
r_t
 !
DB_ERROR_NOT_SET
)

470 ()
	`rtf
(

, "%s",

471 
r_t
 =
DB_ERROR_SET
 ? 
	`db_
(
r
) :

472 
	`__os_
(
r
, 
sysbuf
, (sysbuf)));

473 ()
	`rtf
(

, "\n");

474 ()
	`fush
(

);

475 
	}
}

485 #ifde
STDC_HEADERS


486 
	$__db_msgadd
(
DB_ENV
 *
dbv
, 
DB_MSGBUF
 *
mbp
, cڡ *
fmt
, ...)

488 
	$__db_msgadd
(
dbv
, 
mbp
, 
fmt
, 
va_i
)

489 
DB_ENV
 *
dbv
;

490 
DB_MSGBUF
 *
mbp
;

491 cڡ *
fmt
;

492 
va_d


495 
va_li
 

;

497 #ifde
STDC_HEADERS


498 
	`va_t
(

, 
fmt
);

500 
	`va_t
(

);

502 
	`__db_msgadd_
(
dbv
, 
mbp
, 
fmt
, 

);

503 
	`va_d
(

);

504 
	}
}

514 
	$__db_msgadd_
(
dbv
, 
mbp
, 
fmt
, 

)

515 
DB_ENV
 *
dbv
;

516 
DB_MSGBUF
 *
mbp
;

517 cڡ *
fmt
;

518 
va_li
 

;

520 
size_t
 
n
, 
ޒ
;

521 
buf
[2048];

523 
n
 = (
size_t
)
	`vtf
(
buf
, (buf), 
fmt
, 

);

530 
ޒ
 = (
size_t
)(
mbp
->
cur
 - mbp->
buf
);

531 i(
ޒ
 + 
n
 >
mbp
->len) {

532 i(
	`__os_loc
(
dbv
, 
mbp
->
n
 + + 256, &mbp->
buf
))

534 
mbp
->
n
 += (len + 256);

535 
mbp
->
cur
 = mbp->
buf
 + 
ޒ
;

538 
	`memy
(
mbp
->
cur
, 
buf
, 
n
 + 1);

539 
mbp
->
cur
 +
n
;

540 
	}
}

550 #ifde
STDC_HEADERS


551 
	$__db_msg
(cڡ 
DB_ENV
 *
dbv
, cڡ *
fmt
, ...)

553 
	$__db_msg
(
dbv
, 
fmt
, 
va_i
)

554 cڡ 
DB_ENV
 *
dbv
;

555 cڡ *
fmt
;

556 
va_d


559 
	`DB_REAL_MSG
(
dbv
, 
fmt
);

560 
	}
}

567 
	$__db_msg
(
dbv
, 
fmt
, 

)

568 cڡ 
DB_ENV
 *
dbv
;

569 cڡ *
fmt
;

570 
va_li
 

;

572 
buf
[2048];

574 ()
	`vtf
(
buf
, (buf), 
fmt
, 

);

576 
dbv
->
	`db_msg
(dbv, 
buf
);

577 
	}
}

584 
	$__db_msgfe
(
dbv
, 
fmt
, 

)

585 cڡ 
DB_ENV
 *
dbv
;

586 cڡ *
fmt
;

587 
va_li
 

;

589 
FILE
 *

;

591 

 = 
dbv
 =
NULL
 ||

592 
dbv
->
db_msgfe
 =
NULL
 ? 
dout
 : dbenv->db_msgfile;

593 ()
	`vrtf
(

, 
fmt
, 

);

595 ()
	`rtf
(

, "\n");

596 ()
	`fush
(

);

597 
	}
}

605 
	$__db_unknown_ag
(
dbv
, 
route
, 
ag
)

606 
DB_ENV
 *
dbv
;

607 *
route
;

608 
u_t32_t
 
ag
;

610 
	`__db_rx
(
dbv
, "%s: Unknowag: %#x", 
route
, (
u_t
)
ag
);

612 #ifde
DIAGNOSTIC


613 
	`__os_abt
();

616  (
EINVAL
);

617 
	}
}

625 
	$__db_unknown_ty
(
dbv
, 
route
, 
ty
)

626 
DB_ENV
 *
dbv
;

627 *
route
;

628 
DBTYPE
 
ty
;

630 
	`__db_rx
(
dbv
,

632 
route
, 
	`__db_dbty_to_rg
(
ty
));

634 #ifde
DIAGNOSTIC


635 
	`__os_abt
();

638  (
EINVAL
);

639 
	}
}

647 
	$__db_unknown_th
(
dbv
, 
route
)

648 
DB_ENV
 *
dbv
;

649 *
route
;

651 
	`__db_rx
(
dbv
, "%s: Uxed codth", 
route
);

653 #ifde
DIAGNOSTIC


654 
	`__os_abt
();

657  (
EINVAL
);

658 
	}
}

667 
	$__db_check_txn
(
dbp
, 
txn
, 
assoc_lock
, 
ad_
)

668 
DB
 *
dbp
;

669 
DB_TXN
 *
txn
;

670 
DB_LOCKER
 *
assoc_lock
;

671 
ad_
;

673 
DB_ENV
 *
dbv
;

674 
i
, 
t
;

676 
dbv
 = 
dbp
->dbenv;

686 i(
	`IS_RECOVERING
(
dbv
|| 
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
))

695 i(
txn
 =
NULL
 || 
	`F_ISSET
xn, 
TXN_PRIVATE
)) {

696 i(
dbp
->
cur_lock
 !
NULL
 &&

697 
dbp
->
cur_lock
->
id
 >
TXN_MINIMUM
)

698 
ݒ_r
;

700 i(!
ad_
 && 
	`F_ISSET
(
dbp
, 
DB_AM_TXN
)) {

701 
	`__db_rx
(
dbv
,

703  (
EINVAL
);

705 } i(
	`F_ISSET
(
txn
, 
TXN_CDSGROUP
)) {

706 i(!
	`CDB_LOCKING
(
dbv
)) {

707 
	`__db_rx
(
dbv
,

709  (
EINVAL
);

717 i(!
	`TXN_ON
(
dbv
))

718  (
	`__db_n_txn_v
(
dbv
));

720 i(!
	`F_ISSET
(
dbp
, 
DB_AM_TXN
)) {

721 
	`__db_rx
(
dbv
,

723  (
EINVAL
);

726 i(
	`F_ISSET
(
txn
, 
TXN_DEADLOCK
))

727  (
	`__db_txn_ddlock_r
(
dbv
, 
txn
));

728 i(
dbp
->
cur_lock
 !
NULL
 &&

729 
dbp
->
cur_lock
->
id
 >
TXN_MINIMUM
 &&

730 
dbp
->
cur_lock
->
id
 !
txn
->
txnid
) {

731 i((
t
 = 
	`__lock_lock_is_
(
dbv
,

732 
dbp
->
cur_lock
, 
txn
->
lock
, &
i
)) != 0)

733  (
t
);

734 i(!
i
)

735 
ݒ_r
;

754 i(!
ad_
 && 
dbp
->
assoc_lock
 !
NULL
 &&

755 
txn
 !
NULL
 && 
dbp
->
assoc_lock
 !
assoc_lock
) {

756 
	`__db_rx
(
dbv
,

758  (
EINVAL
);

764 i(
txn
 !
NULL
 && 
dbv
 !txn->
mg
->dbenv) {

765 
	`__db_rx
(
dbv
,

767  (
EINVAL
);

771 
ݒ_r
:

772 
	`__db_rx
(
dbv
,

774  (
EINVAL
);

775 
	}
}

784 
	$__db_txn_ddlock_r
(
dbv
, 
txn
)

785 
DB_ENV
 *
dbv
;

786 
DB_TXN
 *
txn
;

788 cڡ *
me
;

790 
me
 = 
NULL
;

791 ()
	`__txn_g_me
(
txn
, &
me
);

793 
	`__db_rx
(
dbv
,

795 
me
 =
NULL
 ? "" :ame,ame == NULL ? "" : ": ");

797  (
EINVAL
);

798 
	}
}

807 
	$__db_n_txn_v
(
dbv
)

808 
DB_ENV
 *
dbv
;

810 
	`__db_rx
(
dbv
, "DBnvironmentot configured forransactions");

811  (
EINVAL
);

812 
	}
}

821 
	$__db_c_toobig
(
dbv
, 
da_n
, 
fixed_c_n
)

822 
DB_ENV
 *
dbv
;

823 
u_t32_t
 
da_n
, 
fixed_c_n
;

825 
	`__db_rx
(
dbv
,

827 (
u_lg
)
da_n
, (u_lg)
fixed_c_n
);

828  (
EINVAL
);

829 
	}
}

838 
	$__db_c_
(
dbv
, 
da_size
, 
da_dn
)

839 
DB_ENV
 *
dbv
;

840 
u_t32_t
 
da_size
, 
da_dn
;

842 
	`__db_rx
(
dbv
,

844 "Recdgth", (
u_lg
)
da_size
, (u_lg)
da_dn
);

845  (
EINVAL
);

846 
	}
}

848 #i
defed
(
DIAGNOSTIC
|| defed(
DEBUG_ROP
|| defed(
DEBUG_WOP
)

856 
	$__dbc_loggg
(
dbc
)

857 
DBC
 *
dbc
;

859 
DB_ENV
 *
dbv
;

860 
DB_REP
 *
db_p
;

861 
t
;

863 
dbv
 = 
dbc
->
dbp
->dbenv;

864 
db_p
 = 
dbv
->
p_hd
;

866 
t
 = 
	`LOGGING_ON
(
dbv
) &&

867 !
	`F_ISSET
(
dbc
, 
DBC_RECOVER
&& !
	`IS_REP_CLIENT
(
dbv
);

872 i(
db_p
 =
NULL
 || 
	`F_ISSET
(
dbc
, 
DBC_RECOVER
))

873  (
t
);

875 #idef 
DEBUG_ROP


882 
REP
 *
p
;

884 
p
 = 
db_p
->
gi
;

889 i(
	`IS_REP_CLIENT
(
dbv
&& !
	`F_ISSET
(
dbc
->
dbp
, 
DB_AM_NOT_DURABLE
)) {

890 
	`__db_rx
(
dbv
, "dbc_logging: Client update");

891 
r
;

894 #ide
DEBUG_WOP


899 i(
	`IS_REP_MASTER
(
dbv
) &&

900 
dbc
->
txn
 =
NULL
 && !
	`F_ISSET
(dbc->
dbp
, 
DB_AM_NOT_DURABLE
)) {

901 
	`__db_rx
(
dbv
, "Dbc_logging: Masteron-txn update");

902 
r
;

907 
r
: 
	`__db_rx
(
dbv
, "Rep: flags 0x%lx msg_th %lu",

908 (
u_lg
)
p
->
ags
, (u_lg->
msg_th
);

909 
	`__db_rx
(
dbv
, "Rep: handle %lu, opcnt %lu",

910 (
u_lg
)
p
->
hd_t
, (u_lg->
_t
);

911 
	`__os_abt
();

916  (
t
);

917 
	}
}

927 
	$__db_check_l
(
dbv
, 
l
, 
ev
)

928 
DB_ENV
 *
dbv
;

929 
DB_LSN
 *
l
, *
ev
;

931 
	`__db_rx
(
dbv
,

933 (
u_lg
)(
l
)->
fe
, (u_lg)֢)->
offt
,

934 (
u_lg
)(
ev
)->
fe
, (u_lg)ջv)->
offt
);

935  (
EINVAL
);

936 
	}
}

944 
	$__db_rdly
(
dbv
, 
me
)

945 cڡ 
DB_ENV
 *
dbv
;

946 cڡ *
me
;

948 
	`__db_rx
(
dbv
, "%s:emmodifyd-ly daba", 
me
);

949  (
EACCES
);

950 
	}
}

958 
	$__db_a_r
(
dbp
)

959 cڡ 
DB
 *
dbp
;

961 
	`__db_rx
(
dbp
->
dbv
,

963 
dbp
->
ame
, (
u_lg
)dbp->
mpf
->
m
->
maxpgno
);

964  (
ENOSPC
);

965 
	}
}

975 
	$__db_ed
(
dbv
, 
msg
, 
pid
, 
tid
)

976 cڡ 
DB_ENV
 *
dbv
;

977 cڡ *
msg
;

978 
pid_t
 
pid
;

979 
db_thadid_t
 
tid
;

981 
buf
[
DB_THREADID_STRLEN
];

983 
	`__db_rx
(
dbv
, "Thread/process %s failed: %s",

984 
dbv
->
	`thad_id_rg
((
DB_ENV
*)dbv, 
pid
, 
tid
, 
buf
), 
msg
);

985  (
DB_RUNRECOVERY
);

986 
	}
}

	@../common/db_getlong.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

21 
	$__db_glg
(
dbv
, 
ogme
, 
p
, 
m
, 
max
, 
ܕ
)

22 
DB_ENV
 *
dbv
;

23 cڡ *
ogme
;

24 *
p
;

25 
m
, 
max
, *
ܕ
;

27 
v
;

28 *
d
;

30 
	`__os_t_o
(0);

31 
v
 = 
	`
(
p
, &
d
, 10);

32 i((
v
 =
LONG_MIN
 || v =
LONG_MAX
) &&

33 
	`__os_g_o
(=
ERANGE
) {

34 i(
dbv
 =
NULL
)

35 
	`rtf
(
dr
,

36 "%s: %s: %s\n", 
ogme
, 
p
, 
	`
(
ERANGE
));

38 
dbv
->
	`r
(dbv, 
ERANGE
, "%s", 
p
);

39  (
ERANGE
);

41 i(
p
[0] ='\0' || (
d
[0] != '\0' &&nd[0] != '\n')) {

42 i(
dbv
 =
NULL
)

43 
	`rtf
(
dr
,

44 "%s: %s: Invidumigumt\n", 
ogme
, 
p
);

46 
dbv
->
	`rx
(dbv, "%s: Invidumigumt", 
p
);

47  (
EINVAL
);

49 i(
v
 < 
m
) {

50 i(
dbv
 =
NULL
)

51 
	`rtf
(
dr
,

53 
ogme
, 
p
, 
m
);

55 
dbv
->
	`rx
(dbenv,

56 "%s: Lesth mimum vu(%ld)", 
p
, 
m
);

57  (
ERANGE
);

59 i(
v
 > 
max
) {

60 i(
dbv
 =
NULL
)

61 
	`rtf
(
dr
,

63 
ogme
, 
p
, 
max
);

65 
dbv
->
	`rx
(dbenv,

66 "%s: Gh maximum vu(%ld)", 
p
, 
max
);

67  (
ERANGE
);

69 *
ܕ
 = 
v
;

71 
	}
}

81 
	$__db_gulg
(
dbv
, 
ogme
, 
p
, 
m
, 
max
, 
ܕ
)

82 
DB_ENV
 *
dbv
;

83 cڡ *
ogme
;

84 *
p
;

85 
u_lg
 
m
, 
max
, *
ܕ
;

87 
u_lg
 
v
;

88 *
d
;

90 
	`__os_t_o
(0);

91 
v
 = 
	`oul
(
p
, &
d
, 10);

92 i(
v
 =
ULONG_MAX
 && 
	`__os_g_o
(=
ERANGE
) {

93 i(
dbv
 =
NULL
)

94 
	`rtf
(
dr
,

95 "%s: %s: %s\n", 
ogme
, 
p
, 
	`
(
ERANGE
));

97 
dbv
->
	`r
(dbv, 
ERANGE
, "%s", 
p
);

98  (
ERANGE
);

100 i(
p
[0] ='\0' || (
d
[0] != '\0' &&nd[0] != '\n')) {

101 i(
dbv
 =
NULL
)

102 
	`rtf
(
dr
,

103 "%s: %s: Invidumigumt\n", 
ogme
, 
p
);

105 
dbv
->
	`rx
(dbv, "%s: Invidumigumt", 
p
);

106  (
EINVAL
);

108 i(
v
 < 
m
) {

109 i(
dbv
 =
NULL
)

110 
	`rtf
(
dr
,

112 
ogme
, 
p
, 
m
);

114 
dbv
->
	`rx
(dbenv,

115 "%s: Lesth mimum vu(%lu)", 
p
, 
m
);

116  (
ERANGE
);

125 i(
max
 !0 && 
v
 > max) {

126 i(
dbv
 =
NULL
)

127 
	`rtf
(
dr
,

129 
ogme
, 
p
, 
max
);

131 
dbv
->
	`rx
(dbenv,

132 "%s: Gh maximum vu(%lu)", 
p
, 
max
);

133  (
ERANGE
);

135 *
ܕ
 = 
v
;

137 
	}
}

	@../common/db_idspace.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
__db_idcmp
 
__P
((const *, const *));

16 
	$__db_idcmp
(
a
, 
b
)

17 cڡ *
a
;

18 cڡ *
b
;

20 
u_t32_t
 
i
, 
j
;

22 
i
 = *(
u_t32_t
 *)
a
;

23 
j
 = *(
u_t32_t
 *)
b
;

25 i(
i
 < 
j
)

27 i(
i
 > 
j
)

31 
	}
}

44 
	$__db_ida
(
u
, 
n
, 
mp
, 
maxp
)

45 
u_t32_t
 *
u
;

46 
n
;

47 
u_t32_t
 *
mp
, *
maxp
;

49 
i
, 
low
;

50 
u_t32_t
 
g
, 
t
;

53 i(
n
 == 1) {

60 i(
u
[0] !*
maxp
)

61 *
mp
 = 
u
[0];

62 *
maxp
 = 
u
[0] - 1;

66 
g
 = 0;

67 
low
 = 0;

68 
	`qst
(
u
, (
size_t
)
n
, (
u_t32_t
), 
__db_idcmp
);

69 
i
 = 0; i < 
n
 - 1; i++)

70 i((
t
 = (
u
[
i
 + 1] - inu[i])> 
g
) {

71 
g
 = 
t
;

72 
low
 = 
i
;

76 i((*
maxp
 - 
u
[
n
 - 1]+ (u[0] - *
mp
> 
g
) {

78 i(
u
[
n
 - 1] !*
maxp
)

79 *
mp
 = 
u
[
n
 - 1];

80 *
maxp
 = 
u
[0] - 1;

82 *
mp
 = 
u
[
low
];

83 *
maxp
 = 
u
[
low
 + 1] - 1;

85 
	}
}

	@../common/db_log2.c

40 
	~"db_cfig.h
"

42 
	~"db_t.h
"

47 
u_t32_t


48 
	$__db_log2
(
num
)

49 
u_t32_t
 
num
;

51 
u_t32_t
 
i
, 
lim
;

53 
lim
 = 1;

54 
i
 = 0; 
lim
 < 
num
;imit =imit << 1)

55 ++
i
;

56  (
i
);

57 
	}
}

	@../common/db_shash.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

19 
u_t32_t


20 
	$__db_bsize
(
n_bucks
)

21 
u_t32_t
 
n_bucks
;

41 
	#HASH_SIZE
(
pow
, 
ime
) { \

42 i((
pow
>
n_bucks
) \

43  (
ime
); \

44 }

	)

45 
	`HASH_SIZE
(32, 37);

46 
	`HASH_SIZE
(64, 67);

47 
	`HASH_SIZE
(128, 131);

48 
	`HASH_SIZE
(256, 257);

49 
	`HASH_SIZE
(512, 521);

50 
	`HASH_SIZE
(1024, 1031);

51 
	`HASH_SIZE
(2048, 2053);

52 
	`HASH_SIZE
(4096, 4099);

53 
	`HASH_SIZE
(8192, 8191);

54 
	`HASH_SIZE
(16384, 16381);

55 
	`HASH_SIZE
(32768, 32771);

56 
	`HASH_SIZE
(65536, 65537);

57 
	`HASH_SIZE
(131072, 131071);

58 
	`HASH_SIZE
(262144, 262147);

59 
	`HASH_SIZE
(393216, 393209);

60 
	`HASH_SIZE
(524288, 524287);

61 
	`HASH_SIZE
(786432, 786431);

62 
	`HASH_SIZE
(1048576, 1048573);

63 
	`HASH_SIZE
(1572864, 1572869);

64 
	`HASH_SIZE
(2097152, 2097169);

65 
	`HASH_SIZE
(3145728, 3145721);

66 
	`HASH_SIZE
(4194304, 4194301);

67 
	`HASH_SIZE
(6291456, 6291449);

68 
	`HASH_SIZE
(8388608, 8388617);

69 
	`HASH_SIZE
(12582912, 12582917);

70 
	`HASH_SIZE
(16777216, 16777213);

71 
	`HASH_SIZE
(25165824, 25165813);

72 
	`HASH_SIZE
(33554432, 33554393);

73 
	`HASH_SIZE
(50331648, 50331653);

74 
	`HASH_SIZE
(67108864, 67108859);

75 
	`HASH_SIZE
(100663296, 100663291);

76 
	`HASH_SIZE
(134217728, 134217757);

77 
	`HASH_SIZE
(201326592, 201326611);

78 
	`HASH_SIZE
(268435456, 268435459);

79 
	`HASH_SIZE
(402653184, 402653189);

80 
	`HASH_SIZE
(536870912, 536870909);

81 
	`HASH_SIZE
(805306368, 805306357);

82 
	`HASH_SIZE
(1073741824, 1073741827);

84 
	}
}

93 
	$__db_hash
(
beg
, 
mts
)

94 *
beg
;

95 
u_t32_t
 
mts
;

97 
u_t32_t
 
i
;

98 
	`SH_TAILQ_HEAD
(
hash_hd
*
hdp
;

100 
hdp
 = (
hash_hd
 *)
beg
;

102 
i
 = 0; i < 
mts
; i++, 
hdp
++)

103 
	`SH_TAILQ_INIT
(
hdp
);

104 
	}
}

	@../common/mkpath.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
	$__db_mkth
(
dbv
, 
me
)

21 
DB_ENV
 *
dbv
;

22 cڡ *
me
;

24 
size_t
 
n
;

25 
t
;

26 *
p
, *
t
, 
vech
;

32 
n
 = 
	`
(
me
) + 1;

33 i((
t
 = 
	`__os_mloc
(
dbv
, 
n
, &
t
)) != 0)

34  (
t
);

35 
	`memy
(
t
, 
me
, 
n
);

43 i(
PATH_SEPARATOR
[1] == '\0') {

44 
p
 = 
t
 + 1;[0] != '\0'; ++p)

45 i(
p
[0] =
PATH_SEPARATOR
[0]) {

46 
vech
 = *
p
;

47 *
p
 = '\0';

48 i(
	`__os_exis
(
dbv
, 
t
, 
NULL
) &&

49 (
t
 = 
	`__os_mkd
(

50 
dbv
, 
t
, dbv->
d_mode
)) != 0)

52 *
p
 = 
vech
;

55 
p
 = 
t
 + 1;[0] != '\0'; ++p)

56 i(
	`rchr
(
PATH_SEPARATOR
, 
p
[0]!
NULL
) {

57 
vech
 = *
p
;

58 *
p
 = '\0';

59 i(
	`__os_exis
(
dbv
, 
t
, 
NULL
) &&

60 (
t
 = 
	`__os_mkd
(

61 
dbv
, 
t
, dbv->
d_mode
)) != 0)

63 *
p
 = 
vech
;

66 
	`__os_
(
dbv
, 
t
);

67  (
t
);

68 
	}
}

	@../common/util_arg.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 *
__db_rp
 
__P
((**, const *));

22 
	$__db_ut_g
(
g0
, 
r
, 
g
, 
gvp
)

23 *
g0
, *
r
, ***
gvp
;

24 *
g
;

26 
n
, 
t
;

27 **

, **
gv
;

29 
	#MAXARGS
 25

	)

30 i((
t
 =

31 
	`__os_mloc
(
NULL
, (
MAXARGS
 + 1* (**), &
gv
)) != 0)

32  (
t
);

34 

 = 
gv
;

35 *

++ = 
g0
;

36 
n
 = 1; (*

 = 
	`__db_rp
(&
r
, " \t")!
NULL
;)

37 i(**

 != '\0') {

38 ++

;

39 i(++
n
 =
MAXARGS
)

42 *

 = 
NULL
;

44 *
g
 = 

 - 
gv
;

45 *
gvp
 = 
gv
;

48 
	}
}

94 
	$__db_rp
(
rgp
, 
dim
)

95 **
rgp
;

96 cڡ *
dim
;

98 cڡ *
p
;

99 
c
, 
sc
;

100 *
s
, *
tok
;

102 i((
s
 = *
rgp
=
NULL
)

103  (
NULL
);

104 
tok
 = 
s
;;) {

105 
c
 = *
s
++;

106 
p
 = 
dim
;

108 i((
sc
 = *
p
++=
c
) {

109 i(
c
 == 0)

110 
s
 = 
NULL
;

112 
s
[-1] = 0;

113 *
rgp
 = 
s
;

114  (
tok
);

116 } 
sc
 != 0);

119 
	}
}

	@../common/util_cache.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
	$__db_ut_che
(
dbp
, 
ch
, 
siz
)

21 
DB
 *
dbp
;

22 
u_t32_t
 *
ch
;

23 *
siz
;

25 
u_t32_t
 
pgsize
;

26 
t
;

29 i((
t
 = 
dbp
->
	`g_gesize
(dbp, &
pgsize
)) != 0)

30  (
t
);

40 i((*
ch
 / 
pgsize
< 
DB_MINPAGECACHE
) {

41 *
siz
 = 1;

42 *
ch
 = 
pgsize
 * 
DB_MINPAGECACHE
;

44 *
siz
 = 0;

47 
	}
}

	@../common/util_log.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
	$__db_ut_logt
(
ogme
, 
ame
)

21 cڡ *
ogme
;

22 *
ame
;

24 
pid_t
 
pid
;

25 
FILE
 *

;

26 
time_t
 
now
;

27 
time_buf
[
CTIME_BUFLEN
];

29 i((

 = 
	`fݒ
(
ame
, "w")=
NULL
)

30 
r
;

32 ()
	`time
(&
now
);

34 
	`__os_id
(
NULL
, &
pid
, NULL);

35 
	`rtf
(

,

36 "%s: %lu %s", 
ogme
, (
u_lg
)
pid
, 
	`__db_ime
(&
now
, 
time_buf
));

38 i(
	`fo
(

=
EOF
)

39 
r
;

43 
r
: 
	`rtf
(
dr
, "%s: %s: %s\n", 
ogme
, 
ame
, 
	`
(
o
));

45 
	}
}

	@../common/util_sig.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	gu
;

14 
t_sigl
 
__P
((, ));

15 
sigl_hdr
 
__P
(());

22 
	$sigl_hdr
(
signo
)

23 
signo
;

25 #ide
HAVE_SIGACTION


27 
	`t_sigl
(
signo
, 0);

30 i((
u
 = 
signo
) == 0)

31 
u
 = 
SIGINT
;

32 
	}
}

38 
	$t_sigl
(
s
, 
is_dt
)

39 
s
, 
is_dt
;

44 #ifde
HAVE_SIGACTION


45 
sigai
 

, 
o
;

47 

.
_hdr
 = 
is_dt
 ? 
SIG_DFL
 : 
sigl_hdr
;

48 ()
	`sigemyt
(&

.
_mask
);

49 

.
_ags
 = 0;

50 ()
	`sigai
(
s
, &

, &
o
);

52 ()
	`sigl
(
s
, 
is_dt
 ? 
SIG_DFL
 : 
sigl_hdr
);

54 
	}
}

62 
	$__db_ut_sig
()

69 #ifde
SIGHUP


70 
	`t_sigl
(
SIGHUP
, 0);

72 #ifde
SIGINT


73 
	`t_sigl
(
SIGINT
, 0);

75 #ifde
SIGPIPE


76 
	`t_sigl
(
SIGPIPE
, 0);

78 #ifde
SIGTERM


79 
	`t_sigl
(
SIGTERM
, 0);

81 
	}
}

90 
	$__db_ut_ued
()

92  (
u
 != 0);

93 
	}
}

101 
	$__db_ut_signd
()

104 i(
u
 != 0) {

105 
	`t_sigl
(
u
, 1);

107 ()
	`i
(
u
);

110 
	}
}

	@../crypto/aes_method.c

12 
	~"db_cfig.h
"

14 
	~"db_t.h
"

15 
	~"dbc/yo.h
"

16 
	~"dbc/hmac.h
"

18 
__s_r
 
__P
((
DB_ENV
 *, ));

19 
__s_divekeys
 
__P
((
DB_ENV
 *, 
DB_CIPHER
 *, 
u_t8_t
 *, 
size_t
));

28 
	$__s_tup
(
dbv
, 
db_ch
)

29 
DB_ENV
 *
dbv
;

30 
DB_CIPHER
 *
db_ch
;

32 
AES_CIPHER
 *
s_ch
;

33 
t
;

35 
db_ch
->
adj_size
 = 
__s_adj_size
;

36 
db_ch
->
o
 = 
__s_o
;

37 
db_ch
->
dey
 = 
__s_dey
;

38 
db_ch
->
y
 = 
__s_y
;

39 
db_ch
->

 = 
__s_
;

40 i((
t
 = 
	`__os_oc
(
dbv
, 1, (
AES_CIPHER
), &
s_ch
)) != 0)

41  (
t
);

42 
db_ch
->
da
 = 
s_ch
;

44 
	}
}

53 
u_t


54 
	$__s_adj_size
(
n
)

55 
size_t
 
n
;

57 i(
n
 % 
DB_AES_CHUNK
 == 0)

59  (
DB_AES_CHUNK
 - (
u_t
)(
n
 % DB_AES_CHUNK));

60 
	}
}

69 
	$__s_o
(
dbv
, 
da
)

70 
DB_ENV
 *
dbv
;

71 *
da
;

73 
	`__os_
(
dbv
, 
da
);

75 
	}
}

85 
	$__s_dey
(
dbv
, 
s_da
, 
iv
, 
ch
, 
ch_n
)

86 
DB_ENV
 *
dbv
;

87 *
s_da
;

88 *
iv
;

89 
u_t8_t
 *
ch
;

90 
size_t
 
ch_n
;

92 
AES_CIPHER
 *
s
;

93 
chIn
 
c
;

94 
t
;

96 
s
 = (
AES_CIPHER
 *)
s_da
;

97 i(
iv
 =
NULL
 || 
ch
 == NULL)

98  (
EINVAL
);

99 i((
ch_n
 % 
DB_AES_CHUNK
) != 0)

100  (
EINVAL
);

104 i((
t
 = 
	`__db_chIn
(&
c
, 
MODE_CBC
, 
iv
)) < 0) {

105 
	`__s_r
(
dbv
, 
t
);

106  (
EAGAIN
);

110 i((
t
 = 
	`__db_blockDey
(&
c
, &
s
->
dey_ki
, 
ch
,

111 
ch_n
 * 8, 
ch
)) < 0) {

112 
	`__s_r
(
dbv
, 
t
);

113  (
EAGAIN
);

116 
	}
}

126 
	$__s_y
(
dbv
, 
s_da
, 
iv
, 
da
, 
da_n
)

127 
DB_ENV
 *
dbv
;

128 *
s_da
;

129 *
iv
;

130 
u_t8_t
 *
da
;

131 
size_t
 
da_n
;

133 
AES_CIPHER
 *
s
;

134 
chIn
 
c
;

135 
u_t32_t
 
tmp_iv
[
DB_IV_BYTES
/4];

136 
t
;

138 
s
 = (
AES_CIPHER
 *)
s_da
;

139 i(
s
 =
NULL
 || 
da
 == NULL)

140  (
EINVAL
);

141 i((
da_n
 % 
DB_AES_CHUNK
) != 0)

142  (
EINVAL
);

152 i((
t
 = 
	`__db_ge_iv
(
dbv
, 
tmp_iv
)) != 0)

153  (
t
);

158 i((
t
 = 
	`__db_chIn
(&
c
, 
MODE_CBC
, (*)
tmp_iv
)) < 0) {

159 
	`__s_r
(
dbv
, 
t
);

160  (
EAGAIN
);

164 i((
t
 = 
	`__db_blockEny
(&
c
, &
s
->
y_ki
, 
da
, 
da_n
 * 8,

165 
da
)) < 0) {

166 
	`__s_r
(
dbv
, 
t
);

167  (
EAGAIN
);

169 
	`memy
(
iv
, 
tmp_iv
, 
DB_IV_BYTES
);

171 
	}
}

180 
	$__s_
(
dbv
, 
db_ch
)

181 
DB_ENV
 *
dbv
;

182 
DB_CIPHER
 *
db_ch
;

184  (
	`__s_divekeys
(
dbv
, 
db_ch
, (
u_t8_t
 *)dbv->
sswd
,

185 
dbv
->
sswd_n
));

186 
	}
}

189 
	$__s_divekeys
(
dbv
, 
db_ch
, 
sswd
, 

)

190 
DB_ENV
 *
dbv
;

191 
DB_CIPHER
 *
db_ch
;

192 
u_t8_t
 *
sswd
;

193 
size_t
 

;

195 
SHA1_CTX
 
x
;

196 
AES_CIPHER
 *
s
;

197 
t
;

198 
u_t32_t
 
mp
[
DB_MAC_KEY
/4];

200 i(
sswd
 =
NULL
)

201  (
EINVAL
);

203 
s
 = (
AES_CIPHER
 *)
db_ch
->
da
;

206 
	`__db_SHA1In
(&
x
);

207 
	`__db_SHA1Upde
(&
x
, 
sswd
, 

);

208 
	`__db_SHA1Upde
(&
x
, (
u_t8_t
 *)
DB_ENC_MAGIC
, 
	`
(DB_ENC_MAGIC));

209 
	`__db_SHA1Upde
(&
x
, 
sswd
, 

);

210 
	`__db_SHA1F
((
u_t8_t
 *)
mp
, &
x
);

212 i((
t
 = 
	`__db_makeKey
(&
s
->
y_ki
, 
DIR_ENCRYPT
,

213 
DB_AES_KEYLEN
, (*)
mp
)!
TRUE
) {

214 
	`__s_r
(
dbv
, 
t
);

215  (
EAGAIN
);

217 i((
t
 = 
	`__db_makeKey
(&
s
->
dey_ki
, 
DIR_DECRYPT
,

218 
DB_AES_KEYLEN
, (*)
mp
)!
TRUE
) {

219 
	`__s_r
(
dbv
, 
t
);

220  (
EAGAIN
);

223 
	}
}

231 
	$__s_r
(
dbv
, 
r
)

232 
DB_ENV
 *
dbv
;

233 
r
;

235 *
rr
;

237 
r
) {

238 
BAD_KEY_DIR
:

239 
rr
 = "AES key direction is invalid";

241 
BAD_KEY_MAT
:

242 
rr
 = "AES key materialot of correctength";

244 
BAD_KEY_INSTANCE
:

245 
rr
 = "AES keyasswdot valid";

247 
BAD_CIPHER_MODE
:

248 
rr
 = "AES cipher in wrong state (not initialized)";

250 
BAD_BLOCK_LENGTH
:

251 
rr
 = "AES bad blockength";

253 
BAD_CIPHER_INSTANCE
:

254 
rr
 = "AES cipher instance is invalid";

256 
BAD_DATA
:

257 
rr
 = "AES data contentsre invalid";

259 
BAD_OTHER
:

260 
rr
 = "AES unknownrror";

263 
rr
 = "AESrror unrecognized";

266 
	`__db_rx
(
dbv
, 
rr
);

268 
	}
}

	@../crypto/crypto.c

12 
	~"db_cfig.h
"

14 
	~"db_t.h
"

15 
	~"dbc/db_ge.h
"

16 
	~"dbc/yo.h
"

23 
	$__yo_gi_
(
dbv
)

24 
DB_ENV
 *
dbv
;

26 
REGENV
 *
nv
;

27 
REGINFO
 *
f
;

28 
CIPHER
 *
ch
;

29 
DB_CIPHER
 *
db_ch
;

30 *
sh_sswd
;

31 
t
;

33 
db_ch
 = 
dbv
->
yo_hd
;

35 
t
 = 0;

36 
f
 = 
dbv
->
gfo
;

37 
nv
 = 
f
->
imy
;

38 i(
nv
->
ch_off
 =
INVALID_ROFF
) {

39 i(!
	`CRYPTO_ON
(
dbv
))

41 i(!
	`F_ISSET
(
f
, 
REGION_CREATE
)) {

42 
	`__db_rx
(
dbv
,

44  (
EINVAL
);

46 i(
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
)) {

47 
	`__db_rx
(
dbv
, "Encryptionlgorithmot supplied");

48  (
EINVAL
);

55 i((
t
 = 
	`__v_loc
(
f
, (
CIPHER
), &
ch
)) != 0)

56  (
t
);

57 
	`memt
(
ch
, 0, (*cipher));

58 i((
t
 =

59 
	`__v_loc
(
f
, 
dbv
->
sswd_n
, &
sh_sswd
)) != 0) {

60 
	`__v_loc_
(
f
, 
ch
);

61  (
t
);

63 
	`memt
(
sh_sswd
, 0, 
dbv
->
sswd_n
);

64 
ch
->
sswd
 = 
	`R_OFFSET
(
f
, 
sh_sswd
);

65 
ch
->
sswd_n
 = 
dbv
->passwd_len;

66 
ch
->
ags
 = 
db_ch
->
g
;

67 
	`memy
(
sh_sswd
, 
dbv
->
sswd
, 
ch
->
sswd_n
);

68 
nv
->
ch_off
 = 
	`R_OFFSET
(
f
, 
ch
);

70 i(!
	`CRYPTO_ON
(
dbv
)) {

71 
	`__db_rx
(
dbv
,

73  (
EINVAL
);

75 
ch
 = 
	`R_ADDR
(
f
, 
nv
->
ch_off
);

76 
sh_sswd
 = 
	`R_ADDR
(
f
, 
ch
->
sswd
);

77 i((
ch
->
sswd_n
 !
dbv
->passwd_len) ||

78 
	`memcmp
(
dbv
->
sswd
, 
sh_sswd
, 
ch
->
sswd_n
) != 0) {

79 
	`__db_rx
(
dbv
, "Invalidassword");

80  (
EPERM
);

82 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
) &&

83 
db_ch
->
g
 !
ch
->
ags
) {

84 
	`__db_rx
(
dbv
,

86  (
EINVAL
);

88 i(
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
))

94 i((
t
 = 
	`__yo_gtup
(
dbv
, 
db_ch
,

95 
ch
->
ags
, 0)) != 0)

96  (
t
);

98 
t
 = 
db_ch
->
	`
(
dbv
, db_cipher);

105 
	`memt
(
dbv
->
sswd
, 0xff, dbv->
sswd_n
-1);

106 
	`__os_
(
dbv
, dbv->
sswd
);

107 
dbv
->
sswd
 = 
NULL
;

108 
dbv
->
sswd_n
 = 0;

110  (
t
);

111 
	}
}

120 
	$__yo_v_o
(
dbv
)

121 
DB_ENV
 *
dbv
;

123 
DB_CIPHER
 *
db_ch
;

124 
t
;

126 i(
dbv
->
sswd
 !
NULL
) {

127 
	`memt
(
dbv
->
sswd
, 0xff, dbv->
sswd_n
-1);

128 
	`__os_
(
dbv
, dbv->
sswd
);

129 
dbv
->
sswd
 = 
NULL
;

132 i(!
	`CRYPTO_ON
(
dbv
))

135 
t
 = 0;

136 
db_ch
 = 
dbv
->
yo_hd
;

137 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
))

138 
t
 = 
db_ch
->
	`o
(
dbv
, db_ch->
da
);

139 
	`__os_
(
dbv
, 
db_ch
);

141 
dbv
->
yo_hd
 = 
NULL
;

142  (
t
);

143 
	}
}

152 
	$__yo_v_esh
(
dbv
)

153 
DB_ENV
 *
dbv
;

155 
CIPHER
 *
ch
;

156 
REGENV
 *
nv
;

157 
REGINFO
 *
f
;

164 i(
	`F_ISSET
(
dbv
, 
DB_ENV_PRIVATE
)) {

165 
f
 = 
dbv
->
gfo
;

166 
nv
 = 
f
->
imy
;

167 i(
nv
->
ch_off
 !
INVALID_ROFF
) {

168 
ch
 = 
	`R_ADDR
(
f
, 
nv
->
ch_off
);

169 
	`__v_loc_
(
f
, 
	`R_ADDR
(f, 
ch
->
sswd
));

170 
	`__v_loc_
(
f
, 
ch
);

174 
	}
}

184 
	$__yo_gtup
(
dbv
, 
db_ch
, 
g
, 
do_
)

185 
DB_ENV
 *
dbv
;

186 
DB_CIPHER
 *
db_ch
;

187 
u_t32_t
 
g
;

188 
do_
;

190 
t
;

192 
t
 = 0;

193 i(!
	`CRYPTO_ON
(
dbv
)) {

194 
	`__db_rx
(
dbv
, "No cipher structure given");

195  (
EINVAL
);

197 
	`F_CLR
(
db_ch
, 
CIPHER_ANY
);

198 
g
) {

199 
CIPHER_AES
:

200 
db_ch
->
g
 = 
CIPHER_AES
;

201 
t
 = 
	`__s_tup
(
dbv
, 
db_ch
);

204 
t
 = 
	`__db_nic
(
dbv
, 
EINVAL
);

207 i(
t
 =0 && 
do_
)

208 
t
 = 
db_ch
->
	`
(
dbv
, db_cipher);

209  (
t
);

210 
	}
}

219 
	$__yo_dey_ma
(
dbv
, 
dbp
, 
mbuf
, 
do_machk
)

220 
DB_ENV
 *
dbv
;

221 
DB
 *
dbp
;

222 
u_t8_t
 *
mbuf
;

223 
do_machk
;

225 
DB_CIPHER
 *
db_ch
;

226 
DB
 
dummydb
;

227 
DBMETA
 *
ma
;

228 
size_t
 
pg_off
;

229 
t
;

230 
u_t8_t
 *
iv
;

238 i(
dbp
 =
NULL
) {

239 
	`memt
(&
dummydb
, 0, (
DB
));

240 
dbp
 = &
dummydb
;

243 
t
 = 0;

244 
ma
 = (
DBMETA
 *)
mbuf
;

262 i(
ma
->
magic
 =
DB_HASHMAGIC
 && ma->
vsi
 <= 5)

280 i(
ma
->
y_g
 != 0) {

281 
db_ch
 = (
DB_CIPHER
 *)
dbv
->
yo_hd
;

282 i(!
	`F_ISSET
(
dbp
, 
DB_AM_ENCRYPT
)) {

283 i(!
	`CRYPTO_ON
(
dbv
)) {

284 
	`__db_rx
(
dbv
,

286  (
EINVAL
);

294 
	`F_SET
(
dbp
, 
DB_AM_ENCRYPT
|
DB_AM_CHKSUM
);

300 
	`DB_ASSERT
(
dbv
, 
	`CRYPTO_ON
(dbenv));

301 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
) &&

302 
ma
->
y_g
 !
db_ch
->
g
) {

303 
	`__db_rx
(
dbv
,

305  (
EINVAL
);

307 
	`DB_ASSERT
(
dbv
, 
	`F_ISSET
(
dbp
, 
DB_AM_CHKSUM
));

308 
iv
 = ((
BTMETA
 *)
mbuf
)->iv;

314 
pg_off
 = 
	`P_OVERHEAD
(
dbp
);

315 
g_y
:

320 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
)) {

321 i(
do_machk
 && (
t
 = 
db_ch
->
	`dey
(
dbv
,

322 
db_ch
->
da
, 
iv
, 
mbuf
 + 
pg_off
,

323 
DBMETASIZE
 - 
pg_off
)))

324  (
t
);

325 i(((
BTMETA
 *)
ma
)->
yo_magic
 !=

326 
ma
->
magic
) {

327 
	`__db_rx
(
dbv
, "Invalidassword");

328  (
EINVAL
);

342 
t
 = 
	`__yo_gtup
(
dbv
, 
db_ch
, 
ma
->
y_g
, 1);

343 
g_y
;

344 } i(
	`F_ISSET
(
dbp
, 
DB_AM_ENCRYPT
)) {

365 
	`__db_rx
(
dbv
,

367  (
EINVAL
);

369  (
t
);

370 
	}
}

380 
	$__yo_t_sswd
(
dbv_c
, 
dbv_de
)

381 
DB_ENV
 *
dbv_c
, *
dbv_de
;

383 
CIPHER
 *
ch
;

384 
REGENV
 *
nv
;

385 
REGINFO
 *
f
;

386 *
sh_sswd
;

388 
f
 = 
dbv_c
->
gfo
;

389 
nv
 = 
f
->
imy
;

391 
	`DB_ASSERT
(
dbv_c
, 
	`CRYPTO_ON
(dbenv_src));

393 
ch
 = 
	`R_ADDR
(
f
, 
nv
->
ch_off
);

394 
sh_sswd
 = 
	`R_ADDR
(
f
, 
ch
->
sswd
);

395  (
	`__v_t_y
(
dbv_de
, 
sh_sswd
, 
DB_ENCRYPT_AES
));

396 
	}
}

	@../crypto/mersenne/mt19937db.c

4 
	~"db_cfig.h
"

6 
	~"db_t.h
"

7 
	~"dbc/yo.h
"

8 
	~"dbc/hmac.h
"

37 
	#N
 624

	)

38 
	#M
 397

	)

39 
	#MATRIX_A
 0x9908b0d

	)

40 
	#UPPER_MASK
 0x80000000

	)

41 
	#LOWER_MASK
 0x7ffffff

	)

44 
	#TEMPERING_MASK_B
 0x9d2c5680

	)

45 
	#TEMPERING_MASK_C
 0xefc60000

	)

46 
	#TEMPERING_SHIFT_U
(
y
(y >> 11)

	)

47 
	#TEMPERING_SHIFT_S
(
y
(y << 7)

	)

48 
	#TEMPERING_SHIFT_T
(
y
(y << 15)

	)

49 
	#TEMPERING_SHIFT_L
(
y
(y >> 18)

	)

51 
__db_sgnd
 
__P
((, *, *));

52 #ifdef 
NOT_USED


53 
__db_lsgnd
 
__P
((*, *, *));

55 
__db_gnd
 
__P
((
DB_ENV
 *));

64 
	$__db_ge_iv
(
dbv
, 
iv
)

65 
DB_ENV
 *
dbv
;

66 
u_t32_t
 *
iv
;

68 
i
, 
n
, 
t
;

70 
t
 = 0;

71 
n
 = 
DB_IV_BYTES
 / (
u_t32_t
);

72 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_mt
);

73 i(
dbv
->
mt
 =
NULL
) {

74 i((
t
 = 
	`__os_oc
(
dbv
, 1, 
N
*(),

75 &
dbv
->
mt
)) != 0)

76  (
t
);

78 
dbv
->
mti
 = 
N
 + 1;

80 
i
 = 0; i < 
n
; i++) {

85 
iv
[
i
] = (
u_t32_t
)
	`__db_gnd
(
dbv
);

86 } 
iv
[
i
] == 0);

89 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_mt
);

91 
	}
}

95 
	$__db_sgnd
(
ed
, 
mt
, 
mt
)

96 
ed
;

97 
mt
[];

98 *
mt
;

100 
i
;

102 
	`DB_ASSERT
(
NULL
, 
ed
 != 0);

103 
i
=0;i<
N
;i++) {

104 
mt
[
i
] = 
ed
 & 0xffff0000;

105 
ed
 = 69069 * seed + 1;

106 
mt
[
i
] |(
ed
 & 0xffff0000) >> 16;

107 
ed
 = 69069 * seed + 1;

109 *
mt
 = 
N
;

110 
	}
}

112 #ifdef 
NOT_USED


123 
	$__db_lsgnd
(
ed_y
, 
mt
, 
mt
)

124 
ed_y
[];

125 
mt
[];

126 *
mt
;

129 
i
;

131 
i
=0;i<
N
;i++)

132 
mt
[
i
] = 
ed_y
[i];

133 *
mt
=
N
;

134 
	}
}

138 
	$__db_gnd
(
dbv
)

139 
DB_ENV
 *
dbv
;

141 
db_timeec
 
ts
;

142 
y
;

143 
mag01
[2]={0x0, 
MATRIX_A
};

145 
u_t32_t
 
ed
;

150 i(
dbv
->
mti
 >
N
) {

151 
kk
;

153 i(
dbv
->
mti
 =
N
+1) {

159 
	`__os_gtime
(
dbv
, &
ts
);

160 
	`__db_chksum
(
NULL
, (
u_t8_t
 *)&
ts
.
tv_c
,

161 (
ts
.
tv_c
), 
NULL
, (
u_t8_t
 *)&
ed
);

162 } 
ed
 == 0);

163 
	`__db_sgnd
(()
ed
, 
dbv
->
mt
, &dbv->
mti
);

166 
kk
=0;kk<
N
-
M
;kk++) {

167 
y
 = (
dbv
->
mt
[
kk
]&
UPPER_MASK
)|(dbv->mt[kk+1]&
LOWER_MASK
);

168 
dbv
->
mt
[
kk
] = dbv->mt[kk+
M
] ^ (
y
 >> 1^ 
mag01
[y & 0x1];

170 ;
kk
<
N
-1;kk++) {

171 
y
 = (
dbv
->
mt
[
kk
]&
UPPER_MASK
)|(dbv->mt[kk+1]&
LOWER_MASK
);

172 
dbv
->
mt
[
kk
] = dbv->mt[kk+(
M
-
N
)] ^ (
y
 >> 1^ 
mag01
[y & 0x1];

174 
y
 = (
dbv
->
mt
[
N
-1]&
UPPER_MASK
)|(dbv->mt[0]&
LOWER_MASK
);

175 
dbv
->
mt
[
N
-1] = dbv->mt[
M
-1] ^ (
y
 >> 1^ 
mag01
[y & 0x1];

177 
dbv
->
mti
 = 0;

180 
y
 = 
dbv
->
mt
[dbv->
mti
++];

181 
y
 ^
	`TEMPERING_SHIFT_U
(y);

182 
y
 ^
	`TEMPERING_SHIFT_S
(y& 
TEMPERING_MASK_B
;

183 
y
 ^
	`TEMPERING_SHIFT_T
(y& 
TEMPERING_MASK_C
;

184 
y
 ^
	`TEMPERING_SHIFT_L
(y);

186  
y
;

187 
	}
}

	@../crypto/rijndael/rijndael-alg-fst.c

26 
	~"db_cfig.h
"

28 
	~"db_t.h
"

29 
	~"dbc/yo.h
"

31 
	~"yo/rijndl/rijndl-g-f.h
"

47 cڡ 
u32
 
	gTe0
[256] = {

48 (
u_t
)0xc66363a5, (u_int)0xf87c7c84, (u_int)0xee777799, (u_int)0xf67b7b8d,

49 (
u_t
)0xfff2f20d, (u_int)0xd66b6bbd, (u_int)0xde6f6fb1, (u_int)0x91c5c554,

50 (
u_t
)0x60303050, (u_int)0x02010103, (u_int)0xce6767a9, (u_int)0x562b2b7d,

51 (
u_t
)0xe7fefe19, (u_int)0xb5d7d762, (u_int)0x4dababe6, (u_int)0xec76769a,

52 (
u_t
)0x8fcaca45, (u_int)0x1f82829d, (u_int)0x89c9c940, (u_int)0xfa7d7d87,

53 (
u_t
)0xeffafa15, (u_int)0xb25959eb, (u_int)0x8e4747c9, (u_int)0xfbf0f00b,

54 (
u_t
)0x41adadec, (u_int)0xb3d4d467, (u_int)0x5fa2a2fd, (u_int)0x45afafea,

55 (
u_t
)0x239c9cbf, (u_int)0x53a4a4f7, (u_int)0xe4727296, (u_int)0x9bc0c05b,

56 (
u_t
)0x75b7b7c2, (u_int)0xe1fdfd1c, (u_int)0x3d9393ae, (u_int)0x4c26266a,

57 (
u_t
)0x6c36365a, (u_int)0x7e3f3f41, (u_int)0xf5f7f702, (u_int)0x83cccc4f,

58 (
u_t
)0x6834345c, (u_int)0x51a5a5f4, (u_int)0xd1e5e534, (u_int)0xf9f1f108,

59 (
u_t
)0xe2717193, (u_int)0xabd8d873, (u_int)0x62313153, (u_int)0x2a15153f,

60 (
u_t
)0x0804040c, (u_int)0x95c7c752, (u_int)0x46232365, (u_int)0x9dc3c35e,

61 (
u_t
)0x30181828, (u_int)0x379696a1, (u_int)0x0a05050f, (u_int)0x2f9a9ab5,

62 (
u_t
)0x0e070709, (u_int)0x24121236, (u_int)0x1b80809b, (u_int)0xdfe2e23d,

63 (
u_t
)0xcdebeb26, (u_int)0x4e272769, (u_int)0x7fb2b2cd, (u_int)0xea75759f,

64 (
u_t
)0x1209091b, (u_int)0x1d83839e, (u_int)0x582c2c74, (u_int)0x341a1a2e,

65 (
u_t
)0x361b1b2d, (u_int)0xdc6e6eb2, (u_int)0xb45a5aee, (u_int)0x5ba0a0fb,

66 (
u_t
)0xa45252f6, (u_int)0x763b3b4d, (u_int)0xb7d6d661, (u_int)0x7db3b3ce,

67 (
u_t
)0x5229297b, (u_int)0xdde3e33e, (u_int)0x5e2f2f71, (u_int)0x13848497,

68 (
u_t
)0xa65353f5, (u_int)0xb9d1d168, (u_int)0x00000000, (u_int)0xc1eded2c,

69 (
u_t
)0x40202060, (u_int)0xe3fcfc1f, (u_int)0x79b1b1c8, (u_int)0xb65b5bed,

70 (
u_t
)0xd46a6abe, (u_int)0x8dcbcb46, (u_int)0x67bebed9, (u_int)0x7239394b,

71 (
u_t
)0x944a4ade, (u_int)0x984c4cd4, (u_int)0xb05858e8, (u_int)0x85cfcf4a,

72 (
u_t
)0xbbd0d06b, (u_int)0xc5efef2a, (u_int)0x4faaaae5, (u_int)0xedfbfb16,

73 (
u_t
)0x864343c5, (u_int)0x9a4d4dd7, (u_int)0x66333355, (u_int)0x11858594,

74 (
u_t
)0x8a4545cf, (u_int)0xe9f9f910, (u_int)0x04020206, (u_int)0xfe7f7f81,

75 (
u_t
)0xa05050f0, (u_int)0x783c3c44, (u_int)0x259f9fba, (u_int)0x4ba8a8e3,

76 (
u_t
)0xa25151f3, (u_int)0x5da3a3fe, (u_int)0x804040c0, (u_int)0x058f8f8a,

77 (
u_t
)0x3f9292ad, (u_int)0x219d9dbc, (u_int)0x70383848, (u_int)0xf1f5f504,

78 (
u_t
)0x63bcbcdf, (u_int)0x77b6b6c1, (u_int)0xafdada75, (u_int)0x42212163,

79 (
u_t
)0x20101030, (u_int)0xe5ffff1a, (u_int)0xfdf3f30e, (u_int)0xbfd2d26d,

80 (
u_t
)0x81cdcd4c, (u_int)0x180c0c14, (u_int)0x26131335, (u_int)0xc3ecec2f,

81 (
u_t
)0xbe5f5fe1, (u_int)0x359797a2, (u_int)0x884444cc, (u_int)0x2e171739,

82 (
u_t
)0x93c4c457, (u_int)0x55a7a7f2, (u_int)0xfc7e7e82, (u_int)0x7a3d3d47,

83 (
u_t
)0xc86464ac, (u_int)0xba5d5de7, (u_int)0x3219192b, (u_int)0xe6737395,

84 (
u_t
)0xc06060a0, (u_int)0x19818198, (u_int)0x9e4f4fd1, (u_int)0xa3dcdc7f,

85 (
u_t
)0x44222266, (u_int)0x542a2a7e, (u_int)0x3b9090ab, (u_int)0x0b888883,

86 (
u_t
)0x8c4646ca, (u_int)0xc7eeee29, (u_int)0x6bb8b8d3, (u_int)0x2814143c,

87 (
u_t
)0xa7dede79, (u_int)0xbc5e5ee2, (u_int)0x160b0b1d, (u_int)0xaddbdb76,

88 (
u_t
)0xdbe0e03b, (u_int)0x64323256, (u_int)0x743a3a4e, (u_int)0x140a0a1e,

89 (
u_t
)0x924949db, (u_int)0x0c06060a, (u_int)0x4824246c, (u_int)0xb85c5ce4,

90 (
u_t
)0x9fc2c25d, (u_int)0xbdd3d36e, (u_int)0x43acacef, (u_int)0xc46262a6,

91 (
u_t
)0x399191a8, (u_int)0x319595a4, (u_int)0xd3e4e437, (u_int)0xf279798b,

92 (
u_t
)0xd5e7e732, (u_int)0x8bc8c843, (u_int)0x6e373759, (u_int)0xda6d6db7,

93 (
u_t
)0x018d8d8c, (u_int)0xb1d5d564, (u_int)0x9c4e4ed2, (u_int)0x49a9a9e0,

94 (
u_t
)0xd86c6cb4, (u_int)0xac5656fa, (u_int)0xf3f4f407, (u_int)0xcfeaea25,

95 (
u_t
)0xca6565af, (u_int)0xf47a7a8e, (u_int)0x47aeaee9, (u_int)0x10080818,

96 (
u_t
)0x6fbabad5, (u_int)0xf0787888, (u_int)0x4a25256f, (u_int)0x5c2e2e72,

97 (
u_t
)0x381c1c24, (u_int)0x57a6a6f1, (u_int)0x73b4b4c7, (u_int)0x97c6c651,

98 (
u_t
)0xcbe8e823, (u_int)0xa1dddd7c, (u_int)0xe874749c, (u_int)0x3e1f1f21,

99 (
u_t
)0x964b4bdd, (u_int)0x61bdbddc, (u_int)0x0d8b8b86, (u_int)0x0f8a8a85,

100 (
u_t
)0xe0707090, (u_int)0x7c3e3e42, (u_int)0x71b5b5c4, (u_int)0xcc6666aa,

101 (
u_t
)0x904848d8, (u_int)0x06030305, (u_int)0xf7f6f601, (u_int)0x1c0e0e12,

102 (
u_t
)0xc26161a3, (u_int)0x6a35355f, (u_int)0xae5757f9, (u_int)0x69b9b9d0,

103 (
u_t
)0x17868691, (u_int)0x99c1c158, (u_int)0x3a1d1d27, (u_int)0x279e9eb9,

104 (
u_t
)0xd9e1e138, (u_int)0xebf8f813, (u_int)0x2b9898b3, (u_int)0x22111133,

105 (
u_t
)0xd26969bb, (u_int)0xa9d9d970, (u_int)0x078e8e89, (u_int)0x339494a7,

106 (
u_t
)0x2d9b9bb6, (u_int)0x3c1e1e22, (u_int)0x15878792, (u_int)0xc9e9e920,

107 (
u_t
)0x87cece49, (u_int)0xaa5555ff, (u_int)0x50282878, (u_int)0xa5dfdf7a,

108 (
u_t
)0x038c8c8f, (u_int)0x59a1a1f8, (u_int)0x09898980, (u_int)0x1a0d0d17,

109 (
u_t
)0x65bfbfda, (u_int)0xd7e6e631, (u_int)0x844242c6, (u_int)0xd06868b8,

110 (
u_t
)0x824141c3, (u_int)0x299999b0, (u_int)0x5a2d2d77, (u_int)0x1e0f0f11,

111 (
u_t
)0x7bb0b0cb, (u_int)0xa85454fc, (u_int)0x6dbbbbd6, (u_int)0x2c16163a,

113 cڡ 
u32
 
	gTe1
[256] = {

114 (
u_t
)0xa5c66363, (u_int)0x84f87c7c, (u_int)0x99ee7777, (u_int)0x8df67b7b,

115 (
u_t
)0x0dfff2f2, (u_int)0xbdd66b6b, (u_int)0xb1de6f6f, (u_int)0x5491c5c5,

116 (
u_t
)0x50603030, (u_int)0x03020101, (u_int)0xa9ce6767, (u_int)0x7d562b2b,

117 (
u_t
)0x19e7fefe, (u_int)0x62b5d7d7, (u_int)0xe64dabab, (u_int)0x9aec7676,

118 (
u_t
)0x458fcaca, (u_int)0x9d1f8282, (u_int)0x4089c9c9, (u_int)0x87fa7d7d,

119 (
u_t
)0x15effafa, (u_int)0xebb25959, (u_int)0xc98e4747, (u_int)0x0bfbf0f0,

120 (
u_t
)0xec41adad, (u_int)0x67b3d4d4, (u_int)0xfd5fa2a2, (u_int)0xea45afaf,

121 (
u_t
)0xbf239c9c, (u_int)0xf753a4a4, (u_int)0x96e47272, (u_int)0x5b9bc0c0,

122 (
u_t
)0xc275b7b7, (u_int)0x1ce1fdfd, (u_int)0xae3d9393, (u_int)0x6a4c2626,

123 (
u_t
)0x5a6c3636, (u_int)0x417e3f3f, (u_int)0x02f5f7f7, (u_int)0x4f83cccc,

124 (
u_t
)0x5c683434, (u_int)0xf451a5a5, (u_int)0x34d1e5e5, (u_int)0x08f9f1f1,

125 (
u_t
)0x93e27171, (u_int)0x73abd8d8, (u_int)0x53623131, (u_int)0x3f2a1515,

126 (
u_t
)0x0c080404, (u_int)0x5295c7c7, (u_int)0x65462323, (u_int)0x5e9dc3c3,

127 (
u_t
)0x28301818, (u_int)0xa1379696, (u_int)0x0f0a0505, (u_int)0xb52f9a9a,

128 (
u_t
)0x090e0707, (u_int)0x36241212, (u_int)0x9b1b8080, (u_int)0x3ddfe2e2,

129 (
u_t
)0x26cdebeb, (u_int)0x694e2727, (u_int)0xcd7fb2b2, (u_int)0x9fea7575,

130 (
u_t
)0x1b120909, (u_int)0x9e1d8383, (u_int)0x74582c2c, (u_int)0x2e341a1a,

131 (
u_t
)0x2d361b1b, (u_int)0xb2dc6e6e, (u_int)0xeeb45a5a, (u_int)0xfb5ba0a0,

132 (
u_t
)0xf6a45252, (u_int)0x4d763b3b, (u_int)0x61b7d6d6, (u_int)0xce7db3b3,

133 (
u_t
)0x7b522929, (u_int)0x3edde3e3, (u_int)0x715e2f2f, (u_int)0x97138484,

134 (
u_t
)0xf5a65353, (u_int)0x68b9d1d1, (u_int)0x00000000, (u_int)0x2cc1eded,

135 (
u_t
)0x60402020, (u_int)0x1fe3fcfc, (u_int)0xc879b1b1, (u_int)0xedb65b5b,

136 (
u_t
)0xbed46a6a, (u_int)0x468dcbcb, (u_int)0xd967bebe, (u_int)0x4b723939,

137 (
u_t
)0xde944a4a, (u_int)0xd4984c4c, (u_int)0xe8b05858, (u_int)0x4a85cfcf,

138 (
u_t
)0x6bbbd0d0, (u_int)0x2ac5efef, (u_int)0xe54faaaa, (u_int)0x16edfbfb,

139 (
u_t
)0xc5864343, (u_int)0xd79a4d4d, (u_int)0x55663333, (u_int)0x94118585,

140 (
u_t
)0xcf8a4545, (u_int)0x10e9f9f9, (u_int)0x06040202, (u_int)0x81fe7f7f,

141 (
u_t
)0xf0a05050, (u_int)0x44783c3c, (u_int)0xba259f9f, (u_int)0xe34ba8a8,

142 (
u_t
)0xf3a25151, (u_int)0xfe5da3a3, (u_int)0xc0804040, (u_int)0x8a058f8f,

143 (
u_t
)0xad3f9292, (u_int)0xbc219d9d, (u_int)0x48703838, (u_int)0x04f1f5f5,

144 (
u_t
)0xdf63bcbc, (u_int)0xc177b6b6, (u_int)0x75afdada, (u_int)0x63422121,

145 (
u_t
)0x30201010, (u_int)0x1ae5ffff, (u_int)0x0efdf3f3, (u_int)0x6dbfd2d2,

146 (
u_t
)0x4c81cdcd, (u_int)0x14180c0c, (u_int)0x35261313, (u_int)0x2fc3ecec,

147 (
u_t
)0xe1be5f5f, (u_int)0xa2359797, (u_int)0xcc884444, (u_int)0x392e1717,

148 (
u_t
)0x5793c4c4, (u_int)0xf255a7a7, (u_int)0x82fc7e7e, (u_int)0x477a3d3d,

149 (
u_t
)0xacc86464, (u_int)0xe7ba5d5d, (u_int)0x2b321919, (u_int)0x95e67373,

150 (
u_t
)0xa0c06060, (u_int)0x98198181, (u_int)0xd19e4f4f, (u_int)0x7fa3dcdc,

151 (
u_t
)0x66442222, (u_int)0x7e542a2a, (u_int)0xab3b9090, (u_int)0x830b8888,

152 (
u_t
)0xca8c4646, (u_int)0x29c7eeee, (u_int)0xd36bb8b8, (u_int)0x3c281414,

153 (
u_t
)0x79a7dede, (u_int)0xe2bc5e5e, (u_int)0x1d160b0b, (u_int)0x76addbdb,

154 (
u_t
)0x3bdbe0e0, (u_int)0x56643232, (u_int)0x4e743a3a, (u_int)0x1e140a0a,

155 (
u_t
)0xdb924949, (u_int)0x0a0c0606, (u_int)0x6c482424, (u_int)0xe4b85c5c,

156 (
u_t
)0x5d9fc2c2, (u_int)0x6ebdd3d3, (u_int)0xef43acac, (u_int)0xa6c46262,

157 (
u_t
)0xa8399191, (u_int)0xa4319595, (u_int)0x37d3e4e4, (u_int)0x8bf27979,

158 (
u_t
)0x32d5e7e7, (u_int)0x438bc8c8, (u_int)0x596e3737, (u_int)0xb7da6d6d,

159 (
u_t
)0x8c018d8d, (u_int)0x64b1d5d5, (u_int)0xd29c4e4e, (u_int)0xe049a9a9,

160 (
u_t
)0xb4d86c6c, (u_int)0xfaac5656, (u_int)0x07f3f4f4, (u_int)0x25cfeaea,

161 (
u_t
)0xafca6565, (u_int)0x8ef47a7a, (u_int)0xe947aeae, (u_int)0x18100808,

162 (
u_t
)0xd56fbaba, (u_int)0x88f07878, (u_int)0x6f4a2525, (u_int)0x725c2e2e,

163 (
u_t
)0x24381c1c, (u_int)0xf157a6a6, (u_int)0xc773b4b4, (u_int)0x5197c6c6,

164 (
u_t
)0x23cbe8e8, (u_int)0x7ca1dddd, (u_int)0x9ce87474, (u_int)0x213e1f1f,

165 (
u_t
)0xdd964b4b, (u_int)0xdc61bdbd, (u_int)0x860d8b8b, (u_int)0x850f8a8a,

166 (
u_t
)0x90e07070, (u_int)0x427c3e3e, (u_int)0xc471b5b5, (u_int)0xaacc6666,

167 (
u_t
)0xd8904848, (u_int)0x05060303, (u_int)0x01f7f6f6, (u_int)0x121c0e0e,

168 (
u_t
)0xa3c26161, (u_int)0x5f6a3535, (u_int)0xf9ae5757, (u_int)0xd069b9b9,

169 (
u_t
)0x91178686, (u_int)0x5899c1c1, (u_int)0x273a1d1d, (u_int)0xb9279e9e,

170 (
u_t
)0x38d9e1e1, (u_int)0x13ebf8f8, (u_int)0xb32b9898, (u_int)0x33221111,

171 (
u_t
)0xbbd26969, (u_int)0x70a9d9d9, (u_int)0x89078e8e, (u_int)0xa7339494,

172 (
u_t
)0xb62d9b9b, (u_int)0x223c1e1e, (u_int)0x92158787, (u_int)0x20c9e9e9,

173 (
u_t
)0x4987cece, (u_int)0xffaa5555, (u_int)0x78502828, (u_int)0x7aa5dfdf,

174 (
u_t
)0x8f038c8c, (u_int)0xf859a1a1, (u_int)0x80098989, (u_int)0x171a0d0d,

175 (
u_t
)0xda65bfbf, (u_int)0x31d7e6e6, (u_int)0xc6844242, (u_int)0xb8d06868,

176 (
u_t
)0xc3824141, (u_int)0xb0299999, (u_int)0x775a2d2d, (u_int)0x111e0f0f,

177 (
u_t
)0xcb7bb0b0, (u_int)0xfca85454, (u_int)0xd66dbbbb, (u_int)0x3a2c1616,

179 cڡ 
u32
 
	gTe2
[256] = {

180 (
u_t
)0x63a5c663, (u_int)0x7c84f87c, (u_int)0x7799ee77, (u_int)0x7b8df67b,

181 (
u_t
)0xf20dfff2, (u_int)0x6bbdd66b, (u_int)0x6fb1de6f, (u_int)0xc55491c5,

182 (
u_t
)0x30506030, (u_int)0x01030201, (u_int)0x67a9ce67, (u_int)0x2b7d562b,

183 (
u_t
)0xfe19e7fe, (u_int)0xd762b5d7, (u_int)0xabe64dab, (u_int)0x769aec76,

184 (
u_t
)0xca458fca, (u_int)0x829d1f82, (u_int)0xc94089c9, (u_int)0x7d87fa7d,

185 (
u_t
)0xfa15effa, (u_int)0x59ebb259, (u_int)0x47c98e47, (u_int)0xf00bfbf0,

186 (
u_t
)0xadec41ad, (u_int)0xd467b3d4, (u_int)0xa2fd5fa2, (u_int)0xafea45af,

187 (
u_t
)0x9cbf239c, (u_int)0xa4f753a4, (u_int)0x7296e472, (u_int)0xc05b9bc0,

188 (
u_t
)0xb7c275b7, (u_int)0xfd1ce1fd, (u_int)0x93ae3d93, (u_int)0x266a4c26,

189 (
u_t
)0x365a6c36, (u_int)0x3f417e3f, (u_int)0xf702f5f7, (u_int)0xcc4f83cc,

190 (
u_t
)0x345c6834, (u_int)0xa5f451a5, (u_int)0xe534d1e5, (u_int)0xf108f9f1,

191 (
u_t
)0x7193e271, (u_int)0xd873abd8, (u_int)0x31536231, (u_int)0x153f2a15,

192 (
u_t
)0x040c0804, (u_int)0xc75295c7, (u_int)0x23654623, (u_int)0xc35e9dc3,

193 (
u_t
)0x18283018, (u_int)0x96a13796, (u_int)0x050f0a05, (u_int)0x9ab52f9a,

194 (
u_t
)0x07090e07, (u_int)0x12362412, (u_int)0x809b1b80, (u_int)0xe23ddfe2,

195 (
u_t
)0xeb26cdeb, (u_int)0x27694e27, (u_int)0xb2cd7fb2, (u_int)0x759fea75,

196 (
u_t
)0x091b1209, (u_int)0x839e1d83, (u_int)0x2c74582c, (u_int)0x1a2e341a,

197 (
u_t
)0x1b2d361b, (u_int)0x6eb2dc6e, (u_int)0x5aeeb45a, (u_int)0xa0fb5ba0,

198 (
u_t
)0x52f6a452, (u_int)0x3b4d763b, (u_int)0xd661b7d6, (u_int)0xb3ce7db3,

199 (
u_t
)0x297b5229, (u_int)0xe33edde3, (u_int)0x2f715e2f, (u_int)0x84971384,

200 (
u_t
)0x53f5a653, (u_int)0xd168b9d1, (u_int)0x00000000, (u_int)0xed2cc1ed,

201 (
u_t
)0x20604020, (u_int)0xfc1fe3fc, (u_int)0xb1c879b1, (u_int)0x5bedb65b,

202 (
u_t
)0x6abed46a, (u_int)0xcb468dcb, (u_int)0xbed967be, (u_int)0x394b7239,

203 (
u_t
)0x4ade944a, (u_int)0x4cd4984c, (u_int)0x58e8b058, (u_int)0xcf4a85cf,

204 (
u_t
)0xd06bbbd0, (u_int)0xef2ac5ef, (u_int)0xaae54faa, (u_int)0xfb16edfb,

205 (
u_t
)0x43c58643, (u_int)0x4dd79a4d, (u_int)0x33556633, (u_int)0x85941185,

206 (
u_t
)0x45cf8a45, (u_int)0xf910e9f9, (u_int)0x02060402, (u_int)0x7f81fe7f,

207 (
u_t
)0x50f0a050, (u_int)0x3c44783c, (u_int)0x9fba259f, (u_int)0xa8e34ba8,

208 (
u_t
)0x51f3a251, (u_int)0xa3fe5da3, (u_int)0x40c08040, (u_int)0x8f8a058f,

209 (
u_t
)0x92ad3f92, (u_int)0x9dbc219d, (u_int)0x38487038, (u_int)0xf504f1f5,

210 (
u_t
)0xbcdf63bc, (u_int)0xb6c177b6, (u_int)0xda75afda, (u_int)0x21634221,

211 (
u_t
)0x10302010, (u_int)0xff1ae5ff, (u_int)0xf30efdf3, (u_int)0xd26dbfd2,

212 (
u_t
)0xcd4c81cd, (u_int)0x0c14180c, (u_int)0x13352613, (u_int)0xec2fc3ec,

213 (
u_t
)0x5fe1be5f, (u_int)0x97a23597, (u_int)0x44cc8844, (u_int)0x17392e17,

214 (
u_t
)0xc45793c4, (u_int)0xa7f255a7, (u_int)0x7e82fc7e, (u_int)0x3d477a3d,

215 (
u_t
)0x64acc864, (u_int)0x5de7ba5d, (u_int)0x192b3219, (u_int)0x7395e673,

216 (
u_t
)0x60a0c060, (u_int)0x81981981, (u_int)0x4fd19e4f, (u_int)0xdc7fa3dc,

217 (
u_t
)0x22664422, (u_int)0x2a7e542a, (u_int)0x90ab3b90, (u_int)0x88830b88,

218 (
u_t
)0x46ca8c46, (u_int)0xee29c7ee, (u_int)0xb8d36bb8, (u_int)0x143c2814,

219 (
u_t
)0xde79a7de, (u_int)0x5ee2bc5e, (u_int)0x0b1d160b, (u_int)0xdb76addb,

220 (
u_t
)0xe03bdbe0, (u_int)0x32566432, (u_int)0x3a4e743a, (u_int)0x0a1e140a,

221 (
u_t
)0x49db9249, (u_int)0x060a0c06, (u_int)0x246c4824, (u_int)0x5ce4b85c,

222 (
u_t
)0xc25d9fc2, (u_int)0xd36ebdd3, (u_int)0xacef43ac, (u_int)0x62a6c462,

223 (
u_t
)0x91a83991, (u_int)0x95a43195, (u_int)0xe437d3e4, (u_int)0x798bf279,

224 (
u_t
)0xe732d5e7, (u_int)0xc8438bc8, (u_int)0x37596e37, (u_int)0x6db7da6d,

225 (
u_t
)0x8d8c018d, (u_int)0xd564b1d5, (u_int)0x4ed29c4e, (u_int)0xa9e049a9,

226 (
u_t
)0x6cb4d86c, (u_int)0x56faac56, (u_int)0xf407f3f4, (u_int)0xea25cfea,

227 (
u_t
)0x65afca65, (u_int)0x7a8ef47a, (u_int)0xaee947ae, (u_int)0x08181008,

228 (
u_t
)0xbad56fba, (u_int)0x7888f078, (u_int)0x256f4a25, (u_int)0x2e725c2e,

229 (
u_t
)0x1c24381c, (u_int)0xa6f157a6, (u_int)0xb4c773b4, (u_int)0xc65197c6,

230 (
u_t
)0xe823cbe8, (u_int)0xdd7ca1dd, (u_int)0x749ce874, (u_int)0x1f213e1f,

231 (
u_t
)0x4bdd964b, (u_int)0xbddc61bd, (u_int)0x8b860d8b, (u_int)0x8a850f8a,

232 (
u_t
)0x7090e070, (u_int)0x3e427c3e, (u_int)0xb5c471b5, (u_int)0x66aacc66,

233 (
u_t
)0x48d89048, (u_int)0x03050603, (u_int)0xf601f7f6, (u_int)0x0e121c0e,

234 (
u_t
)0x61a3c261, (u_int)0x355f6a35, (u_int)0x57f9ae57, (u_int)0xb9d069b9,

235 (
u_t
)0x86911786, (u_int)0xc15899c1, (u_int)0x1d273a1d, (u_int)0x9eb9279e,

236 (
u_t
)0xe138d9e1, (u_int)0xf813ebf8, (u_int)0x98b32b98, (u_int)0x11332211,

237 (
u_t
)0x69bbd269, (u_int)0xd970a9d9, (u_int)0x8e89078e, (u_int)0x94a73394,

238 (
u_t
)0x9bb62d9b, (u_int)0x1e223c1e, (u_int)0x87921587, (u_int)0xe920c9e9,

239 (
u_t
)0xce4987ce, (u_int)0x55ffaa55, (u_int)0x28785028, (u_int)0xdf7aa5df,

240 (
u_t
)0x8c8f038c, (u_int)0xa1f859a1, (u_int)0x89800989, (u_int)0x0d171a0d,

241 (
u_t
)0xbfda65bf, (u_int)0xe631d7e6, (u_int)0x42c68442, (u_int)0x68b8d068,

242 (
u_t
)0x41c38241, (u_int)0x99b02999, (u_int)0x2d775a2d, (u_int)0x0f111e0f,

243 (
u_t
)0xb0cb7bb0, (u_int)0x54fca854, (u_int)0xbbd66dbb, (u_int)0x163a2c16,

245 cڡ 
u32
 
	gTe3
[256] = {

247 (
u_t
)0x6363a5c6, (u_int)0x7c7c84f8, (u_int)0x777799ee, (u_int)0x7b7b8df6,

248 (
u_t
)0xf2f20dff, (u_int)0x6b6bbdd6, (u_int)0x6f6fb1de, (u_int)0xc5c55491,

249 (
u_t
)0x30305060, (u_int)0x01010302, (u_int)0x6767a9ce, (u_int)0x2b2b7d56,

250 (
u_t
)0xfefe19e7, (u_int)0xd7d762b5, (u_int)0xababe64d, (u_int)0x76769aec,

251 (
u_t
)0xcaca458f, (u_int)0x82829d1f, (u_int)0xc9c94089, (u_int)0x7d7d87fa,

252 (
u_t
)0xfafa15ef, (u_int)0x5959ebb2, (u_int)0x4747c98e, (u_int)0xf0f00bfb,

253 (
u_t
)0xadadec41, (u_int)0xd4d467b3, (u_int)0xa2a2fd5f, (u_int)0xafafea45,

254 (
u_t
)0x9c9cbf23, (u_int)0xa4a4f753, (u_int)0x727296e4, (u_int)0xc0c05b9b,

255 (
u_t
)0xb7b7c275, (u_int)0xfdfd1ce1, (u_int)0x9393ae3d, (u_int)0x26266a4c,

256 (
u_t
)0x36365a6c, (u_int)0x3f3f417e, (u_int)0xf7f702f5, (u_int)0xcccc4f83,

257 (
u_t
)0x34345c68, (u_int)0xa5a5f451, (u_int)0xe5e534d1, (u_int)0xf1f108f9,

258 (
u_t
)0x717193e2, (u_int)0xd8d873ab, (u_int)0x31315362, (u_int)0x15153f2a,

259 (
u_t
)0x04040c08, (u_int)0xc7c75295, (u_int)0x23236546, (u_int)0xc3c35e9d,

260 (
u_t
)0x18182830, (u_int)0x9696a137, (u_int)0x05050f0a, (u_int)0x9a9ab52f,

261 (
u_t
)0x0707090e, (u_int)0x12123624, (u_int)0x80809b1b, (u_int)0xe2e23ddf,

262 (
u_t
)0xebeb26cd, (u_int)0x2727694e, (u_int)0xb2b2cd7f, (u_int)0x75759fea,

263 (
u_t
)0x09091b12, (u_int)0x83839e1d, (u_int)0x2c2c7458, (u_int)0x1a1a2e34,

264 (
u_t
)0x1b1b2d36, (u_int)0x6e6eb2dc, (u_int)0x5a5aeeb4, (u_int)0xa0a0fb5b,

265 (
u_t
)0x5252f6a4, (u_int)0x3b3b4d76, (u_int)0xd6d661b7, (u_int)0xb3b3ce7d,

266 (
u_t
)0x29297b52, (u_int)0xe3e33edd, (u_int)0x2f2f715e, (u_int)0x84849713,

267 (
u_t
)0x5353f5a6, (u_int)0xd1d168b9, (u_int)0x00000000, (u_int)0xeded2cc1,

268 (
u_t
)0x20206040, (u_int)0xfcfc1fe3, (u_int)0xb1b1c879, (u_int)0x5b5bedb6,

269 (
u_t
)0x6a6abed4, (u_int)0xcbcb468d, (u_int)0xbebed967, (u_int)0x39394b72,

270 (
u_t
)0x4a4ade94, (u_int)0x4c4cd498, (u_int)0x5858e8b0, (u_int)0xcfcf4a85,

271 (
u_t
)0xd0d06bbb, (u_int)0xefef2ac5, (u_int)0xaaaae54f, (u_int)0xfbfb16ed,

272 (
u_t
)0x4343c586, (u_int)0x4d4dd79a, (u_int)0x33335566, (u_int)0x85859411,

273 (
u_t
)0x4545cf8a, (u_int)0xf9f910e9, (u_int)0x02020604, (u_int)0x7f7f81fe,

274 (
u_t
)0x5050f0a0, (u_int)0x3c3c4478, (u_int)0x9f9fba25, (u_int)0xa8a8e34b,

275 (
u_t
)0x5151f3a2, (u_int)0xa3a3fe5d, (u_int)0x4040c080, (u_int)0x8f8f8a05,

276 (
u_t
)0x9292ad3f, (u_int)0x9d9dbc21, (u_int)0x38384870, (u_int)0xf5f504f1,

277 (
u_t
)0xbcbcdf63, (u_int)0xb6b6c177, (u_int)0xdada75af, (u_int)0x21216342,

278 (
u_t
)0x10103020, (u_int)0xffff1ae5, (u_int)0xf3f30efd, (u_int)0xd2d26dbf,

279 (
u_t
)0xcdcd4c81, (u_int)0x0c0c1418, (u_int)0x13133526, (u_int)0xecec2fc3,

280 (
u_t
)0x5f5fe1be, (u_int)0x9797a235, (u_int)0x4444cc88, (u_int)0x1717392e,

281 (
u_t
)0xc4c45793, (u_int)0xa7a7f255, (u_int)0x7e7e82fc, (u_int)0x3d3d477a,

282 (
u_t
)0x6464acc8, (u_int)0x5d5de7ba, (u_int)0x19192b32, (u_int)0x737395e6,

283 (
u_t
)0x6060a0c0, (u_int)0x81819819, (u_int)0x4f4fd19e, (u_int)0xdcdc7fa3,

284 (
u_t
)0x22226644, (u_int)0x2a2a7e54, (u_int)0x9090ab3b, (u_int)0x8888830b,

285 (
u_t
)0x4646ca8c, (u_int)0xeeee29c7, (u_int)0xb8b8d36b, (u_int)0x14143c28,

286 (
u_t
)0xdede79a7, (u_int)0x5e5ee2bc, (u_int)0x0b0b1d16, (u_int)0xdbdb76ad,

287 (
u_t
)0xe0e03bdb, (u_int)0x32325664, (u_int)0x3a3a4e74, (u_int)0x0a0a1e14,

288 (
u_t
)0x4949db92, (u_int)0x06060a0c, (u_int)0x24246c48, (u_int)0x5c5ce4b8,

289 (
u_t
)0xc2c25d9f, (u_int)0xd3d36ebd, (u_int)0xacacef43, (u_int)0x6262a6c4,

290 (
u_t
)0x9191a839, (u_int)0x9595a431, (u_int)0xe4e437d3, (u_int)0x79798bf2,

291 (
u_t
)0xe7e732d5, (u_int)0xc8c8438b, (u_int)0x3737596e, (u_int)0x6d6db7da,

292 (
u_t
)0x8d8d8c01, (u_int)0xd5d564b1, (u_int)0x4e4ed29c, (u_int)0xa9a9e049,

293 (
u_t
)0x6c6cb4d8, (u_int)0x5656faac, (u_int)0xf4f407f3, (u_int)0xeaea25cf,

294 (
u_t
)0x6565afca, (u_int)0x7a7a8ef4, (u_int)0xaeaee947, (u_int)0x08081810,

295 (
u_t
)0xbabad56f, (u_int)0x787888f0, (u_int)0x25256f4a, (u_int)0x2e2e725c,

296 (
u_t
)0x1c1c2438, (u_int)0xa6a6f157, (u_int)0xb4b4c773, (u_int)0xc6c65197,

297 (
u_t
)0xe8e823cb, (u_int)0xdddd7ca1, (u_int)0x74749ce8, (u_int)0x1f1f213e,

298 (
u_t
)0x4b4bdd96, (u_int)0xbdbddc61, (u_int)0x8b8b860d, (u_int)0x8a8a850f,

299 (
u_t
)0x707090e0, (u_int)0x3e3e427c, (u_int)0xb5b5c471, (u_int)0x6666aacc,

300 (
u_t
)0x4848d890, (u_int)0x03030506, (u_int)0xf6f601f7, (u_int)0x0e0e121c,

301 (
u_t
)0x6161a3c2, (u_int)0x35355f6a, (u_int)0x5757f9ae, (u_int)0xb9b9d069,

302 (
u_t
)0x86869117, (u_int)0xc1c15899, (u_int)0x1d1d273a, (u_int)0x9e9eb927,

303 (
u_t
)0xe1e138d9, (u_int)0xf8f813eb, (u_int)0x9898b32b, (u_int)0x11113322,

304 (
u_t
)0x6969bbd2, (u_int)0xd9d970a9, (u_int)0x8e8e8907, (u_int)0x9494a733,

305 (
u_t
)0x9b9bb62d, (u_int)0x1e1e223c, (u_int)0x87879215, (u_int)0xe9e920c9,

306 (
u_t
)0xcece4987, (u_int)0x5555ffaa, (u_int)0x28287850, (u_int)0xdfdf7aa5,

307 (
u_t
)0x8c8c8f03, (u_int)0xa1a1f859, (u_int)0x89898009, (u_int)0x0d0d171a,

308 (
u_t
)0xbfbfda65, (u_int)0xe6e631d7, (u_int)0x4242c684, (u_int)0x6868b8d0,

309 (
u_t
)0x4141c382, (u_int)0x9999b029, (u_int)0x2d2d775a, (u_int)0x0f0f111e,

310 (
u_t
)0xb0b0cb7b, (u_int)0x5454fca8, (u_int)0xbbbbd66d, (u_int)0x16163a2c,

312 cڡ 
u32
 
	gTe4
[256] = {

313 (
u_t
)0x63636363, (u_int)0x7c7c7c7c, (u_int)0x77777777, (u_int)0x7b7b7b7b,

314 (
u_t
)0xf2f2f2f2, (u_int)0x6b6b6b6b, (u_int)0x6f6f6f6f, (u_int)0xc5c5c5c5,

315 (
u_t
)0x30303030, (u_int)0x01010101, (u_int)0x67676767, (u_int)0x2b2b2b2b,

316 (
u_t
)0xfefefefe, (u_int)0xd7d7d7d7, (u_int)0xabababab, (u_int)0x76767676,

317 (
u_t
)0xcacacaca, (u_int)0x82828282, (u_int)0xc9c9c9c9, (u_int)0x7d7d7d7d,

318 (
u_t
)0xfafafafa, (u_int)0x59595959, (u_int)0x47474747, (u_int)0xf0f0f0f0,

319 (
u_t
)0xadadadad, (u_int)0xd4d4d4d4, (u_int)0xa2a2a2a2, (u_int)0xafafafaf,

320 (
u_t
)0x9c9c9c9c, (u_int)0xa4a4a4a4, (u_int)0x72727272, (u_int)0xc0c0c0c0,

321 (
u_t
)0xb7b7b7b7, (u_int)0xfdfdfdfd, (u_int)0x93939393, (u_int)0x26262626,

322 (
u_t
)0x36363636, (u_int)0x3f3f3f3f, (u_int)0xf7f7f7f7, (u_int)0xcccccccc,

323 (
u_t
)0x34343434, (u_int)0xa5a5a5a5, (u_int)0xe5e5e5e5, (u_int)0xf1f1f1f1,

324 (
u_t
)0x71717171, (u_int)0xd8d8d8d8, (u_int)0x31313131, (u_int)0x15151515,

325 (
u_t
)0x04040404, (u_int)0xc7c7c7c7, (u_int)0x23232323, (u_int)0xc3c3c3c3,

326 (
u_t
)0x18181818, (u_int)0x96969696, (u_int)0x05050505, (u_int)0x9a9a9a9a,

327 (
u_t
)0x07070707, (u_int)0x12121212, (u_int)0x80808080, (u_int)0xe2e2e2e2,

328 (
u_t
)0xebebebeb, (u_int)0x27272727, (u_int)0xb2b2b2b2, (u_int)0x75757575,

329 (
u_t
)0x09090909, (u_int)0x83838383, (u_int)0x2c2c2c2c, (u_int)0x1a1a1a1a,

330 (
u_t
)0x1b1b1b1b, (u_int)0x6e6e6e6e, (u_int)0x5a5a5a5a, (u_int)0xa0a0a0a0,

331 (
u_t
)0x52525252, (u_int)0x3b3b3b3b, (u_int)0xd6d6d6d6, (u_int)0xb3b3b3b3,

332 (
u_t
)0x29292929, (u_int)0xe3e3e3e3, (u_int)0x2f2f2f2f, (u_int)0x84848484,

333 (
u_t
)0x53535353, (u_int)0xd1d1d1d1, (u_int)0x00000000, (u_int)0xedededed,

334 (
u_t
)0x20202020, (u_int)0xfcfcfcfc, (u_int)0xb1b1b1b1, (u_int)0x5b5b5b5b,

335 (
u_t
)0x6a6a6a6a, (u_int)0xcbcbcbcb, (u_int)0xbebebebe, (u_int)0x39393939,

336 (
u_t
)0x4a4a4a4a, (u_int)0x4c4c4c4c, (u_int)0x58585858, (u_int)0xcfcfcfcf,

337 (
u_t
)0xd0d0d0d0, (u_int)0xefefefef, (u_int)0xaaaaaaaa, (u_int)0xfbfbfbfb,

338 (
u_t
)0x43434343, (u_int)0x4d4d4d4d, (u_int)0x33333333, (u_int)0x85858585,

339 (
u_t
)0x45454545, (u_int)0xf9f9f9f9, (u_int)0x02020202, (u_int)0x7f7f7f7f,

340 (
u_t
)0x50505050, (u_int)0x3c3c3c3c, (u_int)0x9f9f9f9f, (u_int)0xa8a8a8a8,

341 (
u_t
)0x51515151, (u_int)0xa3a3a3a3, (u_int)0x40404040, (u_int)0x8f8f8f8f,

342 (
u_t
)0x92929292, (u_int)0x9d9d9d9d, (u_int)0x38383838, (u_int)0xf5f5f5f5,

343 (
u_t
)0xbcbcbcbc, (u_int)0xb6b6b6b6, (u_int)0xdadadada, (u_int)0x21212121,

344 (
u_t
)0x10101010, (u_int)0xffffffff, (u_int)0xf3f3f3f3, (u_int)0xd2d2d2d2,

345 (
u_t
)0xcdcdcdcd, (u_int)0x0c0c0c0c, (u_int)0x13131313, (u_int)0xecececec,

346 (
u_t
)0x5f5f5f5f, (u_int)0x97979797, (u_int)0x44444444, (u_int)0x17171717,

347 (
u_t
)0xc4c4c4c4, (u_int)0xa7a7a7a7, (u_int)0x7e7e7e7e, (u_int)0x3d3d3d3d,

348 (
u_t
)0x64646464, (u_int)0x5d5d5d5d, (u_int)0x19191919, (u_int)0x73737373,

349 (
u_t
)0x60606060, (u_int)0x81818181, (u_int)0x4f4f4f4f, (u_int)0xdcdcdcdc,

350 (
u_t
)0x22222222, (u_int)0x2a2a2a2a, (u_int)0x90909090, (u_int)0x88888888,

351 (
u_t
)0x46464646, (u_int)0xeeeeeeee, (u_int)0xb8b8b8b8, (u_int)0x14141414,

352 (
u_t
)0xdededede, (u_int)0x5e5e5e5e, (u_int)0x0b0b0b0b, (u_int)0xdbdbdbdb,

353 (
u_t
)0xe0e0e0e0, (u_int)0x32323232, (u_int)0x3a3a3a3a, (u_int)0x0a0a0a0a,

354 (
u_t
)0x49494949, (u_int)0x06060606, (u_int)0x24242424, (u_int)0x5c5c5c5c,

355 (
u_t
)0xc2c2c2c2, (u_int)0xd3d3d3d3, (u_int)0xacacacac, (u_int)0x62626262,

356 (
u_t
)0x91919191, (u_int)0x95959595, (u_int)0xe4e4e4e4, (u_int)0x79797979,

357 (
u_t
)0xe7e7e7e7, (u_int)0xc8c8c8c8, (u_int)0x37373737, (u_int)0x6d6d6d6d,

358 (
u_t
)0x8d8d8d8d, (u_int)0xd5d5d5d5, (u_int)0x4e4e4e4e, (u_int)0xa9a9a9a9,

359 (
u_t
)0x6c6c6c6c, (u_int)0x56565656, (u_int)0xf4f4f4f4, (u_int)0xeaeaeaea,

360 (
u_t
)0x65656565, (u_int)0x7a7a7a7a, (u_int)0xaeaeaeae, (u_int)0x08080808,

361 (
u_t
)0xbabababa, (u_int)0x78787878, (u_int)0x25252525, (u_int)0x2e2e2e2e,

362 (
u_t
)0x1c1c1c1c, (u_int)0xa6a6a6a6, (u_int)0xb4b4b4b4, (u_int)0xc6c6c6c6,

363 (
u_t
)0xe8e8e8e8, (u_int)0xdddddddd, (u_int)0x74747474, (u_int)0x1f1f1f1f,

364 (
u_t
)0x4b4b4b4b, (u_int)0xbdbdbdbd, (u_int)0x8b8b8b8b, (u_int)0x8a8a8a8a,

365 (
u_t
)0x70707070, (u_int)0x3e3e3e3e, (u_int)0xb5b5b5b5, (u_int)0x66666666,

366 (
u_t
)0x48484848, (u_int)0x03030303, (u_int)0xf6f6f6f6, (u_int)0x0e0e0e0e,

367 (
u_t
)0x61616161, (u_int)0x35353535, (u_int)0x57575757, (u_int)0xb9b9b9b9,

368 (
u_t
)0x86868686, (u_int)0xc1c1c1c1, (u_int)0x1d1d1d1d, (u_int)0x9e9e9e9e,

369 (
u_t
)0xe1e1e1e1, (u_int)0xf8f8f8f8, (u_int)0x98989898, (u_int)0x11111111,

370 (
u_t
)0x69696969, (u_int)0xd9d9d9d9, (u_int)0x8e8e8e8e, (u_int)0x94949494,

371 (
u_t
)0x9b9b9b9b, (u_int)0x1e1e1e1e, (u_int)0x87878787, (u_int)0xe9e9e9e9,

372 (
u_t
)0xcececece, (u_int)0x55555555, (u_int)0x28282828, (u_int)0xdfdfdfdf,

373 (
u_t
)0x8c8c8c8c, (u_int)0xa1a1a1a1, (u_int)0x89898989, (u_int)0x0d0d0d0d,

374 (
u_t
)0xbfbfbfbf, (u_int)0xe6e6e6e6, (u_int)0x42424242, (u_int)0x68686868,

375 (
u_t
)0x41414141, (u_int)0x99999999, (u_int)0x2d2d2d2d, (u_int)0x0f0f0f0f,

376 (
u_t
)0xb0b0b0b0, (u_int)0x54545454, (u_int)0xbbbbbbbb, (u_int)0x16161616,

378 cڡ 
u32
 
	gTd0
[256] = {

379 (
u_t
)0x51f4a750, (u_int)0x7e416553, (u_int)0x1a17a4c3, (u_int)0x3a275e96,

380 (
u_t
)0x3bab6bcb, (u_int)0x1f9d45f1, (u_int)0xacfa58ab, (u_int)0x4be30393,

381 (
u_t
)0x2030fa55, (u_int)0xad766df6, (u_int)0x88cc7691, (u_int)0xf5024c25,

382 (
u_t
)0x4fe5d7fc, (u_int)0xc52acbd7, (u_int)0x26354480, (u_int)0xb562a38f,

383 (
u_t
)0xdeb15a49, (u_int)0x25ba1b67, (u_int)0x45ea0e98, (u_int)0x5dfec0e1,

384 (
u_t
)0xc32f7502, (u_int)0x814cf012, (u_int)0x8d4697a3, (u_int)0x6bd3f9c6,

385 (
u_t
)0x038f5fe7, (u_int)0x15929c95, (u_int)0xbf6d7aeb, (u_int)0x955259da,

386 (
u_t
)0xd4be832d, (u_int)0x587421d3, (u_int)0x49e06929, (u_int)0x8ec9c844,

387 (
u_t
)0x75c2896a, (u_int)0xf48e7978, (u_int)0x99583e6b, (u_int)0x27b971dd,

388 (
u_t
)0xbee14fb6, (u_int)0xf088ad17, (u_int)0xc920ac66, (u_int)0x7dce3ab4,

389 (
u_t
)0x63df4a18, (u_int)0xe51a3182, (u_int)0x97513360, (u_int)0x62537f45,

390 (
u_t
)0xb16477e0, (u_int)0xbb6bae84, (u_int)0xfe81a01c, (u_int)0xf9082b94,

391 (
u_t
)0x70486858, (u_int)0x8f45fd19, (u_int)0x94de6c87, (u_int)0x527bf8b7,

392 (
u_t
)0xab73d323, (u_int)0x724b02e2, (u_int)0xe31f8f57, (u_int)0x6655ab2a,

393 (
u_t
)0xb2eb2807, (u_int)0x2fb5c203, (u_int)0x86c57b9a, (u_int)0xd33708a5,

394 (
u_t
)0x302887f2, (u_int)0x23bfa5b2, (u_int)0x02036aba, (u_int)0xed16825c,

395 (
u_t
)0x8acf1c2b, (u_int)0xa779b492, (u_int)0xf307f2f0, (u_int)0x4e69e2a1,

396 (
u_t
)0x65daf4cd, (u_int)0x0605bed5, (u_int)0xd134621f, (u_int)0xc4a6fe8a,

397 (
u_t
)0x342e539d, (u_int)0xa2f355a0, (u_int)0x058ae132, (u_int)0xa4f6eb75,

398 (
u_t
)0x0b83ec39, (u_int)0x4060efaa, (u_int)0x5e719f06, (u_int)0xbd6e1051,

399 (
u_t
)0x3e218af9, (u_int)0x96dd063d, (u_int)0xdd3e05ae, (u_int)0x4de6bd46,

400 (
u_t
)0x91548db5, (u_int)0x71c45d05, (u_int)0x0406d46f, (u_int)0x605015ff,

401 (
u_t
)0x1998fb24, (u_int)0xd6bde997, (u_int)0x894043cc, (u_int)0x67d99e77,

402 (
u_t
)0xb0e842bd, (u_int)0x07898b88, (u_int)0xe7195b38, (u_int)0x79c8eedb,

403 (
u_t
)0xa17c0a47, (u_int)0x7c420fe9, (u_int)0xf8841ec9, (u_int)0x00000000,

404 (
u_t
)0x09808683, (u_int)0x322bed48, (u_int)0x1e1170ac, (u_int)0x6c5a724e,

405 (
u_t
)0xfd0efffb, (u_int)0x0f853856, (u_int)0x3daed51e, (u_int)0x362d3927,

406 (
u_t
)0x0a0fd964, (u_int)0x685ca621, (u_int)0x9b5b54d1, (u_int)0x24362e3a,

407 (
u_t
)0x0c0a67b1, (u_int)0x9357e70f, (u_int)0xb4ee96d2, (u_int)0x1b9b919e,

408 (
u_t
)0x80c0c54f, (u_int)0x61dc20a2, (u_int)0x5a774b69, (u_int)0x1c121a16,

409 (
u_t
)0xe293ba0a, (u_int)0xc0a02ae5, (u_int)0x3c22e043, (u_int)0x121b171d,

410 (
u_t
)0x0e090d0b, (u_int)0xf28bc7ad, (u_int)0x2db6a8b9, (u_int)0x141ea9c8,

411 (
u_t
)0x57f11985, (u_int)0xaf75074c, (u_int)0xee99ddbb, (u_int)0xa37f60fd,

412 (
u_t
)0xf701269f, (u_int)0x5c72f5bc, (u_int)0x44663bc5, (u_int)0x5bfb7e34,

413 (
u_t
)0x8b432976, (u_int)0xcb23c6dc, (u_int)0xb6edfc68, (u_int)0xb8e4f163,

414 (
u_t
)0xd731dcca, (u_int)0x42638510, (u_int)0x13972240, (u_int)0x84c61120,

415 (
u_t
)0x854a247d, (u_int)0xd2bb3df8, (u_int)0xaef93211, (u_int)0xc729a16d,

416 (
u_t
)0x1d9e2f4b, (u_int)0xdcb230f3, (u_int)0x0d8652ec, (u_int)0x77c1e3d0,

417 (
u_t
)0x2bb3166c, (u_int)0xa970b999, (u_int)0x119448fa, (u_int)0x47e96422,

418 (
u_t
)0xa8fc8cc4, (u_int)0xa0f03f1a, (u_int)0x567d2cd8, (u_int)0x223390ef,

419 (
u_t
)0x87494ec7, (u_int)0xd938d1c1, (u_int)0x8ccaa2fe, (u_int)0x98d40b36,

420 (
u_t
)0xa6f581cf, (u_int)0xa57ade28, (u_int)0xdab78e26, (u_int)0x3fadbfa4,

421 (
u_t
)0x2c3a9de4, (u_int)0x5078920d, (u_int)0x6a5fcc9b, (u_int)0x547e4662,

422 (
u_t
)0xf68d13c2, (u_int)0x90d8b8e8, (u_int)0x2e39f75e, (u_int)0x82c3aff5,

423 (
u_t
)0x9f5d80be, (u_int)0x69d0937c, (u_int)0x6fd52da9, (u_int)0xcf2512b3,

424 (
u_t
)0xc8ac993b, (u_int)0x10187da7, (u_int)0xe89c636e, (u_int)0xdb3bbb7b,

425 (
u_t
)0xcd267809, (u_int)0x6e5918f4, (u_int)0xec9ab701, (u_int)0x834f9aa8,

426 (
u_t
)0xe6956e65, (u_int)0xaaffe67e, (u_int)0x21bccf08, (u_int)0xef15e8e6,

427 (
u_t
)0xbae79bd9, (u_int)0x4a6f36ce, (u_int)0xea9f09d4, (u_int)0x29b07cd6,

428 (
u_t
)0x31a4b2af, (u_int)0x2a3f2331, (u_int)0xc6a59430, (u_int)0x35a266c0,

429 (
u_t
)0x744ebc37, (u_int)0xfc82caa6, (u_int)0xe090d0b0, (u_int)0x33a7d815,

430 (
u_t
)0xf104984a, (u_int)0x41ecdaf7, (u_int)0x7fcd500e, (u_int)0x1791f62f,

431 (
u_t
)0x764dd68d, (u_int)0x43efb04d, (u_int)0xccaa4d54, (u_int)0xe49604df,

432 (
u_t
)0x9ed1b5e3, (u_int)0x4c6a881b, (u_int)0xc12c1fb8, (u_int)0x4665517f,

433 (
u_t
)0x9d5eea04, (u_int)0x018c355d, (u_int)0xfa877473, (u_int)0xfb0b412e,

434 (
u_t
)0xb3671d5a, (u_int)0x92dbd252, (u_int)0xe9105633, (u_int)0x6dd64713,

435 (
u_t
)0x9ad7618c, (u_int)0x37a10c7a, (u_int)0x59f8148e, (u_int)0xeb133c89,

436 (
u_t
)0xcea927ee, (u_int)0xb761c935, (u_int)0xe11ce5ed, (u_int)0x7a47b13c,

437 (
u_t
)0x9cd2df59, (u_int)0x55f2733f, (u_int)0x1814ce79, (u_int)0x73c737bf,

438 (
u_t
)0x53f7cdea, (u_int)0x5ffdaa5b, (u_int)0xdf3d6f14, (u_int)0x7844db86,

439 (
u_t
)0xcaaff381, (u_int)0xb968c43e, (u_int)0x3824342c, (u_int)0xc2a3405f,

440 (
u_t
)0x161dc372, (u_int)0xbce2250c, (u_int)0x283c498b, (u_int)0xff0d9541,

441 (
u_t
)0x39a80171, (u_int)0x080cb3de, (u_int)0xd8b4e49c, (u_int)0x6456c190,

442 (
u_t
)0x7bcb8461, (u_int)0xd532b670, (u_int)0x486c5c74, (u_int)0xd0b85742,

444 cڡ 
u32
 
	gTd1
[256] = {

445 (
u_t
)0x5051f4a7, (u_int)0x537e4165, (u_int)0xc31a17a4, (u_int)0x963a275e,

446 (
u_t
)0xcb3bab6b, (u_int)0xf11f9d45, (u_int)0xabacfa58, (u_int)0x934be303,

447 (
u_t
)0x552030fa, (u_int)0xf6ad766d, (u_int)0x9188cc76, (u_int)0x25f5024c,

448 (
u_t
)0xfc4fe5d7, (u_int)0xd7c52acb, (u_int)0x80263544, (u_int)0x8fb562a3,

449 (
u_t
)0x49deb15a, (u_int)0x6725ba1b, (u_int)0x9845ea0e, (u_int)0xe15dfec0,

450 (
u_t
)0x02c32f75, (u_int)0x12814cf0, (u_int)0xa38d4697, (u_int)0xc66bd3f9,

451 (
u_t
)0xe7038f5f, (u_int)0x9515929c, (u_int)0xebbf6d7a, (u_int)0xda955259,

452 (
u_t
)0x2dd4be83, (u_int)0xd3587421, (u_int)0x2949e069, (u_int)0x448ec9c8,

453 (
u_t
)0x6a75c289, (u_int)0x78f48e79, (u_int)0x6b99583e, (u_int)0xdd27b971,

454 (
u_t
)0xb6bee14f, (u_int)0x17f088ad, (u_int)0x66c920ac, (u_int)0xb47dce3a,

455 (
u_t
)0x1863df4a, (u_int)0x82e51a31, (u_int)0x60975133, (u_int)0x4562537f,

456 (
u_t
)0xe0b16477, (u_int)0x84bb6bae, (u_int)0x1cfe81a0, (u_int)0x94f9082b,

457 (
u_t
)0x58704868, (u_int)0x198f45fd, (u_int)0x8794de6c, (u_int)0xb7527bf8,

458 (
u_t
)0x23ab73d3, (u_int)0xe2724b02, (u_int)0x57e31f8f, (u_int)0x2a6655ab,

459 (
u_t
)0x07b2eb28, (u_int)0x032fb5c2, (u_int)0x9a86c57b, (u_int)0xa5d33708,

460 (
u_t
)0xf2302887, (u_int)0xb223bfa5, (u_int)0xba02036a, (u_int)0x5ced1682,

461 (
u_t
)0x2b8acf1c, (u_int)0x92a779b4, (u_int)0xf0f307f2, (u_int)0xa14e69e2,

462 (
u_t
)0xcd65daf4, (u_int)0xd50605be, (u_int)0x1fd13462, (u_int)0x8ac4a6fe,

463 (
u_t
)0x9d342e53, (u_int)0xa0a2f355, (u_int)0x32058ae1, (u_int)0x75a4f6eb,

464 (
u_t
)0x390b83ec, (u_int)0xaa4060ef, (u_int)0x065e719f, (u_int)0x51bd6e10,

465 (
u_t
)0xf93e218a, (u_int)0x3d96dd06, (u_int)0xaedd3e05, (u_int)0x464de6bd,

466 (
u_t
)0xb591548d, (u_int)0x0571c45d, (u_int)0x6f0406d4, (u_int)0xff605015,

467 (
u_t
)0x241998fb, (u_int)0x97d6bde9, (u_int)0xcc894043, (u_int)0x7767d99e,

468 (
u_t
)0xbdb0e842, (u_int)0x8807898b, (u_int)0x38e7195b, (u_int)0xdb79c8ee,

469 (
u_t
)0x47a17c0a, (u_int)0xe97c420f, (u_int)0xc9f8841e, (u_int)0x00000000,

470 (
u_t
)0x83098086, (u_int)0x48322bed, (u_int)0xac1e1170, (u_int)0x4e6c5a72,

471 (
u_t
)0xfbfd0eff, (u_int)0x560f8538, (u_int)0x1e3daed5, (u_int)0x27362d39,

472 (
u_t
)0x640a0fd9, (u_int)0x21685ca6, (u_int)0xd19b5b54, (u_int)0x3a24362e,

473 (
u_t
)0xb10c0a67, (u_int)0x0f9357e7, (u_int)0xd2b4ee96, (u_int)0x9e1b9b91,

474 (
u_t
)0x4f80c0c5, (u_int)0xa261dc20, (u_int)0x695a774b, (u_int)0x161c121a,

475 (
u_t
)0x0ae293ba, (u_int)0xe5c0a02a, (u_int)0x433c22e0, (u_int)0x1d121b17,

476 (
u_t
)0x0b0e090d, (u_int)0xadf28bc7, (u_int)0xb92db6a8, (u_int)0xc8141ea9,

477 (
u_t
)0x8557f119, (u_int)0x4caf7507, (u_int)0xbbee99dd, (u_int)0xfda37f60,

478 (
u_t
)0x9ff70126, (u_int)0xbc5c72f5, (u_int)0xc544663b, (u_int)0x345bfb7e,

479 (
u_t
)0x768b4329, (u_int)0xdccb23c6, (u_int)0x68b6edfc, (u_int)0x63b8e4f1,

480 (
u_t
)0xcad731dc, (u_int)0x10426385, (u_int)0x40139722, (u_int)0x2084c611,

481 (
u_t
)0x7d854a24, (u_int)0xf8d2bb3d, (u_int)0x11aef932, (u_int)0x6dc729a1,

482 (
u_t
)0x4b1d9e2f, (u_int)0xf3dcb230, (u_int)0xec0d8652, (u_int)0xd077c1e3,

483 (
u_t
)0x6c2bb316, (u_int)0x99a970b9, (u_int)0xfa119448, (u_int)0x2247e964,

484 (
u_t
)0xc4a8fc8c, (u_int)0x1aa0f03f, (u_int)0xd8567d2c, (u_int)0xef223390,

485 (
u_t
)0xc787494e, (u_int)0xc1d938d1, (u_int)0xfe8ccaa2, (u_int)0x3698d40b,

486 (
u_t
)0xcfa6f581, (u_int)0x28a57ade, (u_int)0x26dab78e, (u_int)0xa43fadbf,

487 (
u_t
)0xe42c3a9d, (u_int)0x0d507892, (u_int)0x9b6a5fcc, (u_int)0x62547e46,

488 (
u_t
)0xc2f68d13, (u_int)0xe890d8b8, (u_int)0x5e2e39f7, (u_int)0xf582c3af,

489 (
u_t
)0xbe9f5d80, (u_int)0x7c69d093, (u_int)0xa96fd52d, (u_int)0xb3cf2512,

490 (
u_t
)0x3bc8ac99, (u_int)0xa710187d, (u_int)0x6ee89c63, (u_int)0x7bdb3bbb,

491 (
u_t
)0x09cd2678, (u_int)0xf46e5918, (u_int)0x01ec9ab7, (u_int)0xa8834f9a,

492 (
u_t
)0x65e6956e, (u_int)0x7eaaffe6, (u_int)0x0821bccf, (u_int)0xe6ef15e8,

493 (
u_t
)0xd9bae79b, (u_int)0xce4a6f36, (u_int)0xd4ea9f09, (u_int)0xd629b07c,

494 (
u_t
)0xaf31a4b2, (u_int)0x312a3f23, (u_int)0x30c6a594, (u_int)0xc035a266,

495 (
u_t
)0x37744ebc, (u_int)0xa6fc82ca, (u_int)0xb0e090d0, (u_int)0x1533a7d8,

496 (
u_t
)0x4af10498, (u_int)0xf741ecda, (u_int)0x0e7fcd50, (u_int)0x2f1791f6,

497 (
u_t
)0x8d764dd6, (u_int)0x4d43efb0, (u_int)0x54ccaa4d, (u_int)0xdfe49604,

498 (
u_t
)0xe39ed1b5, (u_int)0x1b4c6a88, (u_int)0xb8c12c1f, (u_int)0x7f466551,

499 (
u_t
)0x049d5eea, (u_int)0x5d018c35, (u_int)0x73fa8774, (u_int)0x2efb0b41,

500 (
u_t
)0x5ab3671d, (u_int)0x5292dbd2, (u_int)0x33e91056, (u_int)0x136dd647,

501 (
u_t
)0x8c9ad761, (u_int)0x7a37a10c, (u_int)0x8e59f814, (u_int)0x89eb133c,

502 (
u_t
)0xeecea927, (u_int)0x35b761c9, (u_int)0xede11ce5, (u_int)0x3c7a47b1,

503 (
u_t
)0x599cd2df, (u_int)0x3f55f273, (u_int)0x791814ce, (u_int)0xbf73c737,

504 (
u_t
)0xea53f7cd, (u_int)0x5b5ffdaa, (u_int)0x14df3d6f, (u_int)0x867844db,

505 (
u_t
)0x81caaff3, (u_int)0x3eb968c4, (u_int)0x2c382434, (u_int)0x5fc2a340,

506 (
u_t
)0x72161dc3, (u_int)0x0cbce225, (u_int)0x8b283c49, (u_int)0x41ff0d95,

507 (
u_t
)0x7139a801, (u_int)0xde080cb3, (u_int)0x9cd8b4e4, (u_int)0x906456c1,

508 (
u_t
)0x617bcb84, (u_int)0x70d532b6, (u_int)0x74486c5c, (u_int)0x42d0b857,

510 cڡ 
u32
 
	gTd2
[256] = {

511 (
u_t
)0xa75051f4, (u_int)0x65537e41, (u_int)0xa4c31a17, (u_int)0x5e963a27,

512 (
u_t
)0x6bcb3bab, (u_int)0x45f11f9d, (u_int)0x58abacfa, (u_int)0x03934be3,

513 (
u_t
)0xfa552030, (u_int)0x6df6ad76, (u_int)0x769188cc, (u_int)0x4c25f502,

514 (
u_t
)0xd7fc4fe5, (u_int)0xcbd7c52a, (u_int)0x44802635, (u_int)0xa38fb562,

515 (
u_t
)0x5a49deb1, (u_int)0x1b6725ba, (u_int)0x0e9845ea, (u_int)0xc0e15dfe,

516 (
u_t
)0x7502c32f, (u_int)0xf012814c, (u_int)0x97a38d46, (u_int)0xf9c66bd3,

517 (
u_t
)0x5fe7038f, (u_int)0x9c951592, (u_int)0x7aebbf6d, (u_int)0x59da9552,

518 (
u_t
)0x832dd4be, (u_int)0x21d35874, (u_int)0x692949e0, (u_int)0xc8448ec9,

519 (
u_t
)0x896a75c2, (u_int)0x7978f48e, (u_int)0x3e6b9958, (u_int)0x71dd27b9,

520 (
u_t
)0x4fb6bee1, (u_int)0xad17f088, (u_int)0xac66c920, (u_int)0x3ab47dce,

521 (
u_t
)0x4a1863df, (u_int)0x3182e51a, (u_int)0x33609751, (u_int)0x7f456253,

522 (
u_t
)0x77e0b164, (u_int)0xae84bb6b, (u_int)0xa01cfe81, (u_int)0x2b94f908,

523 (
u_t
)0x68587048, (u_int)0xfd198f45, (u_int)0x6c8794de, (u_int)0xf8b7527b,

524 (
u_t
)0xd323ab73, (u_int)0x02e2724b, (u_int)0x8f57e31f, (u_int)0xab2a6655,

525 (
u_t
)0x2807b2eb, (u_int)0xc2032fb5, (u_int)0x7b9a86c5, (u_int)0x08a5d337,

526 (
u_t
)0x87f23028, (u_int)0xa5b223bf, (u_int)0x6aba0203, (u_int)0x825ced16,

527 (
u_t
)0x1c2b8acf, (u_int)0xb492a779, (u_int)0xf2f0f307, (u_int)0xe2a14e69,

528 (
u_t
)0xf4cd65da, (u_int)0xbed50605, (u_int)0x621fd134, (u_int)0xfe8ac4a6,

529 (
u_t
)0x539d342e, (u_int)0x55a0a2f3, (u_int)0xe132058a, (u_int)0xeb75a4f6,

530 (
u_t
)0xec390b83, (u_int)0xefaa4060, (u_int)0x9f065e71, (u_int)0x1051bd6e,

532 (
u_t
)0x8af93e21, (u_int)0x063d96dd, (u_int)0x05aedd3e, (u_int)0xbd464de6,

533 (
u_t
)0x8db59154, (u_int)0x5d0571c4, (u_int)0xd46f0406, (u_int)0x15ff6050,

534 (
u_t
)0xfb241998, (u_int)0xe997d6bd, (u_int)0x43cc8940, (u_int)0x9e7767d9,

535 (
u_t
)0x42bdb0e8, (u_int)0x8b880789, (u_int)0x5b38e719, (u_int)0xeedb79c8,

536 (
u_t
)0x0a47a17c, (u_int)0x0fe97c42, (u_int)0x1ec9f884, (u_int)0x00000000,

537 (
u_t
)0x86830980, (u_int)0xed48322b, (u_int)0x70ac1e11, (u_int)0x724e6c5a,

538 (
u_t
)0xfffbfd0e, (u_int)0x38560f85, (u_int)0xd51e3dae, (u_int)0x3927362d,

539 (
u_t
)0xd9640a0f, (u_int)0xa621685c, (u_int)0x54d19b5b, (u_int)0x2e3a2436,

540 (
u_t
)0x67b10c0a, (u_int)0xe70f9357, (u_int)0x96d2b4ee, (u_int)0x919e1b9b,

541 (
u_t
)0xc54f80c0, (u_int)0x20a261dc, (u_int)0x4b695a77, (u_int)0x1a161c12,

542 (
u_t
)0xba0ae293, (u_int)0x2ae5c0a0, (u_int)0xe0433c22, (u_int)0x171d121b,

543 (
u_t
)0x0d0b0e09, (u_int)0xc7adf28b, (u_int)0xa8b92db6, (u_int)0xa9c8141e,

544 (
u_t
)0x198557f1, (u_int)0x074caf75, (u_int)0xddbbee99, (u_int)0x60fda37f,

545 (
u_t
)0x269ff701, (u_int)0xf5bc5c72, (u_int)0x3bc54466, (u_int)0x7e345bfb,

546 (
u_t
)0x29768b43, (u_int)0xc6dccb23, (u_int)0xfc68b6ed, (u_int)0xf163b8e4,

547 (
u_t
)0xdccad731, (u_int)0x85104263, (u_int)0x22401397, (u_int)0x112084c6,

548 (
u_t
)0x247d854a, (u_int)0x3df8d2bb, (u_int)0x3211aef9, (u_int)0xa16dc729,

549 (
u_t
)0x2f4b1d9e, (u_int)0x30f3dcb2, (u_int)0x52ec0d86, (u_int)0xe3d077c1,

550 (
u_t
)0x166c2bb3, (u_int)0xb999a970, (u_int)0x48fa1194, (u_int)0x642247e9,

551 (
u_t
)0x8cc4a8fc, (u_int)0x3f1aa0f0, (u_int)0x2cd8567d, (u_int)0x90ef2233,

552 (
u_t
)0x4ec78749, (u_int)0xd1c1d938, (u_int)0xa2fe8cca, (u_int)0x0b3698d4,

553 (
u_t
)0x81cfa6f5, (u_int)0xde28a57a, (u_int)0x8e26dab7, (u_int)0xbfa43fad,

554 (
u_t
)0x9de42c3a, (u_int)0x920d5078, (u_int)0xcc9b6a5f, (u_int)0x4662547e,

555 (
u_t
)0x13c2f68d, (u_int)0xb8e890d8, (u_int)0xf75e2e39, (u_int)0xaff582c3,

556 (
u_t
)0x80be9f5d, (u_int)0x937c69d0, (u_int)0x2da96fd5, (u_int)0x12b3cf25,

557 (
u_t
)0x993bc8ac, (u_int)0x7da71018, (u_int)0x636ee89c, (u_int)0xbb7bdb3b,

558 (
u_t
)0x7809cd26, (u_int)0x18f46e59, (u_int)0xb701ec9a, (u_int)0x9aa8834f,

559 (
u_t
)0x6e65e695, (u_int)0xe67eaaff, (u_int)0xcf0821bc, (u_int)0xe8e6ef15,

560 (
u_t
)0x9bd9bae7, (u_int)0x36ce4a6f, (u_int)0x09d4ea9f, (u_int)0x7cd629b0,

561 (
u_t
)0xb2af31a4, (u_int)0x23312a3f, (u_int)0x9430c6a5, (u_int)0x66c035a2,

562 (
u_t
)0xbc37744e, (u_int)0xcaa6fc82, (u_int)0xd0b0e090, (u_int)0xd81533a7,

563 (
u_t
)0x984af104, (u_int)0xdaf741ec, (u_int)0x500e7fcd, (u_int)0xf62f1791,

564 (
u_t
)0xd68d764d, (u_int)0xb04d43ef, (u_int)0x4d54ccaa, (u_int)0x04dfe496,

565 (
u_t
)0xb5e39ed1, (u_int)0x881b4c6a, (u_int)0x1fb8c12c, (u_int)0x517f4665,

566 (
u_t
)0xea049d5e, (u_int)0x355d018c, (u_int)0x7473fa87, (u_int)0x412efb0b,

567 (
u_t
)0x1d5ab367, (u_int)0xd25292db, (u_int)0x5633e910, (u_int)0x47136dd6,

568 (
u_t
)0x618c9ad7, (u_int)0x0c7a37a1, (u_int)0x148e59f8, (u_int)0x3c89eb13,

569 (
u_t
)0x27eecea9, (u_int)0xc935b761, (u_int)0xe5ede11c, (u_int)0xb13c7a47,

570 (
u_t
)0xdf599cd2, (u_int)0x733f55f2, (u_int)0xce791814, (u_int)0x37bf73c7,

571 (
u_t
)0xcdea53f7, (u_int)0xaa5b5ffd, (u_int)0x6f14df3d, (u_int)0xdb867844,

572 (
u_t
)0xf381caaf, (u_int)0xc43eb968, (u_int)0x342c3824, (u_int)0x405fc2a3,

573 (
u_t
)0xc372161d, (u_int)0x250cbce2, (u_int)0x498b283c, (u_int)0x9541ff0d,

574 (
u_t
)0x017139a8, (u_int)0xb3de080c, (u_int)0xe49cd8b4, (u_int)0xc1906456,

575 (
u_t
)0x84617bcb, (u_int)0xb670d532, (u_int)0x5c74486c, (u_int)0x5742d0b8,

577 cڡ 
u32
 
	gTd3
[256] = {

578 (
u_t
)0xf4a75051, (u_int)0x4165537e, (u_int)0x17a4c31a, (u_int)0x275e963a,

579 (
u_t
)0xab6bcb3b, (u_int)0x9d45f11f, (u_int)0xfa58abac, (u_int)0xe303934b,

580 (
u_t
)0x30fa5520, (u_int)0x766df6ad, (u_int)0xcc769188, (u_int)0x024c25f5,

581 (
u_t
)0xe5d7fc4f, (u_int)0x2acbd7c5, (u_int)0x35448026, (u_int)0x62a38fb5,

582 (
u_t
)0xb15a49de, (u_int)0xba1b6725, (u_int)0xea0e9845, (u_int)0xfec0e15d,

583 (
u_t
)0x2f7502c3, (u_int)0x4cf01281, (u_int)0x4697a38d, (u_int)0xd3f9c66b,

584 (
u_t
)0x8f5fe703, (u_int)0x929c9515, (u_int)0x6d7aebbf, (u_int)0x5259da95,

585 (
u_t
)0xbe832dd4, (u_int)0x7421d358, (u_int)0xe0692949, (u_int)0xc9c8448e,

586 (
u_t
)0xc2896a75, (u_int)0x8e7978f4, (u_int)0x583e6b99, (u_int)0xb971dd27,

587 (
u_t
)0xe14fb6be, (u_int)0x88ad17f0, (u_int)0x20ac66c9, (u_int)0xce3ab47d,

588 (
u_t
)0xdf4a1863, (u_int)0x1a3182e5, (u_int)0x51336097, (u_int)0x537f4562,

589 (
u_t
)0x6477e0b1, (u_int)0x6bae84bb, (u_int)0x81a01cfe, (u_int)0x082b94f9,

590 (
u_t
)0x48685870, (u_int)0x45fd198f, (u_int)0xde6c8794, (u_int)0x7bf8b752,

591 (
u_t
)0x73d323ab, (u_int)0x4b02e272, (u_int)0x1f8f57e3, (u_int)0x55ab2a66,

592 (
u_t
)0xeb2807b2, (u_int)0xb5c2032f, (u_int)0xc57b9a86, (u_int)0x3708a5d3,

593 (
u_t
)0x2887f230, (u_int)0xbfa5b223, (u_int)0x036aba02, (u_int)0x16825ced,

594 (
u_t
)0xcf1c2b8a, (u_int)0x79b492a7, (u_int)0x07f2f0f3, (u_int)0x69e2a14e,

595 (
u_t
)0xdaf4cd65, (u_int)0x05bed506, (u_int)0x34621fd1, (u_int)0xa6fe8ac4,

596 (
u_t
)0x2e539d34, (u_int)0xf355a0a2, (u_int)0x8ae13205, (u_int)0xf6eb75a4,

597 (
u_t
)0x83ec390b, (u_int)0x60efaa40, (u_int)0x719f065e, (u_int)0x6e1051bd,

598 (
u_t
)0x218af93e, (u_int)0xdd063d96, (u_int)0x3e05aedd, (u_int)0xe6bd464d,

599 (
u_t
)0x548db591, (u_int)0xc45d0571, (u_int)0x06d46f04, (u_int)0x5015ff60,

600 (
u_t
)0x98fb2419, (u_int)0xbde997d6, (u_int)0x4043cc89, (u_int)0xd99e7767,

601 (
u_t
)0xe842bdb0, (u_int)0x898b8807, (u_int)0x195b38e7, (u_int)0xc8eedb79,

602 (
u_t
)0x7c0a47a1, (u_int)0x420fe97c, (u_int)0x841ec9f8, (u_int)0x00000000,

603 (
u_t
)0x80868309, (u_int)0x2bed4832, (u_int)0x1170ac1e, (u_int)0x5a724e6c,

604 (
u_t
)0x0efffbfd, (u_int)0x8538560f, (u_int)0xaed51e3d, (u_int)0x2d392736,

605 (
u_t
)0x0fd9640a, (u_int)0x5ca62168, (u_int)0x5b54d19b, (u_int)0x362e3a24,

606 (
u_t
)0x0a67b10c, (u_int)0x57e70f93, (u_int)0xee96d2b4, (u_int)0x9b919e1b,

607 (
u_t
)0xc0c54f80, (u_int)0xdc20a261, (u_int)0x774b695a, (u_int)0x121a161c,

608 (
u_t
)0x93ba0ae2, (u_int)0xa02ae5c0, (u_int)0x22e0433c, (u_int)0x1b171d12,

609 (
u_t
)0x090d0b0e, (u_int)0x8bc7adf2, (u_int)0xb6a8b92d, (u_int)0x1ea9c814,

610 (
u_t
)0xf1198557, (u_int)0x75074caf, (u_int)0x99ddbbee, (u_int)0x7f60fda3,

611 (
u_t
)0x01269ff7, (u_int)0x72f5bc5c, (u_int)0x663bc544, (u_int)0xfb7e345b,

612 (
u_t
)0x4329768b, (u_int)0x23c6dccb, (u_int)0xedfc68b6, (u_int)0xe4f163b8,

613 (
u_t
)0x31dccad7, (u_int)0x63851042, (u_int)0x97224013, (u_int)0xc6112084,

614 (
u_t
)0x4a247d85, (u_int)0xbb3df8d2, (u_int)0xf93211ae, (u_int)0x29a16dc7,

615 (
u_t
)0x9e2f4b1d, (u_int)0xb230f3dc, (u_int)0x8652ec0d, (u_int)0xc1e3d077,

616 (
u_t
)0xb3166c2b, (u_int)0x70b999a9, (u_int)0x9448fa11, (u_int)0xe9642247,

617 (
u_t
)0xfc8cc4a8, (u_int)0xf03f1aa0, (u_int)0x7d2cd856, (u_int)0x3390ef22,

618 (
u_t
)0x494ec787, (u_int)0x38d1c1d9, (u_int)0xcaa2fe8c, (u_int)0xd40b3698,

619 (
u_t
)0xf581cfa6, (u_int)0x7ade28a5, (u_int)0xb78e26da, (u_int)0xadbfa43f,

620 (
u_t
)0x3a9de42c, (u_int)0x78920d50, (u_int)0x5fcc9b6a, (u_int)0x7e466254,

621 (
u_t
)0x8d13c2f6, (u_int)0xd8b8e890, (u_int)0x39f75e2e, (u_int)0xc3aff582,

622 (
u_t
)0x5d80be9f, (u_int)0xd0937c69, (u_int)0xd52da96f, (u_int)0x2512b3cf,

623 (
u_t
)0xac993bc8, (u_int)0x187da710, (u_int)0x9c636ee8, (u_int)0x3bbb7bdb,

624 (
u_t
)0x267809cd, (u_int)0x5918f46e, (u_int)0x9ab701ec, (u_int)0x4f9aa883,

625 (
u_t
)0x956e65e6, (u_int)0xffe67eaa, (u_int)0xbccf0821, (u_int)0x15e8e6ef,

626 (
u_t
)0xe79bd9ba, (u_int)0x6f36ce4a, (u_int)0x9f09d4ea, (u_int)0xb07cd629,

627 (
u_t
)0xa4b2af31, (u_int)0x3f23312a, (u_int)0xa59430c6, (u_int)0xa266c035,

628 (
u_t
)0x4ebc3774, (u_int)0x82caa6fc, (u_int)0x90d0b0e0, (u_int)0xa7d81533,

629 (
u_t
)0x04984af1, (u_int)0xecdaf741, (u_int)0xcd500e7f, (u_int)0x91f62f17,

630 (
u_t
)0x4dd68d76, (u_int)0xefb04d43, (u_int)0xaa4d54cc, (u_int)0x9604dfe4,

631 (
u_t
)0xd1b5e39e, (u_int)0x6a881b4c, (u_int)0x2c1fb8c1, (u_int)0x65517f46,

632 (
u_t
)0x5eea049d, (u_int)0x8c355d01, (u_int)0x877473fa, (u_int)0x0b412efb,

633 (
u_t
)0x671d5ab3, (u_int)0xdbd25292, (u_int)0x105633e9, (u_int)0xd647136d,

634 (
u_t
)0xd7618c9a, (u_int)0xa10c7a37, (u_int)0xf8148e59, (u_int)0x133c89eb,

635 (
u_t
)0xa927eece, (u_int)0x61c935b7, (u_int)0x1ce5ede1, (u_int)0x47b13c7a,

636 (
u_t
)0xd2df599c, (u_int)0xf2733f55, (u_int)0x14ce7918, (u_int)0xc737bf73,

637 (
u_t
)0xf7cdea53, (u_int)0xfdaa5b5f, (u_int)0x3d6f14df, (u_int)0x44db8678,

638 (
u_t
)0xaff381ca, (u_int)0x68c43eb9, (u_int)0x24342c38, (u_int)0xa3405fc2,

639 (
u_t
)0x1dc37216, (u_int)0xe2250cbc, (u_int)0x3c498b28, (u_int)0x0d9541ff,

640 (
u_t
)0xa8017139, (u_int)0x0cb3de08, (u_int)0xb4e49cd8, (u_int)0x56c19064,

641 (
u_t
)0xcb84617b, (u_int)0x32b670d5, (u_int)0x6c5c7448, (u_int)0xb85742d0,

643 cڡ 
u32
 
	gTd4
[256] = {

644 (
u_t
)0x52525252, (u_int)0x09090909, (u_int)0x6a6a6a6a, (u_int)0xd5d5d5d5,

645 (
u_t
)0x30303030, (u_int)0x36363636, (u_int)0xa5a5a5a5, (u_int)0x38383838,

646 (
u_t
)0xbfbfbfbf, (u_int)0x40404040, (u_int)0xa3a3a3a3, (u_int)0x9e9e9e9e,

647 (
u_t
)0x81818181, (u_int)0xf3f3f3f3, (u_int)0xd7d7d7d7, (u_int)0xfbfbfbfb,

648 (
u_t
)0x7c7c7c7c, (u_int)0xe3e3e3e3, (u_int)0x39393939, (u_int)0x82828282,

649 (
u_t
)0x9b9b9b9b, (u_int)0x2f2f2f2f, (u_int)0xffffffff, (u_int)0x87878787,

650 (
u_t
)0x34343434, (u_int)0x8e8e8e8e, (u_int)0x43434343, (u_int)0x44444444,

651 (
u_t
)0xc4c4c4c4, (u_int)0xdededede, (u_int)0xe9e9e9e9, (u_int)0xcbcbcbcb,

652 (
u_t
)0x54545454, (u_int)0x7b7b7b7b, (u_int)0x94949494, (u_int)0x32323232,

653 (
u_t
)0xa6a6a6a6, (u_int)0xc2c2c2c2, (u_int)0x23232323, (u_int)0x3d3d3d3d,

654 (
u_t
)0xeeeeeeee, (u_int)0x4c4c4c4c, (u_int)0x95959595, (u_int)0x0b0b0b0b,

655 (
u_t
)0x42424242, (u_int)0xfafafafa, (u_int)0xc3c3c3c3, (u_int)0x4e4e4e4e,

656 (
u_t
)0x08080808, (u_int)0x2e2e2e2e, (u_int)0xa1a1a1a1, (u_int)0x66666666,

657 (
u_t
)0x28282828, (u_int)0xd9d9d9d9, (u_int)0x24242424, (u_int)0xb2b2b2b2,

658 (
u_t
)0x76767676, (u_int)0x5b5b5b5b, (u_int)0xa2a2a2a2, (u_int)0x49494949,

659 (
u_t
)0x6d6d6d6d, (u_int)0x8b8b8b8b, (u_int)0xd1d1d1d1, (u_int)0x25252525,

660 (
u_t
)0x72727272, (u_int)0xf8f8f8f8, (u_int)0xf6f6f6f6, (u_int)0x64646464,

661 (
u_t
)0x86868686, (u_int)0x68686868, (u_int)0x98989898, (u_int)0x16161616,

662 (
u_t
)0xd4d4d4d4, (u_int)0xa4a4a4a4, (u_int)0x5c5c5c5c, (u_int)0xcccccccc,

663 (
u_t
)0x5d5d5d5d, (u_int)0x65656565, (u_int)0xb6b6b6b6, (u_int)0x92929292,

664 (
u_t
)0x6c6c6c6c, (u_int)0x70707070, (u_int)0x48484848, (u_int)0x50505050,

665 (
u_t
)0xfdfdfdfd, (u_int)0xedededed, (u_int)0xb9b9b9b9, (u_int)0xdadadada,

666 (
u_t
)0x5e5e5e5e, (u_int)0x15151515, (u_int)0x46464646, (u_int)0x57575757,

667 (
u_t
)0xa7a7a7a7, (u_int)0x8d8d8d8d, (u_int)0x9d9d9d9d, (u_int)0x84848484,

668 (
u_t
)0x90909090, (u_int)0xd8d8d8d8, (u_int)0xabababab, (u_int)0x00000000,

669 (
u_t
)0x8c8c8c8c, (u_int)0xbcbcbcbc, (u_int)0xd3d3d3d3, (u_int)0x0a0a0a0a,

670 (
u_t
)0xf7f7f7f7, (u_int)0xe4e4e4e4, (u_int)0x58585858, (u_int)0x05050505,

671 (
u_t
)0xb8b8b8b8, (u_int)0xb3b3b3b3, (u_int)0x45454545, (u_int)0x06060606,

672 (
u_t
)0xd0d0d0d0, (u_int)0x2c2c2c2c, (u_int)0x1e1e1e1e, (u_int)0x8f8f8f8f,

673 (
u_t
)0xcacacaca, (u_int)0x3f3f3f3f, (u_int)0x0f0f0f0f, (u_int)0x02020202,

674 (
u_t
)0xc1c1c1c1, (u_int)0xafafafaf, (u_int)0xbdbdbdbd, (u_int)0x03030303,

675 (
u_t
)0x01010101, (u_int)0x13131313, (u_int)0x8a8a8a8a, (u_int)0x6b6b6b6b,

676 (
u_t
)0x3a3a3a3a, (u_int)0x91919191, (u_int)0x11111111, (u_int)0x41414141,

677 (
u_t
)0x4f4f4f4f, (u_int)0x67676767, (u_int)0xdcdcdcdc, (u_int)0xeaeaeaea,

678 (
u_t
)0x97979797, (u_int)0xf2f2f2f2, (u_int)0xcfcfcfcf, (u_int)0xcececece,

679 (
u_t
)0xf0f0f0f0, (u_int)0xb4b4b4b4, (u_int)0xe6e6e6e6, (u_int)0x73737373,

680 (
u_t
)0x96969696, (u_int)0xacacacac, (u_int)0x74747474, (u_int)0x22222222,

681 (
u_t
)0xe7e7e7e7, (u_int)0xadadadad, (u_int)0x35353535, (u_int)0x85858585,

682 (
u_t
)0xe2e2e2e2, (u_int)0xf9f9f9f9, (u_int)0x37373737, (u_int)0xe8e8e8e8,

683 (
u_t
)0x1c1c1c1c, (u_int)0x75757575, (u_int)0xdfdfdfdf, (u_int)0x6e6e6e6e,

684 (
u_t
)0x47474747, (u_int)0xf1f1f1f1, (u_int)0x1a1a1a1a, (u_int)0x71717171,

685 (
u_t
)0x1d1d1d1d, (u_int)0x29292929, (u_int)0xc5c5c5c5, (u_int)0x89898989,

686 (
u_t
)0x6f6f6f6f, (u_int)0xb7b7b7b7, (u_int)0x62626262, (u_int)0x0e0e0e0e,

687 (
u_t
)0xaaaaaaaa, (u_int)0x18181818, (u_int)0xbebebebe, (u_int)0x1b1b1b1b,

688 (
u_t
)0xfcfcfcfc, (u_int)0x56565656, (u_int)0x3e3e3e3e, (u_int)0x4b4b4b4b,

689 (
u_t
)0xc6c6c6c6, (u_int)0xd2d2d2d2, (u_int)0x79797979, (u_int)0x20202020,

690 (
u_t
)0x9a9a9a9a, (u_int)0xdbdbdbdb, (u_int)0xc0c0c0c0, (u_int)0xfefefefe,

691 (
u_t
)0x78787878, (u_int)0xcdcdcdcd, (u_int)0x5a5a5a5a, (u_int)0xf4f4f4f4,

692 (
u_t
)0x1f1f1f1f, (u_int)0xdddddddd, (u_int)0xa8a8a8a8, (u_int)0x33333333,

693 (
u_t
)0x88888888, (u_int)0x07070707, (u_int)0xc7c7c7c7, (u_int)0x31313131,

694 (
u_t
)0xb1b1b1b1, (u_int)0x12121212, (u_int)0x10101010, (u_int)0x59595959,

695 (
u_t
)0x27272727, (u_int)0x80808080, (u_int)0xecececec, (u_int)0x5f5f5f5f,

696 (
u_t
)0x60606060, (u_int)0x51515151, (u_int)0x7f7f7f7f, (u_int)0xa9a9a9a9,

697 (
u_t
)0x19191919, (u_int)0xb5b5b5b5, (u_int)0x4a4a4a4a, (u_int)0x0d0d0d0d,

698 (
u_t
)0x2d2d2d2d, (u_int)0xe5e5e5e5, (u_int)0x7a7a7a7a, (u_int)0x9f9f9f9f,

699 (
u_t
)0x93939393, (u_int)0xc9c9c9c9, (u_int)0x9c9c9c9c, (u_int)0xefefefef,

700 (
u_t
)0xa0a0a0a0, (u_int)0xe0e0e0e0, (u_int)0x3b3b3b3b, (u_int)0x4d4d4d4d,

701 (
u_t
)0xaeaeaeae, (u_int)0x2a2a2a2a, (u_int)0xf5f5f5f5, (u_int)0xb0b0b0b0,

702 (
u_t
)0xc8c8c8c8, (u_int)0xebebebeb, (u_int)0xbbbbbbbb, (u_int)0x3c3c3c3c,

703 (
u_t
)0x83838383, (u_int)0x53535353, (u_int)0x99999999, (u_int)0x61616161,

704 (
u_t
)0x17171717, (u_int)0x2b2b2b2b, (u_int)0x04040404, (u_int)0x7e7e7e7e,

705 (
u_t
)0xbabababa, (u_int)0x77777777, (u_int)0xd6d6d6d6, (u_int)0x26262626,

706 (
u_t
)0xe1e1e1e1, (u_int)0x69696969, (u_int)0x14141414, (u_int)0x63636363,

707 (
u_t
)0x55555555, (u_int)0x21212121, (u_int)0x0c0c0c0c, (u_int)0x7d7d7d7d,

709 cڡ 
u32
 
	grc
[] = {

715 
	#SWAP
(
x
(
	`_l
(x, 8& 0x00ff00f| 
	`_r
(x, 8& 0xff00ff00)

	)

717 #ifde
_MSC_VER


718 
	#GETU32
(
p

	`SWAP
(*((
u32
 *))))

	)

719 
	#PUTU32
(

, 

{ *((
u32
 *)()
	`SWAP
(()); }

	)

721 
	#GETU32
(

(((
u32
)t)[0] << 24^ ((u32)t)[1] << 16^ ((u32)t)[2] << 8^ ((u32)t)[3]))

	)

722 
	#PUTU32
(

, 

{ ()[0] = (
u8
)((>> 24); ()[1] = (u8)((>> 16); ()[2] = (u8)((>> 8); ()[3] = (u8)(); }

	)

736 
	$__db_rijndlKeySupEnc
(
rk
, 
chKey
, 
keyBs
)

737 
u32
 *
rk
;

738 cڡ 
u8
 *
chKey
;

739 
keyBs
;

741 
i
 = 0;

742 
u32
 
mp
;

744 
rk
[0] = 
	`GETU32
(
chKey
 );

745 
rk
[1] = 
	`GETU32
(
chKey
 + 4);

746 
rk
[2] = 
	`GETU32
(
chKey
 + 8);

747 
rk
[3] = 
	`GETU32
(
chKey
 + 12);

748 i(
keyBs
 == 128) {

750 
mp
 = 
rk
[3];

751 
rk
[4] =k[0] ^

752 (
Te4
[(
mp
 >> 16) & 0xff] & 0xff000000) ^

753 (
Te4
[(
mp
 >> 8) & 0xff] & 0x00ff0000) ^

754 (
Te4
[(
mp
 ) & 0xff] & 0x0000ff00) ^

755 (
Te4
[(
mp
 >> 24) ] & 0x000000ff) ^

756 
rc
[
i
];

757 
rk
[5] =k[1] ^k[4];

758 
rk
[6] =k[2] ^k[5];

759 
rk
[7] =k[3] ^k[6];

760 i(++
i
 == 10) {

763 
rk
 += 4;

766 
rk
[4] = 
	`GETU32
(
chKey
 + 16);

767 
rk
[5] = 
	`GETU32
(
chKey
 + 20);

768 i(
keyBs
 == 192) {

770 
mp
 = 
rk
[ 5];

771 
rk
[ 6] =k[ 0] ^

772 (
Te4
[(
mp
 >> 16) & 0xff] & 0xff000000) ^

773 (
Te4
[(
mp
 >> 8) & 0xff] & 0x00ff0000) ^

774 (
Te4
[(
mp
 ) & 0xff] & 0x0000ff00) ^

775 (
Te4
[(
mp
 >> 24) ] & 0x000000ff) ^

776 
rc
[
i
];

777 
rk
[ 7] =k[ 1] ^k[ 6];

778 
rk
[ 8] =k[ 2] ^k[ 7];

779 
rk
[ 9] =k[ 3] ^k[ 8];

780 i(++
i
 == 8) {

783 
rk
[10] =k[ 4] ^k[ 9];

784 
rk
[11] =k[ 5] ^k[10];

785 
rk
 += 6;

788 
rk
[6] = 
	`GETU32
(
chKey
 + 24);

789 
rk
[7] = 
	`GETU32
(
chKey
 + 28);

790 i(
keyBs
 == 256) {

792 
mp
 = 
rk
[ 7];

793 
rk
[ 8] =k[ 0] ^

794 (
Te4
[(
mp
 >> 16) & 0xff] & 0xff000000) ^

795 (
Te4
[(
mp
 >> 8) & 0xff] & 0x00ff0000) ^

796 (
Te4
[(
mp
 ) & 0xff] & 0x0000ff00) ^

797 (
Te4
[(
mp
 >> 24) ] & 0x000000ff) ^

798 
rc
[
i
];

799 
rk
[ 9] =k[ 1] ^k[ 8];

800 
rk
[10] =k[ 2] ^k[ 9];

801 
rk
[11] =k[ 3] ^k[10];

802 i(++
i
 == 7) {

805 
mp
 = 
rk
[11];

806 
rk
[12] =k[ 4] ^

807 (
Te4
[(
mp
 >> 24) ] & 0xff000000) ^

808 (
Te4
[(
mp
 >> 16) & 0xff] & 0x00ff0000) ^

809 (
Te4
[(
mp
 >> 8) & 0xff] & 0x0000ff00) ^

810 (
Te4
[(
mp
 ) & 0xff] & 0x000000ff);

811 
rk
[13] =k[ 5] ^k[12];

812 
rk
[14] =k[ 6] ^k[13];

813 
rk
[15] =k[ 7] ^k[14];

815 
rk
 += 8;

819 
	}
}

832 
	$__db_rijndlKeySupDec
(
rk
, 
chKey
, 
keyBs
)

833 
u32
 *
rk
;

834 cڡ 
u8
 *
chKey
;

835 
keyBs
;

837 
Nr
, 
i
, 
j
;

838 
u32
 
mp
;

841 
Nr
 = 
	`__db_rijndlKeySupEnc
(
rk
, 
chKey
, 
keyBs
);

843 
i
 = 0, 
j
 = 4*
Nr
; i < j; i += 4, j -= 4) {

844 
mp
 = 
rk
[
i
 ];k[] =k[
j
 ];k[j ] =emp;

845 
mp
 = 
rk
[
i
 + 1];k[+ 1] =k[
j
 + 1];k[j + 1] =emp;

846 
mp
 = 
rk
[
i
 + 2];k[+ 2] =k[
j
 + 2];k[j + 2] =emp;

847 
mp
 = 
rk
[
i
 + 3];k[+ 3] =k[
j
 + 3];k[j + 3] =emp;

850 
i
 = 1; i < 
Nr
; i++) {

851 
rk
 += 4;

852 
rk
[0] =

853 
Td0
[
Te4
[(
rk
[0] >> 24) ] & 0xff] ^

854 
Td1
[
Te4
[(
rk
[0] >> 16) & 0xff] & 0xff] ^

855 
Td2
[
Te4
[(
rk
[0] >> 8) & 0xff] & 0xff] ^

856 
Td3
[
Te4
[(
rk
[0] ) & 0xff] & 0xff];

857 
rk
[1] =

858 
Td0
[
Te4
[(
rk
[1] >> 24) ] & 0xff] ^

859 
Td1
[
Te4
[(
rk
[1] >> 16) & 0xff] & 0xff] ^

860 
Td2
[
Te4
[(
rk
[1] >> 8) & 0xff] & 0xff] ^

861 
Td3
[
Te4
[(
rk
[1] ) & 0xff] & 0xff];

862 
rk
[2] =

863 
Td0
[
Te4
[(
rk
[2] >> 24) ] & 0xff] ^

864 
Td1
[
Te4
[(
rk
[2] >> 16) & 0xff] & 0xff] ^

865 
Td2
[
Te4
[(
rk
[2] >> 8) & 0xff] & 0xff] ^

866 
Td3
[
Te4
[(
rk
[2] ) & 0xff] & 0xff];

867 
rk
[3] =

868 
Td0
[
Te4
[(
rk
[3] >> 24) ] & 0xff] ^

869 
Td1
[
Te4
[(
rk
[3] >> 16) & 0xff] & 0xff] ^

870 
Td2
[
Te4
[(
rk
[3] >> 8) & 0xff] & 0xff] ^

871 
Td3
[
Te4
[(
rk
[3] ) & 0xff] & 0xff];

873  
Nr
;

874 
	}
}

882 
	$__db_rijndlEny
(
rk
, 
Nr
, 

, 

)

883 
u32
 *
rk
;

884 
Nr
;

885 cڡ 
u8
 *

;

886 
u8
 *

;

888 
u32
 
s0
, 
s1
, 
s2
, 
s3
, 
t0
, 
t1
, 
t2
, 
t3
;

889 #ide
FULL_UNROLL


890 
r
;

897 
s0
 = 
	`GETU32
(

 ) ^ 
rk
[0];

898 
s1
 = 
	`GETU32
(

 + 4^ 
rk
[1];

899 
s2
 = 
	`GETU32
(

 + 8^ 
rk
[2];

900 
s3
 = 
	`GETU32
(

 + 12^ 
rk
[3];

901 #ifde
FULL_UNROLL


903 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[ 4];

904 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[ 5];

905 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[ 6];

906 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[ 7];

908 
s0
 = 
Te0
[
t0
 >> 24] ^ 
Te1
[(
t1
 >> 16& 0xff] ^ 
Te2
[(
t2
 >> 8& 0xff] ^ 
Te3
[
t3
 & 0xff] ^ 
rk
[ 8];

909 
s1
 = 
Te0
[
t1
 >> 24] ^ 
Te1
[(
t2
 >> 16& 0xff] ^ 
Te2
[(
t3
 >> 8& 0xff] ^ 
Te3
[
t0
 & 0xff] ^ 
rk
[ 9];

910 
s2
 = 
Te0
[
t2
 >> 24] ^ 
Te1
[(
t3
 >> 16& 0xff] ^ 
Te2
[(
t0
 >> 8& 0xff] ^ 
Te3
[
t1
 & 0xff] ^ 
rk
[10];

911 
s3
 = 
Te0
[
t3
 >> 24] ^ 
Te1
[(
t0
 >> 16& 0xff] ^ 
Te2
[(
t1
 >> 8& 0xff] ^ 
Te3
[
t2
 & 0xff] ^ 
rk
[11];

913 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[12];

914 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[13];

915 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[14];

916 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[15];

918 
s0
 = 
Te0
[
t0
 >> 24] ^ 
Te1
[(
t1
 >> 16& 0xff] ^ 
Te2
[(
t2
 >> 8& 0xff] ^ 
Te3
[
t3
 & 0xff] ^ 
rk
[16];

919 
s1
 = 
Te0
[
t1
 >> 24] ^ 
Te1
[(
t2
 >> 16& 0xff] ^ 
Te2
[(
t3
 >> 8& 0xff] ^ 
Te3
[
t0
 & 0xff] ^ 
rk
[17];

920 
s2
 = 
Te0
[
t2
 >> 24] ^ 
Te1
[(
t3
 >> 16& 0xff] ^ 
Te2
[(
t0
 >> 8& 0xff] ^ 
Te3
[
t1
 & 0xff] ^ 
rk
[18];

921 
s3
 = 
Te0
[
t3
 >> 24] ^ 
Te1
[(
t0
 >> 16& 0xff] ^ 
Te2
[(
t1
 >> 8& 0xff] ^ 
Te3
[
t2
 & 0xff] ^ 
rk
[19];

923 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[20];

924 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[21];

925 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[22];

926 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[23];

928 
s0
 = 
Te0
[
t0
 >> 24] ^ 
Te1
[(
t1
 >> 16& 0xff] ^ 
Te2
[(
t2
 >> 8& 0xff] ^ 
Te3
[
t3
 & 0xff] ^ 
rk
[24];

929 
s1
 = 
Te0
[
t1
 >> 24] ^ 
Te1
[(
t2
 >> 16& 0xff] ^ 
Te2
[(
t3
 >> 8& 0xff] ^ 
Te3
[
t0
 & 0xff] ^ 
rk
[25];

930 
s2
 = 
Te0
[
t2
 >> 24] ^ 
Te1
[(
t3
 >> 16& 0xff] ^ 
Te2
[(
t0
 >> 8& 0xff] ^ 
Te3
[
t1
 & 0xff] ^ 
rk
[26];

931 
s3
 = 
Te0
[
t3
 >> 24] ^ 
Te1
[(
t0
 >> 16& 0xff] ^ 
Te2
[(
t1
 >> 8& 0xff] ^ 
Te3
[
t2
 & 0xff] ^ 
rk
[27];

933 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[28];

934 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[29];

935 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[30];

936 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[31];

938 
s0
 = 
Te0
[
t0
 >> 24] ^ 
Te1
[(
t1
 >> 16& 0xff] ^ 
Te2
[(
t2
 >> 8& 0xff] ^ 
Te3
[
t3
 & 0xff] ^ 
rk
[32];

939 
s1
 = 
Te0
[
t1
 >> 24] ^ 
Te1
[(
t2
 >> 16& 0xff] ^ 
Te2
[(
t3
 >> 8& 0xff] ^ 
Te3
[
t0
 & 0xff] ^ 
rk
[33];

940 
s2
 = 
Te0
[
t2
 >> 24] ^ 
Te1
[(
t3
 >> 16& 0xff] ^ 
Te2
[(
t0
 >> 8& 0xff] ^ 
Te3
[
t1
 & 0xff] ^ 
rk
[34];

941 
s3
 = 
Te0
[
t3
 >> 24] ^ 
Te1
[(
t0
 >> 16& 0xff] ^ 
Te2
[(
t1
 >> 8& 0xff] ^ 
Te3
[
t2
 & 0xff] ^ 
rk
[35];

943 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[36];

944 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[37];

945 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[38];

946 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[39];

947 i(
Nr
 > 10) {

949 
s0
 = 
Te0
[
t0
 >> 24] ^ 
Te1
[(
t1
 >> 16& 0xff] ^ 
Te2
[(
t2
 >> 8& 0xff] ^ 
Te3
[
t3
 & 0xff] ^ 
rk
[40];

950 
s1
 = 
Te0
[
t1
 >> 24] ^ 
Te1
[(
t2
 >> 16& 0xff] ^ 
Te2
[(
t3
 >> 8& 0xff] ^ 
Te3
[
t0
 & 0xff] ^ 
rk
[41];

951 
s2
 = 
Te0
[
t2
 >> 24] ^ 
Te1
[(
t3
 >> 16& 0xff] ^ 
Te2
[(
t0
 >> 8& 0xff] ^ 
Te3
[
t1
 & 0xff] ^ 
rk
[42];

952 
s3
 = 
Te0
[
t3
 >> 24] ^ 
Te1
[(
t0
 >> 16& 0xff] ^ 
Te2
[(
t1
 >> 8& 0xff] ^ 
Te3
[
t2
 & 0xff] ^ 
rk
[43];

954 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[44];

955 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[45];

956 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[46];

957 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[47];

958 i(
Nr
 > 12) {

960 
s0
 = 
Te0
[
t0
 >> 24] ^ 
Te1
[(
t1
 >> 16& 0xff] ^ 
Te2
[(
t2
 >> 8& 0xff] ^ 
Te3
[
t3
 & 0xff] ^ 
rk
[48];

961 
s1
 = 
Te0
[
t1
 >> 24] ^ 
Te1
[(
t2
 >> 16& 0xff] ^ 
Te2
[(
t3
 >> 8& 0xff] ^ 
Te3
[
t0
 & 0xff] ^ 
rk
[49];

962 
s2
 = 
Te0
[
t2
 >> 24] ^ 
Te1
[(
t3
 >> 16& 0xff] ^ 
Te2
[(
t0
 >> 8& 0xff] ^ 
Te3
[
t1
 & 0xff] ^ 
rk
[50];

963 
s3
 = 
Te0
[
t3
 >> 24] ^ 
Te1
[(
t0
 >> 16& 0xff] ^ 
Te2
[(
t1
 >> 8& 0xff] ^ 
Te3
[
t2
 & 0xff] ^ 
rk
[51];

965 
t0
 = 
Te0
[
s0
 >> 24] ^ 
Te1
[(
s1
 >> 16& 0xff] ^ 
Te2
[(
s2
 >> 8& 0xff] ^ 
Te3
[
s3
 & 0xff] ^ 
rk
[52];

966 
t1
 = 
Te0
[
s1
 >> 24] ^ 
Te1
[(
s2
 >> 16& 0xff] ^ 
Te2
[(
s3
 >> 8& 0xff] ^ 
Te3
[
s0
 & 0xff] ^ 
rk
[53];

967 
t2
 = 
Te0
[
s2
 >> 24] ^ 
Te1
[(
s3
 >> 16& 0xff] ^ 
Te2
[(
s0
 >> 8& 0xff] ^ 
Te3
[
s1
 & 0xff] ^ 
rk
[54];

968 
t3
 = 
Te0
[
s3
 >> 24] ^ 
Te1
[(
s0
 >> 16& 0xff] ^ 
Te2
[(
s1
 >> 8& 0xff] ^ 
Te3
[
s2
 & 0xff] ^ 
rk
[55];

971 
rk
 +
Nr
 << 2;

976 
r
 = 
Nr
 >> 1;

978 
t0
 =

979 
Te0
[(
s0
 >> 24) ] ^

980 
Te1
[(
s1
 >> 16) & 0xff] ^

981 
Te2
[(
s2
 >> 8) & 0xff] ^

982 
Te3
[(
s3
 ) & 0xff] ^

983 
rk
[4];

984 
t1
 =

985 
Te0
[(
s1
 >> 24) ] ^

986 
Te1
[(
s2
 >> 16) & 0xff] ^

987 
Te2
[(
s3
 >> 8) & 0xff] ^

988 
Te3
[(
s0
 ) & 0xff] ^

989 
rk
[5];

990 
t2
 =

991 
Te0
[(
s2
 >> 24) ] ^

992 
Te1
[(
s3
 >> 16) & 0xff] ^

993 
Te2
[(
s0
 >> 8) & 0xff] ^

994 
Te3
[(
s1
 ) & 0xff] ^

995 
rk
[6];

996 
t3
 =

997 
Te0
[(
s3
 >> 24) ] ^

998 
Te1
[(
s0
 >> 16) & 0xff] ^

999 
Te2
[(
s1
 >> 8) & 0xff] ^

1000 
Te3
[(
s2
 ) & 0xff] ^

1001 
rk
[7];

1003 
rk
 += 8;

1004 i(--
r
 == 0) {

1008 
s0
 =

1009 
Te0
[(
t0
 >> 24) ] ^

1010 
Te1
[(
t1
 >> 16) & 0xff] ^

1011 
Te2
[(
t2
 >> 8) & 0xff] ^

1012 
Te3
[(
t3
 ) & 0xff] ^

1013 
rk
[0];

1014 
s1
 =

1015 
Te0
[(
t1
 >> 24) ] ^

1016 
Te1
[(
t2
 >> 16) & 0xff] ^

1017 
Te2
[(
t3
 >> 8) & 0xff] ^

1018 
Te3
[(
t0
 ) & 0xff] ^

1019 
rk
[1];

1020 
s2
 =

1021 
Te0
[(
t2
 >> 24) ] ^

1022 
Te1
[(
t3
 >> 16) & 0xff] ^

1023 
Te2
[(
t0
 >> 8) & 0xff] ^

1024 
Te3
[(
t1
 ) & 0xff] ^

1025 
rk
[2];

1026 
s3
 =

1027 
Te0
[(
t3
 >> 24) ] ^

1028 
Te1
[(
t0
 >> 16) & 0xff] ^

1029 
Te2
[(
t1
 >> 8) & 0xff] ^

1030 
Te3
[(
t2
 ) & 0xff] ^

1031 
rk
[3];

1038 
s0
 =

1039 (
Te4
[(
t0
 >> 24) ] & 0xff000000) ^

1040 (
Te4
[(
t1
 >> 16) & 0xff] & 0x00ff0000) ^

1041 (
Te4
[(
t2
 >> 8) & 0xff] & 0x0000ff00) ^

1042 (
Te4
[(
t3
 ) & 0xff] & 0x000000ff) ^

1043 
rk
[0];

1044 
	`PUTU32
(

 , 
s0
);

1045 
s1
 =

1046 (
Te4
[(
t1
 >> 24) ] & 0xff000000) ^

1047 (
Te4
[(
t2
 >> 16) & 0xff] & 0x00ff0000) ^

1048 (
Te4
[(
t3
 >> 8) & 0xff] & 0x0000ff00) ^

1049 (
Te4
[(
t0
 ) & 0xff] & 0x000000ff) ^

1050 
rk
[1];

1051 
	`PUTU32
(

 + 4, 
s1
);

1052 
s2
 =

1053 (
Te4
[(
t2
 >> 24) ] & 0xff000000) ^

1054 (
Te4
[(
t3
 >> 16) & 0xff] & 0x00ff0000) ^

1055 (
Te4
[(
t0
 >> 8) & 0xff] & 0x0000ff00) ^

1056 (
Te4
[(
t1
 ) & 0xff] & 0x000000ff) ^

1057 
rk
[2];

1058 
	`PUTU32
(

 + 8, 
s2
);

1059 
s3
 =

1060 (
Te4
[(
t3
 >> 24) ] & 0xff000000) ^

1061 (
Te4
[(
t0
 >> 16) & 0xff] & 0x00ff0000) ^

1062 (
Te4
[(
t1
 >> 8) & 0xff] & 0x0000ff00) ^

1063 (
Te4
[(
t2
 ) & 0xff] & 0x000000ff) ^

1064 
rk
[3];

1065 
	`PUTU32
(

 + 12, 
s3
);

1066 
	}
}

1074 
	$__db_rijndlDey
(
rk
, 
Nr
, 

, 

)

1075 
u32
 *
rk
;

1076 
Nr
;

1077 cڡ 
u8
 *

;

1078 
u8
 *

;

1080 
u32
 
s0
, 
s1
, 
s2
, 
s3
, 
t0
, 
t1
, 
t2
, 
t3
;

1081 #ide
FULL_UNROLL


1082 
r
;

1089 
s0
 = 
	`GETU32
(

 ) ^ 
rk
[0];

1090 
s1
 = 
	`GETU32
(

 + 4^ 
rk
[1];

1091 
s2
 = 
	`GETU32
(

 + 8^ 
rk
[2];

1092 
s3
 = 
	`GETU32
(

 + 12^ 
rk
[3];

1093 #ifde
FULL_UNROLL


1095 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[ 4];

1096 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[ 5];

1097 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[ 6];

1098 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[ 7];

1100 
s0
 = 
Td0
[
t0
 >> 24] ^ 
Td1
[(
t3
 >> 16& 0xff] ^ 
Td2
[(
t2
 >> 8& 0xff] ^ 
Td3
[
t1
 & 0xff] ^ 
rk
[ 8];

1101 
s1
 = 
Td0
[
t1
 >> 24] ^ 
Td1
[(
t0
 >> 16& 0xff] ^ 
Td2
[(
t3
 >> 8& 0xff] ^ 
Td3
[
t2
 & 0xff] ^ 
rk
[ 9];

1102 
s2
 = 
Td0
[
t2
 >> 24] ^ 
Td1
[(
t1
 >> 16& 0xff] ^ 
Td2
[(
t0
 >> 8& 0xff] ^ 
Td3
[
t3
 & 0xff] ^ 
rk
[10];

1103 
s3
 = 
Td0
[
t3
 >> 24] ^ 
Td1
[(
t2
 >> 16& 0xff] ^ 
Td2
[(
t1
 >> 8& 0xff] ^ 
Td3
[
t0
 & 0xff] ^ 
rk
[11];

1105 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[12];

1106 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[13];

1107 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[14];

1108 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[15];

1110 
s0
 = 
Td0
[
t0
 >> 24] ^ 
Td1
[(
t3
 >> 16& 0xff] ^ 
Td2
[(
t2
 >> 8& 0xff] ^ 
Td3
[
t1
 & 0xff] ^ 
rk
[16];

1111 
s1
 = 
Td0
[
t1
 >> 24] ^ 
Td1
[(
t0
 >> 16& 0xff] ^ 
Td2
[(
t3
 >> 8& 0xff] ^ 
Td3
[
t2
 & 0xff] ^ 
rk
[17];

1112 
s2
 = 
Td0
[
t2
 >> 24] ^ 
Td1
[(
t1
 >> 16& 0xff] ^ 
Td2
[(
t0
 >> 8& 0xff] ^ 
Td3
[
t3
 & 0xff] ^ 
rk
[18];

1113 
s3
 = 
Td0
[
t3
 >> 24] ^ 
Td1
[(
t2
 >> 16& 0xff] ^ 
Td2
[(
t1
 >> 8& 0xff] ^ 
Td3
[
t0
 & 0xff] ^ 
rk
[19];

1115 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[20];

1116 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[21];

1117 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[22];

1118 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[23];

1120 
s0
 = 
Td0
[
t0
 >> 24] ^ 
Td1
[(
t3
 >> 16& 0xff] ^ 
Td2
[(
t2
 >> 8& 0xff] ^ 
Td3
[
t1
 & 0xff] ^ 
rk
[24];

1121 
s1
 = 
Td0
[
t1
 >> 24] ^ 
Td1
[(
t0
 >> 16& 0xff] ^ 
Td2
[(
t3
 >> 8& 0xff] ^ 
Td3
[
t2
 & 0xff] ^ 
rk
[25];

1122 
s2
 = 
Td0
[
t2
 >> 24] ^ 
Td1
[(
t1
 >> 16& 0xff] ^ 
Td2
[(
t0
 >> 8& 0xff] ^ 
Td3
[
t3
 & 0xff] ^ 
rk
[26];

1123 
s3
 = 
Td0
[
t3
 >> 24] ^ 
Td1
[(
t2
 >> 16& 0xff] ^ 
Td2
[(
t1
 >> 8& 0xff] ^ 
Td3
[
t0
 & 0xff] ^ 
rk
[27];

1125 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[28];

1126 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[29];

1127 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[30];

1128 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[31];

1130 
s0
 = 
Td0
[
t0
 >> 24] ^ 
Td1
[(
t3
 >> 16& 0xff] ^ 
Td2
[(
t2
 >> 8& 0xff] ^ 
Td3
[
t1
 & 0xff] ^ 
rk
[32];

1131 
s1
 = 
Td0
[
t1
 >> 24] ^ 
Td1
[(
t0
 >> 16& 0xff] ^ 
Td2
[(
t3
 >> 8& 0xff] ^ 
Td3
[
t2
 & 0xff] ^ 
rk
[33];

1132 
s2
 = 
Td0
[
t2
 >> 24] ^ 
Td1
[(
t1
 >> 16& 0xff] ^ 
Td2
[(
t0
 >> 8& 0xff] ^ 
Td3
[
t3
 & 0xff] ^ 
rk
[34];

1133 
s3
 = 
Td0
[
t3
 >> 24] ^ 
Td1
[(
t2
 >> 16& 0xff] ^ 
Td2
[(
t1
 >> 8& 0xff] ^ 
Td3
[
t0
 & 0xff] ^ 
rk
[35];

1135 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[36];

1136 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[37];

1137 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[38];

1138 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[39];

1139 i(
Nr
 > 10) {

1141 
s0
 = 
Td0
[
t0
 >> 24] ^ 
Td1
[(
t3
 >> 16& 0xff] ^ 
Td2
[(
t2
 >> 8& 0xff] ^ 
Td3
[
t1
 & 0xff] ^ 
rk
[40];

1142 
s1
 = 
Td0
[
t1
 >> 24] ^ 
Td1
[(
t0
 >> 16& 0xff] ^ 
Td2
[(
t3
 >> 8& 0xff] ^ 
Td3
[
t2
 & 0xff] ^ 
rk
[41];

1143 
s2
 = 
Td0
[
t2
 >> 24] ^ 
Td1
[(
t1
 >> 16& 0xff] ^ 
Td2
[(
t0
 >> 8& 0xff] ^ 
Td3
[
t3
 & 0xff] ^ 
rk
[42];

1144 
s3
 = 
Td0
[
t3
 >> 24] ^ 
Td1
[(
t2
 >> 16& 0xff] ^ 
Td2
[(
t1
 >> 8& 0xff] ^ 
Td3
[
t0
 & 0xff] ^ 
rk
[43];

1146 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[44];

1147 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[45];

1148 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[46];

1149 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[47];

1150 i(
Nr
 > 12) {

1152 
s0
 = 
Td0
[
t0
 >> 24] ^ 
Td1
[(
t3
 >> 16& 0xff] ^ 
Td2
[(
t2
 >> 8& 0xff] ^ 
Td3
[
t1
 & 0xff] ^ 
rk
[48];

1153 
s1
 = 
Td0
[
t1
 >> 24] ^ 
Td1
[(
t0
 >> 16& 0xff] ^ 
Td2
[(
t3
 >> 8& 0xff] ^ 
Td3
[
t2
 & 0xff] ^ 
rk
[49];

1154 
s2
 = 
Td0
[
t2
 >> 24] ^ 
Td1
[(
t1
 >> 16& 0xff] ^ 
Td2
[(
t0
 >> 8& 0xff] ^ 
Td3
[
t3
 & 0xff] ^ 
rk
[50];

1155 
s3
 = 
Td0
[
t3
 >> 24] ^ 
Td1
[(
t2
 >> 16& 0xff] ^ 
Td2
[(
t1
 >> 8& 0xff] ^ 
Td3
[
t0
 & 0xff] ^ 
rk
[51];

1157 
t0
 = 
Td0
[
s0
 >> 24] ^ 
Td1
[(
s3
 >> 16& 0xff] ^ 
Td2
[(
s2
 >> 8& 0xff] ^ 
Td3
[
s1
 & 0xff] ^ 
rk
[52];

1158 
t1
 = 
Td0
[
s1
 >> 24] ^ 
Td1
[(
s0
 >> 16& 0xff] ^ 
Td2
[(
s3
 >> 8& 0xff] ^ 
Td3
[
s2
 & 0xff] ^ 
rk
[53];

1159 
t2
 = 
Td0
[
s2
 >> 24] ^ 
Td1
[(
s1
 >> 16& 0xff] ^ 
Td2
[(
s0
 >> 8& 0xff] ^ 
Td3
[
s3
 & 0xff] ^ 
rk
[54];

1160 
t3
 = 
Td0
[
s3
 >> 24] ^ 
Td1
[(
s2
 >> 16& 0xff] ^ 
Td2
[(
s1
 >> 8& 0xff] ^ 
Td3
[
s0
 & 0xff] ^ 
rk
[55];

1163 
rk
 +
Nr
 << 2;

1168 
r
 = 
Nr
 >> 1;

1170 
t0
 =

1171 
Td0
[(
s0
 >> 24) ] ^

1172 
Td1
[(
s3
 >> 16) & 0xff] ^

1173 
Td2
[(
s2
 >> 8) & 0xff] ^

1174 
Td3
[(
s1
 ) & 0xff] ^

1175 
rk
[4];

1176 
t1
 =

1177 
Td0
[(
s1
 >> 24) ] ^

1178 
Td1
[(
s0
 >> 16) & 0xff] ^

1179 
Td2
[(
s3
 >> 8) & 0xff] ^

1180 
Td3
[(
s2
 ) & 0xff] ^

1181 
rk
[5];

1182 
t2
 =

1183 
Td0
[(
s2
 >> 24) ] ^

1184 
Td1
[(
s1
 >> 16) & 0xff] ^

1185 
Td2
[(
s0
 >> 8) & 0xff] ^

1186 
Td3
[(
s3
 ) & 0xff] ^

1187 
rk
[6];

1188 
t3
 =

1189 
Td0
[(
s3
 >> 24) ] ^

1190 
Td1
[(
s2
 >> 16) & 0xff] ^

1191 
Td2
[(
s1
 >> 8) & 0xff] ^

1192 
Td3
[(
s0
 ) & 0xff] ^

1193 
rk
[7];

1195 
rk
 += 8;

1196 i(--
r
 == 0) {

1200 
s0
 =

1201 
Td0
[(
t0
 >> 24) ] ^

1202 
Td1
[(
t3
 >> 16) & 0xff] ^

1203 
Td2
[(
t2
 >> 8) & 0xff] ^

1204 
Td3
[(
t1
 ) & 0xff] ^

1205 
rk
[0];

1206 
s1
 =

1207 
Td0
[(
t1
 >> 24) ] ^

1208 
Td1
[(
t0
 >> 16) & 0xff] ^

1209 
Td2
[(
t3
 >> 8) & 0xff] ^

1210 
Td3
[(
t2
 ) & 0xff] ^

1211 
rk
[1];

1212 
s2
 =

1213 
Td0
[(
t2
 >> 24) ] ^

1214 
Td1
[(
t1
 >> 16) & 0xff] ^

1215 
Td2
[(
t0
 >> 8) & 0xff] ^

1216 
Td3
[(
t3
 ) & 0xff] ^

1217 
rk
[2];

1218 
s3
 =

1219 
Td0
[(
t3
 >> 24) ] ^

1220 
Td1
[(
t2
 >> 16) & 0xff] ^

1221 
Td2
[(
t1
 >> 8) & 0xff] ^

1222 
Td3
[(
t0
 ) & 0xff] ^

1223 
rk
[3];

1230 
s0
 =

1231 (
Td4
[(
t0
 >> 24) ] & 0xff000000) ^

1232 (
Td4
[(
t3
 >> 16) & 0xff] & 0x00ff0000) ^

1233 (
Td4
[(
t2
 >> 8) & 0xff] & 0x0000ff00) ^

1234 (
Td4
[(
t1
 ) & 0xff] & 0x000000ff) ^

1235 
rk
[0];

1236 
	`PUTU32
(

 , 
s0
);

1237 
s1
 =

1238 (
Td4
[(
t1
 >> 24) ] & 0xff000000) ^

1239 (
Td4
[(
t0
 >> 16) & 0xff] & 0x00ff0000) ^

1240 (
Td4
[(
t3
 >> 8) & 0xff] & 0x0000ff00) ^

1241 (
Td4
[(
t2
 ) & 0xff] & 0x000000ff) ^

1242 
rk
[1];

1243 
	`PUTU32
(

 + 4, 
s1
);

1244 
s2
 =

1245 (
Td4
[(
t2
 >> 24) ] & 0xff000000) ^

1246 (
Td4
[(
t1
 >> 16) & 0xff] & 0x00ff0000) ^

1247 (
Td4
[(
t0
 >> 8) & 0xff] & 0x0000ff00) ^

1248 (
Td4
[(
t3
 ) & 0xff] & 0x000000ff) ^

1249 
rk
[2];

1250 
	`PUTU32
(

 + 8, 
s2
);

1251 
s3
 =

1252 (
Td4
[(
t3
 >> 24) ] & 0xff000000) ^

1253 (
Td4
[(
t2
 >> 16) & 0xff] & 0x00ff0000) ^

1254 (
Td4
[(
t1
 >> 8) & 0xff] & 0x0000ff00) ^

1255 (
Td4
[(
t0
 ) & 0xff] & 0x000000ff) ^

1256 
rk
[3];

1257 
	`PUTU32
(

 + 12, 
s3
);

1258 
	}
}

1260 #ifde
INTERMEDIATE_VALUE_KAT


1268 
	$__db_rijndlEnyRound
(
rk
, 
Nr
, 

, 

)

1269 cڡ 
u32
 *
rk
;

1270 
Nr
;

1271 
u8
 *
block
;

1272 
rounds
;

1274 
r
;

1275 
u32
 
s0
, 
s1
, 
s2
, 
s3
, 
t0
, 
t1
, 
t2
, 
t3
;

1281 
s0
 = 
	`GETU32
(
block
 ) ^ 
rk
[0];

1282 
s1
 = 
	`GETU32
(
block
 + 4^ 
rk
[1];

1283 
s2
 = 
	`GETU32
(
block
 + 8^ 
rk
[2];

1284 
s3
 = 
	`GETU32
(
block
 + 12^ 
rk
[3];

1285 
rk
 += 4;

1290 
r
 = (
rounds
 < 
Nr
 ?ounds : Nr - 1); > 0;--) {

1291 
t0
 =

1292 
Te0
[(
s0
 >> 24) ] ^

1293 
Te1
[(
s1
 >> 16) & 0xff] ^

1294 
Te2
[(
s2
 >> 8) & 0xff] ^

1295 
Te3
[(
s3
 ) & 0xff] ^

1296 
rk
[0];

1297 
t1
 =

1298 
Te0
[(
s1
 >> 24) ] ^

1299 
Te1
[(
s2
 >> 16) & 0xff] ^

1300 
Te2
[(
s3
 >> 8) & 0xff] ^

1301 
Te3
[(
s0
 ) & 0xff] ^

1302 
rk
[1];

1303 
t2
 =

1304 
Te0
[(
s2
 >> 24) ] ^

1305 
Te1
[(
s3
 >> 16) & 0xff] ^

1306 
Te2
[(
s0
 >> 8) & 0xff] ^

1307 
Te3
[(
s1
 ) & 0xff] ^

1308 
rk
[2];

1309 
t3
 =

1310 
Te0
[(
s3
 >> 24) ] ^

1311 
Te1
[(
s0
 >> 16) & 0xff] ^

1312 
Te2
[(
s1
 >> 8) & 0xff] ^

1313 
Te3
[(
s2
 ) & 0xff] ^

1314 
rk
[3];

1316 
s0
 = 
t0
;

1317 
s1
 = 
t1
;

1318 
s2
 = 
t2
;

1319 
s3
 = 
t3
;

1320 
rk
 += 4;

1328 i(
rounds
 =
Nr
) {

1329 
t0
 =

1330 (
Te4
[(
s0
 >> 24) ] & 0xff000000) ^

1331 (
Te4
[(
s1
 >> 16) & 0xff] & 0x00ff0000) ^

1332 (
Te4
[(
s2
 >> 8) & 0xff] & 0x0000ff00) ^

1333 (
Te4
[(
s3
 ) & 0xff] & 0x000000ff) ^

1334 
rk
[0];

1335 
t1
 =

1336 (
Te4
[(
s1
 >> 24) ] & 0xff000000) ^

1337 (
Te4
[(
s2
 >> 16) & 0xff] & 0x00ff0000) ^

1338 (
Te4
[(
s3
 >> 8) & 0xff] & 0x0000ff00) ^

1339 (
Te4
[(
s0
 ) & 0xff] & 0x000000ff) ^

1340 
rk
[1];

1341 
t2
 =

1342 (
Te4
[(
s2
 >> 24) ] & 0xff000000) ^

1343 (
Te4
[(
s3
 >> 16) & 0xff] & 0x00ff0000) ^

1344 (
Te4
[(
s0
 >> 8) & 0xff] & 0x0000ff00) ^

1345 (
Te4
[(
s1
 ) & 0xff] & 0x000000ff) ^

1346 
rk
[2];

1347 
t3
 =

1348 (
Te4
[(
s3
 >> 24) ] & 0xff000000) ^

1349 (
Te4
[(
s0
 >> 16) & 0xff] & 0x00ff0000) ^

1350 (
Te4
[(
s1
 >> 8) & 0xff] & 0x0000ff00) ^

1351 (
Te4
[(
s2
 ) & 0xff] & 0x000000ff) ^

1352 
rk
[3];

1354 
s0
 = 
t0
;

1355 
s1
 = 
t1
;

1356 
s2
 = 
t2
;

1357 
s3
 = 
t3
;

1360 
	`PUTU32
(
block
 , 
s0
);

1361 
	`PUTU32
(
block
 + 4, 
s1
);

1362 
	`PUTU32
(
block
 + 8, 
s2
);

1363 
	`PUTU32
(
block
 + 12, 
s3
);

1364 
	}
}

1372 
	$__db_rijndlDeyRound
(
rk
, 
Nr
, 

, 

)

1373 cڡ 
u32
 *
rk
;

1374 
Nr
;

1375 
u8
 *
block
;

1376 
rounds
;

1378 
r
;

1379 
u32
 
s0
, 
s1
, 
s2
, 
s3
, 
t0
, 
t1
, 
t2
, 
t3
;

1385 
s0
 = 
	`GETU32
(
block
 ) ^ 
rk
[0];

1386 
s1
 = 
	`GETU32
(
block
 + 4^ 
rk
[1];

1387 
s2
 = 
	`GETU32
(
block
 + 8^ 
rk
[2];

1388 
s3
 = 
	`GETU32
(
block
 + 12^ 
rk
[3];

1389 
rk
 += 4;

1394 
r
 = (
rounds
 < 
Nr
 ?ounds : Nr) - 1; > 0;--) {

1395 
t0
 =

1396 
Td0
[(
s0
 >> 24) ] ^

1397 
Td1
[(
s3
 >> 16) & 0xff] ^

1398 
Td2
[(
s2
 >> 8) & 0xff] ^

1399 
Td3
[(
s1
 ) & 0xff] ^

1400 
rk
[0];

1401 
t1
 =

1402 
Td0
[(
s1
 >> 24) ] ^

1403 
Td1
[(
s0
 >> 16) & 0xff] ^

1404 
Td2
[(
s3
 >> 8) & 0xff] ^

1405 
Td3
[(
s2
 ) & 0xff] ^

1406 
rk
[1];

1407 
t2
 =

1408 
Td0
[(
s2
 >> 24) ] ^

1409 
Td1
[(
s1
 >> 16) & 0xff] ^

1410 
Td2
[(
s0
 >> 8) & 0xff] ^

1411 
Td3
[(
s3
 ) & 0xff] ^

1412 
rk
[2];

1413 
t3
 =

1414 
Td0
[(
s3
 >> 24) ] ^

1415 
Td1
[(
s2
 >> 16) & 0xff] ^

1416 
Td2
[(
s1
 >> 8) & 0xff] ^

1417 
Td3
[(
s0
 ) & 0xff] ^

1418 
rk
[3];

1420 
s0
 = 
t0
;

1421 
s1
 = 
t1
;

1422 
s2
 = 
t2
;

1423 
s3
 = 
t3
;

1424 
rk
 += 4;

1432 
t0
 =

1433 (
Td4
[(
s0
 >> 24) ] & 0xff000000) ^

1434 (
Td4
[(
s3
 >> 16) & 0xff] & 0x00ff0000) ^

1435 (
Td4
[(
s2
 >> 8) & 0xff] & 0x0000ff00) ^

1436 (
Td4
[(
s1
 ) & 0xff] & 0x000000ff);

1437 
t1
 =

1438 (
Td4
[(
s1
 >> 24) ] & 0xff000000) ^

1439 (
Td4
[(
s0
 >> 16) & 0xff] & 0x00ff0000) ^

1440 (
Td4
[(
s3
 >> 8) & 0xff] & 0x0000ff00) ^

1441 (
Td4
[(
s2
 ) & 0xff] & 0x000000ff);

1442 
t2
 =

1443 (
Td4
[(
s2
 >> 24) ] & 0xff000000) ^

1444 (
Td4
[(
s1
 >> 16) & 0xff] & 0x00ff0000) ^

1445 (
Td4
[(
s0
 >> 8) & 0xff] & 0x0000ff00) ^

1446 (
Td4
[(
s3
 ) & 0xff] & 0x000000ff);

1447 
t3
 =

1448 (
Td4
[(
s3
 >> 24) ] & 0xff000000) ^

1449 (
Td4
[(
s2
 >> 16) & 0xff] & 0x00ff0000) ^

1450 (
Td4
[(
s1
 >> 8) & 0xff] & 0x0000ff00) ^

1451 (
Td4
[(
s0
 ) & 0xff] & 0x000000ff);

1453 i(
rounds
 =
Nr
) {

1454 
t0
 ^
rk
[0];

1455 
t1
 ^
rk
[1];

1456 
t2
 ^
rk
[2];

1457 
t3
 ^
rk
[3];

1460 
	`PUTU32
(
block
 , 
t0
);

1461 
	`PUTU32
(
block
 + 4, 
t1
);

1462 
	`PUTU32
(
block
 + 8, 
t2
);

1463 
	`PUTU32
(
block
 + 12, 
t3
);

1464 
	}
}

	@../crypto/rijndael/rijndael-api-fst.c

37 
	~"db_cfig.h
"

39 
	~"db_t.h
"

40 
	~"dbc/yo.h
"

42 
	~"yo/rijndl/rijndl-g-f.h
"

43 
	~"yo/rijndl/rijndl-i-f.h
"

51 
	$__db_makeKey
(
key
, 
dei
, 
keyL
, 
keyMl
)

52 
keyIn
 *
key
;

53 
dei
;

54 
keyL
;

55 *
keyMl
;

57 
u8
 
chKey
[
MAXKB
];

59 i(
key
 =
NULL
) {

60  
BAD_KEY_INSTANCE
;

63 i((
dei
 =
DIR_ENCRYPT
|| (dei =
DIR_DECRYPT
)) {

64 
key
->
dei
 = direction;

66  
BAD_KEY_DIR
;

69 i((
keyL
 == 128) || (keyLen == 192) || (keyLen == 256)) {

70 
key
->
keyL
 = keyLen;

72  
BAD_KEY_MAT
;

75 i(
keyMl
 !
NULL
) {

76 
	`memy
(
chKey
, 
keyMl
, 
key
->
keyL
/8);

79 i(
dei
 =
DIR_ENCRYPT
) {

80 
key
->
Nr
 = 
	`__db_rijndlKeySupEnc
(key->
rk
, 
chKey
, 
keyL
);

82 
key
->
Nr
 = 
	`__db_rijndlKeySupDec
(key->
rk
, 
chKey
, 
keyL
);

84 
	`__db_rijndlKeySupEnc
(
key
->
ek
, 
chKey
, 
keyL
);

85  
TRUE
;

86 
	}
}

94 
	$__db_chIn
(
ch
, 
mode
, 
IV
)

95 
chIn
 *
ch
;

96 
mode
;

97 *
IV
;

99 i((
mode
 =
MODE_ECB
|| (mod=
MODE_CBC
|| (mod=
MODE_CFB1
)) {

100 
ch
->
mode
 = mode;

102  
BAD_CIPHER_MODE
;

104 i(
IV
 !
NULL
) {

105 
	`memy
(
ch
->
IV
, IV, 
MAX_IV_SIZE
);

107  
TRUE
;

108 
	}
}

117 
	$__db_blockEny
(
ch
, 
key
, 
put
, 
putL
, 
outBufr
)

118 
chIn
 *
ch
;

119 
keyIn
 *
key
;

120 
u_t8_t
 *
put
;

121 
size_t
 
putL
;

122 
u_t8_t
 *
outBufr
;

124 
i
, 
k
, 
t
, 
numBlocks
;

125 
u8
 
block
[16], *
iv
;

126 
u32
 
tmpiv
[4];

128 i(
ch
 =
NULL
 ||

129 
key
 =
NULL
 ||

130 
key
->
dei
 =
DIR_DECRYPT
) {

131  
BAD_CIPHER_STATE
;

133 i(
put
 =
NULL
 || 
putL
 <= 0) {

137 
numBlocks
 = ()(
putL
/128);

139 
ch
->
mode
) {

140 
MODE_ECB
:

141 
i
 = 
numBlocks
; i > 0; i--) {

142 
	`__db_rijndlEny
(
key
->
rk
, key->
Nr
, 
put
, 
outBufr
);

143 
put
 += 16;

144 
outBufr
 += 16;

148 
MODE_CBC
:

149 
iv
 = 
ch
->
IV
;

150 
i
 = 
numBlocks
; i > 0; i--) {

151 
	`memy
(
tmpiv
, 
iv
, 
MAX_IV_SIZE
);

152 ((
u32
*)
block
)[0] = ((u32*)
put
)[0] ^ 
tmpiv
[0];

153 ((
u32
*)
block
)[1] = ((u32*)
put
)[1] ^ 
tmpiv
[1];

154 ((
u32
*)
block
)[2] = ((u32*)
put
)[2] ^ 
tmpiv
[2];

155 ((
u32
*)
block
)[3] = ((u32*)
put
)[3] ^ 
tmpiv
[3];

156 
	`__db_rijndlEny
(
key
->
rk
, key->
Nr
, 
block
, 
outBufr
);

157 
iv
 = 
outBufr
;

158 
put
 += 16;

159 
outBufr
 += 16;

163 
MODE_CFB1
:

164 
iv
 = 
ch
->
IV
;

165 
i
 = 
numBlocks
; i > 0; i--) {

166 
	`memy
(
outBufr
, 
put
, 16);

167 
k
 = 0; k < 128; k++) {

168 
	`__db_rijndlEny
(
key
->
ek
, key->
Nr
, 
iv
, 
block
);

169 
outBufr
[
k
 >> 3] ^(
block
[0] & (
u_t
)0x80) >> (k & 7);

170 
t
 = 0; < 15;++) {

171 
iv
[
t
] = (iv[t] << 1) | (iv[t + 1] >> 7);

173 
iv
[15] = (iv[15] << 1| ((
outBufr
[
k
 >> 3] >> (7 - (k & 7))) & 1);

175 
outBufr
 += 16;

176 
put
 += 16;

181  
BAD_CIPHER_STATE
;

184  128*
numBlocks
;

185 
	}
}

203 
	$__db_dEny
(
ch
, 
key
, 
put
, 
putOs
, 
outBufr
)

204 
chIn
 *
ch
;

205 
keyIn
 *
key
;

206 
u_t8_t
 *
put
;

207 
putOs
;

208 
u_t8_t
 *
outBufr
;

210 
i
, 
numBlocks
, 
dL
;

211 
u8
 
block
[16], *
iv
;

212 
u32
 
tmpiv
[4];

214 i(
ch
 =
NULL
 ||

215 
key
 =
NULL
 ||

216 
key
->
dei
 =
DIR_DECRYPT
) {

217  
BAD_CIPHER_STATE
;

219 i(
put
 =
NULL
 || 
putOs
 <= 0) {

223 
numBlocks
 = 
putOs
/16;

225 
ch
->
mode
) {

226 
MODE_ECB
:

227 
i
 = 
numBlocks
; i > 0; i--) {

228 
	`__db_rijndlEny
(
key
->
rk
, key->
Nr
, 
put
, 
outBufr
);

229 
put
 += 16;

230 
outBufr
 += 16;

232 
dL
 = 16 - (
putOs
 - 16*
numBlocks
);

233 
	`DB_ASSERT
(
NULL
, 
dL
 > 0 &&adLen <= 16);

234 
	`memy
(
block
, 
put
, 16 - 
dL
);

235 
	`memt
(
block
 + 16 - 
dL
,adLen,adLen);

236 
	`__db_rijndlEny
(
key
->
rk
, key->
Nr
, 
block
, 
outBufr
);

239 
MODE_CBC
:

240 
iv
 = 
ch
->
IV
;

241 
i
 = 
numBlocks
; i > 0; i--) {

242 
	`memy
(
tmpiv
, 
iv
, 
MAX_IV_SIZE
);

243 ((
u32
*)
block
)[0] = ((u32*)
put
)[0] ^ 
tmpiv
[0];

244 ((
u32
*)
block
)[1] = ((u32*)
put
)[1] ^ 
tmpiv
[1];

245 ((
u32
*)
block
)[2] = ((u32*)
put
)[2] ^ 
tmpiv
[2];

246 ((
u32
*)
block
)[3] = ((u32*)
put
)[3] ^ 
tmpiv
[3];

247 
	`__db_rijndlEny
(
key
->
rk
, key->
Nr
, 
block
, 
outBufr
);

248 
iv
 = 
outBufr
;

249 
put
 += 16;

250 
outBufr
 += 16;

252 
dL
 = 16 - (
putOs
 - 16*
numBlocks
);

253 
	`DB_ASSERT
(
NULL
, 
dL
 > 0 &&adLen <= 16);

254 
i
 = 0; i < 16 - 
dL
; i++) {

255 
block
[
i
] = 
put
[i] ^ 
iv
[i];

257 
i
 = 16 - 
dL
; i < 16; i++) {

258 
block
[
i
] = (
u_t8_t
)
dL
 ^ 
iv
[i];

260 
	`__db_rijndlEny
(
key
->
rk
, key->
Nr
, 
block
, 
outBufr
);

264  
BAD_CIPHER_STATE
;

267  16*(
numBlocks
 + 1);

268 
	}
}

277 
	$__db_blockDey
(
ch
, 
key
, 
put
, 
putL
, 
outBufr
)

278 
chIn
 *
ch
;

279 
keyIn
 *
key
;

280 
u_t8_t
 *
put
;

281 
size_t
 
putL
;

282 
u_t8_t
 *
outBufr
;

284 
i
, 
k
, 
t
, 
numBlocks
;

285 
u8
 
block
[16], *
iv
;

286 
u32
 
tmpiv
[4];

288 i(
ch
 =
NULL
 ||

289 
key
 =
NULL
 ||

290 (
ch
->
mode
 !
MODE_CFB1
 && 
key
->
dei
 =
DIR_ENCRYPT
)) {

291  
BAD_CIPHER_STATE
;

293 i(
put
 =
NULL
 || 
putL
 <= 0) {

297 
numBlocks
 = ()(
putL
/128);

299 
ch
->
mode
) {

300 
MODE_ECB
:

301 
i
 = 
numBlocks
; i > 0; i--) {

302 
	`__db_rijndlDey
(
key
->
rk
, key->
Nr
, 
put
, 
outBufr
);

303 
put
 += 16;

304 
outBufr
 += 16;

308 
MODE_CBC
:

309 
	`memy
(
tmpiv
, 
ch
->
IV
, 
MAX_IV_SIZE
);

310 
i
 = 
numBlocks
; i > 0; i--) {

311 
	`__db_rijndlDey
(
key
->
rk
, key->
Nr
, 
put
, 
block
);

312 ((
u32
*)
block
)[0] ^
tmpiv
[0];

313 ((
u32
*)
block
)[1] ^
tmpiv
[1];

314 ((
u32
*)
block
)[2] ^
tmpiv
[2];

315 ((
u32
*)
block
)[3] ^
tmpiv
[3];

316 
	`memy
(
tmpiv
, 
put
, 16);

317 
	`memy
(
outBufr
, 
block
, 16);

318 
put
 += 16;

319 
outBufr
 += 16;

323 
MODE_CFB1
:

324 
iv
 = 
ch
->
IV
;

325 
i
 = 
numBlocks
; i > 0; i--) {

326 
	`memy
(
outBufr
, 
put
, 16);

327 
k
 = 0; k < 128; k++) {

328 
	`__db_rijndlEny
(
key
->
ek
, key->
Nr
, 
iv
, 
block
);

329 
t
 = 0; < 15;++) {

330 
iv
[
t
] = (iv[t] << 1) | (iv[t + 1] >> 7);

332 
iv
[15] = (iv[15] << 1| ((
put
[
k
 >> 3] >> (7 - (k & 7))) & 1);

333 
outBufr
[
k
 >> 3] ^(
block
[0] & (
u_t
)0x80) >> (k & 7);

335 
outBufr
 += 16;

336 
put
 += 16;

341  
BAD_CIPHER_STATE
;

344  128*
numBlocks
;

345 
	}
}

354 
	$__db_dDey
(
ch
, 
key
, 
put
, 
putOs
, 
outBufr
)

355 
chIn
 *
ch
;

356 
keyIn
 *
key
;

357 
u_t8_t
 *
put
;

358 
putOs
;

359 
u_t8_t
 *
outBufr
;

361 
i
, 
numBlocks
, 
dL
;

362 
u8
 
block
[16];

363 
u32
 
tmpiv
[4];

365 i(
ch
 =
NULL
 ||

366 
key
 =
NULL
 ||

367 
key
->
dei
 =
DIR_ENCRYPT
) {

368  
BAD_CIPHER_STATE
;

370 i(
put
 =
NULL
 || 
putOs
 <= 0) {

373 i(
putOs
 % 16 != 0) {

374  
BAD_DATA
;

377 
numBlocks
 = 
putOs
/16;

379 
ch
->
mode
) {

380 
MODE_ECB
:

382 
i
 = 
numBlocks
 - 1; i > 0; i--) {

383 
	`__db_rijndlDey
(
key
->
rk
, key->
Nr
, 
put
, 
outBufr
);

384 
put
 += 16;

385 
outBufr
 += 16;

388 
	`__db_rijndlDey
(
key
->
rk
, key->
Nr
, 
put
, 
block
);

389 
dL
 = 
block
[15];

390 i(
dL
 >= 16) {

391  
BAD_DATA
;

393 
i
 = 16 - 
dL
; i < 16; i++) {

394 i(
block
[
i
] !
dL
) {

395  
BAD_DATA
;

398 
	`memy
(
outBufr
, 
block
, 16 - 
dL
);

401 
MODE_CBC
:

403 
	`memy
(
tmpiv
, 
ch
->
IV
, 
MAX_IV_SIZE
);

404 
i
 = 
numBlocks
 - 1; i > 0; i--) {

405 
	`__db_rijndlDey
(
key
->
rk
, key->
Nr
, 
put
, 
block
);

406 ((
u32
*)
block
)[0] ^
tmpiv
[0];

407 ((
u32
*)
block
)[1] ^
tmpiv
[1];

408 ((
u32
*)
block
)[2] ^
tmpiv
[2];

409 ((
u32
*)
block
)[3] ^
tmpiv
[3];

410 
	`memy
(
tmpiv
, 
put
, 16);

411 
	`memy
(
outBufr
, 
block
, 16);

412 
put
 += 16;

413 
outBufr
 += 16;

416 
	`__db_rijndlDey
(
key
->
rk
, key->
Nr
, 
put
, 
block
);

417 ((
u32
*)
block
)[0] ^
tmpiv
[0];

418 ((
u32
*)
block
)[1] ^
tmpiv
[1];

419 ((
u32
*)
block
)[2] ^
tmpiv
[2];

420 ((
u32
*)
block
)[3] ^
tmpiv
[3];

421 
dL
 = 
block
[15];

422 i(
dL
 <= 0 ||adLen > 16) {

423  
BAD_DATA
;

425 
i
 = 16 - 
dL
; i < 16; i++) {

426 i(
block
[
i
] !
dL
) {

427  
BAD_DATA
;

430 
	`memy
(
outBufr
, 
block
, 16 - 
dL
);

434  
BAD_CIPHER_STATE
;

437  16*
numBlocks
 - 
dL
;

438 
	}
}

440 #ifde
INTERMEDIATE_VALUE_KAT


458 
	$__db_chUpdeRounds
(
ch
, 
key
, 
put
, 
putL
, 
outBufr
, 
rounds
)

459 
chIn
 *
ch
;

460 
keyIn
 *
key
;

461 
u_t8_t
 *
put
;

462 
size_t
 
putL
;

463 
u_t8_t
 *
outBufr
;

464 
rounds
;

466 
u8
 
block
[16];

468 i(
ch
 =
NULL
 || 
key
 == NULL) {

469  
BAD_CIPHER_STATE
;

472 
	`memy
(
block
, 
put
, 16);

474 
key
->
dei
) {

475 
DIR_ENCRYPT
:

476 
	`__db_rijndlEnyRound
(
key
->
rk
, key->
Nr
, 
block
, 
rounds
);

479 
DIR_DECRYPT
:

480 
	`__db_rijndlDeyRound
(
key
->
rk
, key->
Nr
, 
block
, 
rounds
);

484  
BAD_KEY_DIR
;

487 
	`memy
(
outBufr
, 
block
, 16);

489  
TRUE
;

490 
	}
}

	@../cxx/cxx_db.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 
	~"dbc/db_ge.h
"

17 
	~"dbc_auto/db_auto.h
"

18 
	~"dbc_auto/d_auto.h
"

19 
	~"dbc/db_dich.h
"

20 
	~"dbc_auto/db_ext.h
"

21 
	~"dbc_auto/comm_ext.h
"

29 
	#DB_METHOD
(
_me
, 
_gec
, 
_gli
, 
_tok
) \

30 
Db
::
_me
 
_gec
 \

32 
t
; \

33 
DB
 *
db
 = 
	`unwp
(
this
); \

35 
t
 = 
db
->
_me
 
_gli
; \

36 i(!
	`_tok
(
t
)) \

37 
	`DB_ERROR
(
v_
, "Db::" #_me, 
t
, 
	`r_picy
()); \

38  (
t
); \

39 }

	)

41 
	#DB_DESTRUCTOR
(
_me
, 
_gec
, 
_gli
, 
_tok
) \

42 
Db
::
_me
 
_gec
 \

44 
t
; \

45 
DB
 *
db
 = 
	`unwp
(
this
); \

47 i(!
db
) { \

48 
	`DB_ERROR
(
v_
, "Db::" #_me, 
EINVAL
, 
	`r_picy
()); \

49  (
EINVAL
); \

51 
t
 = 
db
->
_me
 
_gli
; \

52 
	`nup
(); \

53 i(!
	`_tok
(
t
)) \

54 
	`DB_ERROR
(
v_
, "Db::" #_me, 
t
, 
	`r_picy
()); \

55  (
t
); \

56 }

	)

58 
	#DB_METHOD_QUIET
(
_me
, 
_gec
, 
_gli
) \

59 
Db
::
_me
 
_gec
 \

61 
DB
 *
db
 = 
	`unwp
(
this
); \

63  (
db
->
_me
 
_gli
); \

64 }

	)

66 
	#DB_METHOD_VOID
(
_me
, 
_gec
, 
_gli
) \

67 
Db
::
_me
 
_gec
 \

69 
DB
 *
db
 = 
	`unwp
(
this
); \

71 
db
->
_me
 
_gli
; \

72 }

	)

86 
	gDb
::
	$Db
(
DbEnv
 *
v
, 
u_t32_t
 
ags
)

87 : 
	`imp_
(0)

88 , 
	`v_
(
v
)

89 , 
	`mpf_
(0)

90 , 
	`cڡru_r_
(0)

91 , 
	`ags_
(0)

92 , 
	`cڡru_ags_
(
ags
)

93 , 
	`nd_o_back_
(0)

94 , 
	`assoc_back_
(0)

95 , 
	`bt_com_back_
(0)

96 , 
	`bt_efix_back_
(0)

97 , 
	`dup_com_back_
(0)

98 , 
	`edback_back_
(0)

99 , 
	`h_com_back_
(0)

100 , 
	$h_hash_back_
(0)

102 i(
v_
 == 0)

103 
ags_
 |
DB_CXX_PRIVATE_ENV
;

105 i((
cڡru_r_
 = 
	`lize
()) != 0)

106 
	`DB_ERROR
(
v_
, "Db::Db", 
cڡru_r_
, 
	`r_picy
());

107 
	}
}

116 
	gDb
::~
	$Db
()

118 
DB
 *
db
;

120 
db
 = 
	`unwp
(
this
);

121 i(
db
 !
NULL
) {

122 ()
db
->
	`o
(db, 0);

123 
	`nup
();

125 
	}
}

131 
	gDb
::
	$lize
()

133 
DB
 *
db
;

134 
DB_ENV
 *
nv
 = 
	`unwp
(
v_
);

135 
t
;

136 
u_t32_t
 
cxx_ags
;

138 
cxx_ags
 = 
cڡru_ags_
 & 
DB_CXX_NO_EXCEPTIONS
;

144 i((
t
 = 
	`db_
(&
db
, 
nv
,

145 
cڡru_ags_
 & ~
cxx_ags
)) != 0)

146  (
t
);

149 
imp_
 = 
db
;

150 
db
->
i_
 = 
this
;

155 i((
ags_
 & 
DB_CXX_PRIVATE_ENV
) != 0)

156 
v_
 = 
w
 
	`DbEnv
(
db
->
dbv
, 
cxx_ags
);

159 
mpf_
 = 
w
 
	`DbMpoFe
();

160 
mpf_
->
imp_
 = 
db
->
mpf
;

163 
	}
}

168 
	gDb
::
	$nup
()

170 i(
imp_
 != 0) {

171 
imp_
 = 0;

179 i((
ags_
 & 
DB_CXX_PRIVATE_ENV
) != 0) {

180 
v_
->
	`nup
();

181 
de
 
v_
;

182 
v_
 = 0;

185 
de
 
mpf_
;

187 
	}
}

195 
	gDb
::
	$r_picy
()

197 i(
v_
 !
NULL
)

198  (
v_
->
	`r_picy
());

205 i((
cڡru_ags_
 & 
DB_CXX_NO_EXCEPTIONS
) != 0) {

206  (
ON_ERROR_RETURN
);

209  (
ON_ERROR_THROW
);

212 
	}
}

214 
DB_DESTRUCTOR
(
o
, (
u_t32_t
 
ags
), (
db
, fgs), 
DB_RETOK_STD
)

215 
DB_METHOD
(
com
, (
DbTxn
 *
txnid
, 
Dbt
 *
t
, Db*

,

216 
DB_COMPACT
 *
c_da
, 
u_t32_t
 
ags
, 
Dbt
 *
d
),

217 (
db
, 
unwp
(
txnid
), 
t
, 

, 
c_da
, 
ags
, 
d
), 
DB_RETOK_STD
)

220 
DB_METHOD
(
curs
, (
DbTxn
 *
txnid
, 
Dbc
 **
cursp
, 
u_t32_t
 
ags
),

221 (
db
, 
unwp
(
txnid
), (
DBC
 **)
cursp
, 
ags
),

222 
DB_RETOK_STD
)

224 
DB_METHOD
(
d
, (
DbTxn
 *
txnid
, 
Dbt
 *
key
, 
u_t32_t
 
ags
),

225 (
db
, 
unwp
(
txnid
), 
key
, 
ags
),

226 
DB_RETOK_DBDEL
)

228 
	gDb
::
	$r
(
r
, cڡ *
fm
, ...)

230 
DB
 *
db
 = 
	`unwp
(
this
);

232 
	`DB_REAL_ERR
(
db
->
dbv
, 
r
, 
DB_ERROR_SET
, 1, 
fm
);

233 
	}
}

235 
	gDb
::
	$rx
(cڡ *
fm
, ...)

237 
DB
 *
db
 = 
	`unwp
(
this
);

239 
	`DB_REAL_ERR
(
db
->
dbv
, 0, 
DB_ERROR_NOT_SET
, 1, 
fm
);

240 
	}
}

242 
DB_METHOD
(
exis
, (
DbTxn
 *
txnid
, 
Dbt
 *
key
, 
u_t32_t
 
ags
),

243 (
db
, 
unwp
(
txnid
), 
key
, 
ags
), 
DB_RETOK_EXISTS
)

245 
DB_METHOD
(
fd
, (*
fdp
), (
db
, fdp), 
DB_RETOK_STD
)

247 
	gDb
::
	$g
(
DbTxn
 *
txnid
, 
Dbt
 *
key
, Db*
vue
, 
u_t32_t
 
ags
)

249 
DB
 *
db
 = 
	`unwp
(
this
);

250 
t
;

252 
t
 = 
db
->
	`g
(db, 
	`unwp
(
txnid
), 
key
, 
vue
, 
ags
);

254 i(!
	`DB_RETOK_DBGET
(
t
)) {

255 i(
t
 =
DB_BUFFER_SMALL
)

256 
	`DB_ERROR_DBT
(
v_
, "Db::g", 
vue
, 
	`r_picy
());

258 
	`DB_ERROR
(
v_
, "Db::g", 
t
, 
	`r_picy
());

261  (
t
);

262 
	}
}

264 
	gDb
::
	$g_byswd
(*
isswd
)

266 
DB
 *
db
 = (DB *)
	`unwpCڡ
(
this
);

267  (
db
->
	`g_byswd
(db, 
isswd
));

268 
	}
}

270 
DbEnv
 *
	gDb
::
	$g_v
()

272 
DB
 *
db
 = (DB *)
	`unwpCڡ
(
this
);

273 
DB_ENV
 *
dbv
 = 
db
->
	`g_v
(db);

274  (
dbv
 !
NULL
 ? 
DbEnv
::
	`g_DbEnv
(dbenv) : NULL);

275 
	}
}

277 
DbMpoFe
 *
	gDb
::
	$g_mpf
()

279  (
mpf_
);

280 
	}
}

282 
DB_METHOD
(
g_dbme
, (cڡ **
fam
, cڡ **
dbm
),

283 (
db
, 
fam
, 
dbm
), 
DB_RETOK_STD
)

285 
DB_METHOD
(
g_ݒ_ags
, (
u_t32_t
 *
ag
), (
db
, fg), 
DB_RETOK_STD
)

287 
	gDb
::
	$g_ty
(
DBTYPE
 *
dbty
)

289 
DB
 *
db
 = (DB *)
	`unwpCڡ
(
this
);

290  (
db
->
	`g_ty
(db, 
dbty
));

291 
	}
}

296 
DB_METHOD
(
jo
, (
Dbc
 **
curi
, Db**
cursp
, 
u_t32_t
 
ags
),

297 (
db
, (
DBC
 **)
curi
, (DBC **)
cursp
, 
ags
), 
DB_RETOK_STD
)

299 
DB_METHOD
(
key_nge
,

300 (
DbTxn
 *
txnid
, 
Dbt
 *
key
, 
DB_KEY_RANGE
 *
sus
, 
u_t32_t
 
ags
),

301 (
db
, 
unwp
(
txnid
), 
key
, 
sus
, 
ags
), 
DB_RETOK_STD
)

306 
	gDb
::
	$ݒ
(
DbTxn
 *
txnid
, cڡ *
fe
, cڡ *
daba
,

307 
DBTYPE
 
ty
, 
u_t32_t
 
ags
, 
mode
)

309 
t
;

310 
DB
 *
db
 = 
	`unwp
(
this
);

312 i(
cڡru_r_
 != 0)

313 
t
 = 
cڡru_r_
;

315 
t
 = 
db
->
	`ݒ
(db, 
	`unwp
(
txnid
), 
fe
, 
daba
, 
ty
, 
ags
,

316 
mode
);

318 i(!
	`DB_RETOK_STD
(
t
))

319 
	`DB_ERROR
(
v_
, "Db::ݒ", 
t
, 
	`r_picy
());

321  (
t
);

322 
	}
}

324 
	gDb
::
	$pg
(
DbTxn
 *
txnid
, 
Dbt
 *
key
, Db*
pkey
, Db*
vue
, 
u_t32_t
 
ags
)

326 
DB
 *
db
 = 
	`unwp
(
this
);

327 
t
;

329 
t
 = 
db
->
	`pg
(db, 
	`unwp
(
txnid
), 
key
, 
pkey
, 
vue
, 
ags
);

332 i(!
	`DB_RETOK_DBGET
(
t
)) {

333 i(
t
 =
DB_BUFFER_SMALL
 && 
	`DB_OVERFLOWED_DBT
(
vue
))

334 
	`DB_ERROR_DBT
(
v_
, "Db::pg", 
vue
, 
	`r_picy
());

336 
	`DB_ERROR
(
v_
, "Db::pg", 
t
, 
	`r_picy
());

339  (
t
);

340 
	}
}

342 
DB_METHOD
(
put
, (
DbTxn
 *
txnid
, 
Dbt
 *
key
, Db*
vue
, 
u_t32_t
 
ags
),

343 (
db
, 
unwp
(
txnid
), 
key
, 
vue
, 
ags
), 
DB_RETOK_DBPUT
)

345 
DB_DESTRUCTOR
(
me
,

346 (cڡ *
fe
, cڡ *
daba
, cڡ *
wme
,

347 
u_t32_t
 
ags
),

348 (
db
, 
fe
, 
daba
, 
wme
, 
ags
), 
DB_RETOK_STD
)

350 
DB_DESTRUCTOR
(
move
, (cڡ *
fe
, cڡ *
daba
, 
u_t32_t
 
ags
),

351 (
db
, 
fe
, 
daba
, 
ags
), 
DB_RETOK_STD
)

353 
DB_METHOD
(
un
, (
DbTxn
 *
txnid
, 
u_t32_t
 *
coup
, u_t32_
ags
),

354 (
db
, 
unwp
(
txnid
), 
coup
, 
ags
), 
DB_RETOK_STD
)

356 
DB_METHOD
(

, (
DbTxn
 *
txnid
, *

, 
u_t32_t
 
ags
),

357 (
db
, 
unwp
(
txnid
), 

, 
ags
), 
DB_RETOK_STD
)

359 
DB_METHOD
(
_t
, (
u_t32_t
 
ags
), (
db
, fgs), 
DB_RETOK_STD
)

361 
DB_METHOD
(
sync
, (
u_t32_t
 
ags
), (
db
, fgs), 
DB_RETOK_STD
)

363 
DB_METHOD
(
upgde
,

364 (cڡ *
me
, 
u_t32_t
 
ags
), (
db
,ame, fgs), 
DB_RETOK_STD
)

401 
	#DB_CALLBACK_C_INTERCEPT
(
_me
, 
_y
, 
_rgec
, \

402 
_tu
, 
_cxxgs
) \

403 
"C" 
_y
 
_db_
##
_me
##
_r_c
 
_rgec
 \

405 
Db
 *
cxxthis
; \

408 
	`DB_ASSERT
(
NULL
, 
his
 != NULL); \

409 
cxxthis
 = 
Db
::
	`g_Db
(
his
); \

410 
	`DB_ASSERT
(
his
->
dbv
, 
cxxthis
 !
NULL
); \

411 
	`DB_ASSERT
(
his
->
dbv
, 
cxxthis
->
_me
##
_back_
 != 0); \

413 
	`_tu
 (*
cxxthis
->
_me
##
_back_

_cxxgs
; \

414 }

	)

416 
	#DB_SET_CALLBACK
(
_cxxme
, 
_me
, 
_cxxgec
, 
_cb
) \

417 
Db
::
_cxxme
 
_cxxgec
 \

419 
DB
 *
his
 = 
	`unwp
(
this
); \

421 
_me
##
_back_
 = 
_cb
; \

422  ((*(
his
->
_cxxme
))(cthis, \

423 (
_cb
? 
_db_
##
_me
##
_r_c
 : 
NULL
)); \

424 }

	)

427 
DB_CALLBACK_C_INTERCEPT
(
assoc
,

428 , (
DB
 *
his
, cڡ 
DBT
 *
key
, cڡ DBT *
da
, DBT *
tv
),

429 , (
cxxthis
, 
Dbt
::
g_cڡ_Dbt
(
key
), Dbt::g_cڡ_Dbt(
da
),

430 
Dbt
::
	$g_Dbt
(
tv
)))

432 
Db
::
	`assoc
(
DbTxn
 *
txn
, Db *
cdy
, (*
back
)(Db *, cڡ 
Dbt
 *,

433 cڡ 
Dbt
 *, Db*), 
u_t32_t
 
ags
)

435 
DB
 *
his
 = 
	`unwp
(
this
);

441 
cdy
->
assoc_back_
 = 
back
;

442  ((*(
his
->
assoc
))(his, 
	`unwp
(
txn
), unwp(
cdy
),

443 (
back
? 
_db_assoc_r_c
 : 
NULL
, 
ags
));

444 
	}
}

446 
DB_CALLBACK_C_INTERCEPT
(
edback
,

447 , (
DB
 *
his
, 
code
, 
p
),

448  (), (
cxxthis
, 
code
, 
p
))

450 
DB_SET_CALLBACK
(
t_edback
, 
edback
,

451 ((*
g
)(
Db
 *
cxxthis
, 
code
, 
p
)),rg)

453 
	`DB_CALLBACK_C_INTERCEPT
(
nd_o
,

454 , (
DB
 *
his
, 
DBT
 *
da
, 
db_o_t
 
o
),

455 , (
cxxthis
, 
Dbt
::
	`g_Dbt
(
da
), 
o
))

457 
	`DB_SET_CALLBACK
(
t_nd_o
, 
nd_o
,

458 ((*
g
)(
Db
 *
cxxthis
, 
Dbt
 *
da
, 
db_o_t
 
o
)),rg)

460 
	`DB_CALLBACK_C_INTERCEPT
(
bt_com
,

461 , (
DB
 *
his
, cڡ 
DBT
 *
da1
, cڡ DBT *
da2
),

463 (
cxxthis
, 
Dbt
::
	`g_cڡ_Dbt
(
da1
), Dbt::
	$g_cڡ_Dbt
(
da2
)))

465 
	`DB_SET_CALLBACK
(
t_bt_com
, 
bt_com
,

466 ((*
g
)(
Db
 *
cxxthis
, cڡ 
Dbt
 *
da1
, cڡ Db*
da2
)),rg)

468 
	`DB_CALLBACK_C_INTERCEPT
(
bt_efix
,

469 
size_t
, (
DB
 *
his
, cڡ 
DBT
 *
da1
, cڡ DBT *
da2
),

471 (
cxxthis
, 
Dbt
::
	`g_cڡ_Dbt
(
da1
), Dbt::
	$g_cڡ_Dbt
(
da2
)))

473 
	`DB_SET_CALLBACK
(
t_bt_efix
, 
bt_efix
,

474 (
	$size_t
 (*
g
)(
Db
 *
cxxthis
, cڡ 
Dbt
 *
da1
, cڡ Db*
da2
)),rg)

476 
	`DB_CALLBACK_C_INTERCEPT
(
dup_com
,

477 , (
DB
 *
his
, cڡ 
DBT
 *
da1
, cڡ DBT *
da2
),

479 (
cxxthis
, 
Dbt
::
	`g_cڡ_Dbt
(
da1
), Dbt::
	$g_cڡ_Dbt
(
da2
)))

481 
	`DB_SET_CALLBACK
(
t_dup_com
, 
dup_com
,

482 ((*
g
)(
Db
 *
cxxthis
, cڡ 
Dbt
 *
da1
, cڡ Db*
da2
)),rg)

484 
	`DB_CALLBACK_C_INTERCEPT
(
h_com
,

485 , (
DB
 *
his
, cڡ 
DBT
 *
da1
, cڡ DBT *
da2
),

487 (
cxxthis
, 
Dbt
::
	`g_cڡ_Dbt
(
da1
), Dbt::
	$g_cڡ_Dbt
(
da2
)))

489 
	`DB_SET_CALLBACK
(
t_h_com
, 
h_com
,

490 ((*
g
)(
Db
 *
cxxthis
, cڡ 
Dbt
 *
da1
, cڡ Db*
da2
)),rg)

492 
	`DB_CALLBACK_C_INTERCEPT
(
h_hash
,

493 
u_t32_t
, (
DB
 *
his
, cڡ *
da
, u_t32_
n
),

494 , (
cxxthis
, 
da
, 
n
))

496 
	`DB_SET_CALLBACK
(
t_h_hash
, 
h_hash
,

497 (
	$u_t32_t
 (*
g
)(
Db
 *
cxxthis
, cڡ *
da
, 
u_t32_t
 
n
)),rg)

505 
	$_vify_back_c
(*
hd
, cڡ *
r_g
)

507 *
r
;

508 
	`__DB_STD
(
oam
*
out
;

510 
r
 = (*)
r_g
;

511 
out
 = (
	`__DB_STD
(
oam
*)
hd
;

513 (*
out
<< 
r
;

514 i(
out
->
	`
())

515  (
EIO
);

518 
	}
}

520 
Db
::
vify
(cڡ *
me
, cڡ *
subdb
,

521 
__DB_STD
(
oam
*
or
, 
u_t32_t
 
ags
)

523 
DB
 *
db
 = 
unwp
(
this
);

524 
t
;

526 i(!
db
)

527 
t
 = 
EINVAL
;

529 
t
 = 
__db_vify_
(
db
, 
me
, 
subdb
, 
or
,

530 
_vify_back_c
, 
ags
);

535 
nup
();

538 i(!
DB_RETOK_STD
(
t
))

539 
DB_ERROR
(
v_
, "Db::vify", 
t
, 
r_picy
());

541  (
t
);

544 
DB_METHOD
(
t_bt_com
, (
bt_com_f_ty
 
func
),

545 (
db
, 
func
), 
DB_RETOK_STD
)

546 
DB_METHOD
(
g_bt_mkey
, (
u_t32_t
 *
bt_mkeyp
),

547 (
db
, 
bt_mkeyp
), 
DB_RETOK_STD
)

548 
DB_METHOD
(
t_bt_mkey
, (
u_t32_t
 
bt_mkey
),

549 (
db
, 
bt_mkey
), 
DB_RETOK_STD
)

550 
DB_METHOD
(
t_bt_efix
, (
bt_efix_f_ty
 
func
),

551 (
db
, 
func
), 
DB_RETOK_STD
)

552 
DB_METHOD
(
t_dup_com
, (
dup_com_f_ty
 
func
),

553 (
db
, 
func
), 
DB_RETOK_STD
)

554 
DB_METHOD
(
g_y_ags
, (
u_t32_t
 *
ag
),

555 (
db
, 
ag
), 
DB_RETOK_STD
)

556 
DB_METHOD
(
t_y
, (cڡ *
sswd
, 
u_t32_t
 
ags
),

557 (
db
, 
sswd
, 
ags
), 
DB_RETOK_STD
)

558 
DB_METHOD_VOID
(
g_rfe
, (
FILE
 **
rf
), (
db
,rrfilep))

559 
DB_METHOD_VOID
(
t_rfe
, (
FILE
 *
rfe
), (
db
,rrfile))

560 
DB_METHOD_VOID
(
g_fx
, (cڡ **
fx
), (
db
,rrpfx))

561 
DB_METHOD_VOID
(
t_fx
, (cڡ *
fx
), (
db
,rrpfx))

562 
DB_METHOD
(
g_ags
, (
u_t32_t
 *
ag
), (
db
, flagsp),

563 
DB_RETOK_STD
)

564 
DB_METHOD
(
t_ags
, (
u_t32_t
 
ags
), (
db
, flags),

565 
DB_RETOK_STD
)

566 
DB_METHOD
(
t_h_com
, (
h_com_f_ty
 
func
),

567 (
db
, 
func
), 
DB_RETOK_STD
)

568 
DB_METHOD
(
g_h_f
, (
u_t32_t
 *
h_fp
),

569 (
db
, 
h_fp
), 
DB_RETOK_STD
)

570 
DB_METHOD
(
t_h_f
, (
u_t32_t
 
h_f
),

571 (
db
, 
h_f
), 
DB_RETOK_STD
)

572 
DB_METHOD
(
t_h_hash
, (
h_hash_f_ty
 
func
),

573 (
db
, 
func
), 
DB_RETOK_STD
)

574 
DB_METHOD
(
g_h_m
, (
u_t32_t
 *
h_mp
),

575 (
db
, 
h_mp
), 
DB_RETOK_STD
)

576 
DB_METHOD
(
t_h_m
, (
u_t32_t
 
h_m
),

577 (
db
, 
h_m
), 
DB_RETOK_STD
)

578 
DB_METHOD
(
g_ld
, (*
db_ldp
), (
db
, db_lorderp),

579 
DB_RETOK_STD
)

580 
DB_METHOD
(
t_ld
, (
db_ld
), (
db
, db_lorder),

581 
DB_RETOK_STD
)

582 
DB_METHOD_VOID
(
g_msgfe
, (
FILE
 **
msgf
), (
db
, msgfilep))

583 
DB_METHOD_VOID
(
t_msgfe
, (
FILE
 *
msgfe
), (
db
, msgfile))

584 
DB_METHOD_QUIET
(
g_muɝ
, (), (
db
))

585 
DB_METHOD
(
g_gesize
, (
u_t32_t
 *
db_gesiz
),

586 (
db
, 
db_gesiz
), 
DB_RETOK_STD
)

587 
DB_METHOD
(
t_gesize
, (
u_t32_t
 
db_gesize
),

588 (
db
, 
db_gesize
), 
DB_RETOK_STD
)

589 
DB_METHOD
(
g_iܙy
, (
DB_CACHE_PRIORITY
 *
iܙyp
),

590 (
db
, 
iܙyp
), 
DB_RETOK_STD
)

591 
DB_METHOD
(
t_iܙy
, (
DB_CACHE_PRIORITY
 
iܙy
),

592 (
db
, 
iܙy
), 
DB_RETOK_STD
)

593 
DB_METHOD
(
g__dim
, (*
_dimp
),

594 (
db
, 
_dimp
), 
DB_RETOK_STD
)

595 
DB_METHOD
(
t__dim
, (
_dim
),

596 (
db
, 
_dim
), 
DB_RETOK_STD
)

597 
DB_METHOD
(
g__n
, (
u_t32_t
 *
_
),

598 (
db
, 
_
), 
DB_RETOK_STD
)

599 
DB_METHOD
(
t__n
, (
u_t32_t
 
_n
),

600 (
db
, 
_n
), 
DB_RETOK_STD
)

601 
DB_METHOD
(
g__d
, (*
_dp
),

602 (
db
, 
_dp
), 
DB_RETOK_STD
)

603 
DB_METHOD
(
t__d
, (
_d
),

604 (
db
, 
_d
), 
DB_RETOK_STD
)

605 
DB_METHOD
(
g__sour
, (cڡ **
_sour
),

606 (
db
, 
_sour
), 
DB_RETOK_STD
)

607 
DB_METHOD
(
t__sour
, (cڡ *
_sour
),

608 (
db
, 
_sour
), 
DB_RETOK_STD
)

609 
DB_METHOD
(
g_q_exsize
, (
u_t32_t
 *
exsiz
),

610 (
db
, 
exsiz
), 
DB_RETOK_STD
)

611 
DB_METHOD
(
t_q_exsize
, (
u_t32_t
 
exsize
),

612 (
db
, 
exsize
), 
DB_RETOK_STD
)

614 
DB_METHOD_QUIET
(
t_loc
, (
db_mloc_f_ty
 
mloc_f
,

615 
db_loc_f_ty
 
loc_f
, 
db__f_ty
 
_f
),

616 (
db
, 
mloc_f
, 
loc_f
, 
_f
))

618 
Db
::
t_r
((*
g
)(cڡ 
DbEnv
 *, const *, const *))

620 
v_
->
	`t_r
(
g
);

621 
	}
}

623 
Db
::
t_msg
((*
g
)(cڡ 
DbEnv
 *, const *))

625 
v_
->
	`t_msg
(
g
);

626 
	}
}

628 *
Db
::
	$g_p_ive
() const

630  
	`unwpCڡ
(
this
)->
p_ive
;

631 
	}
}

633 
Db
::
	$t_p_ive
(*
vue
)

635 
	`unwp
(
this
)->
p_ive
 = 
vue
;

636 
	}
}

638 
DB_METHOD
(
g_chesize
, (
u_t32_t
 *
gby
, u_t32_*
by
, *
nch
),

639 (
db
, 
gby
, 
by
, 
nch
), 
DB_RETOK_STD
)

640 
DB_METHOD
(
t_chesize
, (
u_t32_t
 
gbys
, u_t32_
bys
, 
nche
),

641 (
db
, 
gbys
, 
bys
, 
nche
), 
DB_RETOK_STD
)

643 
Db
::
t_nic
((*
back
)(
DbEnv
 *, ))

645  (
v_
->
	`t_nic
(
back
));

646 
	}
}

648 
__DB_STD
(
oam
*
Db
::
	$g_r_am
()

650  
v_
->
	`g_r_am
();

651 
	}
}

653 
Db
::
t_r_am
(
__DB_STD
(
oam
*
r_am
)

655 
v_
->
t_r_am
(
r_am
);

658 
__DB_STD
(
oam
*
Db
::
	$g_mesge_am
()

660  
v_
->
	`g_mesge_am
();

661 
	}
}

663 
Db
::
t_mesge_am
(
__DB_STD
(
oam
*
mesge_am
)

665 
v_
->
t_mesge_am
(
mesge_am
);

668 
DB_METHOD_QUIET
(
g_iڮ
, (), (
db
))

	@../cxx/cxx_dbc.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 
	~"dbc/db_ge.h
"

17 
	~"dbc_auto/db_auto.h
"

18 
	~"dbc_auto/d_auto.h
"

19 
	~"dbc/db_dich.h
"

20 
	~"dbc_auto/db_ext.h
"

21 
	~"dbc_auto/comm_ext.h
"

29 
	#DBC_METHOD
(
_me
, 
_gec
, 
_gli
, 
_tok
) \

30 
Dbc
::
_me
 
_gec
 \

32 
t
; \

33 
DBC
 *
dbc
 = 
this
; \

35 
t
 = 
dbc
->
_me
 
_gli
; \

36 i(!
	`_tok
(
t
)) \

37 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
), \

38 "Dbc::" #_me, 
t
, 
ON_ERROR_UNKNOWN
); \

39  (
t
); \

40 }

	)

44 
	gDbc
::~
	$Dbc
()

46 
	}
}

48 
DBC_METHOD
(
o
, (), (
dbc
), 
DB_RETOK_STD
)

49 
DBC_METHOD
(
cou
, (
db_o_t
 *
coup
, 
u_t32_t
 
_ags
),

50 (
dbc
, 
coup
, 
_ags
), 
DB_RETOK_STD
)

51 
DBC_METHOD
(
d
, (
u_t32_t
 
_ags
),

52 (
dbc
, 
_ags
), 
DB_RETOK_DBCDEL
)

54 
	gDbc
::
	$dup
(
Dbc
** 
cursp
, 
u_t32_t
 
_ags
)

56 
t
;

57 
DBC
 *
dbc
 = 
this
;

58 
DBC
 *
w_curs
 = 0;

60 
t
 = 
dbc
->
	`dup
(dbc, &
w_curs
, 
_ags
);

62 i(
	`DB_RETOK_STD
(
t
))

64 *
cursp
 = (
Dbc
*)
w_curs
;

66 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

67 "Dbc::dup", 
t
, 
ON_ERROR_UNKNOWN
);

69  (
t
);

70 
	}
}

72 
	gDbc
::
	$g
(
Dbt
* 
key
, Db*
da
, 
u_t32_t
 
_ags
)

74 
t
;

75 
DBC
 *
dbc
 = 
this
;

77 
t
 = 
dbc
->
	`g
(dbc, 
key
, 
da
, 
_ags
);

79 i(!
	`DB_RETOK_DBCGET
(
t
)) {

80 i(
t
 =
DB_BUFFER_SMALL
 && 
	`DB_OVERFLOWED_DBT
(
key
))

81 
	`DB_ERROR_DBT
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

82 "Dbc::g", 
key
, 
ON_ERROR_UNKNOWN
);

83 i(
t
 =
DB_BUFFER_SMALL
 && 
	`DB_OVERFLOWED_DBT
(
da
))

84 
	`DB_ERROR_DBT
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

85 "Dbc::g", 
da
, 
ON_ERROR_UNKNOWN
);

87 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

88 "Dbc::g", 
t
, 
ON_ERROR_UNKNOWN
);

91  (
t
);

92 
	}
}

94 
	gDbc
::
	$pg
(
Dbt
* 
key
, Db*
pkey
, Db*
da
, 
u_t32_t
 
_ags
)

96 
t
;

97 
DBC
 *
dbc
 = 
this
;

99 
t
 = 
dbc
->
	`pg
(dbc, 
key
, 
pkey
, 
da
, 
_ags
);

102 i(!
	`DB_RETOK_DBCGET
(
t
)) {

103 i(
t
 =
DB_BUFFER_SMALL
 && 
	`DB_OVERFLOWED_DBT
(
key
))

104 
	`DB_ERROR_DBT
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

105 "Dbc::pg", 
key
, 
ON_ERROR_UNKNOWN
);

106 i(
t
 =
DB_BUFFER_SMALL
 && 
	`DB_OVERFLOWED_DBT
(
da
))

107 
	`DB_ERROR_DBT
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

108 "Dbc::pg", 
da
, 
ON_ERROR_UNKNOWN
);

110 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbc
->
dbp
->
dbv
),

111 "Dbc::pg", 
t
, 
ON_ERROR_UNKNOWN
);

114  (
t
);

115 
	}
}

117 
DBC_METHOD
(
put
, (
Dbt
* 
key
, Db*
da
, 
u_t32_t
 
_ags
),

118 (
dbc
, 
key
, 
da
, 
_ags
), 
DB_RETOK_DBCPUT
)

119 
DBC_METHOD
(
g_iܙy
, (
DB_CACHE_PRIORITY
 *
iܙyp
),

120 (
dbc
, 
iܙyp
), 
DB_RETOK_STD
)

121 
DBC_METHOD
(
t_iܙy
, (
DB_CACHE_PRIORITY
 
i
), (
dbc
,ri), 
DB_RETOK_STD
)

	@../cxx/cxx_dbt.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 
	~"dbc/db_ge.h
"

17 
	~"dbc_auto/db_auto.h
"

18 
	~"dbc_auto/d_auto.h
"

19 
	~"dbc/db_dich.h
"

20 
	~"dbc_auto/db_ext.h
"

21 
	~"dbc_auto/comm_ext.h
"

23 
	gDbt
::
	$Dbt
()

25 
DBT
 *
dbt
 = 
this
;

26 
	`memt
(
dbt
, 0, (
DBT
));

27 
	}
}

29 
	gDbt
::
	$Dbt
(*
da_g
, 
u_t32_t
 
size_g
)

31 
DBT
 *
dbt
 = 
this
;

32 
	`memt
(
dbt
, 0, (
DBT
));

33 
	`t_da
(
da_g
);

34 
	`t_size
(
size_g
);

35 
	}
}

37 
	gDbt
::~
	$Dbt
()

39 
	}
}

41 
Dbt
::
	$Dbt
(cڡ 
Dbt
 &
th
)

43 cڡ 
DBT
 *
om
 = &
th
;

44 
DBT
 *
to
 = 
this
;

45 
	`memy
(
to
, 
om
, (
DBT
));

46 
	}
}

48 
	gDbt
 &Dbt::
ݔ
 = (cڡ 
Dbt
 &
th
)

50 i(
this
 !&
th
) {

51 cڡ 
DBT
 *
om
 = &
th
;

52 
DBT
 *
	gto
 = 
this
;

53 
memy
(
to
, 
om
, (
DBT
));

55  (*
	gthis
);

	@../cxx/cxx_env.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 
	~"dbc/db_ge.h
"

17 
	~"dbc/db_am.h
"

18 
	~"dbc/log.h
"

19 
	~"dbc_auto/comm_ext.h
"

20 
	~"dbc_auto/log_ext.h
"

22 #ifde
HAVE_CXX_STDHEADERS


23 
usg
 
	gd
::

;

32 
	#DBENV_METHOD_ERR
(
_me
, 
_gec
, 
_gli
, 
__r
) \

33 
DbEnv
::
_me
 
_gec
 \

35 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
); \

36 
t
; \

38 i((
t
 = 
dbv
->
_me
 
_gli
) != 0) { \

39 
__r
; \

41  (
t
); \

42 }

	)

44 
	#DBENV_METHOD
(
_me
, 
_gec
, 
_gli
) \

45 
	`DBENV_METHOD_ERR
(
_me
, 
_gec
, 
_gli
, \

46 
	`DB_ERROR
(
this
, "DbEnv::" #_me, 
t
, 
	`r_picy
()))

	)

48 
	#DBENV_METHOD_QUIET
(
_me
, 
_gec
, 
_gli
) \

49 
DbEnv
::
_me
 
_gec
 \

51 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
); \

53  (
dbv
->
_me
 
_gli
); \

54 }

	)

56 
	#DBENV_METHOD_VOID
(
_me
, 
_gec
, 
_gli
) \

57 
DbEnv
::
_me
 
_gec
 \

59 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
); \

61 
dbv
->
_me
 
_gli
; \

62 }

	)

73 
	gϡ_known_r_picy
 = 
ON_ERROR_UNKNOWN
;

81 
	$_edback_r_c
(
DB_ENV
 *
v
, 
code
, 
p
)

83 
DbEnv
::
	`_edback_r
(
v
, 
code
, 
p
);

84 
	}
}

87 
	$_nic_r_c
(
DB_ENV
 *
v
, 
rv
)

89 
DbEnv
::
	`_nic_r
(
v
, 
rv
);

90 
	}
}

93 
	$_evt_func_r_c
(
DB_ENV
 *
v
, 
u_t32_t
 
evt
, *
evt_fo
)

95 
DbEnv
::
	`_evt_func_r
(
v
, 
evt
, 
evt_fo
);

96 
	}
}

99 
	$_am_r_funi_c
(cڡ 
DB_ENV
 *
v
,

100 cڡ *
efix
, cڡ *
mesge
)

102 
DbEnv
::
	`_am_r_funi
(
v
, 
efix
, 
mesge
);

103 
	}
}

106 
	$_am_mesge_funi_c
(cڡ 
DB_ENV
 *
v
, cڡ *
mesge
)

108 
DbEnv
::
	`_am_mesge_funi
(
v
, 
mesge
);

109 
	}
}

112 
	$_p_dich_r_c
(
DB_ENV
 *
v
, 
DBT
 *
dbt
, 
DB_LSN
 *
l
, 
db_cs
 

)

114  (
DbEnv
::
	`_p_dich_r
(
v
, 
dbt
, 
l
, 

));

115 
	}
}

118 
	$_p_nd_r_c
(
DB_ENV
 *
v
, cڡ 
DBT
 *
l
, cڡ DBT *
da
,

119 cڡ 
DB_LSN
 *
l
, 
id
, 
u_t32_t
 
ags
)

121  (
DbEnv
::
	`_p_nd_r
(
v
,

122 
l
, 
da
, 
l
, 
id
, 
ags
));

123 
	}
}

126 
	$_ilive_r_c
(

127 
DB_ENV
 *
v
, 
pid_t
 
pid
, 
db_thadid_t
 
thrid
, 
u_t32_t
 
ags
)

129  (
DbEnv
::
	`_ilive_r
(
v
, 
pid
, 
thrid
, 
ags
));

130 
	}
}

133 
	$_thad_id_r_c
(
DB_ENV
 *
v
, 
pid_t
 *
pidp
, 
db_thadid_t
 *
thridp
)

135 
DbEnv
::
	`_thad_id_r
(
v
, 
pidp
, 
thridp
);

136 
	}
}

139 *
	$_thad_id_rg_r_c
(
DB_ENV
 *
v
, 
pid_t
 
pid
,

140 
db_thadid_t
 
thrid
, *
buf
)

142  (
DbEnv
::
	`_thad_id_rg_r
(
v
, 
pid
, 
thrid
, 
buf
));

143 
	}
}

145 
DbEnv
::
	$_edback_r
(
DB_ENV
 *
v
, 
code
, 
p
)

147 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

148 i(
cxxv
 == 0) {

149 
	`DB_ERROR
(0,

150 "DbEnv::edback_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

153 i(
cxxv
->
edback_back_
 == 0) {

154 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

155 "DbEnv::edback_back", 
EINVAL
, 
cxxv
->
	`r_picy
());

158 (*
cxxv
->
edback_back_
)(cxxv, 
code
, 
p
);

159 
	}
}

161 
DbEnv
::
	$_nic_r
(
DB_ENV
 *
v
, 
rv
)

163 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

164 i(
cxxv
 == 0) {

165 
	`DB_ERROR
(0,

166 "DbEnv::nic_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

169 i(
cxxv
->
nic_back_
 == 0) {

170 
	`DB_ERROR
(
cxxv
, "DbEnv::nic_back", 
EINVAL
,

171 
cxxv
->
	`r_picy
());

174 (*
cxxv
->
nic_back_
)(cxxv, 
rv
);

175 
	}
}

177 
DbEnv
::
	$_evt_func_r
(

178 
DB_ENV
 *
v
, 
u_t32_t
 
evt
, *
evt_fo
)

180 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

181 i(
cxxv
 == 0) {

182 
	`DB_ERROR
(0,

183 "DbEnv::evt_func_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

186 i(
cxxv
->
evt_func_back_
 == 0) {

187 
	`DB_ERROR
(
cxxv
, "DbEnv::evt_func_back", 
EINVAL
,

188 
cxxv
->
	`r_picy
());

191 (*
cxxv
->
evt_func_back_
)(cxxv, 
evt
, 
evt_fo
);

192 
	}
}

194 
DbEnv
::
	$_p_dich_r
(
DB_ENV
 *
v
, 
DBT
 *
dbt
, 
DB_LSN
 *
l
,

195 
db_cs
 

)

197 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

198 i(
cxxv
 == 0) {

199 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

200 "DbEnv::p_dich_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

201  (
EINVAL
);

203 i(
cxxv
->
p_dich_back_
 == 0) {

204 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

205 "DbEnv::p_dich_back", 
EINVAL
,

206 
cxxv
->
	`r_picy
());

207  (
EINVAL
);

209 
Dbt
 *
cxxdbt
 = (Db*)
dbt
;

210 
DbL
 *
cxxl
 = (DbL *)
l
;

211  ((*
cxxv
->
p_dich_back_
)(cxxv, 
cxxdbt
, 
cxxl
, 

));

212 
	}
}

214 
DbEnv
::
	$_ilive_r
(

215 
DB_ENV
 *
v
, 
pid_t
 
pid
, 
db_thadid_t
 
thrid
, 
u_t32_t
 
ags
)

217 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

218 i(
cxxv
 == 0) {

219 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

220 "DbEnv::ilive_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

223  ((*
cxxv
->
ilive_back_
)(cxxv, 
pid
, 
thrid
, 
ags
));

224 
	}
}

226 
DbEnv
::
	$_p_nd_r
(
DB_ENV
 *
v
, cڡ 
DBT
 *
l
, cڡ DBT *
da
,

227 cڡ 
DB_LSN
 *
l
, 
id
, 
u_t32_t
 
ags
)

229 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

230 i(
cxxv
 == 0) {

231 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

232 "DbEnv::p_nd_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

233  (
EINVAL
);

235 cڡ 
Dbt
 *
cxxl
 = (cڡ Db*)
l
;

236 cڡ 
DbL
 *
cxxl
 = (cڡ DbL *)
l
;

237 
Dbt
 *
cxxda
 = (Db*)
da
;

238  ((*
cxxv
->
p_nd_back_
)(cxxenv,

239 
cxxl
, 
cxxda
, 
cxxl
, 
id
, 
ags
));

240 
	}
}

242 
DbEnv
::
	$_thad_id_r
(
DB_ENV
 *
v
,

243 
pid_t
 *
pidp
, 
db_thadid_t
 *
thridp
)

245 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

246 i(
cxxv
 == 0) {

247 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

248 "DbEnv::thad_id_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

250 
cxxv
->
	`thad_id_back_
(cxxv, 
pidp
, 
thridp
);

251 
	}
}

253 *
DbEnv
::
	$_thad_id_rg_r
(
DB_ENV
 *
v
,

254 
pid_t
 
pid
, 
db_thadid_t
 
thrid
, *
buf
)

256 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
v
);

257 i(
cxxv
 == 0) {

258 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
v
),

259 "DbEnv::thad_id_rg_back", 
EINVAL
,

260 
ON_ERROR_UNKNOWN
);

261  (
NULL
);

263  (
cxxv
->
	`thad_id_rg_back_
(cxxv, 
pid
, 
thrid
, 
buf
));

264 
	}
}

278 
DbEnv
::
	$DbEnv
(
u_t32_t
 
ags
)

279 : 
	`imp_
(0)

280 , 
	`cڡru_r_
(0)

281 , 
	`cڡru_ags_
(
ags
)

282 , 
	`r_am_
(0)

283 , 
	`mesge_am_
(0)

284 , 
	`p_dich_back_
(0)

285 , 
	`edback_back_
(0)

286 , 
	`nic_back_
(0)

287 , 
	`evt_func_back_
(0)

288 , 
	$p_nd_back_
(0)

290 i((
cڡru_r_
 = 
	`lize
(0)) != 0)

291 
	`DB_ERROR
(
this
, "DbEnv::DbEnv", 
cڡru_r_
,

292 
	`r_picy
());

293 
	}
}

295 
DbEnv
::
	$DbEnv
(
DB_ENV
 *
v
, 
u_t32_t
 
ags
)

296 : 
	`imp_
(0)

297 , 
	`cڡru_r_
(0)

298 , 
	`cڡru_ags_
(
ags
)

299 , 
	`r_am_
(0)

300 , 
	`mesge_am_
(0)

301 , 
	`p_dich_back_
(0)

302 , 
	`edback_back_
(0)

303 , 
	`nic_back_
(0)

304 , 
	`evt_func_back_
(0)

305 , 
	$p_nd_back_
(0)

307 i((
cڡru_r_
 = 
	`lize
(
v
)) != 0)

308 
	`DB_ERROR
(
this
, "DbEnv::DbEnv", 
cڡru_r_
,

309 
	`r_picy
());

310 
	}
}

319 
DbEnv
::~
	$DbEnv
()

321 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

323 i(
v
 !
NULL
) {

324 ()
v
->
	`o
(env, 0);

325 
	`nup
();

327 
	}
}

330 
DbEnv
::
	$nup
()

332 
imp_
 = 0;

333 
	}
}

335 
DbEnv
::
	$o
(
u_t32_t
 
ags
)

337 
t
;

338 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

340 
t
 = 
v
->
	`o
nv, 
ags
);

344 
	`nup
();

350 i(
t
 != 0)

351 
	`DB_ERROR
(
this
, "DbEnv::o", 
t
, 
	`r_picy
());

353  (
t
);

354 
	}
}

356 
DBENV_METHOD
(
dbmove
,

357 (
DbTxn
 *
txn
, cڡ *
me
, cڡ *
subdb
, 
u_t32_t
 
ags
),

358 (
dbv
, 
unwp
(
txn
), 
me
, 
subdb
, 
ags
))

359 
DBENV_METHOD
(
dbme
, (
DbTxn
 *
txn
, cڡ *
me
, cڡ *
subdb
,

360 cڡ *
wme
, 
u_t32_t
 
ags
),

361 (
dbv
, 
unwp
(
txn
), 
me
, 
subdb
, 
wme
, 
ags
))

363 
DbEnv
::
	$r
(
r
, cڡ *
fm
, ...)

365 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

367 
	`DB_REAL_ERR
(
v
, 
r
, 
DB_ERROR_SET
, 1, 
fm
);

368 
	}
}

376 
DbEnv
::
	$r_picy
()

378 i((
cڡru_ags_
 & 
DB_CXX_NO_EXCEPTIONS
) != 0) {

379  (
ON_ERROR_RETURN
);

382  (
ON_ERROR_THROW
);

384 
	}
}

386 
DbEnv
::
	$rx
(cڡ *
fm
, ...)

388 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

390 
	`DB_REAL_ERR
(
v
, 0, 
DB_ERROR_NOT_SET
, 1, 
fm
);

391 
	}
}

393 *
DbEnv
::
	$g_p_ive
() const

395  
	`unwpCڡ
(
this
)->
p_ive
;

396 
	}
}

398 
DBENV_METHOD
(
chk
, (
u_t32_t
 
ags
), (
dbv
, flags))

399 
DBENV_METHOD
(
feid_t
, (cڡ *
fe
, 
u_t32_t
 
ags
),

400 (
dbv
, 
fe
, 
ags
))

401 
DBENV_METHOD
(
g_home
, (cڡ **
hom
), (
dbv
, homep))

402 
DBENV_METHOD
(
g_ݒ_ags
, (
u_t32_t
 *
ag
), (
dbv
, flagsp))

403 
DBENV_METHOD
(
g_da_ds
, (cڡ ***
dp
), (
dbv
, dirspp))

405 
bo
 
DbEnv
::
	$is_bigdn
()

407  
	`unwp
(
this
)->
	`is_bigdn
(? 
ue
 : 
l
;

408 
	}
}

410 
DBENV_METHOD
(
g_thad_cou
, (
u_t32_t
 *
cou
), (
dbv
, count))

411 
DBENV_METHOD
(
t_thad_cou
, (
u_t32_t
 
cou
), (
dbv
, count))

417 
DbEnv
::
	$lize
(
DB_ENV
 *
v
)

419 
t
;

421 
ϡ_known_r_picy
 = 
	`r_picy
();

423 i(
v
 == 0) {

425 i((
t
 = ::
	`db_v_
(&
v
,

426 
cڡru_ags_
 & ~
DB_CXX_NO_EXCEPTIONS
)) != 0)

427  (
t
);

429 
imp_
 = 
v
;

430 
v
->
i1_
 = 
this
;

432 
	}
}

435 
DBENV_METHOD
(
lock_de
, (
u_t32_t
 
ags
, u_t32_
y
, *
ab܋d
),

436 (
dbv
, 
ags
, 
y
, 
ab܋d
))

437 
DBENV_METHOD_ERR
(
lock_g
,

438 (
u_t32_t
 
lock
, u_t32_
ags
, cڡ 
Dbt
 *
obj
,

439 
db_lockmode_t
 
lock_mode
, 
DbLock
 *
lock
),

440 (
dbv
, 
lock
, 
ags
, 
obj
, 
lock_mode
, &
lock
->
lock_
),

441 
DbEnv
::
ruime_r_lock_g
(
this
, "DbEnv::lock_g", 
t
,

442 
DB_LOCK_GET
, 
lock_mode
, 
obj
, *
lock
,

443 -1, 
	$r_picy
()))

444 
	`DBENV_METHOD
(
lock_id
, (
u_t32_t
 *
idp
), (
dbv
, idp))

445 
	`DBENV_METHOD
(
lock_id_
, (
u_t32_t
 
id
), (
dbv
, id))

446 
	`DBENV_METHOD
(
lock_put
, (
DbLock
 *
lock
), (
dbv
, &lock->
lock_
))

447 
	`DBENV_METHOD
(
lock_
, (
DB_LOCK_STAT
 **
p
, 
u_t32_t
 
ags
),

448 (
dbv
, 
p
, 
ags
))

449 
	`DBENV_METHOD
(
lock__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

450 
	`DBENV_METHOD_ERR
(
lock_vec
,

451 (
u_t32_t
 
lock
, u_t32_
ags
, 
DB_LOCKREQ
 
li
[],

452 
i
, 
DB_LOCKREQ
 **
i_tued
),

453 (
dbv
, 
lock
, 
ags
, 
li
, 
i
, 
i_tued
),

454 
DbEnv
::
	`ruime_r_lock_g
(
this
, "DbEnv::lock_vec", 
t
,

455 (*
i_tued
)->

, (*i_tued)->
mode
,

456 
Dbt
::
	`g_Dbt
((*
i_tued
)->
obj
), 
	`DbLock
((*i_tued)->
lock
),

457 (*
i_tued
- 
li
, 
	$r_picy
()))

459 
	`DBENV_METHOD
(
log_chive
, (**
li
[], 
u_t32_t
 
ags
),

460 (
dbv
, 
li
, 
ags
))

462 
DbEnv
::
	$log_com
(cڡ 
DbL
 *
l0
, cڡ DbL *
l1
)

464  (::
	`log_com
(
l0
, 
l1
));

465 
	}
}

468 
DBENV_METHOD
(
log_curs
, (
DbLogc
 **
cursp
, 
u_t32_t
 
ags
),

469 (
dbv
, (
DB_LOGC
 **)
cursp
, 
ags
))

470 
DBENV_METHOD
(
log_fe
, (
DbL
 *
l
, *
m
, 
size_t
 
n
),

471 (
dbv
, 
l
, 
m
, 
n
))

472 
DBENV_METHOD
(
log_ush
, (cڡ 
DbL
 *
l
), (
dbv
,sn))

473 
DBENV_METHOD
(
log_put
, (
DbL
 *
l
, cڡ 
Dbt
 *
da
, 
u_t32_t
 
ags
),

474 (
dbv
, 
l
, 
da
, 
ags
))

476 
DbEnv
::
	$log_tf
(
DbTxn
 *
txn
, cڡ *
fmt
, ...)

478 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

479 
va_li
 

;

480 
t
;

482 
	`va_t
(

, 
fmt
);

483 
t
 = 
	`__log_tf_
(
v
, 
	`unwp
(
txn
), 
fmt
, 

);

484 
	`va_d
(

);

486  (
t
);

487 
	}
}

489 
DBENV_METHOD
(
log_
, (
DB_LOG_STAT
 **
p
, 
u_t32_t
 
ags
),

490 (
dbv
, 
p
, 
ags
))

491 
DBENV_METHOD
(
log__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

493 
DBENV_METHOD
(
l_t
, (cڡ *
fe
, 
u_t32_t
 
ags
),

494 (
dbv
, 
fe
, 
ags
))

496 
DbEnv
::
	$memp_f
(
DbMpoFe
 **
dbm
, 
u_t32_t
 
ags
)

498 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

499 
t
;

500 
DB_MPOOLFILE
 *
mpf
;

502 i(
v
 =
NULL
)

503 
t
 = 
EINVAL
;

505 
t
 = 
v
->
	`memp_f
nv, &
mpf
, 
ags
);

507 i(
	`DB_RETOK_STD
(
t
)) {

508 *
dbm
 = 
w
 
	`DbMpoFe
();

509 (*
dbm
)->
imp_
 = 
mpf
;

511 
	`DB_ERROR
(
this
, "DbMpoFe::f_", 
t
, 
ON_ERROR_UNKNOWN
);

513  (
t
);

514 
	}
}

516 
DBENV_METHOD
(
memp_gi
,

517 (
y
, 
pg_f_ty
 
pg_f
, 
pgout_f_ty
 
pgout_f
),

518 (
dbv
, 
y
, 
pg_f
, 
pgout_f
))

521 
DBENV_METHOD
(
memp_
,

522 (
DB_MPOOL_STAT
 **
g
, 
DB_MPOOL_FSTAT
 ***
f
, 
u_t32_t
 
ags
),

523 (
dbv
, 
g
, 
f
, 
ags
))

524 
DBENV_METHOD
(
memp__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

525 
DBENV_METHOD
(
memp_sync
, (
DbL
 *

), (
dbv
, sn))

526 
DBENV_METHOD
(
memp_ick
, (
p
, *
nwrٕ
), (
dbv
,ct,wrotep))

531 
DbEnv
::
	$ݒ
(cڡ *
db_home
, 
u_t32_t
 
ags
, 
mode
)

533 
t
;

534 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

536 i(
cڡru_r_
 != 0)

537 
t
 = 
cڡru_r_
;

539 
t
 = 
v
->
	`ݒ
nv, 
db_home
, 
ags
, 
mode
);

541 i(!
	`DB_RETOK_STD
(
t
))

542 
	`DB_ERROR
(
this
, "DbEnv::ݒ", 
t
, 
	`r_picy
());

544  (
t
);

545 
	}
}

547 
DbEnv
::
	$move
(cڡ *
db_home
, 
u_t32_t
 
ags
)

549 
t
;

550 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

552 
t
 = 
v
->
	`move
nv, 
db_home
, 
ags
);

558 
	`nup
();

560 i(
t
 != 0)

561 
	`DB_ERROR
(
this
, "DbEnv::move", 
t
, 
	`r_picy
());

563  (
t
);

564 
	}
}

572 
DbEnv
::
	$ruime_r
(
DbEnv
 *
v
,

573 cڡ *
Δ
, 
r
, 
r_picy
)

575 i(
r_picy
 =
ON_ERROR_UNKNOWN
)

576 
r_picy
 = 
ϡ_known_r_picy
;

577 i(
r_picy
 =
ON_ERROR_THROW
) {

580 
r
) {

581 
DB_LOCK_DEADLOCK
:

583 
DbDdlockExi
 
	`dl_ex
(
Δ
);

584 
dl_ex
.
	`t_v
(
v
);

585 
throw
 
dl_ex
;

587 
DB_LOCK_NOTGRANTED
:

589 
DbLockNGedExi
 
	`g_ex
(
Δ
);

590 
g_ex
.
	`t_v
(
v
);

591 
throw
 
g_ex
;

593 
DB_REP_HANDLE_DEAD
:

595 
DbRHdDdExi
 
	`hd_ex
(
Δ
);

596 
hd_ex
.
	`t_v
(
v
);

597 
throw
 
hd_ex
;

599 
DB_RUNRECOVERY
:

601 
DbRunRecovyExi
 
	`_ex
(
Δ
);

602 
_ex
.
	`t_v
(
v
);

603 
throw
 
_ex
;

607 
DbExi
 
	`ex
(
Δ
, 
r
);

608 
ex
.
	`t_v
(
v
);

609 
throw
 
ex
;

613 
	}
}

617 
DbEnv
::
	$ruime_r_dbt
(
DbEnv
 *
v
,

618 cڡ *
Δ
, 
Dbt
 *
dbt
, 
r_picy
)

620 i(
r_picy
 =
ON_ERROR_UNKNOWN
)

621 
r_picy
 = 
ϡ_known_r_picy
;

622 i(
r_picy
 =
ON_ERROR_THROW
) {

625 
DbMemyExi
 
	`ex
(
Δ
, 
dbt
);

626 
ex
.
	`t_v
(
v
);

627 
throw
 
ex
;

629 
	}
}

634 
DbEnv
::
	$ruime_r_lock_g
(
DbEnv
 *
v
,

635 cڡ *
Δ
, 
r
,

636 
db_lock_t
 

, 
db_lockmode_t
 
mode
, cڡ 
Dbt
 *
obj
,

637 
DbLock
 
lock
, 
dex
, 
r_picy
)

639 i(
r
 !
DB_LOCK_NOTGRANTED
) {

640 
	`ruime_r
(
v
, 
Δ
, 
r
, 
r_picy
);

644 i(
r_picy
 =
ON_ERROR_UNKNOWN
)

645 
r_picy
 = 
ϡ_known_r_picy
;

646 i(
r_picy
 =
ON_ERROR_THROW
) {

649 
DbLockNGedExi
 
	`ex
(
Δ
, 

, 
mode
,

650 
obj
, 
lock
, 
dex
);

651 
ex
.
	`t_v
(
v
);

652 
throw
 
ex
;

654 
	}
}

656 
DbEnv
::
	$_am_r_funi
(

657 cڡ 
DB_ENV
 *
v
, cڡ *
efix
, cڡ *
mesge
)

659 cڡ 
DbEnv
 *
cxxv
 = DbEnv::
	`g_cڡ_DbEnv
(
v
);

660 i(
cxxv
 == 0) {

661 
	`DB_ERROR
(0,

662 "DbEnv::am_r", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

666 i(
cxxv
->
r_back_
)

667 
cxxv
->
	`r_back_
(cxxv, 
efix
, 
mesge
);

668 i(
cxxv
->
r_am_
) {

670 i(
efix
) {

671 (*
cxxv
->
r_am_
<< 
efix
;

672 (*
cxxv
->
r_am_
) << (const *)": ";

674 i(
mesge
)

675 (*
cxxv
->
r_am_
<< (cڡ *)
mesge
;

676 (*
cxxv
->
r_am_
) << (const *)"\n";

678 
	}
}

680 
DbEnv
::
	$_am_mesge_funi
(cڡ 
DB_ENV
 *
v
, cڡ *
mesge
)

682 cڡ 
DbEnv
 *
cxxv
 = DbEnv::
	`g_cڡ_DbEnv
(
v
);

683 i(
cxxv
 == 0) {

684 
	`DB_ERROR
(0,

685 "DbEnv::am_mesge", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

689 i(
cxxv
->
mesge_back_
)

690 
cxxv
->
	`mesge_back_
(cxxv, 
mesge
);

691 i(
cxxv
->
mesge_am_
) {

693 (*
cxxv
->
mesge_am_
<< (cڡ *)
mesge
;

694 (*
cxxv
->
mesge_am_
) << (const *)"\n";

696 
	}
}

699 *
DbEnv
::
	$
(
r
)

701  (
	`db_
(
r
));

702 
	}
}

707 
DBENV_METHOD
(
t_da_d
, (cڡ *
d
), (
dbv
, dir))

708 
DBENV_METHOD
(
g_y_ags
, (
u_t32_t
 *
ag
),

709 (
dbv
, 
ag
))

710 
DBENV_METHOD
(
t_y
, (cڡ *
sswd
, 
u_t32_t
 
ags
),

711 (
dbv
, 
sswd
, 
ags
))

712 
DBENV_METHOD_VOID
(
g_rfe
, (
FILE
 **
rf
), (
dbv
,rrfilep))

713 
DBENV_METHOD_VOID
(
t_rfe
, (
FILE
 *
rfe
), (
dbv
,rrfile))

714 
DBENV_METHOD_VOID
(
g_fx
, (cڡ **
fxp
), (
dbv
,rrpfxp))

715 
DBENV_METHOD_VOID
(
t_fx
, (cڡ *
fx
), (
dbv
,rrpfx))

716 
DBENV_METHOD
(
t_rmed_d
, (
mode
, 
u_t32_t
 
ags
),

717 (
dbv
, 
mode
, 
ags
))

718 
DBENV_METHOD
(
g_lg_bsize
, (
u_t32_t
 *
bsiz
), (
dbv
, bsizep))

719 
DBENV_METHOD
(
t_lg_bsize
, (
u_t32_t
 
bsize
), (
dbv
, bsize))

720 
DBENV_METHOD
(
g_lg_d
, (cڡ **
dp
), (
dbv
, dirp))

721 
DBENV_METHOD
(
t_lg_d
, (cڡ *
d
), (
dbv
, dir))

722 
DBENV_METHOD
(
g_lg_femode
, (*
mod
), (
dbv
, modep))

723 
DBENV_METHOD
(
t_lg_femode
, (
mode
), (
dbv
, mode))

724 
DBENV_METHOD
(
g_lg_max
, (
u_t32_t
 *
maxp
), (
dbv
, maxp))

725 
DBENV_METHOD
(
t_lg_max
, (
u_t32_t
 
max
), (
dbv
, max))

726 
DBENV_METHOD
(
g_lg_gimax
, (
u_t32_t
 *
gimaxp
), (
dbv
,egionmaxp))

727 
DBENV_METHOD
(
t_lg_gimax
, (
u_t32_t
 
gimax
), (
dbv
,egionmax))

728 
DBENV_METHOD
(
g_lk_cis
, (cڡ 
u_t8_t
 **
lk_ci
, *
lk_maxp
),

729 (
dbv
, 
lk_ci
, 
lk_maxp
))

730 
DBENV_METHOD
(
t_lk_cis
, (
u_t8_t
 *
lk_cis
, 
lk_max
),

731 (
dbv
, 
lk_cis
, 
lk_max
))

732 
DBENV_METHOD
(
g_lk_de
, (
u_t32_t
 *
dep
), (
dbv
, detectp))

733 
DBENV_METHOD
(
t_lk_de
, (
u_t32_t
 
de
), (
dbv
, detect))

734 
DBENV_METHOD
(
g_lk_max_locks
, (
u_t32_t
 *
max_lock
),

735 (
dbv
, 
max_lock
))

736 
DBENV_METHOD
(
t_lk_max_locks
, (
u_t32_t
 
max_locks
), (
dbv
, max_lockers))

737 
DBENV_METHOD
(
g_lk_max_locks
, (
u_t32_t
 *
max_lock
), (
dbv
, max_locksp))

738 
DBENV_METHOD
(
t_lk_max_locks
, (
u_t32_t
 
max_locks
), (
dbv
, max_locks))

739 
DBENV_METHOD
(
g_lk_max_objes
, (
u_t32_t
 *
max_obje
),

740 (
dbv
, 
max_obje
))

741 
DBENV_METHOD
(
t_lk_max_objes
, (
u_t32_t
 
max_objes
), (
dbv
, max_objects))

742 
DBENV_METHOD
(
g_mp_max_ݒfd
, (*
maxݒfdp
), (
dbv
, maxopenfdp))

743 
DBENV_METHOD
(
t_mp_max_ݒfd
, (
maxݒfd
), (
dbv
, maxopenfd))

744 
DBENV_METHOD
(
g_mp_max_wre
, (*
maxwr
, 
db_timeout_t
 *
maxwre_
),

745 (
dbv
, 
maxwr
, 
maxwre_
))

746 
DBENV_METHOD
(
t_mp_max_wre
, (
maxwre
, 
db_timeout_t
 
maxwre_p
),

747 (
dbv
, 
maxwre
, 
maxwre_p
))

748 
DBENV_METHOD
(
g_mp_mmsize
, (
size_t
 *
mmsiz
), (
dbv
, mmapsizep))

749 
DBENV_METHOD
(
t_mp_mmsize
, (
size_t
 
mmsize
), (
dbv
, mmapsize))

750 
DBENV_METHOD_VOID
(
g_msgfe
, (
FILE
 **
msgf
), (
dbv
, msgfilep))

751 
DBENV_METHOD_VOID
(
t_msgfe
, (
FILE
 *
msgfe
), (
dbv
, msgfile))

752 
DBENV_METHOD
(
g_tmp_d
, (cڡ **
tmp_dp
), (
dbv
,mp_dirp))

753 
DBENV_METHOD
(
t_tmp_d
, (cڡ *
tmp_d
), (
dbv
,mp_dir))

754 
DBENV_METHOD
(
g_tx_max
, (
u_t32_t
 *
tx_maxp
), (
dbv
,x_maxp))

755 
DBENV_METHOD
(
t_tx_max
, (
u_t32_t
 
tx_max
), (
dbv
,x_max))

757 
DBENV_METHOD
(
_t
, (
u_t32_t
 
ags
), (
dbv
, flags))

759 
DBENV_METHOD_QUIET
(
t_loc
,

760 (
db_mloc_f_ty
 
mloc_f
, 
db_loc_f_ty
 
loc_f
,

761 
db__f_ty
 
_f
),

762 (
dbv
, 
mloc_f
, 
loc_f
, 
_f
))

764 
DbEnv
::
	$t_p_ive
(*
vue
)

766 
	`unwp
(
this
)->
p_ive
 = 
vue
;

767 
	}
}

769 
DBENV_METHOD
(
g_chesize
,

770 (
u_t32_t
 *
gby
, u_t32_*
by
, *
nch
),

771 (
dbv
, 
gby
, 
by
, 
nch
))

772 
DBENV_METHOD
(
t_chesize
,

773 (
u_t32_t
 
gbys
, u_t32_
bys
, 
nche
),

774 (
dbv
, 
gbys
, 
bys
, 
nche
))

775 
DBENV_METHOD
(
g_che_max
, (
u_t32_t
 *
gby
, u_t32_*
by
),

776 (
dbv
, 
gby
, 
by
))

777 
DBENV_METHOD
(
t_che_max
, (
u_t32_t
 
gbys
, u_t32_
bys
),

778 (
dbv
, 
gbys
, 
bys
))

780 
DbEnv
::
t_r
((*
g
)(const DbEnv *, const *, const *))

782 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

784 
r_back_
 = 
g
;

785 
r_am_
 = 0;

787 
dbv
->
	`t_r
(dbv, (
g
 == 0) ? 0 :

788 
_am_r_funi_c
);

789 
	}
}

791 
__DB_STD
(
oam
*
DbEnv
::
	$g_r_am
()

793  (
r_am_
);

794 
	}
}

796 
DbEnv
::
t_r_am
(
__DB_STD
(
oam
*
am
)

798 
DB_ENV
 *
dbv
 = 
unwp
(
this
);

800 
r_am_
 = 
am
;

801 
r_back_
 = 0;

803 
dbv
->
t_r
(dbv, (
am
 == 0) ? 0 :

804 
_am_r_funi_c
);

807 
DbEnv
::
t_edback
((*
g
)(DbEnv *, , ))

809 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

811 
edback_back_
 = 
g
;

813  (
dbv
->
	`t_edback
(dbenv,

814 
g
 =0 ? 0 : 
_edback_r_c
));

815 
	}
}

817 
DBENV_METHOD
(
g_ags
, (
u_t32_t
 *
ag
), (
dbv
, flagsp))

818 
DBENV_METHOD
(
t_ags
, (
u_t32_t
 
ags
, 
off
), (
dbv
, flags, onoff))

820 
DbEnv
::
t_msg
((*
g
)(const DbEnv *, const *))

822 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

824 
mesge_back_
 = 
g
;

825 
mesge_am_
 = 0;

827 
dbv
->
	`t_msg
(dbv, (
g
 == 0) ? 0 :

828 
_am_mesge_funi_c
);

829 
	}
}

831 
__DB_STD
(
oam
*
DbEnv
::
	$g_mesge_am
()

833  (
mesge_am_
);

834 
	}
}

836 
DbEnv
::
t_mesge_am
(
__DB_STD
(
oam
*
am
)

838 
DB_ENV
 *
dbv
 = 
unwp
(
this
);

840 
mesge_am_
 = 
am
;

841 
mesge_back_
 = 0;

843 
dbv
->
t_msg
(dbv, (
am
 == 0) ? 0 :

844 
_am_mesge_funi_c
);

847 
DbEnv
::
t_nic
((*
g
)(DbEnv *, ))

849 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

851 
nic_back_
 = 
g
;

853  (
dbv
->
	`t_nic
(dbenv,

854 
g
 =0 ? 0 : 
_nic_r_c
));

855 
	}
}

857 
DbEnv
::
t_evt_nify
((*
g
)(DbEnv *, 
u_t32_t
, *))

859 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

861 
evt_func_back_
 = 
g
;

863  (
dbv
->
	`t_evt_nify
(dbenv,

864 
g
 =0 ? 0 : 
_evt_func_r_c
));

865 
	}
}

867 
DBENV_METHOD
(
t_c_rv
,

868 (*

, *
ho
, 
tc
, 
sc
, 
u_t32_t
 
ags
),

869 (
dbv
, 

, 
ho
, 
tc
, 
sc
, 
ags
))

870 
DBENV_METHOD
(
g_shm_key
, (*
shm_keyp
), (
dbv
, shm_keyp))

871 
DBENV_METHOD
(
t_shm_key
, (
shm_key
), (
dbv
, shm_key))

873 
DbEnv
::
t_p_dich


874 ((*
g
)(
DbEnv
 *, 
Dbt
 *, 
DbL
 *, 
db_cs
))

876 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

877 
t
;

879 
p_dich_back_
 = 
g
;

880 i((
t
 = 
dbv
->
	`t_p_dich
(dbenv,

881 
g
 =0 ? 0 : 
_p_dich_r_c
)) != 0)

882 
	`DB_ERROR
(
this
, "DbEnv::t_p_dich", 
t
, 
	`r_picy
());

884  (
t
);

885 
	}
}

887 
DbEnv
::
t_ilive


888 ((*
g
)(
DbEnv
 *, 
pid_t
, 
db_thadid_t
, 
u_t32_t
))

890 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

891 
t
;

893 
ilive_back_
 = 
g
;

894 i((
t
 = 
dbv
->
	`t_ilive
(dbenv,

895 
g
 =0 ? 0 : 
_ilive_r_c
)) != 0)

896 
	`DB_ERROR
(
this
, "DbEnv::t_ilive", 
t
, 
	`r_picy
());

898  (
t
);

899 
	}
}

901 
DBENV_METHOD
(
g_tx_timeamp
, (
time_t
 *
timeamp
), (
dbv
,imestamp))

902 
DBENV_METHOD
(
t_tx_timeamp
, (
time_t
 *
timeamp
), (
dbv
,imestamp))

903 
DBENV_METHOD
(
g_vbo
, (
u_t32_t
 
which
, *
of
),

904 (
dbv
, 
which
, 
of
))

905 
DBENV_METHOD
(
t_vbo
, (
u_t32_t
 
which
, 
off
), (
dbv
, which, onoff))

907 
DBENV_METHOD
(
mux_loc
,

908 (
u_t32_t
 
ags
, 
db_mux_t
 *
muxp
), (
dbv
, flags, mutexp))

909 
DBENV_METHOD
(
mux_
, (
db_mux_t
 
mux
), (
dbv
, mutex))

910 
DBENV_METHOD
(
mux_g_ign
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

911 
DBENV_METHOD
(
mux_g_emt
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

912 
DBENV_METHOD
(
mux_g_max
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

913 
DBENV_METHOD
(
mux_g_s_s
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

914 
DBENV_METHOD
(
mux_lock
, (
db_mux_t
 
mux
), (
dbv
, mutex))

915 
DBENV_METHOD
(
mux_t_ign
, (
u_t32_t
 
g
), (
dbv
,rg))

916 
DBENV_METHOD
(
mux_t_emt
, (
u_t32_t
 
g
), (
dbv
,rg))

917 
DBENV_METHOD
(
mux_t_max
, (
u_t32_t
 
g
), (
dbv
,rg))

918 
DBENV_METHOD
(
mux_t_s_s
, (
u_t32_t
 
g
), (
dbv
,rg))

919 
DBENV_METHOD
(
mux_
,

920 (
DB_MUTEX_STAT
 **
p
, 
u_t32_t
 
ags
), (
dbv
, statp, flags))

921 
DBENV_METHOD
(
mux__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

922 
DBENV_METHOD
(
mux_uock
, (
db_mux_t
 
mux
), (
dbv
, mutex))

924 
DbEnv
::
t_thad_id
((*
g
)(DbEnv *, 
pid_t
 *, 
db_thadid_t
 *))

926 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

927 
t
;

929 
thad_id_back_
 = 
g
;

930 i((
t
 = 
dbv
->
	`t_thad_id
(dbenv,

931 
g
 =0 ? 0 : 
_thad_id_r_c
)) != 0)

932 
	`DB_ERROR
(
this
, "DbEnv::t_thad_id", 
t
, 
	`r_picy
());

934  (
t
);

935 
	}
}

937 
DbEnv
::
t_thad_id_rg
(

938 *(*
g
)(
DbEnv
 *, 
pid_t
, 
db_thadid_t
, *))

940 
DB_ENV
 *
dbv
 = 
unwp
(
this
);

941 
t
;

943 
thad_id_rg_back_
 = 
g
;

944 i((
t
 = 
dbv
->
t_thad_id_rg
(dbenv,

945 
g
 =0 ? 0 : 
_thad_id_rg_r_c
)) != 0)

946 
DB_ERROR
(
this
, "DbEnv::t_thad_id_rg", 
t
,

947 
r_picy
());

949  (
t
);

952 
DbEnv
::
	$cdsgroup_beg
(
DbTxn
 **
tid
)

954 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

955 
DB_TXN
 *
txn
;

956 
t
;

958 
t
 = 
v
->
	`cdsgroup_beg
nv, &
txn
);

959 i(
	`DB_RETOK_STD
(
t
))

960 *
tid
 = 
w
 
	`DbTxn
(
txn
);

962 
	`DB_ERROR
(
this
, "DbEnv::cdsgroup_beg", 
t
, 
	`r_picy
());

964  (
t
);

965 
	}
}

967 
DbEnv
::
	$txn_beg
(
DbTxn
 *
pid
, DbTx**
tid
, 
u_t32_t
 
ags
)

969 
DB_ENV
 *
v
 = 
	`unwp
(
this
);

970 
DB_TXN
 *
txn
;

971 
t
;

973 
t
 = 
v
->
	`txn_beg
nv, 
	`unwp
(
pid
), &
txn
, 
ags
);

974 i(
	`DB_RETOK_STD
(
t
))

975 *
tid
 = 
w
 
	`DbTxn
(
txn
);

977 
	`DB_ERROR
(
this
, "DbEnv::txn_beg", 
t
, 
	`r_picy
());

979  (
t
);

980 
	}
}

982 
DBENV_METHOD
(
txn_checkpot
, (
u_t32_t
 
kby
, u_t32_
m
, u_t32_
ags
),

983 (
dbv
, 
kby
, 
m
, 
ags
))

985 
DbEnv
::
	$txn_cov
(
DbPi
 *
li
, 
cou
,

986 *

, 
u_t32_t
 
ags
)

988 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

989 
DB_PREPLIST
 *
c_li
;

990 
i
;

991 
t
;

998 i(
cou
 <= 0)

999 
t
 = 
EINVAL
;

1001 
t
 = 
	`__os_mloc
(
dbv
, (
DB_PREPLIST
* 
cou
,

1002 &
c_li
);

1004 i(
t
 != 0) {

1005 
	`DB_ERROR
(
this
, "DbEnv::txn_cov", 
t
, 
	`r_picy
());

1006  (
t
);

1009 i((
t
 =

1010 
dbv
->
	`txn_cov
(dbv, 
c_li
, 
cou
, 

, 
ags
)) != 0) {

1011 
	`__os_
(
dbv
, 
c_li
);

1012 
	`DB_ERROR
(
this
, "DbEnv::txn_cov", 
t
, 
	`r_picy
());

1013  (
t
);

1016 
i
 = 0; i < *

; i++) {

1017 
li
[
i
].
txn
 = 
w
 
	`DbTxn
();

1018 
li
[
i
].
txn
->
imp_
 = 
c_li
[i].txn;

1019 
	`memy
(
li
[
i
].
gid
, 
c_li
[i].gid,

1020 (
li
[
i
].
gid
));

1023 
	`__os_
(
dbv
, 
c_li
);

1026 
	}
}

1028 
DBENV_METHOD
(
txn_
, (
DB_TXN_STAT
 **
p
, 
u_t32_t
 
ags
),

1029 (
dbv
, 
p
, 
ags
))

1030 
DBENV_METHOD
(
txn__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

1032 
DbEnv
::
p_t_t
(
myid
, (*
g
)(DbEnv *,

1033 cڡ 
Dbt
 *, cڡ Db*, cڡ 
DbL
 *, , 
u_t32_t
))

1035 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

1036 
t
;

1038 
p_nd_back_
 = 
g
;

1039 i((
t
 = 
dbv
->
	`p_t_t
(dbv, 
myid
,

1040 
g
 =0 ? 0 : 
_p_nd_r_c
)) != 0)

1041 
	`DB_ERROR
(
this
, "DbEnv::p_t_t", 
t
, 
	`r_picy
());

1043  (
t
);

1044 
	}
}

1046 
DBENV_METHOD
(
p_e
, (
nses
, 
nves
, 
u_t32_t
 
ags
),

1047 (
dbv
, 
nses
, 
nves
, 
ags
))

1048 
DBENV_METHOD
(
p_ush
, (), (
dbv
))

1049 
DBENV_METHOD
(
p_g_cfig
, (
u_t32_t
 
which
, *
of
),

1050 (
dbv
, 
which
, 
of
))

1051 
DBENV_METHOD
(
t_p_que
, (
u_t32_t
 
m
, u_t32_
max
), (
dbv
, min, max))

1053 
DbEnv
::
	$p_oss_mesge
(
Dbt
 *
cڌ
,

1054 
Dbt
 *
c
, 
id
, 
DbL
 *
t_lp
)

1056 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

1057 
t
;

1059 
t
 = 
dbv
->
	`p_oss_mesge
(dbv, 
cڌ
, 
c
, 
id
, 
t_lp
);

1060 i(!
	`DB_RETOK_REPPMSG
(
t
))

1061 
	`DB_ERROR
(
this
, "DbEnv::p_oss_mesge", 
t
,

1062 
	`r_picy
());

1064  (
t
);

1065 
	}
}

1067 
DBENV_METHOD
(
p_t_cfig
,

1068 (
u_t32_t
 
which
, 
off
), (
dbv
, which, onoff))

1069 
DBENV_METHOD
(
p_t
,

1070 (
Dbt
 *
cook
, 
u_t32_t
 
ags
),

1071 (
dbv
, (
DBT
 *)
cook
, 
ags
))

1073 
DBENV_METHOD
(
p_
, (
DB_REP_STAT
 **
p
, 
u_t32_t
 
ags
),

1074 (
dbv
, 
p
, 
ags
))

1075 
DBENV_METHOD
(
p__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

1076 
DBENV_METHOD
(
p_sync
, (
u_t32_t
 
ags
), (
dbv
, flags))

1078 
DBENV_METHOD
(
p_t_a
, (
u_t32_t
 
ock_s_
, u_t32_
ags
),

1079 (
dbv
, 
ock_s_
, 
ags
))

1080 
DBENV_METHOD
(
p_g_lim
, (
u_t32_t
 *
gby
, u_t32_*
by
),

1081 (
dbv
, 
gby
, 
by
))

1082 
DBENV_METHOD
(
p_t_lim
, (
u_t32_t
 
gbys
, u_t32_
bys
),

1083 (
dbv
, 
gbys
, 
bys
))

1087 
DBENV_METHOD
(
p_g_nses
, (*
n
), (
dbv
,))

1088 
DBENV_METHOD
(
p_t_nses
, (
n
), (
dbv
,))

1089 
DBENV_METHOD
(
p_g_iܙy
, (*
iܙy
),

1090 (
dbv
, 
iܙy
))

1091 
DBENV_METHOD
(
p_t_iܙy
, (
iܙy
),

1092 (
dbv
, 
iܙy
))

1093 
DBENV_METHOD
(
p_g_timeout
, (
which
, 
db_timeout_t
 * 
timeout
),

1094 (
dbv
, 
which
, 
timeout
))

1095 
DBENV_METHOD
(
p_t_timeout
, (
which
, 
db_timeout_t
 
timeout
),

1096 (
dbv
, 
which
, 
timeout
))

1097 
DBENV_METHOD
(
pmgr_add_me_se
, (cڡ * 
ho
, 
u_t16_t
 
pt
,

1098 * 
eidp
, 
u_t32_t
 
ags
), (
dbv
, 
ho
, 
pt
,idp, flags))

1099 
DBENV_METHOD
(
pmgr_g_ack_picy
, (*
picy
), (
dbv
,olicy))

1100 
DBENV_METHOD
(
pmgr_t_ack_picy
, (
picy
), (
dbv
,olicy))

1101 
DBENV_METHOD
(
pmgr_t_lol_se
, (cڡ * 
ho
, 
u_t16_t
 
pt
,

1102 
u_t32_t
 
ags
), (
dbv
, 
ho
, 
pt
, flags))

1103 
DBENV_METHOD
(
pmgr_se_li
, (
u_t
 *
coup
, 
DB_REPMGR_SITE
 **
lip
),

1104 (
dbv
, 
coup
, 
lip
))

1105 
DBENV_METHOD
(
pmgr_t
, (
hads
, 
u_t32_t
 
ags
),

1106 (
dbv
, 
hads
, 
ags
))

1107 
DBENV_METHOD
(
pmgr_
, (
DB_REPMGR_STAT
 **
p
, 
u_t32_t
 
ags
),

1108 (
dbv
, 
p
, 
ags
))

1109 
DBENV_METHOD
(
pmgr__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

1113 
DBENV_METHOD
(
g_timeout
,

1114 (
db_timeout_t
 *
timeou
, 
u_t32_t
 
ags
),

1115 (
dbv
, 
timeou
, 
ags
))

1116 
DBENV_METHOD
(
t_timeout
,

1117 (
db_timeout_t
 
timeout
, 
u_t32_t
 
ags
),

1118 (
dbv
, 
timeout
, 
ags
))

1121 *
DbEnv
::
	$vsi
(*
maj
, *
m
, *
tch
)

1123  (
	`db_vsi
(
maj
, 
m
, 
tch
));

1124 
	}
}

1127 
DbEnv
 *DbEnv::
	$wp_DB_ENV
(
DB_ENV
 *
dbv
)

1129 
DbEnv
 *
wed_v
 = 
	`g_DbEnv
(
dbv
);

1130  (
wed_v
 !
NULL
? wed_v : 
w
 
	`DbEnv
(
dbv
, 0);

1131 
	}
}

	@../cxx/cxx_except.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 cڡ 
	gMAX_DESCRIPTION_LENGTH
 = 1024;

22 *
	$dupSg
(cڡ *
s
)

24 *
r
 = 
w
 [
	`
(
s
)+1];

25 
	`ry
(
r
, 
s
);

26  (
r
);

27 
	}
}

35 
	gDbExi
::~
	$DbExi
(
	$throw
()

37 
de
 [] 
wh_
;

38 
	}
}

40 
	gDbExi
::
	$DbExi
(
r
)

41 : 
	`r_
(
r
)

42 , 
	$v_
(0)

44 
	`desibe
(0, 0);

45 
	}
}

47 
	gDbExi
::
	$DbExi
(cڡ *
desti
)

48 : 
	`r_
(0)

49 , 
	$v_
(0)

51 
	`desibe
(0, 
desti
);

52 
	}
}

54 
	gDbExi
::
	$DbExi
(cڡ *
desti
, 
r
)

55 : 
	`r_
(
r
)

56 , 
	$v_
(0)

58 
	`desibe
(0, 
desti
);

59 
	}
}

61 
	gDbExi
::
	$DbExi
(cڡ *
efix
, cڡ *
desti
, 
r
)

62 : 
	`r_
(
r
)

63 , 
	$v_
(0)

65 
	`desibe
(
efix
, 
desti
);

66 
	}
}

68 
	gDbExi
::
	$DbExi
(cڡ 
DbExi
 &
th
)

69 : 
	`__DB_STD
(
exi
)()

70 , 
	`wh_
(
	`dupSg
(
th
.
wh_
))

71 , 
	`r_
(
th
.
r_
)

72 , 
	$v_
(0)

74 
	}
}

76 
	gDbExi
 &DbExi::
ݔ
 = (cڡ 
DbExi
 &
th
)

78 i(
this
 !&
th
) {

79 
r_
 = 
th
.err_;

80 
	gde
 [] 
	gwh_
;

81 
	gwh_
 = 
dupSg
(
th
.
wh_
);

83  (*
	gthis
);

86 
	gDbExi
::
	$desibe
(cڡ *
efix
, cڡ *
desti
)

88 *
msgbuf
, *
p
, *
d
;

90 
msgbuf
 = 
w
 [
MAX_DESCRIPTION_LENGTH
];

91 
p
 = 
msgbuf
;

92 
d
 = 
msgbuf
 + 
MAX_DESCRIPTION_LENGTH
 - 1;

94 i(
efix
 !
NULL
) {

95 
	`y
(
p
, 
efix
, (< 
d
) ?nd -: 0);

96 
p
 +
	`
(
efix
);

97 
	`y
(
p
, ": ", (< 
d
) ?nd -: 0);

98 
p
 += 2;

100 i(
desti
 !
NULL
) {

101 
	`y
(
p
, 
desti
, (< 
d
) ?nd -: 0);

102 
p
 +
	`
(
desti
);

103 i(
r_
 != 0) {

104 
	`y
(
p
, ": ", (< 
d
) ?nd -: 0);

105 
p
 += 2;

108 i(
r_
 != 0) {

109 
	`y
(
p
, 
	`db_
(
r_
), (< 
d
) ?nd -: 0);

110 
p
 +
	`
(
	`db_
(
r_
));

117 i(
p
 >
d
)

118 *
d
 = '\0';

120 
wh_
 = 
	`dupSg
(
msgbuf
);

121 
de
 [] 
msgbuf
;

122 
	}
}

124 
	gDbExi
::
	$g_o
() const

126  (
r_
);

127 
	}
}

129 cڡ *
	gDbExi
::
	$wh
(cڡ 
	$throw
()

131  (
wh_
);

132 
	}
}

134 
DbEnv
 *
	gDbExi
::
	$g_v
() const

136  
v_
;

137 
	}
}

139 
	gDbExi
::
	$t_v
(
DbEnv
 *
v
)

141 
v_

v
;

142 
	}
}

150 cڡ *
	gmemy_r_desc
 = "Dbtotargenough forvailable data";

151 
	gDbMemyExi
::~
	$DbMemyExi
(
	$throw
()

153 
	}
}

155 
DbMemyExi
::
	$DbMemyExi
(
Dbt
 *
dbt
)

156 : 
	`DbExi
(
memy_r_desc
, 
DB_BUFFER_SMALL
)

157 , 
	$dbt_
(
dbt
)

159 
	}
}

161 
	gDbMemyExi
::
	$DbMemyExi
(cڡ *
efix
, 
Dbt
 *
dbt
)

162 : 
	`DbExi
(
efix
, 
memy_r_desc
, 
DB_BUFFER_SMALL
)

163 , 
	$dbt_
(
dbt
)

165 
	}
}

167 
	gDbMemyExi
::
	$DbMemyExi
(cڡ 
DbMemyExi
 &
th
)

168 : 
	`DbExi
(
th
)

169 , 
	$dbt_
(
th
.
dbt_
)

171 
	}
}

173 
	gDbMemyExi


174 &
	gDbMemyExi
::
ݔ
 =(cڡ 
DbMemyExi
 &
th
)

176 i(
this
 !&
th
) {

177 
DbExi
::
ݔ
=(
th
);

178 
	gdbt_
 = 
th
.
dbt_
;

180  (*
	gthis
);

183 
Dbt
 *
	gDbMemyExi
::
	$g_dbt
() const

185  (
dbt_
);

186 
	}
}

194 
	gDbDdlockExi
::~
	$DbDdlockExi
(
	$throw
()

196 
	}
}

198 
DbDdlockExi
::
	$DbDdlockExi
(cڡ *
desti
)

199 : 
	$DbExi
(
desti
, 
DB_LOCK_DEADLOCK
)

201 
	}
}

203 
	gDbDdlockExi
::
	$DbDdlockExi
(cڡ 
DbDdlockExi
 &
th
)

204 : 
	$DbExi
(
th
)

206 
	}
}

208 
DbDdlockExi


209 &
DbDdlockExi
::
ݔ
 =(cڡ DbDdlockExi &
th
)

211 i(
this
 !&
th
)

212 
DbExi
::
ݔ
=(
th
);

213  (*
	gthis
);

222 
	gDbLockNGedExi
::~
	$DbLockNGedExi
(
	$throw
()

224 
de
 
lock_
;

225 
	}
}

227 
	gDbLockNGedExi
::
	$DbLockNGedExi
(cڡ *
efix
,

228 
db_lock_t
 

, 
db_lockmode_t
 
mode
, cڡ 
Dbt
 *
obj
, cڡ 
DbLock
 
lock
,

229 
dex
)

230 : 
	`DbExi
(
efix
, 
DbEnv
::
	`
(
DB_LOCK_NOTGRANTED
),

231 
DB_LOCK_NOTGRANTED
)

232 , 
	`_
(

)

233 , 
	`mode_
(
mode
)

234 , 
	`obj_
(
obj
)

235 , 
	`lock_
(
w
 
	`DbLock
(
lock
))

236 , 
	$dex_
(
dex
)

238 
	}
}

240 
	gDbLockNGedExi
::
	$DbLockNGedExi
(cڡ *
desti
)

241 : 
	`DbExi
(
desti
, 
DB_LOCK_NOTGRANTED
)

242 , 
	`_
(
DB_LOCK_GET
)

243 , 
	`mode_
(
DB_LOCK_NG
)

244 , 
	`obj_
(
NULL
)

245 , 
	`lock_
(
NULL
)

246 , 
	$dex_
(0)

248 
	}
}

250 
	gDbLockNGedExi
::
DbLockNGedExi


251 (cڡ 
DbLockNGedExi
 &
th
)

252 : 
	$DbExi
(
th
)

254 
_
 = 
th
.op_;

255 
mode_
 = 
th
.mode_;

256 
obj_
 = 
th
.obj_;

257 
lock_
 = (
th
.lock_ !
NULL
? 
w
 
	`DbLock
(*that.lock_) : NULL;

258 
dex_
 = 
th
.index_;

259 
	}
}

261 
	gDbLockNGedExi


262 &
	gDbLockNGedExi
::
ݔ
 =(cڡ 
DbLockNGedExi
 &
th
)

264 i(
this
 !&
th
) {

265 
DbExi
::
ݔ
=(
th
);

266 
	g_
 = 
th
.
_
;

267 
	gmode_
 = 
th
.
mode_
;

268 
	gobj_
 = 
th
.
obj_
;

269 
	glock_
 = (
th
.
lock_
 !
NULL
? 
w
 
DbLock
(*that.lock_) : NULL;

270 
	gdex_
 = 
th
.
dex_
;

272  (*
	gthis
);

275 
db_lock_t
 
	gDbLockNGedExi
::
	$g_
() const

277  
_
;

278 
	}
}

280 
db_lockmode_t
 
	gDbLockNGedExi
::
	$g_mode
() const

282  
mode_
;

283 
	}
}

285 cڡ 
Dbt
* 
	gDbLockNGedExi
::
	$g_obj
() const

287  
obj_
;

288 
	}
}

290 
DbLock
* 
	gDbLockNGedExi
::
	$g_lock
() const

292  
lock_
;

293 
	}
}

295 
	gDbLockNGedExi
::
	$g_dex
() const

297  
dex_
;

298 
	}
}

306 
	gDbRHdDdExi
::~
	$DbRHdDdExi
(
	$throw
()

308 
	}
}

310 
DbRHdDdExi
::
	$DbRHdDdExi
(cڡ *
desti
)

311 : 
	$DbExi
(
desti
, 
DB_REP_HANDLE_DEAD
)

313 
	}
}

315 
	gDbRHdDdExi
::
DbRHdDdExi


316 (cڡ 
DbRHdDdExi
 &
th
)

317 : 
	$DbExi
(
th
)

319 
	}
}

321 
DbRHdDdExi


322 &
DbRHdDdExi
::
ݔ
 =(cڡ DbRHdDdExi &
th
)

324 i(
this
 !&
th
)

325 
DbExi
::
ݔ
=(
th
);

326  (*
	gthis
);

335 
	gDbRunRecovyExi
::~
	$DbRunRecovyExi
(
	$throw
()

337 
	}
}

339 
DbRunRecovyExi
::
	$DbRunRecovyExi
(cڡ *
desti
)

340 : 
	$DbExi
(
desti
, 
DB_RUNRECOVERY
)

342 
	}
}

344 
	gDbRunRecovyExi
::
DbRunRecovyExi


345 (cڡ 
DbRunRecovyExi
 &
th
)

346 : 
	$DbExi
(
th
)

348 
	}
}

350 
DbRunRecovyExi


351 &
DbRunRecovyExi
::
ݔ
 =(cڡ DbRunRecovyExi &
th
)

353 i(
this
 !&
th
)

354 
DbExi
::
ݔ
=(
th
);

355  (*
	gthis
);

	@../cxx/cxx_lock.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

22 
	gDbLock
::
	$DbLock
(
DB_LOCK
 
vue
)

23 : 
	$lock_
(
vue
)

25 
	}
}

27 
DbLock
::
	$DbLock
()

29 
	`memt
(&
lock_
, 0, (
DB_LOCK
));

30 
	}
}

32 
	gDbLock
::
	$DbLock
(cڡ 
DbLock
 &
th
)

33 : 
	$lock_
(
th
.
lock_
)

35 
	}
}

37 
DbLock
 &DbLock::
ݔ
 = (cڡ DbLock &
th
)

39 
lock_
 = 
th
.lock_;

40  (*
	gthis
);

	@../cxx/cxx_logc.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 
	~"dbc/db_ge.h
"

17 
	~"dbc_auto/db_auto.h
"

18 
	~"dbc_auto/d_auto.h
"

19 
	~"dbc/db_dich.h
"

20 
	~"dbc_auto/db_ext.h
"

21 
	~"dbc_auto/comm_ext.h
"

26 
	gDbLogc
::~
	$DbLogc
()

28 
	}
}

31 
DbLogc
::
	$o
(
u_t32_t
 
_ags
)

33 
DB_LOGC
 *
logc
 = 
this
;

34 
t
;

35 
DbEnv
 *
dbv2
 = DbEnv::
	`g_DbEnv
(
logc
->
dbv
);

37 
t
 = 
logc
->
	`o
ogc, 
_ags
);

39 i(!
	`DB_RETOK_STD
(
t
))

40 
	`DB_ERROR
(
dbv2
, "DbLogc::o", 
t
, 
ON_ERROR_UNKNOWN
);

42  (
t
);

43 
	}
}

46 
	gDbLogc
::
	$g
(
DbL
 *
g_l
, 
Dbt
 *
da
, 
u_t32_t
 
_ags
)

48 
DB_LOGC
 *
logc
 = 
this
;

49 
t
;

51 
t
 = 
logc
->
	`g
ogc, 
g_l
, 
da
, 
_ags
);

53 i(!
	`DB_RETOK_LGGET
(
t
)) {

54 i(
t
 =
DB_BUFFER_SMALL
)

55 
	`DB_ERROR_DBT
(
DbEnv
::
	`g_DbEnv
(
logc
->
dbv
),

56 "DbLogc::g", 
da
, 
ON_ERROR_UNKNOWN
);

58 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
logc
->
dbv
),

59 "DbLogc::g", 
t
, 
ON_ERROR_UNKNOWN
);

62  (
t
);

63 
	}
}

66 
	gDbLogc
::
	$vsi
(
u_t32_t
 *
vsip
, u_t32_
_ags
)

68 
DB_LOGC
 *
logc
 = 
this
;

69 
t
;

71 
t
 = 
logc
->
	`vsi
ogc, 
vsip
, 
_ags
);

73 i(!
	`DB_RETOK_LGGET
(
t
))

74 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
logc
->
dbv
),

75 "DbLogc::vsi", 
t
, 
ON_ERROR_UNKNOWN
);

77  (
t
);

78 
	}
}

	@../cxx/cxx_mpool.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

22 
	#DB_MPOOLFILE_METHOD
(
_me
, 
_gec
, 
_gli
, 
_tok
) \

23 
DbMpoFe
::
_me
 
_gec
 \

25 
t
; \

26 
DB_MPOOLFILE
 *
mpf
 = 
	`unwp
(
this
); \

28 i(
mpf
 =
NULL
) \

29 
t
 = 
EINVAL
; \

31 
t
 = 
mpf
->
_me
 
_gli
; \

32 i(!
	`_tok
(
t
)) \

33 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
mpf
->
dbv
), \

34 "DbMpoFe::"#_me, 
t
, 
ON_ERROR_UNKNOWN
); \

35  (
t
); \

36 }

	)

38 
	#DB_MPOOLFILE_METHOD_VOID
(
_me
, 
_gec
, 
_gli
) \

39 
DbMpoFe
::
_me
 
_gec
 \

41 
DB_MPOOLFILE
 *
mpf
 = 
	`unwp
(
this
); \

43 
mpf
->
_me
 
_gli
; \

44 }

	)

52 
	gDbMpoFe
::
	$DbMpoFe
()

53 : 
	$imp_
(0)

55 
	}
}

57 
DbMpoFe
::~
	$DbMpoFe
()

59 
	}
}

61 
DbMpoFe
::
	$o
(
u_t32_t
 
ags
)

63 
DB_MPOOLFILE
 *
mpf
 = 
	`unwp
(
this
);

64 
t
;

65 
DbEnv
 *
dbv
 = DbEnv::
	`g_DbEnv
(
mpf
->dbenv);

67 i(
mpf
 =
NULL
)

68 
t
 = 
EINVAL
;

70 
t
 = 
mpf
->
	`o
(mpf, 
ags
);

72 
imp_
 = 0;

76 
de
 
this
;

78 i(!
	`DB_RETOK_STD
(
t
))

79 
	`DB_ERROR
(
dbv
, "DbMpoFe::o", 
t
, 
ON_ERROR_UNKNOWN
);

81  (
t
);

82 
	}
}

84 
DB_MPOOLFILE_METHOD
(
g
,

85 (
db_pgno_t
 *
pgnddr
, 
DbTxn
 *
txn
, 
u_t32_t
 
ags
, *
g
),

86 (
mpf
, 
pgnddr
, 
unwp
(
txn
), 
ags
, 
g
), 
DB_RETOK_MPGET
)

87 
DB_MPOOLFILE_METHOD
(
ݒ
,

88 (cڡ *
fe
, 
u_t32_t
 
ags
, 
mode
, 
size_t
 
gesize
),

89 (
mpf
, 
fe
, 
ags
, 
mode
, 
gesize
), 
DB_RETOK_STD
)

90 
DB_MPOOLFILE_METHOD
(
put
,

91 (*
pgaddr
, 
DB_CACHE_PRIORITY
 
iܙy
, 
u_t32_t
 
ags
),

92 (
mpf
, 
pgaddr
, 
iܙy
, 
ags
), 
DB_RETOK_STD
)

93 
DB_MPOOLFILE_METHOD
(
g_r_n
, (
u_t32_t
 *

),

94 (
mpf
, 

), 
DB_RETOK_STD
)

95 
DB_MPOOLFILE_METHOD
(
t_r_n
, (
u_t32_t
 
n
),

96 (
mpf
, 
n
), 
DB_RETOK_STD
)

97 
DB_MPOOLFILE_METHOD
(
g_feid
, (
u_t8_t
 *
feid
),

98 (
mpf
, 
feid
), 
DB_RETOK_STD
)

99 
DB_MPOOLFILE_METHOD
(
t_feid
, (
u_t8_t
 *
feid
),

100 (
mpf
, 
feid
), 
DB_RETOK_STD
)

101 
DB_MPOOLFILE_METHOD
(
g_ags
, (
u_t32_t
 *
ag
),

102 (
mpf
, 
ag
), 
DB_RETOK_STD
)

103 
DB_MPOOLFILE_METHOD
(
t_ags
, (
u_t32_t
 
ags
, 
off
),

104 (
mpf
, 
ags
, 
off
), 
DB_RETOK_STD
)

105 
DB_MPOOLFILE_METHOD
(
g_y
, (*
yp
),

106 (
mpf
, 
yp
), 
DB_RETOK_STD
)

107 
DB_MPOOLFILE_METHOD
(
t_y
, (
y
),

108 (
mpf
, 
y
), 
DB_RETOK_STD
)

109 
DB_MPOOLFILE_METHOD
(
g_ϡ_pgno
, (
db_pgno_t
 *
pgn
),

110 (
mpf
, 
pgn
), 
DB_RETOK_STD
)

111 
DB_MPOOLFILE_METHOD
(
g_l_offt
, (
t32_t
 *
off
),

112 (
mpf
, 
off
), 
DB_RETOK_STD
)

113 
DB_MPOOLFILE_METHOD
(
t_l_offt
, (
t32_t
 
offt
),

114 (
mpf
, 
offt
), 
DB_RETOK_STD
)

115 
DB_MPOOLFILE_METHOD
(
g_maxsize
, (
u_t32_t
 *
gby
, u_t32_*
by
),

116 (
mpf
, 
gby
, 
by
), 
DB_RETOK_STD
)

117 
DB_MPOOLFILE_METHOD
(
t_maxsize
, (
u_t32_t
 
gbys
, u_t32_
bys
),

118 (
mpf
, 
gbys
, 
bys
), 
DB_RETOK_STD
)

119 
DB_MPOOLFILE_METHOD
(
g_pgcook
, (
DBT
 *
dbt
),

120 (
mpf
, 
dbt
), 
DB_RETOK_STD
)

121 
DB_MPOOLFILE_METHOD
(
t_pgcook
, (
DBT
 *
dbt
),

122 (
mpf
, 
dbt
), 
DB_RETOK_STD
)

123 
DB_MPOOLFILE_METHOD
(
g_iܙy
, (
DB_CACHE_PRIORITY
 *
iܙyp
),

124 (
mpf
, 
iܙyp
), 
DB_RETOK_STD
)

125 
DB_MPOOLFILE_METHOD
(
t_iܙy
, (
DB_CACHE_PRIORITY
 
iܙy
),

126 (
mpf
, 
iܙy
), 
DB_RETOK_STD
)

127 
DB_MPOOLFILE_METHOD
(
sync
, (),

128 (
mpf
), 
DB_RETOK_STD
)

	@../cxx/cxx_multi.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

15 
	gDbMuɝIt
::
	$DbMuɝIt
(cڡ 
Dbt
 &
dbt
)

16 : 
	`da_
((
u_t8_t
*)
dbt
.
	`g_da
()),

17 
	`p_
((
u_t32_t
*)(
da_
 + 
dbt
.
	`g_un
() - (u_int32_t)))

19 
	}
}

21 
bo
 
	gDbMuɝDaIt
::
	$xt
(
Dbt
 &
da
)

23 i(*
p_
 =(
u_t32_t
)-1) {

24 
da
.
	`t_da
(0);

25 
da
.
	`t_size
(0);

26 
p_
 = 0;

28 
da
.
	`t_da
(
da_
 + *
p_
--);

29 
da
.
	`t_size
(*
p_
--);

30 i(
da
.
	`g_size
(=0 && da.
	`g_da
(=
da_
)

31 
da
.
	`t_da
(0);

33  (
p_
 != 0);

34 
	}
}

36 
bo
 
	gDbMuɝKeyDaIt
::
	$xt
(
Dbt
 &
key
, Db&
da
)

38 i(*
p_
 =(
u_t32_t
)-1) {

39 
key
.
	`t_da
(0);

40 
key
.
	`t_size
(0);

41 
da
.
	`t_da
(0);

42 
da
.
	`t_size
(0);

43 
p_
 = 0;

45 
key
.
	`t_da
(
da_
 + *
p_
--);

46 
key
.
	`t_size
(*
p_
--);

47 
da
.
	`t_da
(
da_
 + *
p_
--);

48 
da
.
	`t_size
(*
p_
--);

50  (
p_
 != 0);

51 
	}
}

53 
bo
 
	gDbMuɝReoDaIt
::
	$xt
(
db_o_t
 &
o
, 
Dbt
 &
da
)

55 i(*
p_
 =(
u_t32_t
)0) {

56 
o
 = 0;

57 
da
.
	`t_da
(0);

58 
da
.
	`t_size
(0);

59 
p_
 = 0;

61 
o
 = *
p_
--;

62 
da
.
	`t_da
(
da_
 + *
p_
--);

63 
da
.
	`t_size
(*
p_
--);

65  (
p_
 != 0);

66 
	}
}

	@../cxx/cxx_seq.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

22 
	#DBSEQ_METHOD
(
_me
, 
_gec
, 
_gli
, 
_deru
) \

23 
DbSequ
::
_me
 
_gec
 \

25 
t
; \

26 
DB_SEQUENCE
 *
q
 = 
	`unwp
(
this
); \

27 
DbEnv
 *
dbv
 = DbEnv::
	`g_DbEnv
(
q
->
q_dbp
->dbenv); \

29 
t
 = 
q
->
_me
 
_gli
; \

30 i(
_deru
) \

31 
imp_
 = 0; \

32 i(!
	`DB_RETOK_STD
(
t
)) \

33 
	`DB_ERROR
(
dbv
, \

34 "DbSequ::" #_me, 
t
, 
ON_ERROR_UNKNOWN
); \

35  (
t
); \

36 }

	)

38 
	gDbSequ
::
	$DbSequ
(
Db
 *
db
, 
u_t32_t
 
ags
)

39 : 
	$imp_
(0)

41 
DB_SEQUENCE
 *
q
;

42 
t
;

44 i((
t
 = 
	`db_qu_
(&
q
, 
	`unwp
(
db
), 
ags
)) != 0)

45 
	`DB_ERROR
(
db
->
	`g_v
(), "DbSequ::DbSequ", 
t
,

46 
ON_ERROR_UNKNOWN
);

48 
imp_
 = 
q
;

49 
q
->
i_
 = 
this
;

51 
	}
}

53 
	gDbSequ
::
	$DbSequ
(
DB_SEQUENCE
 *
q
)

54 : 
	$imp_
(
q
)

56 
q
->
i_
 = 
this
;

57 
	}
}

59 
	gDbSequ
::~
	$DbSequ
()

61 
DB_SEQUENCE
 *
q
;

63 
q
 = 
	`unwp
(
this
);

64 i(
q
 !
NULL
)

65 ()
q
->
	`o
(seq, 0);

66 
	}
}

68 
DBSEQ_METHOD
(
ݒ
, (
DbTxn
 *
txnid
, 
Dbt
 *
key
, 
u_t32_t
 
ags
),

69 (
q
, 
unwp
(
txnid
), 
key
, 
ags
), 0)

70 
DBSEQ_METHOD
(
l_vue
, (
db_q_t
 
vue
), (
q
, value), 0)

71 
DBSEQ_METHOD
(
o
, (
u_t32_t
 
ags
), (
q
, flags), 1)

72 
DBSEQ_METHOD
(
move
, (
DbTxn
 *
txnid
, 
u_t32_t
 
ags
),

73 (
q
, 
unwp
(
txnid
), 
ags
), 1)

74 
DBSEQ_METHOD
(

, (
DB_SEQUENCE_STAT
 **

, 
u_t32_t
 
ags
),

75 (
q
, 

, 
ags
), 0)

76 
DBSEQ_METHOD
(
_t
, (
u_t32_t
 
ags
), (
q
, flags), 0)

78 
DBSEQ_METHOD
(
g
,

79 (
DbTxn
 *
txnid
, 
t32_t
 
d
, 
db_q_t
 *

, 
u_t32_t
 
ags
),

80 (
q
, 
unwp
(
txnid
), 
d
, 

, 
ags
), 0)

81 
DBSEQ_METHOD
(
g_chesize
, (
t32_t
 *
siz
), (
q
, sizep), 0)

82 
DBSEQ_METHOD
(
t_chesize
, (
t32_t
 
size
), (
q
, size), 0)

83 
DBSEQ_METHOD
(
g_ags
, (
u_t32_t
 *
ag
), (
q
, flagsp), 0)

84 
DBSEQ_METHOD
(
t_ags
, (
u_t32_t
 
ags
), (
q
, flags), 0)

85 
DBSEQ_METHOD
(
g_nge
, (
db_q_t
 *
mp
, db_q_*
maxp
), (
q
, minp, maxp), 0)

86 
DBSEQ_METHOD
(
t_nge
, (
db_q_t
 
m
, db_q_
max
), (
q
, min, max), 0)

88 
Db
 *
	gDbSequ
::
	$g_db
()

90 
DB_SEQUENCE
 *
q
 = 
	`unwp
(
this
);

91 
DB
 *
db
;

92 ()
q
->
	`g_db
(q, &
db
);

93  
Db
::
	`g_Db
(
db
);

94 
	}
}

96 
Dbt
 *
	gDbSequ
::
	$g_key
()

98 
DB_SEQUENCE
 *
q
 = 
	`unwp
(
this
);

99 
	`memt
(&
key_
, 0, (
DBT
));

100 ()
q
->
	`g_key
(q, &
key_
);

101  
Dbt
::
	`g_Dbt
(&
key_
);

102 
	}
}

105 
DbSequ
 *
	gDbSequ
::
	$wp_DB_SEQUENCE
(
DB_SEQUENCE
 *
q
)

107 
DbSequ
 *
wed_q
 = 
	`g_DbSequ
(
q
);

108  (
wed_q
 !
NULL
? wed_q : 
w
 
	`DbSequ
(
q
);

109 
	}
}

	@../cxx/cxx_txn.cpp

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 
	~"db_cxx.h
"

14 
	~"dbc/cxx_t.h
"

16 
	~"dbc/txn.h
"

24 
	#DBTXN_METHOD
(
_me
, 
_de
, 
_gec
, 
_gli
) \

25 
DbTxn
::
_me
 
_gec
 \

27 
t
; \

28 
DB_TXN
 *
txn
 = 
	`unwp
(
this
); \

29 
DbEnv
 *
dbv
 = DbEnv::
	`g_DbEnv
(
txn
->
mg
->dbenv); \

31 
t
 = 
txn
->
_me
 
_gli
; \

33 i(
_de
) \

34 
de
 
this
; \

35 i(!
	`DB_RETOK_STD
(
t
)) \

36 
	`DB_ERROR
(
dbv
, "DbTxn::" #_me, 
t
, 
ON_ERROR_UNKNOWN
); \

37  (
t
); \

38 }

	)

41 
	gDbTxn
::
	$DbTxn
()

42 : 
	$imp_
(0)

44 
	}
}

46 
DbTxn
::
	$DbTxn
(
DB_TXN
 *
txn
)

47 : 
	$imp_
(
txn
)

49 
txn
->
i_
 = 
this
;

50 
	}
}

52 
	gDbTxn
::~
	$DbTxn
()

54 
	}
}

56 
DBTXN_METHOD
(
abt
, 1, (), (
txn
))

57 
DBTXN_METHOD
(
comm
, 1, (
u_t32_t
 
ags
), (
txn
, flags))

58 
DBTXN_METHOD
(
disrd
, 1, (
u_t32_t
 
ags
), (
txn
, flags))

60 
u_t32_t
 
	gDbTxn
::
	$id
()

62 
DB_TXN
 *
txn
;

64 
txn
 = 
	`unwp
(
this
);

65  (
txn
->
	`id
(txn));

66 
	}
}

68 
DBTXN_METHOD
(
g_me
, 0, (cڡ **
m
), (
txn
,amep))

69 
DBTXN_METHOD
(
e
, 0, (
u_t8_t
 *
gid
), (
txn
, gid))

70 
DBTXN_METHOD
(
t_me
, 0, (cڡ *
me
), (
txn
,ame))

71 
DBTXN_METHOD
(
t_timeout
, 0, (
db_timeout_t
 
timeout
, 
u_t32_t
 
ags
),

72 (
txn
, 
timeout
, 
ags
))

75 
DbTxn
 *
	gDbTxn
::
	$wp_DB_TXN
(
DB_TXN
 *
txn
)

77 
DbTxn
 *
wed_txn
 = 
	`g_DbTxn
(
txn
);

78  (
wed_txn
 !
NULL
? wed_tx: 
w
 
	`DbTxn
(
txn
);

79 
	}
}

	@../db/crdel_auto.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_dich.h
"

9 
	~"dbc/db_am.h
"

10 
	~"dbc/log.h
"

11 
	~"dbc/txn.h
"

18 
	$__d_masub_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ge
, 
l
)

19 
DB
 *
dbp
;

20 
DB_TXN
 *
tx
;

21 
DB_LSN
 *
t_lp
;

22 
u_t32_t
 
ags
;

23 
db_pgno_t
 
pgno
;

24 cڡ 
DBT
 *
ge
;

25 
DB_LSN
 * 
l
;

27 
DBT
 
logc
;

28 
DB_ENV
 *
dbv
;

29 
DB_TXNLOGREC
 *

;

30 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

31 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

32 
u_t
 
ad
;

33 
u_t8_t
 *
bp
;

34 
is_dub
, 
t
;

36 
dbv
 = 
dbp
->dbenv;

37 
	`COMPQUIET
(

, 
NULL
);

39 
y
 = 
DB___d_masub
;

40 
ad
 = 0;

41 
p
 = 
t_lp
;

43 
t
 = 0;

45 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

46 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

47 i(
tx
 =
NULL
)

49 
is_dub
 = 0;

51 
is_dub
 = 1;

53 i(
tx
 =
NULL
) {

54 
txn_num
 = 0;

55 
lp
 = &
nu_l
;

56 
nu_l
.
fe
 =u_l.
offt
 = 0;

58 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

59 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

60  (
t
);

67 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

68 
txn_num
 = 
tx
->
txnid
;

71 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

72 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

73 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

74  (
t
);

76 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

77 + (
u_t32_t
)

78 + (
u_t32_t
)

79 + (
u_t32_t
+ (
ge
 =
NULL
 ? 0 :age->
size
)

80 + (*
l
);

81 i(
	`CRYPTO_ON
(
dbv
)) {

82 
ad
 =

83 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

84 
logc
.
size
 +
ad
;

87 i(
is_dub
 || 
tx
 =
NULL
) {

88 i((
t
 =

89 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

90  (
t
);

92 i((
t
 = 
	`__os_mloc
(
dbv
,

93 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

94  (
t
);

95 #ifde
DIAGNOSTIC


96 i((
t
 =

97 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

98 
	`__os_
(
dbv
, 

);

99  (
t
);

102 
logc
.
da
 = 

->data;

105 i(
ad
 > 0)

106 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

108 
bp
 = 
logc
.
da
;

110 
	`memy
(
bp
, &
y
, (rectype));

111 
bp
 +(
y
);

113 
	`memy
(
bp
, &
txn_num
, (txn_num));

114 
bp
 +(
txn_num
);

116 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

117 
bp
 +(
DB_LSN
);

119 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

120 
	`memy
(
bp
, &
ump
, (uinttmp));

121 
bp
 +(
ump
);

123 
ump
 = (
u_t32_t
)
pgno
;

124 
	`memy
(
bp
, &
ump
, (uinttmp));

125 
bp
 +(
ump
);

127 i(
ge
 =
NULL
) {

128 
zo
 = 0;

129 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

130 
bp
 +(
u_t32_t
);

132 
	`memy
(
bp
, &
ge
->
size
, (page->size));

133 
bp
 +(
ge
->
size
);

134 
	`memy
(
bp
, 
ge
->
da
,age->
size
);

135 
bp
 +
ge
->
size
;

138 i(
l
 !
NULL
) {

139 i(
tx
 !
NULL
) {

140 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

141 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

142 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

143  (
t
);

145 
	`memy
(
bp
, 
l
, (*lsn));

147 
	`memt
(
bp
, 0, (*
l
));

148 
bp
 +(*
l
);

150 
	`DB_ASSERT
(
dbv
,

151 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

153 i(
is_dub
 || 
tx
 =
NULL
) {

154 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

155 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

156 *
lp
 = *
p
;

157 i(
p
 !
t_lp
)

158 *
t_lp
 = *
p
;

161 
t
 = 0;

162 #ifde
DIAGNOSTIC


167 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

168 
y
 |
DB_debug_FLAG
;

169 
	`memy
(
logc
.
da
, &
y
, (rectype));

171 i(!
	`IS_REP_CLIENT
(
dbv
))

172 
t
 = 
	`__log_put
(
dbv
,

173 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

175 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

176 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

177 
	`LSN_NOT_LOGGED
(*
t_lp
);

180 #ifde
LOG_DIAGNOSTIC


181 i(
t
 != 0)

182 ()
	`__d_masub_t
(
dbv
,

183 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

186 #ifde
DIAGNOSTIC


187 
	`__os_
(
dbv
, 
logc
.
da
);

189 i(
is_dub
 || 
tx
 =
NULL
)

190 
	`__os_
(
dbv
, 
logc
.
da
);

192  (
t
);

193 
	}
}

200 
	$__d_masub_ad
(
dbv
, 
cbuf
, 
g
)

201 
DB_ENV
 *
dbv
;

202 *
cbuf
;

203 
__d_masub_gs
 **
g
;

205 
__d_masub_gs
 *
gp
;

206 
u_t32_t
 
ump
;

207 
u_t8_t
 *
bp
;

208 
t
;

210 i((
t
 = 
	`__os_mloc
(
dbv
,

211 (
__d_masub_gs
+ (
DB_TXN
), &
gp
)) != 0)

212  (
t
);

213 
bp
 = 
cbuf
;

214 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

215 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

217 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

218 
bp
 +(
gp
->
ty
);

220 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

221 
bp
 +(
gp
->
tx
->
txnid
);

223 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

224 
bp
 +(
DB_LSN
);

226 
	`memy
(&
ump
, 
bp
, (uinttmp));

227 
gp
->
feid
 = (
t32_t
)
ump
;

228 
bp
 +(
ump
);

230 
	`memy
(&
ump
, 
bp
, (uinttmp));

231 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

232 
bp
 +(
ump
);

234 
	`memt
(&
gp
->
ge
, 0, (argp->page));

235 
	`memy
(&
gp
->
ge
.
size
, 
bp
, (
u_t32_t
));

236 
bp
 +(
u_t32_t
);

237 
gp
->
ge
.
da
 = 
bp
;

238 
bp
 +
gp
->
ge
.
size
;

240 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

241 
bp
 +(
gp
->
l
);

243 *
g
 = 
gp
;

245 
	}
}

253 
	$__d_mem__log
(
dbv
, 
tx
, 
t_lp
, 
ags
,

254 
feid
, 
me
, 
fid
, 
pgsize
)

255 
DB_ENV
 *
dbv
;

256 
DB_TXN
 *
tx
;

257 
DB_LSN
 *
t_lp
;

258 
u_t32_t
 
ags
;

259 
t32_t
 
feid
;

260 cڡ 
DBT
 *
me
;

261 cڡ 
DBT
 *
fid
;

262 
u_t32_t
 
pgsize
;

264 
DBT
 
logc
;

265 
DB_TXNLOGREC
 *

;

266 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

267 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

268 
u_t
 
ad
;

269 
u_t8_t
 *
bp
;

270 
is_dub
, 
t
;

272 
	`COMPQUIET
(

, 
NULL
);

274 
y
 = 
DB___d_mem_
;

275 
ad
 = 0;

276 
p
 = 
t_lp
;

278 
t
 = 0;

280 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

281 i(
tx
 =
NULL
)

283 i(
tx
 =
NULL
)

285 
is_dub
 = 0;

287 
is_dub
 = 1;

289 i(
tx
 =
NULL
) {

290 
txn_num
 = 0;

291 
lp
 = &
nu_l
;

292 
nu_l
.
fe
 =u_l.
offt
 = 0;

294 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

295 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

296  (
t
);

303 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

304 
txn_num
 = 
tx
->
txnid
;

307 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

308 + (
u_t32_t
)

309 + (
u_t32_t
+ (
me
 =
NULL
 ? 0 :ame->
size
)

310 + (
u_t32_t
+ (
fid
 =
NULL
 ? 0 : fid->
size
)

311 + (
u_t32_t
);

312 i(
	`CRYPTO_ON
(
dbv
)) {

313 
ad
 =

314 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

315 
logc
.
size
 +
ad
;

318 i(
is_dub
 || 
tx
 =
NULL
) {

319 i((
t
 =

320 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

321  (
t
);

323 i((
t
 = 
	`__os_mloc
(
dbv
,

324 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

325  (
t
);

326 #ifde
DIAGNOSTIC


327 i((
t
 =

328 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

329 
	`__os_
(
dbv
, 

);

330  (
t
);

333 
logc
.
da
 = 

->data;

336 i(
ad
 > 0)

337 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

339 
bp
 = 
logc
.
da
;

341 
	`memy
(
bp
, &
y
, (rectype));

342 
bp
 +(
y
);

344 
	`memy
(
bp
, &
txn_num
, (txn_num));

345 
bp
 +(
txn_num
);

347 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

348 
bp
 +(
DB_LSN
);

350 
ump
 = (
u_t32_t
)
feid
;

351 
	`memy
(
bp
, &
ump
, (uinttmp));

352 
bp
 +(
ump
);

354 i(
me
 =
NULL
) {

355 
zo
 = 0;

356 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

357 
bp
 +(
u_t32_t
);

359 
	`memy
(
bp
, &
me
->
size
, (name->size));

360 
bp
 +(
me
->
size
);

361 
	`memy
(
bp
, 
me
->
da
,ame->
size
);

362 
bp
 +
me
->
size
;

365 i(
fid
 =
NULL
) {

366 
zo
 = 0;

367 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

368 
bp
 +(
u_t32_t
);

370 
	`memy
(
bp
, &
fid
->
size
, (fid->size));

371 
bp
 +(
fid
->
size
);

372 
	`memy
(
bp
, 
fid
->
da
, fid->
size
);

373 
bp
 +
fid
->
size
;

376 
ump
 = (
u_t32_t
)
pgsize
;

377 
	`memy
(
bp
, &
ump
, (uinttmp));

378 
bp
 +(
ump
);

380 
	`DB_ASSERT
(
dbv
,

381 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

383 i(
is_dub
 || 
tx
 =
NULL
) {

384 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

385 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

386 *
lp
 = *
p
;

387 i(
p
 !
t_lp
)

388 *
t_lp
 = *
p
;

391 
t
 = 0;

392 #ifde
DIAGNOSTIC


397 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

398 
y
 |
DB_debug_FLAG
;

399 
	`memy
(
logc
.
da
, &
y
, (rectype));

401 i(!
	`IS_REP_CLIENT
(
dbv
))

402 
t
 = 
	`__log_put
(
dbv
,

403 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

405 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

406 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

407 
	`LSN_NOT_LOGGED
(*
t_lp
);

410 #ifde
LOG_DIAGNOSTIC


411 i(
t
 != 0)

412 ()
	`__d_mem__t
(
dbv
,

413 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

416 #ifde
DIAGNOSTIC


417 
	`__os_
(
dbv
, 
logc
.
da
);

419 i(
is_dub
 || 
tx
 =
NULL
)

420 
	`__os_
(
dbv
, 
logc
.
da
);

422  (
t
);

423 
	}
}

430 
	$__d_mem__ad
(
dbv
, 
cbuf
, 
g
)

431 
DB_ENV
 *
dbv
;

432 *
cbuf
;

433 
__d_mem__gs
 **
g
;

435 
__d_mem__gs
 *
gp
;

436 
u_t32_t
 
ump
;

437 
u_t8_t
 *
bp
;

438 
t
;

440 i((
t
 = 
	`__os_mloc
(
dbv
,

441 (
__d_mem__gs
+ (
DB_TXN
), &
gp
)) != 0)

442  (
t
);

443 
bp
 = 
cbuf
;

444 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

445 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

447 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

448 
bp
 +(
gp
->
ty
);

450 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

451 
bp
 +(
gp
->
tx
->
txnid
);

453 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

454 
bp
 +(
DB_LSN
);

456 
	`memy
(&
ump
, 
bp
, (uinttmp));

457 
gp
->
feid
 = (
t32_t
)
ump
;

458 
bp
 +(
ump
);

460 
	`memt
(&
gp
->
me
, 0, (argp->name));

461 
	`memy
(&
gp
->
me
.
size
, 
bp
, (
u_t32_t
));

462 
bp
 +(
u_t32_t
);

463 
gp
->
me
.
da
 = 
bp
;

464 
bp
 +
gp
->
me
.
size
;

466 
	`memt
(&
gp
->
fid
, 0, (argp->fid));

467 
	`memy
(&
gp
->
fid
.
size
, 
bp
, (
u_t32_t
));

468 
bp
 +(
u_t32_t
);

469 
gp
->
fid
.
da
 = 
bp
;

470 
bp
 +
gp
->
fid
.
size
;

472 
	`memy
(&
ump
, 
bp
, (uinttmp));

473 
gp
->
pgsize
 = (
u_t32_t
)
ump
;

474 
bp
 +(
ump
);

476 *
g
 = 
gp
;

478 
	}
}

485 
	$__d_mem_me_log
(
dbv
, 
tx
, 
t_lp
, 
ags
,

486 
dme
, 
wme
, 
fid
)

487 
DB_ENV
 *
dbv
;

488 
DB_TXN
 *
tx
;

489 
DB_LSN
 *
t_lp
;

490 
u_t32_t
 
ags
;

491 cڡ 
DBT
 *
dme
;

492 cڡ 
DBT
 *
wme
;

493 cڡ 
DBT
 *
fid
;

495 
DBT
 
logc
;

496 
DB_TXNLOGREC
 *

;

497 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

498 
u_t32_t
 
zo
, 
y
, 
txn_num
;

499 
u_t
 
ad
;

500 
u_t8_t
 *
bp
;

501 
is_dub
, 
t
;

503 
	`COMPQUIET
(

, 
NULL
);

505 
y
 = 
DB___d_mem_me
;

506 
ad
 = 0;

507 
p
 = 
t_lp
;

509 
t
 = 0;

511 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

512 i(
tx
 =
NULL
)

514 i(
tx
 =
NULL
)

516 
is_dub
 = 0;

518 
is_dub
 = 1;

520 i(
tx
 =
NULL
) {

521 
txn_num
 = 0;

522 
lp
 = &
nu_l
;

523 
nu_l
.
fe
 =u_l.
offt
 = 0;

525 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

526 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

527  (
t
);

534 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

535 
txn_num
 = 
tx
->
txnid
;

538 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

539 + (
u_t32_t
+ (
dme
 =
NULL
 ? 0 : oldme->
size
)

540 + (
u_t32_t
+ (
wme
 =
NULL
 ? 0 :ewme->
size
)

541 + (
u_t32_t
+ (
fid
 =
NULL
 ? 0 : fid->
size
);

542 i(
	`CRYPTO_ON
(
dbv
)) {

543 
ad
 =

544 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

545 
logc
.
size
 +
ad
;

548 i(
is_dub
 || 
tx
 =
NULL
) {

549 i((
t
 =

550 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

551  (
t
);

553 i((
t
 = 
	`__os_mloc
(
dbv
,

554 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

555  (
t
);

556 #ifde
DIAGNOSTIC


557 i((
t
 =

558 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

559 
	`__os_
(
dbv
, 

);

560  (
t
);

563 
logc
.
da
 = 

->data;

566 i(
ad
 > 0)

567 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

569 
bp
 = 
logc
.
da
;

571 
	`memy
(
bp
, &
y
, (rectype));

572 
bp
 +(
y
);

574 
	`memy
(
bp
, &
txn_num
, (txn_num));

575 
bp
 +(
txn_num
);

577 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

578 
bp
 +(
DB_LSN
);

580 i(
dme
 =
NULL
) {

581 
zo
 = 0;

582 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

583 
bp
 +(
u_t32_t
);

585 
	`memy
(
bp
, &
dme
->
size
, (oldname->size));

586 
bp
 +(
dme
->
size
);

587 
	`memy
(
bp
, 
dme
->
da
, oldme->
size
);

588 
bp
 +
dme
->
size
;

591 i(
wme
 =
NULL
) {

592 
zo
 = 0;

593 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

594 
bp
 +(
u_t32_t
);

596 
	`memy
(
bp
, &
wme
->
size
, (newname->size));

597 
bp
 +(
wme
->
size
);

598 
	`memy
(
bp
, 
wme
->
da
,ewme->
size
);

599 
bp
 +
wme
->
size
;

602 i(
fid
 =
NULL
) {

603 
zo
 = 0;

604 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

605 
bp
 +(
u_t32_t
);

607 
	`memy
(
bp
, &
fid
->
size
, (fid->size));

608 
bp
 +(
fid
->
size
);

609 
	`memy
(
bp
, 
fid
->
da
, fid->
size
);

610 
bp
 +
fid
->
size
;

613 
	`DB_ASSERT
(
dbv
,

614 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

616 i(
is_dub
 || 
tx
 =
NULL
) {

617 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

618 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

619 *
lp
 = *
p
;

620 i(
p
 !
t_lp
)

621 *
t_lp
 = *
p
;

624 
t
 = 0;

625 #ifde
DIAGNOSTIC


630 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

631 
y
 |
DB_debug_FLAG
;

632 
	`memy
(
logc
.
da
, &
y
, (rectype));

634 i(!
	`IS_REP_CLIENT
(
dbv
))

635 
t
 = 
	`__log_put
(
dbv
,

636 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

638 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

639 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

640 
	`LSN_NOT_LOGGED
(*
t_lp
);

643 #ifde
LOG_DIAGNOSTIC


644 i(
t
 != 0)

645 ()
	`__d_mem_me_t
(
dbv
,

646 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

649 #ifde
DIAGNOSTIC


650 
	`__os_
(
dbv
, 
logc
.
da
);

652 i(
is_dub
 || 
tx
 =
NULL
)

653 
	`__os_
(
dbv
, 
logc
.
da
);

655  (
t
);

656 
	}
}

663 
	$__d_mem_me_ad
(
dbv
, 
cbuf
, 
g
)

664 
DB_ENV
 *
dbv
;

665 *
cbuf
;

666 
__d_mem_me_gs
 **
g
;

668 
__d_mem_me_gs
 *
gp
;

669 
u_t8_t
 *
bp
;

670 
t
;

672 i((
t
 = 
	`__os_mloc
(
dbv
,

673 (
__d_mem_me_gs
+ (
DB_TXN
), &
gp
)) != 0)

674  (
t
);

675 
bp
 = 
cbuf
;

676 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

677 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

679 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

680 
bp
 +(
gp
->
ty
);

682 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

683 
bp
 +(
gp
->
tx
->
txnid
);

685 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

686 
bp
 +(
DB_LSN
);

688 
	`memt
(&
gp
->
dme
, 0, (argp->oldname));

689 
	`memy
(&
gp
->
dme
.
size
, 
bp
, (
u_t32_t
));

690 
bp
 +(
u_t32_t
);

691 
gp
->
dme
.
da
 = 
bp
;

692 
bp
 +
gp
->
dme
.
size
;

694 
	`memt
(&
gp
->
wme
, 0, (argp->newname));

695 
	`memy
(&
gp
->
wme
.
size
, 
bp
, (
u_t32_t
));

696 
bp
 +(
u_t32_t
);

697 
gp
->
wme
.
da
 = 
bp
;

698 
bp
 +
gp
->
wme
.
size
;

700 
	`memt
(&
gp
->
fid
, 0, (argp->fid));

701 
	`memy
(&
gp
->
fid
.
size
, 
bp
, (
u_t32_t
));

702 
bp
 +(
u_t32_t
);

703 
gp
->
fid
.
da
 = 
bp
;

704 
bp
 +
gp
->
fid
.
size
;

706 *
g
 = 
gp
;

708 
	}
}

715 
	$__d_mem_move_log
(
dbv
, 
tx
, 
t_lp
, 
ags
,

716 
me
, 
fid
)

717 
DB_ENV
 *
dbv
;

718 
DB_TXN
 *
tx
;

719 
DB_LSN
 *
t_lp
;

720 
u_t32_t
 
ags
;

721 cڡ 
DBT
 *
me
;

722 cڡ 
DBT
 *
fid
;

724 
DBT
 
logc
;

725 
DB_TXNLOGREC
 *

;

726 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

727 
u_t32_t
 
zo
, 
y
, 
txn_num
;

728 
u_t
 
ad
;

729 
u_t8_t
 *
bp
;

730 
is_dub
, 
t
;

732 
	`COMPQUIET
(

, 
NULL
);

734 
y
 = 
DB___d_mem_move
;

735 
ad
 = 0;

736 
p
 = 
t_lp
;

738 
t
 = 0;

740 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

741 i(
tx
 =
NULL
)

743 i(
tx
 =
NULL
)

745 
is_dub
 = 0;

747 
is_dub
 = 1;

749 i(
tx
 =
NULL
) {

750 
txn_num
 = 0;

751 
lp
 = &
nu_l
;

752 
nu_l
.
fe
 =u_l.
offt
 = 0;

754 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

755 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

756  (
t
);

763 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

764 
txn_num
 = 
tx
->
txnid
;

767 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

768 + (
u_t32_t
+ (
me
 =
NULL
 ? 0 :ame->
size
)

769 + (
u_t32_t
+ (
fid
 =
NULL
 ? 0 : fid->
size
);

770 i(
	`CRYPTO_ON
(
dbv
)) {

771 
ad
 =

772 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

773 
logc
.
size
 +
ad
;

776 i(
is_dub
 || 
tx
 =
NULL
) {

777 i((
t
 =

778 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

779  (
t
);

781 i((
t
 = 
	`__os_mloc
(
dbv
,

782 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

783  (
t
);

784 #ifde
DIAGNOSTIC


785 i((
t
 =

786 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

787 
	`__os_
(
dbv
, 

);

788  (
t
);

791 
logc
.
da
 = 

->data;

794 i(
ad
 > 0)

795 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

797 
bp
 = 
logc
.
da
;

799 
	`memy
(
bp
, &
y
, (rectype));

800 
bp
 +(
y
);

802 
	`memy
(
bp
, &
txn_num
, (txn_num));

803 
bp
 +(
txn_num
);

805 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

806 
bp
 +(
DB_LSN
);

808 i(
me
 =
NULL
) {

809 
zo
 = 0;

810 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

811 
bp
 +(
u_t32_t
);

813 
	`memy
(
bp
, &
me
->
size
, (name->size));

814 
bp
 +(
me
->
size
);

815 
	`memy
(
bp
, 
me
->
da
,ame->
size
);

816 
bp
 +
me
->
size
;

819 i(
fid
 =
NULL
) {

820 
zo
 = 0;

821 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

822 
bp
 +(
u_t32_t
);

824 
	`memy
(
bp
, &
fid
->
size
, (fid->size));

825 
bp
 +(
fid
->
size
);

826 
	`memy
(
bp
, 
fid
->
da
, fid->
size
);

827 
bp
 +
fid
->
size
;

830 
	`DB_ASSERT
(
dbv
,

831 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

833 i(
is_dub
 || 
tx
 =
NULL
) {

834 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

835 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

836 *
lp
 = *
p
;

837 i(
p
 !
t_lp
)

838 *
t_lp
 = *
p
;

841 
t
 = 0;

842 #ifde
DIAGNOSTIC


847 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

848 
y
 |
DB_debug_FLAG
;

849 
	`memy
(
logc
.
da
, &
y
, (rectype));

851 i(!
	`IS_REP_CLIENT
(
dbv
))

852 
t
 = 
	`__log_put
(
dbv
,

853 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

855 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

856 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

857 
	`LSN_NOT_LOGGED
(*
t_lp
);

860 #ifde
LOG_DIAGNOSTIC


861 i(
t
 != 0)

862 ()
	`__d_mem_move_t
(
dbv
,

863 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

866 #ifde
DIAGNOSTIC


867 
	`__os_
(
dbv
, 
logc
.
da
);

869 i(
is_dub
 || 
tx
 =
NULL
)

870 
	`__os_
(
dbv
, 
logc
.
da
);

872  (
t
);

873 
	}
}

880 
	$__d_mem_move_ad
(
dbv
, 
cbuf
, 
g
)

881 
DB_ENV
 *
dbv
;

882 *
cbuf
;

883 
__d_mem_move_gs
 **
g
;

885 
__d_mem_move_gs
 *
gp
;

886 
u_t8_t
 *
bp
;

887 
t
;

889 i((
t
 = 
	`__os_mloc
(
dbv
,

890 (
__d_mem_move_gs
+ (
DB_TXN
), &
gp
)) != 0)

891  (
t
);

892 
bp
 = 
cbuf
;

893 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

894 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

896 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

897 
bp
 +(
gp
->
ty
);

899 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

900 
bp
 +(
gp
->
tx
->
txnid
);

902 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

903 
bp
 +(
DB_LSN
);

905 
	`memt
(&
gp
->
me
, 0, (argp->name));

906 
	`memy
(&
gp
->
me
.
size
, 
bp
, (
u_t32_t
));

907 
bp
 +(
u_t32_t
);

908 
gp
->
me
.
da
 = 
bp
;

909 
bp
 +
gp
->
me
.
size
;

911 
	`memt
(&
gp
->
fid
, 0, (argp->fid));

912 
	`memy
(&
gp
->
fid
.
size
, 
bp
, (
u_t32_t
));

913 
bp
 +(
u_t32_t
);

914 
gp
->
fid
.
da
 = 
bp
;

915 
bp
 +
gp
->
fid
.
size
;

917 *
g
 = 
gp
;

919 
	}
}

926 
	$__d__cov
(
dbv
, 
dbp
, 
dbsiz
)

927 
DB_ENV
 *
dbv
;

928 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

929 
size_t
 *
dbsiz
;

931 
t
;

933 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

934 
__d_masub_cov
, 
DB___d_masub
)) != 0)

935  (
t
);

936 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

937 
__d_mem__cov
, 
DB___d_mem_
)) != 0)

938  (
t
);

939 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

940 
__d_mem_me_cov
, 
DB___d_mem_me
)) != 0)

941  (
t
);

942 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

943 
__d_mem_move_cov
, 
DB___d_mem_move
)) != 0)

944  (
t
);

946 
	}
}

	@../db/crdel_autop.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_dich.h
"

9 
	~"dbc/db_am.h
"

10 
	~"dbc/log.h
"

11 
	~"dbc/txn.h
"

18 
	$__d_masub_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

19 
DB_ENV
 *
dbv
;

20 
DBT
 *
db
;

21 
DB_LSN
 *
lp
;

22 
db_cs
 
nud2
;

23 *
nud3
;

25 
__d_masub_gs
 *
gp
;

26 
u_t32_t
 
i
;

27 
ch
;

28 
t
;

30 
nud2
 = 
DB_TXN_PRINT
;

31 
nud3
 = 
NULL
;

33 i((
t
 = 
	`__d_masub_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

34  (
t
);

35 ()
	`tf
(

37 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

38 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

39 (
u_lg
)
gp
->
ty
,

40 (
u_lg
)
gp
->
tx
->
txnid
,

41 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

42 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

43 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

44 ()
	`tf
("\tpage: ");

45 
i
 = 0; i < 
gp
->
ge
.
size
; i++) {

46 
ch
 = ((
u_t8_t
 *)
gp
->
ge
.
da
)[
i
];

47 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

49 ()
	`tf
("\n");

50 ()
	`tf
("\tlsn: [%lu][%lu]\n",

51 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

52 ()
	`tf
("\n");

53 
	`__os_
(
dbv
, 
gp
);

55 
	}
}

62 
	$__d_mem__t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

63 
DB_ENV
 *
dbv
;

64 
DBT
 *
db
;

65 
DB_LSN
 *
lp
;

66 
db_cs
 
nud2
;

67 *
nud3
;

69 
__d_mem__gs
 *
gp
;

70 
u_t32_t
 
i
;

71 
ch
;

72 
t
;

74 
nud2
 = 
DB_TXN_PRINT
;

75 
nud3
 = 
NULL
;

77 i((
t
 = 
	`__d_mem__ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

78  (
t
);

79 ()
	`tf
(

81 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

82 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

83 (
u_lg
)
gp
->
ty
,

84 (
u_lg
)
gp
->
tx
->
txnid
,

85 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

86 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

87 ()
	`tf
("\tname: ");

88 
i
 = 0; i < 
gp
->
me
.
size
; i++) {

89 
ch
 = ((
u_t8_t
 *)
gp
->
me
.
da
)[
i
];

90 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

92 ()
	`tf
("\n");

93 ()
	`tf
("\tfid: ");

94 
i
 = 0; i < 
gp
->
fid
.
size
; i++) {

95 
ch
 = ((
u_t8_t
 *)
gp
->
fid
.
da
)[
i
];

96 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

98 ()
	`tf
("\n");

99 ()
	`tf
("\gsize: %lu\n", (
u_lg
)
gp
->
pgsize
);

100 ()
	`tf
("\n");

101 
	`__os_
(
dbv
, 
gp
);

103 
	}
}

110 
	$__d_mem_me_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

111 
DB_ENV
 *
dbv
;

112 
DBT
 *
db
;

113 
DB_LSN
 *
lp
;

114 
db_cs
 
nud2
;

115 *
nud3
;

117 
__d_mem_me_gs
 *
gp
;

118 
u_t32_t
 
i
;

119 
ch
;

120 
t
;

122 
nud2
 = 
DB_TXN_PRINT
;

123 
nud3
 = 
NULL
;

125 i((
t
 = 
	`__d_mem_me_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

126  (
t
);

127 ()
	`tf
(

129 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

130 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

131 (
u_lg
)
gp
->
ty
,

132 (
u_lg
)
gp
->
tx
->
txnid
,

133 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

134 ()
	`tf
("\toldname: ");

135 
i
 = 0; i < 
gp
->
dme
.
size
; i++) {

136 
ch
 = ((
u_t8_t
 *)
gp
->
dme
.
da
)[
i
];

137 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

139 ()
	`tf
("\n");

140 ()
	`tf
("\tnewname: ");

141 
i
 = 0; i < 
gp
->
wme
.
size
; i++) {

142 
ch
 = ((
u_t8_t
 *)
gp
->
wme
.
da
)[
i
];

143 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

145 ()
	`tf
("\n");

146 ()
	`tf
("\tfid: ");

147 
i
 = 0; i < 
gp
->
fid
.
size
; i++) {

148 
ch
 = ((
u_t8_t
 *)
gp
->
fid
.
da
)[
i
];

149 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

151 ()
	`tf
("\n");

152 ()
	`tf
("\n");

153 
	`__os_
(
dbv
, 
gp
);

155 
	}
}

162 
	$__d_mem_move_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

163 
DB_ENV
 *
dbv
;

164 
DBT
 *
db
;

165 
DB_LSN
 *
lp
;

166 
db_cs
 
nud2
;

167 *
nud3
;

169 
__d_mem_move_gs
 *
gp
;

170 
u_t32_t
 
i
;

171 
ch
;

172 
t
;

174 
nud2
 = 
DB_TXN_PRINT
;

175 
nud3
 = 
NULL
;

177 i((
t
 = 
	`__d_mem_move_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

178  (
t
);

179 ()
	`tf
(

181 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

182 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

183 (
u_lg
)
gp
->
ty
,

184 (
u_lg
)
gp
->
tx
->
txnid
,

185 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

186 ()
	`tf
("\tname: ");

187 
i
 = 0; i < 
gp
->
me
.
size
; i++) {

188 
ch
 = ((
u_t8_t
 *)
gp
->
me
.
da
)[
i
];

189 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

191 ()
	`tf
("\n");

192 ()
	`tf
("\tfid: ");

193 
i
 = 0; i < 
gp
->
fid
.
size
; i++) {

194 
ch
 = ((
u_t8_t
 *)
gp
->
fid
.
da
)[
i
];

195 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

197 ()
	`tf
("\n");

198 ()
	`tf
("\n");

199 
	`__os_
(
dbv
, 
gp
);

201 
	}
}

208 
	$__d__t
(
dbv
, 
dbp
, 
dbsiz
)

209 
DB_ENV
 *
dbv
;

210 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

211 
size_t
 *
dbsiz
;

213 
t
;

215 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

216 
__d_masub_t
, 
DB___d_masub
)) != 0)

217  (
t
);

218 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

219 
__d_mem__t
, 
DB___d_mem_
)) != 0)

220  (
t
);

221 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

222 
__d_mem_me_t
, 
DB___d_mem_me
)) != 0)

223  (
t
);

224 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

225 
__d_mem_move_t
, 
DB___d_mem_move
)) != 0)

226  (
t
);

228 
	}
}

	@../db/crdel_rec.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/f.h
"

14 
	~"dbc/hash.h
"

15 
	~"dbc/log.h
"

16 
	~"dbc/mp.h
"

17 
	~"dbc/txn.h
"

27 
	$__d_masub_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

28 
DB_ENV
 *
dbv
;

29 
DBT
 *
db
;

30 
DB_LSN
 *
lp
;

31 
db_cs
 

;

32 *
fo
;

34 
__d_masub_gs
 *
gp
;

35 
DB
 *
fe_dbp
;

36 
DBC
 *
dbc
;

37 
DB_MPOOLFILE
 *
mpf
;

38 
PAGE
 *
g
;

39 
cmp_p
, 
t
, 
t_t
;

41 
g
 = 
NULL
;

42 
	`REC_PRINT
(
__d_masub_t
);

43 
	`REC_INTRO
(
__d_masub_ad
, 0, 0);

45 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

46 0, &
g
)) != 0) {

48 i(
	`F_ISSET
(
fe_dbp
, 
DB_AM_INMEM
) &&

49 (
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 
NULL
,

50 
DB_MPOOL_CREATE
 | 
DB_MPOOL_DIRTY
, &
g
)) == 0) {

51 
	`LSN_NOT_LOGGED
(
	`LSN
(
g
));

53 *
lp
 = 
gp
->
ev_l
;

54 
t
 = 0;

55 
out
;

59 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

60 
	`CHECK_LSN
(
dbv
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

62 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

63 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

64 
	`memy
(
g
, 
gp
->
ge
.
da
,rgp->ge.
size
);

65 
	`LSN
(
g
*
lp
;

72 i(
	`F_ISSET
(
fe_dbp
, 
DB_AM_INMEM
) &&

73 
gp
->
pgno
 =
PGNO_BASE_MD
 &&

74 (
t
 = 
	`__db_ma_tup
(
fe_dbp
->
dbv
, file_dbp,

75 
fe_dbp
->
dme
, (
DBMETA
 *)
g
, 0, 
DB_CHK_META
)) != 0)

76 
out
;

77 } i(
	`DB_UNDO
(

)) {

90 
	`REC_DIRTY
(
mpf
, 
fe_dbp
->
iܙy
, &
g
);

91 
	`LSN
(
g

gp
->
l
;

94 
de
: *
lp
 = 
gp
->
ev_l
;

95 
t
 = 0;

97 
out
: i(
g
 !
NULL
 &&

98 (
t_t
 = 
	`__memp_ut
(
mpf
, 
g
, 
fe_dbp
->
iܙy
)) != 0 &&

99 
t
 == 0)

100 
t
 = 
t_t
;

102 
REC_CLOSE
;

103 
	}
}

113 
	$__d_mem__cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

114 
DB_ENV
 *
dbv
;

115 
DBT
 *
db
;

116 
DB_LSN
 *
lp
;

117 
db_cs
 

;

118 *
fo
;

120 
DB
 *
dbp
;

121 
__d_mem__gs
 *
gp
;

122 
do_o
, 
t
, 
t_t
;

124 
	`COMPQUIET
(
fo
, 
NULL
);

125 
dbp
 = 
NULL
;

126 
do_o
 = 0;

127 
	`REC_PRINT
(
__d_mem__t
);

128 
	`REC_NOOP_INTRO
(
__d_mem__ad
);

131 i(
gp
->
feid
 =
DB_LOGFILEID_INVALID
) {

132 i(
	`DB_REDO
(

))

133 
t
 = 
ENOENT
;

135 
t
 = 0;

137 
t
 = 
	`__dbg_id_to_db_t
(
dbv
,

138 
gp
->
tx
, &
dbp
,rgp->
feid
, 0, 0);

140 i(
	`DB_REDO
(

)) {

145 i(
t
 != 0) {

146 i((
t
 = 
	`__db__
(&
dbp
, 
dbv
, 0)) != 0)

147 
out
;

149 
	`F_SET
(
dbp
, 
DB_AM_RECOVER
 | 
DB_AM_INMEM
);

150 
	`memy
(
dbp
->
feid
, 
gp
->
fid
.
da
, 
DB_FILE_ID_LEN
);

151 i(((
t
 = 
	`__os_rdup
(
dbv
,

152 
gp
->
me
.
da
, &
dbp
->
dme
)) != 0))

153 
out
;

160 
do_o
 = 1;

164 
	`memy
(
dbp
->
feid
, 
gp
->
fid
.
da
,rgp->fid.
size
);

165 i((
t
 = 
	`__memp_t_feid
(
dbp
->
mpf
, dbp->
feid
)) != 0)

166 
out
;

167 
dbp
->
erve_fid
 = 1;

168 
	`MAKE_INMEM
(
dbp
);

169 i((
t
 = 
	`__db_v_tup
(
dbp
,

170 
NULL
, NULL, 
gp
->
me
.
da
, 
TXN_INVALID
, 0)) != 0)

171 
out
;

172 
t
 = 
	`__db_v_mpo
(
dbp
, 
gp
->
me
.
da
, 0);

174 i(
t
 =
ENOENT
) {

175 
dbp
->
pgsize
 = 
gp
->pgsize;

176 i((
t
 = 
	`__db_v_mpo
(
dbp
,

177 
gp
->
me
.
da
, 
DB_CREATE
)) != 0)

178 
out
;

179 } i(
t
 != 0)

180 
out
;

183 i(
	`DB_UNDO
(

)) {

184 i(
t
 == 0)

185 
t
 = 
	`__memp_me
(
dbv
, 
gp
->
fid
.
da
, 
NULL
,

186 (cڡ *)
gp
->
me
.
da
, 
NULL
, 1);

188 i(
t
 =
ENOENT
 || =
DB_DELETED
)

189 
t
 = 0;

191 
out
;

194 *
lp
 = 
gp
->
ev_l
;

196 
out
: i(
dbp
 !
NULL
) {

197 
t_t
 = 0;

199 i(
do_o
 || 
t
 != 0)

200 
t_t
 = 
	`__db_o
(
dbp
, 
NULL
, 
DB_NOSYNC
);

201 i(
t_t
 !0 && 
t
 == 0)

202 
t
 = 
t_t
;

204 
REC_NOOP_CLOSE
;

205 
	}
}

215 
	$__d_mem_me_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

216 
DB_ENV
 *
dbv
;

217 
DBT
 *
db
;

218 
DB_LSN
 *
lp
;

219 
db_cs
 

;

220 *
fo
;

222 
__d_mem_me_gs
 *
gp
;

223 
u_t8_t
 *
feid
;

224 
t
;

226 
	`COMPQUIET
(
fo
, 
NULL
);

227 
	`REC_PRINT
(
__d_mem_me_t
);

228 
	`REC_NOOP_INTRO
(
__d_mem_me_ad
);

229 
feid
 = 
gp
->
fid
.
da
;

232 i(
	`DB_REDO
(

))

233 ()
	`__memp_me
(
dbv
, 
feid
,

234 (cڡ *)
gp
->
wme
.
da
,

235 (cڡ *)
gp
->
dme
.
da
,

236 (cڡ *)
gp
->
wme
.
da
, 1);

238 i(
	`DB_UNDO
(

))

239 ()
	`__memp_me
(
dbv
, 
feid
,

240 (cڡ *)
gp
->
dme
.
da
,

241 (cڡ *)
gp
->
wme
.
da
,

242 (cڡ *)
gp
->
dme
.
da
, 1);

244 *
lp
 = 
gp
->
ev_l
;

245 
t
 = 0;

247 
REC_NOOP_CLOSE
;

248 
	}
}

258 
	$__d_mem_move_cov
(
dbv
, 
db
, 
lp
, 

, 
fo
)

259 
DB_ENV
 *
dbv
;

260 
DBT
 *
db
;

261 
DB_LSN
 *
lp
;

262 
db_cs
 

;

263 *
fo
;

265 
__d_mem_move_gs
 *
gp
;

266 
t
;

268 
	`COMPQUIET
(
fo
, 
NULL
);

269 
	`REC_PRINT
(
__d_mem_move_t
);

270 
	`REC_NOOP_INTRO
(
__d_mem_move_ad
);

276 i(
	`DB_REDO
(

)) {

277 ()
	`__memp_me
(
dbv
,

278 
gp
->
fid
.
da
, 
NULL
,rgp->
me
.data, NULL, 1);

281 *
lp
 = 
gp
->
ev_l
;

282 
t
 = 0;

284 
REC_NOOP_CLOSE
;

285 
	}
}

	@../db/db.c

41 
	~"db_cfig.h
"

43 
	~"db_t.h
"

44 
	~"dbc/db_ge.h
"

45 
	~"dbc/db_sw.h
"

46 
	~"dbc/b.h
"

47 
	~"dbc/f.h
"

48 
	~"dbc/hash.h
"

49 
	~"dbc/lock.h
"

50 
	~"dbc/log.h
"

51 
	~"dbc/mp.h
"

52 
	~"dbc/qam.h
"

53 
	~"dbc/txn.h
"

55 
__db_dissoc
 
__P
((
DB
 *));

57 #ifde
CONFIG_TEST


58 
__db_makecy
 
__P
((
DB_ENV
 *, const *, const *));

59 
__db_docy
 
__P
((
DB_ENV
 *, const *));

60 
__qam_docy
 
__P
((
DB
 *, const *));

76 
	$__db_ma_ݒ
(
subdbp
, 
txn
, 
me
, 
ags
, 
mode
, 
db
)

77 
DB
 *
subdbp
;

78 
DB_TXN
 *
txn
;

79 cڡ *
me
;

80 
u_t32_t
 
ags
;

81 
mode
;

82 
DB
 **
db
;

84 
DB
 *
dbp
;

85 
t
;

87 *
db
 = 
NULL
;

90 i((
t
 = 
	`__db__
(&
dbp
, 
subdbp
->
dbv
, 0)) != 0)

91  (
t
);

99 
dbp
->
pgsize
 = 
subdbp
->pgsize;

100 
	`F_SET
(
dbp
, 
DB_AM_SUBDB
);

101 
	`F_SET
(
dbp
, 
	`F_ISSET
(
subdbp
,

102 
DB_AM_RECOVER
 | 
DB_AM_SWAP
 |

103 
DB_AM_ENCRYPT
 | 
DB_AM_CHKSUM
 | 
DB_AM_NOT_DURABLE
));

110 
	`LF_CLR
(
DB_EXCL
);

111 
	`LF_SET
(
DB_RDWRMASTER
);

112 i((
t
 = 
	`__db_ݒ
(
dbp
,

113 
txn
, 
me
, 
NULL
, 
DB_BTREE
, 
ags
, 
mode
, 
PGNO_BASE_MD
)) != 0)

114 
r
;

123 i(
	`F_ISSET
(
dbp
, 
DB_AM_CHKSUM
))

124 
	`F_SET
(
subdbp
, 
DB_AM_CHKSUM
);

130 
subdbp
->
pgsize
 = 
dbp
->pgsize;

131 *
db
 = 
dbp
;

134 
r
: i(!
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
))

135 ()
	`__db_o
(
dbp
, 
txn
, 0);

138  (
t
);

139 
	}
}

149 
	$__db_ma_upde
(
mdbp
, 
sdbp
, 
txn
, 
subdb
, 
ty
, 
ai
, 
wme
, 
ags
)

150 
DB
 *
mdbp
, *
sdbp
;

151 
DB_TXN
 *
txn
;

152 cڡ *
subdb
;

153 
DBTYPE
 
ty
;

154 
mu_ai
 
ai
;

155 cڡ *
wme
;

156 
u_t32_t
 
ags
;

158 
DB_ENV
 *
dbv
;

159 
DBC
 *
dbc
, *
ndbc
;

160 
DBT
 
key
, 
da
, 
nda
;

161 
PAGE
 *
p
, *
r
;

162 
db_pgno_t
 
t_pgno
;

163 
modify
, 
t
, 
t_t
;

165 
dbv
 = 
mdbp
->dbenv;

166 
dbc
 = 
ndbc
 = 
NULL
;

167 
p
 = 
NULL
;

175 
modify
 = (
ai
 !
MU_OPEN
 || 
	`LF_ISSET
(
DB_CREATE
)) ? 1 : 0;

177 i((
t
 = 
	`__db_curs
(
mdbp
, 
txn
, &
dbc
,

178 (
	`CDB_LOCKING
(
dbv
&& 
modify
? 
DB_WRITECURSOR
 : 0)) != 0)

179  (
t
);

194 
	`DB_INIT_DBT
(
key
, 
subdb
, 
	`
(subdb));

195 
	`memt
(&
da
, 0, (data));

196 
	`F_SET
(&
da
, 
DB_DBT_MALLOC
);

198 
t
 = 
	`__dbc_g
(
dbc
, &
key
, &
da
,

199 
DB_SET
 | ((
	`STD_LOCKING
(
dbc
&& 
modify
? 
DB_RMW
 : 0));

206 
ai
) {

207 
MU_REMOVE
:

214 i(
t
 != 0)

215 
r
;

221 i((
t
 = 
	`__dbc_d
(
dbc
, 0)) != 0)

222 
r
;

229 
	`memy
(&
sdbp
->
ma_pgno
, 
da
.da, (
db_pgno_t
));

230 
	`DB_NTOHL
(&
sdbp
->
ma_pgno
);

231 i((
t
 = 
	`__memp_fg
(
mdbp
->
mpf
, &
sdbp
->
ma_pgno
,

232 
dbc
->
txn
, 
DB_MPOOL_DIRTY
, &
p
)) != 0)

233 
r
;

236 i(
	`TYPE
(
p
=
P_BTREEMETA
 &&

237 ((
BTMETA
 *)
p
)->
ro
 !
PGNO_INVALID
) {

238 i((
t
 = 
	`__memp_fg
(
mdbp
->
mpf
,

239 &((
BTMETA
 *)
p
)->
ro
, 
dbc
->
txn
,

240 
DB_MPOOL_DIRTY
, &
r
)) != 0)

241 
r
;

244 i((
t
 = 
	`__db_
(
dbc
, 
r
)) != 0) {

245 
r
 = 
NULL
;

246 
r
;

250 i((
t
 = 
	`__db_
(
dbc
, 
p
)) != 0) {

251 
p
 = 
NULL
;

252 
r
;

254 
p
 = 
NULL
;

256 
MU_RENAME
:

258 i(
t
 != 0)

259 
r
;

268 i((
t
 = 
	`__db_curs
(
mdbp
, 
txn
, &
ndbc
,

269 
	`CDB_LOCKING
(
dbv
? 
DB_WRITECURSOR
 : 0)) != 0)

270 
r
;

271 
	`DB_SET_DBT
(
key
, 
wme
, 
	`
(newname));

277 
	`memt
(&
nda
, 0, (ndata));

278 
	`F_SET
(&
nda
, 
DB_DBT_USERMEM
 | 
DB_DBT_PARTIAL
);

280 i((
t
 = 
	`__dbc_g
(
ndbc
, &
key
, &
nda
, 
DB_SET
)) == 0) {

282 
t
 = 
EEXIST
;

283 
	`__db_rx
(
dbv
, "me: daba %exis", 
wme
);

284 
r
;

285 } i(
t
 !
DB_NOTFOUND
)

286 
r
;

293 i((
t
 = 
	`__dbc_put
(
ndbc
, &
key
, &
da
, 
DB_KEYFIRST
)) != 0)

294 
r
;

295 i((
t
 = 
	`__dbc_d
(
dbc
, 0)) != 0) {

300 ()
	`__dbc_d
(
ndbc
, 0);

301 
r
;

305 
MU_OPEN
:

310 
t
) {

312 i(
	`LF_ISSET
(
DB_CREATE
&& LF_ISSET(
DB_EXCL
)) {

313 
t
 = 
EEXIST
;

314 
r
;

316 
	`memy
(&
sdbp
->
ma_pgno
, 
da
.da, (
db_pgno_t
));

317 
	`DB_NTOHL
(&
sdbp
->
ma_pgno
);

318 
de
;

319 
DB_NOTFOUND
:

320 i(
	`LF_ISSET
(
DB_CREATE
))

326 
t
 = 
ENOENT
;

327 
r
;

329 
r
;

333 i((
t
 = 
	`__db_w
(
dbc
,

334 
ty
 =
DB_HASH
 ? 
P_HASHMETA
 : 
P_BTREEMETA
, &
p
)) != 0)

335 
r
;

336 
sdbp
->
ma_pgno
 = 
	`PGNO
(
p
);

344 
t_pgno
 = 
	`PGNO
(
p
);

345 
	`DB_HTONL
(&
t_pgno
);

346 
	`memt
(&
nda
, 0, (ndata));

347 
nda
.
da
 = &
t_pgno
;

348 
nda
.
size
 = (
db_pgno_t
);

349 i((
t
 = 
	`__dbc_put
(
dbc
, &
key
, &
nda
, 
DB_KEYLAST
)) != 0)

350 
r
;

351 
	`F_SET
(
sdbp
, 
DB_AM_CREATED
);

355 
r
:

356 
de
:

360 i(
p
 !
NULL
 && (
t_t
 =

361 
	`__memp_ut
(
mdbp
->
mpf
, 
p
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

362 
t
 = 
t_t
;

365 i(
da
.d!
NULL
)

366 
	`__os_u
(
dbv
, 
da
.data);

367 i(
dbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(dbc)!0 && 
t
 == 0)

368 
t
 = 
t_t
;

369 i(
ndbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
dbc)!0 && 
t
 == 0)

370 
t
 = 
t_t
;

372  (
t
);

373 
	}
}

383 
	$__db_v_tup
(
dbp
, 
txn
, 
ame
, 
dme
, 
id
, 
ags
)

384 
DB
 *
dbp
;

385 
DB_TXN
 *
txn
;

386 cڡ *
ame
, *
dme
;

387 
u_t32_t
 
id
, 
ags
;

389 
DB
 *
ldbp
;

390 
DB_ENV
 *
dbv
;

391 
u_t32_t
 
maxid
;

392 
t
;

394 
dbv
 = 
dbp
->dbenv;

397 i(!
	`F_ISSET
(
dbv
, 
DB_ENV_OPEN_CALLED
)) {

399 i(
dbv
->
mp_gbys
 == 0 &&

400 
dbv
->
mp_bys
 < 
dbp
->
pgsize
 * 
DB_MINPAGECACHE
 &&

401 (
t
 = 
	`__memp_t_chesize
(

402 
dbv
, 0, 
dbp
->
pgsize
 * 
DB_MINPAGECACHE
, 0)) != 0)

403  (
t
);

405 i((
t
 = 
	`__v_ݒ
(
dbv
, 
NULL
, 
DB_CREATE
 |

406 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
	`LF_ISSET
(
DB_THREAD
), 0)) != 0)

407  (
t
);

411 i((!
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
|| 
dme
 =
NULL
) &&

412 (
t
 = 
	`__db_v_mpo
(
dbp
, 
ame
, 
ags
)) != 0)

413  (
t
);

416 i(
	`LF_ISSET
(
DB_THREAD
&& (
t
 = 
	`__mux_loc
(

417 
dbv
, 
MTX_DB_HANDLE
, 
DB_MUTEX_PROCESS_ONLY
, &
dbp
->
mux
)) != 0)

418  (
t
);

426 i(
	`LOGGING_ON
(
dbv
&& 
dbp
->
log_fame
 =
NULL
 &&

427 #i!
	`defed
(
DEBUG_ROP
&& !defed(
DEBUG_WOP
&& !defed(
DIAGNOSTIC
)

428 (
txn
 !
NULL
 || 
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
)) &&

430 (
t
 = 
	`__dbg_tup
(
dbp
,

431 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
? 
dme
 : 
ame
, 
id
)) != 0)

432  (
t
);

438 i(
	`DBENV_LOGGING
(
dbv
&& !
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
) &&

439 #i!
	`defed
(
DEBUG_ROP
&& !defed(
DEBUG_WOP
&& !defed(
DIAGNOSTIC
)

440 
txn
 !
NULL
 &&

442 #i!
	`defed
(
DEBUG_ROP
)

443 !
	`F_ISSET
(
dbp
, 
DB_AM_RDONLY
) &&

445 (
t
 = 
	`__dbg_w_id
(
dbp
, 
txn
)) != 0)

446  (
t
);

457 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

458 
maxid
 = 0;

459 
	`TAILQ_FOREACH
(
ldbp
, &
dbv
->
dbli
, 
dblilks
) {

465 i(!
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
)) {

466 i(
	`memcmp
(
ldbp
->
feid
, 
dbp
->feid, 
DB_FILE_ID_LEN
)

467 =0 && 
ldbp
->
ma_pgno
 =
dbp
->meta_pgno)

469 } i(
dme
 !
NULL
) {

470 i(
	`F_ISSET
(
ldbp
, 
DB_AM_INMEM
) &&

471 
ldbp
->
dme
 !
NULL
 &&

472 
	`rcmp
(
ldbp
->
dme
, dname) == 0)

475 i(
ldbp
->
adj_feid
 > 
maxid
)

476 
maxid
 = 
ldbp
->
adj_feid
;

488 i(
ldbp
 =
NULL
) {

489 
dbp
->
adj_feid
 = 
maxid
 + 1;

490 
	`TAILQ_INSERT_HEAD
(&
dbv
->
dbli
, 
dbp
, 
dblilks
);

492 
dbp
->
adj_feid
 = 
ldbp
->adj_fileid;

493 
	`TAILQ_INSERT_AFTER
(&
dbv
->
dbli
, 
ldbp
, 
dbp
, 
dblilks
);

495 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

498 
	}
}

507 
	$__db_v_mpo
(
dbp
, 
ame
, 
ags
)

508 
DB
 *
dbp
;

509 cڡ *
ame
;

510 
u_t32_t
 
ags
;

512 
DB_ENV
 *
dbv
;

513 
DBT
 
pgcook
;

514 
DB_MPOOLFILE
 *
mpf
;

515 
DB_PGINFO
 
pgfo
;

516 
fidt
, 
y
, 
t
;

517 
t32_t
 
l_off
;

518 
u_t8_t
 
nufid
[
DB_FILE_ID_LEN
];

519 
u_t32_t
 
r_n
;

521 
dbv
 = 
dbp
->dbenv;

524 
l_off
 = 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_LSN_OFF_NOTSET
 : 0;

527 i(
	`F_ISSET
(
dbp
, 
DB_AM_OPEN_CALLED
))

538 
dbp
->
ty
) {

539 
DB_BTREE
:

540 
DB_RECNO
:

541 
y
 = 
	`F_ISSET
(
dbp
, 
DB_AM_SWAP
 | 
DB_AM_ENCRYPT
 | 
DB_AM_CHKSUM
)

542 ? 
DB_FTYPE_SET
 : 
DB_FTYPE_NOTSET
;

543 
r_n
 = 
	`CRYPTO_ON
(
dbv
) ?

544 (
dbp
->
pgsize
 !0 ? dbp->pgsiz: 
DB_CLEARLEN_NOTSET
) :

545 
DB_PAGE_DB_LEN
;

547 
DB_HASH
:

548 
y
 = 
DB_FTYPE_SET
;

549 
r_n
 = 
	`CRYPTO_ON
(
dbv
) ?

550 (
dbp
->
pgsize
 !0 ? dbp->pgsiz: 
DB_CLEARLEN_NOTSET
) :

551 
DB_PAGE_DB_LEN
;

553 
DB_QUEUE
:

554 
y
 = 
	`F_ISSET
(
dbp
,

555 
DB_AM_SWAP
 | 
DB_AM_ENCRYPT
 | 
DB_AM_CHKSUM
) ?

556 
DB_FTYPE_SET
 : 
DB_FTYPE_NOTSET
;

564 
r_n
 = 
dbp
->
pgsize
 !0 ? dbp->pgsiz: 
DB_CLEARLEN_NOTSET
;

566 
DB_UNKNOWN
:

579 i(
	`F_ISSET
(
dbp
, 
DB_AM_VERIFYING
)) {

580 
y
 = 
DB_FTYPE_NOTSET
;

581 
r_n
 = 
DB_PAGE_DB_LEN
;

590 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
)) {

591 
r_n
 = 
DB_CLEARLEN_NOTSET
;

592 
y
 = 
DB_FTYPE_NOTSET
;

593 
l_off
 = 
DB_LSN_OFF_NOTSET
;

598  (
	`__db_unknown_ty
(
dbv
, "DB->ݒ", 
dbp
->
ty
));

601 
mpf
 = 
dbp
->mpf;

603 
	`memt
(
nufid
, 0, 
DB_FILE_ID_LEN
);

604 
fidt
 = 
	`memcmp
(
nufid
, 
dbp
->
feid
, 
DB_FILE_ID_LEN
);

605 i(
fidt
)

606 ()
	`__memp_t_feid
(
mpf
, 
dbp
->
feid
);

608 ()
	`__memp_t_r_n
(
mpf
, 
r_n
);

609 ()
	`__memp_t_y
(
mpf
, 
y
);

610 ()
	`__memp_t_l_offt
(
mpf
, 
l_off
);

612 
pgfo
.
db_gesize
 = 
dbp
->
pgsize
;

613 
pgfo
.
ags
 =

614 
	`F_ISSET
(
dbp
, (
DB_AM_CHKSUM
 | 
DB_AM_ENCRYPT
 | 
DB_AM_SWAP
));

615 
pgfo
.
ty
 = 
dbp
->type;

616 
pgcook
.
da
 = &
pgfo
;

617 
pgcook
.
size
 = (
DB_PGINFO
);

618 ()
	`__memp_t_pgcook
(
mpf
, &
pgcook
);

620 #ide
DIAG_MVCC


621 i(
	`F_ISSET
(
dbv
, 
DB_ENV_MULTIVERSION
))

623 i(
	`F_ISSET
(
dbp
, 
DB_AM_TXN
) &&

624 
dbp
->
ty
 !
DB_QUEUE
 && dbp->ty !
DB_UNKNOWN
)

625 
	`LF_SET
(
DB_MULTIVERSION
);

627 i((
t
 = 
	`__memp_fݒ
(
mpf
, 
NULL
, 
ame
,

628 
	`LF_ISSET
(
DB_CREATE
 | 
DB_DURABLE_UNKNOWN
 | 
DB_MULTIVERSION
 |

629 
DB_NOMMAP
 | 
DB_ODDFILESIZE
 | 
DB_RDONLY
 | 
DB_TRUNCATE
) |

630 (
	`F_ISSET
(
dbv
, 
DB_ENV_DIRECT_DB
? 
DB_DIRECT
 : 0) |

631 (
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_TXN_NOT_DURABLE
 : 0),

632 0, 
dbp
->
pgsize
)) != 0) {

637 ()
	`__memp_fo
(
dbp
->
mpf
, 0);

638 ()
	`__memp_f
(
dbv
, &
dbp
->
mpf
);

639 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
))

640 
	`MAKE_INMEM
(
dbp
);

641  (
t
);

651 
	`F_SET
(
dbp
, 
DB_AM_OPEN_CALLED
);

652 i(!
fidt
 && 
ame
 !
NULL
) {

653 ()
	`__memp_g_feid
(
dbp
->
mpf
, dbp->
feid
);

654 
dbp
->
erve_fid
 = 1;

658 
	}
}

667 
	$__db_o
(
dbp
, 
txn
, 
ags
)

668 
DB
 *
dbp
;

669 
DB_TXN
 *
txn
;

670 
u_t32_t
 
ags
;

672 
DB_ENV
 *
dbv
;

673 
db_f
, 
deed_o
, 
t
, 
t_t
;

675 
dbv
 = 
dbp
->dbenv;

676 
deed_o
 = 
t
 = 0;

685 i(
txn
 !
NULL
)

686 ()
	`__db_check_txn
(
dbp
, 
txn
, 
DB_LOCK_INVALIDID
, 0);

689 
t
 = 
	`__db_esh
(
dbp
, 
txn
, 
ags
, &
deed_o
, 0);

695 i(
deed_o
)

696  (
t
);

709 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

710 
db_f
 = --
dbv
->db_ref;

711 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

712 i(
	`F_ISSET
(
dbv
, 
DB_ENV_DBLOCAL
&& 
db_f
 == 0 &&

713 (
t_t
 = 
	`__v_o
(
dbv
, 0)!0 && 
t
 == 0)

714 
t
 = 
t_t
;

717 
	`memt
(
dbp
, 
CLEAR_BYTE
, (*dbp));

718 
	`__os_
(
dbv
, 
dbp
);

720  (
t
);

721 
	}
}

734 
	$__db_esh
(
dbp
, 
txn
, 
ags
, 
deed_op
, 
u
)

735 
DB
 *
dbp
;

736 
DB_TXN
 *
txn
;

737 
u_t32_t
 
ags
;

738 *
deed_op
, 
u
;

740 
DB
 *
sdbp
;

741 
DBC
 *
dbc
;

742 
DB_ENV
 *
dbv
;

743 
DB_LOCKREQ
 
eq
;

744 
DB_LOCKER
 *
lock
;

745 
REGENV
 *
nv
;

746 
REGINFO
 *
f
;

747 
u_t32_t
 
ve_ags
;

748 
sync
, 
t
, 
t_t
;

750 
t
 = 0;

752 
dbv
 = 
dbp
->dbenv;

753 
f
 = 
dbv
->
gfo
;

754 i(
f
 !
NULL
)

755 
nv
 = 
f
->
imy
;

757 
nv
 = 
NULL
;

763 i(
dbp
->
mpf
 =
NULL
)

764 
	`LF_SET
(
DB_NOSYNC
);

767 i(!
	`F_ISSET
(
dbp
, 
DB_AM_OPEN_CALLED
))

768 
v_ݒed
;

779 
	`LIST_FOREACH
(
sdbp
, &
dbp
->
s_cds
, 
s_lks
) {

780 
	`LIST_REMOVE
(
sdbp
, 
s_lks
);

781 i((
t_t
 = 
	`__db_dissoc
(
sdbp
)!0 && 
t
 == 0)

782 
t
 = 
t_t
;

794 i(!
	`LF_ISSET
(
DB_NOSYNC
) &&

795 !
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
 | 
DB_AM_RECOVER
) &&

796 (
t_t
 = 
	`__db_sync
(
dbp
)!0 && 
t
 == 0)

797 
t
 = 
t_t
;

806 
sync
 = 
	`TAILQ_FIRST
(&
dbp
->
aive_queue
=
NULL
 ? 0 : 1;

807 (
dbc
 = 
	`TAILQ_FIRST
(&
dbp
->
aive_queue
)!
NULL
)

808 i((
t_t
 = 
	`__dbc_o
(
dbc
)) != 0) {

809 i(
t
 == 0)

810 
t
 = 
t_t
;

814 (
dbc
 = 
	`TAILQ_FIRST
(&
dbp
->
_queue
)!
NULL
)

815 i((
t_t
 = 
	`__dbc_deroy
(
dbc
)) != 0) {

816 i(
t
 == 0)

817 
t
 = 
t_t
;

826 (
dbc
 = 
	`TAILQ_FIRST
(&
dbp
->
jo_queue
)!
NULL
)

827 i((
t_t
 = 
	`__db_jo_o
(
dbc
)) != 0) {

828 i(
t
 == 0)

829 
t
 = 
t_t
;

842 i(
sync
 && !
	`LF_ISSET
(
DB_NOSYNC
) &&

843 !
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
 | 
DB_AM_RECOVER
) &&

844 (
t_t
 = 
	`__memp_fsync
(
dbp
->
mpf
)!0 && 
t
 == 0)

845 
t
 = 
t_t
;

847 
v_ݒed
:

859 i(!
u
 && 
	`LOGGING_ON
(
dbp
->
dbv
&& dbp->
log_fame
 !
NULL
) {

865 
	`DB_ASSERT
(
dbv
, 
nv
 !
NULL
);

866 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
|| 
	`IS_REP_CLIENT
(
dbv
) ||

867 
dbp
->
timeamp
 !
nv
->
p_timeamp
) {

868 i((
t_t
 = 
	`__dbg_voke_id
(
dbp
,

869 0, 
DB_LOGFILEID_INVALID
)=0 && 
t
 == 0)

870 
t
 = 
t_t
;

871 i((
t_t
 = 
	`__dbg_down
(
dbp
)!0 && 
t
 == 0)

872 
t
 = 
t_t
;

874 i((
t_t
 = 
	`__dbg_o_id
(
dbp
,

875 
txn
, 
DBREG_CLOSE
)!0 &&x!
NULL
) {

888 i((
t
 =

889 
	`__txn_oevt
(
dbv
, 
txn
, 
dbp
)) != 0)

890  (
	`__db_nic
(
dbv
, 
t
));

891 i(
deed_op
 !
NULL
)

892 *
deed_op
 = 1;

893  (
t_t
);

911 i(
dbp
->
ved_ݒ_fhp
 !
NULL
 &&

912 (
t_t
 = 
	`__os_ohd
(
dbv
, 
dbp
->
ved_ݒ_fhp
)) != 0 &&

913 
t
 == 0)

914 
t
 = 
t_t
;

927 
	`MUTEX_LOCK
(
dbv
, dbv->
mtx_dbli
);

928 i(!
u
 &&

929 (
dbp
->
dblilks
.
tqe_xt
 !
NULL
 ||

930 
dbp
->
dblilks
.
tqe_ev
 !
NULL
)) {

931 
	`TAILQ_REMOVE
(&
dbv
->
dbli
, 
dbp
, 
dblilks
);

932 
dbp
->
dblilks
.
tqe_xt
 = 
NULL
;

933 
dbp
->
dblilks
.
tqe_ev
 = 
NULL
;

937 i(
dbp
->
mpf
 !
NULL
) {

938 i((
t_t
 = 
	`__memp_fo
(
dbp
->
mpf
,

939 
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
? 
DB_MPOOL_DISCARD
 : 0)) != 0 &&

940 
t
 == 0)

941 
t
 = 
t_t
;

942 
dbp
->
mpf
 = 
NULL
;

943 i(
u
 &&

944 (
t_t
 = 
	`__memp_f
(
dbv
, &
dbp
->
mpf
)) != 0 &&

945 
t
 == 0)

946 
t
 = 
t_t
;

949 
	`MUTEX_UNLOCK
(
dbv
, dbv->
mtx_dbli
);

971 i((
t_t
 = 
	`__bam_db_o
(
dbp
)!0 && 
t
 == 0)

972 
t
 = 
t_t
;

973 i((
t_t
 = 
	`__ham_db_o
(
dbp
)!0 && 
t
 == 0)

974 
t
 = 
t_t
;

975 i((
t_t
 = 
	`__qam_db_o
(
dbp
, dbp->
ags
)!0 && 
t
 == 0)

976 
t
 = 
t_t
;

985 i(!
u
 && 
dbp
->
lock
 !
NULL
) {

987 i(
txn
 =
NULL
)

988 
txn
 = 
dbp
->
cur_txn
;

989 i(
	`IS_REAL_TXN
(
txn
))

990 
	`__txn_mlock
(
dbv
,

991 
txn
, &
dbp
->
hd_lock
, dbp->
lock
);

994 
eq
.

 = 
DB_LOCK_PUT_ALL
;

995 
eq
.
obj
 = 
NULL
;

996 i((
t_t
 = 
	`__lock_vec
(
dbv
,

997 
dbp
->
lock
, 0, &
eq
, 1, 
NULL
)!0 && 
t
 == 0)

998 
t
 = 
t_t
;

1000 i((
t_t
 =

1001 
	`__lock_id_
(
dbv
, 
dbp
->
lock
)!0 && 
t
 == 0)

1002 
t
 = 
t_t
;

1003 
dbp
->
lock
 = 
NULL
;

1004 
	`LOCK_INIT
(
dbp
->
hd_lock
);

1011 i(
	`LOCKING_ON
(
dbv
) &&

1012 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
&& !dbp->
erve_fid
 &&

1013 *(
u_t32_t
 *)
dbp
->
feid
 !
DB_LOCK_INVALIDID
) {

1014 i((
t_t
 = 
	`__lock_glock
(
dbv
->
lk_hd
,

1015 *(
u_t32_t
 *)
dbp
->
feid
, 0, &
lock
)) == 0)

1016 
t_t
 = 
	`__lock_id_
(
dbv
, 
lock
);

1017 i(
t
 == 0)

1018 
t
 = 
t_t
;

1021 i(
u
) {

1028 
ve_ags
 = 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
 | 
DB_AM_TXN
);

1034 i((
t
 = 
	`__bam_db_
(
dbp
)) != 0)

1035  (
t
);

1036 i((
t
 = 
	`__ham_db_
(
dbp
)) != 0)

1037  (
t
);

1038 i((
t
 = 
	`__qam_db_
(
dbp
)) != 0)

1039  (
t
);

1042 
dbp
->
ags
 = dbp->
ig_ags
 | 
ve_ags
;

1044 i(
	`FLD_ISSET
(
ve_ags
, 
DB_AM_INMEM
)) {

1050 
	`memt
(
dbp
->
feid
, 0, (dbp->fileid));

1051 
	`MAKE_INMEM
(
dbp
);

1053  (
t
);

1056 
dbp
->
ty
 = 
DB_UNKNOWN
;

1062 i((
t_t
 = 
	`__mux_
(
dbv
, &
dbp
->
mux
)!0 && 
t
 == 0)

1063 
t
 = 
t_t
;

1066 i(
dbp
->
ame
 !
NULL
) {

1067 
	`__os_
(
dbp
->
dbv
, dbp->
ame
);

1068 
dbp
->
ame
 = 
NULL
;

1070 i(
dbp
->
dme
 !
NULL
) {

1071 
	`__os_
(
dbp
->
dbv
, dbp->
dme
);

1072 
dbp
->
dme
 = 
NULL
;

1076 i(
dbp
->
my_rskey
.
da
 !
NULL
)

1077 
	`__os_
(
dbp
->
dbv
, dbp->
my_rskey
.
da
);

1078 i(
dbp
->
my_rkey
.
da
 !
NULL
)

1079 
	`__os_
(
dbp
->
dbv
, dbp->
my_rkey
.
da
);

1080 i(
dbp
->
my_rda
.
da
 !
NULL
)

1081 
	`__os_
(
dbp
->
dbv
, dbp->
my_rda
.
da
);

1084 
	`memt
(&
dbp
->
my_rskey
, 0, (
DBT
));

1085 
	`memt
(&
dbp
->
my_rkey
, 0, (
DBT
));

1086 
	`memt
(&
dbp
->
my_rda
, 0, (
DBT
));

1089 
	`memt
(
dbp
->
feid
, 0, (dbp->fileid));

1090 
dbp
->
adj_feid
 = 0;

1091 
dbp
->
ma_pgno
 = 0;

1092 
dbp
->
cur_lock
 = 
NULL
;

1093 
dbp
->
cur_txn
 = 
NULL
;

1094 
dbp
->
assoc_lock
 = 
NULL
;

1095 
dbp
->
_id
 = 0;

1096 
dbp
->
ݒ_ags
 = 0;

1105 i(
txn
 !
NULL
)

1106 
	`LOCK_INIT
(
dbp
->
hd_lock
);

1109 
dbp
->
ags
 = dbp->
ig_ags
;

1111  (
t
);

1112 
	}
}

1119 
	$__db_dissoc
(
sdbp
)

1120 
DB
 *
sdbp
;

1122 
DBC
 *
dbc
;

1123 
t
, 
t_t
;

1125 
t
 = 0;

1127 
sdbp
->
s_back
 = 
NULL
;

1128 
sdbp
->
s_imy
 = 
NULL
;

1129 
sdbp
->
g
 = sdbp->
ed_g
;

1130 
sdbp
->
o
 = sdbp->
ed_o
;

1136 i(
sdbp
->
s_ft
 != 1 ||

1137 
	`TAILQ_FIRST
(&
sdbp
->
aive_queue
!
NULL
 ||

1138 
	`TAILQ_FIRST
(&
sdbp
->
jo_queue
!
NULL
) {

1139 
	`__db_rx
(
sdbp
->
dbv
,

1141 
t
 = 
EINVAL
;

1143 
sdbp
->
s_ft
 = 0;

1145 (
dbc
 = 
	`TAILQ_FIRST
(&
sdbp
->
_queue
)!
NULL
)

1146 i((
t_t
 = 
	`__dbc_deroy
(
dbc
)!0 && 
t
 == 0)

1147 
t
 = 
t_t
;

1149 
	`F_CLR
(
sdbp
, 
DB_AM_SECONDARY
);

1150  (
t
);

1151 
	}
}

1160 
	$__db_log_ge
(
dbp
, 
txn
, 
l
, 
pgno
, 
ge
)

1161 
DB
 *
dbp
;

1162 
DB_TXN
 *
txn
;

1163 
DB_LSN
 *
l
;

1164 
db_pgno_t
 
pgno
;

1165 
PAGE
 *
ge
;

1167 
DBT
 
ge_dbt
;

1168 
DB_LSN
 
w_l
;

1169 
t
;

1171 i(!
	`LOGGING_ON
(
dbp
->
dbv
|| 
txn
 =
NULL
)

1174 
	`memt
(&
ge_dbt
, 0, (page_dbt));

1175 
ge_dbt
.
size
 = 
dbp
->
pgsize
;

1176 
ge_dbt
.
da
 = 
ge
;

1178 
t
 = 
	`__d_masub_log
(
dbp
, 
txn
, &
w_l
, 0, 
pgno
, &
ge_dbt
, 
l
);

1180 i(
t
 == 0)

1181 
ge
->
l
 = 
w_l
;

1182  (
t
);

1183 
	}
}

1192 #unde
BACKUP_PREFIX


1193 
	#BACKUP_PREFIX
 "__db."

	)

1195 #unde
MAX_INT_TO_HEX


1196 
	#MAX_INT_TO_HEX
 8

	)

1199 
	$__db_backup_me
(
dbv
, 
me
, 
txn
, 
backup
)

1200 
DB_ENV
 *
dbv
;

1201 cڡ *
me
;

1202 
DB_TXN
 *
txn
;

1203 **
backup
;

1205 
u_t32_t
 
id
;

1206 
size_t
 
n
;

1207 
t
;

1208 *
p
, *

;

1210 *
backup
 = 
NULL
;

1217 
n
 = 
	`
(
me
+ sn(
BACKUP_PREFIX
+ 2 * 
MAX_INT_TO_HEX
 + 1;

1218 i((
t
 = 
	`__os_mloc
(
dbv
, 
n
, &

)) != 0)

1219  (
t
);

1236 
p
 = 
	`__db_h
(
me
);

1237 i(
	`IS_REAL_TXN
(
txn
)) {

1238 
	`__os_unique_id
(
dbv
, &
id
);

1239 i(
p
 =
NULL
)

1240 
	`tf
(

, 
n
, "%s%x.%x",

1241 
BACKUP_PREFIX
, 
txn
->
txnid
, 
id
);

1243 
	`tf
(

, 
n
, "%.*s%x.%x",

1244 ()(
p
 - 
me
+ 1,ame, 
txn
->
txnid
, 
id
);

1246 i(
p
 =
NULL
)

1247 
	`tf
(

, 
n
, "%s%s", 
BACKUP_PREFIX
, 
me
);

1249 
	`tf
(

, 
n
, "%.*s%s%s",

1250 ()(
p
 - 
me
+ 1,ame, 
BACKUP_PREFIX
, + 1);

1253 *
backup
 = 

;

1255 
	}
}

1257 #ifde
CONFIG_TEST


1267 
	$__db_cy
(
dbv
, 
dbp
, 
me
)

1268 
DB_ENV
 *
dbv
;

1269 
DB
 *
dbp
;

1270 cڡ *
me
;

1272 
DB_MPOOL
 *
dbmp
;

1273 
DB_MPOOLFILE
 *
mpf
;

1275 
	`DB_ASSERT
(
dbv
, 
dbp
 !
NULL
 || 
me
 != NULL);

1277 i(
me
 =
NULL
) {

1278 
dbmp
 = 
dbv
->
mp_hd
;

1279 
mpf
 = 
dbp
->mpf;

1280 
me
 = 
	`R_ADDR
(
dbmp
->
gfo
, 
mpf
->
m
->
th_off
);

1283 i(
dbp
 !
NULL
 && dbp->
ty
 =
DB_QUEUE
)

1284  (
	`__qam_docy
(
dbp
, 
me
));

1286  (
	`__db_docy
(
dbv
, 
me
));

1287 
	}
}

1290 
	$__qam_docy
(
dbp
, 
me
)

1291 
DB
 *
dbp
;

1292 cڡ *
me
;

1294 
QUEUE_FILELIST
 *
fi
, *

;

1295 
t
;

1296 
buf
[
DB_MAXPATHLEN
], *
d
;

1298 
fi
 = 
NULL
;

1299 i((
t
 = 
	`__db_docy
(
dbp
->
dbv
, 
me
)) != 0)

1300  (
t
);

1301 i(
dbp
->
mpf
 !
NULL
 &&

1302 (
t
 = 
	`__qam_g_fi
(
dbp
, &
fi
)) != 0)

1303  (
t
);

1305 i(
fi
 =
NULL
)

1307 
d
 = ((
QUEUE
 *)
dbp
->
q_
)->dir;

1308 

 = 
fi
; fp->
mpf
 !
NULL
; fp++) {

1309 
	`tf
(
buf
, (buf),

1310 
QUEUE_EXTENT
, 
d
, 
PATH_SEPARATOR
[0], 
me
, 

->
id
);

1311 i((
t
 = 
	`__db_docy
(
dbp
->
dbv
, 
buf
)) != 0)

1312  (
t
);

1315 
	`__os_
(
dbp
->
dbv
, 
fi
);

1317 
	}
}

1324 
	$__db_docy
(
dbv
, 
me
)

1325 
DB_ENV
 *
dbv
;

1326 cڡ *
me
;

1328 
size_t
 
n
;

1329 
dt
, 
i
, 
t
;

1330 *
cy
, **
me
, *
p
, *
_me
;

1332 
dt
 = 0;

1333 
cy
 = 
NULL
;

1334 
me
 = 
NULL
;

1337 i((
t
 = 
	`__db_ame
(
dbv
,

1338 
DB_APP_DATA
, 
me
, 0, 
NULL
, &
_me
)) != 0)

1339  (
t
);

1347 i(
	`__os_exis
(
dbv
, 
_me
, 
NULL
) != 0) {

1348 
	`__os_
(
dbv
, 
_me
);

1358 
n
 = 
	`
(
_me
) + (".afterop");

1359 i((
t
 = 
	`__os_mloc
(
dbv
, 
n
, &
cy
)) != 0)

1360 
r
;

1361 
	`tf
(
cy
, 
n
, "%s.a", 
_me
);

1362 i((
t
 = 
	`__db_makecy
(
dbv
, 
_me
, 
cy
)) != 0)

1363 
r
;

1368 i((
p
 = 
	`__db_h
(
_me
)!
NULL
)

1369 *
p
 = '\0';

1370 i((
t
 = 
	`__os_dli
(
dbv
, 
_me
, &
me
, &
dt
)) != 0)

1371 
r
;

1379 
i
 = 0; i < 
dt
; i++) {

1381 i(
	`cmp
(

1382 
me
[
i
], 
BACKUP_PREFIX
, (BACKUP_PREFIX) - 1) != 0)

1384 
p
 = 
me
[
i
] + (
BACKUP_PREFIX
);

1385 
p
 +
	`rn
(p, "0123456789ABCDEFabcdef");

1386 i(*
p
 != '.')

1388 ++
p
;

1389 
p
 +
	`rn
(p, "0123456789ABCDEFabcdef");

1390 i(*
p
 != '\0')

1399 i(
_me
 !
NULL
) {

1400 
	`__os_
(
dbv
, 
_me
);

1401 
_me
 = 
NULL
;

1403 i((
t
 = 
	`__db_ame
(

1404 
dbv
, 
DB_APP_DATA
, 
me
[
i
], 0, 
NULL
, &
_me
)) != 0)

1405 
r
;

1406 i(
cy
 !
NULL
) {

1407 
	`__os_
(
dbv
, 
cy
);

1408 
cy
 = 
NULL
;

1410 
n
 = 
	`
(
_me
) + (".afterop");

1411 i((
t
 = 
	`__os_mloc
(
dbv
, 
n
, &
cy
)) != 0)

1412 
r
;

1413 
	`tf
(
cy
, 
n
, "%s.a", 
_me
);

1414 i((
t
 = 
	`__db_makecy
(
dbv
, 
_me
, 
cy
)) != 0)

1415 
r
;

1418 
r
: i(
me
 !
NULL
)

1419 
	`__os_d
(
dbv
, 
me
, 
dt
);

1420 i(
cy
 !
NULL
)

1421 
	`__os_
(
dbv
, 
cy
);

1422 i(
_me
 !
NULL
)

1423 
	`__os_
(
dbv
, 
_me
);

1424  (
t
);

1425 
	}
}

1428 
	$__db_makecy
(
dbv
, 
c
, 
de
)

1429 
DB_ENV
 *
dbv
;

1430 cڡ *
c
, *
de
;

1432 
DB_FH
 *
rfhp
, *
wfhp
;

1433 
size_t
 
rt
, 
wt
;

1434 
t
;

1435 *
buf
;

1437 
rfhp
 = 
wfhp
 = 
NULL
;

1439 i((
t
 = 
	`__os_mloc
(
dbv
, 64 * 1024, &
buf
)) != 0)

1440 
r
;

1442 i((
t
 = 
	`__os_ݒ
(
dbv
, 
c
, 0,

1443 
DB_OSO_RDONLY
, 
	`__db_omode
(
OWNER_RW
), &
rfhp
)) != 0)

1444 
r
;

1445 i((
t
 = 
	`__os_ݒ
(
dbv
, 
de
, 0,

1446 
DB_OSO_CREATE
 | 
DB_OSO_TRUNC
, 
	`__db_omode
(
OWNER_RW
), &
wfhp
)) != 0)

1447 
r
;

1450 i((
t
 =

1451 
	`__os_ad
(
dbv
, 
rfhp
, 
buf
, (buf), &
rt
)) != 0)

1452 
r
;

1453 i(
rt
 == 0)

1455 i((
t
 =

1456 
	`__os_wre
(
dbv
, 
wfhp
, 
buf
, (buf), &
wt
)) != 0)

1457 
r
;

1461 
r
: 
	`__db_r
(
dbv
, 
t
, "__db_makecy: %-> %s", 
c
, 
de
);

1464 i(
buf
 !
NULL
)

1465 
	`__os_
(
dbv
, 
buf
);

1466 i(
rfhp
 !
NULL
)

1467 ()
	`__os_ohd
(
dbv
, 
rfhp
);

1468 i(
wfhp
 !
NULL
)

1469 ()
	`__os_ohd
(
dbv
, 
wfhp
);

1470  (
t
);

1471 
	}
}

	@../db/db_am.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/hash.h
"

15 
	~"dbc/lock.h
"

16 
	~"dbc/log.h
"

17 
	~"dbc/mp.h
"

18 
	~"dbc/qam.h
"

19 
	~"dbc/txn.h
"

21 
__db_nd_imy
 
__P
((
DBC
 *, 
DBT
 *, DBT *));

22 
__db_cdy_g
 
__P
((
DB
 *, 
DB_TXN
 *, 
DBT
 *, DBT *, 
u_t32_t
));

23 
__dbc_t_iܙy
 
__P
((
DBC
 *, 
DB_CACHE_PRIORITY
));

24 
__dbc_g_iܙy
 
__P
((
DBC
 *, 
DB_CACHE_PRIORITY
* ));

34 
	$__db_curs_t
(
dbp
, 
txn
, 
dbty
, 
ro
, 
is_d
, 
lock
, 
db
)

35 
DB
 *
dbp
;

36 
DB_TXN
 *
txn
;

37 
DBTYPE
 
dbty
;

38 
db_pgno_t
 
ro
;

39 
is_d
;

40 
DB_LOCKER
 *
lock
;

41 
DBC
 **
db
;

43 
DBC
 *
dbc
;

44 
DBC_INTERNAL
 *

;

45 
DB_ENV
 *
dbv
;

46 
db_thadid_t
 
tid
;

47 
lod
, 
t
;

48 
pid_t
 
pid
;

50 
dbv
 = 
dbp
->dbenv;

51 
lod
 = 0;

61 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

63 #ide
HAVE_NO_DB_REFCOUNT


71 i(
txn
 !
NULL
 && !
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
) &&

72 
dbp
->
log_fame
 !
NULL
 &&

73 !
is_d
 && 
lock
 =
NULL
 && !
	`IS_REP_CLIENT
(
dbv
) &&

74 (
t
 = 
	`__txn_cd_ame
(
dbv
, 
txn
, 
dbp
->
log_fame
)) != 0)

75  (
t
);

78 
	`TAILQ_FOREACH
(
dbc
, &
dbp
->
_queue
, 
lks
)

79 i(
dbty
 =
dbc
->dbtype) {

80 
	`TAILQ_REMOVE
(&
dbp
->
_queue
, 
dbc
, 
lks
);

81 
	`F_CLR
(
dbc
, ~
DBC_OWN_LID
);

84 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

86 i(
dbc
 =
NULL
) {

87 i((
t
 = 
	`__os_oc
(
dbv
, 1, (
DBC
), &
dbc
)) != 0)

88  (
t
);

89 
lod
 = 1;

90 
dbc
->
ags
 = 0;

92 
dbc
->
dbp
 = dbp;

95 i(
	`LOCKING_ON
(
dbv
)) {

106 i(!
	`DB_IS_THREADED
(
dbp
)) {

107 i(
dbp
->
dbv
->
v_ef
 =
NULL
 &&

108 (
t
 = 
	`__lock_id
(
dbv
, 
NULL
,

109 (
DB_LOCKER
 **)&
dbp
->
dbv
->
v_ef
)) != 0)

110 
r
;

111 
dbc
->
ef
 = 
dbp
->
dbv
->
v_ef
;

113 i((
t
 = 
	`__lock_id
(
dbv
, 
NULL
,

114 (
DB_LOCKER
 **)&
dbc
->
ef
)) != 0)

115 
r
;

116 
	`F_SET
(
dbc
, 
DBC_OWN_LID
);

132 i(
	`CDB_LOCKING
(
dbv
) &&

133 
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
))

134 
	`memy
(
dbc
->
lock
.
feid
,

135 
dbp
->
s_imy
->
feid
, 
DB_FILE_ID_LEN
);

137 
	`memy
(
dbc
->
lock
.
feid
,

138 
dbp
->
feid
, 
DB_FILE_ID_LEN
);

140 i(
	`CDB_LOCKING
(
dbv
)) {

141 i(
	`F_ISSET
(
dbv
, 
DB_ENV_CDB_ALLDB
)) {

148 
	`DB_ASSERT
(
dbv
, (
db_pgno_t
) ==

149 (
u_t32_t
));

150 
dbc
->
lock_dbt
.
size
 = (
u_t32_t
);

151 
dbc
->
lock_dbt
.
da
 = &dbc->
lock
.
pgno
;

152 
dbc
->
lock
.
pgno
 = 0;

154 
dbc
->
lock_dbt
.
size
 = 
DB_FILE_ID_LEN
;

155 
dbc
->
lock_dbt
.
da
 = dbc->
lock
.
feid
;

158 
dbc
->
lock
.
ty
 = 
DB_PAGE_LOCK
;

159 
dbc
->
lock_dbt
.
size
 = (dbc->
lock
);

160 
dbc
->
lock_dbt
.
da
 = &dbc->
lock
;

164 
dbty
) {

165 
DB_BTREE
:

166 
DB_RECNO
:

167 i((
t
 = 
	`__bamc_
(
dbc
, 
dbty
)) != 0)

168 
r
;

170 
DB_HASH
:

171 i((
t
 = 
	`__hamc_
(
dbc
)) != 0)

172 
r
;

174 
DB_QUEUE
:

175 i((
t
 = 
	`__qamc_
(
dbc
)) != 0)

176 
r
;

178 
DB_UNKNOWN
:

180 
t
 = 
	`__db_unknown_ty
(
dbv
, "DB->curs", 
dbty
);

181 
r
;

184 

 = 
dbc
->

;

188 
dbc
->
dbty
 = dbtype;

189 
	`RESET_RET_MEM
(
dbc
);

190 
dbc
->
t_iܙy
 = 
__dbc_t_iܙy
;

191 
dbc
->
g_iܙy
 = 
__dbc_g_iܙy
;

192 
dbc
->
iܙy
 = 
dbp
->priority;

194 i((
dbc
->
txn
 =xn!
NULL
)

195 
dbc
->
lock
 = 
txn
->locker;

196 i(
	`LOCKING_ON
(
dbv
)) {

218 i(
lock
 !
NULL
)

219 
dbc
->
lock
 =ocker;

225 i(
	`DB_IS_THREADED
(
dbp
)) {

226 
dbv
->
	`thad_id
(dbv, &
pid
, &
tid
);

227 
	`__lock_t_thad_id
(
dbc
->
ef
, 
pid
, 
tid
);

229 
dbc
->
lock
 = (
DB_LOCKER
 *)dbc->
ef
;

240 i(
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
))

241 
dbc
->
g
 = dbc->
c_g
 = 
__dbc_cdy_g_
;

243 i(
is_d
)

244 
	`F_SET
(
dbc
, 
DBC_OPD
);

245 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
))

246 
	`F_SET
(
dbc
, 
DBC_RECOVER
);

247 i(
	`F_ISSET
(
dbp
, 
DB_AM_COMPENSATE
))

248 
	`F_SET
(
dbc
, 
DBC_DONTLOCK
);

251 

 = 
dbc
->

;

252 

->
d
 = 
NULL
;

254 

->
dx
 = 0;

255 

->
ge
 = 
NULL
;

256 

->
pgno
 = 
PGNO_INVALID
;

257 

->
ro
 =oot;

259 
dbty
) {

260 
DB_BTREE
:

261 
DB_RECNO
:

262 i((
t
 = 
	`__bamc_esh
(
dbc
)) != 0)

263 
r
;

265 
DB_HASH
:

266 
DB_QUEUE
:

268 
DB_UNKNOWN
:

270 
t
 = 
	`__db_unknown_ty
(
dbv
, "DB->curs", 
dbp
->
ty
);

271 
r
;

279 i(
txn
 !
NULL
)

280 ++
txn
->
curss
;

282 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

283 
	`TAILQ_INSERT_TAIL
(&
dbp
->
aive_queue
, 
dbc
, 
lks
);

284 
	`F_SET
(
dbc
, 
DBC_ACTIVE
);

285 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

287 *
db
 = 
dbc
;

290 
r
: i(
lod
)

291 
	`__os_
(
dbv
, 
dbc
);

292  (
t
);

293 
	}
}

302 
	$__db_put
(
dbp
, 
txn
, 
key
, 
da
, 
ags
)

303 
DB
 *
dbp
;

304 
DB_TXN
 *
txn
;

305 
DBT
 *
key
, *
da
;

306 
u_t32_t
 
ags
;

308 
DBC
 *
dbc
;

309 
DBT
 
tda
;

310 
DB_ENV
 *
dbv
;

311 
t
, 
t_t
;

313 
dbv
 = 
dbp
->dbenv;

315 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 
DB_WRITELOCK
)) != 0)

316  (
t
);

318 
	`DEBUG_LWRITE
(
dbc
, 
txn
, "DB->put", 
key
, 
da
, 
ags
);

320 
	`SET_RET_MEM
(
dbc
, 
dbp
);

332 
	`F_SET
(
dbc
, 
DBC_TRANSIENT
);

334 
ags
) {

335 
DB_APPEND
:

342 
tda
 = *
da
;

348 
dbp
->
ty
) {

349 
DB_QUEUE
:

350 i((
t
 = 
	`__qam_nd
(
dbc
, 
key
, &
tda
)) != 0)

351 
r
;

353 
DB_RECNO
:

354 i((
t
 = 
	`__m_nd
(
dbc
, 
key
, &
tda
)) != 0)

355 
r
;

357 
DB_BTREE
:

358 
DB_HASH
:

359 
DB_UNKNOWN
:

362 
	`DB_ASSERT
(
dbv
,

363 
dbp
->
ty
 =
DB_QUEUE
 || dbp->ty =
DB_RECNO
);

365 
t
 = 
	`__db_
(
dbv
, "DB->put", 0);

366 
r
;

379 
	`DB_ASSERT
(
dbv
, !
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
));

381 i(
	`LIST_FIRST
(&
dbp
->
s_cds
!
NULL
 &&

382 (
t
 = 
	`__dbt_urcy
(
dbv
, 
key
)) == 0)

383 
t
 = 
	`__db_nd_imy
(
dbc
, 
key
, &
tda
);

389 
	`FREE_IF_NEEDED
(
dbv
, &
tda
);

392 
de
;

398 i(
t
 == 0)

399 
t
 = 
	`__dbc_put
(
dbc
,

400 
key
, 
da
, 
ags
 =0 ? 
DB_KEYLAST
 : flags);

402 
r
:

403 
de
:

404 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

405 
t
 = 
t_t
;

407  (
t
);

408 
	}
}

417 
	$__db_d
(
dbp
, 
txn
, 
key
, 
ags
)

418 
DB
 *
dbp
;

419 
DB_TXN
 *
txn
;

420 
DBT
 *
key
;

421 
u_t32_t
 
ags
;

423 
DBC
 *
dbc
;

424 
DBT
 
da
;

425 
u_t32_t
 
f_
, 
f_xt
;

426 
t
, 
t_t
;

429 i((
t
 = 
	`__db_curs
(
dbp
, 
txn
, &
dbc
, 
DB_WRITELOCK
)) != 0)

430 
r
;

432 
	`DEBUG_LWRITE
(
dbc
, 
txn
, "DB->d", 
key
, 
NULL
, 
ags
);

433 
	`COMPQUIET
(
ags
, 0);

442 
	`memt
(&
da
, 0, (data));

443 
	`F_SET
(&
da
, 
DB_DBT_USERMEM
 | 
DB_DBT_ISSET
);

444 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

450 
f_
 = 
DB_SET
;

451 
f_xt
 = 
DB_NEXT_DUP
;

452 i(
	`STD_LOCKING
(
dbc
)) {

453 
f_
 |
DB_RMW
;

454 
f_xt
 |
DB_RMW
;

481 i(!
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
) &&

482 
	`LIST_FIRST
(&
dbp
->
s_cds
=
NULL
) {

483 #ifde
HAVE_QUEUE


484 i(
dbp
->
ty
 =
DB_QUEUE
) {

485 
t
 = 
	`__qam_de
(
dbc
, 
key
);

486 
	`F_CLR
(
key
, 
DB_DBT_ISSET
);

487 
de
;

492 i((
t
 = 
	`__dbc_g
(
dbc
, 
key
, &
da
, 
f_
)) != 0)

493 
r
;

495 #ifde
HAVE_HASH


496 i(
dbp
->
ty
 =
DB_HASH
 && 
dbc
->

->
d
 =
NULL
) {

497 
t
 = 
	`__ham_quick_de
(
dbc
);

498 
de
;

502 i((
dbp
->
ty
 =
DB_BTREE
 || dbp->ty =
DB_RECNO
) &&

503 !
	`F_ISSET
(
dbp
, 
DB_AM_DUP
)) {

504 
t
 = 
dbc
->
	`am_d
(dbc);

505 
de
;

507 } i((
t
 = 
	`__dbc_g
(
dbc
, 
key
, &
da
, 
f_
)) != 0)

508 
r
;

512 i((
t
 = 
	`__dbc_d
(
dbc
, 0)) != 0)

514 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

515 
	`F_SET
(&
da
, 
DB_DBT_ISSET
);

516 i((
t
 = 
	`__dbc_g
(
dbc
, 
key
, &
da
, 
f_xt
)) != 0) {

517 i(
t
 =
DB_NOTFOUND
)

518 
t
 = 0;

523 
de
:

524 
r
:

525 i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

526 
t
 = 
t_t
;

528  (
t
);

529 
	}
}

538 
	$__db_sync
(
dbp
)

539 
DB
 *
dbp
;

541 
t
, 
t_t
;

543 
t
 = 0;

546 i(
	`F_ISSET
(
dbp
, 
DB_AM_RDONLY
))

550 i(
dbp
->
ty
 =
DB_RECNO
)

551 
t
 = 
	`__m_wreback
(
dbp
);

554 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
))

555  (
t
);

557 i(
dbp
->
ty
 =
DB_QUEUE
)

558 
t
 = 
	`__qam_sync
(
dbp
);

561 i((
t_t
 = 
	`__memp_fsync
(
dbp
->
mpf
)!0 && 
t
 == 0)

562 
t
 = 
t_t
;

564  (
t
);

565 
	}
}

575 
	$__db_assoc
(
dbp
, 
txn
, 
sdbp
, 
back
, 
ags
)

576 
DB
 *
dbp
, *
sdbp
;

577 
DB_TXN
 *
txn
;

578 (*
back

	`__P
((
DB
 *, cڡ 
DBT
 *, const DBT *, DBT *));

579 
u_t32_t
 
ags
;

581 
DB_ENV
 *
dbv
;

582 
DBC
 *
pdbc
, *
sdbc
;

583 
DBT
 
key
, 
da
, 
skey
, *
tskeyp
;

584 
bud
, 
t
, 
t_t
;

585 
u_t32_t
 
nskey
;

587 
dbv
 = 
dbp
->dbenv;

588 
pdbc
 = 
sdbc
 = 
NULL
;

589 
t
 = 0;

591 
	`memt
(&
skey
, 0, (
DBT
));

592 
nskey
 = 0;

593 
tskeyp
 = 
NULL
;

601 
bud
 = 0;

602 i(
	`LF_ISSET
(
DB_CREATE
)) {

603 i((
t
 = 
	`__db_curs
(
sdbp
, 
txn
, &
sdbc
, 0)) != 0)

604 
r
;

610 
	`memt
(&
key
, 0, (
DBT
));

611 
	`memt
(&
da
, 0, (
DBT
));

612 
	`F_SET
(&
key
, 
DB_DBT_PARTIAL
 | 
DB_DBT_USERMEM
);

613 
	`F_SET
(&
da
, 
DB_DBT_PARTIAL
 | 
DB_DBT_USERMEM
);

614 i((
t
 = 
	`__dbc_g
(
sdbc
, &
key
, &
da
,

615 (
	`STD_LOCKING
(
sdbc
? 
DB_RMW
 : 0) |

616 
DB_FIRST
)=
DB_NOTFOUND
) {

617 
bud
 = 1;

618 
t
 = 0;

621 i((
t_t
 = 
	`__dbc_o
(
sdbc
)!0 && 
t
 == 0)

622 
t
 = 
t_t
;

625 
sdbc
 = 
NULL
;

627 i(
t
 != 0)

628 
r
;

634 
sdbp
->
s_back
 = 
back
;

635 
sdbp
->
s_imy
 = 
dbp
;

637 
sdbp
->
ed_g
 = sdbp->
g
;

638 
sdbp
->
g
 = 
__db_cdy_g
;

640 
sdbp
->
ed_o
 = sdbp->
o
;

641 
sdbp
->
o
 = 
__db_cdy_o_
;

643 
	`F_SET
(
sdbp
, 
DB_AM_SECONDARY
);

645 i(
	`LF_ISSET
(
DB_IMMUTABLE_KEY
))

646 
	`FLD_SET
(
sdbp
->
s_assoc_ags
, 
DB_ASSOC_IMMUTABLE_KEY
);

653 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

656 
	`DB_ASSERT
(
dbv
, 
sdbp
->
s_ft
 == 0);

657 
sdbp
->
s_ft
 = 1;

658 
	`LIST_INSERT_HEAD
(&
dbp
->
s_cds
, 
sdbp
, 
s_lks
);

659 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

661 i(
bud
) {

675 i((
t
 = 
	`__db_curs
(
sdbp
, 
txn
, &
sdbc
,

676 
	`CDB_LOCKING
(
sdbp
->
dbv
? 
DB_WRITECURSOR
 : 0)) != 0)

677 
r
;

678 i((
t
 = 
	`__db_curs_t
(
dbp
,

679 
txn
, 
dbp
->
ty
, 
PGNO_INVALID
, 0, 
sdbc
->
lock
, &
pdbc
)) != 0)

680 
r
;

683 
dbp
->
assoc_lock
 = 
sdbc
->
lock
;

685 
	`memt
(&
key
, 0, (
DBT
));

686 
	`memt
(&
da
, 0, (
DBT
));

687 (
t
 = 
	`__dbc_g
(
pdbc
, &
key
, &
da
, 
DB_NEXT
)) == 0) {

688 i((
t
 = 
	`back
(
sdbp
, &
key
, &
da
, &
skey
)) != 0) {

689 i(
t
 =
DB_DONOTINDEX
)

691 
r
;

693 i(
	`F_ISSET
(&
skey
, 
DB_DBT_MULTIPLE
)) {

694 #ifde
DIAGNOSTIC


695 
	`__db_check_skeyt
(
sdbp
, &
skey
);

697 
nskey
 = 
skey
.
size
;

698 
tskeyp
 = (
DBT
 *)
skey
.
da
;

700 
nskey
 = 1;

701 
tskeyp
 = &
skey
;

703 
	`SWAP_IF_NEEDED
(
sdbp
, &
key
);

704 ; 
nskey
 > 0;skey--, 
tskeyp
++) {

705 i((
t
 = 
	`__dbc_put
(
sdbc
,

706 
tskeyp
, &
key
, 
DB_UPDATE_SECONDARY
)) != 0)

707 
r
;

708 
	`FREE_IF_NEEDED
(
dbv
, 
tskeyp
);

710 
	`SWAP_IF_NEEDED
(
sdbp
, &
key
);

711 
	`FREE_IF_NEEDED
(
dbv
, &
skey
);

713 i(
t
 =
DB_NOTFOUND
)

714 
t
 = 0;

717 
r
: i(
sdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(sdbc)!0 && 
t
 == 0)

718 
t
 = 
t_t
;

720 i(
pdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
dbc)!0 && 
t
 == 0)

721 
t
 = 
t_t
;

723 
dbp
->
assoc_lock
 = 
NULL
;

725 ; 
nskey
 > 0;skey--, 
tskeyp
++)

726 
	`FREE_IF_NEEDED
(
dbv
, 
tskeyp
);

727 
	`FREE_IF_NEEDED
(
dbv
, &
skey
);

729  (
t
);

730 
	}
}

738 
	$__db_cdy_g
(
sdbp
, 
txn
, 
skey
, 
da
, 
ags
)

739 
DB
 *
sdbp
;

740 
DB_TXN
 *
txn
;

741 
DBT
 *
skey
, *
da
;

742 
u_t32_t
 
ags
;

744 
	`DB_ASSERT
(
sdbp
->
dbv
, 
	`F_ISSET
(sdbp, 
DB_AM_SECONDARY
));

745  (
	`__db_pg_
(
sdbp
, 
txn
, 
skey
, 
NULL
, 
da
, 
ags
));

746 
	}
}

757 
	$__db_cdy_o
(
sdbp
, 
ags
)

758 
DB
 *
sdbp
;

759 
u_t32_t
 
ags
;

761 
DB_ENV
 *
dbv
;

762 
DB
 *
imy
;

763 
doo
;

765 
doo
 = 0;

766 
imy
 = 
sdbp
->
s_imy
;

767 
dbv
 = 
imy
->dbenv;

769 
	`MUTEX_LOCK
(
dbv
, 
imy
->
mux
);

779 
	`DB_ASSERT
(
dbv
, 
sdbp
->
s_ft
 != 0);

780 i(--
sdbp
->
s_ft
 == 0) {

781 
	`LIST_REMOVE
(
sdbp
, 
s_lks
);

783 
doo
 = 1;

785 
	`MUTEX_UNLOCK
(
dbv
, 
imy
->
mux
);

791  (
doo
 ? 
	`__db_o
(
sdbp
, 
NULL
, 
ags
) : 0);

792 
	}
}

800 
	$__db_nd_imy
(
dbc
, 
key
, 
da
)

801 
DBC
 *
dbc
;

802 
DBT
 *
key
, *
da
;

804 
DB
 *
dbp
, *
sdbp
;

805 
DBC
 *
sdbc
, *
pdbc
;

806 
DBT
 
dpkey
, 
pkey
, 
pda
, 
skey
;

807 
DB_ENV
 *
dbv
;

808 
cmp
, 
t
, 
t_t
;

810 
dbp
 = 
dbc
->dbp;

811 
dbv
 = 
dbp
->dbenv;

812 
sdbp
 = 
NULL
;

813 
t
 = 0;

820 
pdbc
 = 
NULL
;

821 i(
	`F_ISSET
(
da
, 
DB_DBT_PARTIAL
|| F_ISSET(
key
, DB_DBT_PARTIAL)) {

834 i((
t
 = 
	`__dbc_idup
(
dbc
, &
pdbc
, 
DB_POSITION
)) != 0)

835  (
t
);

836 
	`memt
(&
pkey
, 0, (
DBT
));

837 
	`memt
(&
pda
, 0, (
DBT
));

839 i((
t
 = 
	`__dbc_g
(
pdbc
, &
pkey
, &
pda
, 
DB_CURRENT
)) != 0)

840 
r
;

842 
key
 = &
pkey
;

843 
da
 = &
pda
;

855 i((
t
 = 
	`__db_s_f
(
dbp
, &
sdbp
)) != 0)

856 
r
;

857 ; 
sdbp
 !
NULL
 && 
t
 =0; = 
	`__db_s_xt
(&sdbp, 
dbc
->
txn
)) {

858 
	`memt
(&
skey
, 0, (
DBT
));

859 i((
t
 = 
sdbp
->
	`s_back
(sdbp, 
key
, 
da
, &
skey
)) != 0) {

860 i(
t
 =
DB_DONOTINDEX
)

862 
r
;

865 i((
t
 = 
	`__db_curs_t
(
sdbp
, 
dbc
->
txn
, sdbp->
ty
,

866 
PGNO_INVALID
, 0, 
dbc
->
lock
, &
sdbc
)) != 0) {

867 
	`FREE_IF_NEEDED
(
dbv
, &
skey
);

868 
r
;

870 i(
	`CDB_LOCKING
(
dbv
)) {

871 
	`DB_ASSERT
(
dbv
, 
sdbc
->
mylock
.
off
 =
LOCK_INVALID
);

872 
	`F_SET
(
sdbc
, 
DBC_WRITER
);

882 i(!
	`F_ISSET
(
sdbp
, 
DB_AM_DUP
)) {

883 
	`memt
(&
dpkey
, 0, (
DBT
));

884 
	`F_SET
(&
dpkey
, 
DB_DBT_MALLOC
);

885 
t
 = 
	`__dbc_g
(
sdbc
, &
skey
, &
dpkey
,

886 
DB_SET
 | (
	`STD_LOCKING
(
dbc
? 
DB_RMW
 : 0));

887 i(
t
 == 0) {

888 
cmp
 = 
	`__bam_defcmp
(
sdbp
, &
dpkey
, 
key
);

894 
	`__os_u
(
dbv
, 
dpkey
.
da
);

895 i(
cmp
 != 0) {

896 
	`__db_rx
(
dbv
, "%s%s",

899 
t
 = 
EINVAL
;

900 
r1
;

902 } i(
t
 !
DB_NOTFOUND
 && !
DB_KEYEMPTY
)

903 
r1
;

906 
t
 = 
	`__dbc_put
(
sdbc
, &
skey
, 
key
, 
DB_UPDATE_SECONDARY
);

908 
r1
: 
	`FREE_IF_NEEDED
(
dbv
, &
skey
);

910 i((
t_t
 = 
	`__dbc_o
(
sdbc
)!0 && 
t
 == 0)

911 
t
 = 
t_t
;

912 i(
t
 != 0)

913 
r
;

916 
r
: i(
pdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
dbc)!0 && 
t
 == 0)

917 
t
 = 
t_t
;

918 i(
sdbp
 !
NULL
 &&

919 (
t_t
 = 
	`__db_s_de
(
sdbp
, 
dbc
->
txn
)!0 && 
t
 == 0)

920 
t
 = 
t_t
;

921  (
t
);

922 
	}
}

925 
	$__dbc_t_iܙy
(
dbc
, 
iܙy
)

926 
DBC
 *
dbc
;

927 
DB_CACHE_PRIORITY
 
iܙy
;

929 
dbc
->
iܙy
 =riority;

931 
	}
}

934 
	$__dbc_g_iܙy
(
dbc
, 
iܙy
)

935 
DBC
 *
dbc
;

936 
DB_CACHE_PRIORITY
 *
iܙy
;

938 *
iܙy
 = 
dbc
->priority;

940 
	}
}

	@../db/db_auto.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_dich.h
"

9 
	~"dbc/db_am.h
"

10 
	~"dbc/log.h
"

11 
	~"dbc/txn.h
"

19 
	$__db_addm_log
(
dbp
, 
tx
, 
t_lp
, 
ags
,

20 
code
, 
pgno
, 
dx
, 
nbys
, 
hdr
,

21 
dbt
, 
g
)

22 
DB
 *
dbp
;

23 
DB_TXN
 *
tx
;

24 
DB_LSN
 *
t_lp
;

25 
u_t32_t
 
ags
;

26 
u_t32_t
 
code
;

27 
db_pgno_t
 
pgno
;

28 
u_t32_t
 
dx
;

29 
u_t32_t
 
nbys
;

30 cڡ 
DBT
 *
hdr
;

31 cڡ 
DBT
 *
dbt
;

32 
DB_LSN
 * 
g
;

34 
DBT
 
logc
;

35 
DB_ENV
 *
dbv
;

36 
DB_TXNLOGREC
 *

;

37 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

38 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

39 
u_t
 
ad
;

40 
u_t8_t
 *
bp
;

41 
is_dub
, 
t
;

43 
dbv
 = 
dbp
->dbenv;

44 
	`COMPQUIET
(

, 
NULL
);

46 
y
 = 
DB___db_addm
;

47 
ad
 = 0;

48 
p
 = 
t_lp
;

50 
t
 = 0;

52 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

53 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

54 i(
tx
 =
NULL
)

56 
is_dub
 = 0;

58 
is_dub
 = 1;

60 i(
tx
 =
NULL
) {

61 
txn_num
 = 0;

62 
lp
 = &
nu_l
;

63 
nu_l
.
fe
 =u_l.
offt
 = 0;

65 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

66 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

67  (
t
);

74 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

75 
txn_num
 = 
tx
->
txnid
;

78 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

79 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

80 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

81  (
t
);

83 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

84 + (
u_t32_t
)

85 + (
u_t32_t
)

86 + (
u_t32_t
)

87 + (
u_t32_t
)

88 + (
u_t32_t
)

89 + (
u_t32_t
+ (
hdr
 =
NULL
 ? 0 : hdr->
size
)

90 + (
u_t32_t
+ (
dbt
 =
NULL
 ? 0 : dbt->
size
)

91 + (*
g
);

92 i(
	`CRYPTO_ON
(
dbv
)) {

93 
ad
 =

94 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

95 
logc
.
size
 +
ad
;

98 i(
is_dub
 || 
tx
 =
NULL
) {

99 i((
t
 =

100 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

101  (
t
);

103 i((
t
 = 
	`__os_mloc
(
dbv
,

104 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

105  (
t
);

106 #ifde
DIAGNOSTIC


107 i((
t
 =

108 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

109 
	`__os_
(
dbv
, 

);

110  (
t
);

113 
logc
.
da
 = 

->data;

116 i(
ad
 > 0)

117 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

119 
bp
 = 
logc
.
da
;

121 
	`memy
(
bp
, &
y
, (rectype));

122 
bp
 +(
y
);

124 
	`memy
(
bp
, &
txn_num
, (txn_num));

125 
bp
 +(
txn_num
);

127 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

128 
bp
 +(
DB_LSN
);

130 
ump
 = (
u_t32_t
)
code
;

131 
	`memy
(
bp
, &
ump
, (uinttmp));

132 
bp
 +(
ump
);

134 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

135 
	`memy
(
bp
, &
ump
, (uinttmp));

136 
bp
 +(
ump
);

138 
ump
 = (
u_t32_t
)
pgno
;

139 
	`memy
(
bp
, &
ump
, (uinttmp));

140 
bp
 +(
ump
);

142 
ump
 = (
u_t32_t
)
dx
;

143 
	`memy
(
bp
, &
ump
, (uinttmp));

144 
bp
 +(
ump
);

146 
ump
 = (
u_t32_t
)
nbys
;

147 
	`memy
(
bp
, &
ump
, (uinttmp));

148 
bp
 +(
ump
);

150 i(
hdr
 =
NULL
) {

151 
zo
 = 0;

152 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

153 
bp
 +(
u_t32_t
);

155 
	`memy
(
bp
, &
hdr
->
size
, (hdr->size));

156 
bp
 +(
hdr
->
size
);

157 
	`memy
(
bp
, 
hdr
->
da
, hdr->
size
);

158 
bp
 +
hdr
->
size
;

161 i(
dbt
 =
NULL
) {

162 
zo
 = 0;

163 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

164 
bp
 +(
u_t32_t
);

166 
	`memy
(
bp
, &
dbt
->
size
, (dbt->size));

167 
bp
 +(
dbt
->
size
);

168 
	`memy
(
bp
, 
dbt
->
da
, dbt->
size
);

169 
bp
 +
dbt
->
size
;

172 i(
g
 !
NULL
) {

173 i(
tx
 !
NULL
) {

174 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

175 i(
	`LOG_COMPARE
(
g
, &

->
l
>0 && (
t
 =

176 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
g
) != 0))

177  (
t
);

179 
	`memy
(
bp
, 
g
, (*pagelsn));

181 
	`memt
(
bp
, 0, (*
g
));

182 
bp
 +(*
g
);

184 
	`DB_ASSERT
(
dbv
,

185 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

187 i(
is_dub
 || 
tx
 =
NULL
) {

188 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

189 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

190 *
lp
 = *
p
;

191 i(
p
 !
t_lp
)

192 *
t_lp
 = *
p
;

195 
t
 = 0;

196 #ifde
DIAGNOSTIC


201 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

202 
y
 |
DB_debug_FLAG
;

203 
	`memy
(
logc
.
da
, &
y
, (rectype));

205 i(!
	`IS_REP_CLIENT
(
dbv
))

206 
t
 = 
	`__log_put
(
dbv
,

207 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

209 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

210 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

211 
	`LSN_NOT_LOGGED
(*
t_lp
);

214 #ifde
LOG_DIAGNOSTIC


215 i(
t
 != 0)

216 ()
	`__db_addm_t
(
dbv
,

217 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

220 #ifde
DIAGNOSTIC


221 
	`__os_
(
dbv
, 
logc
.
da
);

223 i(
is_dub
 || 
tx
 =
NULL
)

224 
	`__os_
(
dbv
, 
logc
.
da
);

226  (
t
);

227 
	}
}

233 
	$__db_addm_ad
(
dbv
, 
cbuf
, 
g
)

234 
DB_ENV
 *
dbv
;

235 *
cbuf
;

236 
__db_addm_gs
 **
g
;

238 
__db_addm_gs
 *
gp
;

239 
u_t32_t
 
ump
;

240 
u_t8_t
 *
bp
;

241 
t
;

243 i((
t
 = 
	`__os_mloc
(
dbv
,

244 (
__db_addm_gs
+ (
DB_TXN
), &
gp
)) != 0)

245  (
t
);

246 
bp
 = 
cbuf
;

247 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

248 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

250 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

251 
bp
 +(
gp
->
ty
);

253 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

254 
bp
 +(
gp
->
tx
->
txnid
);

256 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

257 
bp
 +(
DB_LSN
);

259 
	`memy
(&
ump
, 
bp
, (uinttmp));

260 
gp
->
code
 = (
u_t32_t
)
ump
;

261 
bp
 +(
ump
);

263 
	`memy
(&
ump
, 
bp
, (uinttmp));

264 
gp
->
feid
 = (
t32_t
)
ump
;

265 
bp
 +(
ump
);

267 
	`memy
(&
ump
, 
bp
, (uinttmp));

268 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

269 
bp
 +(
ump
);

271 
	`memy
(&
ump
, 
bp
, (uinttmp));

272 
gp
->
dx
 = (
u_t32_t
)
ump
;

273 
bp
 +(
ump
);

275 
	`memy
(&
ump
, 
bp
, (uinttmp));

276 
gp
->
nbys
 = (
u_t32_t
)
ump
;

277 
bp
 +(
ump
);

279 
	`memt
(&
gp
->
hdr
, 0, (argp->hdr));

280 
	`memy
(&
gp
->
hdr
.
size
, 
bp
, (
u_t32_t
));

281 
bp
 +(
u_t32_t
);

282 
gp
->
hdr
.
da
 = 
bp
;

283 
bp
 +
gp
->
hdr
.
size
;

285 
	`memt
(&
gp
->
dbt
, 0, (argp->dbt));

286 
	`memy
(&
gp
->
dbt
.
size
, 
bp
, (
u_t32_t
));

287 
bp
 +(
u_t32_t
);

288 
gp
->
dbt
.
da
 = 
bp
;

289 
bp
 +
gp
->
dbt
.
size
;

291 
	`memy
(&
gp
->
g
, 
bp
, (argp->pagelsn));

292 
bp
 +(
gp
->
g
);

294 *
g
 = 
gp
;

296 
	}
}

304 
	$__db_big_log
(
dbp
, 
tx
, 
t_lp
, 
ags
,

305 
code
, 
pgno
, 
ev_pgno
, 
xt_pgno
, 
dbt
,

306 
g
, 
evl
, 
x
)

307 
DB
 *
dbp
;

308 
DB_TXN
 *
tx
;

309 
DB_LSN
 *
t_lp
;

310 
u_t32_t
 
ags
;

311 
u_t32_t
 
code
;

312 
db_pgno_t
 
pgno
;

313 
db_pgno_t
 
ev_pgno
;

314 
db_pgno_t
 
xt_pgno
;

315 cڡ 
DBT
 *
dbt
;

316 
DB_LSN
 * 
g
;

317 
DB_LSN
 * 
evl
;

318 
DB_LSN
 * 
x
;

320 
DBT
 
logc
;

321 
DB_ENV
 *
dbv
;

322 
DB_TXNLOGREC
 *

;

323 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

324 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

325 
u_t
 
ad
;

326 
u_t8_t
 *
bp
;

327 
is_dub
, 
t
;

329 
dbv
 = 
dbp
->dbenv;

330 
	`COMPQUIET
(

, 
NULL
);

332 
y
 = 
DB___db_big
;

333 
ad
 = 0;

334 
p
 = 
t_lp
;

336 
t
 = 0;

338 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

339 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

340 i(
tx
 =
NULL
)

342 
is_dub
 = 0;

344 
is_dub
 = 1;

346 i(
tx
 =
NULL
) {

347 
txn_num
 = 0;

348 
lp
 = &
nu_l
;

349 
nu_l
.
fe
 =u_l.
offt
 = 0;

351 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

352 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

353  (
t
);

360 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

361 
txn_num
 = 
tx
->
txnid
;

364 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

365 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

366 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

367  (
t
);

369 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

370 + (
u_t32_t
)

371 + (
u_t32_t
)

372 + (
u_t32_t
)

373 + (
u_t32_t
)

374 + (
u_t32_t
)

375 + (
u_t32_t
+ (
dbt
 =
NULL
 ? 0 : dbt->
size
)

376 + (*
g
)

377 + (*
evl
)

378 + (*
x
);

379 i(
	`CRYPTO_ON
(
dbv
)) {

380 
ad
 =

381 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

382 
logc
.
size
 +
ad
;

385 i(
is_dub
 || 
tx
 =
NULL
) {

386 i((
t
 =

387 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

388  (
t
);

390 i((
t
 = 
	`__os_mloc
(
dbv
,

391 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

392  (
t
);

393 #ifde
DIAGNOSTIC


394 i((
t
 =

395 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

396 
	`__os_
(
dbv
, 

);

397  (
t
);

400 
logc
.
da
 = 

->data;

403 i(
ad
 > 0)

404 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

406 
bp
 = 
logc
.
da
;

408 
	`memy
(
bp
, &
y
, (rectype));

409 
bp
 +(
y
);

411 
	`memy
(
bp
, &
txn_num
, (txn_num));

412 
bp
 +(
txn_num
);

414 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

415 
bp
 +(
DB_LSN
);

417 
ump
 = (
u_t32_t
)
code
;

418 
	`memy
(
bp
, &
ump
, (uinttmp));

419 
bp
 +(
ump
);

421 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

422 
	`memy
(
bp
, &
ump
, (uinttmp));

423 
bp
 +(
ump
);

425 
ump
 = (
u_t32_t
)
pgno
;

426 
	`memy
(
bp
, &
ump
, (uinttmp));

427 
bp
 +(
ump
);

429 
ump
 = (
u_t32_t
)
ev_pgno
;

430 
	`memy
(
bp
, &
ump
, (uinttmp));

431 
bp
 +(
ump
);

433 
ump
 = (
u_t32_t
)
xt_pgno
;

434 
	`memy
(
bp
, &
ump
, (uinttmp));

435 
bp
 +(
ump
);

437 i(
dbt
 =
NULL
) {

438 
zo
 = 0;

439 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

440 
bp
 +(
u_t32_t
);

442 
	`memy
(
bp
, &
dbt
->
size
, (dbt->size));

443 
bp
 +(
dbt
->
size
);

444 
	`memy
(
bp
, 
dbt
->
da
, dbt->
size
);

445 
bp
 +
dbt
->
size
;

448 i(
g
 !
NULL
) {

449 i(
tx
 !
NULL
) {

450 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

451 i(
	`LOG_COMPARE
(
g
, &

->
l
>0 && (
t
 =

452 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
g
) != 0))

453  (
t
);

455 
	`memy
(
bp
, 
g
, (*pagelsn));

457 
	`memt
(
bp
, 0, (*
g
));

458 
bp
 +(*
g
);

460 i(
evl
 !
NULL
) {

461 i(
tx
 !
NULL
) {

462 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

463 i(
	`LOG_COMPARE
(
evl
, &

->
l
>0 && (
t
 =

464 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
evl
) != 0))

465  (
t
);

467 
	`memy
(
bp
, 
evl
, (*prevlsn));

469 
	`memt
(
bp
, 0, (*
evl
));

470 
bp
 +(*
evl
);

472 i(
x
 !
NULL
) {

473 i(
tx
 !
NULL
) {

474 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

475 i(
	`LOG_COMPARE
(
x
, &

->
l
>0 && (
t
 =

476 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
x
) != 0))

477  (
t
);

479 
	`memy
(
bp
, 
x
, (*nextlsn));

481 
	`memt
(
bp
, 0, (*
x
));

482 
bp
 +(*
x
);

484 
	`DB_ASSERT
(
dbv
,

485 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

487 i(
is_dub
 || 
tx
 =
NULL
) {

488 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

489 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

490 *
lp
 = *
p
;

491 i(
p
 !
t_lp
)

492 *
t_lp
 = *
p
;

495 
t
 = 0;

496 #ifde
DIAGNOSTIC


501 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

502 
y
 |
DB_debug_FLAG
;

503 
	`memy
(
logc
.
da
, &
y
, (rectype));

505 i(!
	`IS_REP_CLIENT
(
dbv
))

506 
t
 = 
	`__log_put
(
dbv
,

507 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

509 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

510 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

511 
	`LSN_NOT_LOGGED
(*
t_lp
);

514 #ifde
LOG_DIAGNOSTIC


515 i(
t
 != 0)

516 ()
	`__db_big_t
(
dbv
,

517 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

520 #ifde
DIAGNOSTIC


521 
	`__os_
(
dbv
, 
logc
.
da
);

523 i(
is_dub
 || 
tx
 =
NULL
)

524 
	`__os_
(
dbv
, 
logc
.
da
);

526  (
t
);

527 
	}
}

533 
	$__db_big_ad
(
dbv
, 
cbuf
, 
g
)

534 
DB_ENV
 *
dbv
;

535 *
cbuf
;

536 
__db_big_gs
 **
g
;

538 
__db_big_gs
 *
gp
;

539 
u_t32_t
 
ump
;

540 
u_t8_t
 *
bp
;

541 
t
;

543 i((
t
 = 
	`__os_mloc
(
dbv
,

544 (
__db_big_gs
+ (
DB_TXN
), &
gp
)) != 0)

545  (
t
);

546 
bp
 = 
cbuf
;

547 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

548 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

550 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

551 
bp
 +(
gp
->
ty
);

553 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

554 
bp
 +(
gp
->
tx
->
txnid
);

556 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

557 
bp
 +(
DB_LSN
);

559 
	`memy
(&
ump
, 
bp
, (uinttmp));

560 
gp
->
code
 = (
u_t32_t
)
ump
;

561 
bp
 +(
ump
);

563 
	`memy
(&
ump
, 
bp
, (uinttmp));

564 
gp
->
feid
 = (
t32_t
)
ump
;

565 
bp
 +(
ump
);

567 
	`memy
(&
ump
, 
bp
, (uinttmp));

568 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

569 
bp
 +(
ump
);

571 
	`memy
(&
ump
, 
bp
, (uinttmp));

572 
gp
->
ev_pgno
 = (
db_pgno_t
)
ump
;

573 
bp
 +(
ump
);

575 
	`memy
(&
ump
, 
bp
, (uinttmp));

576 
gp
->
xt_pgno
 = (
db_pgno_t
)
ump
;

577 
bp
 +(
ump
);

579 
	`memt
(&
gp
->
dbt
, 0, (argp->dbt));

580 
	`memy
(&
gp
->
dbt
.
size
, 
bp
, (
u_t32_t
));

581 
bp
 +(
u_t32_t
);

582 
gp
->
dbt
.
da
 = 
bp
;

583 
bp
 +
gp
->
dbt
.
size
;

585 
	`memy
(&
gp
->
g
, 
bp
, (argp->pagelsn));

586 
bp
 +(
gp
->
g
);

588 
	`memy
(&
gp
->
evl
, 
bp
, (argp->prevlsn));

589 
bp
 +(
gp
->
evl
);

591 
	`memy
(&
gp
->
x
, 
bp
, (argp->nextlsn));

592 
bp
 +(
gp
->
x
);

594 *
g
 = 
gp
;

596 
	}
}

603 
	$__db_ovf_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
adju
, 
l
)

604 
DB
 *
dbp
;

605 
DB_TXN
 *
tx
;

606 
DB_LSN
 *
t_lp
;

607 
u_t32_t
 
ags
;

608 
db_pgno_t
 
pgno
;

609 
t32_t
 
adju
;

610 
DB_LSN
 * 
l
;

612 
DBT
 
logc
;

613 
DB_ENV
 *
dbv
;

614 
DB_TXNLOGREC
 *

;

615 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

616 
u_t32_t
 
ump
, 
y
, 
txn_num
;

617 
u_t
 
ad
;

618 
u_t8_t
 *
bp
;

619 
is_dub
, 
t
;

621 
dbv
 = 
dbp
->dbenv;

622 
	`COMPQUIET
(

, 
NULL
);

624 
y
 = 
DB___db_ovf
;

625 
ad
 = 0;

626 
p
 = 
t_lp
;

628 
t
 = 0;

630 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

631 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

632 i(
tx
 =
NULL
)

634 
is_dub
 = 0;

636 
is_dub
 = 1;

638 i(
tx
 =
NULL
) {

639 
txn_num
 = 0;

640 
lp
 = &
nu_l
;

641 
nu_l
.
fe
 =u_l.
offt
 = 0;

643 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

644 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

645  (
t
);

652 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

653 
txn_num
 = 
tx
->
txnid
;

656 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

657 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

658 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

659  (
t
);

661 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

662 + (
u_t32_t
)

663 + (
u_t32_t
)

664 + (
u_t32_t
)

665 + (*
l
);

666 i(
	`CRYPTO_ON
(
dbv
)) {

667 
ad
 =

668 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

669 
logc
.
size
 +
ad
;

672 i(
is_dub
 || 
tx
 =
NULL
) {

673 i((
t
 =

674 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

675  (
t
);

677 i((
t
 = 
	`__os_mloc
(
dbv
,

678 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

679  (
t
);

680 #ifde
DIAGNOSTIC


681 i((
t
 =

682 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

683 
	`__os_
(
dbv
, 

);

684  (
t
);

687 
logc
.
da
 = 

->data;

690 i(
ad
 > 0)

691 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

693 
bp
 = 
logc
.
da
;

695 
	`memy
(
bp
, &
y
, (rectype));

696 
bp
 +(
y
);

698 
	`memy
(
bp
, &
txn_num
, (txn_num));

699 
bp
 +(
txn_num
);

701 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

702 
bp
 +(
DB_LSN
);

704 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

705 
	`memy
(
bp
, &
ump
, (uinttmp));

706 
bp
 +(
ump
);

708 
ump
 = (
u_t32_t
)
pgno
;

709 
	`memy
(
bp
, &
ump
, (uinttmp));

710 
bp
 +(
ump
);

712 
ump
 = (
u_t32_t
)
adju
;

713 
	`memy
(
bp
, &
ump
, (uinttmp));

714 
bp
 +(
ump
);

716 i(
l
 !
NULL
) {

717 i(
tx
 !
NULL
) {

718 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

719 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

720 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
l
) != 0))

721  (
t
);

723 
	`memy
(
bp
, 
l
, (*lsn));

725 
	`memt
(
bp
, 0, (*
l
));

726 
bp
 +(*
l
);

728 
	`DB_ASSERT
(
dbv
,

729 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

731 i(
is_dub
 || 
tx
 =
NULL
) {

732 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

733 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

734 *
lp
 = *
p
;

735 i(
p
 !
t_lp
)

736 *
t_lp
 = *
p
;

739 
t
 = 0;

740 #ifde
DIAGNOSTIC


745 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

746 
y
 |
DB_debug_FLAG
;

747 
	`memy
(
logc
.
da
, &
y
, (rectype));

749 i(!
	`IS_REP_CLIENT
(
dbv
))

750 
t
 = 
	`__log_put
(
dbv
,

751 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

753 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

754 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

755 
	`LSN_NOT_LOGGED
(*
t_lp
);

758 #ifde
LOG_DIAGNOSTIC


759 i(
t
 != 0)

760 ()
	`__db_ovf_t
(
dbv
,

761 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

764 #ifde
DIAGNOSTIC


765 
	`__os_
(
dbv
, 
logc
.
da
);

767 i(
is_dub
 || 
tx
 =
NULL
)

768 
	`__os_
(
dbv
, 
logc
.
da
);

770  (
t
);

771 
	}
}

777 
	$__db_ovf_ad
(
dbv
, 
cbuf
, 
g
)

778 
DB_ENV
 *
dbv
;

779 *
cbuf
;

780 
__db_ovf_gs
 **
g
;

782 
__db_ovf_gs
 *
gp
;

783 
u_t32_t
 
ump
;

784 
u_t8_t
 *
bp
;

785 
t
;

787 i((
t
 = 
	`__os_mloc
(
dbv
,

788 (
__db_ovf_gs
+ (
DB_TXN
), &
gp
)) != 0)

789  (
t
);

790 
bp
 = 
cbuf
;

791 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

792 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

794 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

795 
bp
 +(
gp
->
ty
);

797 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

798 
bp
 +(
gp
->
tx
->
txnid
);

800 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

801 
bp
 +(
DB_LSN
);

803 
	`memy
(&
ump
, 
bp
, (uinttmp));

804 
gp
->
feid
 = (
t32_t
)
ump
;

805 
bp
 +(
ump
);

807 
	`memy
(&
ump
, 
bp
, (uinttmp));

808 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

809 
bp
 +(
ump
);

811 
	`memy
(&
ump
, 
bp
, (uinttmp));

812 
gp
->
adju
 = (
t32_t
)
ump
;

813 
bp
 +(
ump
);

815 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

816 
bp
 +(
gp
->
l
);

818 *
g
 = 
gp
;

820 
	}
}

827 
	$__db_lk_42_ad
(
dbv
, 
cbuf
, 
g
)

828 
DB_ENV
 *
dbv
;

829 *
cbuf
;

830 
__db_lk_42_gs
 **
g
;

832 
__db_lk_42_gs
 *
gp
;

833 
u_t32_t
 
ump
;

834 
u_t8_t
 *
bp
;

835 
t
;

837 i((
t
 = 
	`__os_mloc
(
dbv
,

838 (
__db_lk_42_gs
+ (
DB_TXN
), &
gp
)) != 0)

839  (
t
);

840 
bp
 = 
cbuf
;

841 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

842 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

844 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

845 
bp
 +(
gp
->
ty
);

847 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

848 
bp
 +(
gp
->
tx
->
txnid
);

850 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

851 
bp
 +(
DB_LSN
);

853 
	`memy
(&
ump
, 
bp
, (uinttmp));

854 
gp
->
code
 = (
u_t32_t
)
ump
;

855 
bp
 +(
ump
);

857 
	`memy
(&
ump
, 
bp
, (uinttmp));

858 
gp
->
feid
 = (
t32_t
)
ump
;

859 
bp
 +(
ump
);

861 
	`memy
(&
ump
, 
bp
, (uinttmp));

862 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

863 
bp
 +(
ump
);

865 
	`memy
(&
gp
->
l
, 
bp
, (argp->lsn));

866 
bp
 +(
gp
->
l
);

868 
	`memy
(&
ump
, 
bp
, (uinttmp));

869 
gp
->
ev
 = (
db_pgno_t
)
ump
;

870 
bp
 +(
ump
);

872 
	`memy
(&
gp
->
l_ev
, 
bp
, (argp->lsn_prev));

873 
bp
 +(
gp
->
l_ev
);

875 
	`memy
(&
ump
, 
bp
, (uinttmp));

876 
gp
->
xt
 = (
db_pgno_t
)
ump
;

877 
bp
 +(
ump
);

879 
	`memy
(&
gp
->
l_xt
, 
bp
, (argp->lsn_next));

880 
bp
 +(
gp
->
l_xt
);

882 *
g
 = 
gp
;

884 
	}
}

892 
	$__db_debug_log
(
dbv
, 
tx
, 
t_lp
, 
ags
,

893 

, 
feid
, 
key
, 
da
, 
g_ags
)

894 
DB_ENV
 *
dbv
;

895 
DB_TXN
 *
tx
;

896 
DB_LSN
 *
t_lp
;

897 
u_t32_t
 
ags
;

898 cڡ 
DBT
 *

;

899 
t32_t
 
feid
;

900 cڡ 
DBT
 *
key
;

901 cڡ 
DBT
 *
da
;

902 
u_t32_t
 
g_ags
;

904 
DBT
 
logc
;

905 
DB_TXNLOGREC
 *

;

906 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

907 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

908 
u_t
 
ad
;

909 
u_t8_t
 *
bp
;

910 
is_dub
, 
t
;

912 
	`COMPQUIET
(

, 
NULL
);

914 
y
 = 
DB___db_debug
;

915 
ad
 = 0;

916 
p
 = 
t_lp
;

918 
t
 = 0;

920 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

921 i(
tx
 =
NULL
)

923 i(
tx
 =
NULL
)

925 
is_dub
 = 0;

927 
is_dub
 = 1;

929 i(
tx
 =
NULL
) {

930 
txn_num
 = 0;

931 
lp
 = &
nu_l
;

932 
nu_l
.
fe
 =u_l.
offt
 = 0;

940 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

941 
txn_num
 = 
tx
->
txnid
;

944 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

945 + (
u_t32_t
+ (

 =
NULL
 ? 0 : op->
size
)

946 + (
u_t32_t
)

947 + (
u_t32_t
+ (
key
 =
NULL
 ? 0 : key->
size
)

948 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
)

949 + (
u_t32_t
);

950 i(
	`CRYPTO_ON
(
dbv
)) {

951 
ad
 =

952 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

953 
logc
.
size
 +
ad
;

956 i(
is_dub
 || 
tx
 =
NULL
) {

957 i((
t
 =

958 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

959  (
t
);

961 i((
t
 = 
	`__os_mloc
(
dbv
,

962 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

963  (
t
);

964 #ifde
DIAGNOSTIC


965 i((
t
 =

966 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

967 
	`__os_
(
dbv
, 

);

968  (
t
);

971 
logc
.
da
 = 

->data;

974 i(
ad
 > 0)

975 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

977 
bp
 = 
logc
.
da
;

979 
	`memy
(
bp
, &
y
, (rectype));

980 
bp
 +(
y
);

982 
	`memy
(
bp
, &
txn_num
, (txn_num));

983 
bp
 +(
txn_num
);

985 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

986 
bp
 +(
DB_LSN
);

988 i(

 =
NULL
) {

989 
zo
 = 0;

990 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

991 
bp
 +(
u_t32_t
);

993 
	`memy
(
bp
, &

->
size
, (op->size));

994 
bp
 +(

->
size
);

995 
	`memy
(
bp
, 

->
da
, op->
size
);

996 
bp
 +

->
size
;

999 
ump
 = (
u_t32_t
)
feid
;

1000 
	`memy
(
bp
, &
ump
, (uinttmp));

1001 
bp
 +(
ump
);

1003 i(
key
 =
NULL
) {

1004 
zo
 = 0;

1005 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

1006 
bp
 +(
u_t32_t
);

1008 
	`memy
(
bp
, &
key
->
size
, (key->size));

1009 
bp
 +(
key
->
size
);

1010 
	`memy
(
bp
, 
key
->
da
, key->
size
);

1011 
bp
 +
key
->
size
;

1014 i(
da
 =
NULL
) {

1015 
zo
 = 0;

1016 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

1017 
bp
 +(
u_t32_t
);

1019 
	`memy
(
bp
, &
da
->
size
, (data->size));

1020 
bp
 +(
da
->
size
);

1021 
	`memy
(
bp
, 
da
->da, da->
size
);

1022 
bp
 +
da
->
size
;

1025 
ump
 = (
u_t32_t
)
g_ags
;

1026 
	`memy
(
bp
, &
ump
, (uinttmp));

1027 
bp
 +(
ump
);

1029 
	`DB_ASSERT
(
dbv
,

1030 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1032 i(
is_dub
 || 
tx
 =
NULL
) {

1033 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1034 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1035 *
lp
 = *
p
;

1036 i(
p
 !
t_lp
)

1037 *
t_lp
 = *
p
;

1040 
t
 = 0;

1041 #ifde
DIAGNOSTIC


1046 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1047 
y
 |
DB_debug_FLAG
;

1048 
	`memy
(
logc
.
da
, &
y
, (rectype));

1050 i(!
	`IS_REP_CLIENT
(
dbv
))

1051 
t
 = 
	`__log_put
(
dbv
,

1052 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1054 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1055 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1056 
	`LSN_NOT_LOGGED
(*
t_lp
);

1059 #ifde
LOG_DIAGNOSTIC


1060 i(
t
 != 0)

1061 ()
	`__db_debug_t
(
dbv
,

1062 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1065 #ifde
DIAGNOSTIC


1066 
	`__os_
(
dbv
, 
logc
.
da
);

1068 i(
is_dub
 || 
tx
 =
NULL
)

1069 
	`__os_
(
dbv
, 
logc
.
da
);

1071  (
t
);

1072 
	}
}

1078 
	$__db_debug_ad
(
dbv
, 
cbuf
, 
g
)

1079 
DB_ENV
 *
dbv
;

1080 *
cbuf
;

1081 
__db_debug_gs
 **
g
;

1083 
__db_debug_gs
 *
gp
;

1084 
u_t32_t
 
ump
;

1085 
u_t8_t
 *
bp
;

1086 
t
;

1088 i((
t
 = 
	`__os_mloc
(
dbv
,

1089 (
__db_debug_gs
+ (
DB_TXN
), &
gp
)) != 0)

1090  (
t
);

1091 
bp
 = 
cbuf
;

1092 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1093 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1095 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1096 
bp
 +(
gp
->
ty
);

1098 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1099 
bp
 +(
gp
->
tx
->
txnid
);

1101 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1102 
bp
 +(
DB_LSN
);

1104 
	`memt
(&
gp
->

, 0, (argp->op));

1105 
	`memy
(&
gp
->

.
size
, 
bp
, (
u_t32_t
));

1106 
bp
 +(
u_t32_t
);

1107 
gp
->

.
da
 = 
bp
;

1108 
bp
 +
gp
->

.
size
;

1110 
	`memy
(&
ump
, 
bp
, (uinttmp));

1111 
gp
->
feid
 = (
t32_t
)
ump
;

1112 
bp
 +(
ump
);

1114 
	`memt
(&
gp
->
key
, 0, (argp->key));

1115 
	`memy
(&
gp
->
key
.
size
, 
bp
, (
u_t32_t
));

1116 
bp
 +(
u_t32_t
);

1117 
gp
->
key
.
da
 = 
bp
;

1118 
bp
 +
gp
->
key
.
size
;

1120 
	`memt
(&
gp
->
da
, 0, (argp->data));

1121 
	`memy
(&
gp
->
da
.
size
, 
bp
, (
u_t32_t
));

1122 
bp
 +(
u_t32_t
);

1123 
gp
->
da
.d
bp
;

1124 
bp
 +
gp
->
da
.
size
;

1126 
	`memy
(&
ump
, 
bp
, (uinttmp));

1127 
gp
->
g_ags
 = (
u_t32_t
)
ump
;

1128 
bp
 +(
ump
);

1130 *
g
 = 
gp
;

1132 
	}
}

1139 
	$__db_no_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
evl
)

1140 
DB
 *
dbp
;

1141 
DB_TXN
 *
tx
;

1142 
DB_LSN
 *
t_lp
;

1143 
u_t32_t
 
ags
;

1144 
db_pgno_t
 
pgno
;

1145 
DB_LSN
 * 
evl
;

1147 
DBT
 
logc
;

1148 
DB_ENV
 *
dbv
;

1149 
DB_TXNLOGREC
 *

;

1150 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1151 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1152 
u_t
 
ad
;

1153 
u_t8_t
 *
bp
;

1154 
is_dub
, 
t
;

1156 
dbv
 = 
dbp
->dbenv;

1157 
	`COMPQUIET
(

, 
NULL
);

1159 
y
 = 
DB___db_no
;

1160 
ad
 = 0;

1161 
p
 = 
t_lp
;

1163 
t
 = 0;

1165 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1166 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1167 i(
tx
 =
NULL
)

1169 
is_dub
 = 0;

1171 
is_dub
 = 1;

1173 i(
tx
 =
NULL
) {

1174 
txn_num
 = 0;

1175 
lp
 = &
nu_l
;

1176 
nu_l
.
fe
 =u_l.
offt
 = 0;

1178 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1179 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1180  (
t
);

1187 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1188 
txn_num
 = 
tx
->
txnid
;

1191 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1192 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1193 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1194  (
t
);

1196 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1197 + (
u_t32_t
)

1198 + (
u_t32_t
)

1199 + (*
evl
);

1200 i(
	`CRYPTO_ON
(
dbv
)) {

1201 
ad
 =

1202 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1203 
logc
.
size
 +
ad
;

1206 i(
is_dub
 || 
tx
 =
NULL
) {

1207 i((
t
 =

1208 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1209  (
t
);

1211 i((
t
 = 
	`__os_mloc
(
dbv
,

1212 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1213  (
t
);

1214 #ifde
DIAGNOSTIC


1215 i((
t
 =

1216 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1217 
	`__os_
(
dbv
, 

);

1218  (
t
);

1221 
logc
.
da
 = 

->data;

1224 i(
ad
 > 0)

1225 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1227 
bp
 = 
logc
.
da
;

1229 
	`memy
(
bp
, &
y
, (rectype));

1230 
bp
 +(
y
);

1232 
	`memy
(
bp
, &
txn_num
, (txn_num));

1233 
bp
 +(
txn_num
);

1235 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1236 
bp
 +(
DB_LSN
);

1238 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1239 
	`memy
(
bp
, &
ump
, (uinttmp));

1240 
bp
 +(
ump
);

1242 
ump
 = (
u_t32_t
)
pgno
;

1243 
	`memy
(
bp
, &
ump
, (uinttmp));

1244 
bp
 +(
ump
);

1246 i(
evl
 !
NULL
) {

1247 i(
tx
 !
NULL
) {

1248 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1249 i(
	`LOG_COMPARE
(
evl
, &

->
l
>0 && (
t
 =

1250 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
evl
) != 0))

1251  (
t
);

1253 
	`memy
(
bp
, 
evl
, (*prevlsn));

1255 
	`memt
(
bp
, 0, (*
evl
));

1256 
bp
 +(*
evl
);

1258 
	`DB_ASSERT
(
dbv
,

1259 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1261 i(
is_dub
 || 
tx
 =
NULL
) {

1262 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1263 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1264 *
lp
 = *
p
;

1265 i(
p
 !
t_lp
)

1266 *
t_lp
 = *
p
;

1269 
t
 = 0;

1270 #ifde
DIAGNOSTIC


1275 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1276 
y
 |
DB_debug_FLAG
;

1277 
	`memy
(
logc
.
da
, &
y
, (rectype));

1279 i(!
	`IS_REP_CLIENT
(
dbv
))

1280 
t
 = 
	`__log_put
(
dbv
,

1281 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1283 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1284 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1285 
	`LSN_NOT_LOGGED
(*
t_lp
);

1288 #ifde
LOG_DIAGNOSTIC


1289 i(
t
 != 0)

1290 ()
	`__db_no_t
(
dbv
,

1291 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1294 #ifde
DIAGNOSTIC


1295 
	`__os_
(
dbv
, 
logc
.
da
);

1297 i(
is_dub
 || 
tx
 =
NULL
)

1298 
	`__os_
(
dbv
, 
logc
.
da
);

1300  (
t
);

1301 
	}
}

1307 
	$__db_no_ad
(
dbv
, 
cbuf
, 
g
)

1308 
DB_ENV
 *
dbv
;

1309 *
cbuf
;

1310 
__db_no_gs
 **
g
;

1312 
__db_no_gs
 *
gp
;

1313 
u_t32_t
 
ump
;

1314 
u_t8_t
 *
bp
;

1315 
t
;

1317 i((
t
 = 
	`__os_mloc
(
dbv
,

1318 (
__db_no_gs
+ (
DB_TXN
), &
gp
)) != 0)

1319  (
t
);

1320 
bp
 = 
cbuf
;

1321 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1322 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1324 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1325 
bp
 +(
gp
->
ty
);

1327 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1328 
bp
 +(
gp
->
tx
->
txnid
);

1330 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1331 
bp
 +(
DB_LSN
);

1333 
	`memy
(&
ump
, 
bp
, (uinttmp));

1334 
gp
->
feid
 = (
t32_t
)
ump
;

1335 
bp
 +(
ump
);

1337 
	`memy
(&
ump
, 
bp
, (uinttmp));

1338 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1339 
bp
 +(
ump
);

1341 
	`memy
(&
gp
->
evl
, 
bp
, (argp->prevlsn));

1342 
bp
 +(
gp
->
evl
);

1344 *
g
 = 
gp
;

1346 
	}
}

1353 
	$__db_pg_loc_42_ad
(
dbv
, 
cbuf
, 
g
)

1354 
DB_ENV
 *
dbv
;

1355 *
cbuf
;

1356 
__db_pg_loc_42_gs
 **
g
;

1358 
__db_pg_loc_42_gs
 *
gp
;

1359 
u_t32_t
 
ump
;

1360 
u_t8_t
 *
bp
;

1361 
t
;

1363 i((
t
 = 
	`__os_mloc
(
dbv
,

1364 (
__db_pg_loc_42_gs
+ (
DB_TXN
), &
gp
)) != 0)

1365  (
t
);

1366 
bp
 = 
cbuf
;

1367 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1368 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1370 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1371 
bp
 +(
gp
->
ty
);

1373 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1374 
bp
 +(
gp
->
tx
->
txnid
);

1376 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1377 
bp
 +(
DB_LSN
);

1379 
	`memy
(&
ump
, 
bp
, (uinttmp));

1380 
gp
->
feid
 = (
t32_t
)
ump
;

1381 
bp
 +(
ump
);

1383 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

1384 
bp
 +(
gp
->
ma_l
);

1386 
	`memy
(&
ump
, 
bp
, (uinttmp));

1387 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1388 
bp
 +(
ump
);

1390 
	`memy
(&
gp
->
ge_l
, 
bp
, (argp->page_lsn));

1391 
bp
 +(
gp
->
ge_l
);

1393 
	`memy
(&
ump
, 
bp
, (uinttmp));

1394 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1395 
bp
 +(
ump
);

1397 
	`memy
(&
ump
, 
bp
, (uinttmp));

1398 
gp
->
y
 = (
u_t32_t
)
ump
;

1399 
bp
 +(
ump
);

1401 
	`memy
(&
ump
, 
bp
, (uinttmp));

1402 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1403 
bp
 +(
ump
);

1405 *
g
 = 
gp
;

1407 
	}
}

1415 
	$__db_pg_loc_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
ma_l
, 
ma_pgno
, 
ge_l
, 
pgno
, 
y
,

1416 
xt
, 
ϡ_pgno
)

1417 
DB
 *
dbp
;

1418 
DB_TXN
 *
tx
;

1419 
DB_LSN
 *
t_lp
;

1420 
u_t32_t
 
ags
;

1421 
DB_LSN
 * 
ma_l
;

1422 
db_pgno_t
 
ma_pgno
;

1423 
DB_LSN
 * 
ge_l
;

1424 
db_pgno_t
 
pgno
;

1425 
u_t32_t
 
y
;

1426 
db_pgno_t
 
xt
;

1427 
db_pgno_t
 
ϡ_pgno
;

1429 
DBT
 
logc
;

1430 
DB_ENV
 *
dbv
;

1431 
DB_TXNLOGREC
 *

;

1432 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1433 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1434 
u_t
 
ad
;

1435 
u_t8_t
 *
bp
;

1436 
is_dub
, 
t
;

1438 
dbv
 = 
dbp
->dbenv;

1439 
	`COMPQUIET
(

, 
NULL
);

1441 
y
 = 
DB___db_pg_loc
;

1442 
ad
 = 0;

1443 
p
 = 
t_lp
;

1445 
t
 = 0;

1447 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1448 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1449 i(
tx
 =
NULL
)

1451 
is_dub
 = 0;

1453 
is_dub
 = 1;

1455 i(
tx
 =
NULL
) {

1456 
txn_num
 = 0;

1457 
lp
 = &
nu_l
;

1458 
nu_l
.
fe
 =u_l.
offt
 = 0;

1460 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1461 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1462  (
t
);

1469 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1470 
txn_num
 = 
tx
->
txnid
;

1473 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1474 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1475 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1476  (
t
);

1478 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1479 + (
u_t32_t
)

1480 + (*
ma_l
)

1481 + (
u_t32_t
)

1482 + (*
ge_l
)

1483 + (
u_t32_t
)

1484 + (
u_t32_t
)

1485 + (
u_t32_t
)

1486 + (
u_t32_t
);

1487 i(
	`CRYPTO_ON
(
dbv
)) {

1488 
ad
 =

1489 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1490 
logc
.
size
 +
ad
;

1493 i(
is_dub
 || 
tx
 =
NULL
) {

1494 i((
t
 =

1495 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1496  (
t
);

1498 i((
t
 = 
	`__os_mloc
(
dbv
,

1499 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1500  (
t
);

1501 #ifde
DIAGNOSTIC


1502 i((
t
 =

1503 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1504 
	`__os_
(
dbv
, 

);

1505  (
t
);

1508 
logc
.
da
 = 

->data;

1511 i(
ad
 > 0)

1512 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1514 
bp
 = 
logc
.
da
;

1516 
	`memy
(
bp
, &
y
, (rectype));

1517 
bp
 +(
y
);

1519 
	`memy
(
bp
, &
txn_num
, (txn_num));

1520 
bp
 +(
txn_num
);

1522 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1523 
bp
 +(
DB_LSN
);

1525 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1526 
	`memy
(
bp
, &
ump
, (uinttmp));

1527 
bp
 +(
ump
);

1529 i(
ma_l
 !
NULL
) {

1530 i(
tx
 !
NULL
) {

1531 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1532 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

1533 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ma_l
) != 0))

1534  (
t
);

1536 
	`memy
(
bp
, 
ma_l
, (*meta_lsn));

1538 
	`memt
(
bp
, 0, (*
ma_l
));

1539 
bp
 +(*
ma_l
);

1541 
ump
 = (
u_t32_t
)
ma_pgno
;

1542 
	`memy
(
bp
, &
ump
, (uinttmp));

1543 
bp
 +(
ump
);

1545 i(
ge_l
 !
NULL
) {

1546 i(
tx
 !
NULL
) {

1547 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1548 i(
	`LOG_COMPARE
(
ge_l
, &

->
l
>0 && (
t
 =

1549 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ge_l
) != 0))

1550  (
t
);

1552 
	`memy
(
bp
, 
ge_l
, (*page_lsn));

1554 
	`memt
(
bp
, 0, (*
ge_l
));

1555 
bp
 +(*
ge_l
);

1557 
ump
 = (
u_t32_t
)
pgno
;

1558 
	`memy
(
bp
, &
ump
, (uinttmp));

1559 
bp
 +(
ump
);

1561 
ump
 = (
u_t32_t
)
y
;

1562 
	`memy
(
bp
, &
ump
, (uinttmp));

1563 
bp
 +(
ump
);

1565 
ump
 = (
u_t32_t
)
xt
;

1566 
	`memy
(
bp
, &
ump
, (uinttmp));

1567 
bp
 +(
ump
);

1569 
ump
 = (
u_t32_t
)
ϡ_pgno
;

1570 
	`memy
(
bp
, &
ump
, (uinttmp));

1571 
bp
 +(
ump
);

1573 
	`DB_ASSERT
(
dbv
,

1574 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1576 i(
is_dub
 || 
tx
 =
NULL
) {

1577 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1578 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1579 *
lp
 = *
p
;

1580 i(
p
 !
t_lp
)

1581 *
t_lp
 = *
p
;

1584 
t
 = 0;

1585 #ifde
DIAGNOSTIC


1590 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1591 
y
 |
DB_debug_FLAG
;

1592 
	`memy
(
logc
.
da
, &
y
, (rectype));

1594 i(!
	`IS_REP_CLIENT
(
dbv
))

1595 
t
 = 
	`__log_put
(
dbv
,

1596 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1598 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1599 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1600 
	`LSN_NOT_LOGGED
(*
t_lp
);

1603 #ifde
LOG_DIAGNOSTIC


1604 i(
t
 != 0)

1605 ()
	`__db_pg_loc_t
(
dbv
,

1606 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1609 #ifde
DIAGNOSTIC


1610 
	`__os_
(
dbv
, 
logc
.
da
);

1612 i(
is_dub
 || 
tx
 =
NULL
)

1613 
	`__os_
(
dbv
, 
logc
.
da
);

1615  (
t
);

1616 
	}
}

1623 
	$__db_pg_loc_ad
(
dbv
, 
cbuf
, 
g
)

1624 
DB_ENV
 *
dbv
;

1625 *
cbuf
;

1626 
__db_pg_loc_gs
 **
g
;

1628 
__db_pg_loc_gs
 *
gp
;

1629 
u_t32_t
 
ump
;

1630 
u_t8_t
 *
bp
;

1631 
t
;

1633 i((
t
 = 
	`__os_mloc
(
dbv
,

1634 (
__db_pg_loc_gs
+ (
DB_TXN
), &
gp
)) != 0)

1635  (
t
);

1636 
bp
 = 
cbuf
;

1637 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1638 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1640 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1641 
bp
 +(
gp
->
ty
);

1643 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1644 
bp
 +(
gp
->
tx
->
txnid
);

1646 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1647 
bp
 +(
DB_LSN
);

1649 
	`memy
(&
ump
, 
bp
, (uinttmp));

1650 
gp
->
feid
 = (
t32_t
)
ump
;

1651 
bp
 +(
ump
);

1653 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

1654 
bp
 +(
gp
->
ma_l
);

1656 
	`memy
(&
ump
, 
bp
, (uinttmp));

1657 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1658 
bp
 +(
ump
);

1660 
	`memy
(&
gp
->
ge_l
, 
bp
, (argp->page_lsn));

1661 
bp
 +(
gp
->
ge_l
);

1663 
	`memy
(&
ump
, 
bp
, (uinttmp));

1664 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1665 
bp
 +(
ump
);

1667 
	`memy
(&
ump
, 
bp
, (uinttmp));

1668 
gp
->
y
 = (
u_t32_t
)
ump
;

1669 
bp
 +(
ump
);

1671 
	`memy
(&
ump
, 
bp
, (uinttmp));

1672 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1673 
bp
 +(
ump
);

1675 
	`memy
(&
ump
, 
bp
, (uinttmp));

1676 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

1677 
bp
 +(
ump
);

1679 *
g
 = 
gp
;

1681 
	}
}

1688 
	$__db_pg__42_ad
(
dbv
, 
cbuf
, 
g
)

1689 
DB_ENV
 *
dbv
;

1690 *
cbuf
;

1691 
__db_pg__42_gs
 **
g
;

1693 
__db_pg__42_gs
 *
gp
;

1694 
u_t32_t
 
ump
;

1695 
u_t8_t
 *
bp
;

1696 
t
;

1698 i((
t
 = 
	`__os_mloc
(
dbv
,

1699 (
__db_pg__42_gs
+ (
DB_TXN
), &
gp
)) != 0)

1700  (
t
);

1701 
bp
 = 
cbuf
;

1702 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1703 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1705 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1706 
bp
 +(
gp
->
ty
);

1708 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1709 
bp
 +(
gp
->
tx
->
txnid
);

1711 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1712 
bp
 +(
DB_LSN
);

1714 
	`memy
(&
ump
, 
bp
, (uinttmp));

1715 
gp
->
feid
 = (
t32_t
)
ump
;

1716 
bp
 +(
ump
);

1718 
	`memy
(&
ump
, 
bp
, (uinttmp));

1719 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1720 
bp
 +(
ump
);

1722 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

1723 
bp
 +(
gp
->
ma_l
);

1725 
	`memy
(&
ump
, 
bp
, (uinttmp));

1726 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1727 
bp
 +(
ump
);

1729 
	`memt
(&
gp
->
hd
, 0, (argp->header));

1730 
	`memy
(&
gp
->
hd
.
size
, 
bp
, (
u_t32_t
));

1731 
bp
 +(
u_t32_t
);

1732 
gp
->
hd
.
da
 = 
bp
;

1733 
bp
 +
gp
->
hd
.
size
;

1735 
	`memy
(&
ump
, 
bp
, (uinttmp));

1736 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1737 
bp
 +(
ump
);

1739 *
g
 = 
gp
;

1741 
	}
}

1749 
	$__db_pg__log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ma_l
, 
ma_pgno
, 
hd
, 
xt
,

1750 
ϡ_pgno
)

1751 
DB
 *
dbp
;

1752 
DB_TXN
 *
tx
;

1753 
DB_LSN
 *
t_lp
;

1754 
u_t32_t
 
ags
;

1755 
db_pgno_t
 
pgno
;

1756 
DB_LSN
 * 
ma_l
;

1757 
db_pgno_t
 
ma_pgno
;

1758 cڡ 
DBT
 *
hd
;

1759 
db_pgno_t
 
xt
;

1760 
db_pgno_t
 
ϡ_pgno
;

1762 
DBT
 
logc
;

1763 
DB_ENV
 *
dbv
;

1764 
DB_TXNLOGREC
 *

;

1765 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1766 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

1767 
u_t
 
ad
;

1768 
u_t8_t
 *
bp
;

1769 
is_dub
, 
t
;

1771 
dbv
 = 
dbp
->dbenv;

1772 
	`COMPQUIET
(

, 
NULL
);

1774 
y
 = 
DB___db_pg_
;

1775 
ad
 = 0;

1776 
p
 = 
t_lp
;

1778 
t
 = 0;

1780 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1781 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1782 i(
tx
 =
NULL
)

1784 
is_dub
 = 0;

1786 
is_dub
 = 1;

1788 i(
tx
 =
NULL
) {

1789 
txn_num
 = 0;

1790 
lp
 = &
nu_l
;

1791 
nu_l
.
fe
 =u_l.
offt
 = 0;

1793 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1794 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

1795  (
t
);

1802 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1803 
txn_num
 = 
tx
->
txnid
;

1806 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

1807 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1808 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1809  (
t
);

1811 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1812 + (
u_t32_t
)

1813 + (
u_t32_t
)

1814 + (*
ma_l
)

1815 + (
u_t32_t
)

1816 + (
u_t32_t
+ (
hd
 =
NULL
 ? 0 : hd->
size
)

1817 + (
u_t32_t
)

1818 + (
u_t32_t
);

1819 i(
	`CRYPTO_ON
(
dbv
)) {

1820 
ad
 =

1821 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

1822 
logc
.
size
 +
ad
;

1825 i(
is_dub
 || 
tx
 =
NULL
) {

1826 i((
t
 =

1827 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

1828  (
t
);

1830 i((
t
 = 
	`__os_mloc
(
dbv
,

1831 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1832  (
t
);

1833 #ifde
DIAGNOSTIC


1834 i((
t
 =

1835 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

1836 
	`__os_
(
dbv
, 

);

1837  (
t
);

1840 
logc
.
da
 = 

->data;

1843 i(
ad
 > 0)

1844 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1846 
bp
 = 
logc
.
da
;

1848 
	`memy
(
bp
, &
y
, (rectype));

1849 
bp
 +(
y
);

1851 
	`memy
(
bp
, &
txn_num
, (txn_num));

1852 
bp
 +(
txn_num
);

1854 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

1855 
bp
 +(
DB_LSN
);

1857 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1858 
	`memy
(
bp
, &
ump
, (uinttmp));

1859 
bp
 +(
ump
);

1861 
ump
 = (
u_t32_t
)
pgno
;

1862 
	`memy
(
bp
, &
ump
, (uinttmp));

1863 
bp
 +(
ump
);

1865 i(
ma_l
 !
NULL
) {

1866 i(
tx
 !
NULL
) {

1867 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

1868 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

1869 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ma_l
) != 0))

1870  (
t
);

1872 
	`memy
(
bp
, 
ma_l
, (*meta_lsn));

1874 
	`memt
(
bp
, 0, (*
ma_l
));

1875 
bp
 +(*
ma_l
);

1877 
ump
 = (
u_t32_t
)
ma_pgno
;

1878 
	`memy
(
bp
, &
ump
, (uinttmp));

1879 
bp
 +(
ump
);

1881 i(
hd
 =
NULL
) {

1882 
zo
 = 0;

1883 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

1884 
bp
 +(
u_t32_t
);

1886 
	`memy
(
bp
, &
hd
->
size
, (header->size));

1887 
bp
 +(
hd
->
size
);

1888 
	`memy
(
bp
, 
hd
->
da
, hd->
size
);

1889 
bp
 +
hd
->
size
;

1892 
ump
 = (
u_t32_t
)
xt
;

1893 
	`memy
(
bp
, &
ump
, (uinttmp));

1894 
bp
 +(
ump
);

1896 
ump
 = (
u_t32_t
)
ϡ_pgno
;

1897 
	`memy
(
bp
, &
ump
, (uinttmp));

1898 
bp
 +(
ump
);

1900 
	`DB_ASSERT
(
dbv
,

1901 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1903 i(
is_dub
 || 
tx
 =
NULL
) {

1904 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

1905 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1906 *
lp
 = *
p
;

1907 i(
p
 !
t_lp
)

1908 *
t_lp
 = *
p
;

1911 
t
 = 0;

1912 #ifde
DIAGNOSTIC


1917 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1918 
y
 |
DB_debug_FLAG
;

1919 
	`memy
(
logc
.
da
, &
y
, (rectype));

1921 i(!
	`IS_REP_CLIENT
(
dbv
))

1922 
t
 = 
	`__log_put
(
dbv
,

1923 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1925 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1926 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1927 
	`LSN_NOT_LOGGED
(*
t_lp
);

1930 #ifde
LOG_DIAGNOSTIC


1931 i(
t
 != 0)

1932 ()
	`__db_pg__t
(
dbv
,

1933 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1936 #ifde
DIAGNOSTIC


1937 
	`__os_
(
dbv
, 
logc
.
da
);

1939 i(
is_dub
 || 
tx
 =
NULL
)

1940 
	`__os_
(
dbv
, 
logc
.
da
);

1942  (
t
);

1943 
	}
}

1949 
	$__db_pg__ad
(
dbv
, 
cbuf
, 
g
)

1950 
DB_ENV
 *
dbv
;

1951 *
cbuf
;

1952 
__db_pg__gs
 **
g
;

1954 
__db_pg__gs
 *
gp
;

1955 
u_t32_t
 
ump
;

1956 
u_t8_t
 *
bp
;

1957 
t
;

1959 i((
t
 = 
	`__os_mloc
(
dbv
,

1960 (
__db_pg__gs
+ (
DB_TXN
), &
gp
)) != 0)

1961  (
t
);

1962 
bp
 = 
cbuf
;

1963 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1964 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1966 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

1967 
bp
 +(
gp
->
ty
);

1969 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

1970 
bp
 +(
gp
->
tx
->
txnid
);

1972 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

1973 
bp
 +(
DB_LSN
);

1975 
	`memy
(&
ump
, 
bp
, (uinttmp));

1976 
gp
->
feid
 = (
t32_t
)
ump
;

1977 
bp
 +(
ump
);

1979 
	`memy
(&
ump
, 
bp
, (uinttmp));

1980 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1981 
bp
 +(
ump
);

1983 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

1984 
bp
 +(
gp
->
ma_l
);

1986 
	`memy
(&
ump
, 
bp
, (uinttmp));

1987 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1988 
bp
 +(
ump
);

1990 
	`memt
(&
gp
->
hd
, 0, (argp->header));

1991 
	`memy
(&
gp
->
hd
.
size
, 
bp
, (
u_t32_t
));

1992 
bp
 +(
u_t32_t
);

1993 
gp
->
hd
.
da
 = 
bp
;

1994 
bp
 +
gp
->
hd
.
size
;

1996 
	`memy
(&
ump
, 
bp
, (uinttmp));

1997 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1998 
bp
 +(
ump
);

2000 
	`memy
(&
ump
, 
bp
, (uinttmp));

2001 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

2002 
bp
 +(
ump
);

2004 *
g
 = 
gp
;

2006 
	}
}

2012 
	$__db_cksum_log
(
dbv
, 
tx
, 
t_lp
, 
ags
)

2013 
DB_ENV
 *
dbv
;

2014 
DB_TXN
 *
tx
;

2015 
DB_LSN
 *
t_lp
;

2016 
u_t32_t
 
ags
;

2018 
DBT
 
logc
;

2019 
DB_TXNLOGREC
 *

;

2020 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2021 
u_t32_t
 
y
, 
txn_num
;

2022 
u_t
 
ad
;

2023 
u_t8_t
 *
bp
;

2024 
is_dub
, 
t
;

2026 
	`COMPQUIET
(

, 
NULL
);

2028 
y
 = 
DB___db_cksum
;

2029 
ad
 = 0;

2030 
p
 = 
t_lp
;

2032 
t
 = 0;

2034 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

2035 i(
tx
 =
NULL
)

2037 i(
tx
 =
NULL
)

2039 
is_dub
 = 0;

2041 
is_dub
 = 1;

2043 i(
tx
 =
NULL
) {

2044 
txn_num
 = 0;

2045 
lp
 = &
nu_l
;

2046 
nu_l
.
fe
 =u_l.
offt
 = 0;

2048 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2049 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2050  (
t
);

2057 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2058 
txn_num
 = 
tx
->
txnid
;

2061 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
);

2062 i(
	`CRYPTO_ON
(
dbv
)) {

2063 
ad
 =

2064 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2065 
logc
.
size
 +
ad
;

2068 i(
is_dub
 || 
tx
 =
NULL
) {

2069 i((
t
 =

2070 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2071  (
t
);

2073 i((
t
 = 
	`__os_mloc
(
dbv
,

2074 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2075  (
t
);

2076 #ifde
DIAGNOSTIC


2077 i((
t
 =

2078 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2079 
	`__os_
(
dbv
, 

);

2080  (
t
);

2083 
logc
.
da
 = 

->data;

2086 i(
ad
 > 0)

2087 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2089 
bp
 = 
logc
.
da
;

2091 
	`memy
(
bp
, &
y
, (rectype));

2092 
bp
 +(
y
);

2094 
	`memy
(
bp
, &
txn_num
, (txn_num));

2095 
bp
 +(
txn_num
);

2097 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2098 
bp
 +(
DB_LSN
);

2100 
	`DB_ASSERT
(
dbv
,

2101 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2103 i(
is_dub
 || 
tx
 =
NULL
) {

2104 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2105 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2106 *
lp
 = *
p
;

2107 i(
p
 !
t_lp
)

2108 *
t_lp
 = *
p
;

2111 
t
 = 0;

2112 #ifde
DIAGNOSTIC


2117 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2118 
y
 |
DB_debug_FLAG
;

2119 
	`memy
(
logc
.
da
, &
y
, (rectype));

2121 i(!
	`IS_REP_CLIENT
(
dbv
))

2122 
t
 = 
	`__log_put
(
dbv
,

2123 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2125 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2126 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2127 
	`LSN_NOT_LOGGED
(*
t_lp
);

2130 #ifde
LOG_DIAGNOSTIC


2131 i(
t
 != 0)

2132 ()
	`__db_cksum_t
(
dbv
,

2133 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2136 #ifde
DIAGNOSTIC


2137 
	`__os_
(
dbv
, 
logc
.
da
);

2139 i(
is_dub
 || 
tx
 =
NULL
)

2140 
	`__os_
(
dbv
, 
logc
.
da
);

2142  (
t
);

2143 
	}
}

2149 
	$__db_cksum_ad
(
dbv
, 
cbuf
, 
g
)

2150 
DB_ENV
 *
dbv
;

2151 *
cbuf
;

2152 
__db_cksum_gs
 **
g
;

2154 
__db_cksum_gs
 *
gp
;

2155 
u_t8_t
 *
bp
;

2156 
t
;

2158 i((
t
 = 
	`__os_mloc
(
dbv
,

2159 (
__db_cksum_gs
+ (
DB_TXN
), &
gp
)) != 0)

2160  (
t
);

2161 
bp
 = 
cbuf
;

2162 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2163 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2165 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2166 
bp
 +(
gp
->
ty
);

2168 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2169 
bp
 +(
gp
->
tx
->
txnid
);

2171 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2172 
bp
 +(
DB_LSN
);

2174 *
g
 = 
gp
;

2176 
	}
}

2183 
	$__db_pg_da_42_ad
(
dbv
, 
cbuf
, 
g
)

2184 
DB_ENV
 *
dbv
;

2185 *
cbuf
;

2186 
__db_pg_da_42_gs
 **
g
;

2188 
__db_pg_da_42_gs
 *
gp
;

2189 
u_t32_t
 
ump
;

2190 
u_t8_t
 *
bp
;

2191 
t
;

2193 i((
t
 = 
	`__os_mloc
(
dbv
,

2194 (
__db_pg_da_42_gs
+ (
DB_TXN
), &
gp
)) != 0)

2195  (
t
);

2196 
bp
 = 
cbuf
;

2197 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2198 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2200 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2201 
bp
 +(
gp
->
ty
);

2203 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2204 
bp
 +(
gp
->
tx
->
txnid
);

2206 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2207 
bp
 +(
DB_LSN
);

2209 
	`memy
(&
ump
, 
bp
, (uinttmp));

2210 
gp
->
feid
 = (
t32_t
)
ump
;

2211 
bp
 +(
ump
);

2213 
	`memy
(&
ump
, 
bp
, (uinttmp));

2214 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2215 
bp
 +(
ump
);

2217 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

2218 
bp
 +(
gp
->
ma_l
);

2220 
	`memy
(&
ump
, 
bp
, (uinttmp));

2221 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

2222 
bp
 +(
ump
);

2224 
	`memt
(&
gp
->
hd
, 0, (argp->header));

2225 
	`memy
(&
gp
->
hd
.
size
, 
bp
, (
u_t32_t
));

2226 
bp
 +(
u_t32_t
);

2227 
gp
->
hd
.
da
 = 
bp
;

2228 
bp
 +
gp
->
hd
.
size
;

2230 
	`memy
(&
ump
, 
bp
, (uinttmp));

2231 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2232 
bp
 +(
ump
);

2234 
	`memt
(&
gp
->
da
, 0, (argp->data));

2235 
	`memy
(&
gp
->
da
.
size
, 
bp
, (
u_t32_t
));

2236 
bp
 +(
u_t32_t
);

2237 
gp
->
da
.d
bp
;

2238 
bp
 +
gp
->
da
.
size
;

2240 *
g
 = 
gp
;

2242 
	}
}

2250 
	$__db_pg_da_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ma_l
, 
ma_pgno
, 
hd
, 
xt
,

2251 
ϡ_pgno
, 
da
)

2252 
DB
 *
dbp
;

2253 
DB_TXN
 *
tx
;

2254 
DB_LSN
 *
t_lp
;

2255 
u_t32_t
 
ags
;

2256 
db_pgno_t
 
pgno
;

2257 
DB_LSN
 * 
ma_l
;

2258 
db_pgno_t
 
ma_pgno
;

2259 cڡ 
DBT
 *
hd
;

2260 
db_pgno_t
 
xt
;

2261 
db_pgno_t
 
ϡ_pgno
;

2262 cڡ 
DBT
 *
da
;

2264 
DBT
 
logc
;

2265 
DB_ENV
 *
dbv
;

2266 
DB_TXNLOGREC
 *

;

2267 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2268 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

2269 
u_t
 
ad
;

2270 
u_t8_t
 *
bp
;

2271 
is_dub
, 
t
;

2273 
dbv
 = 
dbp
->dbenv;

2274 
	`COMPQUIET
(

, 
NULL
);

2276 
y
 = 
DB___db_pg_da
;

2277 
ad
 = 0;

2278 
p
 = 
t_lp
;

2280 
t
 = 0;

2282 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2283 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2284 i(
tx
 =
NULL
)

2286 
is_dub
 = 0;

2288 
is_dub
 = 1;

2290 i(
tx
 =
NULL
) {

2291 
txn_num
 = 0;

2292 
lp
 = &
nu_l
;

2293 
nu_l
.
fe
 =u_l.
offt
 = 0;

2295 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2296 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2297  (
t
);

2304 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2305 
txn_num
 = 
tx
->
txnid
;

2308 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

2309 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2310 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2311  (
t
);

2313 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2314 + (
u_t32_t
)

2315 + (
u_t32_t
)

2316 + (*
ma_l
)

2317 + (
u_t32_t
)

2318 + (
u_t32_t
+ (
hd
 =
NULL
 ? 0 : hd->
size
)

2319 + (
u_t32_t
)

2320 + (
u_t32_t
)

2321 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
);

2322 i(
	`CRYPTO_ON
(
dbv
)) {

2323 
ad
 =

2324 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2325 
logc
.
size
 +
ad
;

2328 i(
is_dub
 || 
tx
 =
NULL
) {

2329 i((
t
 =

2330 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2331  (
t
);

2333 i((
t
 = 
	`__os_mloc
(
dbv
,

2334 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2335  (
t
);

2336 #ifde
DIAGNOSTIC


2337 i((
t
 =

2338 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2339 
	`__os_
(
dbv
, 

);

2340  (
t
);

2343 
logc
.
da
 = 

->data;

2346 i(
ad
 > 0)

2347 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2349 
bp
 = 
logc
.
da
;

2351 
	`memy
(
bp
, &
y
, (rectype));

2352 
bp
 +(
y
);

2354 
	`memy
(
bp
, &
txn_num
, (txn_num));

2355 
bp
 +(
txn_num
);

2357 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2358 
bp
 +(
DB_LSN
);

2360 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2361 
	`memy
(
bp
, &
ump
, (uinttmp));

2362 
bp
 +(
ump
);

2364 
ump
 = (
u_t32_t
)
pgno
;

2365 
	`memy
(
bp
, &
ump
, (uinttmp));

2366 
bp
 +(
ump
);

2368 i(
ma_l
 !
NULL
) {

2369 i(
tx
 !
NULL
) {

2370 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

2371 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

2372 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ma_l
) != 0))

2373  (
t
);

2375 
	`memy
(
bp
, 
ma_l
, (*meta_lsn));

2377 
	`memt
(
bp
, 0, (*
ma_l
));

2378 
bp
 +(*
ma_l
);

2380 
ump
 = (
u_t32_t
)
ma_pgno
;

2381 
	`memy
(
bp
, &
ump
, (uinttmp));

2382 
bp
 +(
ump
);

2384 i(
hd
 =
NULL
) {

2385 
zo
 = 0;

2386 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

2387 
bp
 +(
u_t32_t
);

2389 
	`memy
(
bp
, &
hd
->
size
, (header->size));

2390 
bp
 +(
hd
->
size
);

2391 
	`memy
(
bp
, 
hd
->
da
, hd->
size
);

2392 
bp
 +
hd
->
size
;

2395 
ump
 = (
u_t32_t
)
xt
;

2396 
	`memy
(
bp
, &
ump
, (uinttmp));

2397 
bp
 +(
ump
);

2399 
ump
 = (
u_t32_t
)
ϡ_pgno
;

2400 
	`memy
(
bp
, &
ump
, (uinttmp));

2401 
bp
 +(
ump
);

2403 i(
da
 =
NULL
) {

2404 
zo
 = 0;

2405 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

2406 
bp
 +(
u_t32_t
);

2408 
	`memy
(
bp
, &
da
->
size
, (data->size));

2409 
bp
 +(
da
->
size
);

2410 
	`memy
(
bp
, 
da
->da, da->
size
);

2411 
bp
 +
da
->
size
;

2414 
	`DB_ASSERT
(
dbv
,

2415 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2417 i(
is_dub
 || 
tx
 =
NULL
) {

2418 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2419 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2420 *
lp
 = *
p
;

2421 i(
p
 !
t_lp
)

2422 *
t_lp
 = *
p
;

2425 
t
 = 0;

2426 #ifde
DIAGNOSTIC


2431 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2432 
y
 |
DB_debug_FLAG
;

2433 
	`memy
(
logc
.
da
, &
y
, (rectype));

2435 i(!
	`IS_REP_CLIENT
(
dbv
))

2436 
t
 = 
	`__log_put
(
dbv
,

2437 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2439 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2440 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2441 
	`LSN_NOT_LOGGED
(*
t_lp
);

2444 #ifde
LOG_DIAGNOSTIC


2445 i(
t
 != 0)

2446 ()
	`__db_pg_da_t
(
dbv
,

2447 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2450 #ifde
DIAGNOSTIC


2451 
	`__os_
(
dbv
, 
logc
.
da
);

2453 i(
is_dub
 || 
tx
 =
NULL
)

2454 
	`__os_
(
dbv
, 
logc
.
da
);

2456  (
t
);

2457 
	}
}

2464 
	$__db_pg_da_ad
(
dbv
, 
cbuf
, 
g
)

2465 
DB_ENV
 *
dbv
;

2466 *
cbuf
;

2467 
__db_pg_da_gs
 **
g
;

2469 
__db_pg_da_gs
 *
gp
;

2470 
u_t32_t
 
ump
;

2471 
u_t8_t
 *
bp
;

2472 
t
;

2474 i((
t
 = 
	`__os_mloc
(
dbv
,

2475 (
__db_pg_da_gs
+ (
DB_TXN
), &
gp
)) != 0)

2476  (
t
);

2477 
bp
 = 
cbuf
;

2478 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2479 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2481 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2482 
bp
 +(
gp
->
ty
);

2484 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2485 
bp
 +(
gp
->
tx
->
txnid
);

2487 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2488 
bp
 +(
DB_LSN
);

2490 
	`memy
(&
ump
, 
bp
, (uinttmp));

2491 
gp
->
feid
 = (
t32_t
)
ump
;

2492 
bp
 +(
ump
);

2494 
	`memy
(&
ump
, 
bp
, (uinttmp));

2495 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2496 
bp
 +(
ump
);

2498 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

2499 
bp
 +(
gp
->
ma_l
);

2501 
	`memy
(&
ump
, 
bp
, (uinttmp));

2502 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

2503 
bp
 +(
ump
);

2505 
	`memt
(&
gp
->
hd
, 0, (argp->header));

2506 
	`memy
(&
gp
->
hd
.
size
, 
bp
, (
u_t32_t
));

2507 
bp
 +(
u_t32_t
);

2508 
gp
->
hd
.
da
 = 
bp
;

2509 
bp
 +
gp
->
hd
.
size
;

2511 
	`memy
(&
ump
, 
bp
, (uinttmp));

2512 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2513 
bp
 +(
ump
);

2515 
	`memy
(&
ump
, 
bp
, (uinttmp));

2516 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

2517 
bp
 +(
ump
);

2519 
	`memt
(&
gp
->
da
, 0, (argp->data));

2520 
	`memy
(&
gp
->
da
.
size
, 
bp
, (
u_t32_t
));

2521 
bp
 +(
u_t32_t
);

2522 
gp
->
da
.d
bp
;

2523 
bp
 +
gp
->
da
.
size
;

2525 *
g
 = 
gp
;

2527 
	}
}

2534 
	$__db_pg_e_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
)

2535 
DB
 *
dbp
;

2536 
DB_TXN
 *
tx
;

2537 
DB_LSN
 *
t_lp
;

2538 
u_t32_t
 
ags
;

2539 
db_pgno_t
 
pgno
;

2541 
DBT
 
logc
;

2542 
DB_ENV
 *
dbv
;

2543 
DB_TXNLOGREC
 *

;

2544 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2545 
u_t32_t
 
ump
, 
y
, 
txn_num
;

2546 
u_t
 
ad
;

2547 
u_t8_t
 *
bp
;

2548 
is_dub
, 
t
;

2550 
dbv
 = 
dbp
->dbenv;

2551 
	`COMPQUIET
(

, 
NULL
);

2553 
y
 = 
DB___db_pg_e
;

2554 
ad
 = 0;

2555 
p
 = 
t_lp
;

2557 
t
 = 0;

2559 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2560 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2561 i(
tx
 =
NULL
)

2563 
is_dub
 = 0;

2565 
is_dub
 = 1;

2567 i(
tx
 =
NULL
) {

2568 
txn_num
 = 0;

2569 
lp
 = &
nu_l
;

2570 
nu_l
.
fe
 =u_l.
offt
 = 0;

2572 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2573 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2574  (
t
);

2581 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2582 
txn_num
 = 
tx
->
txnid
;

2585 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

2586 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2587 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2588  (
t
);

2590 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2591 + (
u_t32_t
)

2592 + (
u_t32_t
);

2593 i(
	`CRYPTO_ON
(
dbv
)) {

2594 
ad
 =

2595 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2596 
logc
.
size
 +
ad
;

2599 i(
is_dub
 || 
tx
 =
NULL
) {

2600 i((
t
 =

2601 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2602  (
t
);

2604 i((
t
 = 
	`__os_mloc
(
dbv
,

2605 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2606  (
t
);

2607 #ifde
DIAGNOSTIC


2608 i((
t
 =

2609 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2610 
	`__os_
(
dbv
, 

);

2611  (
t
);

2614 
logc
.
da
 = 

->data;

2617 i(
ad
 > 0)

2618 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2620 
bp
 = 
logc
.
da
;

2622 
	`memy
(
bp
, &
y
, (rectype));

2623 
bp
 +(
y
);

2625 
	`memy
(
bp
, &
txn_num
, (txn_num));

2626 
bp
 +(
txn_num
);

2628 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2629 
bp
 +(
DB_LSN
);

2631 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2632 
	`memy
(
bp
, &
ump
, (uinttmp));

2633 
bp
 +(
ump
);

2635 
ump
 = (
u_t32_t
)
pgno
;

2636 
	`memy
(
bp
, &
ump
, (uinttmp));

2637 
bp
 +(
ump
);

2639 
	`DB_ASSERT
(
dbv
,

2640 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2642 i(
is_dub
 || 
tx
 =
NULL
) {

2643 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2644 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2645 *
lp
 = *
p
;

2646 i(
p
 !
t_lp
)

2647 *
t_lp
 = *
p
;

2650 
t
 = 0;

2651 #ifde
DIAGNOSTIC


2656 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2657 
y
 |
DB_debug_FLAG
;

2658 
	`memy
(
logc
.
da
, &
y
, (rectype));

2660 i(!
	`IS_REP_CLIENT
(
dbv
))

2661 
t
 = 
	`__log_put
(
dbv
,

2662 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2664 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2665 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2666 
	`LSN_NOT_LOGGED
(*
t_lp
);

2669 #ifde
LOG_DIAGNOSTIC


2670 i(
t
 != 0)

2671 ()
	`__db_pg_e_t
(
dbv
,

2672 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2675 #ifde
DIAGNOSTIC


2676 
	`__os_
(
dbv
, 
logc
.
da
);

2678 i(
is_dub
 || 
tx
 =
NULL
)

2679 
	`__os_
(
dbv
, 
logc
.
da
);

2681  (
t
);

2682 
	}
}

2689 
	$__db_pg_e_ad
(
dbv
, 
cbuf
, 
g
)

2690 
DB_ENV
 *
dbv
;

2691 *
cbuf
;

2692 
__db_pg_e_gs
 **
g
;

2694 
__db_pg_e_gs
 *
gp
;

2695 
u_t32_t
 
ump
;

2696 
u_t8_t
 *
bp
;

2697 
t
;

2699 i((
t
 = 
	`__os_mloc
(
dbv
,

2700 (
__db_pg_e_gs
+ (
DB_TXN
), &
gp
)) != 0)

2701  (
t
);

2702 
bp
 = 
cbuf
;

2703 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2704 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2706 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2707 
bp
 +(
gp
->
ty
);

2709 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2710 
bp
 +(
gp
->
tx
->
txnid
);

2712 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2713 
bp
 +(
DB_LSN
);

2715 
	`memy
(&
ump
, 
bp
, (uinttmp));

2716 
gp
->
feid
 = (
t32_t
)
ump
;

2717 
bp
 +(
ump
);

2719 
	`memy
(&
ump
, 
bp
, (uinttmp));

2720 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2721 
bp
 +(
ump
);

2723 *
g
 = 
gp
;

2725 
	}
}

2733 
	$__db_pg_w_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ma_l
, 
ma_pgno
, 
hd
, 
xt
)

2734 
DB
 *
dbp
;

2735 
DB_TXN
 *
tx
;

2736 
DB_LSN
 *
t_lp
;

2737 
u_t32_t
 
ags
;

2738 
db_pgno_t
 
pgno
;

2739 
DB_LSN
 * 
ma_l
;

2740 
db_pgno_t
 
ma_pgno
;

2741 cڡ 
DBT
 *
hd
;

2742 
db_pgno_t
 
xt
;

2744 
DBT
 
logc
;

2745 
DB_ENV
 *
dbv
;

2746 
DB_TXNLOGREC
 *

;

2747 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2748 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

2749 
u_t
 
ad
;

2750 
u_t8_t
 *
bp
;

2751 
is_dub
, 
t
;

2753 
dbv
 = 
dbp
->dbenv;

2754 
	`COMPQUIET
(

, 
NULL
);

2756 
y
 = 
DB___db_pg_w
;

2757 
ad
 = 0;

2758 
p
 = 
t_lp
;

2760 
t
 = 0;

2762 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2763 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2764 i(
tx
 =
NULL
)

2766 
is_dub
 = 0;

2768 
is_dub
 = 1;

2770 i(
tx
 =
NULL
) {

2771 
txn_num
 = 0;

2772 
lp
 = &
nu_l
;

2773 
nu_l
.
fe
 =u_l.
offt
 = 0;

2775 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2776 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

2777  (
t
);

2784 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2785 
txn_num
 = 
tx
->
txnid
;

2788 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

2789 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2790 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2791  (
t
);

2793 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2794 + (
u_t32_t
)

2795 + (
u_t32_t
)

2796 + (*
ma_l
)

2797 + (
u_t32_t
)

2798 + (
u_t32_t
+ (
hd
 =
NULL
 ? 0 : hd->
size
)

2799 + (
u_t32_t
);

2800 i(
	`CRYPTO_ON
(
dbv
)) {

2801 
ad
 =

2802 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

2803 
logc
.
size
 +
ad
;

2806 i(
is_dub
 || 
tx
 =
NULL
) {

2807 i((
t
 =

2808 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

2809  (
t
);

2811 i((
t
 = 
	`__os_mloc
(
dbv
,

2812 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2813  (
t
);

2814 #ifde
DIAGNOSTIC


2815 i((
t
 =

2816 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

2817 
	`__os_
(
dbv
, 

);

2818  (
t
);

2821 
logc
.
da
 = 

->data;

2824 i(
ad
 > 0)

2825 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2827 
bp
 = 
logc
.
da
;

2829 
	`memy
(
bp
, &
y
, (rectype));

2830 
bp
 +(
y
);

2832 
	`memy
(
bp
, &
txn_num
, (txn_num));

2833 
bp
 +(
txn_num
);

2835 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

2836 
bp
 +(
DB_LSN
);

2838 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2839 
	`memy
(
bp
, &
ump
, (uinttmp));

2840 
bp
 +(
ump
);

2842 
ump
 = (
u_t32_t
)
pgno
;

2843 
	`memy
(
bp
, &
ump
, (uinttmp));

2844 
bp
 +(
ump
);

2846 i(
ma_l
 !
NULL
) {

2847 i(
tx
 !
NULL
) {

2848 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

2849 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

2850 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ma_l
) != 0))

2851  (
t
);

2853 
	`memy
(
bp
, 
ma_l
, (*meta_lsn));

2855 
	`memt
(
bp
, 0, (*
ma_l
));

2856 
bp
 +(*
ma_l
);

2858 
ump
 = (
u_t32_t
)
ma_pgno
;

2859 
	`memy
(
bp
, &
ump
, (uinttmp));

2860 
bp
 +(
ump
);

2862 i(
hd
 =
NULL
) {

2863 
zo
 = 0;

2864 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

2865 
bp
 +(
u_t32_t
);

2867 
	`memy
(
bp
, &
hd
->
size
, (header->size));

2868 
bp
 +(
hd
->
size
);

2869 
	`memy
(
bp
, 
hd
->
da
, hd->
size
);

2870 
bp
 +
hd
->
size
;

2873 
ump
 = (
u_t32_t
)
xt
;

2874 
	`memy
(
bp
, &
ump
, (uinttmp));

2875 
bp
 +(
ump
);

2877 
	`DB_ASSERT
(
dbv
,

2878 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2880 i(
is_dub
 || 
tx
 =
NULL
) {

2881 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

2882 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2883 *
lp
 = *
p
;

2884 i(
p
 !
t_lp
)

2885 *
t_lp
 = *
p
;

2888 
t
 = 0;

2889 #ifde
DIAGNOSTIC


2894 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2895 
y
 |
DB_debug_FLAG
;

2896 
	`memy
(
logc
.
da
, &
y
, (rectype));

2898 i(!
	`IS_REP_CLIENT
(
dbv
))

2899 
t
 = 
	`__log_put
(
dbv
,

2900 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2902 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2903 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2904 
	`LSN_NOT_LOGGED
(*
t_lp
);

2907 #ifde
LOG_DIAGNOSTIC


2908 i(
t
 != 0)

2909 ()
	`__db_pg_w_t
(
dbv
,

2910 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2913 #ifde
DIAGNOSTIC


2914 
	`__os_
(
dbv
, 
logc
.
da
);

2916 i(
is_dub
 || 
tx
 =
NULL
)

2917 
	`__os_
(
dbv
, 
logc
.
da
);

2919  (
t
);

2920 
	}
}

2926 
	$__db_pg_w_ad
(
dbv
, 
cbuf
, 
g
)

2927 
DB_ENV
 *
dbv
;

2928 *
cbuf
;

2929 
__db_pg_w_gs
 **
g
;

2931 
__db_pg_w_gs
 *
gp
;

2932 
u_t32_t
 
ump
;

2933 
u_t8_t
 *
bp
;

2934 
t
;

2936 i((
t
 = 
	`__os_mloc
(
dbv
,

2937 (
__db_pg_w_gs
+ (
DB_TXN
), &
gp
)) != 0)

2938  (
t
);

2939 
bp
 = 
cbuf
;

2940 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2941 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2943 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

2944 
bp
 +(
gp
->
ty
);

2946 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

2947 
bp
 +(
gp
->
tx
->
txnid
);

2949 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

2950 
bp
 +(
DB_LSN
);

2952 
	`memy
(&
ump
, 
bp
, (uinttmp));

2953 
gp
->
feid
 = (
t32_t
)
ump
;

2954 
bp
 +(
ump
);

2956 
	`memy
(&
ump
, 
bp
, (uinttmp));

2957 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2958 
bp
 +(
ump
);

2960 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

2961 
bp
 +(
gp
->
ma_l
);

2963 
	`memy
(&
ump
, 
bp
, (uinttmp));

2964 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

2965 
bp
 +(
ump
);

2967 
	`memt
(&
gp
->
hd
, 0, (argp->header));

2968 
	`memy
(&
gp
->
hd
.
size
, 
bp
, (
u_t32_t
));

2969 
bp
 +(
u_t32_t
);

2970 
gp
->
hd
.
da
 = 
bp
;

2971 
bp
 +
gp
->
hd
.
size
;

2973 
	`memy
(&
ump
, 
bp
, (uinttmp));

2974 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2975 
bp
 +(
ump
);

2977 *
g
 = 
gp
;

2979 
	}
}

2986 
	$__db_pg__log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
hd
, 
da
)

2987 
DB
 *
dbp
;

2988 
DB_TXN
 *
tx
;

2989 
DB_LSN
 *
t_lp
;

2990 
u_t32_t
 
ags
;

2991 
db_pgno_t
 
pgno
;

2992 cڡ 
DBT
 *
hd
;

2993 cڡ 
DBT
 *
da
;

2995 
DBT
 
logc
;

2996 
DB_ENV
 *
dbv
;

2997 
DB_TXNLOGREC
 *

;

2998 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2999 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

3000 
u_t
 
ad
;

3001 
u_t8_t
 *
bp
;

3002 
is_dub
, 
t
;

3004 
dbv
 = 
dbp
->dbenv;

3005 
	`COMPQUIET
(

, 
NULL
);

3007 
y
 = 
DB___db_pg_
;

3008 
ad
 = 0;

3009 
p
 = 
t_lp
;

3011 
t
 = 0;

3013 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

3014 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

3015 i(
tx
 =
NULL
)

3017 
is_dub
 = 0;

3019 
is_dub
 = 1;

3021 i(
tx
 =
NULL
) {

3022 
txn_num
 = 0;

3023 
lp
 = &
nu_l
;

3024 
nu_l
.
fe
 =u_l.
offt
 = 0;

3026 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

3027 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

3028  (
t
);

3035 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

3036 
txn_num
 = 
tx
->
txnid
;

3039 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

3040 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

3041 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

3042  (
t
);

3044 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

3045 + (
u_t32_t
)

3046 + (
u_t32_t
)

3047 + (
u_t32_t
+ (
hd
 =
NULL
 ? 0 : hd->
size
)

3048 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
);

3049 i(
	`CRYPTO_ON
(
dbv
)) {

3050 
ad
 =

3051 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

3052 
logc
.
size
 +
ad
;

3055 i(
is_dub
 || 
tx
 =
NULL
) {

3056 i((
t
 =

3057 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

3058  (
t
);

3060 i((
t
 = 
	`__os_mloc
(
dbv
,

3061 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

3062  (
t
);

3063 #ifde
DIAGNOSTIC


3064 i((
t
 =

3065 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

3066 
	`__os_
(
dbv
, 

);

3067  (
t
);

3070 
logc
.
da
 = 

->data;

3073 i(
ad
 > 0)

3074 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

3076 
bp
 = 
logc
.
da
;

3078 
	`memy
(
bp
, &
y
, (rectype));

3079 
bp
 +(
y
);

3081 
	`memy
(
bp
, &
txn_num
, (txn_num));

3082 
bp
 +(
txn_num
);

3084 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

3085 
bp
 +(
DB_LSN
);

3087 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

3088 
	`memy
(
bp
, &
ump
, (uinttmp));

3089 
bp
 +(
ump
);

3091 
ump
 = (
u_t32_t
)
pgno
;

3092 
	`memy
(
bp
, &
ump
, (uinttmp));

3093 
bp
 +(
ump
);

3095 i(
hd
 =
NULL
) {

3096 
zo
 = 0;

3097 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

3098 
bp
 +(
u_t32_t
);

3100 
	`memy
(
bp
, &
hd
->
size
, (header->size));

3101 
bp
 +(
hd
->
size
);

3102 
	`memy
(
bp
, 
hd
->
da
, hd->
size
);

3103 
bp
 +
hd
->
size
;

3106 i(
da
 =
NULL
) {

3107 
zo
 = 0;

3108 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

3109 
bp
 +(
u_t32_t
);

3111 
	`memy
(
bp
, &
da
->
size
, (data->size));

3112 
bp
 +(
da
->
size
);

3113 
	`memy
(
bp
, 
da
->da, da->
size
);

3114 
bp
 +
da
->
size
;

3117 
	`DB_ASSERT
(
dbv
,

3118 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

3120 i(
is_dub
 || 
tx
 =
NULL
) {

3121 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

3122 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

3123 *
lp
 = *
p
;

3124 i(
p
 !
t_lp
)

3125 *
t_lp
 = *
p
;

3128 
t
 = 0;

3129 #ifde
DIAGNOSTIC


3134 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

3135 
y
 |
DB_debug_FLAG
;

3136 
	`memy
(
logc
.
da
, &
y
, (rectype));

3138 i(!
	`IS_REP_CLIENT
(
dbv
))

3139 
t
 = 
	`__log_put
(
dbv
,

3140 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

3142 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

3143 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

3144 
	`LSN_NOT_LOGGED
(*
t_lp
);

3147 #ifde
LOG_DIAGNOSTIC


3148 i(
t
 != 0)

3149 ()
	`__db_pg__t
(
dbv
,

3150 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

3153 #ifde
DIAGNOSTIC


3154 
	`__os_
(
dbv
, 
logc
.
da
);

3156 i(
is_dub
 || 
tx
 =
NULL
)

3157 
	`__os_
(
dbv
, 
logc
.
da
);

3159  (
t
);

3160 
	}
}

3166 
	$__db_pg__ad
(
dbv
, 
cbuf
, 
g
)

3167 
DB_ENV
 *
dbv
;

3168 *
cbuf
;

3169 
__db_pg__gs
 **
g
;

3171 
__db_pg__gs
 *
gp
;

3172 
u_t32_t
 
ump
;

3173 
u_t8_t
 *
bp
;

3174 
t
;

3176 i((
t
 = 
	`__os_mloc
(
dbv
,

3177 (
__db_pg__gs
+ (
DB_TXN
), &
gp
)) != 0)

3178  (
t
);

3179 
bp
 = 
cbuf
;

3180 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

3181 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

3183 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

3184 
bp
 +(
gp
->
ty
);

3186 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

3187 
bp
 +(
gp
->
tx
->
txnid
);

3189 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

3190 
bp
 +(
DB_LSN
);

3192 
	`memy
(&
ump
, 
bp
, (uinttmp));

3193 
gp
->
feid
 = (
t32_t
)
ump
;

3194 
bp
 +(
ump
);

3196 
	`memy
(&
ump
, 
bp
, (uinttmp));

3197 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

3198 
bp
 +(
ump
);

3200 
	`memt
(&
gp
->
hd
, 0, (argp->header));

3201 
	`memy
(&
gp
->
hd
.
size
, 
bp
, (
u_t32_t
));

3202 
bp
 +(
u_t32_t
);

3203 
gp
->
hd
.
da
 = 
bp
;

3204 
bp
 +
gp
->
hd
.
size
;

3206 
	`memt
(&
gp
->
da
, 0, (argp->data));

3207 
	`memy
(&
gp
->
da
.
size
, 
bp
, (
u_t32_t
));

3208 
bp
 +(
u_t32_t
);

3209 
gp
->
da
.d
bp
;

3210 
bp
 +
gp
->
da
.
size
;

3212 *
g
 = 
gp
;

3214 
	}
}

3222 
	$__db_pg_st_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
ma
, 
ma_l
, 
ϡ_
, 
ϡ_l
, 
ϡ_pgno
,

3223 
li
)

3224 
DB
 *
dbp
;

3225 
DB_TXN
 *
tx
;

3226 
DB_LSN
 *
t_lp
;

3227 
u_t32_t
 
ags
;

3228 
db_pgno_t
 
ma
;

3229 
DB_LSN
 * 
ma_l
;

3230 
db_pgno_t
 
ϡ_
;

3231 
DB_LSN
 * 
ϡ_l
;

3232 
db_pgno_t
 
ϡ_pgno
;

3233 cڡ 
DBT
 *
li
;

3235 
DBT
 
logc
;

3236 
DB_ENV
 *
dbv
;

3237 
DB_TXNLOGREC
 *

;

3238 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

3239 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

3240 
u_t
 
ad
;

3241 
u_t8_t
 *
bp
;

3242 
is_dub
, 
t
;

3244 
dbv
 = 
dbp
->dbenv;

3245 
	`COMPQUIET
(

, 
NULL
);

3247 
y
 = 
DB___db_pg_st
;

3248 
ad
 = 0;

3249 
p
 = 
t_lp
;

3251 
t
 = 0;

3253 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

3254 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

3255 i(
tx
 =
NULL
)

3257 
is_dub
 = 0;

3259 
is_dub
 = 1;

3261 i(
tx
 =
NULL
) {

3262 
txn_num
 = 0;

3263 
lp
 = &
nu_l
;

3264 
nu_l
.
fe
 =u_l.
offt
 = 0;

3266 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

3267 (
t
 = 
	`__txn_aivekids
(
dbv
, 
y
, 
tx
)) != 0)

3268  (
t
);

3275 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

3276 
txn_num
 = 
tx
->
txnid
;

3279 
	`DB_ASSERT
(
dbv
, 
dbp
->
log_fame
 !
NULL
);

3280 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

3281 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

3282  (
t
);

3284 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

3285 + (
u_t32_t
)

3286 + (
u_t32_t
)

3287 + (*
ma_l
)

3288 + (
u_t32_t
)

3289 + (*
ϡ_l
)

3290 + (
u_t32_t
)

3291 + (
u_t32_t
+ (
li
 =
NULL
 ? 0 :i->
size
);

3292 i(
	`CRYPTO_ON
(
dbv
)) {

3293 
ad
 =

3294 ((
DB_CIPHER
 *)
dbv
->
yo_hd
)->
	`adj_size
(
logc
.
size
);

3295 
logc
.
size
 +
ad
;

3298 i(
is_dub
 || 
tx
 =
NULL
) {

3299 i((
t
 =

3300 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0)

3301  (
t
);

3303 i((
t
 = 
	`__os_mloc
(
dbv
,

3304 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

3305  (
t
);

3306 #ifde
DIAGNOSTIC


3307 i((
t
 =

3308 
	`__os_mloc
(
dbv
, 
logc
.
size
, &logc.
da
)) != 0) {

3309 
	`__os_
(
dbv
, 

);

3310  (
t
);

3313 
logc
.
da
 = 

->data;

3316 i(
ad
 > 0)

3317 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

3319 
bp
 = 
logc
.
da
;

3321 
	`memy
(
bp
, &
y
, (rectype));

3322 
bp
 +(
y
);

3324 
	`memy
(
bp
, &
txn_num
, (txn_num));

3325 
bp
 +(
txn_num
);

3327 
	`memy
(
bp
, 
lp
, (
DB_LSN
));

3328 
bp
 +(
DB_LSN
);

3330 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

3331 
	`memy
(
bp
, &
ump
, (uinttmp));

3332 
bp
 +(
ump
);

3334 
ump
 = (
u_t32_t
)
ma
;

3335 
	`memy
(
bp
, &
ump
, (uinttmp));

3336 
bp
 +(
ump
);

3338 i(
ma_l
 !
NULL
) {

3339 i(
tx
 !
NULL
) {

3340 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

3341 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

3342 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ma_l
) != 0))

3343  (
t
);

3345 
	`memy
(
bp
, 
ma_l
, (*meta_lsn));

3347 
	`memt
(
bp
, 0, (*
ma_l
));

3348 
bp
 +(*
ma_l
);

3350 
ump
 = (
u_t32_t
)
ϡ_
;

3351 
	`memy
(
bp
, &
ump
, (uinttmp));

3352 
bp
 +(
ump
);

3354 i(
ϡ_l
 !
NULL
) {

3355 i(
tx
 !
NULL
) {

3356 
LOG
 *

 = 
dbv
->
lg_hd
->
gfo
.
imy
;

3357 i(
	`LOG_COMPARE
(
ϡ_l
, &

->
l
>0 && (
t
 =

3358 
	`__log_check_ge_l
(
dbv
, 
dbp
, 
ϡ_l
) != 0))

3359  (
t
);

3361 
	`memy
(
bp
, 
ϡ_l
, (*last_lsn));

3363 
	`memt
(
bp
, 0, (*
ϡ_l
));

3364 
bp
 +(*
ϡ_l
);

3366 
ump
 = (
u_t32_t
)
ϡ_pgno
;

3367 
	`memy
(
bp
, &
ump
, (uinttmp));

3368 
bp
 +(
ump
);

3370 i(
li
 =
NULL
) {

3371 
zo
 = 0;

3372 
	`memy
(
bp
, &
zo
, (
u_t32_t
));

3373 
bp
 +(
u_t32_t
);

3375 
	`memy
(
bp
, &
li
->
size
, (list->size));

3376 
bp
 +(
li
->
size
);

3377 
	`memy
(
bp
, 
li
->
da
,i->
size
);

3378 
bp
 +
li
->
size
;

3381 
	`DB_ASSERT
(
dbv
,

3382 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

3384 i(
is_dub
 || 
tx
 =
NULL
) {

3385 i((
t
 = 
	`__log_put
(
dbv
, 
p
,(
DBT
 *)&
logc
,

3386 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

3387 *
lp
 = *
p
;

3388 i(
p
 !
t_lp
)

3389 *
t_lp
 = *
p
;

3392 
t
 = 0;

3393 #ifde
DIAGNOSTIC


3398 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

3399 
y
 |
DB_debug_FLAG
;

3400 
	`memy
(
logc
.
da
, &
y
, (rectype));

3402 i(!
	`IS_REP_CLIENT
(
dbv
))

3403 
t
 = 
	`__log_put
(
dbv
,

3404 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

3406 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

3407 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

3408 
	`LSN_NOT_LOGGED
(*
t_lp
);

3411 #ifde
LOG_DIAGNOSTIC


3412 i(
t
 != 0)

3413 ()
	`__db_pg_st_t
(
dbv
,

3414 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

3417 #ifde
DIAGNOSTIC


3418 
	`__os_
(
dbv
, 
logc
.
da
);

3420 i(
is_dub
 || 
tx
 =
NULL
)

3421 
	`__os_
(
dbv
, 
logc
.
da
);

3423  (
t
);

3424 
	}
}

3430 
	$__db_pg_st_ad
(
dbv
, 
cbuf
, 
g
)

3431 
DB_ENV
 *
dbv
;

3432 *
cbuf
;

3433 
__db_pg_st_gs
 **
g
;

3435 
__db_pg_st_gs
 *
gp
;

3436 
u_t32_t
 
ump
;

3437 
u_t8_t
 *
bp
;

3438 
t
;

3440 i((
t
 = 
	`__os_mloc
(
dbv
,

3441 (
__db_pg_st_gs
+ (
DB_TXN
), &
gp
)) != 0)

3442  (
t
);

3443 
bp
 = 
cbuf
;

3444 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

3445 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

3447 
	`memy
(&
gp
->
ty
, 
bp
, (argp->type));

3448 
bp
 +(
gp
->
ty
);

3450 
	`memy
(&
gp
->
tx
->
txnid
, 
bp
, (argp->txnp->txnid));

3451 
bp
 +(
gp
->
tx
->
txnid
);

3453 
	`memy
(&
gp
->
ev_l
, 
bp
, (
DB_LSN
));

3454 
bp
 +(
DB_LSN
);

3456 
	`memy
(&
ump
, 
bp
, (uinttmp));

3457 
gp
->
feid
 = (
t32_t
)
ump
;

3458 
bp
 +(
ump
);

3460 
	`memy
(&
ump
, 
bp
, (uinttmp));

3461 
gp
->
ma
 = (
db_pgno_t
)
ump
;

3462 
bp
 +(
ump
);

3464 
	`memy
(&
gp
->
ma_l
, 
bp
, (argp->meta_lsn));

3465 
bp
 +(
gp
->
ma_l
);

3467 
	`memy
(&
ump
, 
bp
, (uinttmp));

3468 
gp
->
ϡ_
 = (
db_pgno_t
)
ump
;

3469 
bp
 +(
ump
);

3471 
	`memy
(&
gp
->
ϡ_l
, 
bp
, (argp->last_lsn));

3472 
bp
 +(
gp
->
ϡ_l
);

3474 
	`memy
(&
ump
, 
bp
, (uinttmp));

3475 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

3476 
bp
 +(
ump
);

3478 
	`memt
(&
gp
->
li
, 0, (argp->list));

3479 
	`memy
(&
gp
->
li
.
size
, 
bp
, (
u_t32_t
));

3480 
bp
 +(
u_t32_t
);

3481 
gp
->
li
.
da
 = 
bp
;

3482 
bp
 +
gp
->
li
.
size
;

3484 *
g
 = 
gp
;

3486 
	}
}

3493 
	$__db__cov
(
dbv
, 
dbp
, 
dbsiz
)

3494 
DB_ENV
 *
dbv
;

3495 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

3496 
size_t
 *
dbsiz
;

3498 
t
;

3500 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3501 
__db_addm_cov
, 
DB___db_addm
)) != 0)

3502  (
t
);

3503 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3504 
__db_big_cov
, 
DB___db_big
)) != 0)

3505  (
t
);

3506 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3507 
__db_ovf_cov
, 
DB___db_ovf
)) != 0)

3508  (
t
);

3509 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3510 
__db_debug_cov
, 
DB___db_debug
)) != 0)

3511  (
t
);

3512 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3513 
__db_no_cov
, 
DB___db_no
)) != 0)

3514  (
t
);

3515 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3516 
__db_pg_loc_cov
, 
DB___db_pg_loc
)) != 0)

3517  (
t
);

3518 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3519 
__db_pg__cov
, 
DB___db_pg_
)) != 0)

3520  (
t
);

3521 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3522 
__db_cksum_cov
, 
DB___db_cksum
)) != 0)

3523  (
t
);

3524 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3525 
__db_pg_da_cov
, 
DB___db_pg_da
)) != 0)

3526  (
t
);

3527 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3528 
__db_pg_e_cov
, 
DB___db_pg_e
)) != 0)

3529  (
t
);

3530 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3531 
__db_pg_w_cov
, 
DB___db_pg_w
)) != 0)

3532  (
t
);

3533 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3534 
__db_pg__cov
, 
DB___db_pg_
)) != 0)

3535  (
t
);

3536 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

3537 
__db_pg_st_cov
, 
DB___db_pg_st
)) != 0)

3538  (
t
);

3540 
	}
}

	@../db/db_autop.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_dich.h
"

9 
	~"dbc/db_am.h
"

10 
	~"dbc/log.h
"

11 
	~"dbc/txn.h
"

18 
	$__db_addm_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

19 
DB_ENV
 *
dbv
;

20 
DBT
 *
db
;

21 
DB_LSN
 *
lp
;

22 
db_cs
 
nud2
;

23 *
nud3
;

25 
__db_addm_gs
 *
gp
;

26 
u_t32_t
 
i
;

27 
ch
;

28 
t
;

30 
nud2
 = 
DB_TXN_PRINT
;

31 
nud3
 = 
NULL
;

33 i((
t
 = 
	`__db_addm_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

34  (
t
);

35 ()
	`tf
(

37 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

38 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

39 (
u_lg
)
gp
->
ty
,

40 (
u_lg
)
gp
->
tx
->
txnid
,

41 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

42 ()
	`tf
("\tcode: %lu\n", (
u_lg
)
gp
->
code
);

43 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

44 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

45 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

46 ()
	`tf
("\bys: %lu\n", (
u_lg
)
gp
->
nbys
);

47 ()
	`tf
("\thdr: ");

48 
i
 = 0; i < 
gp
->
hdr
.
size
; i++) {

49 
ch
 = ((
u_t8_t
 *)
gp
->
hdr
.
da
)[
i
];

50 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

52 ()
	`tf
("\n");

53 ()
	`tf
("\tdbt: ");

54 
i
 = 0; i < 
gp
->
dbt
.
size
; i++) {

55 
ch
 = ((
u_t8_t
 *)
gp
->
dbt
.
da
)[
i
];

56 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

58 ()
	`tf
("\n");

59 ()
	`tf
("\tpagelsn: [%lu][%lu]\n",

60 (
u_lg
)
gp
->
g
.
fe
, (u_lgrgp->g.
offt
);

61 ()
	`tf
("\n");

62 
	`__os_
(
dbv
, 
gp
);

64 
	}
}

71 
	$__db_big_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

72 
DB_ENV
 *
dbv
;

73 
DBT
 *
db
;

74 
DB_LSN
 *
lp
;

75 
db_cs
 
nud2
;

76 *
nud3
;

78 
__db_big_gs
 *
gp
;

79 
u_t32_t
 
i
;

80 
ch
;

81 
t
;

83 
nud2
 = 
DB_TXN_PRINT
;

84 
nud3
 = 
NULL
;

86 i((
t
 = 
	`__db_big_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

87  (
t
);

88 ()
	`tf
(

90 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

91 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

92 (
u_lg
)
gp
->
ty
,

93 (
u_lg
)
gp
->
tx
->
txnid
,

94 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

95 ()
	`tf
("\tcode: %lu\n", (
u_lg
)
gp
->
code
);

96 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

97 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

98 ()
	`tf
("\v_pgno: %lu\n", (
u_lg
)
gp
->
ev_pgno
);

99 ()
	`tf
("\ext_pgno: %lu\n", (
u_lg
)
gp
->
xt_pgno
);

100 ()
	`tf
("\tdbt: ");

101 
i
 = 0; i < 
gp
->
dbt
.
size
; i++) {

102 
ch
 = ((
u_t8_t
 *)
gp
->
dbt
.
da
)[
i
];

103 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

105 ()
	`tf
("\n");

106 ()
	`tf
("\tpagelsn: [%lu][%lu]\n",

107 (
u_lg
)
gp
->
g
.
fe
, (u_lgrgp->g.
offt
);

108 ()
	`tf
("\tprevlsn: [%lu][%lu]\n",

109 (
u_lg
)
gp
->
evl
.
fe
, (u_lgrgp->evl.
offt
);

110 ()
	`tf
("\tnextlsn: [%lu][%lu]\n",

111 (
u_lg
)
gp
->
x
.
fe
, (u_lgrgp->x.
offt
);

112 ()
	`tf
("\n");

113 
	`__os_
(
dbv
, 
gp
);

115 
	}
}

122 
	$__db_ovf_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

123 
DB_ENV
 *
dbv
;

124 
DBT
 *
db
;

125 
DB_LSN
 *
lp
;

126 
db_cs
 
nud2
;

127 *
nud3
;

129 
__db_ovf_gs
 *
gp
;

130 
t
;

132 
nud2
 = 
DB_TXN_PRINT
;

133 
nud3
 = 
NULL
;

135 i((
t
 = 
	`__db_ovf_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

136  (
t
);

137 ()
	`tf
(

139 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

140 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

141 (
u_lg
)
gp
->
ty
,

142 (
u_lg
)
gp
->
tx
->
txnid
,

143 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

144 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

145 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

146 ()
	`tf
("\dju: %ld\n", ()
gp
->
adju
);

147 ()
	`tf
("\tlsn: [%lu][%lu]\n",

148 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

149 ()
	`tf
("\n");

150 
	`__os_
(
dbv
, 
gp
);

152 
	}
}

159 
	$__db_lk_42_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

160 
DB_ENV
 *
dbv
;

161 
DBT
 *
db
;

162 
DB_LSN
 *
lp
;

163 
db_cs
 
nud2
;

164 *
nud3
;

166 
__db_lk_42_gs
 *
gp
;

167 
t
;

169 
nud2
 = 
DB_TXN_PRINT
;

170 
nud3
 = 
NULL
;

172 i((
t
 = 
	`__db_lk_42_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

173  (
t
);

174 ()
	`tf
(

176 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

177 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

178 (
u_lg
)
gp
->
ty
,

179 (
u_lg
)
gp
->
tx
->
txnid
,

180 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

181 ()
	`tf
("\tcode: %lu\n", (
u_lg
)
gp
->
code
);

182 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

183 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

184 ()
	`tf
("\tlsn: [%lu][%lu]\n",

185 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

186 ()
	`tf
("\v: %lu\n", (
u_lg
)
gp
->
ev
);

187 ()
	`tf
("\tlsn_prev: [%lu][%lu]\n",

188 (
u_lg
)
gp
->
l_ev
.
fe
, (u_lgrgp->l_ev.
offt
);

189 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

190 ()
	`tf
("\tlsn_next: [%lu][%lu]\n",

191 (
u_lg
)
gp
->
l_xt
.
fe
, (u_lgrgp->l_xt.
offt
);

192 ()
	`tf
("\n");

193 
	`__os_
(
dbv
, 
gp
);

195 
	}
}

202 
	$__db_debug_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

203 
DB_ENV
 *
dbv
;

204 
DBT
 *
db
;

205 
DB_LSN
 *
lp
;

206 
db_cs
 
nud2
;

207 *
nud3
;

209 
__db_debug_gs
 *
gp
;

210 
u_t32_t
 
i
;

211 
ch
;

212 
t
;

214 
nud2
 = 
DB_TXN_PRINT
;

215 
nud3
 = 
NULL
;

217 i((
t
 = 
	`__db_debug_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

218  (
t
);

219 ()
	`tf
(

221 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

222 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

223 (
u_lg
)
gp
->
ty
,

224 (
u_lg
)
gp
->
tx
->
txnid
,

225 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

226 ()
	`tf
("\top: ");

227 
i
 = 0; i < 
gp
->

.
size
; i++) {

228 
ch
 = ((
u_t8_t
 *)
gp
->

.
da
)[
i
];

229 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

231 ()
	`tf
("\n");

232 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

233 ()
	`tf
("\tkey: ");

234 
i
 = 0; i < 
gp
->
key
.
size
; i++) {

235 
ch
 = ((
u_t8_t
 *)
gp
->
key
.
da
)[
i
];

236 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

238 ()
	`tf
("\n");

239 ()
	`tf
("\tdata: ");

240 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

241 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

242 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

244 ()
	`tf
("\n");

245 ()
	`tf
("\rg_ags: %lu\n", (
u_lg
)
gp
->
g_ags
);

246 ()
	`tf
("\n");

247 
	`__os_
(
dbv
, 
gp
);

249 
	}
}

256 
	$__db_no_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

257 
DB_ENV
 *
dbv
;

258 
DBT
 *
db
;

259 
DB_LSN
 *
lp
;

260 
db_cs
 
nud2
;

261 *
nud3
;

263 
__db_no_gs
 *
gp
;

264 
t
;

266 
nud2
 = 
DB_TXN_PRINT
;

267 
nud3
 = 
NULL
;

269 i((
t
 = 
	`__db_no_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

270  (
t
);

271 ()
	`tf
(

273 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

274 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

275 (
u_lg
)
gp
->
ty
,

276 (
u_lg
)
gp
->
tx
->
txnid
,

277 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

278 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

279 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

280 ()
	`tf
("\tprevlsn: [%lu][%lu]\n",

281 (
u_lg
)
gp
->
evl
.
fe
, (u_lgrgp->evl.
offt
);

282 ()
	`tf
("\n");

283 
	`__os_
(
dbv
, 
gp
);

285 
	}
}

292 
	$__db_pg_loc_42_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

293 
DB_ENV
 *
dbv
;

294 
DBT
 *
db
;

295 
DB_LSN
 *
lp
;

296 
db_cs
 
nud2
;

297 *
nud3
;

299 
__db_pg_loc_42_gs
 *
gp
;

300 
t
;

302 
nud2
 = 
DB_TXN_PRINT
;

303 
nud3
 = 
NULL
;

305 i((
t
 = 
	`__db_pg_loc_42_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

306  (
t
);

307 ()
	`tf
(

309 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

310 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

311 (
u_lg
)
gp
->
ty
,

312 (
u_lg
)
gp
->
tx
->
txnid
,

313 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

314 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

315 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

316 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

317 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

318 ()
	`tf
("\tpage_lsn: [%lu][%lu]\n",

319 (
u_lg
)
gp
->
ge_l
.
fe
, (u_lgrgp->ge_l.
offt
);

320 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

321 ()
	`tf
("\ty: %lu\n", (
u_lg
)
gp
->
y
);

322 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

323 ()
	`tf
("\n");

324 
	`__os_
(
dbv
, 
gp
);

326 
	}
}

333 
	$__db_pg_loc_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

334 
DB_ENV
 *
dbv
;

335 
DBT
 *
db
;

336 
DB_LSN
 *
lp
;

337 
db_cs
 
nud2
;

338 *
nud3
;

340 
__db_pg_loc_gs
 *
gp
;

341 
t
;

343 
nud2
 = 
DB_TXN_PRINT
;

344 
nud3
 = 
NULL
;

346 i((
t
 = 
	`__db_pg_loc_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

347  (
t
);

348 ()
	`tf
(

350 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

351 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

352 (
u_lg
)
gp
->
ty
,

353 (
u_lg
)
gp
->
tx
->
txnid
,

354 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

355 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

356 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

357 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

358 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

359 ()
	`tf
("\tpage_lsn: [%lu][%lu]\n",

360 (
u_lg
)
gp
->
ge_l
.
fe
, (u_lgrgp->ge_l.
offt
);

361 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

362 ()
	`tf
("\ty: %lu\n", (
u_lg
)
gp
->
y
);

363 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

364 ()
	`tf
("\a_pgno: %lu\n", (
u_lg
)
gp
->
ϡ_pgno
);

365 ()
	`tf
("\n");

366 
	`__os_
(
dbv
, 
gp
);

368 
	}
}

375 
	$__db_pg__42_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

376 
DB_ENV
 *
dbv
;

377 
DBT
 *
db
;

378 
DB_LSN
 *
lp
;

379 
db_cs
 
nud2
;

380 *
nud3
;

382 
__db_pg__42_gs
 *
gp
;

383 
u_t32_t
 
i
;

384 
ch
;

385 
t
;

387 
nud2
 = 
DB_TXN_PRINT
;

388 
nud3
 = 
NULL
;

390 i((
t
 = 
	`__db_pg__42_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

391  (
t
);

392 ()
	`tf
(

394 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

395 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

396 (
u_lg
)
gp
->
ty
,

397 (
u_lg
)
gp
->
tx
->
txnid
,

398 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

399 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

400 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

401 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

402 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

403 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

404 ()
	`tf
("\theader: ");

405 
i
 = 0; i < 
gp
->
hd
.
size
; i++) {

406 
ch
 = ((
u_t8_t
 *)
gp
->
hd
.
da
)[
i
];

407 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

409 ()
	`tf
("\n");

410 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

411 ()
	`tf
("\n");

412 
	`__os_
(
dbv
, 
gp
);

414 
	}
}

421 
	$__db_pg__t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

422 
DB_ENV
 *
dbv
;

423 
DBT
 *
db
;

424 
DB_LSN
 *
lp
;

425 
db_cs
 
nud2
;

426 *
nud3
;

428 
__db_pg__gs
 *
gp
;

429 
u_t32_t
 
i
;

430 
ch
;

431 
t
;

433 
nud2
 = 
DB_TXN_PRINT
;

434 
nud3
 = 
NULL
;

436 i((
t
 = 
	`__db_pg__ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

437  (
t
);

438 ()
	`tf
(

440 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

441 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

442 (
u_lg
)
gp
->
ty
,

443 (
u_lg
)
gp
->
tx
->
txnid
,

444 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

445 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

446 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

447 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

448 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

449 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

450 ()
	`tf
("\theader: ");

451 
i
 = 0; i < 
gp
->
hd
.
size
; i++) {

452 
ch
 = ((
u_t8_t
 *)
gp
->
hd
.
da
)[
i
];

453 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

455 ()
	`tf
("\n");

456 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

457 ()
	`tf
("\a_pgno: %lu\n", (
u_lg
)
gp
->
ϡ_pgno
);

458 ()
	`tf
("\n");

459 
	`__os_
(
dbv
, 
gp
);

461 
	}
}

468 
	$__db_cksum_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

469 
DB_ENV
 *
dbv
;

470 
DBT
 *
db
;

471 
DB_LSN
 *
lp
;

472 
db_cs
 
nud2
;

473 *
nud3
;

475 
__db_cksum_gs
 *
gp
;

476 
t
;

478 
nud2
 = 
DB_TXN_PRINT
;

479 
nud3
 = 
NULL
;

481 i((
t
 = 
	`__db_cksum_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

482  (
t
);

483 ()
	`tf
(

485 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

486 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

487 (
u_lg
)
gp
->
ty
,

488 (
u_lg
)
gp
->
tx
->
txnid
,

489 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

490 ()
	`tf
("\n");

491 
	`__os_
(
dbv
, 
gp
);

493 
	}
}

500 
	$__db_pg_da_42_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

501 
DB_ENV
 *
dbv
;

502 
DBT
 *
db
;

503 
DB_LSN
 *
lp
;

504 
db_cs
 
nud2
;

505 *
nud3
;

507 
__db_pg_da_42_gs
 *
gp
;

508 
u_t32_t
 
i
;

509 
ch
;

510 
t
;

512 
nud2
 = 
DB_TXN_PRINT
;

513 
nud3
 = 
NULL
;

515 i((
t
 = 
	`__db_pg_da_42_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

516  (
t
);

517 ()
	`tf
(

519 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

520 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

521 (
u_lg
)
gp
->
ty
,

522 (
u_lg
)
gp
->
tx
->
txnid
,

523 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

524 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

525 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

526 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

527 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

528 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

529 ()
	`tf
("\theader: ");

530 
i
 = 0; i < 
gp
->
hd
.
size
; i++) {

531 
ch
 = ((
u_t8_t
 *)
gp
->
hd
.
da
)[
i
];

532 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

534 ()
	`tf
("\n");

535 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

536 ()
	`tf
("\tdata: ");

537 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

538 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

539 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

541 ()
	`tf
("\n");

542 ()
	`tf
("\n");

543 
	`__os_
(
dbv
, 
gp
);

545 
	}
}

552 
	$__db_pg_da_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

553 
DB_ENV
 *
dbv
;

554 
DBT
 *
db
;

555 
DB_LSN
 *
lp
;

556 
db_cs
 
nud2
;

557 *
nud3
;

559 
__db_pg_da_gs
 *
gp
;

560 
u_t32_t
 
i
;

561 
ch
;

562 
t
;

564 
nud2
 = 
DB_TXN_PRINT
;

565 
nud3
 = 
NULL
;

567 i((
t
 = 
	`__db_pg_da_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

568  (
t
);

569 ()
	`tf
(

571 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

572 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

573 (
u_lg
)
gp
->
ty
,

574 (
u_lg
)
gp
->
tx
->
txnid
,

575 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

576 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

577 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

578 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

579 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

580 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

581 ()
	`tf
("\theader: ");

582 
i
 = 0; i < 
gp
->
hd
.
size
; i++) {

583 
ch
 = ((
u_t8_t
 *)
gp
->
hd
.
da
)[
i
];

584 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

586 ()
	`tf
("\n");

587 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

588 ()
	`tf
("\a_pgno: %lu\n", (
u_lg
)
gp
->
ϡ_pgno
);

589 ()
	`tf
("\tdata: ");

590 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

591 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

592 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

594 ()
	`tf
("\n");

595 ()
	`tf
("\n");

596 
	`__os_
(
dbv
, 
gp
);

598 
	}
}

605 
	$__db_pg_e_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

606 
DB_ENV
 *
dbv
;

607 
DBT
 *
db
;

608 
DB_LSN
 *
lp
;

609 
db_cs
 
nud2
;

610 *
nud3
;

612 
__db_pg_e_gs
 *
gp
;

613 
t
;

615 
nud2
 = 
DB_TXN_PRINT
;

616 
nud3
 = 
NULL
;

618 i((
t
 = 
	`__db_pg_e_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

619  (
t
);

620 ()
	`tf
(

622 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

623 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

624 (
u_lg
)
gp
->
ty
,

625 (
u_lg
)
gp
->
tx
->
txnid
,

626 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

627 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

628 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

629 ()
	`tf
("\n");

630 
	`__os_
(
dbv
, 
gp
);

632 
	}
}

639 
	$__db_pg_w_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

640 
DB_ENV
 *
dbv
;

641 
DBT
 *
db
;

642 
DB_LSN
 *
lp
;

643 
db_cs
 
nud2
;

644 *
nud3
;

646 
__db_pg_w_gs
 *
gp
;

647 
u_t32_t
 
i
;

648 
ch
;

649 
t
;

651 
nud2
 = 
DB_TXN_PRINT
;

652 
nud3
 = 
NULL
;

654 i((
t
 = 
	`__db_pg_w_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

655  (
t
);

656 ()
	`tf
(

658 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

659 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

660 (
u_lg
)
gp
->
ty
,

661 (
u_lg
)
gp
->
tx
->
txnid
,

662 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

663 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

664 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

665 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

666 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

667 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

668 ()
	`tf
("\theader: ");

669 
i
 = 0; i < 
gp
->
hd
.
size
; i++) {

670 
ch
 = ((
u_t8_t
 *)
gp
->
hd
.
da
)[
i
];

671 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

673 ()
	`tf
("\n");

674 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

675 ()
	`tf
("\n");

676 
	`__os_
(
dbv
, 
gp
);

678 
	}
}

685 
	$__db_pg__t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

686 
DB_ENV
 *
dbv
;

687 
DBT
 *
db
;

688 
DB_LSN
 *
lp
;

689 
db_cs
 
nud2
;

690 *
nud3
;

692 
__db_pg__gs
 *
gp
;

693 
u_t32_t
 
i
;

694 
ch
;

695 
t
;

697 
nud2
 = 
DB_TXN_PRINT
;

698 
nud3
 = 
NULL
;

700 i((
t
 = 
	`__db_pg__ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

701  (
t
);

702 ()
	`tf
(

704 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

705 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

706 (
u_lg
)
gp
->
ty
,

707 (
u_lg
)
gp
->
tx
->
txnid
,

708 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

709 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

710 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

711 ()
	`tf
("\theader: ");

712 
i
 = 0; i < 
gp
->
hd
.
size
; i++) {

713 
ch
 = ((
u_t8_t
 *)
gp
->
hd
.
da
)[
i
];

714 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

716 ()
	`tf
("\n");

717 ()
	`tf
("\tdata: ");

718 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

719 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

720 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

722 ()
	`tf
("\n");

723 ()
	`tf
("\n");

724 
	`__os_
(
dbv
, 
gp
);

726 
	}
}

733 
	$__db_pg_st_t
(
dbv
, 
db
, 
lp
, 
nud2
, 
nud3
)

734 
DB_ENV
 *
dbv
;

735 
DBT
 *
db
;

736 
DB_LSN
 *
lp
;

737 
db_cs
 
nud2
;

738 *
nud3
;

740 
__db_pg_st_gs
 *
gp
;

741 
u_t32_t
 
i
;

742 
ch
;

743 
t
;

745 
nud2
 = 
DB_TXN_PRINT
;

746 
nud3
 = 
NULL
;

748 i((
t
 = 
	`__db_pg_st_ad
(
dbv
, 
db
->
da
, &
gp
)) != 0)

749  (
t
);

750 ()
	`tf
(

752 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

753 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

754 (
u_lg
)
gp
->
ty
,

755 (
u_lg
)
gp
->
tx
->
txnid
,

756 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

757 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

758 ()
	`tf
("\tma: %lu\n", (
u_lg
)
gp
->
ma
);

759 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

760 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

761 ()
	`tf
("\a_: %lu\n", (
u_lg
)
gp
->
ϡ_
);

762 ()
	`tf
("\tlast_lsn: [%lu][%lu]\n",

763 (
u_lg
)
gp
->
ϡ_l
.
fe
, (u_lgrgp->ϡ_l.
offt
);

764 ()
	`tf
("\a_pgno: %lu\n", (
u_lg
)
gp
->
ϡ_pgno
);

765 ()
	`tf
("\tlist: ");

766 
i
 = 0; i < 
gp
->
li
.
size
; i++) {

767 
ch
 = ((
u_t8_t
 *)
gp
->
li
.
da
)[
i
];

768 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

770 ()
	`tf
("\n");

771 ()
	`tf
("\n");

772 
	`__os_
(
dbv
, 
gp
);

774 
	}
}

781 
	$__db__t
(
dbv
, 
dbp
, 
dbsiz
)

782 
DB_ENV
 *
dbv
;

783 (***
dbp
)
	`__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
, *));

784 
size_t
 *
dbsiz
;

786 
t
;

788 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

789 
__db_addm_t
, 
DB___db_addm
)) != 0)

790  (
t
);

791 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

792 
__db_big_t
, 
DB___db_big
)) != 0)

793  (
t
);

794 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

795 
__db_ovf_t
, 
DB___db_ovf
)) != 0)

796  (
t
);

797 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

798 
__db_debug_t
, 
DB___db_debug
)) != 0)

799  (
t
);

800 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

801 
__db_no_t
, 
DB___db_no
)) != 0)

802  (
t
);

803 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

804 
__db_pg_loc_t
, 
DB___db_pg_loc
)) != 0)

805  (
t
);

806 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

807 
__db_pg__t
, 
DB___db_pg_
)) != 0)

808  (
t
);

809 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

810 
__db_cksum_t
, 
DB___db_cksum
)) != 0)

811  (
t
);

812 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

813 
__db_pg_da_t
, 
DB___db_pg_da
)) != 0)

814  (
t
);

815 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

816 
__db_pg_e_t
, 
DB___db_pg_e
)) != 0)

817  (
t
);

818 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

819 
__db_pg_w_t
, 
DB___db_pg_w
)) != 0)

820  (
t
);

821 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

822 
__db_pg__t
, 
DB___db_pg_
)) != 0)

823  (
t
);

824 i((
t
 = 
	`__db_add_covy
(
dbv
, 
dbp
, 
dbsiz
,

825 
__db_pg_st_t
, 
DB___db_pg_st
)) != 0)

826  (
t
);

828 
	}
}

	@../db/db_cam.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/b.h
"

14 
	~"dbc/hash.h
"

15 
	~"dbc/lock.h
"

16 
	~"dbc/mp.h
"

17 
	~"dbc/qam.h
"

18 
	~"dbc/txn.h
"

20 
__db_budl
 
__P
((
DB
 *, 
DBT
 *, DBT *, DBT *));

21 
__dbc_nup
 
__P
((
DBC
 *, DBC *, ));

22 
__dbc_d_dskey
 
__P
((
DB
 *, 
DBC
 *, 
DBT
 *, DBT *, DBT *));

23 
__dbc_d_cdy
 
__P
((
DBC
 *));

24 
__dbc_pg_o
 
__P
((
DBC
 *, 
DBT
 *, DBT *, 
u_t32_t
));

25 
__db_s_cou
 
__P
((
DB
 *));

26 
__db_wock_r
 
__P
((
DB_ENV
 *));

28 
	#CDB_LOCKING_INIT
(
dbv
, 
dbc
) \

35 i(
	`CDB_LOCKING
(
dbv
)) { \

36 i(!
	`F_ISSET
(
dbc
, 
DBC_WRITECURSOR
 | 
DBC_WRITER
)) \

37  (
	`__db_wock_r
(
dbv
)); \

39 i(
	`F_ISSET
(
dbc
, 
DBC_WRITECURSOR
) && \

40 (
t
 = 
	`__lock_g
(
dbv
, \

41 (
dbc
)->
lock
, 
DB_LOCK_UPGRADE
, &(dbc)->
lock_dbt
, \

42 
DB_LOCK_WRITE
, &(
dbc
)->
mylock
)) != 0) \

43  (
t
); \

44 }

	)

45 
	#CDB_LOCKING_DONE
(
dbv
, 
dbc
) \

47 i(
	`F_ISSET
(
dbc
, 
DBC_WRITECURSOR
)) \

48 ()
	`__lock_downgde
( \

49 
dbv
, &(
dbc
)->
mylock
, 
DB_LOCK_IWRITE
, 0);

	)

58 
	$__dbc_o
(
dbc
)

59 
DBC
 *
dbc
;

61 
DB
 *
dbp
;

62 
DBC
 *
d
;

63 
DBC_INTERNAL
 *

;

64 
DB_ENV
 *
dbv
;

65 
DB_TXN
 *
txn
;

66 
t
, 
t_t
;

68 
dbp
 = 
dbc
->dbp;

69 
dbv
 = 
dbp
->dbenv;

70 

 = 
dbc
->

;

71 
d
 = 

->opd;

72 
t
 = 0;

85 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

87 i(
d
 !
NULL
) {

88 
	`DB_ASSERT
(
dbv
, 
	`F_ISSET
(
d
, 
DBC_ACTIVE
));

89 
	`F_CLR
(
d
, 
DBC_ACTIVE
);

90 
	`TAILQ_REMOVE
(&
dbp
->
aive_queue
, 
d
, 
lks
);

92 
	`DB_ASSERT
(
dbv
, 
	`F_ISSET
(
dbc
, 
DBC_ACTIVE
));

93 
	`F_CLR
(
dbc
, 
DBC_ACTIVE
);

94 
	`TAILQ_REMOVE
(&
dbp
->
aive_queue
, 
dbc
, 
lks
);

96 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

99 i((
t_t
 =

100 
dbc
->
	`am_o
(dbc, 
PGNO_INVALID
, 
NULL
)!0 && 
t
 == 0)

101 
t
 = 
t_t
;

107 i(
	`CDB_LOCKING
(
dbv
)) {

114 i((
t_t
 = 
	`__LPUT
(
dbc
, dbc->
mylock
)!0 && 
t
 == 0)

115 
t
 = 
t_t
;

118 
	`memt
(&
dbc
->
mylock
, 0, (dbc->mylock));

119 i(
d
 !
NULL
)

120 
	`memt
(&
d
->
mylock
, 0, (opd->mylock));

123 i((
txn
 = 
dbc
->txn!
NULL
)

124 
txn
->
curss
--;

127 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

128 i(
d
 !
NULL
) {

129 i(
txn
 !
NULL
)

130 
txn
->
curss
--;

131 
	`TAILQ_INSERT_TAIL
(&
dbp
->
_queue
, 
d
, 
lks
);

132 
d
 = 
NULL
;

134 
	`TAILQ_INSERT_TAIL
(&
dbp
->
_queue
, 
dbc
, 
lks
);

135 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

137 i(
txn
 !
NULL
 && 
	`F_ISSET
xn, 
TXN_PRIVATE
&&xn->
curss
 == 0 &&

138 (
t_t
 = 
	`__txn_comm
(
txn
, 0)!0 && 
t
 == 0)

139 
t
 = 
t_t
;

141  (
t
);

142 
	}
}

151 
	$__dbc_deroy
(
dbc
)

152 
DBC
 *
dbc
;

154 
DB
 *
dbp
;

155 
DB_ENV
 *
dbv
;

156 
t
, 
t_t
;

158 
dbp
 = 
dbc
->dbp;

159 
dbv
 = 
dbp
->dbenv;

162 
	`MUTEX_LOCK
(
dbv
, 
dbp
->
mux
);

163 
	`TAILQ_REMOVE
(&
dbp
->
_queue
, 
dbc
, 
lks
);

164 
	`MUTEX_UNLOCK
(
dbv
, 
dbp
->
mux
);

167 i(
dbc
->
my_rskey
.
da
 !
NULL
)

168 
	`__os_
(
dbv
, 
dbc
->
my_rskey
.
da
);

169 i(
dbc
->
my_rkey
.
da
 !
NULL
)

170 
	`__os_
(
dbv
, 
dbc
->
my_rkey
.
da
);

171 i(
dbc
->
my_rda
.
da
 !
NULL
)

172 
	`__os_
(
dbv
, 
dbc
->
my_rda
.
da
);

175 
t
 = 
dbc
->
am_deroy
 =
NULL
 ? 0 : dbc->
	`am_deroy
(dbc);

180 i(
	`LOCKING_ON
(
dbv
) &&

181 
	`F_ISSET
(
dbc
, 
DBC_OWN_LID
) &&

182 (
t_t
 = 
	`__lock_id_
(
dbv
,

183 (
DB_LOCKER
 *)
dbc
->
ef
)!0 && 
t
 == 0)

184 
t
 = 
t_t
;

186 
	`__os_
(
dbv
, 
dbc
);

188  (
t
);

189 
	}
}

198 
	$__dbc_cou
(
dbc
, 

)

199 
DBC
 *
dbc
;

200 
db_o_t
 *

;

202 
DB_ENV
 *
dbv
;

203 
t
;

205 
dbv
 = 
dbc
->
dbp
->dbenv;

214 
dbc
->
dbty
) {

215 
DB_QUEUE
:

216 
DB_RECNO
:

217 *

 = 1;

219 
DB_HASH
:

220 i(
dbc
->

->
d
 =
NULL
) {

221 i((
t
 = 
	`__hamc_cou
(
dbc
, 

)) != 0)

222  (
t
);

226 
DB_BTREE
:

227 i((
t
 = 
	`__bamc_cou
(
dbc
, 

)) != 0)

228  (
t
);

230 
DB_UNKNOWN
:

232  (
	`__db_unknown_ty
(
dbv
, "__dbc_cou", 
dbc
->
dbty
));

235 
	}
}

244 
	$__dbc_d
(
dbc
, 
ags
)

245 
DBC
 *
dbc
;

246 
u_t32_t
 
ags
;

248 
DB
 *
dbp
;

249 
DBC
 *
d
;

250 
DB_ENV
 *
dbv
;

251 
t
, 
t_t
;

253 
dbp
 = 
dbc
->dbp;

254 
dbv
 = 
dbp
->dbenv;

264 
	`CDB_LOCKING_INIT
(
dbv
, 
dbc
);

274 i(
ags
 !
DB_UPDATE_SECONDARY
 && 
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
)) {

275 
t
 = 
	`__dbc_d_cdy
(
dbc
);

276 
de
;

283 i(
	`LIST_FIRST
(&
dbp
->
s_cds
!
NULL
 &&

284 (
t
 = 
	`__dbc_d_imy
(
dbc
)) != 0)

285 
de
;

293 
d
 = 
dbc
->

->opd;

294 i(
d
 =
NULL
)

295 
t
 = 
dbc
->
	`am_d
(dbc);

297 i((
t
 = 
dbc
->
	`am_wrock
(dbc)) == 0)

298 
t
 = 
d
->
	`am_d
(opd);

307 i(
	`F_ISSET
(
dbc
->
dbp
, 
DB_AM_READ_UNCOMMITTED
) &&

308 
dbc
->

->
lock_mode
 =
DB_LOCK_WRITE
) {

309 i((
t_t
 =

310 
	`__TLPUT
(
dbc
, dbc->

->
lock
)!0 && 
t
 == 0)

311 
t
 = 
t_t
;

312 i(
t_t
 == 0)

313 
dbc
->

->
lock_mode
 = 
DB_LOCK_WWRITE
;

316 
de
: 
	`CDB_LOCKING_DONE
(
dbv
, 
dbc
);

318  (
t
);

319 
	}
}

328 
	$__dbc_dup
(
dbc_ig
, 
db
, 
ags
)

329 
DBC
 *
dbc_ig
;

330 
DBC
 **
db
;

331 
u_t32_t
 
ags
;

333 
DBC
 *
dbc_n
, *
dbc_nd
;

334 
t
;

336 
dbc_n
 = 
dbc_nd
 = 
NULL
;

339 i((
t
 = 
	`__dbc_idup
(
dbc_ig
, &
dbc_n
, 
ags
)) != 0)

340 
r
;

341 *
db
 = 
dbc_n
;

347 i(
dbc_ig
->

->
d
 !
NULL
) {

348 i((
t
 =

349 
	`__dbc_idup
(
dbc_ig
->

->
d
, &
dbc_nd
, 
ags
)) != 0)

350 
r
;

351 
dbc_n
->

->
d
 = 
dbc_nd
;

355 
r
: i(
dbc_n
 !
NULL
)

356 ()
	`__dbc_o
(
dbc_n
);

357 i(
dbc_nd
 !
NULL
)

358 ()
	`__dbc_o
(
dbc_nd
);

360  (
t
);

361 
	}
}

370 
	$__dbc_idup
(
dbc_ig
, 
db
, 
ags
)

371 
DBC
 *
dbc_ig
, **
db
;

372 
u_t32_t
 
ags
;

374 
DB
 *
dbp
;

375 
DBC
 *
dbc_n
;

376 
DBC_INTERNAL
 *
t_n
, *
t_ig
;

377 
t
;

379 
dbp
 = 
dbc_ig
->dbp;

380 
dbc_n
 = *
db
;

382 i((
t
 = 
	`__db_curs_t
(
dbp
, 
dbc_ig
->
txn
, dbc_ig->
dbty
,

383 
dbc_ig
->

->
ro
, 
	`F_ISSET
(dbc_ig, 
DBC_OPD
),

384 
dbc_ig
->
lock
, &
dbc_n
)) != 0)

385  (
t
);

388 i(
ags
 =
DB_POSITION
) {

389 
t_n
 = 
dbc_n
->

;

390 
t_ig
 = 
dbc_ig
->

;

392 
dbc_n
->
ags
 |
dbc_ig
->ag& ~
DBC_OWN_LID
;

394 
t_n
->
dx
 = 
t_ig
->indx;

395 
t_n
->
pgno
 = 
t_ig
->pgno;

396 
t_n
->
ro
 = 
t_ig
->root;

397 
t_n
->
lock_mode
 = 
t_ig
->lock_mode;

399 
dbc_ig
->
dbty
) {

400 
DB_QUEUE
:

401 i((
t
 = 
	`__qamc_dup
(
dbc_ig
, 
dbc_n
)) != 0)

402 
r
;

404 
DB_BTREE
:

405 
DB_RECNO
:

406 i((
t
 = 
	`__bamc_dup
(
dbc_ig
, 
dbc_n
)) != 0)

407 
r
;

409 
DB_HASH
:

410 i((
t
 = 
	`__hamc_dup
(
dbc_ig
, 
dbc_n
)) != 0)

411 
r
;

413 
DB_UNKNOWN
:

415 
t
 = 
	`__db_unknown_ty
(
dbp
->
dbv
,

416 "__dbc_idup", 
dbc_ig
->
dbty
);

417 
r
;

422 
	`F_SET
(
dbc_n
, 
	`F_ISSET
(
dbc_ig
,

423 
DBC_READ_COMMITTED
 | 
DBC_READ_UNCOMMITTED
 | 
DBC_WRITECURSOR
));

429 i(
	`CDB_LOCKING
(
dbp
->
dbv
&& !
	`F_ISSET
(
dbc_n
, 
DBC_OPD
) &&

430 (
t
 = 
	`__lock_g
(
dbp
->
dbv
, 
dbc_n
->
lock
, 0,

431 &
dbc_n
->
lock_dbt
, 
	`F_ISSET
(
dbc_ig
, 
DBC_WRITECURSOR
) ?

432 
DB_LOCK_IWRITE
 : 
DB_LOCK_READ
, &
dbc_n
->
mylock
)) != 0)

433 
r
;

435 
dbc_n
->
iܙy
 = 
dbc_ig
->priority;

436 *
db
 = 
dbc_n
;

439 
r
: ()
	`__dbc_o
(
dbc_n
);

440  (
t
);

441 
	}
}

450 
	$__dbc_wd
(
dbc_
, 
ro
, 
dd
, 
db
)

451 
DBC
 *
dbc_
;

452 
db_pgno_t
 
ro
;

453 
DBC
 *
dd
;

454 
DBC
 **
db
;

456 
DB
 *
dbp
;

457 
DBC
 *
d
;

458 
DBTYPE
 
dbty
;

459 
t
;

461 
dbp
 = 
dbc_
->dbp;

462 
dbty
 = (
dbp
->
dup_com
 =
NULL
? 
DB_RECNO
 : 
DB_BTREE
;

471 *
db
 = 
dd
;

473 i((
t
 = 
	`__db_curs_t
(
dbp
,

474 
dbc_
->
txn
, 
dbty
, 
ro
, 1, dbc_->
lock
, &
d
)) != 0)

475  (
t
);

477 
d
->
iܙy
 = 
dbc_
->priority;

478 *
db
 = 
d
;

492 i(
dd
 !
NULL
 && (
t
 = 
	`__dbc_o
(oldopd)) != 0)

493  (
t
);

496 
	}
}

505 
	$__dbc_g
(
dbc_g
, 
key
, 
da
, 
ags
)

506 
DBC
 *
dbc_g
;

507 
DBT
 *
key
, *
da
;

508 
u_t32_t
 
ags
;

510 
DB
 *
dbp
;

511 
DBC
 *
dbc
, *
dbc_n
, *
d
;

512 
DBC_INTERNAL
 *

, *
_n
;

513 
DB_ENV
 *
dbv
;

514 
DB_MPOOLFILE
 *
mpf
;

515 
db_pgno_t
 
pgno
;

516 
db_dx_t
 
dx_off
;

517 
u_t32_t
 
mui
, 
ig_un
, 
tmp_ags
, 
tmp_ad_uncommd
, 
tmp_rmw
;

518 
u_t8_t
 
ty
;

519 
key_sml
, 
t
, 
t_t
;

521 
	`COMPQUIET
(
ig_un
, 0);

523 
key_sml
 = 0;

534 
dbp
 = 
dbc_g
->dbp;

535 
dbv
 = 
dbp
->dbenv;

536 
mpf
 = 
dbp
->mpf;

537 
dbc_n
 = 
NULL
;

538 
d
 = 
NULL
;

541 
tmp_rmw
 = 
	`LF_ISSET
(
DB_RMW
);

542 
	`LF_CLR
(
DB_RMW
);

544 
tmp_ad_uncommd
 =

545 
	`LF_ISSET
(
DB_READ_UNCOMMITTED
) &&

546 !
	`F_ISSET
(
dbc_g
, 
DBC_READ_UNCOMMITTED
);

547 
	`LF_CLR
(
DB_READ_UNCOMMITTED
);

549 
mui
 = 
	`LF_ISSET
(
DB_MULTIPLE
|
DB_MULTIPLE_KEY
);

550 
	`LF_CLR
(
DB_MULTIPLE
|
DB_MULTIPLE_KEY
);

556 i(
ags
 =
DB_GET_RECNO
) {

557 i(
tmp_rmw
)

558 
	`F_SET
(
dbc_g
, 
DBC_RMW
);

559 i(
tmp_ad_uncommd
)

560 
	`F_SET
(
dbc_g
, 
DBC_READ_UNCOMMITTED
);

561 
t
 = 
	`__bamc_rg
(
dbc_g
, 
da
);

562 i(
tmp_rmw
)

563 
	`F_CLR
(
dbc_g
, 
DBC_RMW
);

564 i(
tmp_ad_uncommd
)

565 
	`F_CLR
(
dbc_g
, 
DBC_READ_UNCOMMITTED
);

566  (
t
);

569 i(
ags
 =
DB_CONSUME
 || fg=
DB_CONSUME_WAIT
)

570 
	`CDB_LOCKING_INIT
(
dbv
, 
dbc_g
);

577 i((
ags
 =
DB_GET_BOTH
 ||

578 
ags
 =
DB_GET_BOTH_RANGE
 || fg=
DB_SET
) &&

579 ((
BTREE
 *)
dbp
->
bt_
)->
bt_com
 =
__bam_defcmp


580 #ifde
HAVE_HASH


581 && ((
HASH
 *)
dbp
->
h_
)->
h_com
 =
NULL


584 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

586 i(
ags
 =
DB_GET_BOTH
 && 
dbp
->
dup_com
 =
NULL
)

587 
	`F_SET
(
da
, 
DB_DBT_ISSET
);

600 

 = 
dbc_g
->

;

601 i(

->
d
 !
NULL
 &&

602 (
ags
 =
DB_CURRENT
 || fg=
DB_GET_BOTHC
 ||

603 
ags
 =
DB_NEXT
 || fg=
DB_NEXT_DUP
 ||

604 
ags
 =
DB_PREV
 || fg=
DB_PREV_DUP
)) {

605 i(
tmp_rmw
 && (
t
 = 
dbc_g
->
	`am_wrock
(dbc_arg)) != 0)

606 
r
;

607 i(
	`F_ISSET
(
dbc_g
, 
DBC_TRANSIENT
))

608 
d
 = 

->opd;

609 i((
t
 = 
	`__dbc_idup
(

->
d
, &d, 
DB_POSITION
)) != 0)

610 
r
;

612 
t
 = 
d
->
	`am_g
(d, 
key
, 
da
, 
ags
, 
NULL
)) {

614 
de
;

615 
DB_NOTFOUND
:

621 i(
ags
 =
DB_NEXT
 || fg=
DB_PREV
) {

622 i((
t
 = 
	`__dbc_o
(
d
)) != 0)

623 
r
;

624 
d
 = 
NULL
;

625 i(
	`F_ISSET
(
dbc_g
, 
DBC_TRANSIENT
))

626 

->
d
 = 
NULL
;

629 
r
;

631 
r
;

633 } i(

->
d
 !
NULL
 && 
	`F_ISSET
(
dbc_g
, 
DBC_TRANSIENT
)) {

634 i((
t
 = 
	`__dbc_o
(

->
d
)) != 0)

635 
r
;

636 

->
d
 = 
NULL
;

643 
ags
) {

644 
DB_CURRENT
:

645 
DB_GET_BOTHC
:

646 
DB_NEXT
:

647 
DB_NEXT_DUP
:

648 
DB_NEXT_NODUP
:

649 
DB_PREV
:

650 
DB_PREV_DUP
:

651 
DB_PREV_NODUP
:

652 
tmp_ags
 = 
DB_POSITION
;

655 
tmp_ags
 = 0;

659 i(
tmp_ad_uncommd
)

660 
	`F_SET
(
dbc_g
, 
DBC_READ_UNCOMMITTED
);

666 i(
	`F_ISSET
(
dbc_g
, 
DBC_TRANSIENT
))

667 
dbc_n
 = 
dbc_g
;

669 
t
 = 
	`__dbc_idup
(
dbc_g
, &
dbc_n
, 
tmp_ags
);

670 i(
tmp_ad_uncommd
)

671 
	`F_CLR
(
dbc_g
, 
DBC_READ_UNCOMMITTED
);

673 i(
t
 != 0)

674 
r
;

675 
	`COPY_RET_MEM
(
dbc_g
, 
dbc_n
);

678 i(
tmp_rmw
)

679 
	`F_SET
(
dbc_n
, 
DBC_RMW
);

681 
mui
) {

682 
DB_MULTIPLE
:

683 
	`F_SET
(
dbc_n
, 
DBC_MULTIPLE
);

685 
DB_MULTIPLE_KEY
:

686 
	`F_SET
(
dbc_n
, 
DBC_MULTIPLE_KEY
);

688 
DB_MULTIPLE
 | 
DB_MULTIPLE_KEY
:

689 
	`F_SET
(
dbc_n
, 
DBC_MULTIPLE
|
DBC_MULTIPLE_KEY
);

696 
pgno
 = 
PGNO_INVALID
;

697 
t
 = 
dbc_n
->
	`am_g
(dbc_n, 
key
, 
da
, 
ags
, &
pgno
);

698 i(
tmp_rmw
)

699 
	`F_CLR
(
dbc_n
, 
DBC_RMW
);

700 i(
tmp_ad_uncommd
)

701 
	`F_CLR
(
dbc_g
, 
DBC_READ_UNCOMMITTED
);

702 
	`F_CLR
(
dbc_n
, 
DBC_MULTIPLE
|
DBC_MULTIPLE_KEY
);

703 i(
t
 != 0)

704 
r
;

706 
_n
 = 
dbc_n
->

;

712 i(
pgno
 !
PGNO_INVALID
) {

713 i((
t
 = 
	`__dbc_wd
(
dbc_g
,

714 
pgno
, 
_n
->
d
, &cp_n->opd)) != 0)

715 
r
;

717 
ags
) {

718 
DB_FIRST
:

719 
DB_NEXT
:

720 
DB_NEXT_NODUP
:

721 
DB_SET
:

722 
DB_SET_RECNO
:

723 
DB_SET_RANGE
:

724 
tmp_ags
 = 
DB_FIRST
;

726 
DB_LAST
:

727 
DB_PREV
:

728 
DB_PREV_NODUP
:

729 
tmp_ags
 = 
DB_LAST
;

731 
DB_GET_BOTH
:

732 
DB_GET_BOTHC
:

733 
DB_GET_BOTH_RANGE
:

734 
tmp_ags
 = 
ags
;

737 
t
 = 
	`__db_unknown_ag
(
dbv
, "__dbc_g", 
ags
);

738 
r
;

740 i((
t
 = 
_n
->
d
->
	`am_g
(

741 
_n
->
d
, 
key
, 
da
, 
tmp_ags
, 
NULL
)) != 0)

742 
r
;

745 
de
:

759 
_n
 = 
dbc_n
 =
NULL
 ? 
dbc_g
->

 : dbc_n->internal;

760 i(!
	`F_ISSET
(
key
, 
DB_DBT_ISSET
)) {

761 i(
_n
->
ge
 =
NULL
 && (
t
 = 
	`__memp_fg
(
mpf
, &_n->
pgno
,

762 
dbc_g
->
txn
, 0, &
_n
->
ge
)) != 0)

763 
r
;

765 i((
t
 = 
	`__db_t
(
dbp
, 
dbc_g
->
txn
,

766 
_n
->
ge
, cp_n->
dx
, 
key
,

767 &
dbc_g
->
rkey
->
da
, &dbc_g->rkey->
un
)) != 0) {

775 i(
t
 =
DB_BUFFER_SMALL
 &&

776 
	`F_ISSET
(
da
, 
DB_DBT_USERMEM
)) {

777 
key_sml
 = 1;

778 
ig_un
 = 
da
->
un
;

779 
da
->
un
 = 0;

781 
r
;

784 i(
mui
 != 0) {

789 i(
dbc_n
 =
NULL
) {

796 i((!(
mui
 & 
DB_MULTIPLE_KEY
) &&

797 
dbc_g
->

->
d
 =
NULL
) ||

798 
	`F_ISSET
(
dbc_g
, 
DBC_TRANSIENT
))

799 
dbc_n
 = 
dbc_g
;

801 i((
t
 = 
	`__dbc_idup
(
dbc_g
,

802 &
dbc_n
, 
DB_POSITION
)) != 0)

803 
r
;

804 i((
t
 = 
dbc_n
->
	`am_g
(dbc_n,

805 
key
, 
da
, 
DB_CURRENT
, &
pgno
)) != 0)

806 
r
;

808 
_n
 = 
dbc_n
->

;

816 i(
d
 !
NULL
) {

817 
	`DB_ASSERT
(
dbv
, 
_n
->
d
 =
NULL
);

818 
_n
->
d
 = opd;

819 
d
 = 
NULL
;

830 
da
->
size
 = da->
un
;

831 
t
 = 
dbc_n
->
	`am_bulk
(dbc_n, 
da
, 
ags
 | 
mui
);

832 } i(!
	`F_ISSET
(
da
, 
DB_DBT_ISSET
)) {

833 
dbc
 = 
d
 !
NULL
 ? opd : 
_n
->d !NULL ? cp_n->d : 
dbc_n
;

834 

 = 
dbc
->

;

835 i(

->
ge
 =
NULL
 &&

836 (
t
 = 
	`__memp_fg
(
mpf
, &

->
pgno
, 
dbc
->
txn
,

837 0, &

->
ge
)) != 0)

838 
r
;

840 
ty
 = 
	`TYPE
(

->
ge
);

841 
dx_off
 = ((
ty
 =
P_LBTREE
 ||

842 
ty
 =
P_HASH
 ||y =
P_HASH_UNSORTED
? 
O_INDX
 : 0);

843 
t
 = 
	`__db_t
(
dbp
, 
dbc
->
txn
, 

->
ge
, cp->
dx
 + 
dx_off
,

844 
da
, &
dbc_g
->
rda
->da, &dbc_g->rda->
un
);

847 
r
:

848 
	`F_CLR
(
key
, 
DB_DBT_ISSET
);

849 
	`F_CLR
(
da
, 
DB_DBT_ISSET
);

852 i(
d
 !
NULL
) {

860 i(
	`F_ISSET
(
dbc_g
->
dbp
, 
DB_AM_READ_UNCOMMITTED
) &&

861 
	`F_ISSET
((
BTREE_CURSOR
 *)

862 
dbc_g
->

->
d
->, 
C_DELETED
))

863 i((
t_t
 =

864 
dbc_g
->
	`am_wrock
(dbc_g)!0 && 
t
 == 0)

865 
t
 = 
t_t
;

866 i((
t_t
 = 
	`__dbc_nup
(

867 
dbc_g
->

->
d
, opd, 
t
)) != 0 &&et == 0)

868 
t
 = 
t_t
;

872 i(
key_sml
) {

873 
da
->
un
 = 
ig_un
;

874 i(
t
 == 0)

875 
t
 = 
DB_BUFFER_SMALL
;

878 i((
t_t
 = 
	`__dbc_nup
(
dbc_g
, 
dbc_n
, 
t
)) != 0 &&

879 (
t
 =0 || =
DB_BUFFER_SMALL
))

880 
t
 = 
t_t
;

882 i(
ags
 =
DB_CONSUME
 || fg=
DB_CONSUME_WAIT
)

883 
	`CDB_LOCKING_DONE
(
dbv
, 
dbc_g
);

884  (
t
);

885 
	}
}

894 
	$__dbc_put
(
dbc_g
, 
key
, 
da
, 
ags
)

895 
DBC
 *
dbc_g
;

896 
DBT
 *
key
, *
da
;

897 
u_t32_t
 
ags
;

899 
DB_ENV
 *
dbv
;

900 
DB
 *
dbp
, *
sdbp
;

901 
DBC
 *
dbc_n
, *
dd
, *
d
, *
sdbc
, *
pdbc
;

902 
DBT
 
dda
, 
dpkey
, 
wda
, 
pkey
, 
mkey
, 
mpskey
;

903 
DBT
 *
l_skeys
, *
skeyp
, *
tskeyp
;

904 
db_pgno_t
 
pgno
;

905 
cmp
, 
have_dc
, 
itl
, 
nod
, 
_d
, 
t
, 
s_cou
, 
t_t
;

906 
u_t32_t
 
_n
, 
nskey
, 
rmw
, 
size
, 
tmp_ags
;

917 
dbp
 = 
dbc_g
->dbp;

918 
dbv
 = 
dbp
->dbenv;

919 
sdbp
 = 
NULL
;

920 
pdbc
 = 
dbc_n
 = 
NULL
;

921 
l_skeys
 = 
NULL
;

922 
	`memt
(&
wda
, 0, (
DBT
));

923 
t
 = 
s_cou
 = 0;

930 
	`memt
(&
dda
, 0, (
DBT
));

931 
	`F_SET
(&
dda
, 
DB_DBT_MALLOC
);

939 i(
ags
 =
DB_UPDATE_SECONDARY
)

940 
ags
 = 
DB_KEYLAST
;

942 
	`CDB_LOCKING_INIT
(
dbv
, 
dbc_g
);

949 i(
	`LIST_FIRST
(&
dbp
->
s_cds
=
NULL
)

950 
sk_s_upde
;

1009 
	`memt
(&
pkey
, 0, (
DBT
));

1010 
s_cou
 = 
	`__db_s_cou
(
dbp
);

1011 i((
t
 = 
	`__os_oc
(

1012 
dbv
, (
u_t
)
s_cou
, (
DBT
), &
l_skeys
)) != 0)

1013 
r
;

1014 
have_dc
 = 
nod
 = 0;

1022 
	`DB_ASSERT
(
dbv
, 
ags
 =
DB_CURRENT
 || fg=
DB_KEYFIRST
 ||

1023 
ags
 =
DB_KEYLAST
 || fg=
DB_NOOVERWRITE
);

1029 
rmw
 = 
	`STD_LOCKING
(
dbc_g
? 
DB_RMW
 : 0;

1031 i(
ags
 =
DB_CURRENT
) {

1044 
t
 = 
	`__dbc_g
(
dbc_g
, &
pkey
, &
dda
, 
rmw
 | 
DB_CURRENT
);

1045 i(
t
 =
DB_KEYEMPTY
)

1046 
t
 = 
DB_NOTFOUND
;

1047 i(
t
 != 0)

1048 
r
;

1050 
have_dc
 = 1;

1053 
pkey
.
da
 = 
key
->data;

1054 
pkey
.
size
 = 
key
->size;

1060 i(
	`F_ISSET
(
da
, 
DB_DBT_PARTIAL
)) {

1061 i(!
have_dc
 && !
nod
) {

1067 i((
t
 = 
	`__dbc_idup
(
dbc_g
, &
pdbc
, 0)) != 0)

1068 
r
;

1071 
	`DB_ASSERT
(
dbv
, 
ags
 !
DB_CURRENT
);

1073 
t
 = 
	`__dbc_g
(
pdbc
, &
pkey
, &
dda
, 
rmw
 | 
DB_SET
);

1074 i(
t
 =
DB_KEYEMPTY
 || =
DB_NOTFOUND
) {

1075 
nod
 = 1;

1076 
t
 = 0;

1078 i((
t_t
 = 
	`__dbc_o
(
pdbc
)) != 0)

1079 
t
 = 
t_t
;

1080 i(
t
 != 0)

1081 
r
;

1083 
have_dc
 = 1;

1092 i((
t
 =

1093 
	`__db_budl
(
dbp
, &
dda
, 
da
, &
wda
)) != 0)

1094 
r
;

1095 
itl
 = 1;

1097 
itl
 = 0;

1105 i((
dbp
->
ty
 =
DB_RECNO
 && 
	`F_ISSET
(dbp, 
DB_AM_FIXEDLEN
)) ||

1106 (
dbp
->
ty
 =
DB_QUEUE
)) {

1107 i(
dbp
->
ty
 =
DB_QUEUE
) {

1108 
_n
 = ((
QUEUE
 *)
dbp
->
q_
)->re_len;

1109 
_d
 = ((
QUEUE
 *)
dbp
->
q_
)->re_pad;

1111 
_n
 = ((
BTREE
 *)
dbp
->
bt_
)->re_len;

1112 
_d
 = ((
BTREE
 *)
dbp
->
bt_
)->re_pad;

1115 
size
 = 
itl
 ? 
wda
.siz: 
da
->size;

1116 i(
size
 > 
_n
) {

1117 
t
 = 
	`__db_c_toobig
(
dbv
, 
size
, 
_n
);

1118 
r
;

1119 } i(
size
 < 
_n
) {

1131 i((
t
 =

1132 
	`__os_loc
(
dbv
, 
_n
, &
wda
.
da
)) != 0)

1133 
r
;

1134 i(!
itl
)

1135 
	`memy
(
wda
.
da
, da->da, 
size
);

1136 
	`memt
((
u_t8_t
 *)
wda
.
da
 + 
size
, 
_d
,

1137 
_n
 - 
size
);

1138 
wda
.
size
 = 
_n
;

1139 
itl
 = 1;

1149 
t
 = 
	`__db_s_f
(
dbp
, &
sdbp
), 
skeyp
 = 
l_skeys
;

1150 
sdbp
 !
NULL
 && 
t
 == 0;

1151 
t
 = 
	`__db_s_xt
(&
sdbp
, 
dbc_g
->
txn
), ++
skeyp
) {

1152 
	`DB_ASSERT
(
dbv
, 
skeyp
 - 
l_skeys
 < 
s_cou
);

1158 i(
have_dc
 && !
nod
 &&

1159 
	`FLD_ISSET
(
sdbp
->
s_assoc_ags
, 
DB_ASSOC_IMMUTABLE_KEY
))

1166 i((
t
 = 
sdbp
->
	`s_back
(sdbp,

1167 &
pkey
, 
itl
 ? &
wda
 : 
da
, 
skeyp
)) != 0) {

1168 i(
t
 =
DB_DONOTINDEX
)

1176 
r
;

1184 i(
	`F_ISSET
(
skeyp
, 
DB_DBT_MULTIPLE
)) {

1185 #ifde
DIAGNOSTIC


1186 
	`__db_check_skeyt
(
sdbp
, 
skeyp
);

1188 
tskeyp
 = (
DBT
 *)
skeyp
->
da
, 
nskey
 = skeyp->
size
;

1189 
nskey
 > 0;skey--, 
tskeyp
++)

1190 
	`F_SET
(
tskeyp
, 
DB_DBT_ISSET
);

1192 
tskeyp
 = (
DBT
 *)
skeyp
->
da
;

1193 
nskey
 = 
skeyp
->
size
;

1195 
	`F_SET
(
skeyp
, 
DB_DBT_ISSET
);

1196 
tskeyp
 = 
skeyp
;

1197 
nskey
 = 1;

1205 i(
have_dc
) {

1206 i((
t
 = 
	`__dbc_d_dskey
(
sdbp
, 
dbc_g
,

1207 
skeyp
, &
pkey
, &
dda
)=
DB_KEYEXIST
)

1209 i(
t
 != 0)

1210 
r
;

1221 i((
t
 = 
	`__db_curs_t
(
sdbp
, 
dbc_g
->
txn
, sdbp->
ty
,

1222 
PGNO_INVALID
, 0, 
dbc_g
->
lock
, &
sdbc
)) != 0)

1223 
r
;

1234 i(
	`CDB_LOCKING
(
dbv
)) {

1235 
	`DB_ASSERT
(
dbv
, 
sdbc
->
mylock
.
off
 =
LOCK_INVALID
);

1236 
	`F_SET
(
sdbc
, 
DBC_WRITER
);

1245 
	`SWAP_IF_NEEDED
(
sdbp
, &
pkey
);

1247 ; 
nskey
 > 0 && 
t
 =0;skey--, 
tskeyp
++) {

1249 i(!
	`F_ISSET
(
tskeyp
, 
DB_DBT_ISSET
))

1284 i(!
	`F_ISSET
(
sdbp
, 
DB_AM_DUP
)) {

1286 
	`memt
(&
dpkey
, 0, (
DBT
));

1287 
	`F_SET
(&
dpkey
, 
DB_DBT_MALLOC
);

1288 
t
 = 
	`__dbc_g
(
sdbc
,

1289 
tskeyp
, &
dpkey
, 
rmw
 | 
DB_SET
);

1290 i(
t
 == 0) {

1291 
cmp
 = 
	`__bam_defcmp
(
sdbp
,

1292 &
dpkey
, &
pkey
);

1293 
	`__os_u
(
dbv
, 
dpkey
.
da
);

1294 i(
cmp
 != 0) {

1295 
	`__db_rx
(
dbv
, "%s%s",

1298 
t
 = 
EINVAL
;

1301 i(
t
 !
DB_NOTFOUND
 && !
DB_KEYEMPTY
)

1303 } i(!
	`F_ISSET
(
sdbp
, 
DB_AM_DUPSORT
)) {

1305 
	`DB_INIT_DBT
(
mpskey
,

1306 
tskeyp
->
da
,skeyp->
size
);

1307 
	`DB_INIT_DBT
(
mkey
,

1308 
pkey
.
da
,key.
size
);

1309 
t
 = 
	`__dbc_g
(
sdbc
, &
mpskey
, &
mkey
,

1310 
rmw
 | 
DB_GET_BOTH
);

1311 i(
t
 !
DB_NOTFOUND
 && !
DB_KEYEMPTY
)

1315 
t
 = 
	`__dbc_put
(
sdbc
, 
tskeyp
, &
pkey
,

1316 
DB_UPDATE_SECONDARY
);

1323 i(
t
 =
DB_KEYEXIST
)

1324 
t
 = 0;

1328 
	`SWAP_IF_NEEDED
(
sdbp
, &
pkey
);

1330 i((
t_t
 = 
	`__dbc_o
(
sdbc
)!0 && 
t
 == 0)

1331 
t
 = 
t_t
;

1333 i(
t
 != 0)

1334 
r
;

1341 
	`F_SET
(
skeyp
, 
DB_DBT_ISSET
);

1343 i(
t
 != 0)

1344 
r
;

1350 i(
have_dc
)

1351 
sk_s_upde
;

1358 i((
t
 = 
	`__dbc_idup
(
dbc_g
, &
pdbc
, 0)) != 0)

1359 
r
;

1360 
	`DB_ASSERT
(
dbv
, 
ags
 !
DB_CURRENT
);

1361 
pkey
.
da
 = 
key
->data;

1362 
pkey
.
size
 = 
key
->size;

1363 
t
 = 
	`__dbc_g
(
pdbc
, &
pkey
, &
dda
, 
rmw
 | 
DB_SET
);

1364 i(
t
 =
DB_KEYEMPTY
 || =
DB_NOTFOUND
) {

1365 
nod
 = 1;

1366 
t
 = 0;

1368 i((
t_t
 = 
	`__dbc_o
(
pdbc
)!0 && 
t
 == 0)

1369 
t
 = 
t_t
;

1370 i(
t
 != 0)

1371 
r
;

1377 i(
nod
)

1378 
sk_s_upde
;

1380 
t
 = 
	`__db_s_f
(
dbp
, &
sdbp
), 
skeyp
 = 
l_skeys
;

1381 
sdbp
 !
NULL
 && 
t
 == 0;

1382 
t
 = 
	`__db_s_xt
(&
sdbp
, 
dbc_g
->
txn
), 
skeyp
++) {

1383 
	`DB_ASSERT
(
dbv
, 
skeyp
 - 
l_skeys
 < 
s_cou
);

1389 i(
	`FLD_ISSET
(
sdbp
->
s_assoc_ags
, 
DB_ASSOC_IMMUTABLE_KEY
))

1392 
t
 = 
	`__dbc_d_dskey
(
sdbp
, 
dbc_g
, 
skeyp
, &
pkey
, &
dda
);

1393 i(
t
 !0 && !
DB_KEYEXIST
)

1394 
r
;

1396 i(
t
 != 0)

1397 
r
;

1401 
sk_s_upde
:

1412 i(
dbc_g
->

->
d
 !
NULL
 &&

1413 (
ags
 =
DB_AFTER
 || fg=
DB_BEFORE
 || fg=
DB_CURRENT
)) {

1421 i(
dbc_g
->
dbty
 =
DB_HASH
 && 
	`F_ISSET
(

1422 ((
BTREE_CURSOR
 *)(
dbc_g
->

->
d
->internal)),

1423 
C_DELETED
)) {

1424 
t
 = 
DB_NOTFOUND
;

1425 
r
;

1428 i((
t
 = 
dbc_g
->
	`am_wrock
(dbc_arg)) != 0 ||

1429 (
t
 = 
	`__dbc_dup
(
dbc_g
, &
dbc_n
, 
DB_POSITION
)) != 0)

1430 
r
;

1431 
d
 = 
dbc_n
->

->opd;

1432 i((
t
 = 
d
->
	`am_put
(

1433 
d
, 
key
, 
da
, 
ags
, 
NULL
)) != 0)

1434 
r
;

1435 
de
;

1442 
tmp_ags
 = 
ags
 =
DB_AFTER
 ||

1443 
ags
 =
DB_BEFORE
 || fg=
DB_CURRENT
 ? 
DB_POSITION
 : 0;

1449 i(
	`F_ISSET
(
dbc_g
, 
DBC_TRANSIENT
))

1450 
dbc_n
 = 
dbc_g
;

1451 i((
t
 = 
	`__dbc_idup
(
dbc_g
, &
dbc_n
, 
tmp_ags
)) != 0)

1452 
r
;

1454 
pgno
 = 
PGNO_INVALID
;

1455 i((
t
 = 
dbc_n
->
	`am_put
(dbc_n, 
key
, 
da
, 
ags
, &
pgno
)) != 0)

1456 
r
;

1462 i(
pgno
 !
PGNO_INVALID
) {

1463 
dd
 = 
dbc_n
->

->
d
;

1464 i((
t
 = 
	`__dbc_wd
(
dbc_g
, 
pgno
, 
dd
, &
d
)) != 0) {

1465 
dbc_n
->

->
d
 = opd;

1466 
r
;

1469 
dbc_n
->

->
d
 = opd;

1471 i(
ags
 =
DB_NOOVERWRITE
)

1472 
ags
 = 
DB_KEYLAST
;

1473 i((
t
 = 
d
->
	`am_put
(

1474 
d
, 
key
, 
da
, 
ags
, 
NULL
)) != 0)

1475 
r
;

1478 
de
:

1479 
r
:

1480 i((
t_t
 = 
	`__dbc_nup
(
dbc_g
, 
dbc_n
, 
t
)) != 0 &&et == 0)

1481 
t
 = 
t_t
;

1484 i(
wda
.
da
 !
NULL
)

1485 
	`__os_
(
dbv
, 
wda
.
da
);

1486 i(
dda
.
da
 !
NULL
)

1487 
	`__os_u
(
dbv
, 
dda
.
da
);

1489 
	`CDB_LOCKING_DONE
(
dbv
, 
dbc_g
);

1491 i(
sdbp
 !
NULL
 &&

1492 (
t_t
 = 
	`__db_s_de
(
sdbp
, 
dbc_g
->
txn
)!0 && 
t
 == 0)

1493 
t
 = 
t_t
;

1495 
skeyp
 = 
l_skeys
; skey-_skey< 
s_cou
; skeyp++) {

1496 i(
	`F_ISSET
(
skeyp
, 
DB_DBT_MULTIPLE
)) {

1497 
nskey
 = 
skeyp
->
size
, 
tskeyp
 = (
DBT
 *)skeyp->
da
;

1498 
nskey
 > 0;

1499 
nskey
--, 
tskeyp
++)

1500 
	`FREE_IF_NEEDED
(
dbv
, 
tskeyp
);

1502 
	`FREE_IF_NEEDED
(
dbv
, 
skeyp
);

1504 i(
l_skeys
 !
NULL
)

1505 
	`__os_
(
dbv
, 
l_skeys
);

1507  (
t
);

1508 
	}
}

1516 
	$__dbc_d_dskey
(
sdbp
, 
dbc_g
, 
skey
, 
pkey
, 
dda
)

1517 
DB
 *
sdbp
;

1518 
DBC
 *
dbc_g
;

1519 
DBT
 *
skey
, *
pkey
, *
dda
;

1521 
DB_ENV
 *
dbv
;

1522 
DB
 *
dbp
;

1523 
DBC
 *
sdbc
;

1524 
DBT
 *
tdskeyp
, *
tskeyp
;

1525 
DBT
 
dskey
, 
mkey
, 
mpskey
;

1526 
t
, 
t_t
;

1527 
u_t32_t
 
i
, 
ndskey
, 
nme
, 
nskey
, 
rmw
;

1529 
sdbc
 = 
NULL
;

1530 
dbp
 = 
sdbp
->
s_imy
;

1531 
dbv
 = 
dbp
->dbenv;

1532 
nme
 = 0;

1533 
rmw
 = 
	`STD_LOCKING
(
dbc_g
? 
DB_RMW
 : 0;

1538 
	`memt
(&
dskey
, 0, (
DBT
));

1539 i((
t
 = 
sdbp
->
	`s_back
(sdbp, 
pkey
, 
dda
, &
dskey
)) != 0) {

1540 i(
t
 =
DB_DONOTINDEX
)

1542 
t
 = 0;

1543  (
t
);

1546 i(
	`F_ISSET
(&
dskey
, 
DB_DBT_MULTIPLE
)) {

1547 #ifde
DIAGNOSTIC


1548 
	`__db_check_skeyt
(
sdbp
, &
dskey
);

1550 
tdskeyp
 = (
DBT
 *)
dskey
.
da
;

1551 
ndskey
 = 
dskey
.
size
;

1553 
tdskeyp
 = &
dskey
;

1554 
ndskey
 = 1;

1557 i(
	`F_ISSET
(
skey
, 
DB_DBT_MULTIPLE
)) {

1558 
nskey
 = 
skey
->
size
;

1559 
skey
 = (
DBT
 *)skey->
da
;

1561 
nskey
 = 
	`F_ISSET
(
skey
, 
DB_DBT_ISSET
) ? 1 : 0;

1563 ; 
ndskey
 > 0 && 
t
 =0;dskey--, 
tdskeyp
++) {

1569 
i
 = 0, 
tskeyp
 = 
skey
; i < 
nskey
; i++,skeyp++)

1570 i(((
BTREE
 *)
sdbp
->
bt_
)->
	`bt_com
(sdbp,

1571 
tdskeyp
, 
tskeyp
) == 0) {

1572 
nme
++;

1573 
	`F_CLR
(
tskeyp
, 
DB_DBT_ISSET
);

1577 i(
i
 < 
nskey
) {

1578 
	`FREE_IF_NEEDED
(
dbv
, 
tdskeyp
);

1582 i(
sdbc
 =
NULL
) {

1583 i((
t
 = 
	`__db_curs_t
(

1584 
sdbp
, 
dbc_g
->
txn
, sdbp->
ty
,

1585 
PGNO_INVALID
, 0, 
dbc_g
->
lock
, &
sdbc
)) != 0)

1586 
r
;

1587 i(
	`CDB_LOCKING
(
dbv
)) {

1588 
	`DB_ASSERT
(
dbv
,

1589 
sdbc
->
mylock
.
off
 =
LOCK_INVALID
);

1590 
	`F_SET
(
sdbc
, 
DBC_WRITER
);

1598 
	`SWAP_IF_NEEDED
(
sdbp
, 
pkey
);

1599 
	`DB_INIT_DBT
(
mkey
, 
pkey
->
da
,key->
size
);

1600 
	`DB_INIT_DBT
(
mpskey
, 
tdskeyp
->
da
,dskeyp->
size
);

1601 i((
t
 = 
	`__dbc_g
(
sdbc
,

1602 &
mpskey
, &
mkey
, 
rmw
 | 
DB_GET_BOTH
)) == 0)

1603 
t
 = 
	`__dbc_d
(
sdbc
, 
DB_UPDATE_SECONDARY
);

1604 i(
t
 =
DB_NOTFOUND
)

1605 
t
 = 
	`__db_cdy_cru
(
dbp
);

1606 
	`SWAP_IF_NEEDED
(
sdbp
, 
pkey
);

1607 
	`FREE_IF_NEEDED
(
dbv
, 
tdskeyp
);

1610 
r
: ; 
ndskey
 > 0;dskey--, 
tdskeyp
++)

1611 
	`FREE_IF_NEEDED
(
dbv
, 
tdskeyp
);

1612 
	`FREE_IF_NEEDED
(
dbv
, &
dskey
);

1613 i(
sdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(sdbc)!0 && 
t
 == 0)

1614 
t
 = 
t_t
;

1615 i(
t
 =0 && 
nme
 =
nskey
)

1616  (
DB_KEYEXIST
);

1617  (
t
);

1618 
	}
}

1626 
	$__db_du
(
dbp
, 
ags
)

1627 
DB
 *
dbp
;

1628 
u_t32_t
 
ags
;

1643 i(
ags
 !
DB_NODUPDATA
 && !
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
))

1644 
	`__db_rx
(
dbp
->
dbv
,

1646  (
DB_KEYEXIST
);

1647 
	}
}

1654 
	$__dbc_nup
(
dbc
, 
dbc_n
, 
ed
)

1655 
DBC
 *
dbc
, *
dbc_n
;

1656 
ed
;

1658 
DB
 *
dbp
;

1659 
DBC
 *
d
;

1660 
DBC_INTERNAL
 *

;

1661 
DB_MPOOLFILE
 *
mpf
;

1662 
t
, 
t_t
;

1664 
dbp
 = 
dbc
->dbp;

1665 
mpf
 = 
dbp
->mpf;

1666 

 = 
dbc
->internal;

1667 
t
 = 0;

1670 i(

->
ge
 !
NULL
) {

1671 i((
t_t
 = 
	`__memp_ut
(
mpf
,

1672 

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

1673 
t
 = 
t_t
;

1674 

->
ge
 = 
NULL
;

1676 
d
 = 

->opd;

1677 i(
d
 !
NULL
 && opd->

->
ge
 != NULL) {

1678 i((
t_t
 = 
	`__memp_ut
(
mpf
,

1679 
d
->

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

1680 
t
 = 
t_t
;

1681 
d
->

->
ge
 = 
NULL
;

1698 i(
dbc_n
 =
NULL
 || 
dbc
 == dbc_n)

1699  (
t
);

1701 i(
dbc_n
->

->
ge
 !
NULL
) {

1702 i((
t_t
 = 
	`__memp_ut
(
mpf
,

1703 
dbc_n
->

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

1704 
t
 = 
t_t
;

1705 
dbc_n
->

->
ge
 = 
NULL
;

1707 
d
 = 
dbc_n
->

->opd;

1708 i(
d
 !
NULL
 && opd->

->
ge
 != NULL) {

1709 i((
t_t
 = 
	`__memp_ut
(
mpf
,

1710 
d
->

->
ge
, 
dbc
->
iܙy
)!0 && 
t
 == 0)

1711 
t
 = 
t_t
;

1712 
d
->

->
ge
 = 
NULL
;

1720 i(!
ed
 && 
t
 == 0) {

1721 
dbc
->

 = 
dbc_n
->internal;

1722 
dbc_n
->

 = internal;

1740 i((
t_t
 = 
	`__dbc_o
(
dbc_n
)!0 && 
t
 == 0)

1741 
t
 = 
t_t
;

1750 i(
	`F_ISSET
(
dbp
, 
DB_AM_READ_UNCOMMITTED
) &&

1751 
dbc
->

->
lock_mode
 =
DB_LOCK_WRITE
) {

1752 i((
t_t
 =

1753 
	`__TLPUT
(
dbc
, dbc->

->
lock
)!0 && 
t
 == 0)

1754 
t
 = 
t_t
;

1755 i(
t_t
 == 0)

1756 
dbc
->

->
lock_mode
 = 
DB_LOCK_WWRITE
;

1759  (
t
);

1760 
	}
}

1770 
	$__dbc_cdy_g_
(
dbc
, 
skey
, 
da
, 
ags
)

1771 
DBC
 *
dbc
;

1772 
DBT
 *
skey
, *
da
;

1773 
u_t32_t
 
ags
;

1775 
	`DB_ASSERT
(
dbc
->
dbp
->
dbv
, 
	`F_ISSET
(dbc->dbp, 
DB_AM_SECONDARY
));

1776  (
	`__dbc_pg_
(
dbc
, 
skey
, 
NULL
, 
da
, 
ags
));

1777 
	}
}

1786 
	$__dbc_pg
(
dbc
, 
skey
, 
pkey
, 
da
, 
ags
)

1787 
DBC
 *
dbc
;

1788 
DBT
 *
skey
, *
pkey
, *
da
;

1789 
u_t32_t
 
ags
;

1791 
DB
 *
pdbp
, *
sdbp
;

1792 
DBC
 *
dbc_n
, *
pdbc
;

1793 
DBT
 
nupkey
;

1794 
u_t32_t
 
ve_pkey_ags
, 
tmp_ags
, 
tmp_ad_uncommd
, 
tmp_rmw
;

1795 
pkeymloc
, 
t
, 
t_t
;

1797 
sdbp
 = 
dbc
->
dbp
;

1798 
pdbp
 = 
sdbp
->
s_imy
;

1799 
dbc_n
 = 
NULL
;

1800 
pkeymloc
 = 
t_t
 = 0;

1814 i(
pkey
 =
NULL
) {

1815 
	`memt
(&
nupkey
, 0, (
DBT
));

1816 
pkey
 = &
nupkey
;

1820 
tmp_rmw
 = 
	`LF_ISSET
(
DB_RMW
);

1821 
	`LF_CLR
(
DB_RMW
);

1823 
tmp_ad_uncommd
 =

1824 
	`LF_ISSET
(
DB_READ_UNCOMMITTED
) &&

1825 !
	`F_ISSET
(
dbc
, 
DBC_READ_UNCOMMITTED
);

1826 
	`LF_CLR
(
DB_READ_UNCOMMITTED
);

1833 i(
ags
 =
DB_GET_RECNO
) {

1834 i(
tmp_rmw
)

1835 
	`F_SET
(
dbc
, 
DBC_RMW
);

1836 i(
tmp_ad_uncommd
)

1837 
	`F_SET
(
dbc
, 
DBC_READ_UNCOMMITTED
);

1838 
t
 = 
	`__dbc_pg_o
(
dbc
, 
pkey
, 
da
, 
ags
);

1839 i(
tmp_rmw
)

1840 
	`F_CLR
(
dbc
, 
DBC_RMW
);

1841 i(
tmp_ad_uncommd
)

1842 
	`F_CLR
(
dbc
, 
DBC_READ_UNCOMMITTED
);

1843  (
t
);

1880 
ve_pkey_ags
 = 
pkey
->
ags
;

1881 
	`F_CLR
(
pkey
, 
DB_DBT_PARTIAL
);

1890 
ags
) {

1891 
DB_CURRENT
:

1892 
DB_GET_BOTHC
:

1893 
DB_NEXT
:

1894 
DB_NEXT_DUP
:

1895 
DB_NEXT_NODUP
:

1896 
DB_PREV
:

1897 
DB_PREV_DUP
:

1898 
DB_PREV_NODUP
:

1899 
tmp_ags
 = 
DB_POSITION
;

1902 
tmp_ags
 = 0;

1906 i((
t
 = 
	`__dbc_dup
(
dbc
, &
dbc_n
, 
tmp_ags
)) != 0)

1907  (
t
);

1909 
	`F_SET
(
dbc_n
, 
DBC_TRANSIENT
);

1911 i(
tmp_rmw
)

1912 
	`F_SET
(
dbc_n
, 
DBC_RMW
);

1913 i(
tmp_ad_uncommd
)

1914 
	`F_SET
(
dbc_n
, 
DBC_READ_UNCOMMITTED
);

1920 i(
ags
 =
DB_GET_BOTH
 || fg=
DB_GET_BOTHC
 ||

1921 
ags
 =
DB_GET_BOTH_RANGE
)

1922 
	`SWAP_IF_NEEDED
(
sdbp
, 
pkey
);

1924 
y
:

1925 
dbc_n
->
rda
 = 
dbc
->
rkey
;

1926 
dbc_n
->
rkey
 = 
dbc
->
rskey
;

1927 
t
 = 
	`__dbc_g
(
dbc_n
, 
skey
, 
pkey
, 
ags
);

1929 
pkey
->
ags
 = 
ve_pkey_ags
;

1936 i(
t
 =0 || 
ags
 =
DB_GET_BOTH
 || fg=
DB_GET_BOTHC
 ||

1937 
ags
 =
DB_GET_BOTH_RANGE
)

1938 
	`SWAP_IF_NEEDED
(
sdbp
, 
pkey
);

1940 i(
t
 != 0)

1941 
r
;

1965 i((
t
 = 
	`__db_curs_t
(
pdbp
,

1966 
dbc
->
txn
, 
pdbp
->
ty
, 
PGNO_INVALID
, 0, dbc->
lock
, &
pdbc
)) != 0)

1967 
r
;

1969 i(
tmp_ad_uncommd
 || 
	`F_ISSET
(
dbc
, 
DBC_READ_UNCOMMITTED
))

1970 
	`F_SET
(
pdbc
, 
DBC_READ_UNCOMMITTED
);

1971 i(
tmp_rmw
 || 
	`F_ISSET
(
dbc
, 
DBC_RMW
))

1972 
	`F_SET
(
pdbc
, 
DBC_RMW
);

1973 i(
	`F_ISSET
(
dbc
, 
DBC_READ_COMMITTED
))

1974 
	`F_SET
(
pdbc
, 
DBC_READ_COMMITTED
);

1992 i(
	`F_ISSET
(
pkey
, 
DB_DBT_MALLOC
)) {

1993 
	`F_CLR
(
pkey
, 
DB_DBT_MALLOC
);

1994 
	`F_SET
(
pkey
, 
DB_DBT_REALLOC
);

1995 
pkeymloc
 = 1;

1996 } i(
	`F_ISSET
(
pkey
, 
DB_DBT_USERCOPY
) &&

1997 (
t
 = 
	`__dbt_urcy
(
sdbp
->
dbv
, 
pkey
)) != 0)

1998 
r
;

2005 
	`F_SET
(
pdbc
, 
DBC_TRANSIENT
);

2006 
	`SET_RET_MEM
(
pdbc
, 
dbc
);

2007 
t
 = 
	`__dbc_g
(
pdbc
, 
pkey
, 
da
, 
DB_SET
);

2016 i((
t_t
 = 
	`__dbc_o
(
pdbc
)!0 && 
t
 == 0)

2017 
t
 = 
t_t
;

2019 i(
t
 =
DB_NOTFOUND
) {

2020 i(!
	`F_ISSET
(
pdbc
, 
DBC_READ_UNCOMMITTED
))

2021 
t
 = 
	`__db_cdy_cru
(
pdbp
);

2022 
ags
) {

2023 
DB_GET_BOTHC
:

2024 
DB_NEXT
:

2025 
DB_NEXT_DUP
:

2026 
DB_NEXT_NODUP
:

2027 
DB_PREV
:

2028 
DB_PREV_DUP
:

2029 
DB_PREV_NODUP
:

2030 
y
;

2036 
r
:

2037 i((
t_t
 = 
	`__dbc_nup
(
dbc
, 
dbc_n
, 
t
)) != 0 &&et == 0)

2038 
t
 = 
t_t
;

2039 i(
pkeymloc
) {

2046 
	`F_CLR
(
pkey
, 
DB_DBT_REALLOC
);

2047 
	`F_SET
(
pkey
, 
DB_DBT_MALLOC
);

2050  (
t
);

2051 
	}
}

2060 
	$__dbc_pg_o
(
sdbc
, 
pkey
, 
da
, 
ags
)

2061 
DBC
 *
sdbc
;

2062 
DBT
 *
pkey
, *
da
;

2063 
u_t32_t
 
ags
;

2065 
DB
 *
pdbp
, *
sdbp
;

2066 
DB_ENV
 *
dbv
;

2067 
DBC
 *
pdbc
;

2068 
DBT
 
disrdme
, 
imy_key
;

2069 
db_o_t
 
oob
;

2070 
u_t32_t
 
rmw
;

2071 
t
, 
t_t
;

2073 
sdbp
 = 
sdbc
->
dbp
;

2074 
pdbp
 = 
sdbp
->
s_imy
;

2075 
dbv
 = 
sdbp
->dbenv;

2076 
pdbc
 = 
NULL
;

2077 
t
 = 
t_t
 = 0;

2079 
rmw
 = 
	`LF_ISSET
(
DB_RMW
);

2081 
	`memt
(&
disrdme
, 0, (
DBT
));

2082 
	`F_SET
(&
disrdme
, 
DB_DBT_USERMEM
 | 
DB_DBT_PARTIAL
);

2084 
oob
 = 
RECNO_OOB
;

2092 i(
	`F_ISSET
(
pdbp
, 
DB_AM_RECNUM
)) {

2097 
	`memt
(&
imy_key
, 0, (
DBT
));

2098 
	`F_SET
(&
imy_key
, 
DB_DBT_MALLOC
);

2099 i((
t
 = 
	`__dbc_g
(
sdbc
,

2100 &
disrdme
, &
imy_key
, 
rmw
 | 
DB_CURRENT
)) != 0)

2101  (
t
);

2112 i((
t
 = 
	`__db_curs_t
(
pdbp
, 
sdbc
->
txn
,

2113 
pdbp
->
ty
, 
PGNO_INVALID
, 0, 
sdbc
->
lock
, &
pdbc
)) != 0)

2114 

;

2115 
	`SET_RET_MEM
(
pdbc
, 
sdbc
);

2116 i((
t
 = 
	`__dbc_g
(
pdbc
,

2117 &
imy_key
, &
disrdme
, 
rmw
 | 
DB_SET
)) != 0)

2118 

;

2120 
t
 = 
	`__dbc_g
(
pdbc
, &
disrdme
, 
da
, 
rmw
 | 
DB_GET_RECNO
);

2122 

: 
	`__os_u
(
sdbp
->
dbv
, 
imy_key
.
da
);

2123 i(
pdbc
 !
NULL
 &&

2124 (
t_t
 = 
	`__dbc_o
(
pdbc
)!0 && 
t
 == 0)

2125 
t
 = 
t_t
;

2126 i(
t
 != 0)

2127  (
t
);

2128 } i((
t
 = 
	`__db_tcy
(
dbv
, 
da
, &
oob
,

2129 (
oob
), &
sdbc
->
rkey
->
da
, &sdbc->rkey->
un
)) != 0)

2130  (
t
);

2138 i(
	`F_ISSET
(
sdbp
, 
DB_AM_RECNUM
))

2139  (
	`__dbc_g
(
sdbc
, &
disrdme
, 
pkey
, 
ags
));

2141  (
	`__db_tcy
(
dbv
, 
pkey
, &
oob
,

2142 (
oob
), &
sdbc
->
rda
->
da
, &sdbc->rda->
un
));

2143 
	}
}

2149 
	$__db_wock_r
(
dbv
)

2150 
DB_ENV
 *
dbv
;

2152 
	`__db_rx
(
dbv
, "Writettempted onead-only cursor");

2153  (
EPERM
);

2154 
	}
}

2167 
	$__dbc_d_cdy
(
dbc
)

2168 
DBC
 *
dbc
;

2170 
DB_ENV
 *
dbv
;

2171 
DB
 *
pdbp
;

2172 
DBC
 *
pdbc
;

2173 
DBT
 
skey
, 
pkey
;

2174 
t
, 
t_t
;

2175 
u_t32_t
 
rmw
;

2177 
pdbp
 = 
dbc
->
dbp
->
s_imy
;

2178 
dbv
 = 
pdbp
->dbenv;

2179 
rmw
 = 
	`STD_LOCKING
(
dbc
? 
DB_RMW
 : 0;

2186 
	`memt
(&
skey
, 0, (
DBT
));

2187 
	`memt
(&
pkey
, 0, (
DBT
));

2188 
	`F_SET
(&
skey
, 
DB_DBT_PARTIAL
 | 
DB_DBT_USERMEM
);

2189 i((
t
 = 
	`__dbc_g
(
dbc
, &
skey
, &
pkey
, 
DB_CURRENT
)) != 0)

2190  (
t
);

2192 
	`SWAP_IF_NEEDED
(
dbc
->
dbp
, &
pkey
);

2204 i((
t
 = 
	`__db_curs_t
(
pdbp
, 
dbc
->
txn
,

2205 
pdbp
->
ty
, 
PGNO_INVALID
, 0, 
dbc
->
lock
, &
pdbc
)) != 0)

2206  (
t
);

2214 i(
	`CDB_LOCKING
(
dbv
)) {

2215 
	`DB_ASSERT
(
dbv
, 
pdbc
->
mylock
.
off
 =
LOCK_INVALID
);

2216 
	`F_SET
(
pdbc
, 
DBC_WRITER
);

2228 i((
t
 = 
	`__dbc_g
(
pdbc
, &
pkey
, &
skey
, 
DB_SET
 | 
rmw
)) == 0)

2229 
t
 = 
	`__dbc_d
(
pdbc
, 0);

2230 i(
t
 =
DB_NOTFOUND
)

2231 
t
 = 
	`__db_cdy_cru
(
pdbp
);

2233 i((
t_t
 = 
	`__dbc_o
(
pdbc
)!0 && 
t
 == 0)

2234 
t
 = 
t_t
;

2236  (
t
);

2237 
	}
}

2249 
	$__dbc_d_imy
(
dbc
)

2250 
DBC
 *
dbc
;

2252 
DB_ENV
 *
dbv
;

2253 
DB
 *
dbp
, *
sdbp
;

2254 
DBC
 *
sdbc
;

2255 
DBT
 *
tskeyp
;

2256 
DBT
 
da
, 
pkey
, 
skey
, 
mkey
, 
mpskey
;

2257 
u_t32_t
 
nskey
, 
rmw
;

2258 
t
, 
t_t
;

2260 
dbp
 = 
dbc
->dbp;

2261 
dbv
 = 
dbp
->dbenv;

2262 
rmw
 = 
	`STD_LOCKING
(
dbc
? 
DB_RMW
 : 0;

2270 
	`memt
(&
pkey
, 0, (
DBT
));

2271 
	`memt
(&
da
, 0, (
DBT
));

2272 i((
t
 = 
	`__dbc_g
(
dbc
, &
pkey
, &
da
, 
DB_CURRENT
)) != 0)

2273  (
t
);

2275 
	`memt
(&
skey
, 0, (
DBT
));

2276 
t
 = 
	`__db_s_f
(
dbp
, &
sdbp
);

2277 
sdbp
 !
NULL
 && 
t
 == 0;

2278 
t
 = 
	`__db_s_xt
(&
sdbp
, 
dbc
->
txn
)) {

2283 i((
t
 = 
sdbp
->
	`s_back
(sdbp, &
pkey
, &
da
, &
skey
)) != 0) {

2288 i(
t
 =
DB_DONOTINDEX
)

2292 
r
;

2295 #ifde
DIAGNOSTIC


2296 i(
	`F_ISSET
(&
skey
, 
DB_DBT_MULTIPLE
))

2297 
	`__db_check_skeyt
(
sdbp
, &
skey
);

2301 i((
t
 = 
	`__db_curs_t
(
sdbp
, 
dbc
->
txn
, sdbp->
ty
,

2302 
PGNO_INVALID
, 0, 
dbc
->
lock
, &
sdbc
)) != 0)

2303 
r
;

2305 i(
	`CDB_LOCKING
(
dbv
)) {

2306 
	`DB_ASSERT
(
dbv
, 
sdbc
->
mylock
.
off
 =
LOCK_INVALID
);

2307 
	`F_SET
(
sdbc
, 
DBC_WRITER
);

2310 i(
	`F_ISSET
(&
skey
, 
DB_DBT_MULTIPLE
)) {

2311 
tskeyp
 = (
DBT
 *)
skey
.
da
;

2312 
nskey
 = 
skey
.
size
;

2314 
tskeyp
 = &
skey
;

2315 
nskey
 = 1;

2318 ; 
nskey
 > 0;skey--, 
tskeyp
++) {

2332 
	`DB_INIT_DBT
(
mpskey
, 
tskeyp
->
da
,skeyp->
size
);

2333 
	`SWAP_IF_NEEDED
(
sdbp
, &
pkey
);

2334 
	`DB_INIT_DBT
(
mkey
, 
pkey
.
da
,key.
size
);

2335 i((
t
 = 
	`__dbc_g
(
sdbc
, &
mpskey
, &
mkey
,

2336 
DB_GET_BOTH
 | 
rmw
)) == 0)

2337 
t
 = 
	`__dbc_d
(
sdbc
, 
DB_UPDATE_SECONDARY
);

2338 i(
t
 =
DB_NOTFOUND
)

2339 
t
 = 
	`__db_cdy_cru
(
dbp
);

2340 
	`SWAP_IF_NEEDED
(
sdbp
, &
pkey
);

2341 
	`FREE_IF_NEEDED
(
dbv
, 
tskeyp
);

2344 i((
t_t
 = 
	`__dbc_o
(
sdbc
)!0 && 
t
 == 0)

2345 
t
 = 
t_t
;

2346 i(
t
 != 0)

2347 
r
;

2356 
	`FREE_IF_NEEDED
(
dbv
, &
skey
);

2359 
r
: i(
sdbp
 !
NULL
 &&

2360 (
t_t
 = 
	`__db_s_de
(
sdbp
, 
dbc
->
txn
)!0 && 
t
 == 0)

2361 
t
 = 
t_t
;

2362 
	`FREE_IF_NEEDED
(
dbv
, &
skey
);

2363  (
t
);

2364 
	}
}

2373 
	$__db_s_f
(
pdbp
, 
sdb
)

2374 
DB
 *
pdbp
, **
sdb
;

2376 
DB
 *
sdbp
;

2378 
	`MUTEX_LOCK
(
pdbp
->
dbv
,dbp->
mux
);

2379 
sdbp
 = 
	`LIST_FIRST
(&
pdbp
->
s_cds
);

2382 i(
sdbp
 !
NULL
)

2383 
sdbp
->
s_ft
++;

2384 
	`MUTEX_UNLOCK
(
pdbp
->
dbv
,dbp->
mux
);

2386 *
sdb
 = 
sdbp
;

2389 
	}
}

2398 
	$__db_s_xt
(
sdb
, 
txn
)

2399 
DB
 **
sdb
;

2400 
DB_TXN
 *
txn
;

2402 
DB_ENV
 *
dbv
;

2403 
DB
 *
sdbp
, *
pdbp
, *
ome
;

2404 
t
;

2429 
sdbp
 = *
sdb
;

2430 
pdbp
 = 
sdbp
->
s_imy
;

2431 
dbv
 = 
pdbp
->dbenv;

2432 
ome
 = 
NULL
;

2434 
	`MUTEX_LOCK
(
dbv
, 
pdbp
->
mux
);

2435 
	`DB_ASSERT
(
dbv
, 
sdbp
->
s_ft
 != 0);

2436 i(--
sdbp
->
s_ft
 == 0) {

2437 
	`LIST_REMOVE
(
sdbp
, 
s_lks
);

2438 
ome
 = 
sdbp
;

2440 
sdbp
 = 
	`LIST_NEXT
(sdbp, 
s_lks
);

2441 i(
sdbp
 !
NULL
)

2442 
sdbp
->
s_ft
++;

2443 
	`MUTEX_UNLOCK
(
dbv
, 
pdbp
->
mux
);

2445 *
sdb
 = 
sdbp
;

2450 i(
ome
 =
NULL
)

2451 
t
 = 0;

2452 i(
txn
 =
NULL
)

2453 
t
 = 
	`__db_o
(
ome
, 
NULL
, 0);

2455 
t
 = 
	`__txn_oevt
(
dbv
, 
txn
, 
ome
);

2457  (
t
);

2458 
	}
}

2468 
	$__db_s_de
(
sdbp
, 
txn
)

2469 
DB
 *
sdbp
;

2470 
DB_TXN
 *
txn
;

2472 
DB_ENV
 *
dbv
;

2473 
DB
 *
pdbp
;

2474 
doo
, 
t
;

2476 
pdbp
 = 
sdbp
->
s_imy
;

2477 
dbv
 = 
pdbp
->dbenv;

2478 
doo
 = 0;

2480 
	`MUTEX_LOCK
(
dbv
, 
pdbp
->
mux
);

2481 
	`DB_ASSERT
(
dbv
, 
sdbp
->
s_ft
 != 0);

2482 i(--
sdbp
->
s_ft
 == 0) {

2483 
	`LIST_REMOVE
(
sdbp
, 
s_lks
);

2484 
doo
 = 1;

2486 
	`MUTEX_UNLOCK
(
dbv
, 
pdbp
->
mux
);

2488 i(
doo
 == 0)

2489 
t
 = 0;

2490 i(
txn
 =
NULL
)

2491 
t
 = 
	`__db_o
(
sdbp
, 
NULL
, 0);

2493 
t
 = 
	`__txn_oevt
(
dbv
, 
txn
, 
sdbp
);

2494  (
t
);

2495 
	}
}

2502 
	$__db_s_cou
(
pdbp
)

2503 
DB
 *
pdbp
;

2505 
DB_ENV
 *
dbv
;

2506 
DB
 *
sdbp
;

2507 
cou
;

2509 
dbv
 = 
pdbp
->dbenv;

2510 
cou
 = 0;

2512 
	`MUTEX_LOCK
(
dbv
, 
pdbp
->
mux
);

2513 
sdbp
 = 
	`LIST_FIRST
(&
pdbp
->
s_cds
);

2514 
sdbp
 !
NULL
;

2515 
sdbp
 = 
	`LIST_NEXT
(sdbp, 
s_lks
))

2516 ++
cou
;

2517 
	`MUTEX_UNLOCK
(
dbv
, 
pdbp
->
mux
);

2519  (
cou
);

2520 
	}
}

2532 
	$__db_budl
(
dbp
, 
dc
, 
l
, 
wc
)

2533 
DB
 *
dbp
;

2534 
DBT
 *
dc
, *
l
, *
wc
;

2536 
DB_ENV
 *
dbv
;

2537 
u_t32_t
 
n
, 
nbys
;

2538 
u_t8_t
 *
buf
;

2539 
t
;

2541 
dbv
 = 
dbp
->dbenv;

2543 
	`DB_ASSERT
(
dbv
, 
	`F_ISSET
(
l
, 
DB_DBT_PARTIAL
));

2545 
	`memt
(
wc
, 0, (
DBT
));

2547 
nbys
 = 
	`__db_size
(
dc
->
size
, 
l
);

2548 
wc
->
size
 = 
nbys
;

2550 i((
t
 = 
	`__os_mloc
(
dbv
, 
nbys
, &
buf
)) != 0)

2551  (
t
);

2552 
wc
->
da
 = 
buf
;

2555 
	`memt
(
buf
,

2556 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? ((
BTREE
 *)dbp->
bt_
)->
_d
 :

2557 0, 
nbys
);

2560 
	`memy
(
buf
, 
dc
->
da
,

2561 
l
->
doff
 > 
dc
->
size
 ? oldrec->size :artial->doff);

2564 
	`memy
(
buf
 + 
l
->
doff
,tl->
da
,tl->
size
);

2567 
n
 = 
l
->
doff
 +tl->
dn
;

2568 i(
dc
->
size
 > 
n
)

2569 
	`memy
(
buf
 + 
l
->
doff
 +tl->
size
,

2570 (
u_t8_t
 *)
dc
->
da
 + 
n
, oldc->
size
 -en);

2573 
	}
}

2585 
u_t32_t


2586 
	$__db_size
(
nbys
, 
da
)

2587 
u_t32_t
 
nbys
;

2588 
DBT
 *
da
;

2605 i(
nbys
 < 
da
->
doff
 + da->
dn
)

2606  (
da
->
doff
 + da->
size
);

2608  (
nbys
 + 
da
->
size
 - da->
dn
);

2609 
	}
}

2611 #ifde
DIAGNOSTIC


2622 
	$__db_check_skeyt
(
sdbp
, 
skeyp
)

2623 
DB
 *
sdbp
;

2624 
DBT
 *
skeyp
;

2626 
DB_ENV
 *
dbv
;

2627 
DBT
 *
fkey
, *
ϡkey
, *
key1
, *
key2
;

2629 
dbv
 = 
sdbp
->dbenv;

2631 
fkey
 = (
DBT
 *)
skeyp
->
da
;

2632 
ϡkey
 = 
fkey
 + 
skeyp
->
size
;

2633 
key1
 = 
fkey
; key1 < 
ϡkey
; key1++)

2634 
key2
 = 
key1
 + 1; key2 < 
ϡkey
; key2++)

2635 
	`DB_ASSERT
(
dbv
,

2636 ((
BTREE
 *)
sdbp
->
bt_
)->
	`bt_com
(sdbp,

2637 
key1
, 
key2
) != 0);

2638 
	}
}

	@../db/db_cds.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

12 
	~"dbc/db_ge.h
"

13 
	~"dbc/db_am.h
"

14 
	~"dbc/lock.h
"

15 
	~"dbc/txn.h
"

17 
__cdsgroup_abt
 
__P
((
DB_TXN
 *
txn
));

18 
__cdsgroup_comm
 
__P
((
DB_TXN
 *
txn
, 
u_t32_t
 
ags
));

19 
__cdsgroup_disrd
 
__P
((
DB_TXN
 *
txn
, 
u_t32_t
 
ags
));

20 
u_t32_t
 
__cdsgroup_id
 
__P
((
DB_TXN
 *
txn
));

21 
__cdsgroup_nsup
 
__P
((
DB_ENV
 *
dbv
, cڡ *
mh
));

22 
__cdsgroup_e
 
__P
((
DB_TXN
 *
txn
, 
u_t8_t
 *
gid
));

23 
__cdsgroup_t_me
 
__P
((
DB_TXN
 *
txn
, cڡ *
me
));

24 
__cdsgroup_t_timeout


25 
__P
((
DB_TXN
 *
txn
, 
db_timeout_t
 
timeout
, 
u_t32_t
 
ags
));

32 
	$__cdsgroup_nsup
(
dbv
, 
mh
)

33 
DB_ENV
 *
dbv
;

34 cڡ *
mh
;

36 
	`__db_rx
(
dbv
, "CDS groupdn su܈%s", 
mh
);

37  (
DB_OPNOTSUP
);

38 
	}
}

40 
	$__cdsgroup_abt
(
txn
)

41 
DB_TXN
 *
txn
;

43  (
	`__cdsgroup_nsup
(
txn
->
mg
->
dbv
, "abort"));

44 
	}
}

46 
	$__cdsgroup_comm
(
txn
, 
ags
)

47 
DB_TXN
 *
txn
;

48 
u_t32_t
 
ags
;

50 
DB_ENV
 *
dbv
;

51 
DB_LOCKREQ
 
eq
;

52 
DB_LOCKER
 *
lock
;

53 
t
, 
t_t
;

55 
	`COMPQUIET
(
ags
, 0);

56 
dbv
 = 
txn
->
mg
->dbenv;

59 i(
txn
->
curss
 != 0) {

60 
	`__db_rx
(
dbv
, "CDS group hasctive cursors");

61  (
EINVAL
);

65 
eq
.

 = 
DB_LOCK_PUT_ALL
;

66 
eq
.
obj
 = 
NULL
;

67 
t
 = 
	`__lock_vec
(
dbv
, 
txn
->
lock
, 0, &
eq
, 1, 
NULL
);

69 
dbv
 = 
txn
->
mg
->dbenv;

70 
lock
 = 
txn
->locker;

71 
	`__os_
(
dbv
, 
txn
->
mg
);

72 
	`__os_
(
dbv
, 
txn
);

73 i((
t_t
 = 
	`__lock_id_
(
dbv
, 
lock
)!0 && 
t
 == 0)

74 
t
 = 
t_t
;

75  (
t
);

76 
	}
}

78 
	$__cdsgroup_disrd
(
txn
, 
ags
)

79 
DB_TXN
 *
txn
;

80 
u_t32_t
 
ags
;

82 
	`COMPQUIET
(
ags
, 0);

83  (
	`__cdsgroup_nsup
(
txn
->
mg
->
dbv
, "discard"));

84 
	}
}

86 
u_t32_t
 
	$__cdsgroup_id
(
txn
)

87 
DB_TXN
 *
txn
;

89  (
txn
->
txnid
);

90 
	}
}

92 
	$__cdsgroup_e
(
txn
, 
gid
)

93 
DB_TXN
 *
txn
;

94 
u_t8_t
 *
gid
;

96 
	`COMPQUIET
(
gid
, 
NULL
);

97  (
	`__cdsgroup_nsup
(
txn
->
mg
->
dbv
, "prepare"));

98 
	}
}

100 
	$__cdsgroup_t_me
(
txn
, 
me
)

101 
DB_TXN
 *
txn
;

102 cڡ *
me
;

104 
	`COMPQUIET
(
me
, 
NULL
);

105  (
	`__cdsgroup_nsup
(
txn
->
mg
->
dbv
, "set_name"));

106 
	}
}

108 
	$__cdsgroup_t_timeout
(
txn
, 
timeout
, 
ags
)

109 
DB_TXN
 *
txn
;

110 
db_timeout_t
 
timeout
;

111 
u_t32_t
 
ags
;

113 
	`COMPQUIET
(
timeout
, 0);

114 
	`COMPQUIET
(
ags
, 0);

115  (
	`__cdsgroup_nsup
(
txn
->
mg
->
dbv
, "set_timeout"));

116 
	}
}

125 
	$__cdsgroup_beg
(
dbv
, 
txp
)

126 
DB_ENV
 *
dbv
;

127 
DB_TXN
 **
txp
;

129 
DB_THREAD_INFO
 *

;

130 
DB_TXN
 *
txn
;

131 
t
;

133 
	`PANIC_CHECK
(
dbv
);

134 
	`ENV_ILLEGAL_BEFORE_OPEN
(
dbv
, "cdsgroup_begin");

135 i(!
	`CDB_LOCKING
(
dbv
))

136  (
	`__db_v_cfig
(
dbv
, "cdsgroup_beg", 
DB_INIT_CDB
));

138 
	`ENV_ENTER
(
dbv
, 

);

139 *
txp
 = 
txn
 = 
NULL
;

140 i((
t
 = 
	`__os_oc
(
dbv
, 1, (
DB_TXN
), &
txn
)) != 0)

141 
r
;

146 i((
t
 = 
	`__os_oc
(
dbv
, 1, (
DB_TXNMGR
), &
txn
->
mg
)) != 0)

147 
r
;

148 
txn
->
mg
->
dbv
 = dbenv;

150 i((
t
 = 
	`__lock_id
(
dbv
, &
txn
->
txnid
, &txn->
lock
)) != 0)

151 
r
;

153 
txn
->
ags
 = 
TXN_CDSGROUP
;

154 
txn
->
abt
 = 
__cdsgroup_abt
;

155 
txn
->
comm
 = 
__cdsgroup_comm
;

156 
txn
->
disrd
 = 
__cdsgroup_disrd
;

157 
txn
->
id
 = 
__cdsgroup_id
;

158 
txn
->
e
 = 
__cdsgroup_e
;

159 
txn
->
t_me
 = 
__cdsgroup_t_me
;

160 
txn
->
t_timeout
 = 
__cdsgroup_t_timeout
;

162 *
txp
 = 
txn
;

165 
r
: i(
txn
 !
NULL
) {

166 i(
txn
->
mg
 !
NULL
)

167 
	`__os_
(
dbv
, 
txn
->
mg
);

168 
	`__os_
(
dbv
, 
txn
);

171 
	`ENV_LEAVE
(
dbv
, 

);

172  (
t
);

173 
	}
}

	@../db/db_conv.c

41 
	~"db_cfig.h
"

43 
	~"db_t.h
"

44 
	~"dbc/yo.h
"

45 
	~"dbc/hmac.h
"

46 
	~"dbc/db_ge.h
"

47 
	~"dbc/db_sw.h
"

48 
	~"dbc/b.h
"

49 
	~"dbc/hash.h
"

50 
	~"dbc/log.h
"

51 
	~"dbc/qam.h
"

60 
	$__db_pg
(
dbv
, 
pg
, 

, 
cook
)

61 
DB_ENV
 *
dbv
;

62 
db_pgno_t
 
pg
;

63 *

;

64 
DBT
 *
cook
;

66 
DB
 
dummydb
, *
dbp
;

67 
DB_PGINFO
 *
pgfo
;

68 
DB_CIPHER
 *
db_ch
;

69 
DB_LSN
 
n_ud
;

70 
PAGE
 *
g
;

71 
size_t
 
sum_n
;

72 
is_hmac
, 
t
;

73 
u_t8_t
 *
chksum
;

75 
pgfo
 = (
DB_PGINFO
 *)
cook
->
da
;

76 
g
 = (
PAGE
 *)

;

78 
t
 = 
is_hmac
 = 0;

79 
chksum
 = 
NULL
;

80 
	`memt
(&
dummydb
, 0, (
DB
));

81 
dbp
 = &
dummydb
;

82 
dummydb
.
ags
 = 
pgfo
->flags;

83 
dummydb
.
pgsize
 = 
p