cscope.out   [plain text]


cscope 15 $HOME/berkeleydb/db-4.7.25/dist               0005133041
	@../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_com_isde
 
__P
((
DBC
 *, 
DBT
 *, 
PAGE
 *, *));

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

25 
__bam_mge
 
__P
((
DBC
 *,

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

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

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

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

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

31 
__bam_un_ovow
 
__P
((
DBC
 *,

32 
db_pgno_t
, db_pgno_t, 
DB_COMPACT
 *));

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

34 
__bam_un_ro_ge
 
__P
((
DBC
 *,

35 
PAGE
 *, 
u_t32_t
, 
DB_COMPACT
 *));

37 #ifde
HAVE_FTRUNCATE


38 
__bam__li
 
__P
((
DB
 *, 
DB_THREAD_INFO
 *, 
DB_TXN
 *));

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

40 
__bam_tup_li
 
__P
((
DB
 *, 
db_pgli_t
 *, 
u_t32_t
));

41 
__bam_un_
 
__P
((
DB
 *,

42 
DB_THREAD_INFO
 *, 
DB_TXN
 *, 
DB_COMPACT
 *));

45 
	#SAVE_START
 \

47 
ve_da
 = *
c_da
; \

48 
t
 = 
	`__db_tcy
(
v
, \

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

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

51 } 0)

	)

58 
	#RESTORE_START
 \

60 
c_da
->
com_ges_
 = \

61 
ve_da
.
com_ges_
; \

62 
c_da
->
com_vs
 = 
ve_da
.compact_levels; \

63 
c_da
->
com_un
 = 
ve_da
.compact_truncate; \

64 
t
 = 
	`__db_tcy
(
v
, &
cut
, \

65 
ve_t
.
da
, save_t.
size
, \

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

67 } 0)

	)

75 
	$__bam_com
(
dbp
, 

, 
txn
, 
t
, 

, 
c_da
, 
ags
, 
d
)

76 
DB
 *
dbp
;

77 
DB_THREAD_INFO
 *

;

78 
DB_TXN
 *
txn
;

79 
DBT
 *
t
, *

;

80 
DB_COMPACT
 *
c_da
;

81 
u_t32_t
 
ags
;

82 
DBT
 *
d
;

84 
DBC
 *
dbc
;

85 
DBT
 
cut
, 
ve_t
;

86 
DB_COMPACT
 
ve_da
;

87 
ENV
 *
v
;

88 
u_t32_t
 

;

89 
ddlock
, 
isde
, 
t
, 

, 
t_t
, 
txn_lol
;

91 #ifde
HAVE_FTRUNCATE


92 
db_pgli_t
 *
li
;

93 
db_pgno_t
 
ϡ_pgno
;

94 
u_t32_t
 
ms
, 
und
;

97 
v
 = 
dbp
->env;

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

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

101 
dbc
 = 
NULL
;

102 

 = 0;

103 
ddlock
 = 
isde
 = 
t
 = 

 = 0;

105 #ifde
HAVE_FTRUNCATE


106 
li
 = 
NULL
;

107 
ϡ_pgno
 = 0;

108 
ms
 = 
und
 = 0;

116 i(
t
 !
NULL
 && (
t
 = 
	`__db_tcy
(
v
,

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

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

119  (
t
);

121 i(
	`IS_DB_AUTO_COMMIT
(
dbp
, 
txn
))

122 
txn_lol
 = 1;

124 
txn_lol
 = 0;

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

126 
no_
;

127 i(
	`LF_ISSET
(
DB_FREELIST_ONLY
))

128 
	`LF_SET
(
DB_FREE_SPACE
);

130 #ifde
HAVE_FTRUNCATE


132 i(
txn_lol
 && (
t
 = 
	`__txn_beg
(
v
, 

, 
NULL
, &
txn
, 0)) != 0)

133 
r
;

135 i((
t
 = 
	`__db__un
(
dbp
, 

,

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

137 
	`LF_CLR
(
DB_FREE_SPACE
);

138 

;

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

143 
t
 = 0;

144 
	`LF_CLR
(
DB_FREE_SPACE
);

145 

;

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

149 i(
t
 =
EBUSY
)

150 
t
 = 0;

154 

: i(
txn_lol
) {

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

156 
t
 = 
t_t
;

157 
txn
 = 
NULL
;

159 i(
t
 != 0)

160 
r
;

163 
und
 = 
c_da
->
com_ges_und
;

164 i(
	`LF_ISSET
(
DB_FREELIST_ONLY
))

165 
de
;

175 
no_
:

176 

 = 
dbp
->
pgsize
 - 
SIZEOF_PAGE
;

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

178 

 *
c_da
->
com_f͔
;

179 

 /= 100;

182 

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

184 i(
c_da
->
com_ges
 == 0)

185 
c_da
->
com_ges
 = 
DB_MAX_PAGES
;

188 
ddlock
 = 0;

190 
SAVE_START
;

191 i(
t
 != 0)

194 i(
txn_lol
) {

195 i((
t
 = 
	`__txn_beg
(
v
, 

, 
NULL
, &
txn
, 0)) != 0)

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

199 (
t
 = 
	`__txn_t_timeout
(
txn
,

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

201 
r
;

204 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 0)) != 0)

205 
r
;

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

, 

,

208 &

, 
c_da
, &
isde
)) ==

209 
DB_LOCK_DEADLOCK
 && 
txn_lol
) {

215 
ddlock
 = 1;

216 
c_da
->
com_ddlock
++;

217 
RESTORE_START
;

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

221 
t
 = 
t_t
;

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

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

225 
t
 = 
	`__txn_comm
(
txn
, 
DB_TXN_NOSYNC
);

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

227 
t
 = 
t_t
;

228 
txn
 = 
NULL
;

230 } 
t
 =0 && !
isde
);

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

233 
t
 = 
	`__db_tcy
(
v
, 
d
, 
cut
.
da
, cut.
size
,

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

235 i(
cut
.
da
 !
NULL
)

236 
	`__os_
(
v
, 
cut
.
da
);

237 i(
ve_t
.
da
 !
NULL
)

238 
	`__os_
(
v
, 
ve_t
.
da
);

240 #ifde
HAVE_FTRUNCATE


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

248 
DBMETA
 *
ma
;

249 
db_pgno_t
 
pgno
;

251 
pgno
 = 
PGNO_BASE_MD
;

252 
isde
 = 1;

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

254 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
, 

, 
txn
, 0, &
ma
)) == 0) {

255 
isde
 = 
ma
->

 =
PGNO_INVALID
;

256 
t
 = 
	`__memp_ut
(
dbp
->
mpf
, 

, 
ma
, dbp->
iܙy
);

259 i(!
isde
)

260 
t
 = 
	`__bam_un_
(
dbp
, 

, 
txn
, 
c_da
);

263 i(
li
 !
NULL
)

264 
	`__os_
(
v
, 
li
);

266 i((
t_t
 =

267 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
, 

, 
txn
, 0, &
ma
)) == 0) {

268 
c_da
->
com_ges_und
 =

269 
und
 + 
ϡ_pgno
 - 
ma
->last_pgno;

270 i((
t_t
 = 
	`__memp_ut
(
dbp
->
mpf
, 

,

271 
ma
, 
dbp
->
iܙy
)!0 && 
t
 == 0)

272 
t
 = 
t_t
;

273 } i(
t
 == 0)

274 
t
 = 
t_t
;

276 i((
t_t
 =

277 
	`__bam__li
(
dbp
, 

, 
txn
)!0 && 
t
 == 0)

278 
t_t
 = 
t
;

282  (
t
);

283 
	}
}

290 
	#CS_READ
 0

	)

291 
	#CS_PARENT
 1

	)

292 
	#CS_NEXT
 2

	)

293 
	#CS_NEXT_WRITE
 3

	)

294 
	#CS_DEL
 4

	)

295 
	#CS_START
 5

	)

296 
	#CS_GETRECNO
 0x80

	)

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

300 
DBC
 *
dbc
;

301 
DBT
 *
t
;

302 
u_t32_t
 
sag
;

303 
v
;

305 
BTREE_CURSOR
 *

;

306 
n_ud
, 
t
;

308 

 = (
BTREE_CURSOR
 *)
dbc
->

;

310 i(
dbc
->
dbty
 =
DB_RECNO
) {

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

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

314 

->
o
 = 1;

315 i((
t
 =

316 
	`__m_gno
(
dbc
, 
t
, &

->
o
, 0)) != 0)

317  (
t
);

318 
	`FLD_CLR
(
sag
, 
CS_GETRECNO
);

320 
sag
) {

321 
CS_READ
:

322 
sag
 = 
SR_READ
;

324 
CS_NEXT
:

325 
sag
 = 
SR_PARENT
 | 
SR_READ
;

327 
CS_START
:

328 
v
 = 
LEAFLEVEL
;

330 
CS_DEL
:

331 
CS_NEXT_WRITE
:

332 
sag
 = 
SR_STACK
;

334 
CS_PARENT
:

335 
sag
 = 
SR_PARENT
 | 
SR_WRITE
;

338  (
	`__v_nic
(
dbc
->
v
, 
EINVAL
));

340 i((
t
 = 
	`__bam_rch
(
dbc
,

341 &

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

342  (
t
);

344 

->
o
 -->
c
->
dx
;

346 
	`FLD_CLR
(
sag
, 
CS_GETRECNO
);

347 
sag
) {

348 
CS_READ
:

349 
sag
 = 
SR_READ
 | 
SR_DUPFIRST
;

351 
CS_DEL
:

352 
sag
 = 
SR_DEL
;

354 
CS_NEXT
:

355 
sag
 = 
SR_NEXT
;

357 
CS_NEXT_WRITE
:

358 
sag
 = 
SR_NEXT
 | 
SR_WRITE
;

360 
CS_START
:

361 
sag
 = 
SR_START
 | 
SR_WRITE
;

363 
CS_PARENT
:

364 
sag
 = 
SR_PARENT
 | 
SR_WRITE
;

367  (
	`__v_nic
(
dbc
->
v
, 
EINVAL
));

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

370 
	`FLD_SET
(
sag
, 
SR_MIN
);

372 i((
t
 = 
	`__bam_ch
(
dbc
,

373 

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

374  (
t
);

378 
	}
}

387 
	$__bam_com_t
(
dbc
, 
t
, 

, 

, 
p
, 
c_da
, 
dڕ
)

388 
DBC
 *
dbc
;

389 
DBT
 *
t
, *

;

390 
u_t32_t
 

;

391 *
p
;

392 
DB_COMPACT
 *
c_da
;

393 *
dڕ
;

395 
BTREE_CURSOR
 *

, *
n
;

396 
DB
 *
dbp
;

397 
DBC
 *
ndbc
;

398 
DB_LOCK
 
nock
;

399 
DB_MPOOLFILE
 *
dbmp
;

400 
ENV
 *
v
;

401 
EPG
 *
g
;

402 
PAGE
 *
pg
, *
g
, *
g
;

403 
db_pgno_t
 
gno
;

404 
db_o_t
 
xt_o
;

405 
u_t32_t
 
sag
;

406 
check_dups
, 
check_unc
, 
isde
, 
v
;

407 
mged
, 
ry
, 
xt_p
, 
pgs_de
, 
t
, 
t_t
, 
tde
;

409 #ifdef 
DEBUG


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

411 
DBT
 
__a
; \

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

413 
	`DEBUG_LWRITE
( \

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

415 } 0)

	)

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

417 
__buf
[32]; \

418 ()
	`tf
(
__buf
, \

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

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

421 } 0)

	)

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

	)

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

	)

427 
ndbc
 = 
NULL
;

428 
pg
 = 
NULL
;

429 
g
 = 
NULL
;

430 
isde
 = 0;

431 
tde
 = 0;

432 
pgs_de
 = 0;

433 
xt_o
 = 0;

434 
xt_p
 = 0;

435 
	`LOCK_INIT
(
nock
);

436 
check_unc
 = 
c_da
->
com_un
 !
PGNO_INVALID
;

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

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

440 
dbp
 = 
dbc
->dbp;

441 
v
 = 
dbp
->env;

442 
dbmp
 = 
dbp
->
mpf
;

443 

 = (
BTREE_CURSOR
 *)
dbc
->

;

446 i((
t
 = 
	`__bam_cch
(
dbc
,

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

449 i(
t
 =
DB_NOTFOUND
)

450 
t
 = 0;

451 
isde
 = 1;

452 
r
;

459 
pg
 = 

->
c
->
ge
;

460 

->
c
->
ge
 = 
NULL
;

461 
xt_o
 = 

->
o
;

462 
xt
:

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

480 
c_da
->
com_ges_exame
++;

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

484 i(
xt_p
 == 1 &&

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

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

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

488 
r
;

490 
xt_o
 +
	`NUM_ENT
(
pg
);

491 i(
	`P_FREESPACE
(
dbp
, 
pg
> 

 ||

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

494 i(

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

495 i((
t
 = 
	`__bam_com_isde
(
dbc
,

496 

, 
pg
, &
isde
)) != 0)

497 
r
;

498 i(
isde
)

499 
de
;

507 

->
o
 +
	`NUM_ENT
(
pg
);

508 
xt_p
 = 1;

509 
tde
 = 
pgs_de
;

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

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

512 
dbc
, &
pg
, 

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

513 
r
;

514 
gno
 = 
	`NEXT_PGNO
(
pg
);

515 i((
t
 = 
	`__memp_ut
(
dbmp
,

516 
dbc
->
thad_fo
, 
pg
, dbc->
iܙy
)) != 0)

517 
r
;

518 
pg
 = 
NULL
;

523 i((
t
 = 
	`__db_lg
(
dbc
,

524 
tde
 =
pgs_de
 ? 
LCK_COUPLE_ALWAYS
 : 
LCK_COUPLE
,

525 
gno
, 
DB_LOCK_READ
, 0, &

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

526 
r
;

527 i((
t
 = 
	`__memp_fg
(
dbmp
, &
gno
,

528 
dbc
->
thad_fo
, dbc->
txn
, 0, &
pg
)) != 0)

529 
r
;

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

543 
xt_p
 = 0;

545 i(
dbc
->
dbty
 =
DB_RECNO
) {

546 i((
t
 = 
	`__db_tcy
(
dbp
->
v
, 
t
,

547 &

->
o
, (cp->recno),

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

549 
r
;

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

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

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

553 
r
;

555 i(
gno
 =
PGNO_INVALID
) {

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

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

559 &
pg
, 

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

560 
r
;

561 
c_da
->
com_ges_exame
++;

562 
isde
 = 1;

563 
de
;

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

569 
r
;

570 i((
t
 = 
	`__LPUT
(
dbc
, 

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

571 
r
;

572 
	`BT_STK_CLR
(

);

573 
pg
 = 
NULL
;

597 i(
ry
 == 0) {

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

599 i(
xt_p
 == 1)

600 
sag
 = 
CS_NEXT_WRITE
;

602 
sag
 = 
CS_DEL
;

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

604 
r
;

606 
pg
 = 

->
c
->
ge
;

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

609 
gno
 = 
	`PGNO
(
pg
);

611 
gno
 = 
	`NEXT_PGNO
(
pg
);

613 i(
	`PGNO
(
pg
=

->
ro
)

614 
isde
 = 1;

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

617 
r
;

618 
c_da
->
com_ges_
++;

619 
xt_no_a
;

622 
xt_ge
;

626 i(*
p
) {

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

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

629 
r
;

630 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

631 
n
->
o
 = 
xt_o
;

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

639 
r
;

645 
v
 = 
	`LEVEL
(
n
->

->
ge
);

646 
sag
 = 
CS_START
;

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

648 
r
;

649 
pg
 = 

->
c
->
ge
;

651 *
p
 = 0;

659 i(
	`NUM_ENT
(
pg
) == 0 ||

660 (
dbc
->
dbty
 =
DB_RECNO
 &&

661 
	`NEXT_PGNO
(

->
c
->
ge
!
	`PGNO
(
n
->csp->page))) {

662 
gno
 = 
	`PGNO
(
pg
);

663 
xt_ge
;

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

667 
pgs_de
++;

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

670 
r1
;

672 i((
t
 = 
	`__memp_dty
(
dbp
->
mpf
, &
n
->
c
->
ge
,

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

674 
r1
;

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

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

677 &
n
->
c
->
ge
, 

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

678 
r1
;

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

682 
de
;

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

->
c
->
ge
,

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

686 
r1
;

687 
pg
 = 

->
c
->
ge
;

688 
gno
 = 
	`NEXT_PGNO
(
pg
);

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

690 i(
check_dups
 && (
t
 =

691 
	`__bam_com_dups
(
dbc
, &

->
c
->
ge
,

692 

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

693 
r1
;

701 i(
	`P_FREESPACE
(
dbp
, 
pg
<

 ||

702 

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

703 
xt_ge
;

708 
mged
 = 0;

709 
g
 = 

->

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

710 i(
	`PGNO
(
g
->
ge
=

->
ro
)

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

713 i((
t
 = 
	`__bam_mge_
(
dbc
,

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

715 
r1
;

716 i(
mged
)

721 i(
mged
) {

722 
pgs_de
++;

723 i(

->
c
->
ge
 =
NULL
)

724 
ded
;

725 
gno
 = 
	`PGNO
(
pg
);

726 
xt_ge
;

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

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

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

730 i((
t
 = 
	`__bam_mge
(
dbc
,

731 
ndbc
, 

, 

, 
c_da
, &
isde
)) != 0)

732 
r1
;

733 
pgs_de
++;

738 i(

->
c
->
ge
 =
NULL
)

739 
ded
;

740 

->
o
 +
	`NUM_ENT
(
pg
);

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

744 
gno
 = 
	`NEXT_PGNO
(
pg
);

745 
xt_ge
;

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

750 i((
t
 =

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

752 
r
;

754 
pg
 = 

->
c
->
ge
;

755 
gno
 = 
	`PGNO
(
pg
);

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

759 
xt_ge
;

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

->
c
->
ge
,

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

763 
r1
;

764 
pg
 = 

->
c
->
ge
;

766 
gno
 = 
	`NEXT_PGNO
(
pg
);

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

770 i(
check_dups
 && (
t
 =

771 
	`__bam_com_dups
(
dbc
, &

->
c
->
ge
,

772 

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

773 
r1
;

774 
pg
 = 

->
c
->
ge
;

777 i(
	`PGNO
(
pg
=

->
ro
)

778 
r1
;

779 
	`DB_ASSERT
(
v
, 

->
c
 - cp->

 == 1);

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

782 
pgs_de
++;

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

785 
r1
;

789 i(
	`P_FREESPACE
(
dbp
, 
pg
<

)

790 
xt_ge
;

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

794 
r1
;

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

796 
r1
;

797 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

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

807 !
isde
 && 
gno
 !
PGNO_INVALID
 &&

808 
	`P_FREESPACE
(
dbp
, 
pg
> 

 && 
c_da
->
com_ges
 != 0) {

817 i(

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

818 *
p
 = 1;

819 
gno
 = 
	`PGNO
(
pg
);

820 
xt_o
 = 

->
o
;

821 
xt_ge
;

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

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

827 
r1
;

828 i((
t
 = 
	`__memp_fg
(
dbmp
, &
gno
,

829 
dbc
->
thad_fo
, dbc->
txn
, 
DB_MPOOL_DIRTY
, &
g
)) != 0)

830 
r1
;

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

->
c
[-1].
ge
),

834 
dbc
->
thad_fo
, dbc->
txn
, 0, &
g
)) != 0)

835 
r1
;

836 
	`BT_STK_PUSH
(
v
, 
n
, 
g
,

837 

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

838 i(
t
 != 0)

839 
r1
;

842 
	`BT_STK_ENTER
(
v
, 
n
, 
g
, 0,->
lock
, 
DB_LOCK_WRITE
, 
t
);

844 
	`LOCK_INIT
(
n
->
lock
);

845 
g
 = 
NULL
;

847 
c_da
->
com_ges_exame
++;

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

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

851 &
n
->
c
->
ge
, 

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

852 
r1
;

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

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

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

860 i((
t
 = 
	`__bam_mge
(
dbc
,

861 
ndbc
, 

, 

, 
c_da
, &
isde
)) != 0)

862 
r1
;

864 
pgs_de
++;

870 i(

->
c
->
ge
 =
NULL
)

871 
ded
;

873 i(
gno
 !
	`NEXT_PGNO
(
pg
))

878 
gno
 = 
	`NEXT_PGNO
(
pg
);

879 

->
o
 +
	`NUM_ENT
(
pg
);

880 
xt_o
 = 

->
o
;

882 
xt_ge
:

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

884 
r1
;

885 i(
ndbc
 !
NULL
 &&

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

887 
r1
;

889 
xt_no_a
:

890 
pg
 = 
NULL
;

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

893 
isde
 = 1;

894 i(!
isde
) {

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

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

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

902 
r
;

903 *
dڕ
 = 0;

908 

->
o
 = 
xt_o
;

909 i((
t
 = 
	`__db_lg
(
dbc
,

910 
pgs_de
 ? 
LCK_COUPLE_ALWAYS
 : 
LCK_COUPLE
,

911 
gno
, 
DB_LOCK_READ
, 0, &

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

912 (
t
 = 
	`__memp_fg
(
dbmp
, &
gno
,

913 
dbc
->
thad_fo
, dbc->
txn
, 0, &
pg
)) != 0)

914 
r
;

915 
xt_p
 = 1;

916 
xt
;

919 
de
:

922 
r1
: 
pg
 = 
NULL
;

924 
r
:

928 
sag
 = 
STK_CLRDBC
;

929 i(
dbc
->
txn
 !
NULL
 && 
t
 != 0)

930 
sag
 |
STK_PGONLY
;

931 i(
dbc
 !
NULL
 &&

932 (
t_t
 = 
	`__bam_kl
(
dbc
, 
sag
)!0 && 
t
 == 0)

933 
t
 = 
t_t
;

934 i(
ndbc
 !
NULL
) {

935 i((
t_t
 = 
	`__bam_kl
(
ndbc
, 
sag
)!0 && 
t
 == 0)

936 
t
 = 
t_t
;

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

938 
t
 = 
t_t
;

941 i(
pg
 !
NULL
 && (
t_t
 =

942 
	`__memp_ut
(
dbmp
,

943 
dbc
->
thad_fo
, 
pg
, dbc->
iܙy
!0&& 
t
 == 0)

944 
t
 = 
t_t
;

945 i(
g
 !
NULL
 && (
t_t
 =

946 
	`__memp_ut
(
dbmp
,

947 
dbc
->
thad_fo
, 
g
, dbc->
iܙy
!0&& 
t
 == 0)

948 
t
 = 
t_t
;

950 *
dڕ
 = 
isde
;

952  (
t
);

953 
	}
}

959 
	$__bam_mge
(
dbc
, 
ndbc
, 

, 

, 
c_da
, 
dڕ
)

960 
DBC
 *
dbc
, *
ndbc
;

961 
u_t32_t
 

;

962 
DBT
 *

;

963 
DB_COMPACT
 *
c_da
;

964 *
dڕ
;

966 
BTREE_CURSOR
 *

, *
n
;

967 
DB
 *
dbp
;

968 
PAGE
 *
pg
, *
g
;

969 
db_dx_t
 

;

970 
t
;

972 
dbp
 = 
dbc
->dbp;

973 

 = (
BTREE_CURSOR
 *)
dbc
->

;

974 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

975 
pg
 = 

->
c
->
ge
;

976 
g
 = 
n
->
c
->
ge
;

978 

 = 
	`NUM_ENT
(
g
);

981 i(

 == 0)

982 
_ge
;

985 i(

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

986 i((
t
 = 
	`__bam_com_isde
(
dbc
, 

, 
g
, 
dڕ
)) != 0)

987  (
t
);

988 i(*
dڕ
)

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

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

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

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

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

)

1003 
t
 = 
	`__bam_mge_cds
(
dbc
, 
ndbc
, 

, 
c_da
);

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

1007  (
t
);

1008 
	}
}

1011 
	$__bam_mge_cds
(
dbc
, 
ndbc
, 

, 
c_da
)

1012 
DBC
 *
dbc
, *
ndbc
;

1013 
u_t32_t
 

;

1014 
DB_COMPACT
 *
c_da
;

1016 
BINTERNAL
 *
bi
;

1017 
BKEYDATA
 *
bk
, *
tmp_bk
;

1018 
BTREE
 *
t
;

1019 
BTREE_CURSOR
 *

, *
n
;

1020 
DB
 *
dbp
;

1021 
DBT
 
a
, 
b
, 
da
, 
hdr
;

1022 
ENV
 *
v
;

1023 
EPG
 *
g
;

1024 
PAGE
 *
pg
, *
g
;

1025 
db_dx_t
 
adj
, 
dx
, 

, *
np
, 
pd
;

1026 
t32_t
 
adju
;

1027 
u_t32_t
 
䓥a
, 
nksize
, 
p
, 
size
;

1028 
f_dup
, 
is_dup
, 
xt_dup
, 
n_ok
, 
t
;

1029 
	`size_t
 (*
func

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

1031 
dbp
 = 
dbc
->dbp;

1032 
v
 = 
dbp
->env;

1033 
t
 = 
dbp
->
bt_
;

1034 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1035 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

1036 
pg
 = 

->
c
->
ge
;

1037 
g
 = 
n
->
c
->
ge
;

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

1039 
pd
 = 
	`NUM_ENT
(
pg
);

1040 
n_ok
 = 0;

1041 
adju
 = 0;

1042 
t
 = 0;

1043 

 = 
	`NUM_ENT
(
g
);

1045 
	`DB_ASSERT
(
v
, 

 != 0);

1048 i(
c_da
->
com_un
 !
PGNO_INVALID
 &&

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

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

1052 
r
;

1055 
np
 = 
	`P_INP
(
dbp
, 
g
);

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

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

1067 
dx
 = 0; indx < 

; indx +
adj
) {

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

1071 
size
 = 
	`BITEM_PSIZE
(
bk
);

1074 i(
	`TYPE
(
pg
=
P_LBTREE
)

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

1080 
n_ok
 = 
adj
;

1081 i(
	`TYPE
(
pg
=
P_LBTREE
 &&

1082 
dx
 < 

 - 
adj
 &&

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

1086 
size
 +(
db_dx_t
);

1087 
n_ok
++;

1089 
size
 +
	`BITEM_PSIZE
(

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

1091 
n_ok
++;

1092 } 
dx
 + 
n_ok
 < 

 &&

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

1096 i(
䓥a
 < 
size
)

1104 i((
䓥a
 - 
size
< 

) {

1105 i(
䓥a
 - 

 > fa - (䓥a - 
size
))

1106 
dx
 +
n_ok
;

1109 
䓥a
 -
size
;

1110 
dx
 +
n_ok
 - 
adj
;

1114 i(
dx
 == 0)

1115 
de
;

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

1117 i(
dx
 =

)

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

1119 
no_check
;

1131 
p
 = 
dbp
->
pgsize
;

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

;pg--)

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

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

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

1137 i(
䓥a
 < 
p
)

1138 
p
 = 
䓥a
;

1139 i(
g
->
dx
 != 0)

1148 i(
dx
 =

) {

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

1150 
	`BINTERNAL_PSIZE
(
	`GET_BINTERNAL
(
dbp
,

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

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

1153 
dx
 -
adj
;

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

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

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

1158 i(
dbp
->
dup_com
 =
__bam_defcmp
)

1159 
func
 = 
__bam_defx
;

1161 
func
 = 
NULL
;

1163 
func
 = 
t
->
bt_efix
;

1165 
func
 = 
NULL
;

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

1169 
dx
 -
adj
;

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

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

1173 
nݻfix
;

1178 i(
func
 =
NULL
)

1179 
nݻfix
;

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

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

1182 
nݻfix
;

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

1184 
a
.
size
 = 
tmp_bk
->
n
;

1185 
a
.
da
 = 
tmp_bk
->data;

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

1187 
b
.
size
 = 
bk
->
n
;

1188 
b
.
da
 = 
bk
->data;

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

1190 i(
	`BINTERNAL_PSIZE
(
nksize
< 
p
)

1192 
nݻfix
:

1195 
dx
 -
adj
;

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

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

1206 i(
dx
 == 0)

1207 
de
;

1208 
	`DB_ASSERT
(
v
, 
dx
 <

);

1211 
no_check
: 
is_dup
 = 
f_dup
 = 
xt_dup
 = 0;

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

->
c
->
ge
,

1213 
dbc
->
thad_fo
, dbc->
txn
, dbc->
iܙy
, 0)) != 0 ||

1214 (
t
 = 
	`__memp_dty
(
dbp
->
mpf
, &
n
->
c
->
ge
,

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

1216 
r
;

1217 
pg
 = 

->
c
->
ge
;

1218 
g
 = 
n
->
c
->
ge
;

1219 
np
 = 
	`P_INP
(
dbp
, 
g
);

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

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

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

1225 i(!
is_dup
) {

1226 
f_dup
 = 1;

1227 
is_dup
 = 1;

1229 
f_dup
 = 0;

1231 
xt_dup
 = 1;

1232 } i(
xt_dup
) {

1233 
is_dup
 = 1;

1234 
f_dup
 = 0;

1235 
xt_dup
 = 0;

1237 
is_dup
 = 0;

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

1242 i((
t
 = 
	`__bam_adjdx
(
dbc
,

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

1244 
r
;

1245 i(!
xt_dup
)

1246 
is_dup
 = 0;

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

1248 
B_KEYDATA
:

1249 
hdr
.
da
 = 
bk
;

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

1251 
da
.
size
 = 
bk
->
n
;

1252 
da
.d
bk
->data;

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

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

1255 
r
;

1257 
B_OVERFLOW
:

1258 
B_DUPLICATE
:

1259 
da
.
size
 = 
BOVERFLOW_SIZE
;

1260 
da
.d
bk
;

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

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

1263 
r
;

1266 
	`__db_rx
(
v
,

1268 (
u_lg
)
	`PGNO
(
pg
));

1269 
t
 = 
EINVAL
;

1270 
r
;

1272 
pd
++;

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

1274 i((
t
 = 
	`__bam_adjdx
(
ndbc
,

1275 
g
, 0, 
O_INDX
, 0)) != 0)

1276 
r
;

1278 i((
t
 = 
	`__db_dem
(
ndbc
,

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

1280 
r
;

1282 
adju
++;

1283 } --
dx
 != 0);

1285 
	`DB_ASSERT
(
v
, 
	`NUM_ENT
(
g
) != 0);

1287 i(
adju
 != 0 &&

1288 (
	`F_ISSET
(

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

1289 
	`DB_ASSERT
(
v
, 

->
c
 - cp->

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

1290 i(
	`TYPE
(
pg
=
P_LBTREE
)

1291 
adju
 /
P_INDX
;

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

1293 
r
;

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

1296 
r
;

1300 i(
ndbc
->
dbty
 =
DB_BTREE
 &&

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

1302 
r
;

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

1306 
r
:  (
t
);

1307 
	}
}

1310 
	$__bam_mge_ges
(
dbc
, 
ndbc
, 
c_da
)

1311 
DBC
 *
dbc
, *
ndbc
;

1312 
DB_COMPACT
 *
c_da
;

1314 
BTREE_CURSOR
 *

, *
n
;

1315 
DB
 *
dbp
;

1316 
DBT
 
da
, 
hdr
;

1317 
DB_MPOOLFILE
 *
dbmp
;

1318 
PAGE
 *
pg
, *
g
;

1319 
db_dx_t
 

, *
np
, *
pp
;

1320 
db_pgno_t
 
gno
;

1321 
u_t8_t
 *
bp
;

1322 
u_t32_t
 
n
;

1323 
i
, 
v
, 
t
;

1325 
	`COMPQUIET
(
gno
, 
PGNO_INVALID
);

1326 
dbp
 = 
dbc
->dbp;

1327 
dbmp
 = 
dbp
->
mpf
;

1328 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1329 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

1330 
pg
 = 

->
c
->
ge
;

1331 
g
 = 
n
->
c
->
ge
;

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

1333 

 = 
	`NUM_ENT
(
g
);

1336 i(

 == 0)

1337 
_ge
;

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

->
c
->
ge
,

1340 
dbc
->
thad_fo
, dbc->
txn
, dbc->
iܙy
, 0)) != 0 ||

1341 (
t
 = 
	`__memp_dty
(
dbp
->
mpf
, &
n
->
c
->
ge
,

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

1343 
r
;

1344 
pg
 = 

->
c
->
ge
;

1345 
g
 = 
n
->
c
->
ge
;

1346 
	`DB_ASSERT
(
dbp
->
v
, 

 =
	`NUM_ENT
(
g
));

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

1350 i(
	`DBC_LOGGING
(
dbc
)) {

1351 
hdr
.
da
 = 
g
;

1352 
hdr
.
size
 = 
	`LOFFSET
(
dbp
, 
g
);

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

1354 
da
.
size
 = 
n
;

1355 i((
t
 = 
	`__bam_mge_log
(
dbp
,

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

1357 &
	`LSN
(
pg
), 
	`PGNO
(
g
), &LSNpg), &
hdr
, &
da
, 0)) != 0)

1358 
r
;

1360 
	`LSN_NOT_LOGGED
(
	`LSN
(
pg
));

1361 
	`LSN
(
g
LSN(
pg
);

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

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

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

1367 
np
 = 
	`P_INP
(
dbp
, 
g
);

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

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

1370 
	`HOFFSET
(
pg
-
n
;

1371 
	`NUM_ENT
(
pg
+
i
;

1373 
	`NUM_ENT
(
g
) = 0;

1374 
	`HOFFSET
(
g
+
n
;

1376 i(
	`F_ISSET
(

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

1377 
	`DB_ASSERT
(
dbp
->
v
, 

->
c
 - cp->

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

1378 i(
	`TYPE
(
pg
=
P_LBTREE
)

1379 
i
 /
P_INDX
;

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

1381 
r
;

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

1384 
r
;

1387 
_ge
:

1397 i(
	`PGNO
(
n
->

->
ge
=n->
ro
 &&

1398 
	`NUM_ENT
(
n
->

->
ge
) == 2) {

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

1400 
r
;

1401 
v
 = 
	`LEVEL
(
n
->

->
ge
);

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

1404 
v
 = 0;

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

1406 
c_da
->
com_un
--;

1407 i((
t
 = 
	`__bam_dges
(
ndbc
,

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

1409 
r
;

1410 
g
 = 
NULL
;

1411 
c_da
->
com_ges_
++;

1412 
c_da
->
com_ges
--;

1413 i(
v
 != 0) {

1414 i((
t
 = 
	`__memp_fg
(
dbmp
, &
n
->
ro
,

1415 
dbc
->
thad_fo
, dbc->
txn
, 0, &
g
)) != 0)

1416 
r
;

1417 i(
v
 =
	`LEVEL
(
g
))

1418 
v
 = 0;

1419 i((
t
 = 
	`__memp_ut
(
dbmp
,

1420 
dbc
->
thad_fo
, 
g
, dbc->
iܙy
)) != 0)

1421 
r
;

1422 
g
 = 
NULL
;

1423 i(
v
 != 0) {

1424 
c_da
->
com_vs
++;

1425 
c_da
->
com_ges_
++;

1426 i(
c_da
->
com_un
 > 
gno
)

1427 
c_da
->
com_un
--;

1428 i(
c_da
->
com_ges
 != 0)

1429 
c_da
->
com_ges
--;

1433 
r
:  (
t
);

1434 
	}
}

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

1442 
DBC
 *
dbc
, *
ndbc
;

1443 
v
;

1444 
DB_COMPACT
 *
c_da
;

1445 *
mged
;

1447 
BINTERNAL
 
bi
, *
b
, *
f
;

1448 
BTREE_CURSOR
 *

, *
n
;

1449 
DB
 *
dbp
;

1450 
DBT
 
da
, 
hdr
;

1451 
DB_MPOOLFILE
 *
dbmp
;

1452 
EPG
 *
g
, *
ve_c
, *
nve_c
;

1453 
PAGE
 *
pg
, *
g
;

1454 
RINTERNAL
 *
rk
;

1455 
db_dx_t
 
dx
, 
pd
;

1456 
db_pgno_t
 
gno
;

1457 
t32_t
 
ecs
;

1458 
u_t16_t
 
size
;

1459 
u_t32_t
 
䓥a
, 
p
;

1460 
t
;

1462 
	`COMPQUIET
(
b
, 
NULL
);

1463 
	`COMPQUIET
(
gno
, 
PGNO_INVALID
);

1472 
dbp
 = 
dbc
->dbp;

1473 
dbmp
 = 
dbp
->
mpf
;

1474 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1475 
n
 = (
BTREE_CURSOR
 *)
ndbc
->

;

1476 *
mged
 = 0;

1477 
t
 = 0;

1483 
ve_c
 = 

->
c
;

1484 

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

1485 
pg
 = 

->
c
->
ge
;

1486 
pd
 = 
	`NUM_ENT
(
pg
);

1488 
nve_c
 = 
n
->
c
;

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

1490 
g
 = 
n
->
c
->
ge
;

1491 
dx
 = 
	`NUM_ENT
(
g
);

1497 i(
g
 =
pg
)

1498 
de
;

1500 i((
t
 = 
	`__memp_dty
(
dbmp
, &

->
c
->
ge
,

1501 
dbc
->
thad_fo
, dbc->
txn
, dbc->
iܙy
, 0)) != 0 ||

1502 (
t
 = 
	`__memp_dty
(
dbmp
, &
n
->
c
->
ge
,

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

1504 
r
;

1505 
pg
 = 

->
c
->
ge
;

1506 
g
 = 
n
->
c
->
ge
;

1508 i(
	`TYPE
(
pg
=
P_IBTREE
) {

1513 i((
t
 =

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

1515 
r
;

1516 i((
t
 =

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

1518 
r
;

1527 
f
 = 
NULL
;

1528 i(
	`TYPE
(
pg
=
P_IBTREE
) {

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

1535 
g
 = 
n
->
c
;

1536 --
g
 >
n
->

 &&pg->
dx
 == 0)

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

1539 
g
 = 
n
->
c
;

1541 
dx
 = 0;;) {

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

1543 i(
size
 > 
䓥a
)

1545 
䓥a
 -
size
;

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

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

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

1553 
fs
;

1555 
p
 = 
dbp
->
pgsize
;

1556 
g
--;pg >
n
->

;pg--)

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

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

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

1561 i(
䓥a
 < 
p
)

1562 
p
 = 
䓥a
;

1563 i(
g
->
dx
 != 0)

1566 
g
 = 
n
->
c
;

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

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

1571 
fs
;

1572 
b
 =

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

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

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

1579 
dx
--;

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

1582 i(
dx
 == 0)

1583 
de
;

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

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

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

1589 
ecs
 = 0;

1596 i(
dbc
->
dbty
 =
DB_BTREE
) {

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

1598 
size
 = 
f
 =
NULL
 ?

1599 
	`BINTERNAL_SIZE
(
b
->
n
) :

1600 
	`BINTERNAL_SIZE
(
f
->
n
);

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

1604 i(
f
 =
NULL
) {

1605 
da
.
size
 = 
b
->
n
;

1606 
da
.d
b
->data;

1608 
da
.
size
 = 
f
->
n
;

1609 
da
.d
f
->data;

1611 
bi
.
n
 = 
da
.
size
;

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

1613 
bi
.
pgno
 = 
b
->pgno;

1614 
bi
.
ecs
 = 
b
->nrecs;

1615 
hdr
.
da
 = &
bi
;

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

1617 i(
	`F_ISSET
(

, 
C_RECNUM
|| F_ISSET(
dbc
, 
DBC_OPD
))

1618 
ecs
 +(
t32_t
)
b
->
ecs
;

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

1621 
size
 = 
RINTERNAL_SIZE
;

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

1625 
hdr
.
da
 = 
rk
;

1626 
hdr
.
size
 = size;

1627 
ecs
 +(
t32_t
)
rk
->
ecs
;

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

1630 
r
;

1631 
pd
++;

1632 i(
f
 !
NULL
) {

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

1635 
f
 = 
NULL
;

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

1638 
r
;

1639 *
mged
 = 1;

1640 } --
dx
 != 0);

1642 i(
c_da
->
com_un
 !
PGNO_INVALID
 &&

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

->
c
 !->

) {

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

1645 
r
;

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

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

) {

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

1651 
r
;

1654 i(!*
mged
)

1655 
de
;

1657 i(
ecs
 != 0) {

1658 
	`DB_ASSERT
(
dbp
->
v
, 

->
c
 - cp->

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

1659 

->
c
--;

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

1661 
r
;

1663 
n
->
c
--;

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

1665 
r
;

1666 
n
->
c
++;

1668 

->
c
 = 
ve_c
;

1679 i((
t
 = 
	`__memp_ut
(
dbmp
, 
dbc
->
thad_fo
,

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

1681 
r
;

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

1683 
r
;

1684 
nve_c
--;

1685 } 
nve_c
 !
n
->
c
);

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

1694 i(
	`PGNO
(
n
->

->
ge
=n->
ro
 &&

1695 
	`NUM_ENT
(
n
->

->
ge
) == 2) {

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

1697 
r
;

1698 
v
 = 
	`LEVEL
(
n
->

->
ge
);

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

1701 
v
 = 0;

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

1704 
c_da
->
com_un
--;

1705 
t
 = 
	`__bam_dges
(
ndbc
,

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

1707 
c_da
->
com_ges_
++;

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

1709 i((
t
 = 
	`__memp_fg
(
dbmp
, &
n
->
ro
,

1710 
dbc
->
thad_fo
, dbc->
txn
, 0, &
g
)) != 0)

1711 
r
;

1712 i(
v
 =
	`LEVEL
(
g
))

1713 
v
 = 0;

1714 i((
t
 = 
	`__memp_ut
(
dbmp
,

1715 
dbc
->
thad_fo
, 
g
, dbc->
iܙy
)) != 0)

1716 
r
;

1717 
g
 = 
NULL
;

1718 i(
v
 != 0) {

1719 
c_da
->
com_vs
++;

1720 
c_da
->
com_ges_
++;

1721 i(
c_da
->
com_un
 > 
gno
)

1722 
c_da
->
com_un
--;

1723 i(
c_da
->
com_ges
 != 0)

1724 
c_da
->
com_ges
--;

1728 
t
 = 
	`__bam_pupde
(
ndbc
, 
g
);

1729  (
t
);

1731 
de
:

1732 
r
: 

->
c
 = 
ve_c
;

1733 
n
->
c
 = 
nve_c
;

1735  (
t
);

1736 
	}
}

1743 
	$__bam_com_dups
(
dbc
, 
g
, 

, 
have_lock
, 
c_da
, 
dڕ
)

1744 
DBC
 *
dbc
;

1745 
PAGE
 **
g
;

1746 
u_t32_t
 

;

1747 
have_lock
;

1748 
DB_COMPACT
 *
c_da
;

1749 *
dڕ
;

1751 
BOVERFLOW
 *
bo
;

1752 
BTREE_CURSOR
 *

;

1753 
DB
 *
dbp
;

1754 
DBC
 *
d
;

1755 
DBT
 
t
;

1756 
DB_MPOOLFILE
 *
dbmp
;

1757 
ENV
 *
v
;

1758 
PAGE
 *
dpg
, *
pg
;

1759 
db_dx_t
 
i
;

1760 
isde
, 
v
, 
t
, 

, 
t_t
;

1762 

 = 0;

1763 
t
 = 0;

1764 
d
 = 
NULL
;

1766 
dbp
 = 
dbc
->dbp;

1767 
v
 = 
dbp
->env;

1768 
dbmp
 = 
dbp
->
mpf
;

1769 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1770 
pg
 = *
g
;

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

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

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

1776 
c_da
->
com_ges_exame
++;

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

1778 (*
dڕ
)++;

1779 i(!
have_lock
) {

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

1781 
DB_LOCK_WRITE
, 0, &

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

1782 
r
;

1783 
have_lock
 = 1;

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

1785 
dbc
->
thad_fo
,

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

1787 
r
;

1788 
pg
 = *
g
;

1790 i((
t
 =

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

1792 
r
;

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

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

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

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

1800 
r
;

1801 (*
dڕ
)++;

1808 i((
t
 = 
	`__memp_fg
(
dbmp
, &
bo
->
pgno
,

1809 
dbc
->
thad_fo
, dbc->
txn
, 0, &
dpg
)) != 0)

1810 
r
;

1812 
v
 = 
dpg
->level;

1813 i((
t
 = 
	`__memp_ut
(
dbmp
,

1814 
dbc
->
thad_fo
, 
dpg
, dbc->
iܙy
)) != 0)

1815 
r
;

1816 i(
v
 =
LEAFLEVEL
)

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

1819  (
t
);

1820 i(!
have_lock
) {

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

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

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

1823 
r
;

1824 
have_lock
 = 1;

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

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

1827 
r
;

1828 
pg
 = *
g
;

1830 (*
dڕ
)++;

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

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

1834 
NULL
, 

, &

, 
c_da
, &
isde
)) != 0)

1836 } !
isde
);

1838 i(
t
.
da
 !
NULL
)

1839 
	`__os_
(
v
, 
t
.
da
);

1841 i(
t
 != 0)

1842 
r
;

1844 
t
 = 
	`__dbc_o
(
d
);

1845 
d
 = 
NULL
;

1846 i(
t
 != 0)

1847 
r
;

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

1851 
t
 = 
t_t
;

1852  (
t
);

1853 
	}
}

1861 
	$__bam_un_ge
(
dbc
, 
pgp
, 
upde_
)

1862 
DBC
 *
dbc
;

1863 
PAGE
 **
pgp
;

1864 
upde_
;

1866 
BTREE_CURSOR
 *

;

1867 
DB
 *
dbp
;

1868 
DBT
 
da
, 
hdr
;

1869 
DB_LSN
 
l
;

1870 
EPG
 *
g
;

1871 
PAGE
 *
wge
;

1872 
db_pgno_t
 
wpgno
, *
pgn
;

1873 
t
;

1875 
dbp
 = 
dbc
->dbp;

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

1886  (
t
);

1893 i(
wge
 =
NULL
)

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

1902 i(
	`TYPE
(
wge
=
P_OVERFLOW
)

1903 
	`OV_LEN
(
wge
) = 0;

1904  (
	`__db_
(
dbc
, 
wge
));

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

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

1909 
r
;

1912 i(
	`DBC_LOGGING
(
dbc
)) {

1913 
hdr
.
da
 = *
pgp
;

1914 
hdr
.
size
 = 
	`P_OVERHEAD
(
dbp
);

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

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

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

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

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

1921 
hdr
.
size
 +
	`NUM_ENT
(*
pgp
* (
db_dx_t
);

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

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

1925 
	`PGNO
(*
pgp
), &
	`LSN
(*pgp), &
hdr
, &
da
, 1)) != 0)

1926 
r
;

1928 
	`LSN_NOT_LOGGED
(
	`LSN
(
wge
));

1930 
wpgno
 = 
	`PGNO
(
wge
);

1931 
l
 = 
	`LSN
(
wge
);

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

1933 
	`PGNO
(
wge

wpgno
;

1934 
	`LSN
(
wge

l
;

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

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

1939 
r
;

1940 i(
	`TYPE
(*
pgp
=
P_OVERFLOW
)

1941 
	`OV_LEN
(*
pgp
) = 0;

1943 
	`HOFFSET
(*
pgp

dbp
->
pgsize
;

1944 
	`NUM_ENT
(*
pgp
) = 0;

1946 
	`LSN
(*
pgp

l
;

1949 
	`TYPE
(
wge
)) {

1950 
P_OVERFLOW
:

1951 
P_LBTREE
:

1952 
P_LRECNO
:

1953 
P_LDUP
:

1954 i(
	`NEXT_PGNO
(
wge
=
PGNO_INVALID
 &&

1955 
	`PREV_PGNO
(
wge
=
PGNO_INVALID
)

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

1958 
r
;

1963 

 = (
BTREE_CURSOR
 *)
dbc
->

;

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

1971 *
pgp
 = 
wge
;

1973 i(
t
 != 0)

1974  (
t
);

1976 i(!
upde_
)

1977 
de
;

1980 
g
 = &

->
c
[-1];

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

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

1983  (
t
);

1985 
	`TYPE
(
g
->
ge
)) {

1986 
P_IBTREE
:

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

1989 
P_IRECNO
:

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

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

1996 i(
	`DBC_LOGGING
(
dbc
)) {

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

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

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

2000  (
t
);

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

2004 *
pgn
 = 
	`PGNO
(
wge
);

2005 

->
c
->
ge
 = 
wge
;

2007 
de
:  (0);

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

2010  (
t
);

2011 
	}
}

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

2022 
DBC
 *
dbc
;

2023 
db_pgno_t
 
pgno
;

2024 
db_pgno_t
 
pg_lock
;

2025 
DB_COMPACT
 *
c_da
;

2027 
DB
 *
dbp
;

2028 
DB_LOCK
 
lock
;

2029 
PAGE
 *
ge
;

2030 
t
, 
t_t
;

2032 
dbp
 = 
dbc
->dbp;

2033 
ge
 = 
NULL
;

2034 
	`LOCK_INIT
(
lock
);

2036 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
,

2037 
dbc
->
thad_fo
, dbc->
txn
, 0, &
ge
)) != 0)

2038  (
t
);

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

2041 i((
t
 = 
	`__memp_ut
(
dbp
->
mpf
,

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

2043  (
t
);

2044 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
,

2045 
dbc
->
thad_fo
, dbc->
txn
, 0, &
ge
)) != 0)

2046  (
t
);

2047 i(
pgno
 <
c_da
->
com_un
)

2049 i(
pg_lock
 !
PGNO_INVALID
) {

2050 i((
t
 = 
	`__db_lg
(
dbc
,

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

2053 
pg_lock
 = 
PGNO_INVALID
;

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

2059 i(
ge
 !
NULL
 &&

2060 (
t_t
 = 
	`__memp_ut

dbp
->
mpf
,

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

2062 
t
 = 
t_t
;

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

2064 
t
 = 
t_t
;

2065  (
t
);

2066 
	}
}

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

2075 
DBC
 *
dbc
;

2076 
PAGE
 *
pg
;

2077 
u_t32_t
 
dx
;

2078 
DB_COMPACT
 *
c_da
;

2080 
BINTERNAL
 *
bi
;

2081 
BOVERFLOW
 *
bo
;

2082 
DB
 *
dbp
;

2083 
DBT
 
ig
;

2084 
PAGE
 *
ge
;

2085 
db_pgno_t
 
wpgno
, *
pgn
;

2086 
t
, 
t_t
;

2088 
	`COMPQUIET
(
c_da
, 
NULL
);

2089 
	`COMPQUIET
(
bo
, 
NULL
);

2090 
	`COMPQUIET
(
wpgno
, 
PGNO_INVALID
);

2091 
dbp
 = 
dbc
->dbp;

2092 
ge
 = 
NULL
;

2093 i(
	`TYPE
(
pg
=
P_IBTREE
) {

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

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

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

2097 
pgn
 = &
bo
->
pgno
;

2099 
pgn
 = &
bi
->
pgno
;

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

2102 
pgn
 = &
bo
->
pgno
;

2105 
	`DB_ASSERT
(
dbp
->
v
, 
	`IS_DIRTY
(
pg
));

2107 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, 
pgn
,

2108 
dbc
->
thad_fo
, dbc->
txn
, 0, &
ge
)) != 0)

2109 
r
;

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

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

2118 
r
;

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

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

2121 
bo
->

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

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

2123 i(
ig
.
da
 !
NULL
)

2124 
	`__os_
(
dbp
->
v
, 
ig
.
da
);

2125 i(
t
 != 0)

2126 
r
;

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

2129 
r
;

2130 
wpgno
 = 
	`PGNO
(
ge
);

2132 i(
wpgno
 =*
pgn
)

2133 
r
;

2137 i(
	`DBC_LOGGING
(
dbc
)) {

2138 i((
t
 = 
	`__bam_pgno_log
(
dbp
,

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

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

2141 
r
;

2143 
	`LSN_NOT_LOGGED
(
	`LSN
(
pg
));

2145 *
pgn
 = 
wpgno
;

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

2148 
	`__memp_ut
(
dbp
->
mpf
, 
dbc
->
thad_fo
,

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

2150 
t
 = 
t_t
;

2151  (
t
);

2152 
	}
}

2162 
	$__bam_un__ovow
(
dbc
, 
ge
, 
c_da
)

2163 
DBC
 *
dbc
;

2164 
PAGE
 *
ge
;

2165 
DB_COMPACT
 *
c_da
;

2167 
BINTERNAL
 *
bi
;

2168 
BOVERFLOW
 *
bo
;

2169 
db_dx_t
 
dx
;

2170 
t
;

2172 
	`COMPQUIET
(
bo
, 
NULL
);

2173 
t
 = 0;

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

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

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

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

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

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

2182 i((
t
 = 
	`__bam_un_ovow
(

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

2186  (
t
);

2187 
	}
}

2196 
	$__bam_com_isde
(
dbc
, 

, 
pg
, 
isde
)

2197 
DBC
 *
dbc
;

2198 
DBT
 *

;

2199 
PAGE
 *
pg
;

2200 *
isde
;

2202 
db_o_t
 
o
;

2203 
BTREE
 *
t
;

2204 
BTREE_CURSOR
 *

;

2205 
cmp
, 
t
;

2207 *
isde
 = 0;

2208 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2209 
t
 = 
dbc
->
dbp
->
bt_
;

2211 i(
dbc
->
dbty
 =
DB_RECNO
) {

2212 i((
t
 = 
	`__m_gno
(
dbc
, 

, &
o
, 0)) != 0)

2213  (
t
);

2214 *
isde
 = 

->
o
 >ecno;

2216 
	`DB_ASSERT
(
dbc
->
dbp
->
v
, 
	`TYPE
(
pg
=
P_LBTREE
);

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

2218 

, 
pg
, 0, 
t
->
bt_com
, &
cmp
)) != 0)

2219  (
t
);

2221 *
isde
 = 
cmp
 <= 0;

2224 
	}
}

2226 #ifde
HAVE_FTRUNCATE


2235 
	$__bam_vekey
(
dbc
, 
xt
, 
t
)

2236 
DBC
 *
dbc
;

2237 
xt
;

2238 
DBT
 *
t
;

2240 
BINTERNAL
 *
bi
;

2241 
BKEYDATA
 *
bk
;

2242 
BOVERFLOW
 *
bo
;

2243 
BTREE_CURSOR
 *

;

2244 
DB
 *
dbp
;

2245 
ENV
 *
v
;

2246 
PAGE
 *
pg
;

2247 
RINTERNAL
 *
ri
;

2248 
db_dx_t
 
dx
, 
t
;

2249 
db_pgno_t
 
pgno
;

2250 
t
, 
t_t
;

2251 
u_t32_t
 
n
;

2252 
u_t8_t
 *
da
;

2254 
dbp
 = 
dbc
->dbp;

2255 
v
 = 
dbp
->env;

2256 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2257 
pg
 = 

->
c
->
ge
;

2259 i(
dbc
->
dbty
 =
DB_RECNO
) {

2260 i(
xt
)

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

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

2263 

->
o
 +
ri
->
ecs
;

2265  (
	`__db_tcy
(
v
, 
t
, &

->
o
,

2266 (

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

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

2270 
da
 = 
bi
->data;

2271 
n
 = 
bi
->len;

2273 
n
 == 0) {

2278 i(
	`NUM_ENT
(
pg
) == 0)

2279 
no_key
;

2280 
pgno
 = 
bi
->pgno;

2281 i(
pg
 !

->
c
->
ge
 &&

2282 (
t
 = 
	`__memp_ut
(
dbp
->
mpf
,

2283 
dbc
->
thad_fo
, 
pg
, dbc->
iܙy
)) != 0) {

2284 
pg
 = 
NULL
;

2285 
r
;

2287 i((
t
 = 
	`__memp_fg
(
dbp
->
mpf
, &
pgno
,

2288 
dbc
->
thad_fo
, dbc->
txn
, 0, &
pg
)) != 0)

2289 
r
;

2296 i(
pg
->
v
 =
LEAFLEVEL
) {

2297 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
pg
, 
	`NUM_ENT
(pg) - 2);

2298 
da
 = 
bk
->data;

2299 
n
 = 
bk
->len;

2300 i(
n
 == 0) {

2301 
no_key
: 
	`__db_rx
(
v
,

2303 
t
 = 
DB_NOTFOUND
;

2304 
r
;

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

2308 
da
 = 
bi
->data;

2309 
n
 = 
bi
->len;

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

2313 
bo
 = (
BOVERFLOW
 *)(
da
);

2314 
t
 = 
	`__db_goff
(
dbp
, 
dbc
->
thad_fo
, dbc->
txn
, 
t
,

2315 
bo
->

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

2318 
t
 = 
	`__db_tcy
(
v
,

2319 
t
, 
da
, 
n
, &t->da, &t->
un
);

2321 
r
: i(
pg
 !
NULL
 &&g !

->
c
->
ge
 &&

2322 (
t_t
 = 
	`__memp_ut
(
dbp
->
mpf
, 
dbc
->
thad_fo
,

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

2324 
t
 = 
t_t
;

2325  (
t
);

2326 
	}
}

2334 
	$__bam_un_
(
dbp
, 

, 
txn
, 
c_da
)

2335 
DB
 *
dbp
;

2336 
DB_THREAD_INFO
 *

;

2337 
DB_TXN
 *
txn
;

2338 
DB_COMPACT
 *
c_da
;

2340 
BTREE_CURSOR
 *

;

2341 
DBC
 *
dbc
;

2342 
DBT
 
t
;

2343 
PAGE
 *
pg
;

2344 
db_pgno_t
 
pgno
;

2345 
u_t32_t
 
sag
;

2346 
v
, 
lol_txn
, 
t
, 
t_t
;

2348 
dbc
 = 
NULL
;

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

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

2352 
lol_txn
 = 1;

2353 
txn
 = 
NULL
;

2355 
lol_txn
 = 0;

2357 
v
 = 
LEAFLEVEL
 + 1;

2358 
sag
 = 
CS_READ
 | 
CS_GETRECNO
;

2360 
w_txn
:

2361 i(
lol_txn
 &&

2362 (
t
 = 
	`__txn_beg
(
dbp
->
v
, 

, 
NULL
, &
txn
, 0)) != 0)

2363 
r
;

2365 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 0)) != 0)

2366 
r
;

2367 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2369 
pgno
 = 
PGNO_INVALID
;

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

2373 i(
t
 =
DB_NOTFOUND
) {

2374 
v
++;

2375 i(
t
.
da
 !
NULL
)

2376 
	`__os_
(
dbp
->
v
, 
t
.
da
);

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

2378 
sag
 = 
CS_READ
 | 
CS_GETRECNO
;

2381 
r
;

2383 
c_da
->
com_ges_exame
++;

2385 
pg
 = 

->
c
->
ge
;

2386 
pgno
 = 
	`PGNO
(
pg
);

2388 
sag
 = 
CS_NEXT
 | 
CS_GETRECNO
;

2390 i(
pgno
 !

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

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

2392 
r
;

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

2395 
r
;

2396 i(
pgno
 =

->
ro
)

2399 i(
pgno
 <
c_da
->
com_un
)

2403 i((
t
 = 
	`__bam_cch
(
dbc
,

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

2405 
r
;

2406 
pg
 = 

->
c
->
ge
;

2407 
pgno
 = 
	`PGNO
(
pg
);

2409 i(
pgno
 > 
c_da
->
com_un
) {

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

2411 
r
;

2413 i((
t
 = 
	`__bam_kl
(
dbc
,

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

2415 
r
;

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

2420 } 
pgno
 !

->
ro
);

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

2423 
r
;

2424 
dbc
 = 
NULL
;

2425 i(
lol_txn
) {

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

2427 
r
;

2428 
txn
 = 
NULL
;

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

2431 
w_txn
;

2433 
r
: i(
txn
 !
NULL
 && 
t
 != 0)

2434 
sag
 = 
STK_PGONLY
;

2436 
sag
 = 0;

2437 i(
dbc
 !
NULL
 && (
t_t
 = 
	`__bam_kl
(dbc, 
sag
)!0 && 
t
 == 0)

2438 
t
 = 
t_t
;

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

2440 
t
 = 
t_t
;

2441 i(
lol_txn
 &&

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

2443 
t
 = 
t_t
;

2444 i(
t
.
da
 !
NULL
)

2445 
	`__os_
(
dbp
->
v
, 
t
.
da
);

2446  (
t
);

2447 
	}
}

2450 
	$__bam_tup_li
(
dbp
, 
li
, 
ms
)

2451 
DB
 *
dbp
;

2452 
db_pgli_t
 *
li
;

2453 
u_t32_t
 
ms
;

2455 
DB_MPOOLFILE
 *
mpf
;

2456 
db_pgno_t
 *
i
;

2457 
t
;

2459 
mpf
 = 
dbp
->mpf;

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

2462  (
t
);

2464 
ms
-- != 0)

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

2468 
	}
}

2471 
	$__bam__li
(
dbp
, 

, 
txn
)

2472 
DB
 *
dbp
;

2473 
DB_THREAD_INFO
 *

;

2474 
DB_TXN
 *
txn
;

2476 
DBC
 *
dbc
;

2477 
DB_LOCK
 
lock
;

2478 
auto_comm
, 
t
, 
t_t
;

2480 
	`LOCK_INIT
(
lock
);

2481 
auto_comm
 = 
t
 = 0;

2489 
dbc
 = 
NULL
;

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

2497 i(
	`__txn_beg
(
dbp
->
v
, 

, 
NULL
, &
txn
, 0) == 0) {

2498 ()
	`__lock_t_timeout
(
dbp
->
v
,

2499 
txn
->
lock
, 0, 
DB_SET_TXN_TIMEOUT
);

2500 ()
	`__lock_t_timeout
(
dbp
->
v
,

2501 
txn
->
lock
, 0, 
DB_SET_LOCK_TIMEOUT
);

2502 
auto_comm
 = 1;

2505 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 0)) != 0)

2506  (
t
);

2508 i((
t
 = 
	`__db_lg
(
dbc
,

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

2510 
r
;

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

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

2516 
t
 = 
t_t
;

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

2519 
t
 = 
t_t
;

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

2522 
t
 = 
t_t
;

2524  (
t
);

2525 
	}
}

	@../btree/bt_compare.c

44 
	~"db_cfig.h
"

46 
	~"db_t.h
"

47 
	~"dbc/db_ge.h
"

48 
	~"dbc/b.h
"

59 
	$__bam_cmp
(
dbp
, 

, 
txn
, 
dbt
, 
h
, 
dx
, 
func
, 
cm
)

60 
DB
 *
dbp
;

61 
DB_THREAD_INFO
 *

;

62 
DB_TXN
 *
txn
;

63 cڡ 
DBT
 *
dbt
;

64 
PAGE
 *
h
;

65 
u_t32_t
 
dx
;

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

67 *
cm
;

69 
BINTERNAL
 *
bi
;

70 
BKEYDATA
 *
bk
;

71 
BOVERFLOW
 *
bo
;

72 
DBT
 
pg_dbt
;

87 
	`TYPE
(
h
)) {

88 
P_LBTREE
:

89 
P_LDUP
:

90 
P_LRECNO
:

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

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

93 
bo
 = (
BOVERFLOW
 *)
bk
;

95 
pg_dbt
.
p_da
 = 
NULL
;

96 
pg_dbt
.
da
 = 
bk
->data;

97 
pg_dbt
.
size
 = 
bk
->
n
;

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

102 
P_IBTREE
:

120 i(
dx
 == 0) {

121 *
cm
 = 1;

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

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

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

129 
pg_dbt
.
p_da
 = 
NULL
;

130 
pg_dbt
.
da
 = 
bi
->data;

131 
pg_dbt
.
size
 = 
bi
->
n
;

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

137  (
	`__db_pgfmt
(
dbp
->
v
, 
	`PGNO
(
h
)));

143  (
	`__db_moff
(
dbp
, 

, 
txn
, 
dbt
,

144 
bo
->
pgno
, bo->

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

145 
	}
}

154 
	$__bam_defcmp
(
dbp
, 
a
, 
b
)

155 
DB
 *
dbp
;

156 cڡ 
DBT
 *
a
, *
b
;

158 
size_t
 
n
;

159 
u_t8_t
 *
p1
, *
p2
;

161 
	`COMPQUIET
(
dbp
, 
NULL
);

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

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

177 i(*
p1
 !*
p2
)

178  (()*
p1
 - ()*
p2
);

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

180 
	}
}

188 
size_t


189 
	$__bam_defx
(
dbp
, 
a
, 
b
)

190 
DB
 *
dbp
;

191 cڡ 
DBT
 *
a
, *
b
;

193 
size_t
 
t
, 
n
;

194 
u_t8_t
 *
p1
, *
p2
;

196 
	`COMPQUIET
(
dbp
, 
NULL
);

198 
t
 = 1;

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

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

201 i(*
p1
 !*
p2
)

202  (
t
);

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

209  (
a
->
size
 + 1);

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

211  (
b
->
size
 + 1);

212  (
b
->
size
);

213 
	}
}

	@../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
(
dbp
, 
pg
, 

, 
cook
)

25 
DB
 *
dbp
;

26 
db_pgno_t
 
pg
;

27 *

;

28 
DBT
 *
cook
;

30 
DB_PGINFO
 *
pgfo
;

31 
PAGE
 *
h
;

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

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

37 
h
 = 

;

38  (
	`TYPE
(
h
=
P_BTREEMETA
 ? 
	`__bam_msw
(
dbp
->
v
, 

) :

39 
	`__db_bysw
(
dbp
, 
pg
, 

, 
pgfo
->
db_gesize
, 1));

40 
	}
}

50 
	$__bam_pgout
(
dbp
, 
pg
, 

, 
cook
)

51 
DB
 *
dbp
;

52 
db_pgno_t
 
pg
;

53 *

;

54 
DBT
 *
cook
;

56 
DB_PGINFO
 *
pgfo
;

57 
PAGE
 *
h
;

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

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

63 
h
 = 

;

64  (
	`TYPE
(
h
=
P_BTREEMETA
 ? 
	`__bam_msw
(
dbp
->
v
, 

) :

65 
	`__db_bysw
(
dbp
, 
pg
, 

, 
pgfo
->
db_gesize
, 0));

66 
	}
}

75 
	$__bam_msw
(
v
, 
pg
)

76 
ENV
 *
v
;

77 
PAGE
 *
pg
;

79 
u_t8_t
 *
p
;

81 
	`COMPQUIET
(
v
, 
NULL
);

83 
	`__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 
DBC
 *
dbc
;

46 
ENV
 *
v
;

47 
cou
;

49 
v
 = 
dbp
->env;

62 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

63 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

64 
cou
 = 0;

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

66 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

67 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 
dbp
->
mux
);

94 
	`MUTEX_UNLOCK
(
v
,nv->
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 
ENV
 *
v
;

116 
found
;

118 
v
 = 
dbp
->env;

123 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

124 
	`FIND_FIRST_DB_MATCH
(
v
, 
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
(
v
, 
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
(
v
, 
dbp
->
mux
);

137 
	`MUTEX_UNLOCK
(
v
,nv->
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 
DBC
 *
dbc
;

158 
DBC_INTERNAL
 *

;

159 
DB_LSN
 
l
;

160 
DB_TXN
 *
my_txn
;

161 
ENV
 *
v
;

162 
found
, 
t
;

164 
dbp
 = 
my_dbc
->dbp;

165 
v
 = 
dbp
->env;

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

172 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

173 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

174 
found
 = 0;

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

176 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

177 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 

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

190 

->
dx
 +
adju
;

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

192 
found
 = 1;

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

197 
	`MUTEX_UNLOCK
(
v
,nv->
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
->
v
, 
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_LSN
 
l
;

284 
DB_TXN
 *
my_txn
;

285 
ENV
 *
v
;

286 
found
, 
t
, 
t_t
;

288 
dbp
 = 
my_dbc
->dbp;

289 
v
 = 
dbp
->env;

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

291 
t
 = 0;

296 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

297 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

298 
found
 = 0;

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

300 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

301 
lo
: 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 
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
(
v
, 
dbp
->
mux
);

331 
r
: 
	`MUTEX_UNLOCK
(
v
,nv->
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 
ENV
 *
v
;

362 
t
;

364 
v
 = 
dbp
->env;

365 
t
 = 0;

370 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

371 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

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

374 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

375 
lo
: 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 
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
(
v
, 
dbp
->
mux
);

405 
r
: 
	`MUTEX_UNLOCK
(
v
,nv->
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_LSN
 
l
;

424 
DB_TXN
 *
my_txn
;

425 
ENV
 *
v
;

426 
found
, 
t
;

428 
dbp
 = 
my_dbc
->dbp;

429 
v
 = 
dbp
->env;

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

435 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

436 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

437 
found
 = 0;

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

439 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

440 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 
dbp
->
mux
);

457 
	`MUTEX_UNLOCK
(
v
,nv->
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_LSN
 
l
;

485 
DB_TXN
 *
my_txn
;

486 
ENV
 *
v
;

487 
found
, 
t
;

489 
dbp
 = 
my_dbc
->dbp;

490 
v
 = 
dbp
->env;

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

503 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

504 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

505 
found
 = 0;

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

507 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

508 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 
dbp
->
mux
);

532 
	`MUTEX_UNLOCK
(
v
,nv->
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 
DBC_INTERNAL
 *

;

563 
ENV
 *
v
;

565 
v
 = 
dbp
->env;

573 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

574 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

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

577 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

578 
	`MUTEX_LOCK
(
v
, 
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
(
v
, 
dbp
->
mux
);

593 
	`MUTEX_UNLOCK
(
v
,nv->
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
, \

52 (
dbc
)->
thad_fo
, 
g
, dbc->
iܙy
); \

53 
g
 = 
NULL
; \

55 
t
 = 0; \

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

57 
t
 = 
	`__db_lg
( \

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

59 i((
t
) == 0) \

60 
t
 = 
	`__memp_fg
(
__mpf
, &(
gno
), \

61 (
dbc
)->
thad_fo
, (dbc)->
txn
, 0, &(
g
)); \

62 } 0)

	)

65 #unde
ACQUIRE_CUR


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

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

; \

68 i(
p
 !
__
->
pgno
) \

69 
__
->
pgno
 = 
PGNO_INVALID
; \

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

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

72 
__
->
pgno
 = 
p
; \

73 
__
->
lock_mode
 = (
mode
); \

75 } 0)

	)

83 #unde
ACQUIRE_WRITE_LOCK


84 
	#ACQUIRE_WRITE_LOCK
(
dbc
, 
t
) do { \

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

; \

86 
t
 = 0; \

87 i(
	`STD_LOCKING
(
dbc
) && \

88 
__
->
lock_mode
 !
DB_LOCK_WRITE
 && \

89 ((
t

	`__db_lg
(
dbc
, \

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

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

92 
__
->
lock_mode
 = 
DB_LOCK_WRITE
; \

93 } 0)

	)

96 #unde
DISCARD_CUR


97 
	#DISCARD_CUR
(
dbc
, 
t
) do { \

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

; \

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

100 
__t_t
; \

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

102 
__t_t
 = 
	`__memp_ut
(
__mpf
, \

103 (
dbc
)->
thad_fo
, 
__
->
ge
, dbc->
iܙy
);\

104 
__
->
ge
 = 
NULL
; \

106 
__t_t
 = 0; \

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

108 
t
 = 
__t_t
; \

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

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

111 
t
 = 
__t_t
; \

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

113 
__
->
lock_mode
 = 
DB_LOCK_NG
; \

114 } 0)

	)

117 #unde
IS_DELETED


118 
	#IS_DELETED
(
dbp
, 
ge
, 
dx
) \

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

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

	)

121 #unde
IS_CUR_DELETED


122 
	#IS_CUR_DELETED
(
dbc
) \

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

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

	)

133 #unde
IS_DUPLICATE


134 
	#IS_DUPLICATE
(
dbc
, 
i1
, 
i2
) \

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

->
ge
))[
i1
] == \

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

->
ge
))[
i2
])

	)

137 #unde
IS_CUR_DUPLICATE


138 
	#IS_CUR_DUPLICATE
(
dbc
, 
ig_pgno
, 
ig_dx
) \

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

140 (
ig_pgno
 =(
dbc
)->

->
pgno
 && \

141 
	`IS_DUPLICATE
(
dbc
, (dbc)->

->
dx
, 
ig_dx
)))

	)

150 
	$__bamc_
(
dbc
, 
dbty
)

151 
DBC
 *
dbc
;

152 
DBTYPE
 
dbty
;

154 
ENV
 *
v
;

155 
t
;

157 
v
 = 
dbc
->env;

160 i(
dbc
->

 =
NULL
 && (
t
 =

161 
	`__os_oc
(
v
, 1, (
BTREE_CURSOR
), &
dbc
->

)) != 0)

162  (
t
);

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

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

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

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

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

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

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

172 i(
dbty
 =
DB_BTREE
) {

173 
dbc
->
am_bulk
 = 
__bam_bulk
;

174 
dbc
->
am_o
 = 
__bamc_o
;

175 
dbc
->
am_d
 = 
__bamc_d
;

176 
dbc
->
am_deroy
 = 
__bamc_deroy
;

177 
dbc
->
am_g
 = 
__bamc_g
;

178 
dbc
->
am_put
 = 
__bamc_put
;

179 
dbc
->
am_wrock
 = 
__bamc_wrock
;

181 
dbc
->
am_bulk
 = 
__bam_bulk
;

182 
dbc
->
am_o
 = 
__bamc_o
;

183 
dbc
->
am_d
 = 
__mc_d
;

184 
dbc
->
am_deroy
 = 
__bamc_deroy
;

185 
dbc
->
am_g
 = 
__mc_g
;

186 
dbc
->
am_put
 = 
__mc_put
;

187 
dbc
->
am_wrock
 = 
__bamc_wrock
;

191 
	}
}

200 
	$__bamc_esh
(
dbc
)

201 
DBC
 *
dbc
;

203 
BTREE
 *
t
;

204 
BTREE_CURSOR
 *

;

205 
DB
 *
dbp
;

207 
dbp
 = 
dbc
->dbp;

208 
t
 = 
dbp
->
bt_
;

209 

 = (
BTREE_CURSOR
 *)
dbc
->

;

216 i(

->
ro
 =
PGNO_INVALID
)

217 

->
ro
 = 
t
->
bt_ro
;

219 
	`LOCK_INIT
(

->
lock
);

220 

->
lock_mode
 = 
DB_LOCK_NG
;

222 i(

->

 =
NULL
) {

223 

->

 = cp->
ack
;

224 

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

226 
	`BT_STK_CLR
(

);

236 

->
ovsize
 = 
	`B_MINKEY_TO_OVFLSIZE
(

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

239 

->
o
 = 
RECNO_OOB
;

240 

->
d
 = 
INVALID_ORDER
;

241 

->
ags
 = 0;

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

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

246 
	`F_SET
(

, 
C_RECNUM
);

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

254 
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
 | 
DB_AM_RENUMBER
))

255 
	`F_SET
(

, 
C_RENUMBER
);

259 
	}
}

266 
	$__bamc_o
(
dbc
, 
ro_pgno
, 
rmro
)

267 
DBC
 *
dbc
;

268 
db_pgno_t
 
ro_pgno
;

269 *
rmro
;

271 
BTREE_CURSOR
 *

, *
_d
, *
_c
;

272 
DB
 *
dbp
;

273 
DBC
 *
dbc_d
, *
dbc_c
;

274 
DB_MPOOLFILE
 *
mpf
;

275 
ENV
 *
v
;

276 
PAGE
 *
h
;

277 
cdb_lock
, 
cou
, 
t
;

279 
dbp
 = 
dbc
->dbp;

280 
v
 = 
dbp
->env;

281 
mpf
 = 
dbp
->mpf;

282 

 = (
BTREE_CURSOR
 *)
dbc
->

;

283 
_d
 = (
dbc_d
 = 

->
d
=
NULL
 ?

284 
NULL
 : (
BTREE_CURSOR
 *)
dbc_d
->

;

285 
cdb_lock
 = 
t
 = 0;

344 i(
	`F_ISSET
(

, 
C_DELETED
)) {

345 
dbc_c
 = 
dbc
;

346 
dbc
->
dbty
) {

347 
DB_BTREE
:

348 i((
t
 = 
	`__bam__de
(

349 
dbp
, 

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

350 
r
;

351 i(
cou
 == 0)

352 
lock
;

353 
de
;

354 
DB_RECNO
:

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

356 
de
;

358 i((
t
 = 
	`__m__de
(
dbp
, 

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

359 
r
;

360 i(
cou
 == 0)

361 
lock
;

362 
de
;

363 
DB_HASH
:

364 
DB_QUEUE
:

365 
DB_UNKNOWN
:

367 
t
 = 
	`__db_unknown_ty
(

368 
v
, "DbCurs.o", 
dbc
->
dbty
);

369 
r
;

373 i(
dbc_d
 =
NULL
)

374 
de
;

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

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

->
pgno
,

382 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

383 
r
;

384 
ro_pgno
 = 
	`GET_BOVERFLOW
(
dbp
, 
h
, 

->
dx
 + 
O_INDX
)->
pgno
;

385 i((
t
 = 
	`__memp_ut
(
mpf
,

386 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)) != 0)

387 
r
;

389 
dbc_c
 = 
dbc_d
;

390 
dbc_d
->
dbty
) {

391 
DB_BTREE
:

392 i((
t
 = 
	`__bam__de
(

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

394 
r
;

395 i(
cou
 == 0)

396 
lock
;

397 
de
;

398 
DB_RECNO
:

399 i((
t
 =

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

401 
r
;

402 i(
cou
 == 0)

403 
lock
;

404 
de
;

405 
DB_HASH
:

406 
DB_QUEUE
:

407 
DB_UNKNOWN
:

409 
t
 = 
	`__db_unknown_ty
(

410 
v
, "DbCurs.o", 
dbc
->
dbty
);

411 
r
;

414 
de
;

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

;

424 i(
	`CDB_LOCKING
(
v
)) {

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

426 i((
t
 = 
	`__lock_g
(
v
,

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

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

429 
r
;

430 
cdb_lock
 = 1;

432 
de
;

444 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
))

445 
de
;

478 i(
	`STD_LOCKING
(
dbc
))

479 i((
t
 = 
	`__db_lg
(
dbc
,

480 
LCK_COUPLE
, 

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

481 
r
;

483 
de
:

491 i(
dbc_c
->
dbty
 =
DB_BTREE
) {

492 i((
t
 = 
	`__memp_fg
(
mpf
, &
_c
->
pgno
, 
dbc
->
thad_fo
,

493 
dbc
->
txn
, 
DB_MPOOL_DIRTY
, &
_c
->
ge
)) != 0)

494 
r
;

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

496 
r
;

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

504 
de
;

515 i((
t
 = 
	`__memp_fg
(
mpf
, &
ro_pgno
,

516 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

517 
r
;

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

519 
	`DISCARD_CUR
(
dbc_c
, 
t
);

520 i(
t
 != 0)

521 
r
;

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

523 
r
;

525 i((
t
 = 
	`__memp_ut
(
mpf
,

526 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)) != 0)

527 
r
;

528 
de
;

543 i(
dbc_d
 !
NULL
) {

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

->
pgno
, 
dbc
->
thad_fo
,

545 
dbc
->
txn
, 
DB_MPOOL_DIRTY
, &

->
ge
)) != 0)

546 
r
;

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

548 
r
;

550 *
rmro
 = 1;

551 
r
:

552 
de
:

556 i(
dbc_d
 !
NULL
)

557 
	`DISCARD_CUR
(
dbc_d
, 
t
);

558 
	`DISCARD_CUR
(
dbc
, 
t
);

561 i(
cdb_lock
)

562 ()
	`__lock_downgde
(
v
, &
dbc
->
mylock
, 
DB_LOCK_IWRITE
, 0);

564  (
t
);

565 
	}
}

572 
	$__bamc_deroy
(
dbc
)

573 
DBC
 *
dbc
;

575 
BTREE_CURSOR
 *

;

576 
ENV
 *
v
;

578 

 = (
BTREE_CURSOR
 *)
dbc
->

;

579 
v
 = 
dbc
->env;

582 i(

->

 !->
ack
)

583 
	`__os_
(
v
, 

->

);

584 
	`__os_
(
v
, 

);

587 
	}
}

596 
	$__bamc_cou
(
dbc
, 

)

597 
DBC
 *
dbc
;

598 
db_o_t
 *

;

600 
BTREE_CURSOR
 *

;

601 
DB
 *
dbp
;

602 
DB_MPOOLFILE
 *
mpf
;

603 
db_dx_t
 
dx
, 
t
;

604 
db_o_t
 
o
;

605 
t
;

607 
dbp
 = 
dbc
->dbp;

608 
mpf
 = 
dbp
->mpf;

609 

 = (
BTREE_CURSOR
 *)
dbc
->

;

616 i(

->
d
 =
NULL
) {

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

->
pgno
,

621 
dbc
->
thad_fo
, dbc->
txn
, 0, &

->
ge
)) != 0)

622  (
t
);

628 
dx
 = 

->dx;; indx -
P_INDX
)

629 i(
dx
 == 0 ||

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

632 
o
 = 0,

633 
t
 = 
	`NUM_ENT
(

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

634 i(!
	`IS_DELETED
(
dbp
, 

->
ge
, 
dx
))

635 ++
o
;

636 i(
dx
 =
t
 ||

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

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

->
d
->

->
ro
,

646 
dbc
->
thad_fo
, dbc->
txn
, 0, &

->
ge
)) != 0)

647  (
t
);

658 i(
	`TYPE
(

->
ge
=
P_LDUP
)

659 
o
 = 0, 
dx
 = 0,

660 
t
 = 
	`NUM_ENT
(

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

661 i(!
	`IS_DELETED
(
dbp
, 

->
ge
, 
dx
))

662 ++
o
;

663 i(
dx
 =
t
)

667 
o
 = 
	`RE_NREC
(

->
ge
);

670 *

 = 
o
;

672 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

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

673 

->
ge
 = 
NULL
;

675  (
t
);

676 
	}
}

683 
	$__bamc_d
(
dbc
)

684 
DBC
 *
dbc
;

686 
BTREE_CURSOR
 *

;

687 
DB
 *
dbp
;

688 
DB_MPOOLFILE
 *
mpf
;

689 
cou
, 
t
, 
t_t
;

691 
dbp
 = 
dbc
->dbp;

692 
mpf
 = 
dbp
->mpf;

693 

 = (
BTREE_CURSOR
 *)
dbc
->

;

694 
t
 = 0;

697 i(
	`F_ISSET
(

, 
C_DELETED
))

698  (
DB_KEYEMPTY
);

703 
	`DB_ASSERT
(
dbp
->
v
, 

->
ge
 =
NULL
);

714 i(
	`F_ISSET
(

, 
C_RECNUM
)) {

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

716 
r
;

717 

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

719 
	`ACQUIRE_CUR
(
dbc
, 
DB_LOCK_WRITE
, 

->
pgno
, 0, 
t
);

720 i(
t
 != 0)

721 
r
;

725 i((
t
 = 
	`__memp_dty
(
mpf
,

726 &

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

727 
r
;

730 i(
	`DBC_LOGGING
(
dbc
)) {

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

->
ge
), 0,

732 
	`PGNO
(

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

733 
r
;

735 
	`LSN_NOT_LOGGED
(
	`LSN
(

->
ge
));

738 i(
	`TYPE
(

->
ge
=
P_LBTREE
)

739 
	`B_DSET
(
	`GET_BKEYDATA
(
dbp
, 

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

741 
	`B_DSET
(
	`GET_BKEYDATA
(
dbp
, 

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

743 
r
:

747 i(
	`F_ISSET
(

, 
C_RECNUM
)) {

748 

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

749 i(
t
 == 0)

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

751 ()
	`__bam_kl
(
dbc
, 0);

753 i(

->
ge
 !
NULL
 &&

754 (
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

755 

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

756 
t
 = 
t_t
;

758 

->
ge
 = 
NULL
;

764 i(
t
 == 0)

765 
t
 = 
	`__bam__de
(
dbp
, 

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

767  (
t
);

768 
	}
}

778 
	$__bamc_dup
(
ig_dbc
, 
w_dbc
)

779 
DBC
 *
ig_dbc
, *
w_dbc
;

781 
BTREE_CURSOR
 *
ig
, *
w
;

783 
ig
 = (
BTREE_CURSOR
 *)
ig_dbc
->

;

784 
w
 = (
BTREE_CURSOR
 *)
w_dbc
->

;

786 
w
->
ovsize
 = 
ig
->ovflsize;

787 
w
->
o
 = 
ig
->recno;

788 
w
->
ags
 = 
ig
->flags;

791 
	}
}

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

799 
DBC
 *
dbc
;

800 
DBT
 *
key
, *
da
;

801 
u_t32_t
 
ags
;

802 
db_pgno_t
 *
pgn
;

804 
BTREE_CURSOR
 *

;

805 
DB
 *
dbp
;

806 
DB_MPOOLFILE
 *
mpf
;

807 
db_pgno_t
 
ig_pgno
;

808 
db_dx_t
 
ig_dx
;

809 
exa
, 
wd
, 
t
;

811 
dbp
 = 
dbc
->dbp;

812 
mpf
 = 
dbp
->mpf;

813 

 = (
BTREE_CURSOR
 *)
dbc
->

;

814 
ig_pgno
 = 

->
pgno
;

815 
ig_dx
 = 

->
dx
;

817 
wd
 = 0;

818 
ags
) {

819 
DB_CURRENT
:

821 i(
	`F_ISSET
(

, 
C_DELETED
)) {

822 
t
 = 
DB_KEYEMPTY
;

823 
r
;

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

->
pgno
,

833 
dbc
->
thad_fo
, dbc->
txn
, 0, &

->
ge
)) != 0)

834 
r
;

836 
DB_FIRST
:

837 
wd
 = 1;

838 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

840 
r
;

842 
DB_GET_BOTH
:

843 
DB_GET_BOTH_RANGE
:

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

858 i((
t
 = 
	`__bamc_ch
(

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

860 
r
;

861 i(
ags
 =
DB_GET_BOTH
) {

862 i(!
exa
) {

863 
t
 = 
DB_NOTFOUND
;

864 
r
;

875 i((

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

876 
	`IS_CUR_DELETED
(
dbc
)) &&

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

878 
r
;

880 i((
t
 = 
	`__bamc_ch
(

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

882  (
t
);

883 i(!
exa
) {

884 
t
 = 
DB_NOTFOUND
;

885 
r
;

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

889 
wd
 = 1;

892 i((
t
 =

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

894 
r
;

897 
DB_GET_BOTHC
:

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

899 
r
;

901 
DB_LAST
:

902 
wd
 = 1;

903 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

905 
r
;

907 
DB_NEXT
:

908 
wd
 = 1;

909 i(

->
pgno
 =
PGNO_INVALID
) {

910 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

912 
r
;

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

915 
r
;

917 
DB_NEXT_DUP
:

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

919 
r
;

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

921 
t
 = 
DB_NOTFOUND
;

922 
r
;

925 
DB_NEXT_NODUP
:

926 
wd
 = 1;

927 i(

->
pgno
 =
PGNO_INVALID
) {

928 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

930 
r
;

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

934 
r
;

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

937 
DB_PREV
:

938 
wd
 = 1;

939 i(

->
pgno
 =
PGNO_INVALID
) {

940 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

942 
r
;

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

945 
r
;

947 
DB_PREV_DUP
:

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

949 
r
;

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

951 
t
 = 
DB_NOTFOUND
;

952 
r
;

955 
DB_PREV_NODUP
:

956 
wd
 = 1;

957 i(

->
pgno
 =
PGNO_INVALID
) {

958 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

960 
r
;

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

964 
r
;

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

967 
DB_SET
:

968 
DB_SET_RECNO
:

969 
wd
 = 1;

970 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

972 
r
;

974 
DB_SET_RANGE
:

975 
wd
 = 1;

976 i((
t
 = 
	`__bamc_ch
(
dbc
,

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

978 
r
;

986 i(

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

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

988 
r
;

991 
t
 = 
	`__db_unknown_ag
(
dbp
->
v
, "__bamc_g", 
ags
);

992 
r
;

999 i(
wd
 && 
pgn
 !
NULL
)

1000 ()
	`__bam_isd
(
dbc
, 
pgn
);

1002 
r
:

1007 i(
	`F_ISSET
(

, 
C_DELETED
) &&

1008 (

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

1009 
	`F_CLR
(

, 
C_DELETED
);

1011  (
t
);

1012 
	}
}

1015 
	$__bam_g_ev
(
dbc
)

1016 
DBC
 *
dbc
;

1018 
BTREE_CURSOR
 *

;

1019 
DBT
 
key
, 
da
;

1020 
db_pgno_t
 
pgno
;

1021 
t
;

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

1024  (
t
);

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

1027 

 = (
BTREE_CURSOR
 *)
dbc
->

;

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

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

1029  (
t
);

1030 i((
t
 = 

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

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

1032  (
t
);

1036 
	}
}

1042 
	$__bam_bulk
(
dbc
, 
da
, 
ags
)

1043 
DBC
 *
dbc
;

1044 
DBT
 *
da
;

1045 
u_t32_t
 
ags
;

1047 
BKEYDATA
 *
bk
;

1048 
BOVERFLOW
 *
bo
;

1049 
BTREE_CURSOR
 *

;

1050 
PAGE
 *
pg
;

1051 
db_dx_t
 *
p
, 
dx
, 
pg_keyoff
;

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

1053 
u_t8_t
 *
dbuf
, *
dp
, *

;

1054 
u_t32_t
 
key_size
, 
gesize
, 
size
, 
a
;

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

1057 
t
 = 0;

1058 
key_off
 = 0;

1059 
size
 = 0;

1060 
gesize
 = 
dbc
->
dbp
->
pgsize
;

1061 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1068 
dbuf
 = 
da
->data;

1069 

 = 
dp
 = 
dbuf
;

1072 
a
 = 
da
->
un
;

1073 
a
 -(*
of
);

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

1077 
dp
--;

1078 
of
 = 
dp
;

1080 
key_size
 = 0;

1090 i(
dbc
->
dbty
 =
DB_BTREE
) {

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

1092 
c_key
 = 0;

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

1094 
adj
 = 2;

1096 
is_key
 = 0;

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

1098 
xt_key
 = 
	`LF_ISSET
(
DB_OPFLAGS_MASK
!
DB_NEXT_DUP
;

1099 
adj
 = 1;

1101 
no_dup
 = 
	`LF_ISSET
(
DB_OPFLAGS_MASK
=
DB_NEXT_NODUP
;

1103 
xt_pg
:

1104 
dx
 = 

->indx;

1105 
pg
 = 

->
ge
;

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

1109 
ed_pg
 = 1;

1116 
pg_keyoff
 = 0;

1117 i(
is_key
 == 0)

1118 
pg_keyoff
 = 
p
[
dx
];

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

1122 i(
dbc
->
dbty
 !
DB_RECNO
)

1125 

->
o
++;

1131 i(
c_key
 != 0)

1134 
a
 -2 * (*
of
);

1136 i(
a
 > 
da
->
un
)

1137 
back_up
;

1140 *
of
-- = 0;

1141 *
of
-- = 0;

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

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

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

1154 
bo
 = (
BOVERFLOW
 *)
bk
;

1155 
size
 = 
key_size
 = 
bo
->

;

1156 i(
key_size
 > 
a
)

1157 
g_key_a
;

1158 i((
t
 = 
	`__bam_bulk_ovow
(
dbc
,

1159 
bo
->

, bo->
pgno
, 

)) != 0)

1160  (
t
);

1161 
a
 -
key_size
;

1162 
key_off
 = (
t32_t
)(

 - 
dbuf
);

1163 

 +
key_size
;

1165 i(
ed_pg
) {

1166 
dp
 = 

;

1167 
size
 = 
gesize
 - 
	`HOFFSET
(
pg
);

1168 i(
a
 < 
size
) {

1169 
g_key_a
:

1171 i(
of
 =
dp
) {

1172 
da
->
size
 = (
u_t32_t
)

1173 
	`DB_ALIGN
(
size
 +

1174 
gesize
, 1024);

1176 (
DB_BUFFER_SMALL
);

1184 i(
dx
 != 0)

1185 
dx
 -
P_INDX
;

1187 i((
t
 =

1188 
	`__bam_g_ev
(

1189 
dbc
)) != 0)

1190  (
t
);

1191 
dx
 = 

->indx;

1192 
pg
 = 

->
ge
;

1200 
	`memy
(
dp
,

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

1202 
ed_pg
 = 0;

1203 
a
 -
size
;

1204 

 +
size
;

1206 
key_size
 = 
bk
->
n
;

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

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

1209 
pg_keyoff
 = 
p
[
dx
];

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

1218 i(
c_key
)

1219 
a
 -(*
of
);

1222 i(
a
 > 
da
->
un
)

1223 
back_up
;

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

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

1233 
bo
 = (
BOVERFLOW
 *)
bk
;

1234 i(
is_key
) {

1235 *
of
-- = (
t32_t
)
key_off
;

1236 *
of
-- = (
t32_t
)
key_size
;

1243 
veof
 = 
of
;

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

1245 
dbuf
, 
is_key
 ? 
of
 + 
P_INDX
 : 
NULL
,

1246 &
of
, &

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

1247 i(
t
 =
DB_BUFFER_SMALL
) {

1248 
size
 = 
a
;

1249 
a
 = 0;

1251 i(
of
 =
veof
) {

1252 
of
 += 2;

1253 
back_up
;

1255 
g_a
;

1257  (
t
);

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

1260 
bo
 = (
BOVERFLOW
 *)
bk
;

1261 
size
 = 
bo
->

;

1262 i(
size
 > 
a
)

1263 
back_up
;

1264 i((
t
 =

1265 
	`__bam_bulk_ovow
(
dbc
,

1266 
bo
->

, bo->
pgno
, 

)) != 0)

1267  (
t
);

1268 
a
 -
size
;

1269 i(
is_key
) {

1270 *
of
-- = (
t32_t
)
key_off
;

1271 *
of
-- = (
t32_t
)
key_size
;

1272 } i(
c_key
)

1273 *
of
-- = (
t32_t
)

->
o
;

1274 *
of
-- = (
t32_t
)(

 - 
dbuf
);

1275 

 +
size
;

1276 *
of
-- = (
t32_t
)
size
;

1278 i(
ed_pg
) {

1279 
dp
 = 

;

1280 
size
 = 
gesize
 - 
	`HOFFSET
(
pg
);

1281 i(
a
 < 
size
) {

1282 
back_up
:

1287 i(
dx
 >
adj
)

1288 
dx
 -
adj
;

1290 i((
t
 =

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

1292 
t
 !
DB_NOTFOUND
)

1293  (
t
);

1294 
dx
 = 

->indx;

1295 
pg
 = 

->
ge
;

1297 i(
dbc
->
dbty
 =
DB_RECNO
)

1298 

->
o
--;

1299 
g_a
:

1305 i(
of
 >=

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

1307 
	`F_ISSET
(
dbc
, 
DBC_TRANSIENT
)) {

1308 
da
->
size
 = (
u_t32_t
)

1309 
	`DB_ALIGN
(
size
 +

1310 
da
->
un
 - 
a
, 1024);

1311  (
DB_BUFFER_SMALL
);

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

1316 
ed_pg
 = 0;

1317 
a
 -
size
;

1318 

 +
size
;

1324 i(
is_key
) {

1325 *
of
-- = (
t32_t
)
key_off
;

1326 *
of
-- = (
t32_t
)
key_size
;

1327 } i(
c_key
)

1328 *
of
-- = (
t32_t
)

->
o
;

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

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

1331 *
of
-- = 
bk
->
n
;

1333 i(
dbc
->
dbty
 =
DB_RECNO
)

1334 

->
o
++;

1335 i(
no_dup
) {

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

1337 
pg_keyoff
 =
p
[
dx
 + 
adj
])

1338 
dx
 +
adj
;

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

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

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

1349 

->
dx
 = indx;

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

1351 i(
t
 == 0)

1352 
xt_pg
;

1353 i(
t
 !
DB_NOTFOUND
)

1354  (
t
);

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

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

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

1367  (
DB_BUFFER_SMALL
);

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

1375 

->
dx
 = indx;

1377 

->
dx
 = indx - 
P_INDX
;

1379 i(
c_key
 == 1)

1380 *
of
 = 
RECNO_OOB
;

1382 *
of
 = -1;

1384 
	}
}

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

1395 
DBC
 *
dbc
;

1396 
u_t32_t
 
n
;

1397 
db_pgno_t
 
pgno
;

1398 
u_t8_t
 *
dp
;

1400 
DBT
 
dbt
;

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

1403 
	`F_SET
(&
dbt
, 
DB_DBT_USERMEM
);

1404 
dbt
.
un
 = 
n
;

1405 
dbt
.
da
 = (*)
dp
;

1406  (
	`__db_goff
(
dbc
->
dbp
,

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

1408 
	}
}

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

1421 
DBC
 *
dbc
;

1422 
db_pgno_t
 
pgno
;

1423 
u_t8_t
 *
dbuf
;

1424 
t32_t
 *
keyoff
, **
ofp
;

1425 
u_t8_t
 **
d
;

1426 
u_t32_t
 *
ap
;

1427 
no_dup
;

1429 
BKEYDATA
 *
bk
;

1430 
BOVERFLOW
 *
bo
;

1431 
BTREE_CURSOR
 *

;

1432 
DB
 *
dbp
;

1433 
DBC
 *
d
;

1434 
DBT
 
key
, 
da
;

1435 
PAGE
 *
pg
;

1436 
db_dx_t
 
dx
, *
p
;

1437 
t32_t
 *
of
;

1438 
u_t32_t
 
gesize
, 
size
, 
a
;

1439 
u_t8_t
 *
dp
, *

;

1440 
f
, 
ed_pg
, 
t
, 
t_t
;

1442 
t
 = 0;

1444 
dbp
 = 
dbc
->dbp;

1445 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1446 
d
 = 

->opd;

1448 i(
d
 =
NULL
) {

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

1450  (
t
);

1451 

->
d
 = opd;

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

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

1454 
o_d
;

1457 
gesize
 = 
d
->
dbp
->
pgsize
;

1458 

 = (
BTREE_CURSOR
 *)
d
->

;

1459 
a
 = *
ap
;

1461 
of
 = *
ofp
;

1467 

 = 
dp
 = *
d
;

1468 
f
 = 1;

1469 
dx
 = 

->indx;

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

1475 
pg
 = 

->
ge
;

1476 
dx
 = 

->indx;

1477 
p
 = 
	`P_INP
(
dbp
, 
pg
);

1479 
ed_pg
 = 1;

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

1483 
ct
;

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

1485 
a
 -2 * (*
of
);

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

1488 
a
 -2 * (*
of
);

1491 i(
a
 > *
ap
) {

1492 
t
 = 
DB_BUFFER_SMALL
;

1493 i(
f
 == 1) {

1495 
a
 = -(
t32_t
)space;

1496 
a
 = *
ap
 + space;

1497 i(
ed_pg
)

1498 
a
 +
gesize
 - 
	`HOFFSET
(
pg
);

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

1503 
bo
 = (
BOVERFLOW
 *)
bk
;

1504 
size
 = 
bo
->

;

1505 i(
size
 > 
a
) {

1506 
t
 = 
DB_BUFFER_SMALL
;

1507 
a
 = *
ap
 + 
size
;

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

1511 *
of
-- = 
keyoff
[0];

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

1514 i((
t
 = 
	`__bam_bulk_ovow
(
dbc
,

1515 
bo
->

, bo->
pgno
, 

)) != 0)

1516  (
t
);

1517 
a
 -
size
;

1518 *
of
-- = (
t32_t
)(

 - 
dbuf
);

1519 

 +
size
;

1521 i(
ed_pg
) {

1522 
dp
 = 

;

1523 
size
 = 
gesize
 - 
	`HOFFSET
(
pg
);

1524 i(
a
 < 
size
) {

1525 
t
 = 
DB_BUFFER_SMALL
;

1527 
a
 = *
ap
 + 
size
;

1530 
	`memy
(
dp
,

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

1532 
ed_pg
 = 0;

1533 
a
 -
size
;

1534 

 +
size
;

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

1537 *
of
-- = 
keyoff
[0];

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

1540 
size
 = 
bk
->
n
;

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

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

1544 *
of
-- = (
t32_t
)
size
;

1545 
f
 = 0;

1546 i(
no_dup
)

1548 
ct
:

1549 
dx
++;

1550 i(
d
->
dbty
 =
DB_RECNO
)

1551 

->
o
++;

1552 } 
dx
 < 
	`NUM_ENT
(
pg
));

1553 i(
no_dup
)

1555 

->
dx
 = indx;

1557 } 
t
 == 0);

1560 *
ap
 = 
a
;

1561 *
ofp
 = 
of
;

1562 *
d
 = 

;

1568 i(
t
 =
DB_BUFFER_SMALL
) {

1569 i(
d
->
dbty
 =
DB_RECNO
) {

1570 i(--

->
o
 == 0)

1571 
o_d
;

1572 } i(
dx
 != 0)

1573 

->
dx
--;

1575 
t_t
 = 
	`__bamc_ev
(
d
);

1576 i(
t_t
 =
DB_NOTFOUND
)

1577 
o_d
;

1578 i(
t_t
 != 0)

1579 
t
 = 
t_t
;

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

1582 

->
dx
--;

1583 i(
d
->
dbty
 =
DB_RECNO
)

1584 --

->
o
;

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

1586 
o_d
:

1587 i(
t
 =
DB_NOTFOUND
)

1588 
t
 = 0;

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

1590 
t
 = 
t_t
;

1591 ((
BTREE_CURSOR
 *)
dbc
->

)->
d
 = 
NULL
;

1593 i(
t
 =
DB_NOTFOUND
)

1594 
t
 = 0;

1596  (
t
);

1597 
	}
}

1604 
	$__bam_gbhc
(
dbc
, 
da
)

1605 
DBC
 *
dbc
;

1606 
DBT
 *
da
;

1608 
BTREE_CURSOR
 *

;

1609 
DB
 *
dbp
;

1610 
DB_MPOOLFILE
 *
mpf
;

1611 
cmp
, 
exa
, 
t
;

1613 
dbp
 = 
dbc
->dbp;

1614 
mpf
 = 
dbp
->mpf;

1615 

 = (
BTREE_CURSOR
 *)
dbc
->

;

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

->
pgno
,

1624 
dbc
->
thad_fo
, dbc->
txn
, 0, &

->
ge
)) != 0)

1625  (
t
);

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

1637 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
thad_fo
,

1638 
dbc
->
txn
, 
da
, 

->
ge
, cp->
dx
,

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

1640 &
cmp
)) != 0)

1641  (
t
);

1643 i(
cmp
 <= 0)

1644  (
DB_NOTFOUND
);

1647 i((
t
 = 
	`__memp_ut
(
mpf
,

1648 
dbc
->
thad_fo
, 

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

1649  (
t
);

1650 

->
ge
 = 
NULL
;

1652  (
	`__bamc_ch
(
dbc
,

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

1665 i(

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

1666 !
	`IS_DUPLICATE
(
dbc
, 

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

1667  (
DB_NOTFOUND
);

1668 

->
dx
 +
P_INDX
;

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

1671 
	}
}

1678 
	$__bam_gbh_fddum
(
dbc
, 
da
, 
ags
)

1679 
DBC
 *
dbc
;

1680 
DBT
 *
da
;

1681 
u_t32_t
 
ags
;

1683 
BTREE_CURSOR
 *

;

1684 
DB
 *
dbp
;

1685 
db_dx_t
 
ba
, 
lim
, 
t
;

1686 
cmp
, 
t
;

1688 
	`COMPQUIET
(
cmp
, 0);

1690 
dbp
 = 
dbc
->dbp;

1691 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1704 i(
dbp
->
dup_com
 =
NULL
) {

1705 ;; 

->
dx
 +
P_INDX
) {

1706 i(!
	`IS_CUR_DELETED
(
dbc
) &&

1707 (
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
thad_fo
,

1708 
dbc
->
txn
, 
da
, 

->
ge
,

1709 

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

1710  (
t
);

1711 i(
cmp
 == 0)

1714 i(

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

1715 !
	`IS_DUPLICATE
(
dbc
, 

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

1718  (
DB_NOTFOUND
);

1729 
ba
 = 
t
 = 

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

1730 i(!
	`IS_DUPLICATE
(
dbc
, 

->
dx
, 
t
))

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

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

1734 

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

1735  (
t
);

1736  (
cmp
 == 0 ||

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

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

1741 

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

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

1743 

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

1744  (
t
);

1745 i(
cmp
 == 0) {

1751 i(!
	`IS_CUR_DELETED
(
dbc
))

1755 i(
cmp
 > 0) {

1756 
ba
 = 

->
dx
 + 
P_INDX
;

1757 --
lim
;

1762 i(
ags
 =
DB_GET_BOTH
)

1763  (
DB_NOTFOUND
);

1770 

->
dx
 = 
ba
;

1771 

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

1772 

->
dx
 +
P_INDX
;

1773  (

->
dx
 < 
t
 ? 0 : 
DB_NOTFOUND
);

1774 
	}
}

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

1782 
DBC
 *
dbc
;

1783 
DBT
 *
key
, *
da
;

1784 
u_t32_t
 
ags
;

1785 
db_pgno_t
 *
pgn
;

1787 
BTREE
 *
t
;

1788 
BTREE_CURSOR
 *

;

1789 
DB
 *
dbp
;

1790 
DBT
 
dbt
;

1791 
DB_MPOOLFILE
 *
mpf
;

1792 
db_pgno_t
 
ro_pgno
;

1793 
u_t32_t
 
ii
;

1794 
cmp
, 
exa
, 
own
, 
t
, 
ack
;

1795 *
g
;

1797 
dbp
 = 
dbc
->dbp;

1798 
mpf
 = 
dbp
->mpf;

1799 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1800 
ro_pgno
 = 

->
ro
;

1802 
l
: 
t
 = 
ack
 = 0;

1803 
ags
) {

1804 
DB_CURRENT
:

1805 i(
	`F_ISSET
(

, 
C_DELETED
))

1806  (
DB_NOTFOUND
);

1809 
DB_AFTER
:

1810 
DB_BEFORE
:

1811 
ii
 = 
ags
;

1812 
own
 = 1;

1815 
	`ACQUIRE_WRITE_LOCK
(
dbc
, 
t
);

1816 i(
t
 != 0)

1817 
r
;

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

->
pgno
,

1819 
dbc
->
thad_fo
, dbc->
txn
, 0, &

->
ge
)) != 0)

1820 
r
;

1822 
DB_KEYFIRST
:

1823 
DB_KEYLAST
:

1824 
DB_NODUPDATA
:

1825 
DB_NOOVERWRITE
:

1826 
own
 = 0;

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

1835 i((
t
 = 
	`__bamc_ch
(
dbc
,

1836 
	`F_ISSET
(

, 
C_RECNUM
? cp->
ro
 : 
ro_pgno
,

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

1838 
r
;

1839 
ack
 = 1;

1842 i(
exa
) {

1843 i(
	`IS_DELETED
(
dbp
, 

->
ge
, cp->
dx
)) {

1844 
ii
 = 
DB_CURRENT
;

1847 
t
 = 
	`__db_du
(
dbp
, 
ags
);

1848 
r
;

1850 
ii
 = 
DB_BEFORE
;

1863 i((
t
 = 
	`__bamc_ch
(
dbc
,

1864 
	`F_ISSET
(

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

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

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

1867 
r
;

1868 
ack
 = 1;

1874 i(!
exa
) {

1875 
ii
 = 
DB_KEYFIRST
;

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

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

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

1886 
t
 = 
DB_KEYEXIST
;

1887 i(
t
 != 0)

1888 
r
;

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

1895 
ii
 = 
DB_CURRENT
;

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

1905 
de
;

1908 i(
dbp
->
dup_com
 =
NULL
) {

1909 i(
ags
 =
DB_KEYFIRST
)

1910 
ii
 = 
DB_BEFORE
;

1912 ;; 

->
dx
 +
P_INDX
)

1913 i(

->
dx
 + 
P_INDX
 >=

1914 
	`NUM_ENT
(

->
ge
) ||

1915 !
	`IS_DUPLICATE
(
dbc
, 

->
dx
,

1916 

->
dx
 + 
P_INDX
)) {

1917 
ii
 = 
DB_AFTER
;

1927 ;; 

->
dx
 +
P_INDX
) {

1928 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
thad_fo
,

1929 
dbc
->
txn
, 
da
, 

->
ge
,

1930 

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

1931 
r
;

1932 i(
cmp
 < 0) {

1933 
ii
 = 
DB_BEFORE
;

1938 i(
cmp
 == 0) {

1939 i(
	`IS_DELETED
(
dbp
, 

->
ge
, cp->
dx
)) {

1940 
ii
 = 
DB_CURRENT
;

1943 
t
 = 
	`__db_du
(
dbp
, 
ags
);

1944 
r
;

1947 i(

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

1948 
	`P_INP
(
dbp
, ((
PAGE
 *)

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

1949 
	`P_INP
(
dbp
, ((
PAGE
 *)

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

1950 
ii
 = 
DB_AFTER
;

1956 
t
 = 
	`__db_unknown_ag
(
dbp
->
v
, "__bamc_put", 
ags
);

1957 
r
;

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

1963 
DB_NEEDSPLIT
:

1968 i(
ags
 =
DB_AFTER
 ||

1969 
ags
 =
DB_BEFORE
 || fg=
DB_CURRENT
) {

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

1971 i((
t
 = 
	`__db_t
(
dbp
, 
dbc
->
thad_fo
,

1972 
dbc
->
txn
, 

->
ge
, 0,

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

1974 
r
;

1975 
g
 = &
dbt
;

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

1986 i(
ack
)

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

1989 
	`DISCARD_CUR
(
dbc
, 
t
);

1990 i(
t
 != 0)

1991 
r
;

2001 i(
own
 == 0) {

2002 

->
pgno
 = 
PGNO_INVALID
;

2003 

->
dx
 = 0;

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

2008  (
t
);

2010 
l
;

2012 
r
;

2015 
r
:

2016 
de
:

2029 
t
 = 
dbp
->
bt_
;

2030 i(
t
 =0 && 
	`TYPE
(

->
ge
=
P_LBTREE
 &&

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

2032 !
	`F_ISSET
(

, 
C_RECNUM
) &&

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

2034 (
	`LOGGING_ON
(
dbp
->
v
&& !
	`F_ISSET
(dbp, 
DB_AM_NOT_DURABLE
))) &&

2035 ((
	`NEXT_PGNO
(

->
ge
=
PGNO_INVALID
 &&

2036 

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

2037 (
	`PREV_PGNO
(

->
ge
=
PGNO_INVALID
 && cp->
dx
 == 0))) {

2038 
t
->
bt_gno
 = 

->
pgno
;

2039 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
))

2040 
t
->
bt_΢
 = 
	`LSN
(

->
ge
);

2042 
t
->
bt_gno
 = 
PGNO_INVALID
;

2050 i(
ack
 && 
	`BT_STK_POP
(

!
NULL
)

2051 ()
	`__bam_kl
(
dbc
, 0);

2062 
	`F_CLR
(

, 
C_DELETED
);

2063 i(

->
d
 !
NULL
) {

2064 

 = (
BTREE_CURSOR
 *)->
d
->

;

2065 
	`F_CLR
(

, 
C_DELETED
);

2068  (
t
);

2069 
	}
}

2078 
	$__bamc_rg
(
dbc
, 
da
)

2079 
DBC
 *
dbc
;

2080 
DBT
 *
da
;

2082 
BTREE_CURSOR
 *

;

2083 
DB
 *
dbp
;

2084 
DBT
 
dbt
;

2085 
DB_MPOOLFILE
 *
mpf
;

2086 
db_o_t
 
o
;

2087 
exa
, 
t
, 
t_t
;

2089 
dbp
 = 
dbc
->dbp;

2090 
mpf
 = 
dbp
->mpf;

2091 

 = (
BTREE_CURSOR
 *)
dbc
->

;

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

->
pgno
,

2099 
dbc
->
thad_fo
, dbc->
txn
, 0, &

->
ge
)) != 0)

2100  (
t
);

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

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

->
ge
,

2103 

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

2104 
r
;

2105 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

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

2106 

->
ge
 = 
NULL
;

2107 i(
t
 != 0)

2108  (
t
);

2110 i((
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
, &
dbt
,

2111 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
,

2112 1, &
o
, &
exa
)) != 0)

2113 
r
;

2115 
t
 = 
	`__db_tcy
(
dbc
->
v
, 
da
,

2116 &
o
, eo), &
dbc
->
rda
->
da
, &dbc->rda->
un
);

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

2120 
t
 = 
t_t
;

2122  (
t
);

2123 
	}
}

2130 
	$__bamc_wrock
(
dbc
)

2131 
DBC
 *
dbc
;

2133 
BTREE_CURSOR
 *

;

2134 
t
;

2136 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2138 i(

->
lock_mode
 =
DB_LOCK_WRITE
)

2147 
	`ACQUIRE_WRITE_LOCK
(
dbc
, 
t
);

2148  (
t
);

2149 
	}
}

2156 
	$__bamc_xt
(
dbc
, 
l_move
, 
ded_okay
)

2157 
DBC
 *
dbc
;

2158 
l_move
, 
ded_okay
;

2160 
BTREE_CURSOR
 *

;

2161 
db_dx_t
 
adju
;

2162 
db_lockmode_t
 
lock_mode
;

2163 
db_pgno_t
 
pgno
;

2164 
t
;

2166 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2167 
t
 = 0;

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

2177 
adju
 = 
O_INDX
;

2178 
lock_mode
 = 
DB_LOCK_NG
;

2180 
adju
 = 
dbc
->
dbty
 =
DB_BTREE
 ? 
P_INDX
 : 
O_INDX
;

2181 
lock_mode
 =

2182 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
;

2184 i(

->
ge
 =
NULL
) {

2185 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 

->
pgno
, 0, 
t
);

2186 i(
t
 != 0)

2187  (
t
);

2190 i(
l_move
)

2191 

->
dx
 +
adju
;

2201 i(

->
dx
 >
	`NUM_ENT
(->
ge
)) {

2202 i((
pgno
 = 
	`NEXT_PGNO
(

->
ge
)=
PGNO_INVALID
)

2203  (
DB_NOTFOUND
);

2205 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 
pgno
, 0, 
t
);

2206 i(
t
 != 0)

2207  (
t
);

2208 

->
dx
 = 0;

2211 i(!
ded_okay
 && 
	`IS_CUR_DELETED
(
dbc
)) {

2212 

->
dx
 +
adju
;

2218 
	}
}

2225 
	$__bamc_ev
(
dbc
)

2226 
DBC
 *
dbc
;

2228 
BTREE_CURSOR
 *

;

2229 
db_dx_t
 
adju
;

2230 
db_lockmode_t
 
lock_mode
;

2231 
db_pgno_t
 
pgno
;

2232 
t
;

2234 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2235 
t
 = 0;

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

2245 
adju
 = 
O_INDX
;

2246 
lock_mode
 = 
DB_LOCK_NG
;

2248 
adju
 = 
dbc
->
dbty
 =
DB_BTREE
 ? 
P_INDX
 : 
O_INDX
;

2249 
lock_mode
 =

2250 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
;

2252 i(

->
ge
 =
NULL
) {

2253 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 

->
pgno
, 0, 
t
);

2254 i(
t
 != 0)

2255  (
t
);

2260 i(

->
dx
 == 0) {

2261 i((
pgno
 =

2262 
	`PREV_PGNO
(

->
ge
)=
PGNO_INVALID
)

2263  (
DB_NOTFOUND
);

2265 
	`ACQUIRE_CUR
(
dbc
, 
lock_mode
, 
pgno
, 0, 
t
);

2266 i(
t
 != 0)

2267  (
t
);

2269 i((

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

2274 

->
dx
 -
adju
;

2275 i(
	`IS_CUR_DELETED
(
dbc
))

2281 
	}
}

2288 
	$__bamc_ch
(
dbc
, 
ro_pgno
, 
key
, 
ags
, 
exap
)

2289 
DBC
 *
dbc
;

2290 
db_pgno_t
 
ro_pgno
;

2291 cڡ 
DBT
 *
key
;

2292 
u_t32_t
 
ags
;

2293 *
exap
;

2295 
BTREE
 *
t
;

2296 
BTREE_CURSOR
 *

;

2297 
DB
 *
dbp
;

2298 
PAGE
 *
h
;

2299 
db_dx_t
 
dx
, *
p
;

2300 
db_pgno_t
 
bt_gno
;

2301 
db_o_t
 
o
;

2302 
u_t32_t
 
sags
;

2303 
cmp
, 
t
, 
t_t
;

2305 
dbp
 = 
dbc
->dbp;

2306 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2307 
t
 = 
dbp
->
bt_
;

2308 
t
 = 0;

2314 
	`DISCARD_CUR
(
dbc
, 
t
);

2315 i(
t
 != 0)

2316  (
t
);

2318 
ags
) {

2319 
DB_FIRST
:

2320 
sags
 = (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_WRITE
 : 
SR_READ
| 
SR_MIN
;

2321 
ch
;

2322 
DB_LAST
:

2323 
sags
 = (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_WRITE
 : 
SR_READ
| 
SR_MAX
;

2324 
ch
;

2325 
DB_SET_RECNO
:

2326 i((
t
 = 
	`__m_gno
(
dbc
, 
key
, &
o
, 0)) != 0)

2327  (
t
);

2328 
sags
 =

2329 (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
| 
SR_EXACT
;

2330 i((
t
 = 
	`__bam_rch
(
dbc
, &
o
, 
sags
, 1, 
exap
)) != 0)

2331  (
t
);

2333 
DB_SET
:

2334 
DB_GET_BOTH
:

2335 
sags
 =

2336 (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
| 
SR_EXACT
;

2337 
ch
;

2338 
DB_GET_BOTH_RANGE
:

2339 
sags
 = (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
);

2340 
ch
;

2341 
DB_SET_RANGE
:

2342 
sags
 =

2343 (
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_WRITE
 : 
SR_READ
| 
SR_DUPFIRST
;

2344 
ch
;

2345 
DB_KEYFIRST
:

2346 
DB_NOOVERWRITE
:

2347 
sags
 = 
SR_KEYFIRST
;

2348 
_ch
;

2349 
DB_KEYLAST
:

2350 
DB_NODUPDATA
:

2351 
sags
 = 
SR_KEYLAST
;

2352 
_ch
:

2357 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
))

2358 
ch
;

2369 
bt_gno
 = 
t
->bt_lpgno;

2374 i(
bt_gno
 =
PGNO_INVALID
)

2375 
ch
;

2385 
h
 = 
NULL
;

2386 
	`ACQUIRE_CUR
(
dbc
, 
DB_LOCK_WRITE
, 
bt_gno
, 
DB_LOCK_NOWAIT
, 
t
);

2387 i(
t
 != 0) {

2388 i(
t
 =
DB_LOCK_DEADLOCK
 ||

2389 
t
 =
DB_LOCK_NOTGRANTED
 ||

2390 
t
 =
DB_PAGE_NOTFOUND
)

2391 
t
 = 0;

2392 
_miss
;

2395 
h
 = 

->
ge
;

2396 
p
 = 
	`P_INP
(
dbp
, 
h
);

2402 i(
	`TYPE
(
h
!
P_LBTREE
 || 
	`NUM_ENT
(h) == 0)

2403 
_miss
;

2406 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
) &&

2407 
	`LOG_COMPARE
(&
t
->
bt_΢
, &
	`LSN
(
h
)) != 0)

2408 
_miss
;

2417 i(
h
->
xt_pgno
 =
PGNO_INVALID
) {

2418 
dx
 = 
	`NUM_ENT
(
h
- 
P_INDX
;

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

2420 
key
, 
h
, 
dx
, 
t
->
bt_com
, &
cmp
)) != 0)

2421 
_miss
;

2423 i(
cmp
 < 0)

2424 
y_beg
;

2425 i(
cmp
 > 0) {

2426 
dx
 +
P_INDX
;

2427 
_h
;

2437 i(
ags
 =
DB_KEYLAST
)

2438 
_h
;

2440 
dx
 > 0 && 
p
[dx - 
P_INDX
] == inp[indx];

2441 
dx
 -
P_INDX
)

2443 
_h
;

2445 
y_beg
: i(
h
->
ev_pgno
 =
PGNO_INVALID
) {

2446 
dx
 = 0;

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

2448 
key
, 
h
, 
dx
, 
t
->
bt_com
, &
cmp
)) != 0)

2449 
_miss
;

2451 i(
cmp
 > 0)

2452 
_miss
;

2453 i(
cmp
 < 0)

2454 
_h
;

2463 i(
ags
 =
DB_KEYFIRST
)

2464 
_h
;

2466 
dx
 < (
db_dx_t
)(
	`NUM_ENT
(
h
- 
P_INDX
) &&

2467 
p
[
dx
] =p[dx + 
P_INDX
];

2468 
dx
 +
P_INDX
)

2470 
_h
;

2472 
_miss
;

2474 
_h
:

2475 *
exap
 = 
cmp
 == 0;

2481 
	`BT_STK_CLR
(

);

2482 
	`BT_STK_ENTER
(
dbp
->
v
,

2483 

, 
h
, 
dx
, cp->
lock
, cp->
lock_mode
, 
t
);

2484 i(
t
 != 0)

2485  (
t
);

2488 
_miss
:

2494 
	`DISCARD_CUR
(
dbc
, 
t
);

2495 

->
pgno
 = 
PGNO_INVALID
;

2496 i((
t_t
 = 
	`__LPUT
(
dbc
, 

->
lock
)!0 && 
t
 == 0)

2497 
t
 = 
t_t
;

2498 i(
t
 != 0)

2499  (
t
);

2501 
ch
: i((
t
 = 
	`__bam_ch
(
dbc
, 
ro_pgno
,

2502 
key
, 
sags
, 1, 
NULL
, 
exap
)) != 0)

2503  (
t
);

2506  (
	`__db_unknown_ag
(
dbp
->
v
, "__bamc_ch", 
ags
));

2509 

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

2510 

->
pgno
 = cp->
c
->
ge
->pgno;

2511 

->
dx
 = cp->
c
->indx;

2512 

->
lock
 = cp->
c
->lock;

2513 

->
lock_mode
 = cp->
c
->lock_mode;

2516 i(
ags
 =
DB_FIRST
 &&

2517 (
	`NUM_ENT
(

->
ge
=0 || 
	`IS_CUR_DELETED
(
dbc
)))

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

2519  (
t
);

2520 i(
ags
 =
DB_LAST
 &&

2521 (
	`NUM_ENT
(

->
ge
=0 || 
	`IS_CUR_DELETED
(
dbc
)))

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

2523  (
t
);

2526 
	}
}

2533 
	$__bamc_physd
(
dbc
)

2534 
DBC
 *
dbc
;

2536 
BTREE_CURSOR
 *

;

2537 
DB
 *
dbp
;

2538 
DBT
 
key
;

2539 
de_ge
, 
emy_ge
, 
exa
, 
t
;

2541 
dbp
 = 
dbc
->dbp;

2542 
	`memt
(&
key
, 0, (
DBT
));

2543 

 = (
BTREE_CURSOR
 *)
dbc
->

;

2544 
de_ge
 = 
emy_ge
 = 
t
 = 0;

2547 
de_ge
 = 
emy_ge
 =

2548 
	`NUM_ENT
(

->
ge
=(
	`TYPE
(->ge=
P_LBTREE
 ? 2 : 1);

2555 i(
de_ge
 &&

2556 !
	`F_ISSET
(
dbc
, 
DBC_OPD
&& F_ISSET(
dbp
, 
DB_AM_REVSPLITOFF
))

2557 
de_ge
 = 0;

2564 i(
de_ge
 && 

->
pgno
 =->
ro
)

2565 
de_ge
 = 0;

2578 i(
de_ge
) {

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

->
ge
,

2580 0, &
key
, &
dbc
->
my_rkey
.
da
, &dbc->my_rkey.
un
)) != 0)

2581  (
t
);

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

2600 &

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

2601  (
t
);

2602 i(
	`TYPE
(

->
ge
=
P_LBTREE
) {

2603 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

2604  (
t
);

2605 i(!
emy_ge
)

2606 i((
t
 = 
	`__bam__di
(
dbc
,

2607 
	`PGNO
(

->
ge
), cp->
dx
, -1)) != 0)

2608  (
t
);

2610 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

2611  (
t
);

2614 
	`F_CLR
(

, 
C_DELETED
);

2616 i(!
emy_ge
)

2617 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(

->
ge
), cp->
dx
, -1)) != 0)

2618  (
t
);

2623 i(
	`F_ISSET
(
dbc
->
dbp
, 
DB_AM_READ_UNCOMMITTED
)) {

2624 i((
t
 = 
	`__TLPUT
(
dbc
, 

->
lock
)) != 0)

2625  (
t
);

2626 

->
lock_mode
 = 
DB_LOCK_WWRITE
;

2629 i(!
de_ge
)

2632 
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
, &
key
, 
SR_DEL
, 0, 
NULL
, &
exa
);

2638 i(
t
 == 0)

2639 
	`DISCARD_CUR
(
dbc
, 
t
);

2640 i(
t
 == 0)

2641 
t
 = 
	`__bam_dges
(
dbc
, 1, 0);

2643 ()
	`__bam_kl
(
dbc
, 0);

2645  (
t
);

2646 
	}
}

2653 
	$__bamc_gack
(
dbc
)

2654 
DBC
 *
dbc
;

2656 
BTREE_CURSOR
 *

;

2657 
DB
 *
dbp
;

2658 
DBT
 
dbt
;

2659 
DB_MPOOLFILE
 *
mpf
;

2660 
PAGE
 *
h
;

2661 
exa
, 
t
, 
t_t
;

2663 
dbp
 = 
dbc
->dbp;

2664 
mpf
 = 
dbp
->mpf;

2665 

 = (
BTREE_CURSOR
 *)
dbc
->

;

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

->
pgno
,

2673 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

2674  (
t
);

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

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

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

2680 
r
;

2683 
exa
 = 0;

2684 
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
,

2685 &
dbt
, 
SR_KEYFIRST
, 1, 
NULL
, &
exa
);

2687 
r
:

2688 i((
t_t
 = 
	`__memp_ut
(
mpf
,

2689 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)!0 && 
t
 == 0)

2690 
t
 = 
t_t
;

2692  (
t
);

2693 
	}
}

2701 
	$__bam_isd
(
dbc
, 
pgn
)

2702 
DBC
 *
dbc
;

2703 
db_pgno_t
 *
pgn
;

2705 
BOVERFLOW
 *
bo
;

2707 i(
	`TYPE
(
dbc
->

->
ge
!
P_LBTREE
)

2710 
bo
 = 
	`GET_BOVERFLOW
(
dbc
->
dbp
,

2711 
dbc
->

->
ge
, dbc->->
dx
 + 
O_INDX
);

2712 i(
	`B_TYPE
(
bo
->
ty
=
B_DUPLICATE
) {

2713 *
pgn
 = 
bo
->
pgno
;

2717 
	}
}

2725 
	$__bam_d_exis
(
dbc
, 
pgno
)

2726 
DBC
 *
dbc
;

2727 
db_pgno_t
 
pgno
;

2729 
PAGE
 *
h
;

2730 
t
;

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

2733 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

2734  (
t
);

2741 i(
	`NUM_ENT
(
h
) == 0)

2742 
t
 = 0;

2744 
t
 = 
DB_KEYEXIST
;

2746 ()
	`__memp_ut
(
dbc
->
dbp
->
mpf
, dbc->
thad_fo
, 
h
, dbc->
iܙy
);

2748  (
t
);

2749 
	}
}

	@../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
->
v
, 
	`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
->
v
, 
	`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
->
v
, 
	`PGNO
(
h
)));

150  (
	`__db_pgfmt
(
dbp
->
v
, 
	`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
->
thad_fo
, 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
, 
dbc
->
thad_fo
, 
g
->
ge
, dbc->
iܙy
);

297 
g
->
ge
 = 
NULL
;

298 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

299 
t
 = 
t_t
;

300 i(
t
 != 0)

301 
r_c
;

304 
disrd
: 
g
 = 

->

;pg < 
ack_g
; ++epg) {

305 i((
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

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

307 
t
 = 
t_t
;

308 
g
->
ge
 = 
NULL
;

309 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

310 
t
 = 
t_t
;

312 i(
t
 != 0)

313 
r
;

316 ++
g
 <

->
c
) {

317 i((
t
 = 
	`__memp_dty
(
mpf
, &
g
->
ge
,

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

319 
r
;

326 i(
	`NUM_ENT
(
g
->
ge
) != 0) {

327 
	`DB_ASSERT
(
dbp
->
v
, 
	`LEVEL
(
g
->
ge
) != 1);

329 i((
t
 = 
	`__bam_dem
(
dbc
, 
g
->
ge
,pg->
dx
)) != 0)

330 
r
;

338 i(
	`NUM_ENT
(
g
->
ge
) != 0)

339 
r
;

342 
t
 = 
	`__db_
(
dbc
, 
g
->
ge
);

343 i(

->
ge
 =
g
->page)

344 

->
ge
 = 
NULL
;

345 
g
->
ge
 = 
NULL
;

346 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

347 
t
 = 
t_t
;

348 i(
t
 != 0)

349 
r_c
;

353 
r_c
: ++
g
;

354 
r
: ; 
g
 <

->
c
; ++epg) {

355 i(
g
->
ge
 !
NULL
) {

356 ()
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

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

358 
g
->
ge
 = 
NULL
;

360 ()
	`__TLPUT
(
dbc
, 
g
->
lock
);

362 
	`BT_STK_CLR
(

);

363  (
t
);

365 
	`BT_STK_CLR
(

);

373 
ro_pgno
 = 

->
ro
;

374 i(
pgno
 !
ro_pgno
 || 
nems
 != 1)

377 
de
 = 0; !done;) {

379 

 = 
chd
 = 
NULL
;

380 
	`LOCK_INIT
(
p_lock
);

381 
	`LOCK_INIT
(
c_lock
);

384 
pgno
 = 
ro_pgno
;

385 i((
t
 =

386 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_WRITE
, 0, &
p_lock
)) != 0)

387 

;

388 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
thad_fo
, dbc->
txn
,

389 
DB_MPOOL_DIRTY
, &

)) != 0)

390 

;

392 i(
	`NUM_ENT
(

) != 1)

393 

;

395 
	`TYPE
(

)) {

396 
P_IBTREE
:

401 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 

, 0);

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

403 i((
t
 = 
	`__db_doff
(
dbc
,

404 ((
BOVERFLOW
 *)
bi
->
da
)->
pgno
)) != 0)

405 

;

406 
pgno
 = 
bi
->pgno;

408 
P_IRECNO
:

409 
pgno
 = 
	`GET_RINTERNAL
(
dbp
, 

, 0)->pgno;

412 

;

416 i((
t
 =

417 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_WRITE
, 0, &
c_lock
)) != 0)

418 

;

419 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
dbc
->
thad_fo
, dbc->
txn
,

420 
DB_MPOOL_DIRTY
, &
chd
)) != 0)

421 

;

424 i(
	`DBC_LOGGING
(
dbc
)) {

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

426 
a
.
da
 = 
chd
;

427 
a
.
size
 = 
dbp
->
pgsize
;

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

429 
b
.
da
 = 
	`P_ENTRY
(
dbp
, 

, 0);

430 
b
.
size
 = 
	`TYPE
(

=
P_IRECNO
 ? 
RINTERNAL_SIZE
 :

431 
	`BINTERNAL_SIZE
(((
BINTERNAL
 *)
b
.
da
)->
n
);

432 i((
t
 = 
	`__bam_rl_log
(
dbp
, 
dbc
->
txn
,

433 &
chd
->
l
, 0, 
	`PGNO
(chd), &
a
, PGNO(

),

434 
	`RE_NREC
(

), &
b
, &->
l
)) != 0)

435 

;

437 
	`LSN_NOT_LOGGED
(
chd
->
l
);

450 
	`COMPQUIET
(
rt
, 0);

451 i(
	`F_ISSET
(

, 
C_RECNUM
&& 
	`LEVEL
(
chd
> 
LEAFLEVEL
)

452 
rt
 = 
	`RE_NREC
(

);

453 
	`memy
(

, 
chd
, 
dbp
->
pgsize
);

454 
	`PGNO
(


ro_pgno
;

455 i(
	`F_ISSET
(

, 
C_RECNUM
&& 
	`LEVEL
(
chd
> 
LEAFLEVEL
)

456 
	`RE_NREC_SET
(

, 
rt
);

459 i((
t
 = 
	`__bam__rl
(
dbc
, 
	`PGNO
(
chd
), 
ro_pgno
)) != 0)

460 

;

467 i((
t
 = 
	`__db_
(
dbc
, 
chd
)) != 0) {

468 
chd
 = 
NULL
;

469 

;

471 
chd
 = 
NULL
;

474 

: 
de
 = 1;

476 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
p_lock
)!0 && 
t
 == 0)

477 
t
 = 
t_t
;

478 i(

 !
NULL
 &&

479 (
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

480 

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

481 
t
 = 
t_t
;

482 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
c_lock
)!0 && 
t
 == 0)

483 
t
 = 
t_t
;

484 i(
chd
 !
NULL
 &&

485 (
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

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

487 
t
 = 
t_t
;

490  (
t
);

491 
	}
}

500 
	$__bam_lk
(
dbc
, 
g
, 
w_pgno
)

501 
DBC
 *
dbc
;

502 
PAGE
 *
g
;

503 
db_pgno_t
 
w_pgno
;

505 
DB
 *
dbp
;

506 
DB_LOCK
 
l
, 
l
;

507 
DB_LSN
 *
Ƣp
, *
p
, 
t_l
;

508 
DB_MPOOLFILE
 *
mpf
;

509 
PAGE
 *

, *

;

510 
t
, 
t_t
;

512 
dbp
 = 
dbc
->dbp;

513 

 = 

 = 
NULL
;

514 
	`LOCK_INIT
(
l
);

515 
	`LOCK_INIT
(
l
);

516 
Ƣp
 = 
p
 = 
NULL
;

517 
mpf
 = 
dbp
->mpf;

518 
t
 = 0;

525 i(
g
->
xt_pgno
 !
PGNO_INVALID
) {

526 i((
t
 = 
	`__db_lg
(
dbc
,

527 0, 
g
->
xt_pgno
, 
DB_LOCK_WRITE
, 0, &
l
)) != 0)

528 
r
;

529 i((
t
 = 
	`__memp_fg
(
mpf
, &
g
->
xt_pgno
,

530 
dbc
->
thad_fo
, dbc->
txn
, 
DB_MPOOL_DIRTY
, &

)) != 0) {

531 
t
 = 
	`__db_pgr
(
dbp
, 
g
->
xt_pgno
,et);

532 
r
;

534 
Ƣp
 = &

->
l
;

536 i(
g
->
ev_pgno
 !
PGNO_INVALID
) {

537 i((
t
 = 
	`__db_lg
(
dbc
,

538 0, 
g
->
ev_pgno
, 
DB_LOCK_WRITE
, 0, &
l
)) != 0)

539 
r
;

540 i((
t
 = 
	`__memp_fg
(
mpf
, &
g
->
ev_pgno
,

541 
dbc
->
thad_fo
, dbc->
txn
, 
DB_MPOOL_DIRTY
, &

)) != 0) {

542 
t
 = 
	`__db_pgr
(
dbp
, 
g
->
ev_pgno
,et);

543 
r
;

545 
p
 = &

->
l
;

549 i(
	`DBC_LOGGING
(
dbc
)) {

550 i((
t
 = 
	`__bam_lk_log
(
dbp
, 
dbc
->
txn
, &
t_l
, 0,

551 
g
->
pgno
, 
w_pgno
,ag->
ev_pgno
, 
p
,

552 
g
->
xt_pgno
, 
Ƣp
)) != 0)

553 
r
;

555 
	`LSN_NOT_LOGGED
(
t_l
);

556 i(

 !
NULL
)

557 

->
l
 = 
t_l
;

558 i(

 !
NULL
)

559 

->
l
 = 
t_l
;

564 i(

 !
NULL
) {

565 i(
w_pgno
 =
PGNO_INVALID
)

566 

->
ev_pgno
 = 
g
->prev_pgno;

568 

->
ev_pgno
 = 
w_pgno
;

569 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

, dbc->
iܙy
);

570 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
l
)!0 && 
t
 == 0)

571 
t
 = 
t_t
;

572 i(
t
 != 0)

573 
r
;

576 i(

 !
NULL
) {

577 i(
w_pgno
 =
PGNO_INVALID
)

578 

->
xt_pgno
 = 
g
->next_pgno;

580 

->
xt_pgno
 = 
w_pgno
;

581 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

, dbc->
iܙy
);

582 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
l
)!0 && 
t
 == 0)

583 
t
 = 
t_t
;

584 i(
t
 != 0)

585 
r
;

589 
r
: i(

 !
NULL
)

590 ()
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

, dbc->
iܙy
);

591 ()
	`__TLPUT
(
dbc
, 
l
);

592 i(

 !
NULL
)

593 ()
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

, dbc->
iܙy
);

594 ()
	`__TLPUT
(
dbc
, 
l
);

595  (
t
);

596 
	}
}

605 
	$__bam_pupde
(
dbc
, 
g
)

606 
DBC
 *
dbc
;

607 
PAGE
 *
g
;

609 
BTREE_CURSOR
 *

;

610 
ENV
 *
v
;

611 
EPG
 *
g
;

612 
t
;

614 
v
 = 
dbc
->env;

615 

 = (
BTREE_CURSOR
 *)
dbc
->

;

616 
t
 = 0;

624 
g
 = &

->
c
[-1];pg >->

;pg--) {

625 i((
t
 = 
	`__memp_dty
(
dbc
->
dbp
->
mpf
, &
g
->
ge
,

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

627  (
t
);

628 i((
t
 = 
	`__bam_dem
(
dbc
, 
g
->
ge
,pg->
dx
)) != 0)

629  (
t
);

630 
g
->
dx
--;

631 i((
t
 = 
	`__bam_p
(
dbc
, 
g
, 0,

632 
g
, 
g
[1].
ge
, 
BPI_NORECNUM
)) != 0) {

633 i(
t
 =
DB_NEEDSPLIT
) {

635 
	`__db_rx
(
v
,

637 
dbc
->
dbp
->
ame
, (
u_lg
)
	`PGNO
(
g
->
ge
));

638 
t
 = 
	`__v_nic
(
v
, 
EINVAL
);

640  (
t
);

643  (
t
);

644 
	}
}

	@../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
->
v
, 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
->
v
, 
t
->
_sour
);

92 
	`__os_
(
dbp
->
v
, 
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
->
v
, "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
->
v
, "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
->
v
, 
_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_THREAD_INFO
 *

;

69 
DB_TXN
 *
txn
;

70 cڡ *
me
;

71 
db_pgno_t
 
ba_pgno
;

72 
u_t32_t
 
ags
;

74 
BTREE
 *
t
;

76 
	`COMPQUIET
(
me
, 
NULL
);

77 
t
 = 
dbp
->
bt_
;

84 i(
t
->
bt_com
 =
__bam_defcmp
 &&->
bt_efix
 !
__bam_defx
) {

85 
	`__db_rx
(
dbp
->
v
,

87  (
EINVAL
);

94 i(
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
t
->
bt_mkey
, dbp->
pgsize
) >

95 
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
DEFMINKEYPAGE
, dbp->
pgsize
)) {

96 
	`__db_rx
(
dbp
->
v
,

98 (
u_lg
)
t
->
bt_mkey
, (u_lg)
dbp
->
pgsize
);

99  (
EINVAL
);

103  (
	`__bam_ad_ro
(
dbp
, 

, 
txn
, 
ba_pgno
, 
ags
));

104 
	}
}

112 
	$__bam_machk
(
dbp
, 
me
, 
btm
)

113 
DB
 *
dbp
;

114 cڡ *
me
;

115 
BTMETA
 *
btm
;

117 
ENV
 *
v
;

118 
u_t32_t
 
vs
;

119 
t
;

121 
v
 = 
dbp
->env;

127 
vs
 = 
btm
->
dbma
.
vsi
;

128 i(
	`F_ISSET
(
dbp
, 
DB_AM_SWAP
))

129 
	`M_32_SWAP
(
vs
);

130 
vs
) {

133 
	`__db_rx
(
v
,

135 
me
, (
u_lg
)
vs
);

136  (
DB_OLD_VERSION
);

141 
	`__db_rx
(
v
,

142 "%s: unsu܋d b vsi: %lu", 
me
, (
u_lg
)
vs
);

143  (
EINVAL
);

147 i(
	`F_ISSET
(
dbp
, 
DB_AM_SWAP
) &&

148 (
t
 = 
	`__bam_msw
(
v
, (
PAGE
 *)
btm
)) != 0)

149  (
t
);

155 i((
t
 =

156 
	`__db_fchk
(
v
, "DB->ݒ", 
btm
->
dbma
.
ags
, 
BTM_MASK
)) != 0)

157  (
t
);

159 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_RECNO
)) {

160 i(
dbp
->
ty
 =
DB_BTREE
)

161 
wrg_ty
;

162 
dbp
->
ty
 = 
DB_RECNO
;

163 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_RECNO
);

165 i(
dbp
->
ty
 =
DB_RECNO
)

166 
wrg_ty
;

167 
dbp
->
ty
 = 
DB_BTREE
;

168 
	`DB_ILLEGAL_METHOD
(
dbp
, 
DB_OK_BTREE
);

171 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_DUP
))

172 
	`F_SET
(
dbp
, 
DB_AM_DUP
);

174 i(
	`F_ISSET
(
dbp
, 
DB_AM_DUP
)) {

175 
	`__db_rx
(
v
,

177 
me
);

178  (
EINVAL
);

181 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_RECNUM
)) {

182 i(
dbp
->
ty
 !
DB_BTREE
)

183 
wrg_ty
;

184 
	`F_SET
(
dbp
, 
DB_AM_RECNUM
);

186 i((
t
 = 
	`__db_fcchk
(
v
,

187 "DB->ݒ", 
dbp
->
ags
, 
DB_AM_DUP
, 
DB_AM_RECNUM
)) != 0)

188  (
t
);

190 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
)) {

191 
	`__db_rx
(
v
,

193 
me
);

194  (
EINVAL
);

197 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_FIXEDLEN
)) {

198 i(
dbp
->
ty
 !
DB_RECNO
)

199 
wrg_ty
;

200 
	`F_SET
(
dbp
, 
DB_AM_FIXEDLEN
);

202 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
)) {

203 
	`__db_rx
(
v
,

205 
me
);

206  (
EINVAL
);

209 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_RENUMBER
)) {

210 i(
dbp
->
ty
 !
DB_RECNO
)

211 
wrg_ty
;

212 
	`F_SET
(
dbp
, 
DB_AM_RENUMBER
);

214 i(
	`F_ISSET
(
dbp
, 
DB_AM_RENUMBER
)) {

215 
	`__db_rx
(
v
,

217 
me
);

218  (
EINVAL
);

221 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_SUBDB
))

222 
	`F_SET
(
dbp
, 
DB_AM_SUBDB
);

224 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
)) {

225 
	`__db_rx
(
v
,

227 
me
);

228  (
EINVAL
);

231 i(
	`F_ISSET
(&
btm
->
dbma
, 
BTM_DUPSORT
)) {

232 i(
dbp
->
dup_com
 =
NULL
)

233 
dbp
->
dup_com
 = 
__bam_defcmp
;

234 
	`F_SET
(
dbp
, 
DB_AM_DUPSORT
);

236 i(
dbp
->
dup_com
 !
NULL
) {

237 
	`__db_rx
(
v
,

239 
me
);

240  (
EINVAL
);

244 
dbp
->
pgsize
 = 
btm
->
dbma
.
gesize
;

247 
	`memy
(
dbp
->
feid
, 
btm
->
dbma
.
uid
, 
DB_FILE_ID_LEN
);

251 
wrg_ty
:

252 i(
dbp
->
ty
 =
DB_BTREE
)

253 
	`__db_rx
(
v
,

256 
	`__db_rx
(
v
,

258  (
EINVAL
);

259 
	}
}

269 
	$__bam_ad_ro
(
dbp
, 

, 
txn
, 
ba_pgno
, 
ags
)

270 
DB
 *
dbp
;

271 
DB_THREAD_INFO
 *

;

272 
DB_TXN
 *
txn
;

273 
db_pgno_t
 
ba_pgno
;

274 
u_t32_t
 
ags
;

276 
BTMETA
 *
ma
;

277 
BTREE
 *
t
;

278 
DBC
 *
dbc
;

279 
DB_LOCK
 
mock
;

280 
DB_MPOOLFILE
 *
mpf
;

281 
t
, 
t_t
;

283 
	`COMPQUIET
(
ags
, 0);

285 
ma
 = 
NULL
;

286 
t
 = 
dbp
->
bt_
;

287 
	`LOCK_INIT
(
mock
);

288 
mpf
 = 
dbp
->mpf;

289 
t
 = 0;

292 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 0)) != 0)

293  (
t
);

296 i((
t
 =

297 
	`__db_lg
(
dbc
, 0, 
ba_pgno
, 
DB_LOCK_READ
, 0, &
mock
)) != 0)

298 
r
;

299 i((
t
 = 
	`__memp_fg
(
mpf
, &
ba_pgno
, 

, 
dbc
->
txn
, 0, &
ma
)) != 0)

300 
r
;

310 i(
ma
->
dbma
.
magic
 =
DB_BTREEMAGIC
) {

311 
t
->
bt_mkey
 = 
ma
->
mkey
;

312 
t
->
_d
 = ()
ma
->re_pad;

313 
t
->
_n
 = 
ma
->re_len;

315 
t
->
bt_ma
 = 
ba_pgno
;

316 
t
->
bt_ro
 = 
ma
->
ro
;

317 i(
	`PGNO
(
ma
=
PGNO_BASE_MD
 && !
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
))

318 
	`__memp_t_ϡ_pgno
(
mpf
, 
ma
->
dbma
.
ϡ_pgno
);

320 
	`DB_ASSERT
(
dbp
->
v
,

321 
	`IS_RECOVERING
(
dbp
->
v
|| 
	`F_ISSET
(dbp, 
DB_AM_RECOVER
));

333 
t
->
bt_gno
 = 
PGNO_INVALID
;

335 
r
:

336 i(
ma
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

337 

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

338 
t
 = 
t_t
;

339 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

340 
t
 = 
t_t
;

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

343 
t
 = 
t_t
;

344  (
t
);

345 
	}
}

354 
	$__bam__ma
(
dbp
, 
ma
, 
pgno
, 
lp
)

355 
DB
 *
dbp
;

356 
BTMETA
 *
ma
;

357 
db_pgno_t
 
pgno
;

358 
DB_LSN
 *
lp
;

360 
BTREE
 *
t
;

361 
ENV
 *
v
;

363 
v
 = 
dbp
->env;

364 
t
 = 
dbp
->
bt_
;

366 
	`memt
(
ma
, 0, (
BTMETA
));

367 
ma
->
dbma
.
l
 = *
lp
;

368 
ma
->
dbma
.
pgno
 =gno;

369 
ma
->
dbma
.
magic
 = 
DB_BTREEMAGIC
;

370 
ma
->
dbma
.
vsi
 = 
DB_BTREEVERSION
;

371 
ma
->
dbma
.
gesize
 = 
dbp
->
pgsize
;

372 i(
	`F_ISSET
(
dbp
, 
DB_AM_CHKSUM
))

373 
	`FLD_SET
(
ma
->
dbma
.
maags
, 
DBMETA_CHKSUM
);

374 i(
	`F_ISSET
(
dbp
, 
DB_AM_ENCRYPT
)) {

375 
ma
->
dbma
.
y_g
 = 
v
->
yo_hd
->
g
;

376 
	`DB_ASSERT
(
v
, 
ma
->
dbma
.
y_g
 != 0);

377 
ma
->
yo_magic
 = ma->
dbma
.
magic
;

379 
ma
->
dbma
.
ty
 = 
P_BTREEMETA
;

380 
ma
->
dbma
.

 = 
PGNO_INVALID
;

381 
ma
->
dbma
.
ϡ_pgno
 = 
pgno
;

382 i(
	`F_ISSET
(
dbp
, 
DB_AM_DUP
))

383 
	`F_SET
(&
ma
->
dbma
, 
BTM_DUP
);

384 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
))

385 
	`F_SET
(&
ma
->
dbma
, 
BTM_FIXEDLEN
);

386 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECNUM
))

387 
	`F_SET
(&
ma
->
dbma
, 
BTM_RECNUM
);

388 i(
	`F_ISSET
(
dbp
, 
DB_AM_RENUMBER
))

389 
	`F_SET
(&
ma
->
dbma
, 
BTM_RENUMBER
);

390 i(
	`F_ISSET
(
dbp
, 
DB_AM_SUBDB
))

391 
	`F_SET
(&
ma
->
dbma
, 
BTM_SUBDB
);

392 i(
dbp
->
dup_com
 !
NULL
)

393 
	`F_SET
(&
ma
->
dbma
, 
BTM_DUPSORT
);

394 i(
dbp
->
ty
 =
DB_RECNO
)

395 
	`F_SET
(&
ma
->
dbma
, 
BTM_RECNO
);

396 
	`memy
(
ma
->
dbma
.
uid
, 
dbp
->
feid
, 
DB_FILE_ID_LEN
);

398 
ma
->
mkey
 = 
t
->
bt_mkey
;

399 
ma
->
_n
 = 
t
->re_len;

400 
ma
->
_d
 = (
u_t32_t
)
t
->re_pad;

401 
	}
}

417 
	$__bam_w_fe
(
dbp
, 

, 
txn
, 
fhp
, 
me
)

418 
DB
 *
dbp
;

419 
DB_THREAD_INFO
 *

;

420 
DB_TXN
 *
txn
;

421 
DB_FH
 *
fhp
;

422 cڡ *
me
;

424 
BTMETA
 *
ma
;

425 
DBT
 
pdbt
;

426 
DB_LSN
 
l
;

427 
DB_MPOOLFILE
 *
mpf
;

428 
DB_PGINFO
 
pgfo
;

429 
ENV
 *
v
;

430 
PAGE
 *
ro
;

431 
db_pgno_t
 
pgno
;

432 
t
, 
t_t
;

433 *
buf
;

435 
v
 = 
dbp
->env;

436 
mpf
 = 
dbp
->mpf;

437 
ro
 = 
NULL
;

438 
ma
 = 
NULL
;

439 
buf
 = 
NULL
;

441 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
)) {

443 
pgno
 = 
PGNO_BASE_MD
;

444 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 

, 
txn
,

445 
DB_MPOOL_CREATE
 | 
DB_MPOOL_DIRTY
, &
ma
)) != 0)

446  (
t
);

447 
	`LSN_NOT_LOGGED
(
l
);

448 
	`__bam__ma
(
dbp
, 
ma
, 
PGNO_BASE_MD
, &
l
);

449 
ma
->
ro
 = 1;

450 
ma
->
dbma
.
ϡ_pgno
 = 1;

451 i((
t
 =

452 
	`__db_log_ge
(
dbp
, 
txn
, &
l
, 
pgno
, (
PAGE
 *)
ma
)) != 0)

453 
r
;

454 
t
 = 
	`__memp_ut
(
mpf
, 

, 
ma
, 
dbp
->
iܙy
);

455 
ma
 = 
NULL
;

456 i(
t
 != 0)

457 
r
;

460 
pgno
 = 1;

461 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

462 

, 
txn
, 
DB_MPOOL_CREATE
, &
ro
)) != 0)

463 
r
;

464 
	`P_INIT
(
ro
, 
dbp
->
pgsize
, 1, 
PGNO_INVALID
, PGNO_INVALID,

465 
LEAFLEVEL
, 
dbp
->
ty
 =
DB_RECNO
 ? 
P_LRECNO
 : 
P_LBTREE
);

466 
	`LSN_NOT_LOGGED
(
ro
->
l
);

467 i((
t
 =

468 
	`__db_log_ge
(
dbp
, 
txn
, &
ro
->
l
, 
pgno
,oot)) != 0)

469 
r
;

470 
t
 = 
	`__memp_ut
(
mpf
, 

, 
ro
, 
dbp
->
iܙy
);

471 
ro
 = 
NULL
;

472 i(
t
 != 0)

473 
r
;

475 
	`memt
(&
pdbt
, 0, (pdbt));

478 
pgfo
.
db_gesize
 = 
dbp
->
pgsize
;

479 
pgfo
.
ags
 =

480 
	`F_ISSET
(
dbp
, (
DB_AM_CHKSUM
 | 
DB_AM_ENCRYPT
 | 
DB_AM_SWAP
));

481 
pgfo
.
ty
 = 
dbp
->type;

482 
pdbt
.
da
 = &
pgfo
;

483 
pdbt
.
size
 = (
pgfo
);

484 i((
t
 = 
	`__os_oc
(
v
, 1, 
dbp
->
pgsize
, &
buf
)) != 0)

485  (
t
);

486 
ma
 = (
BTMETA
 *)
buf
;

487 
	`LSN_NOT_LOGGED
(
l
);

488 
	`__bam__ma
(
dbp
, 
ma
, 
PGNO_BASE_MD
, &
l
);

489 
ma
->
ro
 = 1;

490 
ma
->
dbma
.
ϡ_pgno
 = 1;

491 i((
t
 = 
	`__db_pgout
(

492 
dbp
->
dbv
, 
PGNO_BASE_MD
, 
ma
, &
pdbt
)) != 0)

493 
r
;

494 i((
t
 = 
	`__f_wre
(
v
, 
txn
, 
me
, 
DB_APP_DATA
, 
fhp
,

495 
dbp
->
pgsize
, 0, 0, 
buf
, dbp->pgsize, 1, 
	`F_ISSET
(

496 
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_LOG_NOT_DURABLE
 : 0)) != 0)

497 
r
;

498 
ma
 = 
NULL
;

501 #ifde
DIAGNOSTIC


502 
	`memt
(
buf
, 
CLEAR_BYTE
, 
dbp
->
pgsize
);

504 
ro
 = (
PAGE
 *)
buf
;

505 
	`P_INIT
(
ro
, 
dbp
->
pgsize
, 1, 
PGNO_INVALID
, PGNO_INVALID,

506 
LEAFLEVEL
, 
dbp
->
ty
 =
DB_RECNO
 ? 
P_LRECNO
 : 
P_LBTREE
);

507 
	`LSN_NOT_LOGGED
(
ro
->
l
);

508 i((
t
 =

509 
	`__db_pgout
(
dbp
->
dbv
, 
ro
->
pgno
,o, &
pdbt
)) != 0)

510 
r
;

511 i((
t
 = 
	`__f_wre
(
v
, 
txn
, 
me
, 
DB_APP_DATA
, 
fhp
,

512 
dbp
->
pgsize
, 1, 0, 
buf
, dbp->pgsize, 1, 
	`F_ISSET
(

513 
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_LOG_NOT_DURABLE
 : 0)) != 0)

514 
r
;

515 
ro
 = 
NULL
;

518 
r
: i(
buf
 !
NULL
)

519 
	`__os_
(
v
, 
buf
);

521 i(
ma
 !
NULL
 &&

522 (
t_t
 = 
	`__memp_ut
(
mpf
, 

,

523 
ma
, 
dbp
->
iܙy
)!0 && 
t
 == 0)

524 
t
 = 
t_t
;

525 i(
ro
 !
NULL
 &&

526 (
t_t
 = 
	`__memp_ut
(
mpf
, 

,

527 
ro
, 
dbp
->
iܙy
)!0 && 
t
 == 0)

528 
t
 = 
t_t
;

530  (
t
);

531 
	}
}

540 
	$__bam_w_subdb
(
mdbp
, 
dbp
, 

, 
txn
)

541 
DB
 *
mdbp
, *
dbp
;

542 
DB_THREAD_INFO
 *

;

543 
DB_TXN
 *
txn
;

545 
BTMETA
 *
ma
;

546 
DBC
 *
dbc
;

547 
DB_LOCK
 
mock
;

548 
DB_LSN
 
l
;

549 
DB_MPOOLFILE
 *
mpf
;

550 
ENV
 *
v
;

551 
PAGE
 *
ro
;

552 
t
, 
t_t
;

554 
v
 = 
mdbp
->env;

555 
mpf
 = 
mdbp
->mpf;

556 
dbc
 = 
NULL
;

557 
ma
 = 
NULL
;

558 
ro
 = 
NULL
;

560 i((
t
 = 
	`__db_curs
(
mdbp
, 

, 
txn
,

561 &
dbc
, 
	`CDB_LOCKING
(
v
? 
DB_WRITECURSOR
 : 0)) != 0)

562  (
t
);

565 i((
t
 = 
	`__db_lg
(
dbc
,

566 0, 
dbp
->
ma_pgno
, 
DB_LOCK_WRITE
, 0, &
mock
)) != 0)

567 
r
;

568 i((
t
 = 
	`__memp_fg
(
mpf
, &
dbp
->
ma_pgno
,

569 

, 
txn
, 
DB_MPOOL_CREATE
, &
ma
)) != 0)

570 
r
;

573 
l
 = 
ma
->
dbma
.lsn;

574 
	`__bam__ma
(
dbp
, 
ma
, dbp->
ma_pgno
, &
l
);

575 i((
t
 = 
	`__db_log_ge
(
mdbp
,

576 
txn
, &
ma
->
dbma
.
l
, 
dbp
->
ma_pgno
, (
PAGE
 *)meta)) != 0)

577 
r
;

580 i((
t
 = 
	`__db_w
(
dbc
,

581 
dbp
->
ty
 =
DB_RECNO
 ? 
P_LRECNO
 : 
P_LBTREE
, &
ro
)) != 0)

582 
r
;

583 
ro
->
v
 = 
LEAFLEVEL
;

585 i(
	`DBENV_LOGGING
(
v
) &&

586 #i!
	`defed
(
DEBUG_WOP
)

587 
txn
 !
NULL
 &&

590 (
t
 = 
	`__bam_ro_log
(
mdbp
, 
txn
, &
ma
->
dbma
.
l
, 0,

591 
ma
->
dbma
.
pgno
, 
ro
->pgno, &ma->dbma.
l
)) != 0)

592 
r
;

594 
ma
->
ro
 =o->
pgno
;

595 i((
t
 =

596 
	`__db_log_ge
(
mdbp
, 
txn
, &
ro
->
l
,o->
pgno
,oot)) != 0)

597 
r
;

600 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

601 
r
;

602 
ma
 = 
NULL
;

603 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

604 
r
;

605 
ro
 = 
NULL
;

606 
r
:

607 i(
ma
 !
NULL
)

608 i((
t_t
 = 
	`__memp_ut
(
mpf
, 

,

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

610 
t
 = 
t_t
;

611 i(
ro
 !
NULL
)

612 i((
t_t
 = 
	`__memp_ut
(
mpf
, 

,

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

614 
t
 = 
t_t
;

615 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

616 
t
 = 
t_t
;

617 i(
dbc
 !
NULL
)

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

619 
t
 = 
t_t
;

620  (
t
);

621 
	}
}

	@../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 
BKEYDATA
 *
bk
, 
bk_tmp
;

74 
BTREE
 *
t
;

75 
BTREE_CURSOR
 *

;

76 
DB
 *
dbp
;

77 
DBT
 
bk_hdr
, 
tdbt
;

78 
DB_MPOOLFILE
 *
mpf
;

79 
ENV
 *
v
;

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 
v
 = 
dbp
->env;

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_
(
v
, 
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
(
v
, 
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
->
thad_fo
, 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
(
v
,

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
(
v
, "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
,

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

250  (
t
);

251 i(

->
c
->
ge
 == cp->page)

252 

->
c
->
ge
 = 
h
;

253 

->
ge
 = 
h
;

264 

) {

265 
DB_KEYFIRST
:

266 i(
bigkey
) {

267 i((
t
 = 
	`__bam_ovput
(
dbc
,

268 
B_OVERFLOW
, 
PGNO_INVALID
, 
h
, 
dx
, 
key
)) != 0)

269  (
t
);

271 i((
t
 = 
	`__db_pem
(
dbc
, 
h
, 
dx
,

272 
	`BKEYDATA_SIZE
(
key
->
size
), 
NULL
, key)) != 0)

273  (
t
);

275 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
, 1)) != 0)

276  (
t
);

277 ++
dx
;

279 
DB_AFTER
:

280 i(
	`TYPE
(
h
=
P_LBTREE
) {

282 i((
t
 =

283 
	`__bam_adjdx
(
dbc
, 
h
, 
dx
 + 
P_INDX
, indx, 1)) != 0)

284  (
t
);

285 i((
t
 =

286 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
 + 
P_INDX
, 1)) != 0)

287  (
t
);

289 
dx
 += 3;

291 

->
dx
 += 2;

293 ++
dx
;

294 

->
dx
 += 1;

297 
DB_BEFORE
:

298 i(
	`TYPE
(
h
=
P_LBTREE
) {

300 i((
t
 = 
	`__bam_adjdx
(
dbc
, 
h
, 
dx
, indx, 1)) != 0)

301  (
t
);

302 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
, 1)) != 0)

303  (
t
);

305 ++
dx
;

308 
DB_CURRENT
:

316 i((
t
 = 
	`__bam__de
(
dbp
, 
	`PGNO
(
h
), 
dx
, 0, 
NULL
)) != 0)

317  (
t
);

319 i(
	`TYPE
(
h
=
P_LBTREE
)

320 ++
dx
;

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

330 i(
	`TYPE
(
h
=
P_LBTREE
 || TYPE(h=
P_LDUP
)

331 
was_ded
 = 
	`B_DISSET
(
bk
->
ty
);

342 i(
bigda
 || 
	`B_TYPE
(
bk
->
ty
!
B_KEYDATA
) {

343 i((
t
 = 
	`__bam_dem
(
dbc
, 
h
, 
dx
)) != 0)

344  (
t
);

345 
d
 = 1;

350 
a
 = 1;

353  (
	`__db_unknown_ag
(
v
, "DB->put", 

));

357 i(
bigda
) {

362 
	`DB_ASSERT
(
v
, !
	`LF_ISSET
(
BI_DELETED
));

363 
t
 = 
	`__bam_ovput
(
dbc
,

364 
B_OVERFLOW
, 
PGNO_INVALID
, 
h
, 
dx
, 
da
);

366 i(
	`LF_ISSET
(
BI_DELETED
)) {

367 
	`B_TSET_DELETED
(
bk_tmp
.
ty
, 
B_KEYDATA
);

368 
bk_tmp
.
n
 = 
da
->
size
;

369 
bk_hdr
.
da
 = &
bk_tmp
;

370 
bk_hdr
.
size
 = 
	`SSZA
(
BKEYDATA
, 
da
);

371 
t
 = 
	`__db_pem
(
dbc
, 
h
, 
dx
,

372 
	`BKEYDATA_SIZE
(
da
->
size
), &
bk_hdr
, data);

373 } i(
a
)

374 
t
 = 
	`__bam_rem
(
dbc
, 
h
, 
dx
, 
da
);

376 
t
 = 
	`__db_pem
(
dbc
, 
h
, 
dx
,

377 
	`BKEYDATA_SIZE
(
da
->
size
), 
NULL
, data);

379 i(
t
 != 0) {

380 i(
d
 =1 && (
t_t
 =

381 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
 + 1, -1)) != 0) {

382 
	`__db_r
(
v
, 
t_t
,

384  (
	`__v_nic
(
v
, 
t_t
));

386  (
t
);

393 i(

 !
DB_CURRENT
) {

394 i((
t
 = 
	`__bam__di
(
dbc
, 
	`PGNO
(
h
), 
dx
, 1)) != 0)

395  (
t
);

396 

->
dx
 = 
	`TYPE
(
h
=
P_LBTREE
 ? indx - 
O_INDX
 : indx;

404 i(
	`F_ISSET
(

, 
C_RECNUM
&& (

 !
DB_CURRENT
 || 
was_ded
))

405 i((
t
 = 
	`__bam_adju
(
dbc
, 1)) != 0)

406  (
t
);

414 i(
dudju
 &&

415 (
t
 = 
	`__bam_dup_cvt
(
dbc
, 
h
, 
dx
 - 
O_INDX
, 
t
)) != 0)

416  (
t
);

419 i(
dbc
->
dbty
 =
DB_RECNO
)

420 
t
->
_modifd
 = 1;

422  (
t
);

423 
	}
}

429 
u_t32_t


430 
	$__bam_size
(
dbp
, 

, 
da
, 
h
, 
dx
)

431 
DB
 *
dbp
;

432 
u_t32_t
 

, 
dx
;

433 
DBT
 *
da
;

434 
PAGE
 *
h
;

436 
BKEYDATA
 *
bk
;

437 
u_t32_t
 
nbys
;

443 i(

 !
DB_CURRENT
)

444  (
da
->
doff
 + da->
size
);

450 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + (
	`TYPE
(h=
P_LBTREE
 ? 
O_INDX
 : 0));

451 
nbys
 =

452 
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 ? ((
BOVERFLOW
 *)bk)->

 : bk->
n
;

454  (
	`__db_size
(
nbys
, 
da
));

455 
	}
}

462 
	$__bam_bud
(
dbc
, 

, 
dbt
, 
h
, 
dx
, 
nbys
)

463 
DBC
 *
dbc
;

464 
u_t32_t
 

, 
dx
, 
nbys
;

465 
DBT
 *
dbt
;

466 
PAGE
 *
h
;

468 
BKEYDATA
 *
bk
, 
tbk
;

469 
BOVERFLOW
 *
bo
;

470 
BTREE
 *
t
;

471 
DB
 *
dbp
;

472 
DBT
 
cy
, *
rda
;

473 
u_t32_t
 
n
, 

;

474 
u_t8_t
 *
p
;

475 
t
;

477 
	`COMPQUIET
(
bo
, 
NULL
);

479 
dbp
 = 
dbc
->dbp;

480 
t
 = 
dbp
->
bt_
;

483 
rda
 = &
dbc
->
my_rda
;

484 i(
rda
->
un
 < 
nbys
) {

485 i((
t
 = 
	`__os_loc
(
dbp
->
v
,

486 
nbys
, &
rda
->
da
)) != 0) {

487 
rda
->
un
 = 0;

488 
rda
->
da
 = 
NULL
;

489  (
t
);

491 
rda
->
un
 = 
nbys
;

498 
	`memt
(
rda
->
da
,

499 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? 
t
->
_d
 : 0, 
nbys
);

510 i(!
	`F_ISSET
(
dbt
, 
DB_DBT_PARTIAL
|| 

 !
DB_CURRENT
) {

511 
p
 = (
u_t8_t
 *)
rda
->
da
 + 
dbt
->
doff
;

512 

 = 
dbt
->
doff
;

513 
ur_cy
;

517 i(
dx
 < 
	`NUM_ENT
(
h
)) {

518 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + (
	`TYPE
(h=
P_LBTREE
 ?

519 
O_INDX
 : 0));

520 
bo
 = (
BOVERFLOW
 *)
bk
;

522 
bk
 = &
tbk
;

523 
	`B_TSET
(
bk
->
ty
, 
B_KEYDATA
);

524 
bk
->
n
 = 0;

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

531 
	`memt
(&
cy
, 0, (copy));

532 i((
t
 = 
	`__db_goff
(
dbp
, 
dbc
->
thad_fo
, dbc->
txn
, &
cy
,

533 
bo
->

, bo->
pgno
, &
rda
->
da
, &rda->
un
)) != 0)

534  (
t
);

537 

 = 
dbt
->
doff
;

538 
p
 = (
u_t8_t
 *)
rda
->
da
 + 
dbt
->
doff
;

551 i(
bo
->

 > 
dbt
->
doff
 + dbt->
dn
) {

552 
n
 = 
bo
->

 - (
dbt
->
doff
 + dbt->
dn
);

553 i(
dbt
->
dn
 !dbt->
size
)

554 
	`memmove
(
p
 + 
dbt
->
size
, + dbt->
dn
, 
n
);

555 

 +
n
;

559 
	`memy
(
rda
->
da
,

560 
bk
->
da
, 
dbt
->
doff
 > bk->
n
 ? bk->len : dbt->doff);

561 

 = 
dbt
->
doff
;

562 
p
 = (
u_t8_t
 *)
rda
->
da
 + 
dbt
->
doff
;

565 
n
 = 
dbt
->
doff
 + dbt->
dn
;

566 i(
bk
->
n
 >en) {

567 
	`memy
(
p
 + 
dbt
->
size
, 
bk
->
da
 + 
n
, bk->len -en);

568 

 +
bk
->
n
 -en;

572 
ur_cy
:

577 
	`memy
(
p
, 
dbt
->
da
, dbt->
size
);

578 

 +
dbt
->
size
;

581 
rda
->
size
 = 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? 
t
->
_n
 : 

;

582 
rda
->
dn
 = 0;

583 
rda
->
doff
 = 0;

584 
rda
->
ags
 = 0;

585 *
dbt
 = *
rda
;

587 
	}
}

596 
	$__bam_rem
(
dbc
, 
h
, 
dx
, 
da
)

597 
DBC
 *
dbc
;

598 
PAGE
 *
h
;

599 
u_t32_t
 
dx
;

600 
DBT
 *
da
;

602 
BKEYDATA
 *
bk
;

603 
DB
 *
dbp
;

604 
DBT
 
ig
, 

;

605 
db_dx_t
 
t
, 
lo
, 

, 
m
, 
off
, 
efix
, 
suffix
;

606 
t32_t
 
nbys
;

607 
t
;

608 
db_dx_t
 *
p
;

609 
u_t8_t
 *
p
, *
t
;

611 
dbp
 = 
dbc
->dbp;

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

621 i(
	`DBC_LOGGING
(
dbc
)) {

627 
m
 = 
da
->
size
 < 
bk
->
n
 ? data->size : bk->len;

628 
efix
 = 0,

629 
p
 = 
bk
->
da
, 
t
 = data->data;

630 
efix
 < 
m
 && *
p
 =*
t
; ++prefix, ++p, ++t)

633 
m
 -
efix
;

634 
suffix
 = 0,

635 
p
 = (
u_t8_t
 *)
bk
->
da
 + bk->
n
 - 1,

636 
t
 = (
u_t8_t
 *)
da
->d+ da->
size
 - 1;

637 
suffix
 < 
m
 && *
p
 =*
t
; ++suffix, --p, --t)

641 
ig
.
da
 = (
u_t8_t
 *)
bk
->d+ 
efix
;

642 
ig
.
size
 = 
bk
->
n
 - (
efix
 + 
suffix
);

643 

.
da
 = (
u_t8_t
 *)da->d+ 
efix
;

644 

.
size
 = 
da
->siz- (
efix
 + 
suffix
);

645 i((
t
 = 
	`__bam__log
(
dbp
, 
dbc
->
txn
, &
	`LSN
(
h
), 0, 
	`PGNO
(h),

646 &
	`LSN
(
h
), (
u_t32_t
)
dx
, (u_t32_t)
	`B_DISSET
(
bk
->
ty
),

647 &
ig
, &

, (
u_t32_t
)
efix
, (u_t32_t)
suffix
)) != 0)

648  (
t
);

650 
	`LSN_NOT_LOGGED
(
	`LSN
(
h
));

656 
p
 = 
	`P_INP
(
dbp
, 
h
);

657 
p
 = (
u_t8_t
 *)
h
 + 
	`HOFFSET
(h);

658 
t
 = (
u_t8_t
 *)
bk
;

666 
lo
 = 
	`BKEYDATA_SIZE
(
bk
->
n
);

667 

 = (
db_dx_t
)
	`BKEYDATA_SIZE
(
da
->
size
);

668 i(
lo
 !

) {

669 
nbys
 = 
lo
 - 

;

670 i(
p
 =
t
)

671 
p
[
dx
] +
nbys
;

673 
	`memmove
(
p
 + 
nbys
,, (
size_t
)(
t
 -));

676 
off
 = 
p
[
dx
];

677 
t
 = 0; c < 
	`NUM_ENT
(
h
); ++cnt)

678 i(
p
[
t
] <
off
)

679 
p
[
t
] +
nbys
;

683 
	`HOFFSET
(
h
+
nbys
;

684 
t
 +
nbys
;

688 
bk
 = (
BKEYDATA
 *)
t
;

689 
	`B_TSET
(
bk
->
ty
, 
B_KEYDATA
);

690 
bk
->
n
 = 
da
->
size
;

691 
	`memy
(
bk
->
da
, da->da, da->
size
);

694 
	}
}

701 
	$__bam_dup_check
(
dbc
, 

, 
h
, 
dx
, 
sz
, 

)

702 
DBC
 *
dbc
;

703 
u_t32_t
 

;

704 
PAGE
 *
h
;

705 
u_t32_t
 
dx
, 
sz
;

706 
db_dx_t
 *

;

708 
BKEYDATA
 *
bk
;

709 
DB
 *
dbp
;

710 
db_dx_t
 
t
, 
f
, *
p
;

712 
dbp
 = 
dbc
->dbp;

713 
p
 = 
	`P_INP
(
dbp
, 
h
);

719 
dx
 > 0 && 
p
[dx] =p[dx - 
P_INDX
])

720 
dx
 -
P_INDX
;

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

724 
sz
 +
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
 ?

725 
	`BKEYDATA_PSIZE
(
bk
->
n
: 
BOVERFLOW_PSIZE
;

728 
f
 = 
dx
;

737 
t
 = 

 =
DB_CURRENT
 ? 0 : 1;

738 
f
 = 
dx
;

739 
dx
 < 
	`NUM_ENT
(
h
&& 
p
[
f
] == inp[indx];

740 ++
t
, 
dx
 +
P_INDX
) {

741 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
);

742 
sz
 +
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
 ?

743 
	`BKEYDATA_PSIZE
(
bk
->
n
: 
BOVERFLOW_PSIZE
;

753 i(
t
 == 1)

762 i(
sz
 < 
dbp
->
pgsize
 / 4)

765 *

 = 
t
;

767 
	}
}

774 
	$__bam_dup_cvt
(
dbc
, 
h
, 
dx
, 
t
)

775 
DBC
 *
dbc
;

776 
PAGE
 *
h
;

777 
u_t32_t
 
dx
, 
t
;

779 
BKEYDATA
 *
bk
;

780 
DB
 *
dbp
;

781 
DBT
 
hdr
;

782 
DB_MPOOLFILE
 *
mpf
;

783 
PAGE
 *
dp
;

784 
db_dx_t
 
dx
, 
ddx
, 
f
, *
p
;

785 
t
, 
t_t
;

787 
dbp
 = 
dbc
->dbp;

788 
mpf
 = 
dbp
->mpf;

789 
p
 = 
	`P_INP
(
dbp
, 
h
);

792 
dx
 > 0 && 
p
[dx] =p[dx - 
P_INDX
])

793 
dx
 -
P_INDX
;

796 i((
t
 = 
	`__db_w
(
dbc
,

797 
dbp
->
dup_com
 =
NULL
 ? 
P_LRECNO
 : 
P_LDUP
, &
dp
)) != 0)

798  (
t
);

799 
	`P_INIT
(
dp
, 
dbp
->
pgsize
, dp->
pgno
,

800 
PGNO_INVALID
, PGNO_INVALID, 
LEAFLEVEL
, 
	`TYPE
(
dp
));

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

808 
f
 = 
dx
;

809 
ddx
 = 
dx
;

810 
dx
 = 0;

813 i((
t
 = 
	`__bam__dup
(
dbc
, 
f
,

814 
	`PGNO
(
h
), 
dx
, PGNO(
dp
), 
dx
)) != 0)

815 
r
;

826 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
ddx
 + 1);

827 
hdr
.
da
 = 
bk
;

828 
hdr
.
size
 = 
	`B_TYPE
(
bk
->
ty
=
B_KEYDATA
 ?

829 
	`BKEYDATA_SIZE
(
bk
->
n
: 
BOVERFLOW_SIZE
;

830 i(
dbp
->
dup_com
 =
NULL
 && 
	`B_DISSET
(
bk
->
ty
)) {

836 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

837 (
t
 = 
	`__db_doff
(
dbc
,

838 (
	`GET_BOVERFLOW
(
dbp
, 
h
, 
ddx
 + 1))->
pgno
)) != 0)

839 
r
;

841 i((
t
 = 
	`__db_pem
(

842 
dbc
, 
dp
, 
dx
, 
hdr
.
size
, &hdr, 
NULL
)) != 0)

843 
r
;

844 ++
dx
;

847 i(
t
 != 1) {

848 i((
t
 = 
	`__bam_adjdx
(
dbc
,

849 
h
, 
ddx
, 
f
 + 1, 0)) != 0)

850 
r
;

852 
ddx
++;

855 i((
t
 = 
	`__db_dem
(
dbc
, 
h
, 
ddx
, 
hdr
.
size
)) != 0)

856 
r
;

857 
dx
 +
P_INDX
;

858 } --
t
);

861 i((
t
 = 
	`__bam_ovput
(
dbc
,

862 
B_DUPLICATE
, 
dp
->
pgno
, 
h
, 
f
 + 1, 
NULL
)) != 0)

863 
r
;

866 
t
 = 
	`__bam__di
(
dbc
,

867 
	`PGNO
(
h
), 
f
 + 
P_INDX
, ()(f + P_INDX - 
dx
));

869 
r
: i((
t_t
 = 
	`__memp_ut
(
mpf
,

870 
dbc
->
thad_fo
, 
dp
, dbc->
iܙy
)!0 && 
t
 == 0)

871 
t
 = 
t_t
;

873  (
t
);

874 
	}
}

882 
	$__bam_ovput
(
dbc
, 
ty
, 
pgno
, 
h
, 
dx
, 
em
)

883 
DBC
 *
dbc
;

884 
u_t32_t
 
ty
, 
dx
;

885 
db_pgno_t
 
pgno
;

886 
PAGE
 *
h
;

887 
DBT
 *
em
;

889 
BOVERFLOW
 
bo
;

890 
DBT
 
hdr
;

891 
t
;

893 
	`UMRW_SET
(
bo
.
unud1
);

894 
	`B_TSET
(
bo
.
ty
,ype);

895 
	`UMRW_SET
(
bo
.
unud2
);

902 i(
ty
 =
B_OVERFLOW
) {

903 i((
t
 = 
	`__db_poff
(
dbc
, 
em
, &
bo
.
pgno
)) != 0)

904  (
t
);

905 
bo
.

 = 
em
->
size
;

907 
bo
.
pgno
 =gno;

908 
bo
.

 = 0;

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

913 
hdr
.
da
 = &
bo
;

914 
hdr
.
size
 = 
BOVERFLOW_SIZE
;

915  (
	`__db_pem
(
dbc
, 
h
, 
dx
, 
BOVERFLOW_SIZE
, &
hdr
, 
NULL
));

916 
	}
}

	@../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
(
v
, 
db
, 
lp
, 

, 
fo
)

31 
ENV
 *
v
;

32 
DBT
 *
db
;

33 
DB_LSN
 *
lp
;

34 
db_cs
 

;

35 *
fo
;

37 
__bam_l_gs
 *
gp
;

38 
DB_THREAD_INFO
 *

;

39 
DB
 *
fe_dbp
;

40 
DBC
 *
dbc
;

41 
DB_MPOOLFILE
 *
mpf
;

42 
PAGE
 *
_
, *

, *

, *

, *
_
, *

, *

;

43 
db_pgno_t
 
pgno
, 
ro_pgno
;

44 
u_t32_t
 
y
;

45 
cmp
, 
l_upde
, 
p_upde
, 
r_upde
, 
rc
, 
t
, 
ro٥l
, 
t_t
;

47 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

48 
	`REC_PRINT
(
__bam_l_t
);

50 
_
 = 

 = 

 = 

 = 
_
 = 

 = 
NULL
;

51 

 = 
NULL
;

53 
	`REC_INTRO
(
__bam_l_ad
, 

, 0);

69 i((
t
 = 
	`__os_mloc
(
v
, 
gp
->
pg
.
size
, &

)) != 0)

70 
out
;

71 
	`memy
(

, 
gp
->
pg
.
da
,rgp->pg.
size
);

73 
pgno
 = 
	`PGNO
(

);

74 
ro_pgno
 = 
gp
->root_pgno;

75 
ro٥l
 = 
ro_pgno
 !
PGNO_INVALID
;

76 
	`REC_FGET
(
mpf
, 

, 
gp
->

, &

, 
right
);

77 
right
: 
	`REC_FGET
(
mpf
, 

, 
gp
->right, &

, 
do
);

79 
do
: i(
	`DB_REDO
(

)) {

80 
l_upde
 = 
r_upde
 = 
p_upde
 = 0;

87 i(
ro٥l
) {

88 
	`REC_FGET
(
mpf
, 

, 
ro_pgno
, &

, 
do_
);

89 
cmp
 = 
	`LOG_COMPARE
(&
	`LSN
(

), &LSN(
gp
->
pg
.
da
));

90 
	`CHECK_LSN
(
v
, 

,

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
(
v
, 

, 
cmp
, &
	`LSN
(

), &
gp
->
΢
);

98 i(
cmp
 == 0)

99 
l_upde
 = 1;

102 i(

 !
NULL
) {

103 
cmp
 = 
	`LOG_COMPARE
(&
	`LSN
(

), &
gp
->

);

104 
	`CHECK_LSN
(
v
, 

, 
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
(
v
, 
fe_dbp
->
pgsize
, &
_
)) != 0 ||

114 (
t
 = 
	`__os_mloc
(
v
, 
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
 = 
	`__memp_ut
(
mpf
,

146 

, 

, 
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
 = 
	`__memp_ut
(
mpf
,

156 

, 

, 
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
 = 
	`__memp_ut
(
mpf
,

184 

, 

, 
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
,

198 

, 
NULL
, 0, &

)) != 0) {

199 i(
t
 !
DB_PAGE_NOTFOUND
) {

200 
t
 = 
	`__db_pgr
(

201 
fe_dbp
, 
gp
->
gno
, 
t
);

202 
out
;

204 
de
;

206 
cmp
 = 
	`LOG_COMPARE
(&
	`LSN
(

), &
gp
->
Ƣ
);

207 
	`CHECK_LSN
(
v
, 

, 
cmp
, &
	`LSN
(

), &
gp
->
Ƣ
);

208 i(
cmp
 == 0) {

209 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &

);

210 
	`PREV_PGNO
(


gp
->
right
;

211 

->
l
 = *
lp
;

212 i((
t
 = 
	`__memp_ut
(
mpf
, 

,

213 

, 
fe_dbp
->
iܙy
)) != 0)

214 
out
;

215 

 = 
NULL
;

226 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 

, 
NULL
,

227 
DB_MPOOL_EDIT
, &

)) != 0) {

228 

 = 
NULL
;

229 
undo
;

231 i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

232 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &

);

233 
	`memy
(

, 
gp
->
pg
.
da
,rgp->pg.
size
);

234 i((
t
 = 
	`__memp_ut
(
mpf
,

235 

, 

, 
fe_dbp
->
iܙy
)) != 0)

236 
out
;

237 

 = 
NULL
;

248 
undo
: i((
ro٥l
 && 

 !
NULL
|| 

 != NULL) {

249 i(
ro٥l
 && 

 !
NULL
 &&

250 
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

251 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &

);

252 

->
l
 = 
gp
->
΢
;

253 i((
t
 = 
	`__memp_ut
(
mpf
, 

,

254 

, 
fe_dbp
->
iܙy
)) != 0)

255 
out
;

256 

 = 
NULL
;

258 i(

 !
NULL
 &&

259 
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

260 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &

);

261 

->
l
 = 
gp
->

;

262 i((
t
 = 
	`__memp_ut
(
mpf
, 

,

263 

, 
fe_dbp
->
iܙy
)) != 0)

264 
out
;

265 

 = 
NULL
;

277 i(!
ro٥l
 && 
gp
->
gno
 !
PGNO_INVALID
) {

278 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
gno
,

279 

, 
NULL
, 
DB_MPOOL_EDIT
, &

)) != 0) {

280 

 = 
NULL
;

281 
de
;

283 i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(

)) == 0) {

284 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &

);

285 
	`PREV_PGNO
(


gp
->

;

286 

->
l
 = 
gp
->
Ƣ
;

287 i(
	`__memp_ut
(
mpf
,

288 

, 

, 
fe_dbp
->
iܙy
))

289 
out
;

290 

 = 
NULL
;

295 
de
: *
lp
 = 
gp
->
ev_l
;

296 
t
 = 0;

298 
out
:

299 i(

 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

300 

, 

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

301 
t
 = 
t_t
;

302 i(

 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

303 

, 

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

304 
t
 = 
t_t
;

305 i(

 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

306 

, 

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

307 
t
 = 
t_t
;

308 i(

 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

309 

, 

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

310 
t
 = 
t_t
;

313 i(
_
 !
NULL
)

314 
	`__os_
(
v
, 
_
);

315 i(
_
 !
NULL
)

316 
	`__os_
(
v
, 
_
);

317 i(

 !
NULL
)

318 
	`__os_
(
v
, 

);

320 
REC_CLOSE
;

321 
	}
}

331 
	$__bam_rl_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

332 
ENV
 *
v
;

333 
DBT
 *
db
;

334 
DB_LSN
 *
lp
;

335 
db_cs
 

;

336 *
fo
;

338 
__bam_rl_gs
 *
gp
;

339 
DB_THREAD_INFO
 *

;

340 
DB
 *
fe_dbp
;

341 
DBC
 *
dbc
;

342 
DB_LSN
 
cy_l
;

343 
DB_MPOOLFILE
 *
mpf
;

344 
PAGE
 *
g
;

345 
db_pgno_t
 
pgno
, 
ro_pgno
;

346 
db_o_t
 
rt
;

347 
cmp_n
, 
cmp_p
, 
t
;

349 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

350 
g
 = 
NULL
;

351 
	`REC_PRINT
(
__bam_rl_t
);

352 
	`REC_INTRO
(
__bam_rl_ad
, 

, 1);

355 
pgno
 = 
ro_pgno
 = 
gp
->root_pgno;

356 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

357 i(
t
 !
DB_PAGE_NOTFOUND
) {

358 
t
 = 
	`__db_pgr
(
fe_dbp
, 
pgno
,et);

359 
out
;

361 
do_ge
;

364 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

365 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
rol
);

366 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
rol
);

367 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

375 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

376 
rt
 = 
	`RE_NREC
(
g
);

377 
	`memy
(
g
, 
gp
->
pgdbt
.
da
,rgp->pgdbt.
size
);

378 i(
	`LEVEL
(
g
> 
LEAFLEVEL
)

379 
	`RE_NREC_SET
(
g
, 
rt
);

380 
g
->
pgno
 = 
ro_pgno
;

381 
g
->
l
 = *
lp
;

382 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

384 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

385 
	`P_INIT
(
g
, 
fe_dbp
->
pgsize
, 
ro_pgno
,

386 
gp
->
ec
, 
PGNO_INVALID
, 
g
->
v
 + 1,

387 
	`IS_BTREE_PAGE
(
g
? 
P_IBTREE
 : 
P_IRECNO
);

388 i((
t
 = 
	`__db_pem
(
dbc
, 
g
, 0,

389 
gp
->
roْt
.
size
, &gp->roْt, 
NULL
)) != 0)

390 
out
;

391 
g
->
l
 = 
gp
->
rol
;

393 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

394 
out
;

396 
do_ge
:

402 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

403 i(
t
 !
DB_PAGE_NOTFOUND
) {

404 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

405 
out
;

407 
de
;

409 ()
	`__ua_memy
(&
cy_l
, &
	`LSN
(
gp
->
pgdbt
.
da
), (
DB_LSN
));

410 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

411 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
cy_l
);

412 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
cy_l
);

413 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

415 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

416 
g
->
l
 = *
lp
;

417 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

419 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

420 
	`memy
(
g
, 
gp
->
pgdbt
.
da
,rgp->pgdbt.
size
);

422 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

423 
out
;

424 
g
 = 
NULL
;

426 
de
: *
lp
 = 
gp
->
ev_l
;

427 
t
 = 0;

429 
out
: i(
g
 !
NULL
)

430 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
dbc
->
iܙy
);

431 
REC_CLOSE
;

432 
	}
}

442 
	$__bam_adj_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

443 
ENV
 *
v
;

444 
DBT
 *
db
;

445 
DB_LSN
 *
lp
;

446 
db_cs
 

;

447 *
fo
;

449 
__bam_adj_gs
 *
gp
;

450 
DB_THREAD_INFO
 *

;

451 
DB
 *
fe_dbp
;

452 
DBC
 *
dbc
;

453 
DB_MPOOLFILE
 *
mpf
;

454 
PAGE
 *
g
;

455 
cmp_n
, 
cmp_p
, 
t
;

457 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

458 
g
 = 
NULL
;

459 
	`REC_PRINT
(
__bam_adj_t
);

460 
	`REC_INTRO
(
__bam_adj_ad
, 

, 1);

463 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

464 i(
t
 !
DB_PAGE_NOTFOUND
) {

465 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

466 
out
;

468 
de
;

471 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

472 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

473 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

474 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

476 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

477 i((
t
 = 
	`__bam_adjdx
(
dbc
,

478 
g
, 
gp
->
dx
,rgp->
dx_cy
,rgp->
is_
)) != 0)

479 
out
;

481 
	`LSN
(
g
*
lp
;

482 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

484 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

485 i((
t
 = 
	`__bam_adjdx
(
dbc
,

486 
g
, 
gp
->
dx
,rgp->
dx_cy
, !gp->
is_
)) != 0)

487 
out
;

489 
	`LSN
(
g

gp
->
l
;

491 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

492 
out
;

493 
g
 = 
NULL
;

495 
de
: *
lp
 = 
gp
->
ev_l
;

496 
t
 = 0;

498 
out
: i(
g
 !
NULL
)

499 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
dbc
->
iܙy
);

500 
REC_CLOSE
;

501 
	}
}

512 
	$__bam_dju_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

513 
ENV
 *
v
;

514 
DBT
 *
db
;

515 
DB_LSN
 *
lp
;

516 
db_cs
 

;

517 *
fo
;

519 
__bam_dju_gs
 *
gp
;

520 
DB_THREAD_INFO
 *

;

521 
DB
 *
fe_dbp
;

522 
DBC
 *
dbc
;

523 
DB_MPOOLFILE
 *
mpf
;

524 
PAGE
 *
g
;

525 
cmp_n
, 
cmp_p
, 
t
;

527 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

528 
g
 = 
NULL
;

529 
	`REC_PRINT
(
__bam_dju_t
);

530 
	`REC_INTRO
(
__bam_dju_ad
, 

, 0);

533 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

534 i(
t
 !
DB_PAGE_NOTFOUND
) {

535 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

536 
out
;

538 
de
;

541 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

542 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

543 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

544 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

546 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

547 i(
	`IS_BTREE_PAGE
(
g
)) {

548 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 +=

549 
gp
->
adju
;

550 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

551 
	`RE_NREC_ADJ
(
g
, 
gp
->
adju
);

553 
	`GET_RINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 +=

554 
gp
->
adju
;

555 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

556 
	`RE_NREC_ADJ
(
g
, 
gp
->
adju
);

559 
	`LSN
(
g
*
lp
;

560 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

562 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

563 i(
	`IS_BTREE_PAGE
(
g
)) {

564 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 -=

565 
gp
->
adju
;

566 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

567 
	`RE_NREC_ADJ
(
g
, -(
gp
->
adju
));

569 
	`GET_RINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ecs
 -=

570 
gp
->
adju
;

571 i(
gp
->
ags
 & 
CAD_UPDATEROOT
)

572 
	`RE_NREC_ADJ
(
g
, -(
gp
->
adju
));

574 
	`LSN
(
g

gp
->
l
;

576 i((
t
 = 
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

577 
out
;

578 
g
 = 
NULL
;

580 
de
: *
lp
 = 
gp
->
ev_l
;

581 
t
 = 0;

583 
out
: i(
g
 !
NULL
)

584 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
);

585 
REC_CLOSE
;

586 
	}
}

596 
	$__bam_cd_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

597 
ENV
 *
v
;

598 
DBT
 *
db
;

599 
DB_LSN
 *
lp
;

600 
db_cs
 

;

601 *
fo
;

603 
__bam_cd_gs
 *
gp
;

604 
DB_THREAD_INFO
 *

;

605 
DB
 *
fe_dbp
;

606 
DBC
 *
dbc
;

607 
DB_MPOOLFILE
 *
mpf
;

608 
PAGE
 *
g
;

609 
u_t32_t
 
dx
;

610 
cmp_n
, 
cmp_p
, 
t
;

612 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

613 
g
 = 
NULL
;

614 
	`REC_PRINT
(
__bam_cd_t
);

615 
	`REC_INTRO
(
__bam_cd_ad
, 

, 0);

618 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

619 i(
t
 !
DB_PAGE_NOTFOUND
) {

620 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

621 
out
;

623 
de
;

626 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

627 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

628 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

629 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

631 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

632 
dx
 = 
gp
->dx + (
	`TYPE
(
g
=
P_LBTREE
 ? 
O_INDX
 : 0);

633 
	`B_DSET
(
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
)->
ty
);

635 
	`LSN
(
g
*
lp
;

636 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

638 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

639 
dx
 = 
gp
->dx + (
	`TYPE
(
g
=
P_LBTREE
 ? 
O_INDX
 : 0);

640 
	`B_DCLR
(
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
)->
ty
);

642 i((
t
 = 
	`__bam__de
(

643 
fe_dbp
, 
gp
->
pgno
,rgp->
dx
, 0, 
NULL
)) != 0)

644 
out
;

646 
	`LSN
(
g

gp
->
l
;

648 i((
t
 = 
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

649 
out
;

650 
g
 = 
NULL
;

652 
de
: *
lp
 = 
gp
->
ev_l
;

653 
t
 = 0;

655 
out
: i(
g
 !
NULL
)

656 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
);

657 
REC_CLOSE
;

658 
	}
}

668 
	$__bam__cov
(
v
, 
db
, 
lp
, 

, 
fo
)

669 
ENV
 *
v
;

670 
DBT
 *
db
;

671 
DB_LSN
 *
lp
;

672 
db_cs
 

;

673 *
fo
;

675 
__bam__gs
 *
gp
;

676 
DB_THREAD_INFO
 *

;

677 
BKEYDATA
 *
bk
;

678 
DB
 *
fe_dbp
;

679 
DBC
 *
dbc
;

680 
DBT
 
dbt
;

681 
DB_MPOOLFILE
 *
mpf
;

682 
PAGE
 *
g
;

683 
cmp_n
, 
cmp_p
, 
t
;

684 
u_t8_t
 *
p
;

686 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

687 
g
 = 
NULL
;

688 
	`REC_PRINT
(
__bam__t
);

689 
	`REC_INTRO
(
__bam__ad
, 

, 1);

692 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

693 i(
t
 !
DB_PAGE_NOTFOUND
) {

694 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

695 
out
;

697 
de
;

699 
bk
 = 
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
gp
->
dx
);

701 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

702 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

703 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

704 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

710 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

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

712 
dbt
.
size
 = 
gp
->
efix
 +rgp->
suffix
 +rgp->

.size;

713 i((
t
 = 
	`__os_mloc
(
v
, 
dbt
.
size
, &dbt.
da
)) != 0)

714 
out
;

715 
p
 = 
dbt
.
da
;

716 
	`memy
(
p
, 
bk
->
da
, 
gp
->
efix
);

717 
p
 +
gp
->
efix
;

718 
	`memy
(
p
, 
gp
->

.
da
,rgp->.
size
);

719 
p
 +
gp
->

.
size
;

720 
	`memy
(
p
, 
bk
->
da
 + (bk->
n
 - 
gp
->
suffix
),rgp->suffix);

722 
t
 = 
	`__bam_rem
(
dbc
, 
g
, 
gp
->
dx
, &
dbt
);

723 
	`__os_
(
v
, 
dbt
.
da
);

724 i(
t
 != 0)

725 
out
;

727 
	`LSN
(
g
*
lp
;

728 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

734 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

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

736 
dbt
.
size
 = 
gp
->
efix
 +rgp->
suffix
 +rgp->
ig
.size;

737 i((
t
 = 
	`__os_mloc
(
v
, 
dbt
.
size
, &dbt.
da
)) != 0)

738 
out
;

739 
p
 = 
dbt
.
da
;

740 
	`memy
(
p
, 
bk
->
da
, 
gp
->
efix
);

741 
p
 +
gp
->
efix
;

742 
	`memy
(
p
, 
gp
->
ig
.
da
,rgp->ig.
size
);

743 
p
 +
gp
->
ig
.
size
;

744 
	`memy
(
p
, 
bk
->
da
 + (bk->
n
 - 
gp
->
suffix
),rgp->suffix);

746 
t
 = 
	`__bam_rem
(
dbc
, 
g
, 
gp
->
dx
, &
dbt
);

747 
	`__os_
(
v
, 
dbt
.
da
);

748 i(
t
 != 0)

749 
out
;

752 i(
gp
->
isded
)

753 
	`B_DSET
(
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
gp
->
dx
)->
ty
);

755 
	`LSN
(
g

gp
->
l
;

757 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

758 
out
;

759 
g
 = 
NULL
;

761 
de
: *
lp
 = 
gp
->
ev_l
;

762 
t
 = 0;

764 
out
: i(
g
 !
NULL
)

765 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
dbc
->
iܙy
);

766 
REC_CLOSE
;

767 
	}
}

777 
	$__bam_ro_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

778 
ENV
 *
v
;

779 
DBT
 *
db
;

780 
DB_LSN
 *
lp
;

781 
db_cs
 

;

782 *
fo
;

784 
__bam_ro_gs
 *
gp
;

785 
DB_THREAD_INFO
 *

;

786 
BTMETA
 *
ma
;

787 
DB
 *
fe_dbp
;

788 
DBC
 *
dbc
;

789 
DB_MPOOLFILE
 *
mpf
;

790 
cmp_n
, 
cmp_p
, 
t
;

792 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

793 
ma
 = 
NULL
;

794 
	`REC_PRINT
(
__bam_ro_t
);

795 
	`REC_INTRO
(
__bam_ro_ad
, 

, 0);

797 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
ma_pgno
, 

, 
NULL
,

798 0, &
ma
)) != 0) {

799 i(
t
 !
DB_PAGE_NOTFOUND
) {

800 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
ma_pgno
,et);

801 
out
;

803 
de
;

806 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
ma
));

807 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
ma
), &
gp
->
ma_l
);

808 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
ma
), &
gp
->
ma_l
);

809 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

811 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
ma
);

812 
ma
->
ro
 = 
gp
->
ro_pgno
;

813 
ma
->
dbma
.
l
 = *
lp
;

814 ((
BTREE
 *)
fe_dbp
->
bt_
)->
bt_ro
 = 
ma
->
ro
;

815 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

817 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
ma
);

818 
ma
->
dbma
.
l
 = 
gp
->
ma_l
;

820 i((
t
 = 
	`__memp_ut
(
mpf
, 

, 
ma
, 
fe_dbp
->
iܙy
)) != 0)

821 
out
;

822 
ma
 = 
NULL
;

824 
de
: *
lp
 = 
gp
->
ev_l
;

825 
t
 = 0;

827 
out
: i(
ma
 !
NULL
)

828 ()
	`__memp_ut
(
mpf
, 

, 
ma
, 
fe_dbp
->
iܙy
);

829 
REC_CLOSE
;

830 
	}
}

841 
	$__bam_cudj_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

842 
ENV
 *
v
;

843 
DBT
 *
db
;

844 
DB_LSN
 *
lp
;

845 
db_cs
 

;

846 *
fo
;

848 
__bam_cudj_gs
 *
gp
;

849 
DB_THREAD_INFO
 *

;

850 
DB
 *
fe_dbp
;

851 
DBC
 *
dbc
;

852 
DB_MPOOLFILE
 *
mpf
;

853 
t
;

855 
	`COMPQUIET
(
mpf
, 
NULL
);

857 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

858 
	`REC_PRINT
(
__bam_cudj_t
);

859 
	`REC_INTRO
(
__bam_cudj_ad
, 

, 1);

861 
t
 = 0;

862 i(

 !
DB_TXN_ABORT
)

863 
de
;

865 
gp
->
mode
) {

866 
DB_CA_DI
:

867 i((
t
 = 
	`__bam__di
(
dbc
, 
gp
->
om_pgno
,

868 
gp
->
om_dx
, -(rgp->
f_dx
)) != 0)

869 
out
;

871 
DB_CA_DUP
:

872 i((
t
 = 
	`__bam__undodup
(
fe_dbp
, 
gp
->
f_dx
,

873 
gp
->
om_pgno
,rgp->
om_dx
,rgp->
to_dx
)) != 0)

874 
out
;

877 
DB_CA_RSPLIT
:

878 i((
t
 =

879 
	`__bam__rl
(
dbc
, 
gp
->
to_pgno
,rgp->
om_pgno
)) != 0)

880 
out
;

883 
DB_CA_SPLIT
:

884 i((
t
 = 
	`__bam__undol
(
fe_dbp
, 
gp
->
om_pgno
,

885 
gp
->
to_pgno
,rgp->
_pgno
,rgp->
om_dx
)) != 0)

886 
out
;

890 
de
: *
lp
 = 
gp
->
ev_l
;

891 
out
: 
REC_CLOSE
;

892 
	}
}

903 
	$__bam_rcudj_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

904 
ENV
 *
v
;

905 
DBT
 *
db
;

906 
DB_LSN
 *
lp
;

907 
db_cs
 

;

908 *
fo
;

910 
__bam_rcudj_gs
 *
gp
;

911 
DB_THREAD_INFO
 *

;

912 
BTREE_CURSOR
 *

;

913 
DB
 *
fe_dbp
;

914 
DBC
 *
dbc
, *
rdbc
;

915 
DB_MPOOLFILE
 *
mpf
;

916 
t
, 
t_t
;

918 
	`COMPQUIET
(
mpf
, 
NULL
);

920 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

921 
rdbc
 = 
NULL
;

922 
	`REC_PRINT
(
__bam_rcudj_t
);

923 
	`REC_INTRO
(
__bam_rcudj_ad
, 

, 1);

925 
t
 = 
t_t
 = 0;

927 i(

 !
DB_TXN_ABORT
)

928 
de
;

940 i((
t
 = 
	`__db_curs_t
(
fe_dbp
, 
NULL
,

941 
NULL
, 
DB_RECNO
, 
gp
->
ro
, 0, NULL, &
rdbc
)) != 0)

942 
out
;

944 

 = (
BTREE_CURSOR
 *)
rdbc
->

;

945 
	`F_SET
(

, 
C_RENUMBER
);

946 

->
o
 = 
gp
->recno;

948 
gp
->
mode
) {

949 
CA_DELETE
:

954 
	`F_SET
(

, 
C_DELETED
);

955 
	`F_SET
(

, 
C_RENUMBER
);

956 

->
d
 = 
gp
->order;

957 i((
t
 = 
	`__m_
(
rdbc
, 
CA_ICURRENT
, 
NULL
)) != 0)

958 
out
;

960 
CA_IAFTER
:

961 
CA_IBEFORE
:

962 
CA_ICURRENT
:

967 
	`F_CLR
(

, 
C_DELETED
);

968 

->
d
 = 
INVALID_ORDER
;

969 i((
t
 = 
	`__m_
(
rdbc
, 
CA_DELETE
, 
NULL
)) != 0)

970 
out
;

974 
de
: *
lp
 = 
gp
->
ev_l
;

975 
out
: i(
rdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
dbc)!0 && 
t
 == 0)

976 
t
 = 
t_t
;

977 
REC_CLOSE
;

978 
	}
}

988 
	$__bam_lk_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

989 
ENV
 *
v
;

990 
DBT
 *
db
;

991 
DB_LSN
 *
lp
;

992 
db_cs
 

;

993 *
fo
;

995 
__bam_lk_gs
 *
gp
;

996 
DB_THREAD_INFO
 *

;

997 
DB
 *
fe_dbp
;

998 
DBC
 *
dbc
;

999 
DB_MPOOLFILE
 *
mpf
;

1000 
PAGE
 *
g
;

1001 
cmp_n
, 
cmp_p
, 
t
;

1003 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

1004 
g
 = 
NULL
;

1005 
	`REC_PRINT
(
__bam_lk_t
);

1006 
	`REC_INTRO
(
__bam_lk_ad
, 

, 0);

1014 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
xt
, 

, 
NULL
, 0, &
g
)) != 0) {

1015 i(
t
 !
DB_PAGE_NOTFOUND
) {

1016 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
xt
,et);

1017 
out
;

1019 
ev
;

1022 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1023 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_xt
);

1024 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_xt
);

1025 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1027 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1028 i(
gp
->
w_pgno
 =
PGNO_INVALID
)

1029 
g
->
ev_pgno
 = 
gp
->
ev
;

1031 
g
->
ev_pgno
 = 
gp
->
w_pgno
;

1033 
g
->
l
 = *
lp
;

1034 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

1036 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1037 
g
->
ev_pgno
 = 
gp
->
pgno
;

1039 
g
->
l
 = 
gp
->
l_xt
;

1042 i((
t
 = 
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1043 
out
;

1044 
g
 = 
NULL
;

1046 
ev
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->ev, 

, 
NULL
, 0, &
g
)) != 0) {

1047 i(
t
 !
DB_PAGE_NOTFOUND
) {

1048 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
ev
,et);

1049 
out
;

1051 
de
;

1054 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_ev
);

1055 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_ev
);

1056 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1058 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1059 i(
gp
->
w_pgno
 =
PGNO_INVALID
)

1060 
g
->
xt_pgno
 = 
gp
->
xt
;

1062 
g
->
xt_pgno
 = 
gp
->
w_pgno
;

1064 
g
->
l
 = *
lp
;

1065 } i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
)=0 && 
	`DB_UNDO
(

)) {

1067 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1068 
g
->
xt_pgno
 = 
gp
->
pgno
;

1069 
g
->
l
 = 
gp
->
l_ev
;

1072 i((
t
 = 
	`__memp_ut
(
mpf
,

1073 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1074 
out
;

1075 
g
 = 
NULL
;

1077 
de
: *
lp
 = 
gp
->
ev_l
;

1078 
t
 = 0;

1080 
out
: i(
g
 !
NULL
)

1081 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
);

1082 
REC_CLOSE
;

1083 
	}
}

1093 
	$__bam_mge_44_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

1094 
ENV
 *
v
;

1095 
DBT
 *
db
;

1096 
DB_LSN
 *
lp
;

1097 
db_cs
 

;

1098 *
fo
;

1100 
__bam_mge_44_gs
 *
gp
;

1101 
DB_THREAD_INFO
 *

;

1102 
BKEYDATA
 *
bk
;

1103 
DB
 *
fe_dbp
;

1104 
DBC
 *
dbc
;

1105 
DB_MPOOLFILE
 *
mpf
;

1106 
PAGE
 *
g
;

1107 
db_dx_t
 
dx
, *
np
, *
pp
;

1108 
u_t32_t
 
size
;

1109 
u_t8_t
 *
bp
;

1110 
cmp_n
, 
cmp_p
, 
i
, 
t
;

1112 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

1113 
	`REC_PRINT
(
__bam_mge_44_t
);

1114 
	`REC_INTRO
(
__bam_mge_44_ad
, 

, 1);

1116 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

1117 i(
t
 !
DB_PAGE_NOTFOUND
) {

1118 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1119 
out
;

1121 
xt
;

1124 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1125 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1126 
	`CHECK_LSN
(
fe_dbp
->
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1128 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1133 
	`DB_ASSERT
(
v
, 
gp
->
hdr
.
size
 =0 || 
	`NUM_ENT
(
g
) == 0);

1134 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1135 i(
gp
->
hdr
.
size
 != 0) {

1136 
	`P_INIT
(
g
, 
fe_dbp
->
pgsize
,ag->
pgno
,

1137 
	`PREV_PGNO
(
gp
->
hdr
.
da
),

1138 
	`NEXT_PGNO
(
gp
->
hdr
.
da
),

1139 
	`LEVEL
(
gp
->
hdr
.
da
), 
	`TYPE
(argp->hdr.data));

1141 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1142 
	`OV_REF
(
g
OV_REF(
gp
->
hdr
.
da
);

1143 
	`OV_LEN
(
g
OV_LEN(
gp
->
hdr
.
da
);

1144 
bp
 = (
u_t8_t
 *
g
 + 
	`P_OVERHEAD
(
fe_dbp
);

1145 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1148 
bp
 = (
u_t8_t
 *)
g
 +

1149 (
db_dx_t
)(
	`HOFFSET
(
g
- 
gp
->
da
.
size
);

1150 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1153 
pp
 = 
	`P_INP
(
fe_dbp
, 
g
+ 
	`NUM_ENT
(pagep);

1154 
np
 = 
gp
->
d
.
da
;

1155 
i
 = 0;

1156 
i
 < ()(
gp
->
d
.
size
 / (*
np
)); i++)

1157 *
pp
++ = *
np
++

1158 - (
fe_dbp
->
pgsize
 - 
	`HOFFSET
(
g
));

1159 
	`HOFFSET
(
g
-
gp
->
da
.
size
;

1160 
	`NUM_ENT
(
g
+
i
;

1162 
g
->
l
 = *
lp
;

1163 } i(
cmp_n
 =0 && !
	`DB_REDO
(

)) {

1170 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1171 
i
 = 0; i < ()(
gp
->
d
.
size
 / (*
np
)); i++) {

1172 
dx
 = 
	`NUM_ENT
(
g
) - 1;

1173 i(
	`P_INP
(
fe_dbp
, 
g
)[
dx
] ==

1174 
	`P_INP
(
fe_dbp
, 
g
)[
dx
 - 
P_INDX
]) {

1175 
	`NUM_ENT
(
g
)--;

1178 
	`TYPE
(
g
)) {

1179 
P_LBTREE
:

1180 
P_LRECNO
:

1181 
P_LDUP
:

1182 
bk
 = 
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
);

1183 
size
 = 
	`BITEM_SIZE
(
bk
);

1186 
P_IBTREE
:

1187 
size
 = 
	`BINTERNAL_SIZE
(

1188 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
dx
)->
n
);

1190 
P_IRECNO
:

1191 
size
 = 
RINTERNAL_SIZE
;

1195 
t
 = 
	`__db_pgfmt
(
v
, 
	`PGNO
(
g
));

1196 
out
;

1198 i((
t
 =

1199 
	`__db_dem
(
dbc
, 
g
, 
dx
, 
size
)) != 0)

1200 
out
;

1202 i(
gp
->
d
.
size
 == 0)

1203 
	`HOFFSET
(
g

fe_dbp
->
pgsize
;

1204 
g
->
l
 = 
gp
->lsn;

1207 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

1208 
out
;

1210 
xt
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
gno
, 

, 
NULL
, 0, &
g
)) != 0) {

1211 i(
t
 !
DB_PAGE_NOTFOUND
) {

1212 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1213 
out
;

1215 
de
;

1218 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1219 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
Ƣ
);

1220 
	`CHECK_LSN
(
fe_dbp
->
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
Ƣ
);

1222 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1224 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1225 
	`HOFFSET
(
g

fe_dbp
->
pgsize
;

1226 
	`NUM_ENT
(
g
) = 0;

1227 
g
->
l
 = *
lp
;

1228 } i(
cmp_n
 =0 && !
	`DB_REDO
(

)) {

1230 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1231 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1232 
	`OV_REF
(
g
OV_REF(
gp
->
hdr
.
da
);

1233 
	`OV_LEN
(
g
OV_LEN(
gp
->
hdr
.
da
);

1234 
bp
 = (
u_t8_t
 *
g
 + 
	`P_OVERHEAD
(
fe_dbp
);

1235 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1237 
bp
 = (
u_t8_t
 *)
g
 +

1238 (
db_dx_t
)(
	`HOFFSET
(
g
- 
gp
->
da
.
size
);

1239 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1242 
pp
 = 
	`P_INP
(
fe_dbp
, 
g
+ 
	`NUM_ENT
(pagep);

1243 
np
 = 
gp
->
d
.
da
;

1244 
i
 = 0;

1245 
i
 < ()(
gp
->
d
.
size
 / (*
np
)); i++)

1246 *
pp
++ = *
np
++;

1247 
	`HOFFSET
(
g
-
gp
->
da
.
size
;

1248 
	`NUM_ENT
(
g

i
;

1250 
g
->
l
 = 
gp
->
Ƣ
;

1253 i((
t
 = 
	`__memp_ut
(
mpf
,

1254 

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

1255 
out
;

1256 
de
:

1257 *
lp
 = 
gp
->
ev_l
;

1258 
t
 = 0;

1260 
out
: 
REC_CLOSE
;

1261 
	}
}

1271 
	$__bam_mge_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

1272 
ENV
 *
v
;

1273 
DBT
 *
db
;

1274 
DB_LSN
 *
lp
;

1275 
db_cs
 

;

1276 *
fo
;

1278 
__bam_mge_gs
 *
gp
;

1279 
DB_THREAD_INFO
 *

;

1280 
BKEYDATA
 *
bk
;

1281 
DB
 *
fe_dbp
;

1282 
DBC
 *
dbc
;

1283 
DB_MPOOLFILE
 *
mpf
;

1284 
PAGE
 *
g
;

1285 
db_dx_t
 
dx
, *
np
, *
pp
;

1286 
u_t32_t
 
size
;

1287 
u_t8_t
 *
bp
;

1288 
cmp_n
, 
cmp_p
, 
i
, 
t
;

1290 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

1291 
	`REC_PRINT
(
__bam_mge_t
);

1292 
	`REC_INTRO
(
__bam_mge_ad
, 

, 1);

1294 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

1295 i(
t
 !
DB_PAGE_NOTFOUND
) {

1296 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1297 
out
;

1299 
xt
;

1302 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1303 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1304 
	`CHECK_LSN
(
fe_dbp
->
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1306 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1310 
	`DB_ASSERT
(
v
, !
gp
->
pg_cy
 || 
	`NUM_ENT
(
g
) == 0);

1311 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1312 i(
gp
->
pg_cy
) {

1313 
	`P_INIT
(
g
, 
fe_dbp
->
pgsize
,ag->
pgno
,

1314 
	`PREV_PGNO
(
gp
->
hdr
.
da
),

1315 
	`NEXT_PGNO
(
gp
->
hdr
.
da
),

1316 
	`LEVEL
(
gp
->
hdr
.
da
), 
	`TYPE
(argp->hdr.data));

1318 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1319 
	`OV_REF
(
g
OV_REF(
gp
->
hdr
.
da
);

1320 
	`OV_LEN
(
g
OV_LEN(
gp
->
hdr
.
da
);

1321 
bp
 = (
u_t8_t
 *)
g
 + 
	`P_OVERHEAD
(
fe_dbp
);

1322 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1325 
bp
 = (
u_t8_t
 *)
g
 +

1326 (
db_dx_t
)(
	`HOFFSET
(
g
- 
gp
->
da
.
size
);

1327 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1330 
pp
 = 
	`P_INP
(
fe_dbp
, 
g
+ 
	`NUM_ENT
(pagep);

1331 
np
 = 
	`P_INP
(
fe_dbp
, 
gp
->
hdr
.
da
);

1332 
i
 = 0; i < 
	`NUM_ENT
(
gp
->
hdr
.
da
); i++)

1333 *
pp
++ = *
np
++

1334 - (
fe_dbp
->
pgsize
 - 
	`HOFFSET
(
g
));

1335 
	`HOFFSET
(
g
-
gp
->
da
.
size
;

1336 
	`NUM_ENT
(
g
+
i
;

1338 
g
->
l
 = *
lp
;

1339 } i(
cmp_n
 =0 && !
	`DB_REDO
(

)) {

1340 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1341 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1342 
	`HOFFSET
(
g

fe_dbp
->
pgsize
;

1343 

;

1351 
i
 = 0; i < 
	`NUM_ENT
(
gp
->
hdr
.
da
); i++) {

1352 
dx
 = 
	`NUM_ENT
(
g
) - 1;

1353 i(
	`P_INP
(
fe_dbp
, 
g
)[
dx
] ==

1354 
	`P_INP
(
fe_dbp
, 
g
)[
dx
 - 
P_INDX
]) {

1355 
	`NUM_ENT
(
g
)--;

1358 
	`TYPE
(
g
)) {

1359 
P_LBTREE
:

1360 
P_LRECNO
:

1361 
P_LDUP
:

1362 
bk
 = 
	`GET_BKEYDATA
(
fe_dbp
, 
g
, 
dx
);

1363 
size
 = 
	`BITEM_SIZE
(
bk
);

1366 
P_IBTREE
:

1367 
size
 = 
	`BINTERNAL_SIZE
(

1368 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
dx
)->
n
);

1370 
P_IRECNO
:

1371 
size
 = 
RINTERNAL_SIZE
;

1375 
t
 = 
	`__db_pgfmt
(
v
, 
	`PGNO
(
g
));

1376 
out
;

1378 i((
t
 = 
	`__db_dem
(
dbc
, 
g
, 
dx
, 
size
)) != 0)

1379 
out
;

1381 

: 
g
->
l
 = 
gp
->lsn;

1384 i((
t
 = 
	`__memp_ut
(
mpf
, 

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

1385 
out
;

1387 
xt
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
gno
, 

, 
NULL
, 0, &
g
)) != 0) {

1388 i(
t
 !
DB_PAGE_NOTFOUND
) {

1389 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1390 
out
;

1392 
de
;

1395 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1396 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
Ƣ
);

1397 
	`CHECK_LSN
(
fe_dbp
->
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
Ƣ
);

1399 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1401 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1402 
	`HOFFSET
(
g

fe_dbp
->
pgsize
;

1403 
	`NUM_ENT
(
g
) = 0;

1404 
g
->
l
 = *
lp
;

1405 } i(
cmp_n
 =0 && !
	`DB_REDO
(

)) {

1407 
	`REC_DIRTY
(
mpf
, 

, 
dbc
->
iܙy
, &
g
);

1408 i(
	`TYPE
(
g
=
P_OVERFLOW
) {

1409 
	`OV_REF
(
g
OV_REF(
gp
->
hdr
.
da
);

1410 
	`OV_LEN
(
g
OV_LEN(
gp
->
hdr
.
da
);

1411 
bp
 = (
u_t8_t
 *)
g
 + 
	`P_OVERHEAD
(
fe_dbp
);

1412 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1414 
bp
 = (
u_t8_t
 *)
g
 +

1415 (
db_dx_t
)(
	`HOFFSET
(
g
- 
gp
->
da
.
size
);

1416 
	`memy
(
bp
, 
gp
->
da
.da,rgp->da.
size
);

1419 
pp
 = 
	`P_INP
(
fe_dbp
, 
g
+ 
	`NUM_ENT
(pagep);

1420 
np
 = 
	`P_INP
(
fe_dbp
, 
gp
->
hdr
.
da
);

1421 
i
 = 0; i < 
	`NUM_ENT
(
gp
->
hdr
.
da
); i++)

1422 *
pp
++ = *
np
++;

1423 
	`HOFFSET
(
g
-
gp
->
da
.
size
;

1424 
	`NUM_ENT
(
g
+
i
;

1426 
g
->
l
 = 
gp
->
Ƣ
;

1429 i((
t
 = 
	`__memp_ut
(
mpf
,

1430 

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

1431 
out
;

1432 
de
:

1433 *
lp
 = 
gp
->
ev_l
;

1434 
t
 = 0;

1436 
out
: 
REC_CLOSE
;

1437 
	}
}

1447 
	$__bam_pgno_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

1448 
ENV
 *
v
;

1449 
DBT
 *
db
;

1450 
DB_LSN
 *
lp
;

1451 
db_cs
 

;

1452 *
fo
;

1454 
BINTERNAL
 *
bi
;

1455 
__bam_pgno_gs
 *
gp
;

1456 
DB_THREAD_INFO
 *

;

1457 
DB
 *
fe_dbp
;

1458 
DBC
 *
dbc
;

1459 
DB_MPOOLFILE
 *
mpf
;

1460 
PAGE
 *
g
, *
ag
;

1461 
db_pgno_t
 *
pgn
;

1462 
cmp_n
, 
cmp_p
, 
t
;

1464 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

1465 
	`REC_PRINT
(
__bam_pgno_t
);

1466 
	`REC_INTRO
(
__bam_pgno_ad
, 

, 0);

1468 
	`REC_FGET
(
mpf
, 

, 
gp
->
pgno
, &
g
, 
de
);

1470 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1471 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1472 
	`CHECK_LSN
(
fe_dbp
->
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1474 i((
cmp_p
 =0 && 
	`DB_REDO
(

)|| (
cmp_n
 == 0 && !DB_REDO(op))) {

1475 
	`TYPE
(
g
)) {

1476 
P_IBTREE
:

1482 
bi
 = 
	`GET_BINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
);

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

1484 
	`REC_FGET
(
mpf
, 

, 
gp
->
gno
, &
ag
, 
out
);

1486 i(
	`TYPE
(
ag
=
P_OVERFLOW
)

1487 
pgn
 =

1488 &((
BOVERFLOW
 *)(
bi
->
da
))->
pgno
;

1490 
pgn
 = &
bi
->
pgno
;

1491 i((
t
 = 
	`__memp_ut
(
mpf
, 

,

1492 
ag
, 
fe_dbp
->
iܙy
)) != 0)

1493 
out
;

1496 
pgn
 = &
bi
->
pgno
;

1498 
P_IRECNO
:

1499 
pgn
 =

1500 &
	`GET_RINTERNAL
(
fe_dbp
, 
g
, 
gp
->
dx
)->
pgno
;

1503 
pgn
 =

1504 &
	`GET_BOVERFLOW
(
fe_dbp
, 
g
, 
gp
->
dx
)->
pgno
;

1508 i(
	`DB_REDO
(

)) {

1510 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1511 *
pgn
 = 
gp
->
gno
;

1512 
g
->
l
 = *
lp
;

1514 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1515 *
pgn
 = 
gp
->
gno
;

1516 
g
->
l
 = 
gp
->lsn;

1520 i((
t
 = 
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1521 
out
;

1523 
de
:

1524 *
lp
 = 
gp
->
ev_l
;

1525 
t
 = 0;

1527 
out
: 
REC_CLOSE
;

1528 
	}
}

1538 
	$__bam_lk_43_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

1539 
ENV
 *
v
;

1540 
DBT
 *
db
;

1541 
DB_LSN
 *
lp
;

1542 
db_cs
 

;

1543 *
fo
;

1545 
__bam_lk_43_gs
 *
gp
;

1546 
DB_THREAD_INFO
 *

;

1547 
DB
 *
fe_dbp
;

1548 
DBC
 *
dbc
;

1549 
DB_MPOOLFILE
 *
mpf
;

1550 
PAGE
 *
g
;

1551 
cmp_n
, 
cmp_p
, 
modifd
, 
t
;

1553 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

1554 
g
 = 
NULL
;

1555 
	`REC_PRINT
(
__bam_lk_43_t
);

1556 
	`REC_INTRO
(
__bam_lk_43_ad
, 

, 0);

1564 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
, 0, &
g
)) != 0) {

1565 i(
t
 !
DB_PAGE_NOTFOUND
) {

1566 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
pgno
,et);

1567 
out
;

1569 
xt2
;

1572 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

1573 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

1574 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1576 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1577 
g
->
l
 = *
lp
;

1578 } i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
)=0 && 
	`DB_UNDO
(

)) {

1580 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1581 
g
->
xt_pgno
 = 
gp
->
xt
;

1582 
g
->
ev_pgno
 = 
gp
->
ev
;

1583 
g
->
l
 = 
gp
->lsn;

1585 i((
t
 = 
	`__memp_ut
(
mpf
,

1586 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1587 
out
;

1588 
g
 = 
NULL
;

1590 
xt2
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
xt
, 

, 
NULL
, 0, &
g
)) != 0) {

1591 i(
t
 !
DB_PAGE_NOTFOUND
) {

1592 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
xt
,et);

1593 
out
;

1595 
ev
;

1598 
modifd
 = 0;

1599 
cmp_n
 = 
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
));

1600 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_xt
);

1601 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_xt
);

1602 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1604 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1605 
g
->
ev_pgno
 = 
gp
->
ev
;

1606 
modifd
 = 1;

1607 } i(
cmp_n
 =0 && 
	`DB_UNDO
(

)) {

1609 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1610 
g
->
ev_pgno
 = 
gp
->
pgno
;

1611 
modifd
 = 1;

1613 i(
modifd
) {

1614 i(
	`DB_UNDO
(

))

1615 
g
->
l
 = 
gp
->
l_xt
;

1617 
g
->
l
 = *
lp
;

1619 i((
t
 = 
	`__memp_ut
(
mpf
,

1620 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1621 
out
;

1622 
g
 = 
NULL
;

1624 
ev
: i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->ev, 

, 
NULL
, 0, &
g
)) != 0) {

1625 i(
t
 !
DB_PAGE_NOTFOUND
) {

1626 
t
 = 
	`__db_pgr
(
fe_dbp
, 
gp
->
ev
,et);

1627 
out
;

1629 
de
;

1632 
modifd
 = 0;

1633 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l_ev
);

1634 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l_ev
);

1635 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

1637 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1638 
g
->
xt_pgno
 = 
gp
->
xt
;

1639 
modifd
 = 1;

1640 } i(
	`LOG_COMPARE
(
lp
, &
	`LSN
(
g
)=0 && 
	`DB_UNDO
(

)) {

1642 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

1643 
g
->
xt_pgno
 = 
gp
->
pgno
;

1644 
modifd
 = 1;

1646 i(
modifd
) {

1647 i(
	`DB_UNDO
(

))

1648 
g
->
l
 = 
gp
->
l_ev
;

1650 
g
->
l
 = *
lp
;

1652 i((
t
 = 
	`__memp_ut
(
mpf
,

1653 

, 
g
, 
fe_dbp
->
iܙy
)) != 0)

1654 
out
;

1655 
g
 = 
NULL
;

1657 
de
: *
lp
 = 
gp
->
ev_l
;

1658 
t
 = 0;

1660 
out
: i(
g
 !
NULL
)

1661 ()
	`__memp_ut
(
mpf
, 

, 
g
, 
fe_dbp
->
iܙy
);

1662 
REC_CLOSE
;

1663 
	}
}

	@../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_THREAD_INFO
 *

;

26 
DB_TXN
 *
txn
;

28 
DBC
 *
dbc
;

29 
DB_LOCK
 
ma_lock
;

30 
t
, 
t_t
;

33 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 0)) != 0)

34  (
t
);

37 i((
t
 = 
	`__db_lg
(
dbc
,

38 0, 
PGNO_BASE_MD
, 
DB_LOCK_WRITE
, 0, &
ma_lock
)) != 0)

39 
r
;

42 
	`F_SET
(
dbc
, 
DBC_DONTLOCK
);

45 
t
 = 
	`__bam_av
(
dbc
,

46 
DB_LOCK_WRITE
, 
dbc
->

->
ro
, 
__db_aim_back
, 
NULL
);

48 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
ma_lock
)!0 && 
t
 == 0)

49 
t
 = 
t_t
;

52 
r
: i((
t_t
 = 
	`__dbc_o
(
dbc
)!0 && 
t
 == 0)

53 
t
 = 
t_t
;

55  (
t
);

56 
	}
}

65 
	$__bam_un
(
dbc
, 
coup
)

66 
DBC
 *
dbc
;

67 
u_t32_t
 *
coup
;

69 
u_t32_t
 
cou
;

70 
t
;

72 
cou
 = 0;

75 
t
 = 
	`__bam_av
(
dbc
,

76 
DB_LOCK_WRITE
, 
dbc
->

->
ro
, 
__db_un_back
, &
cou
);

78 i(
coup
 !
NULL
)

79 *
coup
 = 
cou
;

81  (
t
);

82 
	}
}

	@../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_THREAD_INFO
 *

;

105 
DB_TXN
 *
txn
;

106 cڡ *
me
;

107 
db_pgno_t
 
ba_pgno
;

108 
u_t32_t
 
ags
;

110 
BTREE
 *
t
;

111 
DBC
 *
dbc
;

112 
t
, 
t_t
;

114 
	`COMPQUIET
(
me
, 
NULL
);

115 
t
 = 
dbp
->
bt_
;

118 i((
t
 = 
	`__bam_ad_ro
(
dbp
, 

, 
txn
, 
ba_pgno
, 
ags
)) != 0)

119  (
t
);

129 i(
t
->
_sour
 !
NULL
 && (
t
 = 
	`__m_sour
(
dbp
)) != 0)

130  (
t
);

133 i(
	`F_ISSET
(
dbp
, 
DB_AM_SNAPSHOT
)) {

135 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
NULL
, &
dbc
, 0)) != 0)

136  (
t
);

139 i((
t
 = 
	`__m_upde
(
dbc
,

140 
DB_MAX_RECORDS
, 0)!0 && 
t
 =
DB_NOTFOUND
)

141 
t
 = 0;

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

145 
t
 = 
t_t
;

148  (
t
);

149 
	}
}

158 
	$__m_nd
(
dbc
, 
key
, 
da
)

159 
DBC
 *
dbc
;

160 
DBT
 *
key
, *
da
;

162 
BTREE_CURSOR
 *

;

163 
t
;

165 

 = (
BTREE_CURSOR
 *)
dbc
->

;

172 
t
 = 
	`__m_upde
(
dbc
, 
DB_MAX_RECORDS
, 0);

173 i(
t
 =0 || =
DB_NOTFOUND
)

174 
t
 = 
	`__m_add
(
dbc
, &

->
o
, 
da
, 
DB_APPEND
, 0);

177 i(
t
 =0 && 
key
 !
NULL
)

178 
t
 = 
	`__db_tcy
(
dbc
->
v
, 
key
, &

->
o
,

179 (

->
o
), &
dbc
->
rkey
->
da
, &dbc->rkey->
un
);

181  (
t
);

182 
	}
}

191 
	$__mc_d
(
dbc
)

192 
DBC
 *
dbc
;

194 
BKEYDATA
 
bk
;

195 
BTREE
 *
t
;

196 
BTREE_CURSOR
 *

;

197 
DB
 *
dbp
;

198 
DBT
 
hdr
, 
da
;

199 
DB_LSN
 
l
;

200 
exa
, 
nc
, 
t
, 
ack
, 
t_t
;

202 
dbp
 = 
dbc
->dbp;

203 

 = (
BTREE_CURSOR
 *)
dbc
->

;

204 
t
 = 
dbp
->
bt_
;

205 
ack
 = 0;

218 i(
	`CD_ISSET
(

))

219  (
DB_KEYEMPTY
);

222 i((
t
 = 
	`__bam_rch
(
dbc
, &

->
o
, 
SR_DELETE
, 1, &
exa
)) != 0)

223 
r
;

224 i(!
exa
) {

225 
t
 = 
DB_NOTFOUND
;

226 
r
;

228 
ack
 = 1;

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

232 &

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

233 
r
;

234 
	`STACK_TO_CURSOR
(

, 
t
);

235 i(
t
 != 0)

236 
r
;

249 i(
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 

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

250 
t
 = 
DB_KEYEMPTY
;

251 
r
;

254 i(
	`F_ISSET
(

, 
C_RENUMBER
)) {

256 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

257 
r
;

258 i((
t
 = 
	`__bam_adju
(
dbc
, -1)) != 0)

259 
r
;

260 i((
t
 = 
	`__m_
(
dbc
, 
CA_DELETE
, &
nc
)) != 0)

261 
r
;

262 i(
nc
 > 0 &&

263 
	`CURADJ_LOG
(
dbc
&& (
t
 = 
	`__bam_rcudj_log
(
dbp
, dbc->
txn
,

264 &
l
, 0, 
CA_DELETE
, 

->
ro
, cp->
o
, cp->
d
)) != 0)

265 
r
;

280 i(
	`NUM_ENT
(

->
ge
=0 && 
	`PGNO
(->ge!->
ro
) {

285 
t
 = 
	`__bam_dges
(
dbc
, 0, 0);

291 
ack
 = 0;

292 

->
ge
 = 
NULL
;

296 i((
t
 = 
	`__bam_dem
(
dbc
, 

->
ge
, cp->
dx
)) != 0)

297 
r
;

299 
	`B_TSET_DELETED
(
bk
.
ty
, 
B_KEYDATA
);

300 
bk
.
n
 = 0;

301 
	`DB_INIT_DBT
(
hdr
, &
bk
, 
	`SSZA
(
BKEYDATA
, 
da
));

302 
	`DB_INIT_DBT
(
da
, "", 0);

303 i((
t
 = 
	`__db_pem
(
dbc
,

304 

->
ge
, cp->
dx
, 
	`BKEYDATA_SIZE
(0), &
hdr
, &
da
)) != 0)

305 
r
;

308 
t
->
_modifd
 = 1;

310 
r
: i(
ack
 && (
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
)!0 && 
t
 == 0)

311 
t
 = 
t_t
;

313  (
t
);

314 
	}
}

324 
	$__mc_g
(
dbc
, 
key
, 
da
, 
ags
, 
pgn
)

325 
DBC
 *
dbc
;

326 
DBT
 *
key
, *
da
;

327 
u_t32_t
 
ags
;

328 
db_pgno_t
 *
pgn
;

330 
BTREE_CURSOR
 *

;

331 
DB
 *
dbp
;

332 
cmp
, 
exa
, 
t
;

334 
	`COMPQUIET
(
pgn
, 
NULL
);

336 
dbp
 = 
dbc
->dbp;

337 

 = (
BTREE_CURSOR
 *)
dbc
->

;

339 
	`LF_CLR
(
DB_MULTIPLE
|
DB_MULTIPLE_KEY
);

340 
y
: 
ags
) {

341 
DB_CURRENT
:

347 i(
	`CD_ISSET
(

))

348  (
DB_KEYEMPTY
);

350 
DB_NEXT_DUP
:

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

358  (
DB_NOTFOUND
);

360 
DB_NEXT_NODUP
:

366 
DB_NEXT
:

367 
ags
 = 
DB_NEXT
;

373 i(
	`CD_ISSET
(

)) {

377 
	`CD_CLR
(

);

381 i(

->
o
 !
RECNO_OOB
) {

382 ++

->
o
;

386 
DB_FIRST
:

387 
ags
 = 
DB_NEXT
;

388 

->
o
 = 1;

390 
DB_PREV_DUP
:

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

398  (
DB_NOTFOUND
);

400 
DB_PREV_NODUP
:

406 
DB_PREV
:

407 
ags
 = 
DB_PREV
;

408 i(

->
o
 !
RECNO_OOB
) {

409 i(

->
o
 == 1) {

410 
t
 = 
DB_NOTFOUND
;

411 
r
;

413 --

->
o
;

417 
DB_LAST
:

418 
ags
 = 
DB_PREV
;

419 i(((
t
 = 
	`__m_upde
(
dbc
,

420 
DB_MAX_RECORDS
, 0)!0&& 
t
 !
DB_NOTFOUND
)

421 
r
;

422 i((
t
 = 
	`__bam_ecs
(
dbc
, &

->
o
)) != 0)

423 
r
;

424 i(

->
o
 == 0) {

425 
t
 = 
DB_NOTFOUND
;

426 
r
;

429 
DB_GET_BOTHC
:

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

440 

->
o
++;

443 
t
 = 
DB_NOTFOUND
;

444 
r
;

446 
DB_GET_BOTH
:

447 
DB_GET_BOTH_RANGE
:

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

455 

->
o
 = 1;

459 
DB_SET
:

460 
DB_SET_RANGE
:

461 i((
t
 = 
	`__m_gno
(
dbc
, 
key
, &

->
o
, 0)) != 0)

462 
r
;

465 
t
 = 
	`__db_unknown_ag
(
dbp
->
v
, "__mc_g", 
ags
);

466 
r
;

478 i((
ags
 =
DB_NEXT
 || fg=
DB_CURRENT
&& ((
t
 =

479 
	`__m_upde
(
dbc
, 

->
o
, 0)!0&& 
t
 !
DB_NOTFOUND
)

480 
r
;

482 ;; ++

->
o
) {

484 i((
t
 = 
	`__bam_rch
(
dbc
, &

->
o
,

485 
	`F_ISSET
(
dbc
, 
DBC_RMW
? 
SR_FIND_WR
 : 
SR_FIND
,

486 1, &
exa
)) != 0)

487 
r
;

488 i(!
exa
) {

489 
t
 = 
DB_NOTFOUND
;

490 
r
;

494 
	`STACK_TO_CURSOR
(

, 
t
);

495 i(
t
 != 0)

496 
r
;

507 i(
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 

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

508 
ags
) {

509 
DB_NEXT
:

510 
DB_PREV
:

511 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

512 
y
;

513 
DB_GET_BOTH
:

514 
DB_GET_BOTH_RANGE
:

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

523 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

526 
t
 = 
DB_NOTFOUND
;

527 
r
;

529 
t
 = 
DB_KEYEMPTY
;

530 
r
;

533 i(
ags
 =
DB_GET_BOTH
 ||

534 
ags
 =
DB_GET_BOTHC
 || fg=
DB_GET_BOTH_RANGE
) {

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

536 
da
, 

->
ge
, cp->
dx
, 
__bam_defcmp
, &
cmp
)) != 0)

537  (
t
);

538 i(
cmp
 == 0)

540 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
)) {

541 
t
 = 
DB_NOTFOUND
;

542 
r
;

544 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

550 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
&& !F_ISSET(
key
, 
DB_DBT_ISSET
)) {

551 
t
 = 
	`__db_tcy
(
dbp
->
v
,

552 
key
, &

->
o
, (cp->recno),

553 &
dbc
->
rkey
->
da
, &dbc->rkey->
un
);

554 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

558 
r
: 
	`CD_CLR
(

);

560  (
t
);

561 
	}
}

570 
	$__mc_put
(
dbc
, 
key
, 
da
, 
ags
, 
pgn
)

571 
DBC
 *
dbc
;

572 
DBT
 *
key
, *
da
;

573 
u_t32_t
 
ags
;

574 
db_pgno_t
 *
pgn
;

576 
BTREE_CURSOR
 *

;

577 
DB
 *
dbp
;

578 
DB_LSN
 
l
;

579 
ENV
 *
v
;

580 
u_t32_t
 
iiags
;

581 
exa
, 
nc
, 
t
, 
t_t
;

582 *
g
;

584 
	`COMPQUIET
(
pgn
, 
NULL
);

586 
dbp
 = 
dbc
->dbp;

587 
v
 = 
dbp
->env;

588 

 = (
BTREE_CURSOR
 *)
dbc
->

;

597 i(
	`F_ISSET
(
dbc
, 
DBC_OPD
))

598 
ags
) {

599 
DB_KEYFIRST
:

600 

->
o
 = 1;

601 
ags
 = 
DB_BEFORE
;

603 
DB_KEYLAST
:

604 i((
t
 = 
	`__m_add
(
dbc
,

605 &

->
o
, 
da
, 
DB_APPEND
, 0)) != 0)

606  (
t
);

607 i(
	`CURADJ_LOG
(
dbc
) &&

608 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0,

609 
CA_ICURRENT
, 

->
ro
, cp->
o
, cp->
d
)) != 0)

610  (
t
);

621 i(
ags
 =
DB_KEYFIRST
 ||

622 
ags
 =
DB_KEYLAST
 || fg=
DB_NOOVERWRITE
) {

623 
t
 = 
	`__m_gno
(
dbc
, 
key
, &

->
o
, 1);

624 i(
t
 =0 || =
DB_NOTFOUND
)

625 
t
 = 
	`__m_add
(
dbc
, &

->
o
, 
da
, 
ags
, 0);

626  (
t
);

637 i(
	`CD_ISSET
(

))

638 
iiags
 = 
DB_BEFORE
;

640 
iiags
 = 
ags
;

642 
l
: i((
t
 = 
	`__bam_rch
(
dbc
, &

->
o
, 
SR_INSERT
, 1, &
exa
)) != 0)

643 
r
;

648 
	`DB_ASSERT
(
v
, 
exa
 || 
	`CD_ISSET
(

));

651 
	`STACK_TO_CURSOR
(

, 
t
);

652 i(
t
 != 0)

653 
r
;

655 
t
 = 
	`__bam_iem
(
dbc
, 
key
, 
da
, 
iiags
, 0);

656 
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

658 i(
t_t
 !0 && (
t
 =0 || =
DB_NEEDSPLIT
))

659 
t
 = 
t_t
;

660 i(
t
 =
DB_NEEDSPLIT
) {

661 
g
 = &

->
o
;

662 i((
t
 = 
	`__bam_l
(
dbc
, 
g
, 
NULL
)) != 0)

663 
r
;

664 
l
;

666 i(
t
 != 0)

667 
r
;

669 
ags
) {

670 
DB_AFTER
:

671 i((
t
 = 
	`__m_
(
dbc
, 
CA_IAFTER
, &
nc
)) != 0)

672 
r
;

679 i(
iiags
 =
DB_AFTER
)

680 ++

->
o
;

683 i(
nc
 > 0 && 
	`CURADJ_LOG
(
dbc
) &&

684 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0, 
CA_IAFTER
,

685 

->
ro
, cp->
o
, cp->
d
)) != 0)

686 
r
;

688 
DB_BEFORE
:

689 i((
t
 = 
	`__m_
(
dbc
, 
CA_IBEFORE
, &
nc
)) != 0)

690 
r
;

691 --

->
o
;

694 i(
nc
 > 0 && 
	`CURADJ_LOG
(
dbc
) &&

695 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0, 
CA_IBEFORE
,

696 

->
ro
, cp->
o
, cp->
d
)) != 0)

697 
r
;

699 
DB_CURRENT
:

705 i(!
	`CD_ISSET
(

))

709 i((
t
 = 
	`__m_
(
dbc
, 
CA_ICURRENT
, &
nc
)) != 0)

710 
r
;

711 i(
nc
 > 0 && 
	`CURADJ_LOG
(
dbc
) &&

712 (
t
 = 
	`__bam_rcudj_log
(
dbp
, 
dbc
->
txn
, &
l
, 0,

713 
CA_ICURRENT
, 

->
ro
, cp->
o
, cp->
d
)) != 0)

714 
r
;

721 i(!
	`F_ISSET
(
dbc
, 
DBC_OPD
) &&

722 (
ags
 =
DB_AFTER
 || fg=
DB_BEFORE
&& 
key
 !
NULL
)

723 
t
 = 
	`__db_tcy
(
v
, 
key
, &

->
o
,

724 (

->
o
), &
dbc
->
rkey
->
da
, &dbc->rkey->
un
);

727 
r
: 
	`CD_CLR
(

);

729  (
t
);

730 
	}
}

739 
	$__m_
(
dbc_g
, 

, 
foundp
)

740 
DBC
 *
dbc_g
;

741 
_o_g
 

;

742 *
foundp
;

744 
BTREE_CURSOR
 *

, *
_g
;

745 
DB
 *
dbp
, *
ldbp
;

746 
DBC
 *
dbc
;

747 
ENV
 *
v
;

748 
db_o_t
 
o
;

749 
u_t32_t
 
d
;

750 
adjued
, 
found
;

752 
dbp
 = 
dbc_g
->dbp;

753 
v
 = 
dbp
->env;

754 
_g
 = (
BTREE_CURSOR
 *)
dbc_g
->

;

755 
o
 = 
_g
->recno;

761 
	`DB_ASSERT
(
v
, 
	`F_ISSET
(
_g
, 
C_RENUMBER
));

763 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

773 i(

 =
CA_DELETE
) {

774 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

775 
d
 = 1;

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

777 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

778 
	`MUTEX_LOCK
(
v
, 
dbp
->
mux
);

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

780 

 = (
BTREE_CURSOR
 *)
dbc
->

;

781 i(
_g
->
ro
 =

->root &&

782 
o
 =

->&& 
	`CD_ISSET
(cp) &&

783 
d
 <

->order &&

784 !
	`MVCC_SKIP_CURADJ
(
dbc
, 

->
ro
))

785 
d
 = 

->order + 1;

787 
	`MUTEX_UNLOCK
(
v
, 
dbp
->
mux
);

790 
d
 = 
INVALID_ORDER
;

793 
	`FIND_FIRST_DB_MATCH
(
v
, 
dbp
, 
ldbp
);

794 
found
 = 0;

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

796 
ldbp
 = 
	`TAILQ_NEXT
dbp, 
dblilks
)) {

797 
	`MUTEX_LOCK
(
v
, 
dbp
->
mux
);

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

799 

 = (
BTREE_CURSOR
 *)
dbc
->

;

800 i(
_g
->
ro
 !

->root ||

801 
	`MVCC_SKIP_CURADJ
(
dbc
, 

->
ro
))

803 ++
found
;

804 
adjued
 = 0;

805 

) {

806 
CA_DELETE
:

807 i(
o
 < 

->recno) {

808 --

->
o
;

813 i(
o
 =

->&& 
	`CD_ISSET
(cp))

814 

->
d
 += order;

815 } i(
o
 =

->recno &&

816 !
	`CD_ISSET
(

)) {

817 
	`CD_SET
(

);

818 

->
d
 = order;

821 
CA_IBEFORE
:

826 i(
	`C_EQUAL
(
_g
, 

)) {

827 ++

->
o
;

828 
adjued
 = 1;

830 

;

831 
CA_ICURRENT
:

843 
	`DB_ASSERT
(
v
, 
	`CD_ISSET
(
_g
));

844 i(
	`C_EQUAL
(
_g
, 

)) {

845 
	`CD_CLR
(

);

849 
CA_IAFTER
:

850 

: i(!
adjued
 && 
	`C_LESSTHAN
(
_g
, 

)) {

851 ++

->
o
;

852 
adjued
 = 1;

854 i(
o
 =

->&& 
adjued
)

863 

->
d
 -(
_g
->order - 1);

867 
	`MUTEX_UNLOCK
(
dbp
->
v
, dbp->
mux
);

869 
	`MUTEX_UNLOCK
(
v
,nv->
mtx_dbli
);

871 i(
foundp
 !
NULL
)

872 *
foundp
 = 
found
;

874 
	}
}

883 
	$__m_gno
(
dbc
, 
key
, 
p
, 
n_
)

884 
DBC
 *
dbc
;

885 cڡ 
DBT
 *
key
;

886 
db_o_t
 *
p
;

887 
n_
;

889 
DB
 *
dbp
;

890 
db_o_t
 
o
;

892 
dbp
 = 
dbc
->dbp;

895 i(
key
->
size
 !(
db_o_t
)) {

896 
	`__db_rx
(
dbp
->
v
, "illegalecordumber size");

897  (
EINVAL
);

901 i((
o
 = *(
db_o_t
 *)
key
->
da
) == 0) {

902 
	`__db_rx
(
dbp
->
v
, "illegalecordumber of 0");

903  (
EINVAL
);

905 i(
p
 !
NULL
)

906 *
p
 = 
o
;

912  (
dbc
->
dbty
 =
DB_RECNO
 ?

913 
	`__m_upde
(
dbc
, 
o
, 
n_
) : 0);

914 
	}
}

921 
	$__m_upde
(
dbc
, 
o
, 
n_
)

922 
DBC
 *
dbc
;

923 
db_o_t
 
o
;

924 
n_
;

926 
BTREE
 *
t
;

927 
DB
 *
dbp
;

928 
DBT
 *
rda
;

929 
db_o_t
 
ecs
;

930 
t
;

932 
dbp
 = 
dbc
->dbp;

933 
t
 = 
dbp
->
bt_
;

939 i(!
n_
 && 
t
->
_eof
)

946 i((
t
 = 
	`__bam_ecs
(
dbc
, &
ecs
)) != 0)

947  (
t
);

948 i(!
t
->
_eof
 && 
o
 > 
ecs
) {

949 i((
t
 = 
	`__m_d
(
dbc
, 
o
)!0 && !
DB_NOTFOUND
)

950  (
t
);

951 i((
t
 = 
	`__bam_ecs
(
dbc
, &
ecs
)) != 0)

952  (
t
);

959 i(!
n_
 || 
o
 <
ecs
 + 1)

962 
rda
 = &
dbc
->
my_rda
;

963 
rda
->
ags
 = 0;

964 
rda
->
size
 = 0;

966 
o
 > ++
ecs
)

967 i((
t
 = 
	`__m_add
(
dbc
,

968 &
ecs
, 
rda
, 0, 
BI_DELETED
)) != 0)

969  (
t
);

971 
	}
}

978 
	$__m_sour
(
dbp
)

979 
DB
 *
dbp
;

981 
BTREE
 *
t
;

982 
ENV
 *
v
;

983 *
sour
;

984 
t
;

986 
v
 = 
dbp
->env;

987 
t
 = 
dbp
->
bt_
;

990 i((
t
 = 
	`__db_ame
(
v
,

991 
DB_APP_DATA
, 
t
->
_sour
, 0, 
NULL
, &
sour
)) != 0)

992  (
t
);

993 
	`__os_
(
v
, 
t
->
_sour
);

994 
t
->
_sour
 = 
sour
;

1002 i((
t
->
_
 = 
	`fݒ
->
_sour
, "rb")=
NULL
) {

1003 
t
 = 
	`__os_g_o
();

1004 
	`__db_r
(
v
, 
t
, "%s", 
t
->
_sour
);

1005  (
t
);

1008 
t
->
_eof
 = 0;

1010 
	}
}

1019 
	$__m_wreback
(
dbp
)

1020 
DB
 *
dbp
;

1022 
BTREE
 *
t
;

1023 
DBC
 *
dbc
;

1024 
DBT
 
key
, 
da
;

1025 
DB_THREAD_INFO
 *

;

1026 
ENV
 *
v
;

1027 
FILE
 *

;

1028 
db_o_t
 
keyno
;

1029 
t
, 
t_t
;

1030 
u_t8_t
 
dim
, *
d
;

1032 
t
 = 
dbp
->
bt_
;

1033 
v
 = 
dbp
->env;

1034 

 = 
NULL
;

1035 
d
 = 
NULL
;

1038 i(!
t
->
_modifd
)

1042 i(
t
->
_sour
 =
NULL
) {

1043 
t
->
_modifd
 = 0;

1053 
	`memt
(&
key
, 0, (key));

1054 
key
.
size
 = (
db_o_t
);

1055 
key
.
da
 = &
keyno
;

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

1057 
	`F_SET
(&
da
, 
DB_DBT_REALLOC
);

1060 
	`ENV_GET_THREAD_INFO
(
v
, 

);

1061 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
NULL
, &
dbc
, 0)) != 0)

1062  (
t
);

1085 i((
t
 =

1086 
	`__m_upde
(
dbc
, 
DB_MAX_RECORDS
, 0)!0 && 
t
 !
DB_NOTFOUND
)

1087 
r
;

1092 i(
t
->
_
 !
NULL
) {

1093 i(
	`fo
(
t
->
_
) != 0) {

1094 
t
 = 
	`__os_g_o
();

1095 
	`__db_r
(
v
, 
t
, "%s", 
t
->
_sour
);

1096 
r
;

1098 
t
->
_
 = 
NULL
;

1100 i((

 = 
	`fݒ
(
t
->
_sour
, "wb")=
NULL
) {

1101 
t
 = 
	`__os_g_o
();

1102 
	`__db_r
(
v
, 
t
, "%s", 
t
->
_sour
);

1103 
r
;

1110 
dim
 = 
t
->
_dim
;

1111 
keyno
 = 1;; ++keyno) {

1112 
t
 = 
	`__db_g
(
dbp
, 

, 
NULL
, &
key
, &
da
, 0)) {

1114 i(
da
.
size
 != 0 &&

1115 
	`fwre
(
da
.da, 1, da.
size
, 

) != data.size)

1116 
wre_r
;

1118 
DB_KEYEMPTY
:

1119 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
)) {

1120 i(
d
 =
NULL
) {

1121 i((
t
 = 
	`__os_mloc
(

1122 
v
, 
t
->
_n
, &
d
)) != 0)

1123 
r
;

1124 
	`memt
(
d
, 
t
->
_d
,->
_n
);

1126 i(
	`fwre
(
d
, 1, 
t
->
_n
, 

) !=->re_len)

1127 
wre_r
;

1130 
DB_NOTFOUND
:

1131 
t
 = 0;

1132 
de
;

1134 
r
;

1136 i(!
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
) &&

1137 
	`fwre
(&
dim
, 1, 1, 

) != 1) {

1138 
wre_r
: 
t
 = 
	`__os_g_o
();

1139 
	`__db_r
(
v
, 
t
,

1140 "%s: wredbackg fe", 
t
->
_sour
);

1141 
r
;

1145 
r
:

1146 
de
:

1147 i(

 !
NULL
 && 
	`fo
(fp) != 0) {

1148 
t_t
 = 
	`__os_g_o
();

1149 
	`__db_r
(
v
, 
t_t
, "%s", 
t
->
_sour
);

1150 i(
t
 == 0)

1151 
t
 = 
t_t
;

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

1156 
t
 = 
t_t
;

1159 i(
da
.d!
NULL
)

1160 
	`__os_u
(
v
, 
da
.data);

1161 i(
d
 !
NULL
)

1162 
	`__os_
(
v
, 
d
);

1164 i(
t
 == 0)

1165 
t
->
_modifd
 = 0;

1167  (
t
);

1168 
	}
}

1175 
	$__m_d
(
dbc
, 
t
)

1176 
DBC
 *
dbc
;

1177 
db_o_t
 
t
;

1179 
BTREE
 *
t
;

1180 
DB
 *
dbp
;

1181 
DBT
 
da
, *
rda
;

1182 
db_o_t
 
o
;

1183 
size_t
 
n
;

1184 
ch
, 
t
, 
was_modifd
;

1186 
t
 = 
dbc
->
dbp
->
bt_
;

1187 
dbp
 = 
dbc
->dbp;

1188 
was_modifd
 = 
t
->
_modifd
;

1190 i((
t
 = 
	`__bam_ecs
(
dbc
, &
o
)) != 0)

1191  (
t
);

1198 
n
 = 
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
? 
t
->
_n
 : 256;

1199 
rda
 = &
dbc
->
my_rkey
;

1200 i(
rda
->
un
 < 
n
) {

1201 i((
t
 = 
	`__os_loc
(

1202 
dbp
->
v
, 
n
, &
rda
->
da
)) != 0) {

1203 
rda
->
un
 = 0;

1204 
rda
->
da
 = 
NULL
;

1205  (
t
);

1207 
rda
->
un
 = (
u_t32_t
)
n
;

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

1211 
o
 < 
t
) {

1212 
da
.d
rda
->data;

1213 
da
.
size
 = 0;

1214 i(
	`F_ISSET
(
dbp
, 
DB_AM_FIXEDLEN
))

1215 
n
 = 
t
->
_n
;en > 0; --len) {

1216 i((
ch
 = 
	`fgc
(
t
->
_
)=
EOF
) {

1217 i(
da
.
size
 == 0)

1218 
eof
;

1221 ((
u_t8_t
 *)
da
.da)[da.
size
++] = 
ch
;

1225 i((
ch
 = 
	`fgc
(
t
->
_
)=
EOF
) {

1226 i(
da
.
size
 == 0)

1227 
eof
;

1230 i(
ch
 =
t
->
_dim
)

1233 ((
u_t8_t
 *)
da
.da)[da.
size
++] = 
ch
;

1234 i(
da
.
size
 =
rda
->
un
) {

1235 i((
t
 = 
	`__os_loc
(
dbp
->
v
,

1236 
rda
->
un
 *= 2,

1237 &
rda
->
da
)) != 0) {

1238 
rda
->
un
 = 0;

1239 
rda
->
da
 = 
NULL
;

1240  (
t
);

1242 
da
.d
rda
->data;

1253 i(
t
->
_ϡ
 >
o
) {

1254 ++
o
;

1255 i((
t
 = 
	`__m_add
(
dbc
, &
o
, &
da
, 0, 0)) != 0)

1256 
r
;

1258 ++
t
->
_ϡ
;

1262 
eof
: 
t
->
_eof
 = 1;

1263 
t
 = 
DB_NOTFOUND
;

1265 
r
: i(!
was_modifd
)

1266 
t
->
_modifd
 = 0;

1268  (
t
);

1269 
	}
}

1276 
	$__m_add
(
dbc
, 

, 
da
, 
ags
, 
bi_ags
)

1277 
DBC
 *
dbc
;

1278 
db_o_t
 *

;

1279 
DBT
 *
da
;

1280 
u_t32_t
 
ags
, 
bi_ags
;

1282 
BTREE_CURSOR
 *

;

1283 
exa
, 
t
, 
ack
, 
t_t
;

1285 

 = (
BTREE_CURSOR
 *)
dbc
->

;

1287 
y
:

1288 i((
t
 = 
	`__bam_rch
(
dbc
, 

,

1289 
SR_INSERT
 | (
ags
 =
DB_APPEND
 ? 
SR_APPEND
 : 0), 1, &
exa
)) != 0)

1290  (
t
);

1291 
ack
 = 1;

1294 
	`STACK_TO_CURSOR
(

, 
t
);

1295 i(
t
 != 0)

1296 
r
;

1298 i(
exa
 && 
ags
 =
DB_NOOVERWRITE
 && !
	`CD_ISSET
(

) &&

1299 !
	`B_DISSET
(
	`GET_BKEYDATA
(
dbc
->
dbp
, 

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

1300 
t
 = 
DB_KEYEXIST
;

1301 
r
;

1308 i(
ags
 =
DB_APPEND
 && 
dbc
->
dbp
->
db_nd_o
 !
NULL
 &&

1309 (
t
 = 
dbc
->
dbp
->
	`db_nd_o
(dbc->dbp, 
da
, *

)) != 0)

1310 
r
;

1319 
t
 = 
	`__bam_iem
(
dbc
,

1320 
NULL
, 
da
, 
exa
 ? 
DB_CURRENT
 : 
DB_BEFORE
, 
bi_ags
)) {

1338 
DB_NEEDSPLIT
:

1340 ()
	`__bam_kl
(
dbc
, 
STK_CLRDBC
);

1341 
ack
 = 0;

1343 i((
t
 = 
	`__bam_l
(
dbc
, 

, 
NULL
)) != 0)

1344 
r
;

1346 
y
;

1349 
r
;

1352 
r
: i(
ack
 && (
t_t
 = 
	`__bam_kl
(
dbc
, 
STK_CLRDBC
)!0 && 
t
 == 0)

1353 
t
 = 
t_t
;

1355  (
t
);

1356 
	}
}

	@../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
,

137 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
);

138 i((
t_t
 =

139 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

140 
t
 = 
t_t
;

141  (
t
 =0 ? 
DB_NOTFOUND
 :et);

152 
tٮ
 = 0;;) {

153 
	`TYPE
(
h
)) {

154 
P_LBTREE
:

155 
P_LDUP
:

156 
o
 -
tٮ
;

161 i(
	`TYPE
(
h
=
P_LBTREE
) {

162 
adju
 = 
P_INDX
;

163 
dofft
 = 
O_INDX
;

165 
adju
 = 
O_INDX
;

166 
dofft
 = 0;

168 
t_o
 = 0, 
dx
 = 0;; indx +
adju
) {

169 i(
dx
 >
	`NUM_ENT
(
h
)) {

170 *
exap
 = 0;

171 i(!
	`LF_ISSET
(
SR_PAST_EOF
) ||

172 
o
 > 
t_o
 + 1) {

173 
t
 = 
	`__memp_ut
(
mpf
,

174 
dbc
->
thad_fo
,

175 
h
, 
dbc
->
iܙy
);

176 
h
 = 
NULL
;

177 i((
t_t
 = 
	`__TLPUT
(
dbc
,

178 
lock
)!0 && 
t
 == 0)

179 
t
 = 
t_t
;

180 i(
t
 == 0)

181 
t
 = 
DB_NOTFOUND
;

182 
r
;

185 i(!
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
,

186 
dx
 + 
dofft
)->
ty
) &&

187 ++
t_o
 =
o
)

192 
	`BT_STK_ENTER
(
dbp
->
v
,

193 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

194 i(
t
 != 0)

195 
r
;

197 
P_IBTREE
:

198 
dx
 = 0, 
t
 = 
	`NUM_ENT
(
h
);;) {

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

200 i(++
dx
 =
t
 || 
tٮ
 + 
bi
->
ecs
 >
o
)

202 
tٮ
 +
bi
->
ecs
;

204 
pg
 = 
bi
->
pgno
;

206 
P_LRECNO
:

207 
o
 -
tٮ
;

210 --
o
;

211 
	`BT_STK_ENTER
(
dbp
->
v
,

212 

, 
h
, 
o
, 
lock
, 
lock_mode
, 
t
);

213 i(
t
 != 0)

214 
r
;

216 
P_IRECNO
:

217 
dx
 = 0, 
t
 = 
	`NUM_ENT
(
h
);;) {

218 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
dx
);

219 i(++
dx
 =
t
 || 
tٮ
 + 
ri
->
ecs
 >
o
)

221 
tٮ
 +
ri
->
ecs
;

223 
pg
 = 
ri
->
pgno
;

226  (
	`__db_pgfmt
(
dbp
->
v
, 
h
->
pgno
));

228 --
dx
;

231 i(

 =
	`LEVEL
(
h
)) {

232 
	`BT_STK_ENTER
(
dbp
->
v
,

233 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

234 i(
t
 != 0)

235 
r
;

238 i(
ack
) {

239 
	`BT_STK_PUSH
(
dbp
->
v
,

240 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

241 i(
t
 != 0)

242 
r
;

243 
h
 = 
NULL
;

245 
lock_mode
 = 
DB_LOCK_WRITE
;

246 i((
t
 =

247 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

248 
r
;

255 i((
	`LF_ISSET
(
SR_PARENT
) &&

256 (
u_t8_t
)(

 + 1>(u_t8_t)(
	`LEVEL
(
h
) - 1)) ||

257 (
	`LEVEL
(
h
- 1=
LEAFLEVEL
)

258 
ack
 = 1;

260 i((
t
 = 
	`__memp_ut
(
mpf
,

261 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)) != 0)

262 
r
;

263 
h
 = 
NULL
;

265 
lock_mode
 = 
ack
 &&

266 
	`LF_ISSET
(
SR_WRITE
? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
;

267 i((
t
 = 
	`__db_lg
(
dbc
,

268 
LCK_COUPLE_ALWAYS
, 
pg
, 
lock_mode
, 0, &
lock
)) != 0) {

274 ()
	`__LPUT
(
dbc
, 
lock
);

275 
r
;

279 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
,

280 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

281 
r
;

285 
r
: i(
h
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

286 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)!0 && 
t
 == 0)

287 
t
 = 
t_t
;

289 
	`BT_STK_POP
(

);

290 
	`__bam_kl
(
dbc
, 0);

292  (
t
);

293 
	}
}

302 
	$__bam_adju
(
dbc
, 
adju
)

303 
DBC
 *
dbc
;

304 
t32_t
 
adju
;

306 
BTREE_CURSOR
 *

;

307 
DB
 *
dbp
;

308 
DB_MPOOLFILE
 *
mpf
;

309 
EPG
 *
g
;

310 
PAGE
 *
h
;

311 
db_pgno_t
 
ro_pgno
;

312 
t
;

314 
dbp
 = 
dbc
->dbp;

315 
mpf
 = 
dbp
->mpf;

316 

 = (
BTREE_CURSOR
 *)
dbc
->

;

317 
ro_pgno
 = 

->
ro
;

320 
g
 = 

->

;pg <->
c
; ++epg) {

321 
h
 = 
g
->
ge
;

322 i(
	`TYPE
(
h
=
P_IBTREE
 || TYPE(h=
P_IRECNO
) {

323 i((
t
 = 
	`__memp_dty
(
mpf
, &
h
,

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

325  (
t
);

326 
g
->
ge
 = 
h
;

327 i(
	`DBC_LOGGING
(
dbc
)) {

328 i((
t
 = 
	`__bam_dju_log
(
dbp
, 
dbc
->
txn
,

329 &
	`LSN
(
h
), 0, 
	`PGNO
(h), &LSN(h),

330 (
u_t32_t
)
g
->
dx
, 
adju
,

331 
	`PGNO
(
h
=
ro_pgno
 ?

332 
CAD_UPDATEROOT
 : 0)) != 0)

333  (
t
);

335 
	`LSN_NOT_LOGGED
(
	`LSN
(
h
));

337 i(
	`TYPE
(
h
=
P_IBTREE
)

338 
	`GET_BINTERNAL
(
dbp
, 
h
, 
g
->
dx
)->
ecs
 +=

339 
adju
;

341 
	`GET_RINTERNAL
(
dbp
, 
h
, 
g
->
dx
)->
ecs
 +=

342 
adju
;

344 i(
	`PGNO
(
h
=
ro_pgno
)

345 
	`RE_NREC_ADJ
(
h
, 
adju
);

349 
	}
}

358 
	$__bam_ecs
(
dbc
, 
p
)

359 
DBC
 *
dbc
;

360 
db_o_t
 *
p
;

362 
DB
 *
dbp
;

363 
DB_LOCK
 
lock
;

364 
DB_MPOOLFILE
 *
mpf
;

365 
PAGE
 *
h
;

366 
db_pgno_t
 
pgno
;

367 
t
, 
t_t
;

369 
dbp
 = 
dbc
->dbp;

370 
mpf
 = 
dbp
->mpf;

372 
pgno
 = 
dbc
->

->
ro
;

373 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_READ
, 0, &
lock
)) != 0)

374  (
t
);

375 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

376 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

377  (
t
);

379 *
p
 = 
	`RE_NREC
(
h
);

381 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
);

382 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

383 
t
 = 
t_t
;

385  (
t
);

386 
	}
}

394 
db_o_t


395 
	$__bam_tٮ
(
dbp
, 
h
)

396 
DB
 *
dbp
;

397 
PAGE
 *
h
;

399 
db_o_t
 
ecs
;

400 
db_dx_t
 
dx
, 
t
;

402 
ecs
 = 0;

403 
t
 = 
	`NUM_ENT
(
h
);

405 
	`TYPE
(
h
)) {

406 
P_LBTREE
:

408 
dx
 = 0; indx < 
t
; indx +
P_INDX
)

409 i(!
	`B_DISSET
(

410 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->
ty
))

411 ++
ecs
;

413 
P_LDUP
:

415 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

416 i(!
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
)->
ty
))

417 ++
ecs
;

419 
P_IBTREE
:

420 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

421 
ecs
 +
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
)->nrecs;

423 
P_LRECNO
:

424 
ecs
 = 
	`NUM_ENT
(
h
);

426 
P_IRECNO
:

427 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

428 
ecs
 +
	`GET_RINTERNAL
(
dbp
, 
h
, 
dx
)->nrecs;

432  (
ecs
);

433 
	}
}

	@../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
,

97 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0) {

99 ()
	`__LPUT
(
dbc
, 
lock
);

100  (
t
);

111 i(!*
ack
 &&

112 ((
	`LF_ISSET
(
SR_PARENT
&& (
u_t8_t
)(
ev
 + 1>
	`LEVEL
(
h
)) ||

113 (
	`LF_ISSET
(
SR_WRITE
&& 
	`LEVEL
(
h
=
LEAFLEVEL
) ||

114 (
	`LF_ISSET
(
SR_START
&& 
ev
 =
	`LEVEL
(
h
)))) {

115 i(!
	`STD_LOCKING
(
dbc
))

116 
no_lock
;

117 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
);

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

119 
t
 = 
t_t
;

120 i(
t
 != 0)

121  (
t
);

122 
lock_mode
 = 
DB_LOCK_WRITE
;

123 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

124  (
t
);

125 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
,

126 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0) {

128 ()
	`__LPUT
(
dbc
, 
lock
);

129  (
t
);

131 i(!((
	`LF_ISSET
(
SR_PARENT
) &&

132 (
u_t8_t
)(
ev
 + 1>
	`LEVEL
(
h
)) ||

133 (
	`LF_ISSET
(
SR_WRITE
&& 
	`LEVEL
(
h
=
LEAFLEVEL
) ||

134 (
	`LF_ISSET
(
SR_START
&& 
ev
 =
	`LEVEL
(
h
)))) {

136 
t
 = 
	`__memp_ut
(
mpf
,

137 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
);

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

139 
t
 = 
t_t
;

140 i(
t
 != 0)

141  (
t
);

142 
y_aga
;

144 
no_lock
: *
ack
 = 1;

146 
	`BT_STK_ENTER
(
dbp
->
v
, 

, 
h
, 0, 
lock
, 
lock_mode
, 
t
);

148  (
t
);

149 
	}
}

159 
	$__bam_ch
(
dbc
, 
ro_pgno
, 
key
, 
ags
, 
ev
, 

, 
exap
)

160 
DBC
 *
dbc
;

161 
db_pgno_t
 
ro_pgno
;

162 cڡ 
DBT
 *
key
;

163 
u_t32_t
 
ags
;

164 
ev
, *
exap
;

165 
db_o_t
 *

;

167 
BTREE
 *
t
;

168 
BTREE_CURSOR
 *

;

169 
DB
 *
dbp
;

170 
DB_LOCK
 
lock
;

171 
DB_MPOOLFILE
 *
mpf
;

172 
ENV
 *
v
;

173 
PAGE
 *
h
;

174 
db_dx_t
 
ba
, 
i
, 
dx
, *
p
, 
lim
;

175 
db_lockmode_t
 
lock_mode
;

176 
db_pgno_t
 
pg
;

177 
db_o_t
 
o
;

178 
adju
, 
cmp
, 
dofft
, 
t
, 
t_ack
, 
ack
, 
t_t
;

179 (*
func

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

181 
dbp
 = 
dbc
->dbp;

182 
v
 = 
dbp
->env;

183 
mpf
 = 
dbp
->mpf;

184 

 = (
BTREE_CURSOR
 *)
dbc
->

;

185 
h
 = 
NULL
;

186 
t
 = 
dbp
->
bt_
;

187 
o
 = 0;

188 
t_ack
 = 0;

190 
	`BT_STK_CLR
(

);

201 i(
ro_pgno
 =
PGNO_INVALID
)

202 
ro_pgno
 = 

->
ro
;

203 i((
t
 = 
	`__bam_g_ro
(
dbc
, 
ro_pgno
, 
ev
, 
ags
, &
ack
)) != 0)

204  (
t
);

205 
lock_mode
 = 

->
c
->lock_mode;

206 
lock
 = 

->
c
->lock;

207 
h
 = 

->
c
->
ge
;

209 
	`BT_STK_CLR
(

);

212 
func
 = 
	`F_ISSET
(
dbc
, 
DBC_OPD
) ?

213 (
dbp
->
dup_com
 =
NULL
 ? 
__bam_defcmp
 : dbp->dup_compare) :

214 
t
->
bt_com
;

217 
p
 = 
	`P_INP
(
dbp
, 
h
);

218 
adju
 = 
	`TYPE
(
h
=
P_LBTREE
 ? 
P_INDX
 : 
O_INDX
;

219 i(
	`LF_ISSET
(
SR_MIN
 | 
SR_MAX
)) {

220 i(
	`LF_ISSET
(
SR_MIN
|| 
	`NUM_ENT
(
h
) == 0)

221 
dx
 = 0;

222 i(
	`TYPE
(
h
=
P_LBTREE
)

223 
dx
 = 
	`NUM_ENT
(
h
) - 2;

225 
dx
 = 
	`NUM_ENT
(
h
) - 1;

227 i(
	`LEVEL
(
h
=
LEAFLEVEL
 ||

228 (!
	`LF_ISSET
(
SR_START
&& 
	`LEVEL
(
h
=
ev
)) {

229 i(
	`LF_ISSET
(
SR_NEXT
))

230 
g_xt
;

231 
found
;

233 
xt
;

242 
	`DB_BINARY_SEARCH_FOR
(
ba
, 
lim
, 
h
, 
adju
) {

243 
	`DB_BINARY_SEARCH_INCR
(
dx
, 
ba
, 
lim
, 
adju
);

244 i((
t
 = 
	`__bam_cmp
(
dbp
, 
dbc
->
thad_fo
,

245 
dbc
->
txn
, 
key
, 
h
, 
dx
, 
func
, &
cmp
)) != 0)

246 
r
;

247 i(
cmp
 == 0) {

248 i(
	`LEVEL
(
h
=
LEAFLEVEL
 ||

249 (!
	`LF_ISSET
(
SR_START
) &&

250 
	`LEVEL
(
h
=
ev
)) {

251 i(
	`LF_ISSET
(
SR_NEXT
))

252 
g_xt
;

253 
found
;

255 
xt
;

257 i(
cmp
 > 0)

258 
	`DB_BINARY_SEARCH_SHIFT_BASE
(
dx
, 
ba
,

259 
lim
, 
adju
);

270 i(
	`LEVEL
(
h
=
LEAFLEVEL
 ||

271 (!
	`LF_ISSET
(
SR_START
&& 
	`LEVEL
(
h
=
ev
)) {

272 *
exap
 = 0;

274 i(
	`LF_ISSET
(
SR_EXACT
)) {

275 
t
 = 
DB_NOTFOUND
;

276 
r
;

279 i(
	`LF_ISSET
(
SR_STK_ONLY
)) {

280 
	`BT_STK_NUM
(
v
, 

, 
h
, 
ba
, 
t
);

281 i((
t_t
 =

282 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

283 
t
 = 
t_t
;

284 i((
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

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

286 
t
 = 
t_t
;

287  (
t
);

289 i(
	`LF_ISSET
(
SR_NEXT
)) {

290 
g_xt
:

294 i(
	`PGNO
(
h
=
ro_pgno
) {

295 
t
 = 
DB_NOTFOUND
;

296 
r
;

304 i((
t
 = 
	`__LPUT
(
dbc
, 
lock
)) != 0)

305 
r
;

306 i((
t
 = 
	`__memp_ut
(
mpf
,

307 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)) != 0)

308 
r
;

309 
h
 = 
NULL
;

310 
	`LF_SET
(
SR_MIN
);

311 
	`LF_CLR
(
SR_NEXT
);

312 
dx
 = 

->

->indx + 1;

313 i(
dx
 =
	`NUM_ENT
(

->

->
ge
)) {

314 
t
 = 
DB_NOTFOUND
;

315 

->
c
++;

316 
r
;

318 
h
 = 

->

->
ge
;

319 

->

->
ge
 = 
NULL
;

320 
lock
 = 

->

->lock;

321 
	`LOCK_INIT
(

->

->
lock
);

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

323 
r
;

324 
ack
 = 1;

325 
xt
;

336 i(
	`LF_ISSET
(
SR_DEL
&& 

->
c
 =->

)

337 

->
c
++;

338 
	`BT_STK_ENTER
(
v
, 

, 
h
, 
ba
, 
lock
, 
lock_mode
, 
t
);

339 i(
t
 != 0)

340 
r
;

350 
dx
 = 
ba
 > 0 ? ba - 
O_INDX
 : base;

356 
xt
: i(

 !
NULL
)

357 
i
 = 0; i < 
dx
; ++i)

358 
o
 +
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
)->
ecs
;

360 
pg
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
dx
)->
pgno
;

363 i(
	`LF_ISSET
(
SR_START
&& 
ev
 =
	`LEVEL
(
h
))

364 
ack
 = 1;

366 i(
	`LF_ISSET
(
SR_STK_ONLY
)) {

367 i(
ev
 =
	`LEVEL
(
h
)) {

368 
	`BT_STK_NUM
(
v
, 

, 
h
, 
dx
, 
t
);

369 i((
t_t
 =

370 
	`__LPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

371 
t
 = 
t_t
;

372 i((
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

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

374 
t
 = 
t_t
;

375  (
t
);

377 
	`BT_STK_NUMPUSH
(
v
, 

, 
h
, 
dx
, 
t
);

378 ()
	`__memp_ut
(
mpf
,

379 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
);

380 
h
 = 
NULL
;

381 i((
t
 = 
	`__db_lg
(
dbc
,

382 
LCK_COUPLE_ALWAYS
, 
pg
, 
lock_mode
, 0, &
lock
)) != 0) {

388 ()
	`__LPUT
(
dbc
, 
lock
);

389  (
t
);

391 } i(
ack
) {

393 i(
	`LF_ISSET
(
SR_PARENT
&& 
ev
 =
	`LEVEL
(
h
)) {

394 
	`BT_STK_ENTER
(
v
,

395 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

396 i(
t
 != 0)

397 
r
;

400 i(
	`LF_ISSET
(
SR_DEL
&& 
	`NUM_ENT
(
h
) > 1) {

405 

->
c
--;

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

407 
r
;

408 
t_ack
 = 
ack
 = 0;

409 
do_d
;

411 
	`BT_STK_PUSH
(
v
,

412 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

413 i(
t
 != 0)

414 
r
;

415 
h
 = 
NULL
;

417 
lock_mode
 = 
DB_LOCK_WRITE
;

418 i((
t
 =

419 
	`__db_lg
(
dbc
, 0, 
pg
, 
lock_mode
, 0, &
lock
)) != 0)

420 
r
;

429 i((
	`LF_ISSET
(
SR_PARENT
) &&

430 (
u_t8_t
)(
ev
 + 1>(
	`LEVEL
(
h
) - 1)) ||

431 (
	`LEVEL
(
h
- 1=
LEAFLEVEL
)

432 
t_ack
 = 1;

446 i(!
	`LF_ISSET
(
SR_DEL
 | 
SR_NEXT
)) {

447 i((
t
 = 
	`__memp_ut
(
mpf
,

448 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)) != 0)

449 
r
;

450 
lock_xt
;

453 i((
	`LF_ISSET
(
SR_DEL
&& 
	`NUM_ENT
(
h
) == 1)) {

459 
ack
 = 
t_ack
 = 1;

460 
	`LF_SET
(
SR_WRITE
);

462 

->
c
++;

464 
	`BT_STK_PUSH
(
v
, 

, 
h
,

465 
dx
, 
lock
, 
lock_mode
, 
t
);

466 i(
t
 != 0)

467 
r
;

468 
	`LOCK_INIT
(
lock
);

479 
do_d
: i(

->
c
->
ge
 !
NULL
) {

480 i(
	`LF_ISSET
(
SR_NEXT
) &&

481 
dx
 =
	`NUM_ENT
(
h
) - 1)

482 

->
c
++;

483 i((
t
 =

484 
	`__bam_kl
(
dbc
, 
STK_NOLOCK
)) != 0)

485 
r
;

488 
	`BT_STK_ENTER
(
v
, 

,

489 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

490 i(
t
 != 0)

491 
r
;

492 
	`LOCK_INIT
(
lock
);

495 
lock_xt
: 
h
 = 
NULL
;

497 i(
t_ack
 && 
	`LF_ISSET
(
SR_WRITE
))

498 
lock_mode
 = 
DB_LOCK_WRITE
;

499 i((
t
 = 
	`__db_lg
(
dbc
,

500 
LCK_COUPLE_ALWAYS
, 
pg
, 
lock_mode
, 0, &
lock
)) != 0) {

506 ()
	`__LPUT
(
dbc
, 
lock
);

507 i(
	`LF_ISSET
(
SR_DEL
 | 
SR_NEXT
&& !
ack
)

508 

->
c
++;

509 
r
;

511 
ack
 = 
t_ack
;

513 i((
t
 = 
	`__memp_fg
(
mpf
, &
pg
,

514 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

515 
r
;

519 
found
: *
exap
 = 1;

531 i(
	`TYPE
(
h
=
P_LBTREE
 && 
	`NUM_ENT
(h> 
P_INDX
) {

532 i(
	`LF_ISSET
(
SR_DUPLAST
))

533 
dx
 < (
db_dx_t
)(
	`NUM_ENT
(
h
- 
P_INDX
) &&

534 
p
[
dx
] =p[dx + 
P_INDX
])

535 
dx
 +
P_INDX
;

536 i(
	`LF_ISSET
(
SR_DUPFIRST
))

537 
dx
 > 0 &&

538 
p
[
dx
] =p[dx - 
P_INDX
])

539 
dx
 -
P_INDX
;

548 
	`DB_ASSERT
(
v
, 

 =
NULL
 || 
	`LF_ISSET
(
SR_DELNO
));

549 i(
	`LF_ISSET
(
SR_DELNO
)) {

550 
dofft
 = 
	`TYPE
(
h
=
P_LBTREE
 ? 
O_INDX
 : 0;

551 i(
	`LF_ISSET
(
SR_DUPLAST
))

552 
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
,

553 
h
, 
dx
 + 
dofft
)->
ty
) && indx > 0 &&

554 
p
[
dx
] =p[dx - 
adju
])

555 
dx
 -
adju
;

557 
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
,

558 
h
, 
dx
 + 
dofft
)->
ty
) &&

559 
dx
 < (
db_dx_t
)(
	`NUM_ENT
(
h
- 
adju
) &&

560 
p
[
dx
] =p[dx + 
adju
])

561 
dx
 +
adju
;

567 i(
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
dofft
)->
ty
)) {

568 
t
 = 
DB_NOTFOUND
;

569 
r
;

578 i(

 !
NULL
) {

579 
	`DB_ASSERT
(
v
, 
	`TYPE
(
h
=
P_LBTREE
);

581 
i
 = 0; i < 
dx
; i +
P_INDX
)

582 i(!
	`B_DISSET
(

583 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
 + 
O_INDX
)->
ty
))

584 ++
o
;

587 *

 = 
o
 + 1;

591 i(
	`LF_ISSET
(
SR_STK_ONLY
)) {

592 
	`BT_STK_NUM
(
v
, 

, 
h
, 
dx
, 
t
);

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

594 
t
 = 
t_t
;

595 i((
t_t
 = 
	`__memp_ut
(
mpf
,

596 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)!0 && 
t
 == 0)

597 
t
 = 
t_t
;

599 i(
	`LF_ISSET
(
SR_DEL
&& 

->
c
 =->

)

600 

->
c
++;

601 
	`BT_STK_ENTER
(
v
, 

, 
h
, 
dx
, 
lock
, 
lock_mode
, 
t
);

603 i(
t
 != 0)

604 
r
;

608 
r
: i(
h
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

609 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)!0 && 
t
 == 0)

610 
t
 = 
t_t
;

613 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

614 
t
 = 
t_t
;

616 
	`BT_STK_POP
(

);

617 
	`__bam_kl
(
dbc
, 0);

619  (
t
);

620 
	}
}

629 
	$__bam_kl
(
dbc
, 
ags
)

630 
DBC
 *
dbc
;

631 
u_t32_t
 
ags
;

633 
BTREE_CURSOR
 *

;

634 
DB
 *
dbp
;

635 
DB_MPOOLFILE
 *
mpf
;

636 
EPG
 *
g
;

637 
t
, 
t_t
;

639 
dbp
 = 
dbc
->dbp;

640 
mpf
 = 
dbp
->mpf;

641 

 = (
BTREE_CURSOR
 *)
dbc
->

;

649 
t
 = 0, 
g
 = 

->

;pg <->
c
; ++epg) {

650 i(
g
->
ge
 !
NULL
) {

651 i(
	`LF_ISSET
(
STK_CLRDBC
&& 

->
ge
 =
g
->page) {

652 

->
ge
 = 
NULL
;

653 
	`LOCK_INIT
(

->
lock
);

655 i((
t_t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
,

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

657 
t
 = 
t_t
;

665 
g
->
ge
 = 
NULL
;

672 i(
	`LF_ISSET
(
STK_PGONLY
))

674 i(
	`LF_ISSET
(
STK_NOLOCK
)) {

675 i((
t_t
 = 
	`__LPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

676 
t
 = 
t_t
;

678 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
g
->
lock
)!0 && 
t
 == 0)

679 
t
 = 
t_t
;

683 i(!
	`LF_ISSET
(
STK_PGONLY
))

684 
	`BT_STK_CLR
(

);

686  (
t
);

687 
	}
}

696 
	$__bam_kgrow
(
v
, 

)

697 
ENV
 *
v
;

698 
BTREE_CURSOR
 *

;

700 
EPG
 *
p
;

701 
size_t
 
s
;

702 
t
;

704 
s
 = 

->
e
 - cp->

;

706 i((
t
 = 
	`__os_oc
(
v
, 
s
 * 2, (
EPG
), &
p
)) != 0)

707  (
t
);

708 
	`memy
(
p
, 

->

, 
s
 * (
EPG
));

709 i(

->

 !->
ack
)

710 
	`__os_
(
v
, 

->

);

711 

->

 = 
p
;

712 

->
c
 = 
p
 + 
s
;

713 

->
e
 = 
p
 + 
s
 * 2;

715 
	}
}

	@../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
->
v
,

187 "Tomy bevs: %d", 

->
ge
->
v
);

188 
t
 = 
ENOSPC
;

189 
r
;

192 i((
t
 = 
	`__memp_dty
(
mpf
,

193 &

->
ge
, 
dbc
->
thad_fo
, 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
 = 
	`__memp_ut
(
mpf
,

240 
dbc
->
thad_fo
, 

->
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
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

245 
dbc
->
thad_fo
, 

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

246 
t
 = 
t_t
;

247 i(

 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

248 
dbc
->
thad_fo
, 

, 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 
DB
 *
dbp
;

265 
DBT
 
log_dbt
;

266 
DB_LOCK
 
lock
, 
lock
;

267 
DB_LSN
 
log_l
;

268 
DB_LSN
 
ve_l
;

269 
DB_MPOOLFILE
 *
mpf
;

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
->
v
, 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
->
thad_fo
, 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
->
thad_fo
, dbc->
txn
, dbc->
iܙy
, 0)) != 0)

386 
r
;

389 i((
t
 = 
	`__memp_dty
(
mpf
,

390 &

->
ge
, 
dbc
->
thad_fo
, 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
->
v
, 

);

460 i((
t_t
 = 
	`__memp_ut
(
mpf
,

461 
dbc
->
thad_fo
, 
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
 = 
	`__memp_ut
(
mpf
,

466 
dbc
->
thad_fo
, 

->
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
 = 
	`__memp_ut
(
mpf
,

471 
dbc
->
thad_fo
, 

->
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
 = 
	`__memp_ut
(
mpf
,

477 
dbc
->
thad_fo
, 

, 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
->
v
, 

);

486 i(
loc_
 !
NULL
)

487 ()
	`__memp_ut
(
mpf
,

488 
dbc
->
thad_fo
, 
loc_
, dbc->
iܙy
);

489 i(

 !
NULL
)

490 ()
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

, dbc->
iܙy
);

493 ()
	`__LPUT
(
dbc
, 
lock
);

494 ()
	`__LPUT
(
dbc
, 
lock
);

496 ()
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

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

497 i(
t
 =
DB_NEEDSPLIT
)

498 ()
	`__LPUT
(
dbc
, 

->
lock
);

500 ()
	`__TLPUT
(
dbc
, 

->
lock
);

502 ()
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 

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

503 i(
t
 =
DB_NEEDSPLIT
)

504 ()
	`__LPUT
(
dbc
, 

->
lock
);

506 ()
	`__TLPUT
(
dbc
, 

->
lock
);

508  (
t
);

509 
	}
}

516 
	$__bam_bro
(
dbc
, 
rop
, 
l
, 

, 

)

517 
DBC
 *
dbc
;

518 
u_t32_t
 
l
;

519 
PAGE
 *
rop
, *

, *

;

521 
BINTERNAL
 
bi
, 
bi0
, *
chd_bi
;

522 
BKEYDATA
 *
chd_bk
;

523 
BOVERFLOW
 
bo
, *
chd_bo
;

524 
BTREE_CURSOR
 *

;

525 
DB
 *
dbp
;

526 
DBT
 
hdr
, 
hdr0
, 
da
;

527 
db_pgno_t
 
ro_pgno
;

528 
t
;

530 
dbp
 = 
dbc
->dbp;

531 

 = (
BTREE_CURSOR
 *)
dbc
->

;

532 
chd_bo
 = 
NULL
;

533 
da
.d
NULL
;

534 
	`memt
(&
bi
, 0, (bi));

536 
	`TYPE
(
rop
)) {

537 
P_IBTREE
:

539 
chd_bi
 = 
	`GET_BINTERNAL
(
dbp
, 
rop
, 
l
);

540 
	`B_TYPE
(
chd_bi
->
ty
)) {

541 
B_KEYDATA
:

542 
bi
.
n
 = 
chd_bi
->len;

543 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

544 
bi
.
pgno
 = 

->pgno;

545 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

546 i((
t
 = 
	`__os_mloc
(
dbp
->
v
,

547 
chd_bi
->
n
, &
da
.data)) != 0)

548  (
t
);

549 
	`memy
(
da
.da, 
chd_bi
->da, chd_bi->
n
);

550 
da
.
size
 = 
chd_bi
->
n
;

552 
B_OVERFLOW
:

554 
chd_bo
 = (
BOVERFLOW
 *)
chd_bi
->
da
;

555 
	`memt
(&
bo
, 0, (bo));

556 
bo
.
ty
 = 
B_OVERFLOW
;

557 
bo
.

 = 
chd_bo
->tlen;

558 
bo
.
pgno
 = 
chd_bo
->pgno;

559 
bi
.
n
 = 
BOVERFLOW_SIZE
;

560 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

561 
bi
.
pgno
 = 

->pgno;

562 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

563 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

565 
B_DUPLICATE
:

567 
pgfmt
;

570 
P_LDUP
:

571 
P_LBTREE
:

573 
chd_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
rop
, 
l
);

574 
	`B_TYPE
(
chd_bk
->
ty
)) {

575 
B_KEYDATA
:

576 
bi
.
n
 = 
chd_bk
->len;

577 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

578 
bi
.
pgno
 = 

->pgno;

579 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

580 i((
t
 = 
	`__os_mloc
(
dbp
->
v
,

581 
chd_bk
->
n
, &
da
.data)) != 0)

582  (
t
);

583 
	`memy
(
da
.da, 
chd_bk
->da, chd_bk->
n
);

584 
da
.
size
 = 
chd_bk
->
n
;

586 
B_OVERFLOW
:

588 
chd_bo
 = (
BOVERFLOW
 *)
chd_bk
;

589 
	`memt
(&
bo
, 0, (bo));

590 
bo
.
ty
 = 
B_OVERFLOW
;

591 
bo
.

 = 
chd_bo
->tlen;

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

593 i((
t
 = 
	`__db_goff
(
dbp
, 
dbc
->
thad_fo
,

594 
dbc
->
txn
, &
hdr
, 
chd_bo
->

,

595 
chd_bo
->
pgno
, &
hdr
.
da
, &hdr.
size
)) == 0)

596 
t
 = 
	`__db_poff
(
dbc
, &
hdr
, &
bo
.
pgno
);

598 i(
hdr
.
da
 !
NULL
)

599 
	`__os_
(
dbp
->
v
, 
hdr
.
da
);

600 i(
t
 != 0)

601  (
t
);

603 
bi
.
n
 = 
BOVERFLOW_SIZE
;

604 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

605 
bi
.
pgno
 = 

->pgno;

606 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

607 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

609 
B_DUPLICATE
:

611 
pgfmt
;

615 
pgfmt
:  (
	`__db_pgfmt
(
dbp
->
v
, 

->
pgno
));

622 
ro_pgno
 = 

->
ro
;

623 
	`P_INIT
(
rop
, 
dbp
->
pgsize
,

624 
ro_pgno
, 
PGNO_INVALID
, PGNO_INVALID, 

->
v
 + 1, 
P_IBTREE
);

631 
	`memt
(&
bi0
, 0, (bi0));

632 
	`B_TSET
(
bi0
.
ty
, 
B_KEYDATA
);

633 
bi0
.
pgno
 = 

->pgno;

634 i(
	`F_ISSET
(

, 
C_RECNUM
)) {

635 
bi0
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

636 
	`RE_NREC_SET
(
rop
, 
bi0
.
ecs
);

637 
bi
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

638 
	`RE_NREC_ADJ
(
rop
, 
bi
.
ecs
);

640 
	`DB_SET_DBT
(
hdr0
, &
bi0
, 
	`SSZA
(
BINTERNAL
, 
da
));

641 i((
t
 = 
	`__db_pem
(
dbc
,

642 
rop
, 0, 
	`BINTERNAL_SIZE
(0), &
hdr0
, 
NULL
)) != 0)

643 
r
;

644 
t
 = 
	`__db_pem
(
dbc
, 
rop
, 1, 
	`BINTERNAL_SIZE
(
da
.
size
), &
hdr
, &data);

646 
r
: i(
da
.d!
NULL
 && 
chd_bo
 == NULL)

647 
	`__os_
(
dbp
->
v
, 
da
.data);

648  (
t
);

649 
	}
}

656 
	$__m_ro
(
dbc
, 
rop
, 

, 

)

657 
DBC
 *
dbc
;

658 
PAGE
 *
rop
, *

, *

;

660 
DB
 *
dbp
;

661 
DBT
 
hdr
;

662 
RINTERNAL
 
ri
;

663 
db_pgno_t
 
ro_pgno
;

664 
t
;

666 
dbp
 = 
dbc
->dbp;

667 
ro_pgno
 = 
dbc
->

->
ro
;

670 
	`P_INIT
(
rop
, 
dbp
->
pgsize
,

671 
ro_pgno
, 
PGNO_INVALID
, PGNO_INVALID, 

->
v
 + 1, 
P_IRECNO
);

674 
	`DB_SET_DBT
(
hdr
, &
ri
, 
RINTERNAL_SIZE
);

677 
ri
.
pgno
 = 

->pgno;

678 
ri
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

679 i((
t
 = 
	`__db_pem
(
dbc
, 
rop
, 0, 
RINTERNAL_SIZE
, &
hdr
, 
NULL
)) != 0)

680  (
t
);

681 
	`RE_NREC_SET
(
rop
, 
ri
.
ecs
);

682 
ri
.
pgno
 = 

->pgno;

683 
ri
.
ecs
 = 
	`__bam_tٮ
(
dbp
, 

);

684 i((
t
 = 
	`__db_pem
(
dbc
, 
rop
, 1, 
RINTERNAL_SIZE
, &
hdr
, 
NULL
)) != 0)

685  (
t
);

686 
	`RE_NREC_ADJ
(
rop
, 
ri
.
ecs
);

688 
	}
}

698 
	$__bam_p
(
dbc
, 

, 
l
, 
lchd
, 
rchd
, 
ags
)

699 
DBC
 *
dbc
;

700 
EPG
 *

;

701 
u_t32_t
 
l
;

702 
PAGE
 *
lchd
, *
rchd
;

703 
ags
;

705 
BINTERNAL
 
bi
, *
chd_bi
;

706 
BKEYDATA
 *
chd_bk
, *
tmp_bk
;

707 
BOVERFLOW
 
bo
, *
chd_bo
;

708 
BTREE
 *
t
;

709 
BTREE_CURSOR
 *

;

710 
DB
 *
dbp
;

711 
DBT
 
a
, 
b
, 
hdr
, 
da
;

712 
EPG
 *
chd
;

713 
PAGE
 *
age
;

714 
RINTERNAL
 
ri
;

715 
db_dx_t
 
off
;

716 
db_o_t
 
ecs
;

717 
	`size_t
 (*
func

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

718 
u_t32_t
 
n
, 
nbys
, 
nksize
;

719 
t
;

721 
dbp
 = 
dbc
->dbp;

722 

 = (
BTREE_CURSOR
 *)
dbc
->

;

723 
t
 = 
dbp
->
bt_
;

724 
age
 = 

->
ge
;

725 
chd
 = 

 + 1;

728 
ecs
 = 
	`F_ISSET
(

, 
C_RECNUM
) &&

729 !
	`LF_ISSET
(
BPI_SPACEONLY
? 
	`__bam_tٮ
(
dbp
, 
rchd
) : 0;

744 
off
 = 

->
dx
 + 
O_INDX
;

758 
	`TYPE
(
chd
->
ge
)) {

759 
P_IBTREE
:

760 
chd_bi
 = 
	`GET_BINTERNAL
(
dbp
, 
chd
->
ge
, 
l
);

761 
nbys
 = 
	`BINTERNAL_PSIZE
(
chd_bi
->
n
);

763 i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

764  (
DB_NEEDSPLIT
);

765 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

768 
	`B_TYPE
(
chd_bi
->
ty
)) {

769 
B_KEYDATA
:

771 
	`memt
(&
bi
, 0, (bi));

772 
bi
.
n
 = 
chd_bi
->len;

773 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

774 
bi
.
pgno
 = 
rchd
->pgno;

775 
bi
.
ecs
 =recs;

776 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

777 
	`DB_SET_DBT
(
da
, 
chd_bi
->da, chd_bi->
n
);

778 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

779 
	`BINTERNAL_SIZE
(
chd_bi
->
n
), &
hdr
, &
da
)) != 0)

780  (
t
);

782 
B_OVERFLOW
:

784 
chd_bo
 = (
BOVERFLOW
 *)
chd_bi
->
da
;

785 
	`memt
(&
bo
, 0, (bo));

786 
bo
.
ty
 = 
B_OVERFLOW
;

787 
bo
.

 = 
chd_bo
->tlen;

788 
bo
.
pgno
 = 
chd_bo
->pgno;

789 
bi
.
n
 = 
BOVERFLOW_SIZE
;

790 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

791 
bi
.
pgno
 = 
rchd
->pgno;

792 
bi
.
ecs
 =recs;

793 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

794 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

795 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

796 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
), &
hdr
, &
da
)) != 0)

797  (
t
);

799 
B_DUPLICATE
:

801 
pgfmt
;

804 
P_LDUP
:

805 
P_LBTREE
:

806 
chd_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
chd
->
ge
, 
l
);

807 
	`B_TYPE
(
chd_bk
->
ty
)) {

808 
B_KEYDATA
:

809 
nbys
 = 
	`BINTERNAL_PSIZE
(
chd_bk
->
n
);

810 
nksize
 = 
chd_bk
->
n
;

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

835 i(
dbp
->
dup_com
 =
__bam_defcmp
)

836 
func
 = 
__bam_defx
;

838 
func
 = 
NULL
;

840 
func
 = 
t
->
bt_efix
;

841 i(
func
 =
NULL
)

842 
nݻfix
;

843 
tmp_bk
 = 
	`GET_BKEYDATA
(
dbp
, 
lchd
, 
	`NUM_ENT
(lchild) -

844 (
	`TYPE
(
lchd
=
P_LDUP
 ? 
O_INDX
 : 
P_INDX
));

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

846 
nݻfix
;

847 
	`DB_SET_DBT
(
a
, 
tmp_bk
->
da
,mp_bk->
n
);

848 
	`DB_SET_DBT
(
b
, 
chd_bk
->
da
, chd_bk->
n
);

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

850 i((
n
 = 
	`BINTERNAL_PSIZE
(
nksize
)< 
nbys
)

851 
nbys
 = 
n
;

853 
nksize
 = 
chd_bk
->
n
;

855 
nݻfix
: i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

856  (
DB_NEEDSPLIT
);

857 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

860 
	`memt
(&
bi
, 0, (bi));

861 
bi
.
n
 = 
nksize
;

862 
	`B_TSET
(
bi
.
ty
, 
B_KEYDATA
);

863 
bi
.
pgno
 = 
rchd
->pgno;

864 
bi
.
ecs
 =recs;

865 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

866 
	`DB_SET_DBT
(
da
, 
chd_bk
->da, 
nksize
);

867 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

868 
	`BINTERNAL_SIZE
(
nksize
), &
hdr
, &
da
)) != 0)

869  (
t
);

871 
B_OVERFLOW
:

872 
nbys
 = 
	`BINTERNAL_PSIZE
(
BOVERFLOW_SIZE
);

874 i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

875  (
DB_NEEDSPLIT
);

876 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

880 
chd_bo
 = (
BOVERFLOW
 *)
chd_bk
;

881 
	`memt
(&
bo
, 0, (bo));

882 
bo
.
ty
 = 
B_OVERFLOW
;

883 
bo
.

 = 
chd_bo
->tlen;

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

885 i((
t
 = 
	`__db_goff
(
dbp
, 
dbc
->
thad_fo
,

886 
dbc
->
txn
, &
hdr
, 
chd_bo
->

,

887 
chd_bo
->
pgno
, &
hdr
.
da
, &hdr.
size
)) == 0)

888 
t
 = 
	`__db_poff
(
dbc
, &
hdr
, &
bo
.
pgno
);

890 i(
hdr
.
da
 !
NULL
)

891 
	`__os_
(
dbp
->
v
, 
hdr
.
da
);

892 i(
t
 != 0)

893  (
t
);

895 
	`memt
(&
bi
, 0, (bi));

896 
bi
.
n
 = 
BOVERFLOW_SIZE
;

897 
	`B_TSET
(
bi
.
ty
, 
B_OVERFLOW
);

898 
bi
.
pgno
 = 
rchd
->pgno;

899 
bi
.
ecs
 =recs;

900 
	`DB_SET_DBT
(
hdr
, &
bi
, 
	`SSZA
(
BINTERNAL
, 
da
));

901 
	`DB_SET_DBT
(
da
, &
bo
, 
BOVERFLOW_SIZE
);

902 i((
t
 = 
	`__db_pem
(
dbc
, 
age
, 
off
,

903 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
), &
hdr
, &
da
)) != 0)

904  (
t
);

907 
B_DUPLICATE
:

909 
pgfmt
;

912 
P_IRECNO
:

913 
P_LRECNO
:

914 
nbys
 = 
RINTERNAL_PSIZE
;

916 i(
	`P_FREESPACE
(
dbp
, 
age
< 
nbys
)

917  (
DB_NEEDSPLIT
);

918 i(
	`LF_ISSET
(
BPI_SPACEONLY
))

922 
	`DB_SET_DBT
(
hdr
, &
ri
, 
RINTERNAL_SIZE
);

923 
ri
.
pgno
 = 
rchd
->pgno;

924 
ri
.
ecs
 =recs;

925 i((
t
 = 
	`__db_pem
(
dbc
,

926 
age
, 
off
, 
RINTERNAL_SIZE
, &
hdr
, 
NULL
)) != 0)

927  (
t
);

930 
pgfmt
:  (
	`__db_pgfmt
(
dbp
->
v
, 
	`PGNO
(
chd
->
ge
)));

937 i(
	`F_ISSET
(

, 
C_RECNUM
&& !
	`LF_ISSET
(
BPI_NORECNUM
)) {

939 i(
	`DBC_LOGGING
(
dbc
)) {

940 i((
t
 = 
	`__bam_dju_log
(
dbp
, 
dbc
->
txn
,

941 &
	`LSN
(
age
), 0, 
	`PGNO
(ppage), &LSN(ppage),

942 

->
dx
, -(
t32_t
)
ecs
, 0)) != 0)

943  (
t
);

945 
	`LSN_NOT_LOGGED
(
	`LSN
(
age
));

948 i(
dbc
->
dbty
 =
DB_RECNO
)

949 
	`GET_RINTERNAL
(
dbp
, 
age
, 

->
dx
)->
ecs
 -=recs;

951 
	`GET_BINTERNAL
(
dbp
, 
age
, 

->
dx
)->
ecs
 -=recs;

955 
	}
}

962 
	$__bam_pl
(
dbc
, 

, 

, 

, 
lt
)

963 
DBC
 *
dbc
;

964 
EPG
 *

;

965 
PAGE
 *

, *

;

966 
db_dx_t
 *
lt
;

968 
DB
 *
dbp
;

969 
PAGE
 *

;

970 
db_dx_t
 
hf
, *
p
, 
nbys
, 
off
, 
lp
, 
t
;

971 
adju
, 
t
, 
iag
, 
isbigkey
, 
t
;

973 
dbp
 = 
dbc
->dbp;

974 

 = 

->
ge
;

975 
p
 = 
	`P_INP
(
dbp
, 

);

976 
adju
 = 
	`TYPE
(

=
P_LBTREE
 ? 
P_INDX
 : 
O_INDX
;

1011 
off
 = 0;

1012 i(
	`NEXT_PGNO
(

=
PGNO_INVALID
 && 

->
dx
 >
	`NUM_ENT
p- 
adju
)

1013 
off
 = 
	`NUM_ENT
(

- 
adju
;

1014 i(
	`PREV_PGNO
(

=
PGNO_INVALID
 && 

->
dx
 == 0)

1015 
off
 = 
adju
;

1016 i(
off
 != 0)

1017 
st
;

1040 
t
 = 
	`NUM_ENT
(

- 
adju
;

1041 
hf
 = (
dbp
->
pgsize
 - 
	`HOFFSET
(

)) / 2;

1042 
nbys
 = 0, 
off
 = 0; of< 
t
 &&by< 
hf
; ++off)

1043 
	`TYPE
(

)) {

1044 
P_IBTREE
:

1045 i(
	`B_TYPE
(

1046 
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
ty
=
B_KEYDATA
)

1047 
nbys
 +
	`BINTERNAL_SIZE
(

1048 
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
n
);

1050 
nbys
 +
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
);

1052 
P_LBTREE
:

1053 i(
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1054 
B_KEYDATA
)

1055 
nbys
 +
	`BKEYDATA_SIZE
(
	`GET_BKEYDATA
(
dbp
,

1056 

, 
off
)->
n
);

1058 
nbys
 +
BOVERFLOW_SIZE
;

1060 ++
off
;

1062 
P_LDUP
:

1063 
P_LRECNO
:

1064 i(
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1065 
B_KEYDATA
)

1066 
nbys
 +
	`BKEYDATA_SIZE
(
	`GET_BKEYDATA
(
dbp
,

1067 

, 
off
)->
n
);

1069 
nbys
 +
BOVERFLOW_SIZE
;

1071 
P_IRECNO
:

1072 
nbys
 +
RINTERNAL_SIZE
;

1075  (
	`__db_pgfmt
(
dbp
->
v
, 

->
pgno
));

1077 
st
: 
lp
 = 
off
;

1085 
	`TYPE
(

)) {

1086 
P_IBTREE
:

1087 
iag
 = 1;

1088 
isbigkey
 =

1089 
	`B_TYPE
(
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
ty
!
B_KEYDATA
;

1091 
P_LBTREE
:

1092 
P_LDUP
:

1093 
iag
 = 0;

1094 
isbigkey
 = 
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) !=

1095 
B_KEYDATA
;

1098 
iag
 = 
isbigkey
 = 0;

1100 i(
isbigkey
)

1101 
t
 = 1; cnt <= 3; ++cnt) {

1102 
off
 = 
lp
 + 
t
 * 
adju
;

1103 i(
off
 < (
db_dx_t
)
	`NUM_ENT
(

) &&

1104 ((
iag
 && 
	`B_TYPE
(

1105 
	`GET_BINTERNAL
(
dbp
, 

,
off
)->
ty
=
B_KEYDATA
) ||

1106 
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1107 
B_KEYDATA
)) {

1108 
lp
 = 
off
;

1111 i(
lp
 <(
db_dx_t
)(
t
 * 
adju
))

1113 
off
 = 
lp
 - 
t
 * 
adju
;

1114 i(
iag
 ? 
	`B_TYPE
(

1115 
	`GET_BINTERNAL
(
dbp
, 

, 
off
)->
ty
=
B_KEYDATA
 :

1116 
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
off
)->
ty
) ==

1117 
B_KEYDATA
) {

1118 
lp
 = 
off
;

1129 i(
	`TYPE
(

=
P_LBTREE
 &&

1130 
p
[
lp
] =p[l- 
adju
])

1131 
t
 = 1;; ++cnt) {

1132 
off
 = 
lp
 + 
t
 * 
adju
;

1133 i(
off
 < 
	`NUM_ENT
(

) &&

1134 
p
[
lp
] !p[
off
]) {

1135 
lp
 = 
off
;

1138 i(
lp
 <(
db_dx_t
)(
t
 * 
adju
))

1140 
off
 = 
lp
 - 
t
 * 
adju
;

1141 i(
p
[
lp
] !p[
off
]) {

1142 
lp
 = 
off
 + 
adju
;

1148 i((
t
 = 
	`__bam_cy
(
dbp
, 

, 

, 0, 
lp
)) != 0)

1149  (
t
);

1150 i((
t
 = 
	`__bam_cy
(
dbp
, 

, 

, 
lp
, 
	`NUM_ENT
(pp))) != 0)

1151  (
t
);

1153 *
lt
 = 
lp
;

1155 
	}
}

1164 
	$__bam_cy
(
dbp
, 

, 

, 
nxt
, 

)

1165 
DB
 *
dbp
;

1166 
PAGE
 *

, *

;

1167 
u_t32_t
 
nxt
, 

;

1169 
BINTERNAL
 

;

1170 
db_dx_t
 *
cp
, 
nbys
, 
off
, *
pp
;

1172 
cp
 = 
	`P_INP
(
dbp
, 

);

1173 
pp
 = 
	`P_INP
(
dbp
, 

);

1177 
off
 = 0; 
nxt
 < 

; ++nxt, ++
	`NUM_ENT
(

), ++off) {

1178 
	`TYPE
(

)) {

1179 
P_IBTREE
:

1180 i(
off
 =0 && 
nxt
 != 0)

1181 
nbys
 = 
	`BINTERNAL_SIZE
(0);

1182 i(
	`B_TYPE
(

1183 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->
ty
=
B_KEYDATA
)

1184 
nbys
 = 
	`BINTERNAL_SIZE
(

1185 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->
n
);

1187 
nbys
 = 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
);

1189 
P_LBTREE
:

1194 i(
off
 !0 && (
nxt
 % 
P_INDX
) == 0 &&

1195 
pp
[
nxt
] =pp[nx- 
P_INDX
]) {

1196 
cp
[
off
] = cp[of- 
P_INDX
];

1200 
P_LDUP
:

1201 
P_LRECNO
:

1202 i(
	`B_TYPE
(
	`GET_BKEYDATA
(
dbp
, 

, 
nxt
)->
ty
) ==

1203 
B_KEYDATA
)

1204 
nbys
 = 
	`BKEYDATA_SIZE
(
	`GET_BKEYDATA
(
dbp
,

1205 

, 
nxt
)->
n
);

1207 
nbys
 = 
BOVERFLOW_SIZE
;

1209 
P_IRECNO
:

1210 
nbys
 = 
RINTERNAL_SIZE
;

1213  (
	`__db_pgfmt
(
dbp
->
v
, 

->
pgno
));

1215 
cp
[
off
] = 
	`HOFFSET
(

-
nbys
;

1216 i(
off
 =0 && 
nxt
 !0 && 
	`TYPE
(

=
P_IBTREE
) {

1217 

.
n
 = 0;

1218 

.
ty
 = 
B_KEYDATA
;

1219 

.
pgno
 = 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->pgno;

1220 

.
ecs
 = 
	`GET_BINTERNAL
(
dbp
, 

, 
nxt
)->nrecs;

1221 
	`memy
(
	`P_ENTRY
(
dbp
, 

, 
off
), &

, 
nbys
);

1224 
	`memy
(
	`P_ENTRY
(
dbp
, 

, 
off
),

1225 
	`P_ENTRY
(
dbp
, 

, 
nxt
), 
nbys
);

1228 
	}
}

	@../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_LOCK
 
lock
, 
mock
;

36 
DB_MPOOLFILE
 *
mpf
;

37 
ENV
 *
v
;

38 
PAGE
 *
h
;

39 
db_pgno_t
 
pgno
;

40 
t
, 
t_t
, 
wre_ma
;

42 
dbp
 = 
dbc
->dbp;

43 
v
 = 
dbp
->env;

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
(
v
, (*

), &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
,

66 
dbc
->
thad_fo
, dbc->
txn
, 0, &
ma
)) != 0)

67 
r
;

69 i(
ags
 =
DB_FAST_STAT
)

70 
ma_ly
;

73 

->
bt_
 = 0, 
pgno
 = 
ma
->
dbma
.

;gn!
PGNO_INVALID
;) {

74 ++

->
bt_
;

76 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

77 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

78 
r
;

80 
pgno
 = 
h
->
xt_pgno
;

81 i((
t
 = 
	`__memp_ut
(
mpf
,

82 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)) != 0)

83 
r
;

84 
h
 = 
NULL
;

88 
pgno
 = 

->
ro
;

89 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
pgno
, 
DB_LOCK_READ
, 0, &
lock
)) != 0)

90 
r
;

91 i((
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

92 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

93 
r
;

96 

->
bt_vs
 = 
h
->
v
;

99 
t
 = 
	`__memp_ut
(
mpf
, 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
);

100 
h
 = 
NULL
;

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

102 
t
 = 
t_t
;

103 i(
t
 != 0)

104 
r
;

107 i((
t
 = 
	`__bam_av
(
dbc
,

108 
DB_LOCK_READ
, 

->
ro
, 
__bam__back
, 

)) != 0)

109 
r
;

115 
wre_ma
 = !
	`F_ISSET
(
dbp
, 
DB_AM_RDONLY
) &&

116 (!
	`MULTIVERSION
(
dbp
|| 
dbc
->
txn
 !
NULL
);

117 
ma_ly
:

118 i(
t
->
bt_ma
 !
PGNO_BASE_MD
 || 
wre_ma
) {

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

120 
ma
 = 
NULL
;

121 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

122 
t
 = 
t_t
;

123 i(
t
 != 0)

124 
r
;

126 i((
t
 = 
	`__db_lg
(
dbc
,

127 0, 
t
->
bt_ma
, 
wre_ma
 ? 
DB_LOCK_WRITE
 : 
DB_LOCK_READ
,

128 0, &
mock
)) != 0)

129 
r
;

130 i((
t
 = 
	`__memp_fg
(
mpf
, &
t
->
bt_ma
,

131 
dbc
->
thad_fo
, dbc->
txn
,

132 
wre_ma
 ? 
DB_MPOOL_DIRTY
 : 0, &
ma
)) != 0)

133 
r
;

135 i(
ags
 =
DB_FAST_STAT
) {

136 i(
dbp
->
ty
 =
DB_RECNO
 ||

137 (
dbp
->
ty
 =
DB_BTREE
 && 
	`F_ISSET
(dbp, 
DB_AM_RECNUM
))) {

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

139 

->
ro
, 
DB_LOCK_READ
, 0, &
lock
)) != 0)

140 
r
;

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

->
ro
,

142 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0)

143 
r
;

145 

->
bt_nkeys
 = 
	`RE_NREC
(
h
);

147 

->
bt_nkeys
 = 
ma
->
dbma
.
key_cou
;

149 

->
bt_nda
 = 
dbp
->
ty
 =
DB_RECNO
 ?

150 

->
bt_nkeys
 : 
ma
->
dbma
.
cd_cou
;

154 

->
bt_maags
 = 
ma
->
dbma
.
ags
;

155 

->
bt_mkey
 = 
ma
->
mkey
;

156 

->
bt__n
 = 
ma
->
_n
;

157 

->
bt__d
 = 
ma
->
_d
;

165 i((
t
 = 
	`__memp_g_ϡ_pgno
(
dbp
->
mpf
, &
pgno
)) != 0)

166 
r
;

167 

->
bt_get
 = 
pgno
 + 1;

168 

->
bt_gesize
 = 
ma
->
dbma
.
gesize
;

169 

->
bt_magic
 = 
ma
->
dbma
.
magic
;

170 

->
bt_vsi
 = 
ma
->
dbma
.
vsi
;

172 i(
wre_ma
 != 0) {

173 
ma
->
dbma
.
key_cou
 = 

->
bt_nkeys
;

174 
ma
->
dbma
.
cd_cou
 = 

->
bt_nda
;

177 *(
DB_BTREE_STAT
 **)
p
 = 

;

179 
r
:

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

181 
t
 = 
t_t
;

182 i(
h
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

183 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)!0 && 
t
 == 0)

184 
t
 = 
t_t
;

187 i((
t_t
 = 
	`__LPUT
(
dbc
, 
mock
)!0 && 
t
 == 0)

188 
t
 = 
t_t
;

189 i(
ma
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

190 
dbc
->
thad_fo
, 
ma
, dbc->
iܙy
)!0 && 
t
 == 0)

191 
t
 = 
t_t
;

193 i(
t
 !0 && 

 !
NULL
) {

194 
	`__os_u
(
v
, 

);

195 *(
DB_BTREE_STAT
 **)
p
 = 
NULL
;

198  (
t
);

199 
	}
}

208 
	$__bam__t
(
dbc
, 
ags
)

209 
DBC
 *
dbc
;

210 
u_t32_t
 
ags
;

212 cڡ 
FN
 

[] = {

213 { 
BTM_DUP
, "duplicates" },

214 { 
BTM_RECNO
, "recno" },

215 { 
BTM_RECNUM
, "record-numbers" },

216 { 
BTM_FIXEDLEN
, "fixed-length" },

217 { 
BTM_RENUMBER
, "renumber" },

218 { 
BTM_SUBDB
, "multiple-databases" },

219 { 
BTM_DUPSORT
, "sorted duplicates" },

220 { 0, 
NULL
 }

222 
DB
 *
dbp
;

223 
DB_BTREE_STAT
 *

;

224 
ENV
 *
v
;

225 
ld
, 
t
;

226 cڡ *
s
;

228 
dbp
 = 
dbc
->dbp;

229 
v
 = 
dbp
->env;

231 i((
t
 = 
	`__bam_
(
dbc
, &

, 
	`LF_ISSET
(
DB_FAST_STAT
))) != 0)

232  (
t
);

234 i(
	`LF_ISSET
(
DB_STAT_ALL
)) {

235 
	`__db_msg
(
v
, "%s", 
	`DB_GLOBAL
(
db_le
));

236 
	`__db_msg
(
v
, "Default Btree/Recno database information:");

239 
	`__db_msg
(
v
, "%lx\tB maginumb", (
u_lg
)

->
bt_magic
);

240 
	`__db_msg
(
v
, "%lu\tB vsiڂumb", (
u_lg
)

->
bt_vsi
);

242 ()
	`__db_g_ld
(
dbp
, &
ld
);

243 
ld
) {

245 
s
 = "Little-endian";

248 
s
 = "Big-endian";

251 
s
 = "Unrecognized byte order";

254 
	`__db_msg
(
v
, "%s\tBy ord", 
s
);

255 
	`__db_ags
(
v
, 
NULL
, 

->
bt_maags
, 

, NULL, "\tFlags");

256 i(
dbp
->
ty
 =
DB_BTREE
)

257 
	`__db_dl
(
v
, "Mimum keyr-ge", (
u_lg
)

->
bt_mkey
);

258 i(
dbp
->
ty
 =
DB_RECNO
) {

259 
	`__db_dl
(
v
,

260 "Fixed-ngthecd size", (
u_lg
)

->
bt__n
);

261 
	`__db_msg
(
v
,

262 "%#x\tFixed-ngthecdad", (
u_t
)

->
bt__d
);

264 
	`__db_dl
(
v
,

265 "Undlyg dabaagsize", (
u_lg
)

->
bt_gesize
);

266 i(
dbp
->
ty
 =
DB_BTREE
)

267 
	`__db_dl
(
v
, "Overflow key/data size",

268 ((
BTREE_CURSOR
 *)
dbc
->

)->
ovsize
);

269 
	`__db_dl
(
v
, "Numb ovh", (
u_lg
)

->
bt_vs
);

270 
	`__db_dl
(
v
, 
dbp
->
ty
 =
DB_BTREE
 ?

272 "Numb ocdh", (
u_lg
)

->
bt_nkeys
);

273 
	`__db_dl
(
v
,

274 "Numb odemh", (
u_lg
)

->
bt_nda
);

276 
	`__db_dl
(
v
,

277 "Numb o iȷges", (
u_lg
)

->
bt_t_pg
);

278 
	`__db_dl_p
(
v
,

280 (
u_lg
)

->
bt_t_pg
,

281 
	`DB_PCT_PG
(

->
bt_t_pg
, sp->
bt_t_pg
, sp->
bt_gesize
), "ff");

283 
	`__db_dl
(
v
,

284 "Numb oges", (
u_lg
)

->
bt_af_pg
);

285 
	`__db_dl_p
(
v
, "Number of bytes free inreeeafages",

286 (
u_lg
)

->
bt_af_pg
, 
	`DB_PCT_PG
(

287 

->
bt_af_pg
, sp->
bt_af_pg
, sp->
bt_gesize
), "ff");

289 
	`__db_dl
(
v
,

290 "Numb o duiages", (
u_lg
)

->
bt_dup_pg
);

291 
	`__db_dl_p
(
v
,

293 (
u_lg
)

->
bt_dup_pg
,

294 
	`DB_PCT_PG
(

->
bt_dup_pg
, sp->
bt_dup_pg
, sp->
bt_gesize
), "ff");

296 
	`__db_dl
(
v
,

297 "Numb o ovowages", (
u_lg
)

->
bt_ov_pg
);

298 
	`__db_dl_p
(
v
, "Number of bytes free inree overflowages",

299 (
u_lg
)

->
bt_ov_pg
, 
	`DB_PCT_PG
(

300 

->
bt_ov_pg
, sp->
bt_ov_pg
, sp->
bt_gesize
), "ff");

301 
	`__db_dl
(
v
, "Numb oemyages", (
u_lg
)

->
bt_emy_pg
);

303 
	`__db_dl
(
v
, "Numb ogeځh䓆i", (
u_lg
)

->
bt_
);

305 
	`__os_u
(
v
, 

);

308 
	}
}

317 
	$__bam__back
(
dbc
, 
h
, 
cook
, 
pu
)

318 
DBC
 *
dbc
;

319 
PAGE
 *
h
;

320 *
cook
;

321 *
pu
;

323 
DB
 *
dbp
;

324 
DB_BTREE_STAT
 *

;

325 
db_dx_t
 
dx
, *
p
, 
t
;

326 
u_t8_t
 
ty
;

328 
dbp
 = 
dbc
->dbp;

329 

 = 
cook
;

330 *
pu
 = 0;

331 
t
 = 
	`NUM_ENT
(
h
);

332 
p
 = 
	`P_INP
(
dbp
, 
h
);

334 
	`TYPE
(
h
)) {

335 
P_IBTREE
:

336 
P_IRECNO
:

337 ++

->
bt_t_pg
;

338 

->
bt_t_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

340 
P_LBTREE
:

341 i(
t
 == 0)

342 ++

->
bt_emy_pg
;

345 
dx
 = 0; indx < 
t
; indx +
P_INDX
) {

346 
ty
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->type;

348 i(
	`B_DISSET
(
ty
))

352 i(
dx
 + 
P_INDX
 >
t
 ||

353 
p
[
dx
] !p[dx + 
P_INDX
])

354 ++

->
bt_nkeys
;

357 i(
	`B_TYPE
(
ty
!
B_DUPLICATE
)

358 ++

->
bt_nda
;

361 ++

->
bt_af_pg
;

362 

->
bt_af_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

364 
P_LRECNO
:

365 i(
t
 == 0)

366 ++

->
bt_emy_pg
;

372 i(
dbp
->
ty
 =
DB_RECNO
) {

377 i(
	`F_ISSET
(
dbp
, 
DB_AM_RENUMBER
)) {

378 

->
bt_nkeys
 +
t
;

379 

->
bt_nda
 +
t
;

381 
dx
 = 0; indx < 
t
; indx +
O_INDX
) {

382 
ty
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
)->type;

383 i(!
	`B_DISSET
(
ty
)) {

384 ++

->
bt_nda
;

385 ++

->
bt_nkeys
;

389 ++

->
bt_af_pg
;

390 

->
bt_af_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

392 

->
bt_nda
 +
t
;

394 ++

->
bt_dup_pg
;

395 

->
bt_dup_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

398 
P_LDUP
:

399 i(
t
 == 0)

400 ++

->
bt_emy_pg
;

403 
dx
 = 0; indx < 
t
; indx +
O_INDX
)

404 i(!
	`B_DISSET
(
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
)->
ty
))

405 ++

->
bt_nda
;

407 ++

->
bt_dup_pg
;

408 

->
bt_dup_pg
 +
	`P_FREESPACE
(
dbp
, 
h
);

410 
P_OVERFLOW
:

411 ++

->
bt_ov_pg
;

412 

->
bt_ov_pg
 +
	`P_OVFLSPACE
(
dbp
, dbp->
pgsize
, 
h
);

415  (
	`__db_pgfmt
(
dbp
->
v
, 
h
->
pgno
));

418 
	}
}

427 
	$__bam_t_curs
(
dbc
)

428 
DBC
 *
dbc
;

430 cڡ 
FN
 

[] = {

431 { 
C_DELETED
, "C_DELETED" },

432 { 
C_RECNUM
, "C_RECNUM" },

433 { 
C_RENUMBER
, "C_RENUMBER" },

434 { 0, 
NULL
 }

436 
ENV
 *
v
;

437 
BTREE_CURSOR
 *

;

439 
v
 = 
dbc
->env;

440 

 = (
BTREE_CURSOR
 *)
dbc
->

;

442 
	`STAT_ULONG
("Ovow size", 

->
ovsize
);

443 i(
dbc
->
dbty
 =
DB_RECNO
)

444 
	`STAT_ULONG
("Reo", 

->
o
);

445 
	`STAT_ULONG
("Ord", 

->
d
);

446 
	`__db_ags
(
v
, 
NULL
, 

->
ags
, 

, NULL, "\tInternal Flags");

447 
	}
}

452 
	$__bam_
(
dbc
, 
p
, 
ags
)

453 
DBC
 *
dbc
;

454 *
p
;

455 
u_t32_t
 
ags
;

457 
	`COMPQUIET
(
p
, 
NULL
);

458 
	`COMPQUIET
(
ags
, 0);

460  (
	`__db__n_but
(
dbc
->
v
));

461 
	}
}

464 
	$__bam__t
(
dbc
, 
ags
)

465 
DBC
 *
dbc
;

466 
u_t32_t
 
ags
;

468 
	`COMPQUIET
(
ags
, 0);

470  (
	`__db__n_but
(
dbc
->
v
));

471 
	}
}

474 #ide
HAVE_BREW


483 
	$__bam_key_nge
(
dbc
, 
dbt
, 
kp
, 
ags
)

484 
DBC
 *
dbc
;

485 
DBT
 *
dbt
;

486 
DB_KEY_RANGE
 *
kp
;

487 
u_t32_t
 
ags
;

489 
BTREE_CURSOR
 *

;

490 
EPG
 *

;

491 

;

492 
exa
, 
t
;

494 
	`COMPQUIET
(
ags
, 0);

496 i((
t
 = 
	`__bam_ch
(
dbc
, 
PGNO_INVALID
,

497 
dbt
, 
SR_STK_ONLY
, 1, 
NULL
, &
exa
)) != 0)

498  (
t
);

500 

 = (
BTREE_CURSOR
 *)
dbc
->

;

501 
kp
->
ss
 = kp->
g
 = 0.0;

503 

 = 1.0;

506 

->
c
->
s
 /= 2;

507 

->
c
->
dx
 /= 2;

508 

 = 

->; s<->
c
; ++sp) {

517 i(

->
dx
 == 0)

518 
kp
->
g
 +

 * (

->
s
 - 1)/sp->entries;

519 i(

->
dx
 =->
s
)

520 
kp
->
ss
 +

;

522 
kp
->
ss
 +

 * 

->
dx
 / sp->
s
;

523 
kp
->
g
 +

 *

524 ((

->
s
 - sp->
dx
) - 1) / sp->entries;

526 

 *1.0/

->
s
;

534 i(
exa
)

535 
kp
->
equ
 = 

;

537 i(
kp
->
ss
 != 1)

538 
kp
->
g
 +

;

539 
kp
->
equ
 = 0;

542 
	`BT_STK_CLR
(

);

545 
	}
}

556 
	$__bam_av
(
dbc
, 
mode
, 
ro_pgno
, 
back
, 
cook
)

557 
DBC
 *
dbc
;

558 
db_lockmode_t
 
mode
;

559 
db_pgno_t
 
ro_pgno
;

560 (*
back
)
	`__P
((
DBC
 *, 
PAGE
 *, *, *));

561 *
cook
;

563 
BINTERNAL
 *
bi
;

564 
BKEYDATA
 *
bk
;

565 
DB
 *
dbp
;

566 
DB_LOCK
 
lock
;

567 
DB_MPOOLFILE
 *
mpf
;

568 
PAGE
 *
h
;

569 
RINTERNAL
 *
ri
;

570 
db_dx_t
 
dx
, *
p
;

571 
ady_put
, 
t
, 
t_t
;

573 
dbp
 = 
dbc
->dbp;

574 
mpf
 = 
dbp
->mpf;

575 
ady_put
 = 0;

577 i((
t
 = 
	`__db_lg
(
dbc
, 0, 
ro_pgno
, 
mode
, 0, &
lock
)) != 0)

578  (
t
);

579 i((
t
 = 
	`__memp_fg
(
mpf
, &
ro_pgno
,

580 
dbc
->
thad_fo
, dbc->
txn
, 0, &
h
)) != 0) {

581 ()
	`__TLPUT
(
dbc
, 
lock
);

582  (
t
);

585 
	`TYPE
(
h
)) {

586 
P_IBTREE
:

587 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
O_INDX
) {

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

589 i(
	`B_TYPE
(
bi
->
ty
=
B_OVERFLOW
 &&

590 (
t
 = 
	`__db_av_big
(
dbc
,

591 ((
BOVERFLOW
 *)
bi
->
da
)->
pgno
,

592 
back
, 
cook
)) != 0)

593 
r
;

594 i((
t
 = 
	`__bam_av
(

595 
dbc
, 
mode
, 
bi
->
pgno
, 
back
, 
cook
)) != 0)

596 
r
;

599 
P_IRECNO
:

600 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
O_INDX
) {

601 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
dx
);

602 i((
t
 = 
	`__bam_av
(

603 
dbc
, 
mode
, 
ri
->
pgno
, 
back
, 
cook
)) != 0)

604 
r
;

607 
P_LBTREE
:

608 
p
 = 
	`P_INP
(
dbp
, 
h
);

609 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
P_INDX
) {

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

611 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

612 (
dx
 + 
P_INDX
 >
	`NUM_ENT
(
h
) ||

613 
p
[
dx
] !p[dx + 
P_INDX
])) {

614 i((
t
 = 
	`__db_av_big
(
dbc
,

615 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->
pgno
,

616 
back
, 
cook
)) != 0)

617 
r
;

619 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
dx
 + 
O_INDX
);

620 i(
	`B_TYPE
(
bk
->
ty
=
B_DUPLICATE
 &&

621 (
t
 = 
	`__bam_av
(
dbc
, 
mode
,

622 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->
pgno
,

623 
back
, 
cook
)) != 0)

624 
r
;

625 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

626 (
t
 = 
	`__db_av_big
(
dbc
,

627 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
 + 
O_INDX
)->
pgno
,

628 
back
, 
cook
)) != 0)

629 
r
;

632 
P_LDUP
:

633 
P_LRECNO
:

634 
dx
 = 0; indx < 
	`NUM_ENT
(
h
); indx +
O_INDX
) {

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

636 i(
	`B_TYPE
(
bk
->
ty
=
B_OVERFLOW
 &&

637 (
t
 = 
	`__db_av_big
(
dbc
,

638 
	`GET_BOVERFLOW
(
dbp
, 
h
, 
dx
)->
pgno
,

639 
back
, 
cook
)) != 0)

640 
r
;

644  (
	`__db_pgfmt
(
dbp
->
v
, 
h
->
pgno
));

647 
t
 = 
	`back
(
dbc
, 
h
, 
cook
, &
ady_put
);

649 
r
: i(!
ady_put
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

650 
dbc
->
thad_fo
, 
h
, dbc->
iܙy
)!0 && 
t
 == 0)

651 
t
 = 
t_t
;

652 i((
t_t
 = 
	`__TLPUT
(
dbc
, 
lock
)!0 && 
t
 == 0)

653 
t
 = 
t_t
;

655  (
t
);

656 
	}
}

	@../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 
BTMETA2X
 *
dma
;

29 
BTMETA30
 *
wma
;

30 
ENV
 *
v
;

31 
t
;

33 
v
 = 
dbp
->env;

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
(
v
, 
_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 
BTMETA30
 *
dma
;

79 
BTMETA31
 *
wma
;

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
 *, 
DB_THREAD_INFO
 *,

18 
PAGE
 *, 
u_t32_t
, , 
DBT
 *, *));

19 
__bam_vrfy_p
 
__P
((
DB
 *, 
VRFY_DBINFO
 *, 
PAGE
 *, 
db_pgno_t
,

20 
db_dx_t
 *, 
u_t32_t
));

21 
__bam_vrfy_d
 
__P
((
DB
 *, 
DB_THREAD_INFO
 *, 
PAGE
 *,

22 
BINTERNAL
 *, BINTERNAL *, (*)(
DB
 *, cڡ 
DBT
 *, const DBT *),

23 
u_t32_t
));

24 
__m_vrfy_p
 
	`__P
((
DB
 *, 
VRFY_DBINFO
 *, 
PAGE
 *, 
db_pgno_t
,

25 
db_dx_t
 *, 
u_t32_t
));

35 
	$__bam_vrfy_ma
(
dbp
, 
vdp
, 
ma
, 
pgno
, 
ags
)

36 
DB
 *
dbp
;

37 
VRFY_DBINFO
 *
vdp
;

38 
BTMETA
 *
ma
;

39 
db_pgno_t
 
pgno
;

40 
u_t32_t
 
ags
;

42 
ENV
 *
v
;

43 
VRFY_PAGEINFO
 *
p
;

44 
isbad
, 
t_t
, 
t
;

45 
db_dx_t
 
ovsize
;

47 
v
 = 
dbp
->env;

48 
isbad
 = 0;

50 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

51  (
t
);

62 i(!
	`F_ISSET
(
p
, 
VRFY_INCOMPLETE
) &&

63 (
t
 = 
	`__db_vrfy_ma
(
dbp
, 
vdp
, &
ma
->
dbma
, 
pgno
, 
ags
)) != 0) {

64 i(
t
 =
DB_VERIFY_BAD
)

65 
isbad
 = 1;

67 
r
;

73 
ovsize
 = 
ma
->
mkey
 > 0 ?

74 
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
ma
->
mkey
, dbp->
pgsize
) : 0;

76 i(
ma
->
mkey
 < 2 ||

77 
ovsize
 > 
	`B_MINKEY_TO_OVFLSIZE
(
dbp
, 
DEFMINKEYPAGE
, dbp->
pgsize
)) {

78 
p
->
bt_mkey
 = 0;

79 
isbad
 = 1;

80 
	`EPRINT
((
v
,

82 (
u_lg
)
pgno
, (u_lg)
ma
->
mkey
));

84 
p
->
bt_mkey
 = 
ma
->
mkey
;

87 
p
->
_d
 = 
ma
->re_pad;

88 
p
->
_n
 = 
ma
->re_len;

95 
p
->
ro
 = 0;

96 i(
ma
->
ro
 =
PGNO_INVALID
 ||

97 
ma
->
ro
 =
pgno
 || !
	`IS_VALID_PGNO
(meta->root) ||

98 (
pgno
 =
PGNO_BASE_MD
 && 
ma
->
ro
 != 1)) {

99 
isbad
 = 1;

100 
	`EPRINT
((
v
,

102 (
u_lg
)
pgno
, (u_lg)
ma
->
ro
));

104 
p
->
ro
 = 
ma
->root;

107 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_RENUMBER
))

108 
	`F_SET
(
p
, 
VRFY_IS_RRECNO
);

110 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_SUBDB
)) {

115 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_DUP
&& 
pgno
 =
PGNO_BASE_MD
) {

116 
isbad
 = 1;

117 
	`EPRINT
((
v
,

119 (
u_lg
)
pgno
));

121 
	`F_SET
(
p
, 
VRFY_HAS_SUBDBS
);

124 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_DUP
))

125 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

126 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_DUPSORT
))

127 
	`F_SET
(
p
, 
VRFY_HAS_DUPSORT
);

128 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_RECNUM
))

129 
	`F_SET
(
p
, 
VRFY_HAS_RECNUMS
);

130 i(
	`F_ISSET
(
p
, 
VRFY_HAS_RECNUMS
&& F_ISSET՝, 
VRFY_HAS_DUPS
)) {

131 
	`EPRINT
((
v
,

133 (
u_lg
)
pgno
));

134 
isbad
 = 1;

137 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_RECNO
)) {

138 
	`F_SET
(
p
, 
VRFY_IS_RECNO
);

139 
dbp
->
ty
 = 
DB_RECNO
;

140 } i(
	`F_ISSET
(
p
, 
VRFY_IS_RRECNO
)) {

141 
isbad
 = 1;

142 
	`EPRINT
((
v
,

144 (
u_lg
)
pgno
));

147 i(
	`F_ISSET
(
p
, 
VRFY_IS_RECNO
&& F_ISSET՝, 
VRFY_HAS_DUPS
)) {

148 
	`EPRINT
((
v
,

150 (
u_lg
)
pgno
));

151 
isbad
 = 1;

154 i(
	`F_ISSET
(&
ma
->
dbma
, 
BTM_FIXEDLEN
))

155 
	`F_SET
(
p
, 
VRFY_IS_FIXEDLEN
);

156 i(
p
->
_n
 > 0) {

161 
isbad
 = 1;

162 
	`EPRINT
((
v
,

164 (
u_lg
)
pgno
, (u_lg)
p
->
_n
));

172 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0 && 
t
 == 0)

173 
t
 = 
t_t
;

174 i(
	`LF_ISSET
(
DB_SALVAGE
) &&

175 (
t_t
 = 
	`__db_lvage_mkde
(
vdp
, 
pgno
)!0 && 
t
 == 0)

176 
t
 = 
t_t
;

177  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

178 
	}
}

188 
	$__m_vrfy_af
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)

189 
DB
 *
dbp
;

190 
VRFY_DBINFO
 *
vdp
;

191 
PAGE
 *
h
;

192 
db_pgno_t
 
pgno
;

193 
u_t32_t
 
ags
;

195 
BKEYDATA
 *
bk
;

196 
ENV
 *
v
;

197 
VRFY_PAGEINFO
 *
p
;

198 
db_dx_t
 
i
;

199 
t
, 
t_t
, 
isbad
;

200 
u_t32_t
 
_n_guess
, 
n
;

202 
v
 = 
dbp
->env;

203 
isbad
 = 0;

205 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

206  (
t
);

208 i(
	`TYPE
(
h
!
P_LRECNO
) {

209 
t
 = 
	`__db_unknown_th
(
v
, "__ram_vrfy_leaf");

210 
r
;

217 i((
t
 = 
	`__db_vrfy_dage
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)) != 0) {

218 i(
t
 =
DB_VERIFY_BAD
)

219 
isbad
 = 1;

221 
r
;

228 i((
t
 = 
	`__bam_vrfy_p
(
dbp
,

229 
vdp
, 
h
, 
pgno
, &
p
->
s
, 
ags
)) != 0)

230 
r
;

232 i(
	`F_ISSET
(
p
, 
VRFY_HAS_DUPS
)) {

233 
	`EPRINT
((
v
,

234 "Pag%lu: Redaba hadups", (
u_lg
)
pgno
));

235 
t
 = 
DB_VERIFY_BAD
;

236 
r
;

245 
_n_guess
 = 0;

246 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

247 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

249 i(
	`B_DISSET
(
bk
->
ty
))

251 i(
bk
->
ty
 =
B_OVERFLOW
)

252 
n
 = ((
BOVERFLOW
 *)
bk
)->

;

253 i(
bk
->
ty
 =
B_KEYDATA
)

254 
n
 = 
bk
->len;

256 
isbad
 = 1;

257 
	`EPRINT
((
v
,

259 (
u_lg
)
pgno
, (u_lg)
i
));

262 i(
_n_guess
 == 0)

263 
_n_guess
 = 
n
;

270 i(
_n_guess
 !
n
) {

271 
_n_guess
 = 0;

275 
p
->
_n
 = 
_n_guess
;

278 
p
->
c_t
 = 
	`NUM_ENT
(
h
);

280 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0 && 
t
 == 0)

281 
t
 = 
t_t
;

282  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

283 
	}
}

293 
	$__bam_vrfy
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)

294 
DB
 *
dbp
;

295 
VRFY_DBINFO
 *
vdp
;

296 
PAGE
 *
h
;

297 
db_pgno_t
 
pgno
;

298 
u_t32_t
 
ags
;

300 
ENV
 *
v
;

301 
VRFY_PAGEINFO
 *
p
;

302 
t
, 
t_t
, 
isbad
;

304 
v
 = 
dbp
->env;

305 
isbad
 = 0;

307 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

308  (
t
);

310 
	`TYPE
(
h
)) {

311 
P_IBTREE
:

312 
P_IRECNO
:

313 
P_LBTREE
:

314 
P_LDUP
:

317 
t
 = 
	`__db_unknown_th
(
v
, "__bam_vrfy");

318 
r
;

325 i((
t
 = 
	`__db_vrfy_dage
(
dbp
, 
vdp
, 
h
, 
pgno
, 
ags
)) != 0) {

326 i(
t
 =
DB_VERIFY_BAD
)

327 
isbad
 = 1;

329 
r
;

339 
p
->
c_t
 = 
	`RE_NREC
(
h
);

344 i(
	`TYPE
(
h
=
P_IRECNO
) {

345 i((
t
 = 
	`__m_vrfy_p
(
dbp
,

346 
vdp
, 
h
, 
pgno
, &
p
->
s
, 
ags
)) != 0)

347 
r
;

348 } i((
t
 = 
	`__bam_vrfy_p
(
dbp
,

349 
vdp
, 
h
, 
pgno
, &
p
->
s
, 
ags
)) != 0) {

350 i(
t
 =
DB_VERIFY_BAD
)

351 
isbad
 = 1;

353 
r
;

354 
	`EPRINT
((
v
,

356 (
u_lg
)
pgno
));

357 } i(!
	`LF_ISSET
(
DB_NOORDERCHK
&& (
t
 =

358 
	`__bam_vrfy_emd
(
dbp
,

359 
vdp
, vdp->
thad_fo
, 
h
, 
pgno
, 0, 0, 0, 
ags
)) != 0) {

365 i(
t
 =
DB_VERIFY_BAD
)

366 
isbad
 = 1;

368 
r
;

371 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0 && 
t
 == 0)

372 
t
 = 
t_t
;

373  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

374 
	}
}

384 
	$__m_vrfy_p
(
dbp
, 
vdp
, 
h
, 
pgno
, 
r
, 
ags
)

385 
DB
 *
dbp
;

386 
VRFY_DBINFO
 *
vdp
;

387 
PAGE
 *
h
;

388 
db_pgno_t
 
pgno
;

389 
db_dx_t
 *
r
;

390 
u_t32_t
 
ags
;

392 
ENV
 *
v
;

393 
RINTERNAL
 *
ri
;

394 
VRFY_CHILDINFO
 
chd
;

395 
VRFY_PAGEINFO
 *
p
;

396 
t
, 
t_t
, 
isbad
;

397 
u_t32_t
 
himk
, 
i
, 
offt
, 
rs
;

398 
db_dx_t
 *
p
;

399 
u_t8_t
 *
gayout
, *
p
;

401 
v
 = 
dbp
->env;

402 
isbad
 = 0;

403 
	`memt
(&
chd
, 0, (
VRFY_CHILDINFO
));

404 
rs
 = 0;

405 
gayout
 = 
NULL
;

407 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

408  (
t
);

410 i(
	`TYPE
(
h
!
P_IRECNO
) {

411 
t
 = 
	`__db_unknown_th
(
v
, "__ram_vrfy_inp");

412 
r
;

415 
himk
 = 
dbp
->
pgsize
;

416 i((
t
 = 
	`__os_mloc
(
v
, 
dbp
->
pgsize
, &
gayout
)) != 0)

417 
r
;

418 
	`memt
(
gayout
, 0, 
dbp
->
pgsize
);

419 
p
 = 
	`P_INP
(
dbp
, 
h
);

420 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

421 i((
u_t8_t
 *)
p
 + 
i
 >(u_t8_*)
h
 + 
himk
) {

422 
	`EPRINT
((
v
,

424 (
u_lg
)
pgno
, (u_lg)
i
));

425 
t
 = 
DB_VERIFY_BAD
;

426 
r
;

428 
offt
 = 
p
[
i
];

434 i(
offt
 <(
u_t32_t
)((
u_t8_t
 *)
p
 + 
i
 -

435 (
u_t8_t
 *)
h
) ||

436 
offt
 > (
u_t32_t
)(
dbp
->
pgsize
 - 
RINTERNAL_SIZE
)) {

437 
isbad
 = 1;

438 
	`EPRINT
((
v
,

440 (
u_lg
)
pgno
, (u_lg)
offt
, (u_lg)
i
));

445 i(
offt
 < 
himk
)

446 
himk
 = 
offt
;

448 
rs
++;

451 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
i
);

452 i(
gayout
[
offt
] == 0) {

453 
gayout
[
offt
] = 1;

454 
chd
.
pgno
 = 
ri
->pgno;

455 
chd
.
ty
 = 
V_RECNO
;

456 
chd
.
ecs
 = 
ri
->nrecs;

457 i((
t
 = 
	`__db_vrfy_chdput
(
vdp
, 
pgno
, &
chd
)) != 0)

458 
r
;

460 
	`EPRINT
((
v
,

462 (
u_lg
)
pgno
, (u_lg)
offt
));

463 
isbad
 = 1;

467 
p
 = 
gayout
 + 
himk
;

468 
p
 < 
gayout
 + 
dbp
->
pgsize
;

469 
p
 +
RINTERNAL_SIZE
)

470 i(*
p
 != 1) {

471 
	`EPRINT
((
v
,

473 (
u_lg
)
pgno
, (u_lg)(
p
 - 
gayout
)));

474 
isbad
 = 1;

477 i((
db_dx_t
)
himk
 !
	`HOFFSET
(
h
)) {

478 
	`EPRINT
((
v
,

480 (
u_lg
)
pgno
, (u_lg)(
	`HOFFSET
(
h
)), (u_lg)
himk
));

481 
isbad
 = 1;

484 *
r
 = 
rs
;

486 
r
: i((
t_t
 = 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0 && 
t
 == 0)

487 
t
 = 
t_t
;

488 i(
gayout
 !
NULL
)

489 
	`__os_
(
v
, 
gayout
);

490  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

491 
	}
}

493 um { 
	mVRFY_ITEM_NOTSET
=0, 
	mVRFY_ITEM_BEGIN
, 
	mVRFY_ITEM_END
 } 
	tVRFY_ITEM
;

501 
	$__bam_vrfy_p
(
dbp
, 
vdp
, 
h
, 
pgno
, 
r
, 
ags
)

502 
DB
 *
dbp
;

503 
VRFY_DBINFO
 *
vdp
;

504 
PAGE
 *
h
;

505 
db_pgno_t
 
pgno
;

506 
db_dx_t
 *
r
;

507 
u_t32_t
 
ags
;

509 
BKEYDATA
 *
bk
;

510 
BOVERFLOW
 *
bo
;

511 
ENV
 *
v
;

512 
VRFY_CHILDINFO
 
chd
;

513 
VRFY_ITEM
 *
gayout
;

514 
VRFY_PAGEINFO
 *
p
;

515 
u_t32_t
 
himk
, 
offt
;

519 
u_t32_t
 
i
, 
doff
, 
rs
;

520 
isbad
, 
em
, 
isdupem
, 
t
, 
t_t
;

522 
v
 = 
dbp
->env;

523 
isbad
 = 
isdupem
 = 0;

524 
rs
 = 0;

525 
	`memt
(&
chd
, 0, (
VRFY_CHILDINFO
));

526 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

527  (
t
);

529 
	`TYPE
(
h
)) {

530 
P_IBTREE
:

531 
P_LBTREE
:

532 
P_LDUP
:

533 
P_LRECNO
:

541 i(
	`LF_ISSET
(
DB_SALVAGE
))

543 
t
 = 
	`__db_unknown_th
(
v
, "__bam_vrfy_inp");

544 
r
;

558 
himk
 = 
dbp
->
pgsize
;

559 i((
t
 = 
	`__os_oc
(

560 
v
, 
dbp
->
pgsize
, (
gayout
[0]), &pagelayout)) != 0)

561 
r
;

562 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

563 
t
 = 
	`__db_vrfy_pem
(
dbp
,

564 
h
, 
pgno
, 
i
, 1, 
ags
, &
himk
, &
offt
)) {

567 
DB_VERIFY_BAD
:

568 
isbad
 = 1;

570 
DB_VERIFY_FATAL
:

571 
isbad
 = 1;

572 
r
;

574 
	`DB_ASSERT
(
v
, 
t
 != 0);

585 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

586 i(
gayout
[
offt
] =
VRFY_ITEM_NOTSET
)

587 
gayout
[
offt
] = 
VRFY_ITEM_BEGIN
;

588 i(
gayout
[
offt
] =
VRFY_ITEM_BEGIN
) {

595 i((
i
 % 
P_INDX
 =0&& (
	`TYPE
(
h
=
P_LBTREE
)) {

597 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

600 
rs
++;

606 
isdupem
 = 1;

608 
isbad
 = 1;

609 
	`EPRINT
((
v
, "Page %lu: duplicated item %lu",

610 (
u_lg
)
pgno
, (u_lg)
i
));

621 
	`B_TYPE
(
bk
->
ty
)) {

622 
B_KEYDATA
:

623 i(
	`TYPE
(
h
=
P_IBTREE
)

625 
doff
 = 
offt
 + 
	`BINTERNAL_SIZE
(
bk
->
n
) - 1;

627 
doff
 = 
offt
 + 
	`BKEYDATA_SIZE
(
bk
->
n
) - 1;

629 
B_DUPLICATE
:

634 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

636 
B_OVERFLOW
:

642 
doff
 = 
offt
 +

643 ((
	`TYPE
(
h
=
P_IBTREE
) ?

644 
	`BINTERNAL_SIZE
(
BOVERFLOW_SIZE
) :

645 
BOVERFLOW_SIZE
) - 1;

652 
doff
 = 
offt
 + 
	`BKEYDATA_SIZE
(0) - 1;

660 i(
isdupem
 && 
gayout
[
doff
] !
VRFY_ITEM_END
) {

661 
	`EPRINT
((
v
, "Page %lu: duplicated item %lu",

662 (
u_lg
)
pgno
, (u_lg)
i
));

663 
isbad
 = 1;

664 } i(
gayout
[
doff
] =
VRFY_ITEM_NOTSET
)

665 
gayout
[
doff
] = 
VRFY_ITEM_END
;

666 
isdupem
 = 0;

672 i(
	`B_DISSET
(
bk
->
ty
&& 
	`TYPE
(
h
!
P_LRECNO
) {

673 
isbad
 = 1;

674 
	`EPRINT
((
v
, "Page %lu: item %lu marked deleted",

675 (
u_lg
)
pgno
, (u_lg)
i
));

682 
	`B_TYPE
(
bk
->
ty
)) {

683 
B_KEYDATA
:

690 
B_DUPLICATE
:

691 i(
	`TYPE
(
h
=
P_IBTREE
) {

692 
isbad
 = 1;

693 
	`EPRINT
((
v
,

695 (
u_lg
)
pgno
, (u_lg)
i
));

697 } i(
	`TYPE
(
h
=
P_LRECNO
) {

698 
isbad
 = 1;

699 
	`EPRINT
((
v
,

701 (
u_lg
)
pgno
, (u_lg)
i
));

705 
B_OVERFLOW
:

706 
bo
 = (
	`TYPE
(
h
=
P_IBTREE
) ?

707 (
BOVERFLOW
 *)(((
BINTERNAL
 *)
bk
)->
da
) :

708 (
BOVERFLOW
 *)
bk
;

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

712 i(
bo
->

 > 
dbp
->
pgsize
 * 
vdp
->
ϡ_pgno
) {

713 
isbad
 = 1;

714 
	`EPRINT
((
v
,

716 (
u_lg
)
pgno
,

717 (
u_lg
)
bo
->

, (u_lg)
i
));

722 i(!
	`IS_VALID_PGNO
(
bo
->
pgno
) || bo->pgno ==gno ||

723 
bo
->
pgno
 =
PGNO_INVALID
) {

724 
isbad
 = 1;

725 
	`EPRINT
((
v
,

727 (
u_lg
)
pgno
, (u_lg)
i
, (u_lg)
bo
->pgno));

732 
chd
.
pgno
 = 
bo
->pgno;

733 
chd
.
ty
 = (
	`B_TYPE
(
bk
->ty=
B_OVERFLOW
 ?

734 
V_OVERFLOW
 : 
V_DUPLICATE
);

735 
chd
.

 = 
bo
->tlen;

736 i((
t
 = 
	`__db_vrfy_chdput
(
vdp
, 
pgno
, &
chd
)) != 0)

737 
r
;

740 
isbad
 = 1;

741 
	`EPRINT
((
v
, "Page %lu: item %lu of invalidype %lu",

742 (
u_lg
)
pgno
, (u_lg)
i
, (u_lg)
	`B_TYPE
(
bk
->
ty
)));

751 
em
 = 0;

752 
i
 = 
himk
; i < 
dbp
->
pgsize
; i++)

753 i(
em
 == 0)

754 
gayout
[
i
]) {

755 
VRFY_ITEM_NOTSET
:

757 i(
i
 !
	`DB_ALIGN
(i, (
u_t32_t
)))

760 
isbad
 = 1;

761 
	`EPRINT
((
v
,

763 (
u_lg
)
pgno
, (u_lg)
i
));

765 ; 
gayout
[
i
 + 1] =
VRFY_ITEM_NOTSET
 &&

766 (
size_t
)(
i
 + 1< 
dbp
->
pgsize
; i++)

769 
VRFY_ITEM_BEGIN
:

771 i(
i
 !
	`DB_ALIGN
(i, (
u_t32_t
))) {

772 
isbad
 = 1;

773 
	`EPRINT
((
v
,

775 (
u_lg
)
pgno
, (u_lg)
i
));

777 
em
 = 1;

778 
rs
++;

780 
VRFY_ITEM_END
:

786 
isbad
 = 1;

787 
	`EPRINT
((
v
,

789 (
u_lg
)
pgno
, (u_lg)
i
));

793 
gayout
[
i
]) {

794 
VRFY_ITEM_NOTSET
:

797 
VRFY_ITEM_END
:

799 
em
 = 0;

801 
VRFY_ITEM_BEGIN
:

806 
isbad
 = 1;

807 
	`EPRINT
((
v
,

809 (
u_lg
)
pgno
, (u_lg)
i
));

813 
	`__os_
(
v
, 
gayout
);

816 i((
db_dx_t
)
himk
 !
	`HOFFSET
(
h
)) {

817 
	`EPRINT
((
v
, "Page %lu: bad HOFFSET %lu,ppearso be %lu",

818 (
u_lg
)
pgno
, (u_lg)
	`HOFFSET
(
h
), (u_lg)
himk
));

819 
isbad
 = 1;

822 
r
: i(
r
 !
NULL
)

823 *
r
 = 
rs
;

825 i((
t_t
 = 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0 && 
t
 == 0)

826 
t
 = 
t_t
;

828  ((
isbad
 =1 && 
t
 =0? 
DB_VERIFY_BAD
 :et);

829 
	}
}

848 
	$__bam_vrfy_emd
(
dbp
, 
vdp
, 

, 
h
, 
pgno
, 
rs
, 
ovok
, 
hasdups
, 
ags
)

849 
DB
 *
dbp
;

850 
VRFY_DBINFO
 *
vdp
;

851 
DB_THREAD_INFO
 *

;

852 
PAGE
 *
h
;

853 
db_pgno_t
 
pgno
;

854 
u_t32_t
 
rs
;

855 
ovok
, 
hasdups
;

856 
u_t32_t
 
ags
;

858 
BINTERNAL
 *
bi
;

859 
BKEYDATA
 *
bk
;

860 
BOVERFLOW
 *
bo
;

861 
BTREE
 *
bt
;

862 
DBT
 
db
, 
dbtb
, 
dup_1
, 
dup_2
, *
p1
, *
p2
, *
tmp
;

863 
ENV
 *
v
;

864 
VRFY_PAGEINFO
 *
p
;

865 
db_dx_t
 
i
, *
p
;

866 
adj
, 
cmp
, 
dup_1
, 
dup_2
, 
isbad
, 
t
, 
t_t
;

867 (*
dupfunc

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

868 (*
func

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

869 *
buf1
, *
buf2
, *
tmpbuf
;

876 i(
vdp
 !
NULL
) {

877 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

878  (
t
);

879 
rs
 = 
p
->
s
;

881 
p
 = 
NULL
;

883 
v
 = 
dbp
->env;

884 
t
 = 
isbad
 = 0;

885 
bo
 = 
NULL
;

887 
	`memt
(&
db
, 0, (
DBT
));

888 
	`F_SET
(&
db
, 
DB_DBT_REALLOC
);

890 
	`memt
(&
dbtb
, 0, (
DBT
));

891 
	`F_SET
(&
dbtb
, 
DB_DBT_REALLOC
);

893 
buf1
 = 
buf2
 = 
NULL
;

895 
	`DB_ASSERT
(
v
, !
	`LF_ISSET
(
DB_NOORDERCHK
));

897 
dupfunc
 = (
dbp
->
dup_com
 =
NULL
? 
__bam_defcmp
 : dbp->dup_compare;

898 i(
	`TYPE
(
h
=
P_LDUP
)

899 
func
 = 
dupfunc
;

901 
func
 = 
__bam_defcmp
;

902 i(
dbp
->
bt_
 !
NULL
) {

903 
bt
 = (
BTREE
 *)
dbp
->
bt_
;

904 i(
bt
->
bt_com
 !
NULL
)

905 
func
 = 
bt
->
bt_com
;

914 
p1
 = &
db
;

915 
p2
 = &
dbtb
;

927 
p
 = 
	`P_INP
(
dbp
, 
h
);

928 
adj
 = (
	`TYPE
(
h
=
P_LBTREE
? 
P_INDX
 : 
O_INDX
;

929 
i
 = (
	`TYPE
(
h
=
P_IBTREE
? 1 : 0; i < 
rs
; i +
adj
) {

933 
tmp
 = 
p1
;

934 
p1
 = 
p2
;

935 
p2
 = 
tmp
;

936 
tmpbuf
 = 
buf1
;

937 
buf1
 = 
buf2
;

938 
buf2
 = 
tmpbuf
;

943 
	`TYPE
(
h
)) {

944 
P_IBTREE
:

945 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
);

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

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

948 
ovow
;

950 
p2
->
da
 = 
bi
->data;

951 
p2
->
size
 = 
bi
->
n
;

965 i(
i
 =0 && 
bi
->
n
 != 0) {

966 
isbad
 = 1;

967 
	`EPRINT
((
v
,

969 (
u_lg
)
pgno
));

973 
P_LBTREE
:

974 
P_LDUP
:

975 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

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

977 
bo
 = (
BOVERFLOW
 *)
bk
;

978 
ovow
;

980 
p2
->
da
 = 
bk
->data;

981 
p2
->
size
 = 
bk
->
n
;

989 
t
 = 
	`__db_unknown_th
(
v
, "__bam_vrfy_itemorder");

990 
r
;

1004 
ovow
: i(!
ovok
) {

1005 
	`F_SET
(
p
, 
VRFY_INCOMPLETE
);

1006 
r
;

1018 
p2
->
da
 = 
buf2
;

1019 i((
t
 = 
	`__db_goff
(
dbp
, 

, 
NULL
,

1020 
p2
, 
bo
->

, bo->
pgno
, 
NULL
, NULL)) != 0) {

1021 
isbad
 = 1;

1022 
	`EPRINT
((
v
,

1024 (
u_lg
)
pgno
, (u_lg)
t
, (u_lg)
i
));

1027 
buf2
 = 
p2
->
da
;

1031 i(
p1
->
da
 !
NULL
 && 
p2
->data != NULL) {

1032 
cmp
 = 
p
[
i
] =p[- 
adj
] ? 0 : 
	`func
(
dbp
, 
p1
, 
p2
);

1035 i(
cmp
 > 0) {

1036 
isbad
 = 1;

1037 
	`EPRINT
((
v
,

1039 (
u_lg
)
pgno
, (u_lg)
i
));

1041 } i(
cmp
 == 0) {

1042 i(
p
[
i
] !p[- 
adj
]) {

1043 
	`EPRINT
((
v
,

1045 (
u_lg
)
pgno
, (u_lg)
i
));

1046 
isbad
 = 1;

1054 i(
p
 !
NULL
)

1055 
	`F_SET
(
p
, 
VRFY_HAS_DUPS
);

1056 i(
hasdups
 == 0) {

1057 
isbad
 = 1;

1058 
	`EPRINT
((
v
,

1060 (
u_lg
)
pgno
));

1075 i(
	`TYPE
(
h
=
P_LBTREE
) {

1080 i(
i
 + 1 >(
db_dx_t
)
rs
)

1090 i(((
t
 = 
	`__bam__gda
(
dbp
,

1091 

, 
h
, 
i
 - 1, 
ovok
,

1092 &
dup_1
, &
dup_1
)) != 0) ||

1093 ((
t
 = 
	`__bam__gda
(
dbp
,

1094 

, 
h
, 
i
 + 1, 
ovok
,

1095 &
dup_2
, &
dup_2
)) != 0))

1096 
r
;

1104 i(
dup_1
.
da
 =
NULL
 ||

1105 
dup_2
.
da
 =
NULL
) {

1106 
	`DB_ASSERT
(
v
, !
ovok
);

1107 
	`F_SET
(
p
, 
VRFY_INCOMPLETE
);

1108 
r
;

1117 i(
	`dupfunc
(
dbp
, &
dup_1
, &
dup_2
) > 0)

1118 
	`F_SET
(
p
, 
VRFY_DUPS_UNSORTED
);

1120 i(
dup_1
)

1121 
	`__os_u
(
v
, 
dup_1
.
da
);

1122 i(
dup_2
)

1123 
	`__os_u
(
v
, 
dup_2
.
da
);

1129 
r
: i(
p
 !
NULL
 && ((
t_t
 =

1130 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0&& 
t
 == 0)

1131 
t
 = 
t_t
;

1133 i(
buf1
 !
NULL
)

1134 
	`__os_u
(
v
, 
buf1
);

1135 i(
buf2
 !
NULL
)

1136 
	`__os_u
(
v
, 
buf2
);

1138  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

1139 
	}
}

1150 
	$__bam_vrfy_ruu
(
dbp
, 
vdp
, 
ma_pgno
, 
ags
)

1151 
DB
 *
dbp
;

1152 
VRFY_DBINFO
 *
vdp
;

1153 
db_pgno_t
 
ma_pgno
;

1154 
u_t32_t
 
ags
;

1156 
DB
 *
pgt
;

1157 
ENV
 *
v
;

1158 
VRFY_PAGEINFO
 *
m
, *
r
;

1159 
db_pgno_t
 
ro
, 
p
;

1160 
t_t
, 
t
;

1161 
u_t32_t
 
ecs
, 
v
, 
n
, 
ags
;

1163 
v
 = 
dbp
->env;

1164 
m
 = 
r
 = 0;

1165 
pgt
 = 
vdp
->pgset;

1167 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
ma_pgno
, &
m
)) != 0)

1168  (
t
);

1170 i((
t
 = 
	`__db_vrfy_pgt_g
(
pgt
,

1171 
vdp
->
thad_fo
, 
ma_pgno
, (*)&
p
)) != 0)

1172 
r
;

1173 i(
p
 != 0) {

1174 
	`EPRINT
((
v
,

1176 (
u_lg
)
ma_pgno
));

1177 
t
 = 
DB_VERIFY_BAD
;

1178 
r
;

1180 i((
t
 =

1181 
	`__db_vrfy_pgt_c
(
pgt
, 
vdp
->
thad_fo
, 
ma_pgno
)) != 0)

1182 
r
;

1184 
ro
 = 
m
->root;

1186 i(
ro
 == 0) {

1187 
	`EPRINT
((
v
,

1189 (
u_lg
)
ma_pgno
));

1190 
t
 = 
DB_VERIFY_BAD
;

1191 
r
;

1194 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
ro
, &
r
)) != 0)

1195 
r
;

1197 
r
->
ty
) {

1198 
P_IBTREE
:

1199 
P_LBTREE
:

1200 
ags
 = 
ags
 | 
DB_ST_TOPLEVEL
;

1201 i(
	`F_ISSET
(
m
, 
VRFY_HAS_DUPS
))

1202 
ags
 |
DB_ST_DUPOK
;

1203 i(
	`F_ISSET
(
m
, 
VRFY_HAS_DUPSORT
))

1204 
ags
 |
DB_ST_DUPSORT
;

1205 i(
	`F_ISSET
(
m
, 
VRFY_HAS_RECNUMS
))

1206 
ags
 |
DB_ST_RECNUM
;

1207 
t
 = 
	`__bam_vrfy_sub
(
dbp
,

1208 
vdp
, 
ro
, 
NULL
, NULL, 
ags
, NULL, NULL, NULL);

1210 
P_IRECNO
:

1211 
P_LRECNO
:

1212 
ags
 =

1213 
ags
 | 
DB_ST_RECNUM
 | 
DB_ST_IS_RECNO
 | 
DB_ST_TOPLEVEL
;

1214 i(
m
->
_n
 > 0)

1215 
ags
 |
DB_ST_RELEN
;

1216 i((
t
 = 
	`__bam_vrfy_sub
(
dbp
, 
vdp
,

1217 
ro
, 
NULL
, NULL, 
ags
, &
v
, &
ecs
, &
n
)) != 0)

1218 
r
;

1225 i(
m
->
_n
 > 0 && 
n
 > 0 && mip->re_len !=elen) {

1226 
	`EPRINT
((
v
,

1228 (
u_lg
)
ma_pgno
, (u_lg)
n
));

1229 
t
 = 
DB_VERIFY_BAD
;

1230 
r
;

1232 
t
 = 0;

1234 
P_LDUP
:

1235 
	`EPRINT
((
v
,

1237 (
u_lg
)
ma_pgno
));

1238 
t
 = 
DB_VERIFY_BAD
;

1241 
	`EPRINT
((
v
,

1243 (
u_lg
)
ma_pgno
, (u_lg)
r
->
ty
));

1244 
t
 = 
DB_VERIFY_BAD
;

1248 
r
: i(
m
 !
NULL
 && ((
t_t
 =

1249 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
m
)!0&& 
t
 == 0)

1250 
t
 = 
t_t
;

1251 i(
r
 !
NULL
 && ((
t_t
 =

1252 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
r
)!0&& 
t
 == 0)

1253 
t
 = 
t_t
;

1254  (
t
);

1255 
	}
}

1268 
	$__bam_vrfy_sub
(
dbp
, 
vdp
, 
pgno
, 
l
, 
r
, 
ags
, 
vp
, 
ec
, 

)

1269 
DB
 *
dbp
;

1270 
VRFY_DBINFO
 *
vdp
;

1271 
db_pgno_t
 
pgno
;

1272 *
l
, *
r
;

1273 
u_t32_t
 
ags
, *
vp
, *
ec
, *

;

1275 
BINTERNAL
 *
li
, *
ri
;

1276 
DB
 *
pgt
;

1277 
DBC
 *
cc
;

1278 
DB_MPOOLFILE
 *
mpf
;

1279 
ENV
 *
v
;

1280 
PAGE
 *
h
;

1281 
VRFY_CHILDINFO
 *
chd
;

1282 
VRFY_PAGEINFO
 *
p
;

1283 
db_dx_t
 
i
;

1284 
db_pgno_t
 
xt_pgno
, 
ev_pgno
;

1285 
db_o_t
 
chd_ecs
, 
ecs
;

1286 
u_t32_t
 
chd_v
, 
chd_n
, 
j
, 
v
, 
n
, 
ags
;

1287 
u_t8_t
 
af_ty
;

1288 (*
func

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

1289 
isbad
, 
p
, 
t
, 
t_t
, 
tv
;

1291 i(
vp
 !
NULL
)

1292 *
vp
 = 0;

1293 i(
ec
 !
NULL
)

1294 *
ec
 = 0;

1296 
v
 = 
dbp
->env;

1297 
mpf
 = 
dbp
->mpf;

1298 
h
 = 
NULL
;

1299 
xt_pgno
 = 
ev_pgno
 = 
PGNO_INVALID
;

1300 
ecs
 = 0;

1301 
n
 = 0;

1302 
af_ty
 = 
P_INVALID
;

1303 
isbad
 = 
t
 = 0;

1306 i(!
	`LF_ISSET
(
DB_SALVAGE
))

1307 
	`__db_vrfy_ru_edback
(
dbp
, 
vdp
);

1309 i((
t
 = 
	`__db_vrfy_ggefo
(
vdp
, 
pgno
, &
p
)) != 0)

1310  (
t
);

1312 
cc
 = 
NULL
;

1313 
v
 = 
p
->
bt_v
;

1315 
tv
 = 
	`LF_ISSET
(
DB_ST_TOPLEVEL
) ? 1 : 0;

1316 
	`LF_CLR
(
DB_ST_TOPLEVEL
);

1328 i(
tv
) {

1334 
ev_pgno
 = 
vdp
->prev_pgno;

1335 
xt_pgno
 = 
vdp
->next_pgno;

1336 
af_ty
 = 
vdp
->leaf_type;

1337 
vdp
->
xt_pgno
 = vdp->
ev_pgno
 = 
PGNO_INVALID
;

1338 
vdp
->
af_ty
 = 
P_INVALID
;

1366 
p
->
ty
) {

1367 
P_LRECNO
:

1368 
P_LDUP
:

1369 
P_LBTREE
:

1376 i(
vdp
->
af_ty
 =
P_INVALID
) {

1382 
vdp
->
af_ty
 = 
p
->
ty
;

1383 i(
p
->
ev_pgno
 !
PGNO_INVALID
)

1384 
bad_ev
;

1390 i(
p
->
ty
 !
vdp
->
af_ty
) {

1391 
isbad
 = 1;

1392 
	`EPRINT
((
v
,

1394 (
u_lg
)
p
->
pgno
, (u_lg->
ty
,

1395 (
u_lg
)
vdp
->
af_ty
));

1402 i(!
	`F_ISSET
(
vdp
, 
VRFY_LEAFCHAIN_BROKEN
)) {

1403 i(
p
->
pgno
 !
vdp
->
xt_pgno
) {

1404 
isbad
 = 1;

1405 
	`EPRINT
((
v
,

1407 (
u_lg
)
vdp
->
ev_pgno
,

1408 (
u_lg
)
vdp
->
xt_pgno
,

1409 (
u_lg
)
p
->
pgno
));

1411 i(
p
->
ev_pgno
 !
vdp
->prev_pgno) {

1412 
bad_ev
: 
isbad
 = 1;

1413 
	`EPRINT
((
v
,

1415 (
u_lg
)
p
->
pgno
,

1416 (
u_lg
)
p
->
ev_pgno
,

1417 (
u_lg
)
vdp
->
ev_pgno
));

1421 
vdp
->
ev_pgno
 = 
p
->
pgno
;

1422 
vdp
->
xt_pgno
 = 
p
->next_pgno;

1423 
	`F_CLR
(
vdp
, 
VRFY_LEAFCHAIN_BROKEN
);

1429 i((
t
 = 
	`__db_vrfy_chdcurs
(
vdp
, &
cc
)) != 0)

1430 
r
;

1431 
t
 = 
	`__db_vrfy_cct
(
cc
, 
pgno
, &
chd
);et == 0;

1432 
t
 = 
	`__db_vrfy_cext
(
cc
, &
chd
))

1433 i(
chd
->
ty
 =
V_OVERFLOW
 &&

1434 (
t
 = 
	`__db_vrfy_ov_ruu
(
dbp
, 
vdp
,

1435 
chd
->
pgno
, chd->

,

1436 
ags
 | 
DB_ST_OVFL_LEAF
)) != 0) {

1437 i(
t
 =
DB_VERIFY_BAD
)

1438 
isbad
 = 1;

1440 
de
;

1443 i((
t
 = 
	`__db_vrfy_cco
(
cc
)) != 0)

1444 
r
;

1445 
cc
 = 
NULL
;

1448 i(
p
->
ty
 =
P_LRECNO
) {

1449 i(!
	`LF_ISSET
(
DB_ST_IS_RECNO
) &&

1450 !(
	`LF_ISSET
(
DB_ST_DUPOK
) &&

1451 !
	`LF_ISSET
(
DB_ST_DUPSORT
))) {

1452 
isbad
 = 1;

1453 
	`EPRINT
((
v
,

1455 (
u_lg
)
pgno
));

1456 
de
;

1458 
af
;

1459 } i(
	`LF_ISSET
(
DB_ST_IS_RECNO
)) {

1464 
isbad
 = 1;

1465 
	`EPRINT
((
v
,

1467 (
u_lg
)
pgno
));

1468 
de
;

1472 i(
p
->
ty
 =
P_LDUP
)

1473 
af
;

1478 i(
	`F_ISSET
(
p
, 
VRFY_HAS_DUPS
)) {

1480 i(!
	`LF_ISSET
(
DB_ST_DUPOK
)) {

1481 
isbad
 = 1;

1482 
	`EPRINT
((
v
,

1484 (
u_lg
)
pgno
));

1490 i((
t
 =

1491 
	`__db_vrfy_chdcurs
(
vdp
, &
cc
)) != 0)

1492 
r
;

1493 
t
 = 
	`__db_vrfy_cct
(
cc
, 
pgno
, &
chd
);

1494 
t
 == 0;

1495 
t
 = 
	`__db_vrfy_cext
(
cc
, &
chd
)) {

1496 
ags
 =

1497 
ags
 | 
DB_ST_RECNUM
 | 
DB_ST_DUPSET
;

1499 i(
chd
->
ty
 =
V_DUPLICATE
) {

1500 i((
t
 = 
	`__db_vrfy_duy
(

1501 
dbp
, 
vdp
, 
chd
->
pgno
,

1502 
ags
)) != 0) {

1503 
isbad
 = 1;

1507 i((
t
 = 
	`__bam_vrfy_sub
(

1508 
dbp
, 
vdp
, 
chd
->
pgno
,

1509 
NULL
, NULL,

1510 
ags
 | 
DB_ST_TOPLEVEL
,

1511 
NULL
, NULL, NULL)) != 0) {

1512 i(
t
 ==

1513 
DB_VERIFY_BAD
)

1514 
isbad
 = 1;

1516 
r
;

1521 i((
t
 = 
	`__db_vrfy_cco
(
cc
)) != 0)

1522 
r
;

1523 
cc
 = 
NULL
;

1529 i(
	`F_ISSET
(
p
, 
VRFY_DUPS_UNSORTED
) &&

1530 
	`LF_ISSET
(
DB_ST_DUPSORT
)) {

1531 
isbad
 = 1;

1532 
	`EPRINT
((
v
,

1534 (
u_lg
)
pgno
));

1538 
af
;

1539 
P_IBTREE
:

1540 
P_IRECNO
:

1555 i(
	`F_ISSET
(
p
, 
VRFY_IS_ALLZEROES
))

1556 
	`ZEROPG_ERR_PRINT
(
v
, 
pgno
, "btree orecnoage");

1558 
	`EPRINT
((
v
,

1560 (
u_lg
)
pgno
, (u_lg)
p
->
ty
));

1569 
	`F_SET
(
vdp
, 
VRFY_LEAFCHAIN_BROKEN
);

1571 
t
 = 
DB_VERIFY_BAD
;

1572 
r
;

1580 i((
t
 = 
	`__db_vrfy_chdcurs
(
vdp
, &
cc
)) != 0)

1581 
r
;

1582 
t
 = 
	`__db_vrfy_cct
(
cc
, 
pgno
, &
chd
);et == 0;

1583 
t
 = 
	`__db_vrfy_cext
(
cc
, &
chd
))

1584 i(
chd
->
ty
 =
V_RECNO
) {

1585 i(
p
->
ty
 !
P_IRECNO
) {

1586 
t
 = 
	`__db_unknown_th
(

1587 
v
, "__bam_vrfy_subtree");

1588 
r
;

1590 i((
t
 = 
	`__bam_vrfy_sub
(
dbp
, 
vdp
, 
chd
->
pgno
,

1591 
NULL
, NULL, 
ags
, &
chd_v
, &
chd_ecs
,

1592 &
chd_n
)) != 0) {

1593 i(
t
 =
DB_VERIFY_BAD
)

1594 
isbad
 = 1;

1596 
de
;

1599 i(
	`LF_ISSET
(
DB_ST_RELEN
)) {

1600 i(
n
 == 0)

1601 
n
 = 
chd_n
;

1606 i(
chd_n
 > 0 &&

1607 
n
 !
chd_n
) {

1608 
isbad
 = 1;

1609 
	`EPRINT
((
v
,

1611 (
u_lg
)
chd
->
pgno
,

1612 (
u_lg
)
chd_n
));

1614 i(

)

1615 *

 = 
n
;

1617 i(
	`LF_ISSET
(
DB_ST_RECNUM
)) {

1618 i(
chd
->
ecs
 !
chd_ecs
) {

1619 
isbad
 = 1;

1620 
	`EPRINT
((
v
,

1622 (
u_lg
)
chd
->
pgno
,

1623 (
u_lg
)
chd_ecs
,

1624 (
u_lg
)
chd
->
ecs
));

1626 
ecs
 +
chd_ecs
;

1628 i(
isbad
 =0 && 
v
 !
chd_v
 + 1) {

1629 
isbad
 = 1;

1630 
	`EPRINT
((
v
,

1632 (
u_lg
)
chd
->
pgno
, (u_lg)
chd_v
,

1633 (
u_lg
)(
v
 - 1)));

1635 } i(
chd
->
ty
 =
V_OVERFLOW
) {

1655 
	`DB_ASSERT
(
v
, 
chd
->
ft
 >= 1);

1661 i(
chd
->
ft
 > 2) {

1662 
isbad
 = 1;

1663 
	`EPRINT
((
v
,

1665 (
u_lg
)
pgno
, (u_lg)
chd
->pgno));

1667 
j
 = 0; j < 
chd
->
ft
; j++)

1668 i((
t
 = 
	`__db_vrfy_ov_ruu
(
dbp
,

1669 
vdp
, 
chd
->
pgno
, chd->

,

1670 
ags
)) != 0) {

1671 i(
t
 =
DB_VERIFY_BAD
)

1672 
isbad
 = 1;

1674 
de
;

1678 i((
t
 = 
	`__db_vrfy_cco
(
cc
)) != 0)

1679 
r
;

1680 
cc
 = 
NULL
;

1683 i(
p
->
ty
 =
P_IRECNO
)

1684 
de
;

1696 i(
h
 =
NULL
 &&

1697 (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
, 
vdp
->
thad_fo
, 
NULL
, 0, &
h
)) != 0)

1698 
r
;

1699 
i
 = 0; i < 
p
->
s
; i +
O_INDX
) {

1700 
li
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
);

1701 
ri
 = (
i
 + 
O_INDX
 < 
p
->
s
) ?

1702 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
 + 
O_INDX
: 
r
;

1708 i((
t
 = 
	`__bam_vrfy_sub
(
dbp
, 
vdp
, 
li
->
pgno
,

1709 
i
 =0 ? 
NULL
 : 
li
, 
ri
, 
ags
, &
chd_v
,

1710 &
chd_ecs
, 
NULL
)) != 0) {

1711 i(
t
 =
DB_VERIFY_BAD
)

1712 
isbad
 = 1;

1714 
de
;

1717 i(
	`LF_ISSET
(
DB_ST_RECNUM
)) {

1723 
ecs
 +
chd_ecs
;

1729 i(
li
->
ecs
 !
chd_ecs
) {

1730 
isbad
 = 1;

1731 
	`EPRINT
((
v
,

1733 (
u_lg
)
pgno
, (u_lg)
i
, (u_lg)
li
->
ecs
,

1734 (
u_lg
)
chd_ecs
));

1738 i(
v
 !
chd_v
 + 1) {

1739 
isbad
 = 1;

1740 
	`EPRINT
((
v
,

1742 (
u_lg
)
li
->
pgno
,

1743 (
u_lg
)
chd_v
, (u_lg)(
v
 - 1)));

1748 
af
: 
v
 = 
LEAFLEVEL
;

1749 i(
	`LF_ISSET
(
DB_ST_RECNUM
))

1750 
ecs
 = 
p
->
c_t
;

1760 i(
	`LF_ISSET
(
DB_ST_RELEN
&& 

)

1761 *

 = 
p
->
_n
;

1763 
de
: i(
	`F_ISSET
(
p
, 
VRFY_INCOMPLETE
&& 
isbad
 =0 && 
t
 == 0) {

1770 i(
h
 =
NULL
 && (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

1771 
vdp
->
thad_fo
, 
NULL
, 0, &
h
)) != 0)

1772 
r
;

1773 i((
t
 = 
	`__bam_vrfy_emd
(
dbp
,

1774 
vdp
, vdp->
thad_fo
, 
h
, 
pgno
, 0, 1, 0, 
ags
)) != 0)

1775 
r
;

1776 
	`F_CLR
(
p
, 
VRFY_INCOMPLETE
);

1789 i(
isbad
 =0 && 
t
 == 0) {

1790 i(
h
 =
NULL
 && (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

1791 
vdp
->
thad_fo
, 
NULL
, 0, &
h
)) != 0)

1792 
r
;

1794 i(
	`NUM_ENT
(
h
=0 && 
	`ISINTERNAL
(h)) {

1795 
isbad
 = 1;

1796 
	`EPRINT
((
v
,

1798 (
u_lg
)
pgno
));

1799 
r
;

1808 i(
isbad
 =0 && 
t
 =0 && !
	`LF_ISSET
(
DB_NOORDERCHK
) &&

1809 
p
->
ty
 !
P_IRECNO
 &&->ty !
P_LRECNO
) {

1810 i(
h
 =
NULL
 && (
t
 = 
	`__memp_fg
(
mpf
, &
pgno
,

1811 
vdp
->
thad_fo
, 
NULL
, 0, &
h
)) != 0)

1812 
r
;

1820 
func
 = 
	`LF_ISSET
(
DB_ST_DUPSET
? 
dbp
->
dup_com
 :

1821 ((
BTREE
 *)
dbp
->
bt_
)->
bt_com
;

1822 i(
func
 =
NULL
)

1823 
func
 = 
__bam_defcmp
;

1825 i((
t
 = 
	`__bam_vrfy_d
(
dbp
,

1826 
vdp
->
thad_fo
, 
h
, 
l
, 
r
, 
func
, 
ags
)) != 0) {

1827 i(
t
 =
DB_VERIFY_BAD
)

1828 
isbad
 = 1;

1830 
r
;

1840 i(
	`LF_ISSET
(
DB_ST_RECNUM
&& 
ecs
 !
p
->
c_t
 && 
tv
) {

1841 
isbad
 = 1;

1842 
	`EPRINT
((
v
,

1844 (
u_lg
)
pgno
, (u_lg)
ecs
, (u_lg)
p
->
c_t
));

1847 i(
vp
)

1848 *
vp
 = 
v
;

1849 i(
ec
)

1850 *
ec
 = 
ecs
;

1852 
pgt
 = 
vdp
->pgset;

1853 i((
t
 = 
	`__db_vrfy_pgt_g
(
pgt
,

1854 
vdp
->
thad_fo
, 
pgno
, &
p
)) != 0)

1855 
r
;

1856 i(
p
 != 0) {

1857 
isbad
 = 1;

1858 
	`EPRINT
((
v
, "Pag%lu:kedwi", (
u_lg
)
pgno
));

1859 } i((
t
 =

1860 
	`__db_vrfy_pgt_c
(
pgt
, 
vdp
->
thad_fo
, 
pgno
)) != 0)

1861 
r
;

1863 i(
tv
)

1868 i(
vdp
->
xt_pgno
 !
PGNO_INVALID
) {

1869 
isbad
 = 1;

1870 
	`EPRINT
((
v
, "Page %lu: unterminatedeaf chain",

1871 (
u_lg
)
vdp
->
ev_pgno
));

1874 
r
: i(
tv
) {

1876 
vdp
->
xt_pgno
 =ext_pgno;

1877 
vdp
->
ev_pgno
 =rev_pgno;

1878 
vdp
->
af_ty
 =eaf_type;

1881 i(
h
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

1882 
vdp
->
thad_fo
, 
h
, 
DB_PRIORITY_UNCHANGED
)!0 && 
t
 == 0)

1883 
t
 = 
t_t
;

1884 i((
t_t
 = 
	`__db_vrfy_puagefo
(
v
, 
vdp
, 
p
)!0 && 
t
 == 0)

1885 
t
 = 
t_t
;

1886 i(
cc
 !
NULL
 && ((
t_t
 = 
	`__db_vrfy_cco
(cc)!0&& 
t
 == 0)

1887 
t
 = 
t_t
;

1888  ((
t
 =0 && 
isbad
 =1? 
DB_VERIFY_BAD
 :et);

1889 
	}
}

1905 
	$__bam_vrfy_d
(
dbp
, 

, 
h
, 

, 

, 
func
, 
ags
)

1906 
DB
 *
dbp
;

1907 
DB_THREAD_INFO
 *

;

1908 
PAGE
 *
h
;

1909 
BINTERNAL
 *

, *

;

1910 (*
func

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

1911 
u_t32_t
 
ags
;

1913 
BOVERFLOW
 *
bo
;

1914 
DBT
 
dbt
;

1915 
ENV
 *
v
;

1916 
db_dx_t
 
ϡ
;

1917 
t
, 
cmp
;

1919 
v
 = 
dbp
->env;

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

1921 
	`F_SET
(&
dbt
, 
DB_DBT_MALLOC
);

1922 
t
 = 0;

1929 i(
	`NUM_ENT
(
h
) == 0)

1932 
	`TYPE
(
h
)) {

1933 
P_IBTREE
:

1934 
P_LDUP
:

1935 
ϡ
 = 
	`NUM_ENT
(
h
- 
O_INDX
;

1937 
P_LBTREE
:

1938 
ϡ
 = 
	`NUM_ENT
(
h
- 
P_INDX
;

1941  (
	`__db_unknown_th
(
v
, "__bam_vrfy_treeorder"));

1957 i(

 !
NULL
 && 
	`TYPE
(
h
!
P_IBTREE
) {

1958 i(

->
ty
 =
B_KEYDATA
) {

1959 
dbt
.
da
 = 

->data;

1960 
dbt
.
size
 = 

->
n
;

1961 } i(

->
ty
 =
B_OVERFLOW
) {

1962 
bo
 = (
BOVERFLOW
 *)

->
da
;

1963 i((
t
 = 
	`__db_goff
(
dbp
, 

, 
NULL
, &
dbt
,

1964 
bo
->

, bo->
pgno
, 
NULL
, NULL)) != 0)

1965  (
t
);

1968 
	`__db_unknown_th
(
v
, "__bam_vrfy_treeorder"));

1971 i((
t
 = 
	`__bam_cmp
(
dbp
, 

,

1972 
NULL
, &
dbt
, 
h
, 0, 
func
, &
cmp
)) == 0) {

1973 i(
cmp
 > 0) {

1974 
	`EPRINT
((
v
,

1976 (
u_lg
)
	`PGNO
(
h
)));

1977 
t
 = 
DB_VERIFY_BAD
;

1980 
	`EPRINT
((
v
,

1982 (
u_lg
)
	`PGNO
(
h
)));

1984 i(
dbt
.
da
 !

->data)

1985 
	`__os_u
(
v
, 
dbt
.
da
);

1986 i(
t
 != 0)

1987  (
t
);

1990 i(

 !
NULL
) {

1991 i(

->
ty
 =
B_KEYDATA
) {

1992 
dbt
.
da
 = 

->data;

1993 
dbt
.
size
 = 

->
n
;

1994 } i(

->
ty
 =
B_OVERFLOW
) {

1995 
bo
 = (
BOVERFLOW
 *)

->
da
;

1996 i((
t
 = 
	`__db_goff
(
dbp
, 

, 
NULL
, &
dbt
,

1997 
bo
->

, bo->
pgno
, 
NULL
, NULL)) != 0)

1998  (
t
);

2001 
	`__db_unknown_th
(
v
, "__bam_vrfy_treeorder"));

2004 i((
t
 = 
	`__bam_cmp
(
dbp
, 

,

2005 
NULL
, &
dbt
, 
h
, 
ϡ
, 
func
, &
cmp
)) == 0) {

2006 i(
cmp
 < 0) {

2007 
	`EPRINT
((
v
,

2009 (
u_lg
)
	`PGNO
(
h
)));

2010 
t
 = 
DB_VERIFY_BAD
;

2013 
	`EPRINT
((
v
,

2015 (
u_lg
)
	`PGNO
(
h
)));

2017 i(
dbt
.
da
 !

->data)

2018 
	`__os_u
(
v
, 
dbt
.
da
);

2021  (
t
);

2022 
	}
}

2035 
	$__bam_lvage
(
dbp
, 
vdp
, 
pgno
, 
pgty
, 
h
, 
hd
, 
back
, 
key
, 
ags
)

2036 
DB
 *
dbp
;

2037 
VRFY_DBINFO
 *
vdp
;

2038 
db_pgno_t
 
pgno
;

2039 
u_t32_t
 
pgty
;

2040 
PAGE
 *
h
;

2041 *
hd
;

2042 (*
back

	`__P
((*, const *));

2043 
DBT
 *
key
;

2044 
u_t32_t
 
ags
;

2046 
BKEYDATA
 *
bk
;

2047 
BOVERFLOW
 *
bo
;

2048 
DBT
 
dbt
, 
dbt
, 
unknown_key
, 
unknown_da
;

2049 
ENV
 *
v
;

2050 
VRFY_ITEM
 *
pgm
;

2051 
db_dx_t
 
i
, 
ϡ
, 
beg
, 
d
, *
p
;

2052 
db_pgno_t
 
ovpg
;

2053 
u_t32_t
 
himk
;

2054 *
ovbuf
;

2055 
adj
, 
t
, 
t_t
, 
t2_t
;

2057 
v
 = 
dbp
->env;

2058 
ovbuf
 = 
pgm
 = 
NULL
;

2059 
p
 = 
	`P_INP
(
dbp
, 
h
);

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

2062 
dbt
.
ags
 = 
DB_DBT_REALLOC
;

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

2065 
	`DB_INIT_DBT
(
unknown_key
, "UNKNOWN_KEY", ("UNKNOWN_KEY") - 1);

2066 
	`DB_INIT_DBT
(
unknown_da
, "UNKNOWN_DATA", ("UNKNOWN_DATA") - 1);

2072 i((
t
 = 
	`__os_mloc
(
v
, 
dbp
->
pgsize
, &
ovbuf
)) != 0)

2073 
r
;

2075 i(
	`LF_ISSET
(
DB_AGGRESSIVE
&& (
t
 =

2076 
	`__os_oc
(
v
, 
dbp
->
pgsize
, (
pgm
[0]), &pgmap)) != 0)

2077 
r
;

2086 
himk
 = 
dbp
->
pgsize
;

2087 
i
 = 0, 
ϡ
 = 
UINT16_MAX
;; i +
O_INDX
) {

2089 i(!
	`LF_ISSET
(
DB_AGGRESSIVE
&& 
i
 >
	`NUM_ENT
(
h
))

2093 
t_t
 =

2094 
	`__db_vrfy_pem
(
dbp
, 
h
, 
pgno
, 
i
, 1, 
ags
, &
himk
, 
NULL
);

2096 i(
t_t
 != 0) {

2102 i(
pgty
 =
P_LBTREE
 && 
i
 % 
P_INDX
 == 1 &&

2103 
ϡ
 =
i
 - 1 && (
t2_t
 = 
	`__db_vrfy_dbt
(

2104 &
unknown_da
,

2105 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2106 i(
t
 == 0)

2107 
t
 = 
t2_t
;

2108 
r
;

2117 i(
t_t
 =
DB_VERIFY_FATAL
) {

2118 i(
i
 < 
	`NUM_ENT
(
h
&& 
t
 == 0)

2119 
t
 = 
DB_VERIFY_BAD
;

2131 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

2132 i(!
	`LF_ISSET
(
DB_AGGRESSIVE
&& 
	`B_DISSET
(
bk
->
ty
))

2140 i(
pgty
 =
P_LBTREE
 && 
i
 % 
P_INDX
 == 1 &&

2141 
ϡ
 !
i
 - 1 && (
t_t
 = 
	`__db_vrfy_dbt
(

2142 &
unknown_key
, 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2143 i(
t
 == 0)

2144 
t
 = 
t_t
;

2145 
r
;

2147 
ϡ
 = 
i
;

2155 i(
key
 !
NULL
 && (
i
 !0 || !
	`LF_ISSET
(
DB_SA_SKIPFIRSTKEY
)))

2156 i((
t_t
 = 
	`__db_vrfy_dbt
(
key
,

2157 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2158 i(
t
 == 0)

2159 
t
 = 
t_t
;

2160 
r
;

2163 
beg
 = 
d
 = 
p
[
i
];

2164 
	`B_TYPE
(
bk
->
ty
)) {

2165 
B_DUPLICATE
:

2166 i(
pgty
 =
P_IBTREE
)

2169 
d
 = 
beg
 + 
BOVERFLOW_SIZE
 - 1;

2177 i(
pgty
 !
P_LBTREE
)

2180 
bo
 = (
BOVERFLOW
 *)
bk
;

2188 i(!
	`IS_VALID_PGNO
(
bo
->
pgno
|| (
i
 % 
P_INDX
 == 0)) {

2190 i((
t_t
 = 
	`__db_vrfy_dbt
(&
unknown_key
,

2191 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2192 i(
t
 == 0)

2193 
t
 = 
t_t
;

2194 
r
;

2200 i((
t_t
 = 
	`__db_lvage_due
(
dbp
,

2201 
vdp
, 
bo
->
pgno
, &
dbt
, 
hd
, 
back
,

2202 
ags
 | 
DB_SA_SKIPFIRSTKEY
)!0 && 
t
 == 0)

2203 
t
 = 
t_t
;

2206 
B_KEYDATA
:

2207 i(
pgty
 =
P_IBTREE
)

2210 
d
 = (
db_dx_t
)
	`DB_ALIGN
(

2211 
beg
 + 
bk
->
n
, (
u_t32_t
)) - 1;

2213 
dbt
.
da
 = 
bk
->data;

2214 
dbt
.
size
 = 
bk
->
n
;

2215 i((
t_t
 = 
	`__db_vrfy_dbt
(&
dbt
,

2216 0, " ", 
hd
, 
back
, 0, 
vdp
)) != 0) {

2217 i(
t
 == 0)

2218 
t
 = 
t_t
;

2219 
r
;

2222 
B_OVERFLOW
:

2223 i(
pgty
 !
P_IBTREE
)

2224 
d
 = 
beg
 + 
BOVERFLOW_SIZE
 - 1;

2225 
bo
 = (
BOVERFLOW
 *)
bk
;

2236 
adj
 = 
pgty
 =
P_IBTREE
 ? 
O_INDX
 : 
P_INDX
;

2237 i(
i
 > 
adj
 - 1 && i %dj == 0 &&

2238 
p
[
i
] =p[- 
adj
]) {

2239 
	`DB_ASSERT
(
v
, 
pgty
 !
P_IBTREE
);

2240 
dbt
 = 
dbt
;

2242 i(
pgty
 =
P_IBTREE
) {

2256 
ovpg
 = ((
BOVERFLOW
 *)

2257 ((
BINTERNAL
 *)
bk
)->
da
)->
pgno
;

2258 i(
	`__db_lvage_isde
(
vdp
,

2259 
ovpg
=0 && (
t_t
 =

2260 
	`__db__goff
(
dbp
, 
vdp
, 
ovpg
,

2261 &
dbt
, &
ovbuf
, 
ags
)) != 0 &&

2262 
t
 == 0)

2263 
t
 = 
t_t
;

2268 i((
t_t
 = 
	`__db__goff
(
dbp
, 
vdp
, 
bo
->
pgno
,

2269 &
dbt
, &
ovbuf
, 
ags
)!0 && 
t
 == 0)

2270 
t
 = 
t_t
;

2279 i(
i
 % 
P_INDX
 == 0) {

2280 i((
t
 = 
	`__os_loc
(
v
,

2281 
dbt
.
size
, &
dbt
.
da
)) != 0)

2282 
r
;

2283 
	`memy
(
dbt
.
da
, 
dbt
.data,

2284 
dbt
.
size
);

2285 
dbt
.
size
 = 
dbt
.size;

2290 i((
t_t
 = 
	`__db_vrfy_dbt
(

2291 
t_t
 =0 ? &
dbt
 : &
unknown_key
,

2292 0, " ", 
hd
, 
back
, 0, 
vdp
)!0 && 
t
 == 0)

2293 
t
 = 
t_t
;

2300 
t_t
 = 
	`__db_unknown_th
(
v
, "__bam_salvage");

2301 i(
t
 == 0)

2302 
t
 = 
t_t
;

2303 
r
;

2312 i(
	`LF_ISSET
(
DB_AGGRESSIVE
&& 
pgty
 !
P_IBTREE
) {

2313 
pgm
[
beg
] = 
VRFY_ITEM_BEGIN
;

2314 
pgm
[
d
] = 
VRFY_ITEM_END
;

2318 
r
: i(
pgm
 !
NULL
)

2319 
	`__os_
(
v
, 
pgm
);

2320 i(
ovbuf
 !
NULL
)

2321 
	`__os_
(
v
, 
ovbuf
);

2322 i(
dbt
.
da
 !
NULL
)

2323 
	`__os_
(
v
, 
dbt
.
da
);

2326 i((
t_t
 = 
	`__db_lvage_mkde
(
vdp
, 
pgno
)!0 && 
t
 == 0)

2327 
t
 = 
t_t
;

2329  (
t
);

2330 
	}
}

2341 
	$__bam_lvage_wkdupt
(
dbp
, 
vdp
, 
h
, 
key
, 
hd
, 
back
, 
ags
)

2342 
DB
 *
dbp
;

2343 
VRFY_DBINFO
 *
vdp
;

2344 
PAGE
 *
h
;

2345 
DBT
 *
key
;

2346 *
hd
;

2347 (*
back

	`__P
((*, const *));

2348 
u_t32_t
 
ags
;

2350 
BINTERNAL
 *
bi
;

2351 
ENV
 *
v
;

2352 
RINTERNAL
 *
ri
;

2353 
t
, 
t_t
;

2354 
db_dx_t
 
i
;

2356 
v
 = 
dbp
->env;

2357 
t
 = 0;

2359 
i
 = 0; i < 
	`NUM_ENT
(
h
); i++) {

2360 
	`TYPE
(
h
)) {

2361 
P_IBTREE
:

2362 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 
i
);

2363 i((
t_t
 = 
	`__db_lvage_due
(
dbp
,

2364 
vdp
, 
bi
->
pgno
, 
key
, 
hd
, 
back
, 
ags
)) != 0)

2365 
t
 = 
t_t
;

2367 
P_IRECNO
:

2368 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 
i
);

2369 i((
t_t
 = 
	`__db_lvage_due
(
dbp
,

2370 
vdp
, 
ri
->
pgno
, 
key
, 
hd
, 
back
, 
ags
)) != 0)

2371 
t
 = 
t_t
;

2374  (
	`__db_unknown_th
(

2375 
v
, "__bam_salvage_walkdupint"));

2378 
ags
 &~
	`LF_ISSET
(
DB_SA_SKIPFIRSTKEY
);

2381  (
t
);

2382 
	}
}

2402 
	$__bam_ma2pgt
(
dbp
, 
vdp
, 
btma
, 
ags
, 
pgt
)

2403 
DB
 *
dbp
;

2404 
VRFY_DBINFO
 *
vdp
;

2405 
BTMETA
 *
btma
;

2406 
u_t32_t
 
ags
;

2407 
DB
 *
pgt
;

2409 
BINTERNAL
 *
bi
;

2410 
DB_MPOOLFILE
 *
mpf
;

2411 
PAGE
 *
h
;

2412 
RINTERNAL
 *
ri
;

2413 
db_pgno_t
 
cut
, 
p
;

2414 
r_t
, 
t
;

2416 
	`DB_ASSERT
(
dbp
->
v
, 
pgt
 !
NULL
);

2418 
mpf
 = 
dbp
->mpf;

2419 
h
 = 
NULL
;

2420 
t
 = 
r_t
 = 0;

2422 
cut
 = 
btma
->
ro
;;) {

2423 i(!
	`IS_VALID_PGNO
(
cut
|| cu=
	`PGNO
(
btma
)) {

2424 
r_t
 = 
DB_VERIFY_BAD
;

2425 
r
;

2427 i((
t
 = 
	`__memp_fg
(
mpf
, &
cut
,

2428 
vdp
->
thad_fo
, 
NULL
, 0, &
h
)) != 0) {

2429 
r_t
 = 
t
;

2430 
r
;

2433 
	`TYPE
(
h
)) {

2434 
P_IBTREE
:

2435 
P_IRECNO
:

2436 i((
t
 = 
	`__bam_vrfy
(
dbp
,

2437 
vdp
, 
h
, 
cut
, 
ags
 | 
DB_NOORDERCHK
)) != 0) {

2438 
r_t
 = 
t
;

2439 
r
;

2441 i(
	`TYPE
(
h
=
P_IBTREE
) {

2442 
bi
 = 
	`GET_BINTERNAL
(
dbp
, 
h
, 0);

2443 
cut
 = 
bi
->
pgno
;

2445 
ri
 = 
	`GET_RINTERNAL
(
dbp
, 
h
, 0);

2446 
cut
 = 
ri
->
pgno
;

2449 
P_LBTREE
:

2450 
P_LRECNO
:

2451 
av
;

2453 
r_t
 = 
DB_VERIFY_BAD
;

2454 
r
;

2457 i((
t
 = 
	`__memp_ut
(
mpf
,

2458 
vdp
->
thad_fo
, 
h
, 
DB_PRIORITY_UNCHANGED
)) != 0)

2459 
r_t
 = 
t
;

2460 
h
 = 
NULL
;

2467 
av
:

2468 
	`IS_VALID_PGNO
(
cut
&& cu!
PGNO_INVALID
) {

2469 i(
h
 =
NULL
 && (
t
 = 
	`__memp_fg
(
mpf
,

2470 &
cut
, 
vdp
->
thad_fo
, 
NULL
, 0, &
h
)) != 0) {

2471 
r_t
 = 
t
;

2475 i((
t
 = 
	`__db_vrfy_pgt_g
(
pgt
,

2476 
vdp
->
thad_fo
, 
cut
, (*)&
p
)) != 0)

2477 
r
;

2479 i(
p
 != 0) {

2487 i((
t
 =

2488 
	`__db_vrfy_pgt_c
(
pgt
, 
vdp
->
thad_fo
, 
cut
)) != 0)

2489 
r
;

2491 
cut
 = 
	`NEXT_PGNO
(
h
);

2492 i((
t
 = 
	`__memp_ut
(
mpf
,

2493 
vdp
->
thad_fo
, 
h
, 
DB_PRIORITY_UNCHANGED
)) != 0)

2494 
r_t
 = 
t
;

2495 
h
 = 
NULL
;

2498 
r
: i(
h
 !
NULL
)

2499 ()
	`__memp_ut
(
mpf
,

2500 
vdp
->
thad_fo
, 
h
, 
DB_PRIORITY_UNCHANGED
);

2502  (
t
 =0 ? 
r_t
 :et);

2503 
	}
}

2514 
	$__bam__gda
(
dbp
, 

, 
h
, 
i
, 
ovok
, 
dbt
, 
db
)

2515 
DB
 *
dbp
;

2516 
DB_THREAD_INFO
 *

;

2517 
PAGE
 *
h
;

2518 
u_t32_t
 
i
;

2519 
ovok
;

2520 
DBT
 *
dbt
;

2521 *
db
;

2523 
BKEYDATA
 *
bk
;

2524 
BOVERFLOW
 *
bo
;

2526 
	`memt
(
dbt
, 0, (
DBT
));

2527 *
db
 = 0;

2529 
bk
 = 
	`GET_BKEYDATA
(
dbp
, 
h
, 
i
);

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

2531 i(!
ovok
)

2534 
bo
 = (
BOVERFLOW
 *)
bk
;

2535 
	`F_SET
(
dbt
, 
DB_DBT_MALLOC
);

2537 *
db
 = 1;

2538  (
	`__db_goff
(
dbp
, 

, 
NULL
, 
dbt
,

2539 
bo
->

, bo->
pgno
, 
NULL
, NULL));

2541 
dbt
->
da
 = 
bk
->data;

2542 
dbt
->
size
 = 
bk
->
n
;

2546 
	}
}

	@../btree/btree_auto.c

3 
	~"db_cfig.h
"

4 
	~"db_t.h
"

5 
	~"dbc/yo.h
"

6 
	~"dbc/db_ge.h
"

7 
	~"dbc/db_am.h
"

8 
	~"dbc/b.h
"

9 
	~"dbc/log.h
"

10 
	~"dbc/txn.h
"

17 
	$__bam_l_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

18 
ENV
 *
v
;

19 
DB
 **
db
;

20 *
td
;

21 *
cbuf
;

22 
__bam_l_gs
 **
g
;

24 
__bam_l_gs
 *
gp
;

25 
u_t32_t
 
ump
;

26 
u_t8_t
 *
bp
;

27 
t
;

29 i((
t
 = 
	`__os_mloc
(
v
,

30 (
__bam_l_gs
+ (
DB_TXN
), &
gp
)) != 0)

31  (
t
);

32 
bp
 = 
cbuf
;

33 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

34 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

36 
gp
->
tx
->
td
 =d;

37 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

38 
bp
 +(
gp
->
ty
);

40 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

41 
bp
 +(
gp
->
tx
->
txnid
);

43 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

44 
bp
 +(
DB_LSN
);

46 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

47 
gp
->
feid
 = (
t32_t
)
ump
;

48 
bp
 +(
ump
);

49 i(
db
 !
NULL
) {

50 *
db
 = 
NULL
;

51 
t
 = 
	`__dbg_id_to_db
(

52 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

55 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

56 
gp
->

 = (
db_pgno_t
)
ump
;

57 
bp
 +(
ump
);

59 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
΢
, 
bp
);

60 
bp
 +(
DB_LSN
);

62 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

63 
gp
->
right
 = (
db_pgno_t
)
ump
;

64 
bp
 +(
ump
);

66 
	`LOGCOPY_TOLSN
(
v
, &
gp
->

, 
bp
);

67 
bp
 +(
DB_LSN
);

69 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

70 
bp
 +(
gp
->
dx
);

72 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

73 
gp
->
gno
 = (
db_pgno_t
)
ump
;

74 
bp
 +(
ump
);

76 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
Ƣ
, 
bp
);

77 
bp
 +(
DB_LSN
);

79 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

80 
gp
->
ro_pgno
 = (
db_pgno_t
)
ump
;

81 
bp
 +(
ump
);

83 
	`memt
(&
gp
->
pg
, 0, (argp->pg));

84 
	`LOGCOPY_32
(
v
,&
gp
->
pg
.
size
, 
bp
);

85 
bp
 +(
u_t32_t
);

86 
gp
->
pg
.
da
 = 
bp
;

87 
bp
 +
gp
->
pg
.
size
;

88 i(
	`LOG_SWAPPED
(
v
&& 
db
 !
NULL
 && *dbpp != NULL) {

89 
t_t
;

90 i((
t_t
 = 
	`__db_gesw
(*
db
, (
PAGE
 *)
gp
->
pg
.
da
,

91 (
size_t
)
gp
->
pg
.
size
, 
NULL
, 1)) != 0)

92  (
t_t
);

95 
	`LOGCOPY_32
(
v
, &
gp
->
ags
, 
bp
);

96 
bp
 +(
gp
->
ags
);

98 *
g
 = 
gp
;

99  (
t
);

100 
	}
}

108 
	$__bam_l_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 

, 
΢
, 
right
, 

, 
dx
,

109 
gno
, 
Ƣ
, 
ro_pgno
, 
pg
, 
ags
)

110 
DB
 *
dbp
;

111 
DB_TXN
 *
tx
;

112 
DB_LSN
 *
t_lp
;

113 
u_t32_t
 
ags
;

114 
db_pgno_t
 

;

115 
DB_LSN
 * 
΢
;

116 
db_pgno_t
 
right
;

117 
DB_LSN
 * 

;

118 
u_t32_t
 
dx
;

119 
db_pgno_t
 
gno
;

120 
DB_LSN
 * 
Ƣ
;

121 
db_pgno_t
 
ro_pgno
;

122 cڡ 
DBT
 *
pg
;

123 
u_t32_t
 
ags
;

125 
DBT
 
logc
;

126 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

127 
DB_TXNLOGREC
 *

;

128 
ENV
 *
v
;

129 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

130 
u_t
 
ad
;

131 
u_t8_t
 *
bp
;

132 
is_dub
, 
t
;

134 
	`COMPQUIET
(

, 
NULL
);

136 
v
 = 
dbp
->env;

137 
p
 = 
t_lp
;

138 
y
 = 
DB___bam_l
;

139 
ad
 = 0;

140 
t
 = 0;

142 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

143 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

144 i(
tx
 =
NULL
)

146 
is_dub
 = 0;

148 
is_dub
 = 1;

150 i(
tx
 =
NULL
) {

151 
txn_num
 = 0;

152 
lp
 = &
nu_l
;

153 
nu_l
.
fe
 =u_l.
offt
 = 0;

155 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

156 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

157  (
t
);

164 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

165 
txn_num
 = 
tx
->
txnid
;

168 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

169 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

170 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

171  (
t
);

173 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

174 + (
u_t32_t
)

175 + (
u_t32_t
)

176 + (*
΢
)

177 + (
u_t32_t
)

178 + (*

)

179 + (
u_t32_t
)

180 + (
u_t32_t
)

181 + (*
Ƣ
)

182 + (
u_t32_t
)

183 + (
u_t32_t
+ (
pg
 =
NULL
 ? 0 :g->
size
)

184 + (
u_t32_t
);

185 i(
	`CRYPTO_ON
(
v
)) {

186 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

187 
logc
.
size
 +
ad
;

190 i(
is_dub
 || 
tx
 =
NULL
) {

191 i((
t
 =

192 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

193  (
t
);

195 i((
t
 = 
	`__os_mloc
(
v
,

196 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

197  (
t
);

198 #ifde
DIAGNOSTIC


199 i((
t
 =

200 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

201 
	`__os_
(
v
, 

);

202  (
t
);

205 
logc
.
da
 = 

->data;

208 i(
ad
 > 0)

209 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

211 
bp
 = 
logc
.
da
;

213 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

214 
bp
 +(
y
);

216 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

217 
bp
 +(
txn_num
);

219 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

220 
bp
 +(
DB_LSN
);

222 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

223 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

224 
bp
 +(
ump
);

226 
ump
 = (
u_t32_t
)

;

227 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

228 
bp
 +(
ump
);

230 i(
΢
 !
NULL
) {

231 i(
tx
 !
NULL
) {

232 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

233 i(
	`LOG_COMPARE
(
΢
, &

->
l
>0 && (
t
 =

234 
	`__log_check_ge_l
(
v
, 
dbp
, 
΢
) != 0))

235  (
t
);

237 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
΢
);

239 
	`memt
(
bp
, 0, (*
΢
));

240 
bp
 +(*
΢
);

242 
ump
 = (
u_t32_t
)
right
;

243 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

244 
bp
 +(
ump
);

246 i(

 !
NULL
) {

247 i(
tx
 !
NULL
) {

248 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

249 i(
	`LOG_COMPARE
(

, &

->
l
>0 && (
t
 =

250 
	`__log_check_ge_l
(
v
, 
dbp
, 

) != 0))

251  (
t
);

253 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 

);

255 
	`memt
(
bp
, 0, (*

));

256 
bp
 +(*

);

258 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

259 
bp
 +(
dx
);

261 
ump
 = (
u_t32_t
)
gno
;

262 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

263 
bp
 +(
ump
);

265 i(
Ƣ
 !
NULL
) {

266 i(
tx
 !
NULL
) {

267 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

268 i(
	`LOG_COMPARE
(
Ƣ
, &

->
l
>0 && (
t
 =

269 
	`__log_check_ge_l
(
v
, 
dbp
, 
Ƣ
) != 0))

270  (
t
);

272 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
Ƣ
);

274 
	`memt
(
bp
, 0, (*
Ƣ
));

275 
bp
 +(*
Ƣ
);

277 
ump
 = (
u_t32_t
)
ro_pgno
;

278 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

279 
bp
 +(
ump
);

281 i(
pg
 =
NULL
) {

282 
zo
 = 0;

283 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

284 
bp
 +(
u_t32_t
);

286 
	`LOGCOPY_32
(
v
, 
bp
, &
pg
->
size
);

287 
bp
 +(
pg
->
size
);

288 
	`memy
(
bp
, 
pg
->
da
,g->
size
);

289 i(
	`LOG_SWAPPED
(
v
))

290 i((
t
 = 
	`__db_gesw
(
dbp
,

291 (
PAGE
 *)
bp
, (
size_t
)
pg
->
size
, (
DBT
 *)
NULL
, 0)) != 0)

292  (
t
);

293 
bp
 +
pg
->
size
;

296 
	`LOGCOPY_32
(
v
, 
bp
, &
ags
);

297 
bp
 +(
ags
);

299 
	`DB_ASSERT
(
v
,

300 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

302 i(
is_dub
 || 
tx
 =
NULL
) {

303 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

304 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

305 *
lp
 = *
p
;

306 i(
p
 !
t_lp
)

307 *
t_lp
 = *
p
;

310 
t
 = 0;

311 #ifde
DIAGNOSTIC


316 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

317 
y
 |
DB_debug_FLAG
;

318 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

320 i(!
	`IS_REP_CLIENT
(
v
))

321 
t
 = 
	`__log_put
(
v
,

322 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

324 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

325 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

326 
	`LSN_NOT_LOGGED
(*
t_lp
);

329 #ifde
LOG_DIAGNOSTIC


330 i(
t
 != 0)

331 ()
	`__bam_l_t
(
v
,

332 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

335 #ifde
DIAGNOSTIC


336 
	`__os_
(
v
, 
logc
.
da
);

338 i(
is_dub
 || 
tx
 =
NULL
)

339 
	`__os_
(
v
, 
logc
.
da
);

341  (
t
);

342 
	}
}

349 
	$__bam_rl_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

350 
ENV
 *
v
;

351 
DB
 **
db
;

352 *
td
;

353 *
cbuf
;

354 
__bam_rl_gs
 **
g
;

356 
__bam_rl_gs
 *
gp
;

357 
u_t32_t
 
ump
;

358 
u_t8_t
 *
bp
;

359 
t
;

361 i((
t
 = 
	`__os_mloc
(
v
,

362 (
__bam_rl_gs
+ (
DB_TXN
), &
gp
)) != 0)

363  (
t
);

364 
bp
 = 
cbuf
;

365 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

366 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

368 
gp
->
tx
->
td
 =d;

369 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

370 
bp
 +(
gp
->
ty
);

372 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

373 
bp
 +(
gp
->
tx
->
txnid
);

375 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

376 
bp
 +(
DB_LSN
);

378 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

379 
gp
->
feid
 = (
t32_t
)
ump
;

380 
bp
 +(
ump
);

381 i(
db
 !
NULL
) {

382 *
db
 = 
NULL
;

383 
t
 = 
	`__dbg_id_to_db
(

384 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

387 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

388 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

389 
bp
 +(
ump
);

391 
	`memt
(&
gp
->
pgdbt
, 0, (argp->pgdbt));

392 
	`LOGCOPY_32
(
v
,&
gp
->
pgdbt
.
size
, 
bp
);

393 
bp
 +(
u_t32_t
);

394 
gp
->
pgdbt
.
da
 = 
bp
;

395 
bp
 +
gp
->
pgdbt
.
size
;

396 i(
	`LOG_SWAPPED
(
v
&& 
db
 !
NULL
 && *dbpp != NULL) {

397 
t_t
;

398 i((
t_t
 = 
	`__db_gesw
(*
db
, (
PAGE
 *)
gp
->
pgdbt
.
da
,

399 (
size_t
)
gp
->
pgdbt
.
size
, 
NULL
, 1)) != 0)

400  (
t_t
);

403 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

404 
gp
->
ro_pgno
 = (
db_pgno_t
)
ump
;

405 
bp
 +(
ump
);

407 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

408 
gp
->
ec
 = (
db_pgno_t
)
ump
;

409 
bp
 +(
ump
);

411 
	`memt
(&
gp
->
roْt
, 0, (argp->rootent));

412 
	`LOGCOPY_32
(
v
,&
gp
->
roْt
.
size
, 
bp
);

413 
bp
 +(
u_t32_t
);

414 
gp
->
roْt
.
da
 = 
bp
;

415 
bp
 +
gp
->
roْt
.
size
;

417 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
rol
, 
bp
);

418 
bp
 +(
DB_LSN
);

420 *
g
 = 
gp
;

421  (
t
);

422 
	}
}

430 
	$__bam_rl_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
pgdbt
, 
ro_pgno
, 
ec
, 
roْt
,

431 
rol
)

432 
DB
 *
dbp
;

433 
DB_TXN
 *
tx
;

434 
DB_LSN
 *
t_lp
;

435 
u_t32_t
 
ags
;

436 
db_pgno_t
 
pgno
;

437 cڡ 
DBT
 *
pgdbt
;

438 
db_pgno_t
 
ro_pgno
;

439 
db_pgno_t
 
ec
;

440 cڡ 
DBT
 *
roْt
;

441 
DB_LSN
 * 
rol
;

443 
DBT
 
logc
;

444 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

445 
DB_TXNLOGREC
 *

;

446 
ENV
 *
v
;

447 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

448 
u_t
 
ad
;

449 
u_t8_t
 *
bp
;

450 
is_dub
, 
t
;

452 
	`COMPQUIET
(

, 
NULL
);

454 
v
 = 
dbp
->env;

455 
p
 = 
t_lp
;

456 
y
 = 
DB___bam_rl
;

457 
ad
 = 0;

458 
t
 = 0;

460 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

461 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

462 i(
tx
 =
NULL
)

464 
is_dub
 = 0;

466 
is_dub
 = 1;

468 i(
tx
 =
NULL
) {

469 
txn_num
 = 0;

470 
lp
 = &
nu_l
;

471 
nu_l
.
fe
 =u_l.
offt
 = 0;

473 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

474 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

475  (
t
);

482 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

483 
txn_num
 = 
tx
->
txnid
;

486 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

487 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

488 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

489  (
t
);

491 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

492 + (
u_t32_t
)

493 + (
u_t32_t
)

494 + (
u_t32_t
+ (
pgdbt
 =
NULL
 ? 0 :gdbt->
size
)

495 + (
u_t32_t
)

496 + (
u_t32_t
)

497 + (
u_t32_t
+ (
roْt
 =
NULL
 ? 0 :oْt->
size
)

498 + (*
rol
);

499 i(
	`CRYPTO_ON
(
v
)) {

500 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

501 
logc
.
size
 +
ad
;

504 i(
is_dub
 || 
tx
 =
NULL
) {

505 i((
t
 =

506 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

507  (
t
);

509 i((
t
 = 
	`__os_mloc
(
v
,

510 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

511  (
t
);

512 #ifde
DIAGNOSTIC


513 i((
t
 =

514 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

515 
	`__os_
(
v
, 

);

516  (
t
);

519 
logc
.
da
 = 

->data;

522 i(
ad
 > 0)

523 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

525 
bp
 = 
logc
.
da
;

527 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

528 
bp
 +(
y
);

530 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

531 
bp
 +(
txn_num
);

533 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

534 
bp
 +(
DB_LSN
);

536 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

537 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

538 
bp
 +(
ump
);

540 
ump
 = (
u_t32_t
)
pgno
;

541 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

542 
bp
 +(
ump
);

544 i(
pgdbt
 =
NULL
) {

545 
zo
 = 0;

546 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

547 
bp
 +(
u_t32_t
);

549 
	`LOGCOPY_32
(
v
, 
bp
, &
pgdbt
->
size
);

550 
bp
 +(
pgdbt
->
size
);

551 
	`memy
(
bp
, 
pgdbt
->
da
,gdbt->
size
);

552 i(
	`LOG_SWAPPED
(
v
))

553 i((
t
 = 
	`__db_gesw
(
dbp
,

554 (
PAGE
 *)
bp
, (
size_t
)
pgdbt
->
size
, (
DBT
 *)
NULL
, 0)) != 0)

555  (
t
);

556 
bp
 +
pgdbt
->
size
;

559 
ump
 = (
u_t32_t
)
ro_pgno
;

560 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

561 
bp
 +(
ump
);

563 
ump
 = (
u_t32_t
)
ec
;

564 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

565 
bp
 +(
ump
);

567 i(
roْt
 =
NULL
) {

568 
zo
 = 0;

569 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

570 
bp
 +(
u_t32_t
);

572 
	`LOGCOPY_32
(
v
, 
bp
, &
roْt
->
size
);

573 
bp
 +(
roْt
->
size
);

574 
	`memy
(
bp
, 
roْt
->
da
,oْt->
size
);

575 
bp
 +
roْt
->
size
;

578 i(
rol
 !
NULL
) {

579 i(
tx
 !
NULL
) {

580 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

581 i(
	`LOG_COMPARE
(
rol
, &

->
l
>0 && (
t
 =

582 
	`__log_check_ge_l
(
v
, 
dbp
, 
rol
) != 0))

583  (
t
);

585 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
rol
);

587 
	`memt
(
bp
, 0, (*
rol
));

588 
bp
 +(*
rol
);

590 
	`DB_ASSERT
(
v
,

591 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

593 i(
is_dub
 || 
tx
 =
NULL
) {

594 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

595 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

596 *
lp
 = *
p
;

597 i(
p
 !
t_lp
)

598 *
t_lp
 = *
p
;

601 
t
 = 0;

602 #ifde
DIAGNOSTIC


607 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

608 
y
 |
DB_debug_FLAG
;

609 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

611 i(!
	`IS_REP_CLIENT
(
v
))

612 
t
 = 
	`__log_put
(
v
,

613 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

615 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

616 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

617 
	`LSN_NOT_LOGGED
(*
t_lp
);

620 #ifde
LOG_DIAGNOSTIC


621 i(
t
 != 0)

622 ()
	`__bam_rl_t
(
v
,

623 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

626 #ifde
DIAGNOSTIC


627 
	`__os_
(
v
, 
logc
.
da
);

629 i(
is_dub
 || 
tx
 =
NULL
)

630 
	`__os_
(
v
, 
logc
.
da
);

632  (
t
);

633 
	}
}

640 
	$__bam_adj_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

641 
ENV
 *
v
;

642 
DB
 **
db
;

643 *
td
;

644 *
cbuf
;

645 
__bam_adj_gs
 **
g
;

647 
__bam_adj_gs
 *
gp
;

648 
u_t32_t
 
ump
;

649 
u_t8_t
 *
bp
;

650 
t
;

652 i((
t
 = 
	`__os_mloc
(
v
,

653 (
__bam_adj_gs
+ (
DB_TXN
), &
gp
)) != 0)

654  (
t
);

655 
bp
 = 
cbuf
;

656 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

657 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

659 
gp
->
tx
->
td
 =d;

660 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

661 
bp
 +(
gp
->
ty
);

663 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

664 
bp
 +(
gp
->
tx
->
txnid
);

666 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

667 
bp
 +(
DB_LSN
);

669 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

670 
gp
->
feid
 = (
t32_t
)
ump
;

671 
bp
 +(
ump
);

672 i(
db
 !
NULL
) {

673 *
db
 = 
NULL
;

674 
t
 = 
	`__dbg_id_to_db
(

675 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

678 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

679 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

680 
bp
 +(
ump
);

682 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

683 
bp
 +(
DB_LSN
);

685 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

686 
bp
 +(
gp
->
dx
);

688 
	`LOGCOPY_32
(
v
, &
gp
->
dx_cy
, 
bp
);

689 
bp
 +(
gp
->
dx_cy
);

691 
	`LOGCOPY_32
(
v
, &
gp
->
is_
, 
bp
);

692 
bp
 +(
gp
->
is_
);

694 *
g
 = 
gp
;

695  (
t
);

696 
	}
}

704 
	$__bam_adj_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
dx_cy
, 
is_
)

705 
DB
 *
dbp
;

706 
DB_TXN
 *
tx
;

707 
DB_LSN
 *
t_lp
;

708 
u_t32_t
 
ags
;

709 
db_pgno_t
 
pgno
;

710 
DB_LSN
 * 
l
;

711 
u_t32_t
 
dx
;

712 
u_t32_t
 
dx_cy
;

713 
u_t32_t
 
is_
;

715 
DBT
 
logc
;

716 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

717 
DB_TXNLOGREC
 *

;

718 
ENV
 *
v
;

719 
u_t32_t
 
ump
, 
y
, 
txn_num
;

720 
u_t
 
ad
;

721 
u_t8_t
 *
bp
;

722 
is_dub
, 
t
;

724 
	`COMPQUIET
(

, 
NULL
);

726 
v
 = 
dbp
->env;

727 
p
 = 
t_lp
;

728 
y
 = 
DB___bam_adj
;

729 
ad
 = 0;

730 
t
 = 0;

732 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

733 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

734 i(
tx
 =
NULL
)

736 
is_dub
 = 0;

738 
is_dub
 = 1;

740 i(
tx
 =
NULL
) {

741 
txn_num
 = 0;

742 
lp
 = &
nu_l
;

743 
nu_l
.
fe
 =u_l.
offt
 = 0;

745 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

746 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

747  (
t
);

754 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

755 
txn_num
 = 
tx
->
txnid
;

758 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

759 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

760 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

761  (
t
);

763 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

764 + (
u_t32_t
)

765 + (
u_t32_t
)

766 + (*
l
)

767 + (
u_t32_t
)

768 + (
u_t32_t
)

769 + (
u_t32_t
);

770 i(
	`CRYPTO_ON
(
v
)) {

771 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

772 
logc
.
size
 +
ad
;

775 i(
is_dub
 || 
tx
 =
NULL
) {

776 i((
t
 =

777 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

778  (
t
);

780 i((
t
 = 
	`__os_mloc
(
v
,

781 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

782  (
t
);

783 #ifde
DIAGNOSTIC


784 i((
t
 =

785 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

786 
	`__os_
(
v
, 

);

787  (
t
);

790 
logc
.
da
 = 

->data;

793 i(
ad
 > 0)

794 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

796 
bp
 = 
logc
.
da
;

798 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

799 
bp
 +(
y
);

801 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

802 
bp
 +(
txn_num
);

804 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

805 
bp
 +(
DB_LSN
);

807 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

808 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

809 
bp
 +(
ump
);

811 
ump
 = (
u_t32_t
)
pgno
;

812 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

813 
bp
 +(
ump
);

815 i(
l
 !
NULL
) {

816 i(
tx
 !
NULL
) {

817 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

818 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

819 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

820  (
t
);

822 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

824 
	`memt
(
bp
, 0, (*
l
));

825 
bp
 +(*
l
);

827 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

828 
bp
 +(
dx
);

830 
	`LOGCOPY_32
(
v
, 
bp
, &
dx_cy
);

831 
bp
 +(
dx_cy
);

833 
	`LOGCOPY_32
(
v
, 
bp
, &
is_
);

834 
bp
 +(
is_
);

836 
	`DB_ASSERT
(
v
,

837 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

839 i(
is_dub
 || 
tx
 =
NULL
) {

840 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

841 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

842 *
lp
 = *
p
;

843 i(
p
 !
t_lp
)

844 *
t_lp
 = *
p
;

847 
t
 = 0;

848 #ifde
DIAGNOSTIC


853 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

854 
y
 |
DB_debug_FLAG
;

855 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

857 i(!
	`IS_REP_CLIENT
(
v
))

858 
t
 = 
	`__log_put
(
v
,

859 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

861 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

862 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

863 
	`LSN_NOT_LOGGED
(*
t_lp
);

866 #ifde
LOG_DIAGNOSTIC


867 i(
t
 != 0)

868 ()
	`__bam_adj_t
(
v
,

869 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

872 #ifde
DIAGNOSTIC


873 
	`__os_
(
v
, 
logc
.
da
);

875 i(
is_dub
 || 
tx
 =
NULL
)

876 
	`__os_
(
v
, 
logc
.
da
);

878  (
t
);

879 
	}
}

886 
	$__bam_dju_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

887 
ENV
 *
v
;

888 
DB
 **
db
;

889 *
td
;

890 *
cbuf
;

891 
__bam_dju_gs
 **
g
;

893 
__bam_dju_gs
 *
gp
;

894 
u_t32_t
 
ump
;

895 
u_t8_t
 *
bp
;

896 
t
;

898 i((
t
 = 
	`__os_mloc
(
v
,

899 (
__bam_dju_gs
+ (
DB_TXN
), &
gp
)) != 0)

900  (
t
);

901 
bp
 = 
cbuf
;

902 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

903 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

905 
gp
->
tx
->
td
 =d;

906 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

907 
bp
 +(
gp
->
ty
);

909 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

910 
bp
 +(
gp
->
tx
->
txnid
);

912 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

913 
bp
 +(
DB_LSN
);

915 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

916 
gp
->
feid
 = (
t32_t
)
ump
;

917 
bp
 +(
ump
);

918 i(
db
 !
NULL
) {

919 *
db
 = 
NULL
;

920 
t
 = 
	`__dbg_id_to_db
(

921 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

924 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

925 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

926 
bp
 +(
ump
);

928 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

929 
bp
 +(
DB_LSN
);

931 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

932 
bp
 +(
gp
->
dx
);

934 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

935 
gp
->
adju
 = (
t32_t
)
ump
;

936 
bp
 +(
ump
);

938 
	`LOGCOPY_32
(
v
, &
gp
->
ags
, 
bp
);

939 
bp
 +(
gp
->
ags
);

941 *
g
 = 
gp
;

942  (
t
);

943 
	}
}

950 
	$__bam_dju_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
adju
, 
ags
)

951 
DB
 *
dbp
;

952 
DB_TXN
 *
tx
;

953 
DB_LSN
 *
t_lp
;

954 
u_t32_t
 
ags
;

955 
db_pgno_t
 
pgno
;

956 
DB_LSN
 * 
l
;

957 
u_t32_t
 
dx
;

958 
t32_t
 
adju
;

959 
u_t32_t
 
ags
;

961 
DBT
 
logc
;

962 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

963 
DB_TXNLOGREC
 *

;

964 
ENV
 *
v
;

965 
u_t32_t
 
ump
, 
y
, 
txn_num
;

966 
u_t
 
ad
;

967 
u_t8_t
 *
bp
;

968 
is_dub
, 
t
;

970 
	`COMPQUIET
(

, 
NULL
);

972 
v
 = 
dbp
->env;

973 
p
 = 
t_lp
;

974 
y
 = 
DB___bam_dju
;

975 
ad
 = 0;

976 
t
 = 0;

978 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

979 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

980 i(
tx
 =
NULL
)

982 
is_dub
 = 0;

984 
is_dub
 = 1;

986 i(
tx
 =
NULL
) {

987 
txn_num
 = 0;

988 
lp
 = &
nu_l
;

989 
nu_l
.
fe
 =u_l.
offt
 = 0;

991 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

992 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

993  (
t
);

1000 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1001 
txn_num
 = 
tx
->
txnid
;

1004 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1005 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1006 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1007  (
t
);

1009 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1010 + (
u_t32_t
)

1011 + (
u_t32_t
)

1012 + (*
l
)

1013 + (
u_t32_t
)

1014 + (
u_t32_t
)

1015 + (
u_t32_t
);

1016 i(
	`CRYPTO_ON
(
v
)) {

1017 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1018 
logc
.
size
 +
ad
;

1021 i(
is_dub
 || 
tx
 =
NULL
) {

1022 i((
t
 =

1023 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1024  (
t
);

1026 i((
t
 = 
	`__os_mloc
(
v
,

1027 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1028  (
t
);

1029 #ifde
DIAGNOSTIC


1030 i((
t
 =

1031 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1032 
	`__os_
(
v
, 

);

1033  (
t
);

1036 
logc
.
da
 = 

->data;

1039 i(
ad
 > 0)

1040 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1042 
bp
 = 
logc
.
da
;

1044 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1045 
bp
 +(
y
);

1047 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1048 
bp
 +(
txn_num
);

1050 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1051 
bp
 +(
DB_LSN
);

1053 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1054 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1055 
bp
 +(
ump
);

1057 
ump
 = (
u_t32_t
)
pgno
;

1058 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1059 
bp
 +(
ump
);

1061 i(
l
 !
NULL
) {

1062 i(
tx
 !
NULL
) {

1063 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1064 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

1065 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

1066  (
t
);

1068 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

1070 
	`memt
(
bp
, 0, (*
l
));

1071 
bp
 +(*
l
);

1073 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

1074 
bp
 +(
dx
);

1076 
ump
 = (
u_t32_t
)
adju
;

1077 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1078 
bp
 +(
ump
);

1080 
	`LOGCOPY_32
(
v
, 
bp
, &
ags
);

1081 
bp
 +(
ags
);

1083 
	`DB_ASSERT
(
v
,

1084 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1086 i(
is_dub
 || 
tx
 =
NULL
) {

1087 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1088 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1089 *
lp
 = *
p
;

1090 i(
p
 !
t_lp
)

1091 *
t_lp
 = *
p
;

1094 
t
 = 0;

1095 #ifde
DIAGNOSTIC


1100 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1101 
y
 |
DB_debug_FLAG
;

1102 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1104 i(!
	`IS_REP_CLIENT
(
v
))

1105 
t
 = 
	`__log_put
(
v
,

1106 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1108 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1109 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1110 
	`LSN_NOT_LOGGED
(*
t_lp
);

1113 #ifde
LOG_DIAGNOSTIC


1114 i(
t
 != 0)

1115 ()
	`__bam_dju_t
(
v
,

1116 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1119 #ifde
DIAGNOSTIC


1120 
	`__os_
(
v
, 
logc
.
da
);

1122 i(
is_dub
 || 
tx
 =
NULL
)

1123 
	`__os_
(
v
, 
logc
.
da
);

1125  (
t
);

1126 
	}
}

1133 
	$__bam_cd_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1134 
ENV
 *
v
;

1135 
DB
 **
db
;

1136 *
td
;

1137 *
cbuf
;

1138 
__bam_cd_gs
 **
g
;

1140 
__bam_cd_gs
 *
gp
;

1141 
u_t32_t
 
ump
;

1142 
u_t8_t
 *
bp
;

1143 
t
;

1145 i((
t
 = 
	`__os_mloc
(
v
,

1146 (
__bam_cd_gs
+ (
DB_TXN
), &
gp
)) != 0)

1147  (
t
);

1148 
bp
 = 
cbuf
;

1149 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1150 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1152 
gp
->
tx
->
td
 =d;

1153 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1154 
bp
 +(
gp
->
ty
);

1156 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1157 
bp
 +(
gp
->
tx
->
txnid
);

1159 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1160 
bp
 +(
DB_LSN
);

1162 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1163 
gp
->
feid
 = (
t32_t
)
ump
;

1164 
bp
 +(
ump
);

1165 i(
db
 !
NULL
) {

1166 *
db
 = 
NULL
;

1167 
t
 = 
	`__dbg_id_to_db
(

1168 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1171 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1172 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1173 
bp
 +(
ump
);

1175 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

1176 
bp
 +(
DB_LSN
);

1178 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

1179 
bp
 +(
gp
->
dx
);

1181 *
g
 = 
gp
;

1182  (
t
);

1183 
	}
}

1190 
	$__bam_cd_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
)

1191 
DB
 *
dbp
;

1192 
DB_TXN
 *
tx
;

1193 
DB_LSN
 *
t_lp
;

1194 
u_t32_t
 
ags
;

1195 
db_pgno_t
 
pgno
;

1196 
DB_LSN
 * 
l
;

1197 
u_t32_t
 
dx
;

1199 
DBT
 
logc
;

1200 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1201 
DB_TXNLOGREC
 *

;

1202 
ENV
 *
v
;

1203 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1204 
u_t
 
ad
;

1205 
u_t8_t
 *
bp
;

1206 
is_dub
, 
t
;

1208 
	`COMPQUIET
(

, 
NULL
);

1210 
v
 = 
dbp
->env;

1211 
p
 = 
t_lp
;

1212 
y
 = 
DB___bam_cd
;

1213 
ad
 = 0;

1214 
t
 = 0;

1216 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1217 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1218 i(
tx
 =
NULL
)

1220 
is_dub
 = 0;

1222 
is_dub
 = 1;

1224 i(
tx
 =
NULL
) {

1225 
txn_num
 = 0;

1226 
lp
 = &
nu_l
;

1227 
nu_l
.
fe
 =u_l.
offt
 = 0;

1229 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1230 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

1231  (
t
);

1238 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1239 
txn_num
 = 
tx
->
txnid
;

1242 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1243 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1244 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1245  (
t
);

1247 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1248 + (
u_t32_t
)

1249 + (
u_t32_t
)

1250 + (*
l
)

1251 + (
u_t32_t
);

1252 i(
	`CRYPTO_ON
(
v
)) {

1253 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1254 
logc
.
size
 +
ad
;

1257 i(
is_dub
 || 
tx
 =
NULL
) {

1258 i((
t
 =

1259 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1260  (
t
);

1262 i((
t
 = 
	`__os_mloc
(
v
,

1263 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1264  (
t
);

1265 #ifde
DIAGNOSTIC


1266 i((
t
 =

1267 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1268 
	`__os_
(
v
, 

);

1269  (
t
);

1272 
logc
.
da
 = 

->data;

1275 i(
ad
 > 0)

1276 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1278 
bp
 = 
logc
.
da
;

1280 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1281 
bp
 +(
y
);

1283 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1284 
bp
 +(
txn_num
);

1286 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1287 
bp
 +(
DB_LSN
);

1289 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1290 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1291 
bp
 +(
ump
);

1293 
ump
 = (
u_t32_t
)
pgno
;

1294 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1295 
bp
 +(
ump
);

1297 i(
l
 !
NULL
) {

1298 i(
tx
 !
NULL
) {

1299 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1300 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

1301 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

1302  (
t
);

1304 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

1306 
	`memt
(
bp
, 0, (*
l
));

1307 
bp
 +(*
l
);

1309 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

1310 
bp
 +(
dx
);

1312 
	`DB_ASSERT
(
v
,

1313 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1315 i(
is_dub
 || 
tx
 =
NULL
) {

1316 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1317 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1318 *
lp
 = *
p
;

1319 i(
p
 !
t_lp
)

1320 *
t_lp
 = *
p
;

1323 
t
 = 0;

1324 #ifde
DIAGNOSTIC


1329 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1330 
y
 |
DB_debug_FLAG
;

1331 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1333 i(!
	`IS_REP_CLIENT
(
v
))

1334 
t
 = 
	`__log_put
(
v
,

1335 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1337 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1338 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1339 
	`LSN_NOT_LOGGED
(*
t_lp
);

1342 #ifde
LOG_DIAGNOSTIC


1343 i(
t
 != 0)

1344 ()
	`__bam_cd_t
(
v
,

1345 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1348 #ifde
DIAGNOSTIC


1349 
	`__os_
(
v
, 
logc
.
da
);

1351 i(
is_dub
 || 
tx
 =
NULL
)

1352 
	`__os_
(
v
, 
logc
.
da
);

1354  (
t
);

1355 
	}
}

1362 
	$__bam__ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1363 
ENV
 *
v
;

1364 
DB
 **
db
;

1365 *
td
;

1366 *
cbuf
;

1367 
__bam__gs
 **
g
;

1369 
__bam__gs
 *
gp
;

1370 
u_t32_t
 
ump
;

1371 
u_t8_t
 *
bp
;

1372 
t
;

1374 i((
t
 = 
	`__os_mloc
(
v
,

1375 (
__bam__gs
+ (
DB_TXN
), &
gp
)) != 0)

1376  (
t
);

1377 
bp
 = 
cbuf
;

1378 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1379 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1381 
gp
->
tx
->
td
 =d;

1382 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1383 
bp
 +(
gp
->
ty
);

1385 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1386 
bp
 +(
gp
->
tx
->
txnid
);

1388 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1389 
bp
 +(
DB_LSN
);

1391 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1392 
gp
->
feid
 = (
t32_t
)
ump
;

1393 
bp
 +(
ump
);

1394 i(
db
 !
NULL
) {

1395 *
db
 = 
NULL
;

1396 
t
 = 
	`__dbg_id_to_db
(

1397 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1400 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1401 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1402 
bp
 +(
ump
);

1404 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

1405 
bp
 +(
DB_LSN
);

1407 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

1408 
bp
 +(
gp
->
dx
);

1410 
	`LOGCOPY_32
(
v
, &
gp
->
isded
, 
bp
);

1411 
bp
 +(
gp
->
isded
);

1413 
	`memt
(&
gp
->
ig
, 0, (argp->orig));

1414 
	`LOGCOPY_32
(
v
,&
gp
->
ig
.
size
, 
bp
);

1415 
bp
 +(
u_t32_t
);

1416 
gp
->
ig
.
da
 = 
bp
;

1417 
bp
 +
gp
->
ig
.
size
;

1419 
	`memt
(&
gp
->

, 0, (argp->repl));

1420 
	`LOGCOPY_32
(
v
,&
gp
->

.
size
, 
bp
);

1421 
bp
 +(
u_t32_t
);

1422 
gp
->

.
da
 = 
bp
;

1423 
bp
 +
gp
->

.
size
;

1425 
	`LOGCOPY_32
(
v
, &
gp
->
efix
, 
bp
);

1426 
bp
 +(
gp
->
efix
);

1428 
	`LOGCOPY_32
(
v
, &
gp
->
suffix
, 
bp
);

1429 
bp
 +(
gp
->
suffix
);

1431 *
g
 = 
gp
;

1432  (
t
);

1433 
	}
}

1441 
	$__bam__log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
isded
, 
ig
,

1442 

, 
efix
, 
suffix
)

1443 
DB
 *
dbp
;

1444 
DB_TXN
 *
tx
;

1445 
DB_LSN
 *
t_lp
;

1446 
u_t32_t
 
ags
;

1447 
db_pgno_t
 
pgno
;

1448 
DB_LSN
 * 
l
;

1449 
u_t32_t
 
dx
;

1450 
u_t32_t
 
isded
;

1451 cڡ 
DBT
 *
ig
;

1452 cڡ 
DBT
 *

;

1453 
u_t32_t
 
efix
;

1454 
u_t32_t
 
suffix
;

1456 
DBT
 
logc
;

1457 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1458 
DB_TXNLOGREC
 *

;

1459 
ENV
 *
v
;

1460 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

1461 
u_t
 
ad
;

1462 
u_t8_t
 *
bp
;

1463 
is_dub
, 
t
;

1465 
	`COMPQUIET
(

, 
NULL
);

1467 
v
 = 
dbp
->env;

1468 
p
 = 
t_lp
;

1469 
y
 = 
DB___bam_
;

1470 
ad
 = 0;

1471 
t
 = 0;

1473 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1474 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1475 i(
tx
 =
NULL
)

1477 
is_dub
 = 0;

1479 
is_dub
 = 1;

1481 i(
tx
 =
NULL
) {

1482 
txn_num
 = 0;

1483 
lp
 = &
nu_l
;

1484 
nu_l
.
fe
 =u_l.
offt
 = 0;

1486 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1487 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

1488  (
t
);

1495 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1496 
txn_num
 = 
tx
->
txnid
;

1499 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1500 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1501 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1502  (
t
);

1504 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1505 + (
u_t32_t
)

1506 + (
u_t32_t
)

1507 + (*
l
)

1508 + (
u_t32_t
)

1509 + (
u_t32_t
)

1510 + (
u_t32_t
+ (
ig
 =
NULL
 ? 0 : orig->
size
)

1511 + (
u_t32_t
+ (

 =
NULL
 ? 0 :l->
size
)

1512 + (
u_t32_t
)

1513 + (
u_t32_t
);

1514 i(
	`CRYPTO_ON
(
v
)) {

1515 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1516 
logc
.
size
 +
ad
;

1519 i(
is_dub
 || 
tx
 =
NULL
) {

1520 i((
t
 =

1521 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1522  (
t
);

1524 i((
t
 = 
	`__os_mloc
(
v
,

1525 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1526  (
t
);

1527 #ifde
DIAGNOSTIC


1528 i((
t
 =

1529 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1530 
	`__os_
(
v
, 

);

1531  (
t
);

1534 
logc
.
da
 = 

->data;

1537 i(
ad
 > 0)

1538 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1540 
bp
 = 
logc
.
da
;

1542 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1543 
bp
 +(
y
);

1545 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1546 
bp
 +(
txn_num
);

1548 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1549 
bp
 +(
DB_LSN
);

1551 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1552 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1553 
bp
 +(
ump
);

1555 
ump
 = (
u_t32_t
)
pgno
;

1556 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1557 
bp
 +(
ump
);

1559 i(
l
 !
NULL
) {

1560 i(
tx
 !
NULL
) {

1561 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1562 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

1563 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

1564  (
t
);

1566 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

1568 
	`memt
(
bp
, 0, (*
l
));

1569 
bp
 +(*
l
);

1571 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

1572 
bp
 +(
dx
);

1574 
	`LOGCOPY_32
(
v
, 
bp
, &
isded
);

1575 
bp
 +(
isded
);

1577 i(
ig
 =
NULL
) {

1578 
zo
 = 0;

1579 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

1580 
bp
 +(
u_t32_t
);

1582 
	`LOGCOPY_32
(
v
, 
bp
, &
ig
->
size
);

1583 
bp
 +(
ig
->
size
);

1584 
	`memy
(
bp
, 
ig
->
da
, orig->
size
);

1585 
bp
 +
ig
->
size
;

1588 i(

 =
NULL
) {

1589 
zo
 = 0;

1590 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

1591 
bp
 +(
u_t32_t
);

1593 
	`LOGCOPY_32
(
v
, 
bp
, &

->
size
);

1594 
bp
 +(

->
size
);

1595 
	`memy
(
bp
, 

->
da
,l->
size
);

1596 
bp
 +

->
size
;

1599 
	`LOGCOPY_32
(
v
, 
bp
, &
efix
);

1600 
bp
 +(
efix
);

1602 
	`LOGCOPY_32
(
v
, 
bp
, &
suffix
);

1603 
bp
 +(
suffix
);

1605 
	`DB_ASSERT
(
v
,

1606 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1608 i(
is_dub
 || 
tx
 =
NULL
) {

1609 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1610 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1611 *
lp
 = *
p
;

1612 i(
p
 !
t_lp
)

1613 *
t_lp
 = *
p
;

1616 
t
 = 0;

1617 #ifde
DIAGNOSTIC


1622 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1623 
y
 |
DB_debug_FLAG
;

1624 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1626 i(!
	`IS_REP_CLIENT
(
v
))

1627 
t
 = 
	`__log_put
(
v
,

1628 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1630 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1631 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1632 
	`LSN_NOT_LOGGED
(*
t_lp
);

1635 #ifde
LOG_DIAGNOSTIC


1636 i(
t
 != 0)

1637 ()
	`__bam__t
(
v
,

1638 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1641 #ifde
DIAGNOSTIC


1642 
	`__os_
(
v
, 
logc
.
da
);

1644 i(
is_dub
 || 
tx
 =
NULL
)

1645 
	`__os_
(
v
, 
logc
.
da
);

1647  (
t
);

1648 
	}
}

1655 
	$__bam_ro_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1656 
ENV
 *
v
;

1657 
DB
 **
db
;

1658 *
td
;

1659 *
cbuf
;

1660 
__bam_ro_gs
 **
g
;

1662 
__bam_ro_gs
 *
gp
;

1663 
u_t32_t
 
ump
;

1664 
u_t8_t
 *
bp
;

1665 
t
;

1667 i((
t
 = 
	`__os_mloc
(
v
,

1668 (
__bam_ro_gs
+ (
DB_TXN
), &
gp
)) != 0)

1669  (
t
);

1670 
bp
 = 
cbuf
;

1671 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1672 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1674 
gp
->
tx
->
td
 =d;

1675 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1676 
bp
 +(
gp
->
ty
);

1678 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1679 
bp
 +(
gp
->
tx
->
txnid
);

1681 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1682 
bp
 +(
DB_LSN
);

1684 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1685 
gp
->
feid
 = (
t32_t
)
ump
;

1686 
bp
 +(
ump
);

1687 i(
db
 !
NULL
) {

1688 *
db
 = 
NULL
;

1689 
t
 = 
	`__dbg_id_to_db
(

1690 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1693 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1694 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1695 
bp
 +(
ump
);

1697 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1698 
gp
->
ro_pgno
 = (
db_pgno_t
)
ump
;

1699 
bp
 +(
ump
);

1701 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

1702 
bp
 +(
DB_LSN
);

1704 *
g
 = 
gp
;

1705  (
t
);

1706 
	}
}

1713 
	$__bam_ro_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
ma_pgno
, 
ro_pgno
, 
ma_l
)

1714 
DB
 *
dbp
;

1715 
DB_TXN
 *
tx
;

1716 
DB_LSN
 *
t_lp
;

1717 
u_t32_t
 
ags
;

1718 
db_pgno_t
 
ma_pgno
;

1719 
db_pgno_t
 
ro_pgno
;

1720 
DB_LSN
 * 
ma_l
;

1722 
DBT
 
logc
;

1723 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1724 
DB_TXNLOGREC
 *

;

1725 
ENV
 *
v
;

1726 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1727 
u_t
 
ad
;

1728 
u_t8_t
 *
bp
;

1729 
is_dub
, 
t
;

1731 
	`COMPQUIET
(

, 
NULL
);

1733 
v
 = 
dbp
->env;

1734 
p
 = 
t_lp
;

1735 
y
 = 
DB___bam_ro
;

1736 
ad
 = 0;

1737 
t
 = 0;

1739 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1740 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1741 i(
tx
 =
NULL
)

1743 
is_dub
 = 0;

1745 
is_dub
 = 1;

1747 i(
tx
 =
NULL
) {

1748 
txn_num
 = 0;

1749 
lp
 = &
nu_l
;

1750 
nu_l
.
fe
 =u_l.
offt
 = 0;

1752 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1753 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

1754  (
t
);

1761 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1762 
txn_num
 = 
tx
->
txnid
;

1765 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1766 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1767 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1768  (
t
);

1770 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1771 + (
u_t32_t
)

1772 + (
u_t32_t
)

1773 + (
u_t32_t
)

1774 + (*
ma_l
);

1775 i(
	`CRYPTO_ON
(
v
)) {

1776 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1777 
logc
.
size
 +
ad
;

1780 i(
is_dub
 || 
tx
 =
NULL
) {

1781 i((
t
 =

1782 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1783  (
t
);

1785 i((
t
 = 
	`__os_mloc
(
v
,

1786 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1787  (
t
);

1788 #ifde
DIAGNOSTIC


1789 i((
t
 =

1790 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1791 
	`__os_
(
v
, 

);

1792  (
t
);

1795 
logc
.
da
 = 

->data;

1798 i(
ad
 > 0)

1799 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1801 
bp
 = 
logc
.
da
;

1803 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1804 
bp
 +(
y
);

1806 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1807 
bp
 +(
txn_num
);

1809 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1810 
bp
 +(
DB_LSN
);

1812 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1813 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1814 
bp
 +(
ump
);

1816 
ump
 = (
u_t32_t
)
ma_pgno
;

1817 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1818 
bp
 +(
ump
);

1820 
ump
 = (
u_t32_t
)
ro_pgno
;

1821 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1822 
bp
 +(
ump
);

1824 i(
ma_l
 !
NULL
) {

1825 i(
tx
 !
NULL
) {

1826 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1827 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

1828 
	`__log_check_ge_l
(
v
, 
dbp
, 
ma_l
) != 0))

1829  (
t
);

1831 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
ma_l
);

1833 
	`memt
(
bp
, 0, (*
ma_l
));

1834 
bp
 +(*
ma_l
);

1836 
	`DB_ASSERT
(
v
,

1837 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1839 i(
is_dub
 || 
tx
 =
NULL
) {

1840 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1841 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1842 *
lp
 = *
p
;

1843 i(
p
 !
t_lp
)

1844 *
t_lp
 = *
p
;

1847 
t
 = 0;

1848 #ifde
DIAGNOSTIC


1853 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1854 
y
 |
DB_debug_FLAG
;

1855 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1857 i(!
	`IS_REP_CLIENT
(
v
))

1858 
t
 = 
	`__log_put
(
v
,

1859 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1861 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1862 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1863 
	`LSN_NOT_LOGGED
(*
t_lp
);

1866 #ifde
LOG_DIAGNOSTIC


1867 i(
t
 != 0)

1868 ()
	`__bam_ro_t
(
v
,

1869 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1872 #ifde
DIAGNOSTIC


1873 
	`__os_
(
v
, 
logc
.
da
);

1875 i(
is_dub
 || 
tx
 =
NULL
)

1876 
	`__os_
(
v
, 
logc
.
da
);

1878  (
t
);

1879 
	}
}

1886 
	$__bam_cudj_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1887 
ENV
 *
v
;

1888 
DB
 **
db
;

1889 *
td
;

1890 *
cbuf
;

1891 
__bam_cudj_gs
 **
g
;

1893 
__bam_cudj_gs
 *
gp
;

1894 
u_t32_t
 
ump
;

1895 
u_t8_t
 *
bp
;

1896 
t
;

1898 i((
t
 = 
	`__os_mloc
(
v
,

1899 (
__bam_cudj_gs
+ (
DB_TXN
), &
gp
)) != 0)

1900  (
t
);

1901 
bp
 = 
cbuf
;

1902 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1903 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1905 
gp
->
tx
->
td
 =d;

1906 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1907 
bp
 +(
gp
->
ty
);

1909 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1910 
bp
 +(
gp
->
tx
->
txnid
);

1912 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1913 
bp
 +(
DB_LSN
);

1915 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1916 
gp
->
feid
 = (
t32_t
)
ump
;

1917 
bp
 +(
ump
);

1918 i(
db
 !
NULL
) {

1919 *
db
 = 
NULL
;

1920 
t
 = 
	`__dbg_id_to_db
(

1921 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1924 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1925 
gp
->
mode
 = (
db__mode
)
ump
;

1926 
bp
 +(
ump
);

1928 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1929 
gp
->
om_pgno
 = (
db_pgno_t
)
ump
;

1930 
bp
 +(
ump
);

1932 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1933 
gp
->
to_pgno
 = (
db_pgno_t
)
ump
;

1934 
bp
 +(
ump
);

1936 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1937 
gp
->
_pgno
 = (
db_pgno_t
)
ump
;

1938 
bp
 +(
ump
);

1940 
	`LOGCOPY_32
(
v
, &
gp
->
f_dx
, 
bp
);

1941 
bp
 +(
gp
->
f_dx
);

1943 
	`LOGCOPY_32
(
v
, &
gp
->
om_dx
, 
bp
);

1944 
bp
 +(
gp
->
om_dx
);

1946 
	`LOGCOPY_32
(
v
, &
gp
->
to_dx
, 
bp
);

1947 
bp
 +(
gp
->
to_dx
);

1949 *
g
 = 
gp
;

1950  (
t
);

1951 
	}
}

1959 
	$__bam_cudj_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
mode
, 
om_pgno
, 
to_pgno
, 
_pgno
, 
f_dx
,

1960 
om_dx
, 
to_dx
)

1961 
DB
 *
dbp
;

1962 
DB_TXN
 *
tx
;

1963 
DB_LSN
 *
t_lp
;

1964 
u_t32_t
 
ags
;

1965 
db__mode
 
mode
;

1966 
db_pgno_t
 
om_pgno
;

1967 
db_pgno_t
 
to_pgno
;

1968 
db_pgno_t
 
_pgno
;

1969 
u_t32_t
 
f_dx
;

1970 
u_t32_t
 
om_dx
;

1971 
u_t32_t
 
to_dx
;

1973 
DBT
 
logc
;

1974 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1975 
DB_TXNLOGREC
 *

;

1976 
ENV
 *
v
;

1977 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1978 
u_t
 
ad
;

1979 
u_t8_t
 *
bp
;

1980 
is_dub
, 
t
;

1982 
	`COMPQUIET
(

, 
NULL
);

1984 
v
 = 
dbp
->env;

1985 
p
 = 
t_lp
;

1986 
y
 = 
DB___bam_cudj
;

1987 
ad
 = 0;

1988 
t
 = 0;

1990 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1991 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1992 i(
tx
 =
NULL
)

1994 
is_dub
 = 0;

1996 
is_dub
 = 1;

1998 i(
tx
 =
NULL
) {

1999 
txn_num
 = 0;

2000 
lp
 = &
nu_l
;

2001 
nu_l
.
fe
 =u_l.
offt
 = 0;

2003 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2004 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

2005  (
t
);

2012 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2013 
txn_num
 = 
tx
->
txnid
;

2016 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

2017 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2018 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2019  (
t
);

2021 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2022 + (
u_t32_t
)

2023 + (
u_t32_t
)

2024 + (
u_t32_t
)

2025 + (
u_t32_t
)

2026 + (
u_t32_t
)

2027 + (
u_t32_t
)

2028 + (
u_t32_t
)

2029 + (
u_t32_t
);

2030 i(
	`CRYPTO_ON
(
v
)) {

2031 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

2032 
logc
.
size
 +
ad
;

2035 i(
is_dub
 || 
tx
 =
NULL
) {

2036 i((
t
 =

2037 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

2038  (
t
);

2040 i((
t
 = 
	`__os_mloc
(
v
,

2041 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2042  (
t
);

2043 #ifde
DIAGNOSTIC


2044 i((
t
 =

2045 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

2046 
	`__os_
(
v
, 

);

2047  (
t
);

2050 
logc
.
da
 = 

->data;

2053 i(
ad
 > 0)

2054 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2056 
bp
 = 
logc
.
da
;

2058 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

2059 
bp
 +(
y
);

2061 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

2062 
bp
 +(
txn_num
);

2064 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

2065 
bp
 +(
DB_LSN
);

2067 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2068 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

2069 
bp
 +(
ump
);

2071 
ump
 = (
u_t32_t
)
mode
;

2072 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2073 
bp
 +(
ump
);

2075 
ump
 = (
u_t32_t
)
om_pgno
;

2076 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2077 
bp
 +(
ump
);

2079 
ump
 = (
u_t32_t
)
to_pgno
;

2080 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2081 
bp
 +(
ump
);

2083 
ump
 = (
u_t32_t
)
_pgno
;

2084 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2085 
bp
 +(
ump
);

2087 
	`LOGCOPY_32
(
v
, 
bp
, &
f_dx
);

2088 
bp
 +(
f_dx
);

2090 
	`LOGCOPY_32
(
v
, 
bp
, &
om_dx
);

2091 
bp
 +(
om_dx
);

2093 
	`LOGCOPY_32
(
v
, 
bp
, &
to_dx
);

2094 
bp
 +(
to_dx
);

2096 
	`DB_ASSERT
(
v
,

2097 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2099 i(
is_dub
 || 
tx
 =
NULL
) {

2100 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

2101 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2102 *
lp
 = *
p
;

2103 i(
p
 !
t_lp
)

2104 *
t_lp
 = *
p
;

2107 
t
 = 0;

2108 #ifde
DIAGNOSTIC


2113 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2114 
y
 |
DB_debug_FLAG
;

2115 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

2117 i(!
	`IS_REP_CLIENT
(
v
))

2118 
t
 = 
	`__log_put
(
v
,

2119 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2121 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2122 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2123 
	`LSN_NOT_LOGGED
(*
t_lp
);

2126 #ifde
LOG_DIAGNOSTIC


2127 i(
t
 != 0)

2128 ()
	`__bam_cudj_t
(
v
,

2129 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2132 #ifde
DIAGNOSTIC


2133 
	`__os_
(
v
, 
logc
.
da
);

2135 i(
is_dub
 || 
tx
 =
NULL
)

2136 
	`__os_
(
v
, 
logc
.
da
);

2138  (
t
);

2139 
	}
}

2146 
	$__bam_rcudj_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2147 
ENV
 *
v
;

2148 
DB
 **
db
;

2149 *
td
;

2150 *
cbuf
;

2151 
__bam_rcudj_gs
 **
g
;

2153 
__bam_rcudj_gs
 *
gp
;

2154 
u_t32_t
 
ump
;

2155 
u_t8_t
 *
bp
;

2156 
t
;

2158 i((
t
 = 
	`__os_mloc
(
v
,

2159 (
__bam_rcudj_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 
gp
->
tx
->
td
 =d;

2166 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2167 
bp
 +(
gp
->
ty
);

2169 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2170 
bp
 +(
gp
->
tx
->
txnid
);

2172 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2173 
bp
 +(
DB_LSN
);

2175 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2176 
gp
->
feid
 = (
t32_t
)
ump
;

2177 
bp
 +(
ump
);

2178 i(
db
 !
NULL
) {

2179 *
db
 = 
NULL
;

2180 
t
 = 
	`__dbg_id_to_db
(

2181 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2184 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2185 
gp
->
mode
 = (
_o_g
)
ump
;

2186 
bp
 +(
ump
);

2188 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2189 
gp
->
ro
 = (
db_pgno_t
)
ump
;

2190 
bp
 +(
ump
);

2192 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2193 
gp
->
o
 = (
db_o_t
)
ump
;

2194 
bp
 +(
ump
);

2196 
	`LOGCOPY_32
(
v
, &
gp
->
d
, 
bp
);

2197 
bp
 +(
gp
->
d
);

2199 *
g
 = 
gp
;

2200  (
t
);

2201 
	}
}

2208 
	$__bam_rcudj_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
mode
, 
ro
, 
o
, 
d
)

2209 
DB
 *
dbp
;

2210 
DB_TXN
 *
tx
;

2211 
DB_LSN
 *
t_lp
;

2212 
u_t32_t
 
ags
;

2213 
_o_g
 
mode
;

2214 
db_pgno_t
 
ro
;

2215 
db_o_t
 
o
;

2216 
u_t32_t
 
d
;

2218 
DBT
 
logc
;

2219 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2220 
DB_TXNLOGREC
 *

;

2221 
ENV
 *
v
;

2222 
u_t32_t
 
ump
, 
y
, 
txn_num
;

2223 
u_t
 
ad
;

2224 
u_t8_t
 *
bp
;

2225 
is_dub
, 
t
;

2227 
	`COMPQUIET
(

, 
NULL
);

2229 
v
 = 
dbp
->env;

2230 
p
 = 
t_lp
;

2231 
y
 = 
DB___bam_rcudj
;

2232 
ad
 = 0;

2233 
t
 = 0;

2235 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2236 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2237 i(
tx
 =
NULL
)

2239 
is_dub
 = 0;

2241 
is_dub
 = 1;

2243 i(
tx
 =
NULL
) {

2244 
txn_num
 = 0;

2245 
lp
 = &
nu_l
;

2246 
nu_l
.
fe
 =u_l.
offt
 = 0;

2248 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2249 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

2250  (
t
);

2257 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2258 
txn_num
 = 
tx
->
txnid
;

2261 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

2262 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2263 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2264  (
t
);

2266 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2267 + (
u_t32_t
)

2268 + (
u_t32_t
)

2269 + (
u_t32_t
)

2270 + (
u_t32_t
)

2271 + (
u_t32_t
);

2272 i(
	`CRYPTO_ON
(
v
)) {

2273 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

2274 
logc
.
size
 +
ad
;

2277 i(
is_dub
 || 
tx
 =
NULL
) {

2278 i((
t
 =

2279 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

2280  (
t
);

2282 i((
t
 = 
	`__os_mloc
(
v
,

2283 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2284  (
t
);

2285 #ifde
DIAGNOSTIC


2286 i((
t
 =

2287 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

2288 
	`__os_
(
v
, 

);

2289  (
t
);

2292 
logc
.
da
 = 

->data;

2295 i(
ad
 > 0)

2296 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2298 
bp
 = 
logc
.
da
;

2300 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

2301 
bp
 +(
y
);

2303 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

2304 
bp
 +(
txn_num
);

2306 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

2307 
bp
 +(
DB_LSN
);

2309 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2310 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

2311 
bp
 +(
ump
);

2313 
ump
 = (
u_t32_t
)
mode
;

2314 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2315 
bp
 +(
ump
);

2317 
ump
 = (
u_t32_t
)
ro
;

2318 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2319 
bp
 +(
ump
);

2321 
ump
 = (
u_t32_t
)
o
;

2322 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2323 
bp
 +(
ump
);

2325 
	`LOGCOPY_32
(
v
, 
bp
, &
d
);

2326 
bp
 +(
d
);

2328 
	`DB_ASSERT
(
v
,

2329 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2331 i(
is_dub
 || 
tx
 =
NULL
) {

2332 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

2333 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2334 *
lp
 = *
p
;

2335 i(
p
 !
t_lp
)

2336 *
t_lp
 = *
p
;

2339 
t
 = 0;

2340 #ifde
DIAGNOSTIC


2345 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2346 
y
 |
DB_debug_FLAG
;

2347 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

2349 i(!
	`IS_REP_CLIENT
(
v
))

2350 
t
 = 
	`__log_put
(
v
,

2351 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2353 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2354 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2355 
	`LSN_NOT_LOGGED
(*
t_lp
);

2358 #ifde
LOG_DIAGNOSTIC


2359 i(
t
 != 0)

2360 ()
	`__bam_rcudj_t
(
v
,

2361 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2364 #ifde
DIAGNOSTIC


2365 
	`__os_
(
v
, 
logc
.
da
);

2367 i(
is_dub
 || 
tx
 =
NULL
)

2368 
	`__os_
(
v
, 
logc
.
da
);

2370  (
t
);

2371 
	}
}

2378 
	$__bam_lk_43_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2379 
ENV
 *
v
;

2380 
DB
 **
db
;

2381 *
td
;

2382 *
cbuf
;

2383 
__bam_lk_43_gs
 **
g
;

2385 
__bam_lk_43_gs
 *
gp
;

2386 
u_t32_t
 
ump
;

2387 
u_t8_t
 *
bp
;

2388 
t
;

2390 i((
t
 = 
	`__os_mloc
(
v
,

2391 (
__bam_lk_43_gs
+ (
DB_TXN
), &
gp
)) != 0)

2392  (
t
);

2393 
bp
 = 
cbuf
;

2394 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2395 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2397 
gp
->
tx
->
td
 =d;

2398 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2399 
bp
 +(
gp
->
ty
);

2401 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2402 
bp
 +(
gp
->
tx
->
txnid
);

2404 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2405 
bp
 +(
DB_LSN
);

2407 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2408 
gp
->
feid
 = (
t32_t
)
ump
;

2409 
bp
 +(
ump
);

2410 i(
db
 !
NULL
) {

2411 *
db
 = 
NULL
;

2412 
t
 = 
	`__dbg_id_to_db
(

2413 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2416 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2417 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2418 
bp
 +(
ump
);

2420 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

2421 
bp
 +(
DB_LSN
);

2423 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2424 
gp
->
ev
 = (
db_pgno_t
)
ump
;

2425 
bp
 +(
ump
);

2427 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l_ev
, 
bp
);

2428 
bp
 +(
DB_LSN
);

2430 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2431 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2432 
bp
 +(
ump
);

2434 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l_xt
, 
bp
);

2435 
bp
 +(
DB_LSN
);

2437 *
g
 = 
gp
;

2438  (
t
);

2439 
	}
}

2446 
	$__bam_lk_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2447 
ENV
 *
v
;

2448 
DB
 **
db
;

2449 *
td
;

2450 *
cbuf
;

2451 
__bam_lk_gs
 **
g
;

2453 
__bam_lk_gs
 *
gp
;

2454 
u_t32_t
 
ump
;

2455 
u_t8_t
 *
bp
;

2456 
t
;

2458 i((
t
 = 
	`__os_mloc
(
v
,

2459 (
__bam_lk_gs
+ (
DB_TXN
), &
gp
)) != 0)

2460  (
t
);

2461 
bp
 = 
cbuf
;

2462 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2463 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2465 
gp
->
tx
->
td
 =d;

2466 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2467 
bp
 +(
gp
->
ty
);

2469 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2470 
bp
 +(
gp
->
tx
->
txnid
);

2472 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2473 
bp
 +(
DB_LSN
);

2475 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2476 
gp
->
feid
 = (
t32_t
)
ump
;

2477 
bp
 +(
ump
);

2478 i(
db
 !
NULL
) {

2479 *
db
 = 
NULL
;

2480 
t
 = 
	`__dbg_id_to_db
(

2481 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2484 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2485 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2486 
bp
 +(
ump
);

2488 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2489 
gp
->
w_pgno
 = (
db_pgno_t
)
ump
;

2490 
bp
 +(
ump
);

2492 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2493 
gp
->
ev
 = (
db_pgno_t
)
ump
;

2494 
bp
 +(
ump
);

2496 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l_ev
, 
bp
);

2497 
bp
 +(
DB_LSN
);

2499 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2500 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2501 
bp
 +(
ump
);

2503 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l_xt
, 
bp
);

2504 
bp
 +(
DB_LSN
);

2506 *
g
 = 
gp
;

2507  (
t
);

2508 
	}
}

2516 
	$__bam_lk_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
w_pgno
, 
ev
, 
l_ev
, 
xt
,

2517 
l_xt
)

2518 
DB
 *
dbp
;

2519 
DB_TXN
 *
tx
;

2520 
DB_LSN
 *
t_lp
;

2521 
u_t32_t
 
ags
;

2522 
db_pgno_t
 
pgno
;

2523 
db_pgno_t
 
w_pgno
;

2524 
db_pgno_t
 
ev
;

2525 
DB_LSN
 * 
l_ev
;

2526 
db_pgno_t
 
xt
;

2527 
DB_LSN
 * 
l_xt
;

2529 
DBT
 
logc
;

2530 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2531 
DB_TXNLOGREC
 *

;

2532 
ENV
 *
v
;

2533 
u_t32_t
 
ump
, 
y
, 
txn_num
;

2534 
u_t
 
ad
;

2535 
u_t8_t
 *
bp
;

2536 
is_dub
, 
t
;

2538 
	`COMPQUIET
(

, 
NULL
);

2540 
v
 = 
dbp
->env;

2541 
p
 = 
t_lp
;

2542 
y
 = 
DB___bam_lk
;

2543 
ad
 = 0;

2544 
t
 = 0;

2546 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2547 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2548 i(
tx
 =
NULL
)

2550 
is_dub
 = 0;

2552 
is_dub
 = 1;

2554 i(
tx
 =
NULL
) {

2555 
txn_num
 = 0;

2556 
lp
 = &
nu_l
;

2557 
nu_l
.
fe
 =u_l.
offt
 = 0;

2559 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2560 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

2561  (
t
);

2568 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2569 
txn_num
 = 
tx
->
txnid
;

2572 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

2573 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2574 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2575  (
t
);

2577 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2578 + (
u_t32_t
)

2579 + (
u_t32_t
)

2580 + (
u_t32_t
)

2581 + (
u_t32_t
)

2582 + (*
l_ev
)

2583 + (
u_t32_t
)

2584 + (*
l_xt
);

2585 i(
	`CRYPTO_ON
(
v
)) {

2586 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

2587 
logc
.
size
 +
ad
;

2590 i(
is_dub
 || 
tx
 =
NULL
) {

2591 i((
t
 =

2592 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

2593  (
t
);

2595 i((
t
 = 
	`__os_mloc
(
v
,

2596 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2597  (
t
);

2598 #ifde
DIAGNOSTIC


2599 i((
t
 =

2600 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

2601 
	`__os_
(
v
, 

);

2602  (
t
);

2605 
logc
.
da
 = 

->data;

2608 i(
ad
 > 0)

2609 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2611 
bp
 = 
logc
.
da
;

2613 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

2614 
bp
 +(
y
);

2616 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

2617 
bp
 +(
txn_num
);

2619 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

2620 
bp
 +(
DB_LSN
);

2622 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2623 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

2624 
bp
 +(
ump
);

2626 
ump
 = (
u_t32_t
)
pgno
;

2627 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2628 
bp
 +(
ump
);

2630 
ump
 = (
u_t32_t
)
w_pgno
;

2631 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2632 
bp
 +(
ump
);

2634 
ump
 = (
u_t32_t
)
ev
;

2635 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2636 
bp
 +(
ump
);

2638 i(
l_ev
 !
NULL
) {

2639 i(
tx
 !
NULL
) {

2640 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

2641 i(
	`LOG_COMPARE
(
l_ev
, &

->
l
>0 && (
t
 =

2642 
	`__log_check_ge_l
(
v
, 
dbp
, 
l_ev
) != 0))

2643  (
t
);

2645 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l_ev
);

2647 
	`memt
(
bp
, 0, (*
l_ev
));

2648 
bp
 +(*
l_ev
);

2650 
ump
 = (
u_t32_t
)
xt
;

2651 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2652 
bp
 +(
ump
);

2654 i(
l_xt
 !
NULL
) {

2655 i(
tx
 !
NULL
) {

2656 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

2657 i(
	`LOG_COMPARE
(
l_xt
, &

->
l
>0 && (
t
 =

2658 
	`__log_check_ge_l
(
v
, 
dbp
, 
l_xt
) != 0))

2659  (
t
);

2661 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l_xt
);

2663 
	`memt
(
bp
, 0, (*
l_xt
));

2664 
bp
 +(*
l_xt
);

2666 
	`DB_ASSERT
(
v
,

2667 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2669 i(
is_dub
 || 
tx
 =
NULL
) {

2670 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

2671 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2672 *
lp
 = *
p
;

2673 i(
p
 !
t_lp
)

2674 *
t_lp
 = *
p
;

2677 
t
 = 0;

2678 #ifde
DIAGNOSTIC


2683 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2684 
y
 |
DB_debug_FLAG
;

2685 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

2687 i(!
	`IS_REP_CLIENT
(
v
))

2688 
t
 = 
	`__log_put
(
v
,

2689 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2691 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2692 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2693 
	`LSN_NOT_LOGGED
(*
t_lp
);

2696 #ifde
LOG_DIAGNOSTIC


2697 i(
t
 != 0)

2698 ()
	`__bam_lk_t
(
v
,

2699 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2702 #ifde
DIAGNOSTIC


2703 
	`__os_
(
v
, 
logc
.
da
);

2705 i(
is_dub
 || 
tx
 =
NULL
)

2706 
	`__os_
(
v
, 
logc
.
da
);

2708  (
t
);

2709 
	}
}

2716 
	$__bam_mge_44_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2717 
ENV
 *
v
;

2718 
DB
 **
db
;

2719 *
td
;

2720 *
cbuf
;

2721 
__bam_mge_44_gs
 **
g
;

2723 
__bam_mge_44_gs
 *
gp
;

2724 
u_t32_t
 
ump
;

2725 
u_t8_t
 *
bp
;

2726 
t
;

2728 i((
t
 = 
	`__os_mloc
(
v
,

2729 (
__bam_mge_44_gs
+ (
DB_TXN
), &
gp
)) != 0)

2730  (
t
);

2731 
bp
 = 
cbuf
;

2732 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2733 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2735 
gp
->
tx
->
td
 =d;

2736 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2737 
bp
 +(
gp
->
ty
);

2739 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2740 
bp
 +(
gp
->
tx
->
txnid
);

2742 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2743 
bp
 +(
DB_LSN
);

2745 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2746 
gp
->
feid
 = (
t32_t
)
ump
;

2747 
bp
 +(
ump
);

2748 i(
db
 !
NULL
) {

2749 *
db
 = 
NULL
;

2750 
t
 = 
	`__dbg_id_to_db
(

2751 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2754 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2755 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2756 
bp
 +(
ump
);

2758 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

2759 
bp
 +(
DB_LSN
);

2761 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2762 
gp
->
gno
 = (
db_pgno_t
)
ump
;

2763 
bp
 +(
ump
);

2765 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
Ƣ
, 
bp
);

2766 
bp
 +(
DB_LSN
);

2768 
	`memt
(&
gp
->
hdr
, 0, (argp->hdr));

2769 
	`LOGCOPY_32
(
v
,&
gp
->
hdr
.
size
, 
bp
);

2770 
bp
 +(
u_t32_t
);

2771 
gp
->
hdr
.
da
 = 
bp
;

2772 
bp
 +
gp
->
hdr
.
size
;

2774 
	`memt
(&
gp
->
da
, 0, (argp->data));

2775 
	`LOGCOPY_32
(
v
,&
gp
->
da
.
size
, 
bp
);

2776 
bp
 +(
u_t32_t
);

2777 
gp
->
da
.d
bp
;

2778 
bp
 +
gp
->
da
.
size
;

2780 
	`memt
(&
gp
->
d
, 0, (argp->ind));

2781 
	`LOGCOPY_32
(
v
,&
gp
->
d
.
size
, 
bp
);

2782 
bp
 +(
u_t32_t
);

2783 
gp
->
d
.
da
 = 
bp
;

2784 
bp
 +
gp
->
d
.
size
;

2786 *
g
 = 
gp
;

2787  (
t
);

2788 
	}
}

2795 
	$__bam_mge_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2796 
ENV
 *
v
;

2797 
DB
 **
db
;

2798 *
td
;

2799 *
cbuf
;

2800 
__bam_mge_gs
 **
g
;

2802 
__bam_mge_gs
 *
gp
;

2803 
u_t32_t
 
ump
;

2804 
u_t8_t
 *
bp
;

2805 
t
;

2807 i((
t
 = 
	`__os_mloc
(
v
,

2808 (
__bam_mge_gs
+ (
DB_TXN
), &
gp
)) != 0)

2809  (
t
);

2810 
bp
 = 
cbuf
;

2811 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2812 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2814 
gp
->
tx
->
td
 =d;

2815 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2816 
bp
 +(
gp
->
ty
);

2818 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2819 
bp
 +(
gp
->
tx
->
txnid
);

2821 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2822 
bp
 +(
DB_LSN
);

2824 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2825 
gp
->
feid
 = (
t32_t
)
ump
;

2826 
bp
 +(
ump
);

2827 i(
db
 !
NULL
) {

2828 *
db
 = 
NULL
;

2829 
t
 = 
	`__dbg_id_to_db
(

2830 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2833 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2834 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2835 
bp
 +(
ump
);

2837 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

2838 
bp
 +(
DB_LSN
);

2840 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2841 
gp
->
gno
 = (
db_pgno_t
)
ump
;

2842 
bp
 +(
ump
);

2844 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
Ƣ
, 
bp
);

2845 
bp
 +(
DB_LSN
);

2847 
	`memt
(&
gp
->
hdr
, 0, (argp->hdr));

2848 
	`LOGCOPY_32
(
v
,&
gp
->
hdr
.
size
, 
bp
);

2849 
bp
 +(
u_t32_t
);

2850 
gp
->
hdr
.
da
 = 
bp
;

2851 
bp
 +
gp
->
hdr
.
size
;

2853 
	`memt
(&
gp
->
da
, 0, (argp->data));

2854 
	`LOGCOPY_32
(
v
,&
gp
->
da
.
size
, 
bp
);

2855 
bp
 +(
u_t32_t
);

2856 
gp
->
da
.d
bp
;

2857 
bp
 +
gp
->
da
.
size
;

2858 i(
	`LOG_SWAPPED
(
v
&& 
db
 !
NULL
 && *dbpp != NULL) {

2859 
t_t
;

2860 i((
t_t
 = 
	`__db_gesw
(*
db
,

2861 (
PAGE
 *)
gp
->
hdr
.
da
, (
size_t
rgp->hdr.
size
,

2862 &
gp
->
da
, 1)) != 0)

2863  (
t_t
);

2866 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2867 
gp
->
pg_cy
 = (
t32_t
)
ump
;

2868 
bp
 +(
ump
);

2870 *
g
 = 
gp
;

2871  (
t
);

2872 
	}
}

2880 
	$__bam_mge_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
gno
, 
Ƣ
, 
hdr
,

2881 
da
, 
pg_cy
)

2882 
DB
 *
dbp
;

2883 
DB_TXN
 *
tx
;

2884 
DB_LSN
 *
t_lp
;

2885 
u_t32_t
 
ags
;

2886 
db_pgno_t
 
pgno
;

2887 
DB_LSN
 * 
l
;

2888 
db_pgno_t
 
gno
;

2889 
DB_LSN
 * 
Ƣ
;

2890 cڡ 
DBT
 *
hdr
;

2891 cڡ 
DBT
 *
da
;

2892 
t32_t
 
pg_cy
;

2894 
DBT
 
logc
;

2895 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2896 
DB_TXNLOGREC
 *

;

2897 
ENV
 *
v
;

2898 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

2899 
u_t
 
ad
;

2900 
u_t8_t
 *
bp
;

2901 
is_dub
, 
t
;

2903 
	`COMPQUIET
(

, 
NULL
);

2905 
v
 = 
dbp
->env;

2906 
p
 = 
t_lp
;

2907 
y
 = 
DB___bam_mge
;

2908 
ad
 = 0;

2909 
t
 = 0;

2911 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2912 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2913 i(
tx
 =
NULL
)

2915 
is_dub
 = 0;

2917 
is_dub
 = 1;

2919 i(
tx
 =
NULL
) {

2920 
txn_num
 = 0;

2921 
lp
 = &
nu_l
;

2922 
nu_l
.
fe
 =u_l.
offt
 = 0;

2924 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2925 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

2926  (
t
);

2933 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2934 
txn_num
 = 
tx
->
txnid
;

2937 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

2938 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2939 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2940  (
t
);

2942 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2943 + (
u_t32_t
)

2944 + (
u_t32_t
)

2945 + (*
l
)

2946 + (
u_t32_t
)

2947 + (*
Ƣ
)

2948 + (
u_t32_t
+ (
hdr
 =
NULL
 ? 0 : hdr->
size
)

2949 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
)

2950 + (
u_t32_t
);

2951 i(
	`CRYPTO_ON
(
v
)) {

2952 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

2953 
logc
.
size
 +
ad
;

2956 i(
is_dub
 || 
tx
 =
NULL
) {

2957 i((
t
 =

2958 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

2959  (
t
);

2961 i((
t
 = 
	`__os_mloc
(
v
,

2962 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2963  (
t
);

2964 #ifde
DIAGNOSTIC


2965 i((
t
 =

2966 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

2967 
	`__os_
(
v
, 

);

2968  (
t
);

2971 
logc
.
da
 = 

->data;

2974 i(
ad
 > 0)

2975 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2977 
bp
 = 
logc
.
da
;

2979 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

2980 
bp
 +(
y
);

2982 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

2983 
bp
 +(
txn_num
);

2985 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

2986 
bp
 +(
DB_LSN
);

2988 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2989 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

2990 
bp
 +(
ump
);

2992 
ump
 = (
u_t32_t
)
pgno
;

2993 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2994 
bp
 +(
ump
);

2996 i(
l
 !
NULL
) {

2997 i(
tx
 !
NULL
) {

2998 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

2999 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

3000 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

3001  (
t
);

3003 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

3005 
	`memt
(
bp
, 0, (*
l
));

3006 
bp
 +(*
l
);

3008 
ump
 = (
u_t32_t
)
gno
;

3009 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

3010 
bp
 +(
ump
);

3012 i(
Ƣ
 !
NULL
) {

3013 i(
tx
 !
NULL
) {

3014 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

3015 i(
	`LOG_COMPARE
(
Ƣ
, &

->
l
>0 && (
t
 =

3016 
	`__log_check_ge_l
(
v
, 
dbp
, 
Ƣ
) != 0))

3017  (
t
);

3019 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
Ƣ
);

3021 
	`memt
(
bp
, 0, (*
Ƣ
));

3022 
bp
 +(*
Ƣ
);

3024 i(
hdr
 =
NULL
) {

3025 
zo
 = 0;

3026 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

3027 
bp
 +(
u_t32_t
);

3029 
	`LOGCOPY_32
(
v
, 
bp
, &
hdr
->
size
);

3030 
bp
 +(
hdr
->
size
);

3031 
	`memy
(
bp
, 
hdr
->
da
, hdr->
size
);

3032 i(
	`LOG_SWAPPED
(
v
))

3033 i((
t
 = 
	`__db_gesw
(
dbp
,

3034 (
PAGE
 *)
bp
, (
size_t
)
hdr
->
size
, (
DBT
 *)
da
, 0)) != 0)

3035  (
t
);

3036 
bp
 +
hdr
->
size
;

3039 i(
da
 =
NULL
) {

3040 
zo
 = 0;

3041 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

3042 
bp
 +(
u_t32_t
);

3044 
	`LOGCOPY_32
(
v
, 
bp
, &
da
->
size
);

3045 
bp
 +(
da
->
size
);

3046 
	`memy
(
bp
, 
da
->da, da->
size
);

3047 i(
	`LOG_SWAPPED
(
v
&& 
	`F_ISSET
(
da
, 
DB_DBT_APPMALLOC
))

3048 
	`__os_
(
v
, 
da
->data);

3049 
bp
 +
da
->
size
;

3052 
ump
 = (
u_t32_t
)
pg_cy
;

3053 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

3054 
bp
 +(
ump
);

3056 
	`DB_ASSERT
(
v
,

3057 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

3059 i(
is_dub
 || 
tx
 =
NULL
) {

3060 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

3061 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

3062 *
lp
 = *
p
;

3063 i(
p
 !
t_lp
)

3064 *
t_lp
 = *
p
;

3067 
t
 = 0;

3068 #ifde
DIAGNOSTIC


3073 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

3074 
y
 |
DB_debug_FLAG
;

3075 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

3077 i(!
	`IS_REP_CLIENT
(
v
))

3078 
t
 = 
	`__log_put
(
v
,

3079 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

3081 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

3082 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

3083 
	`LSN_NOT_LOGGED
(*
t_lp
);

3086 #ifde
LOG_DIAGNOSTIC


3087 i(
t
 != 0)

3088 ()
	`__bam_mge_t
(
v
,

3089 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

3092 #ifde
DIAGNOSTIC


3093 
	`__os_
(
v
, 
logc
.
da
);

3095 i(
is_dub
 || 
tx
 =
NULL
)

3096 
	`__os_
(
v
, 
logc
.
da
);

3098  (
t
);

3099 
	}
}

3106 
	$__bam_pgno_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

3107 
ENV
 *
v
;

3108 
DB
 **
db
;

3109 *
td
;

3110 *
cbuf
;

3111 
__bam_pgno_gs
 **
g
;

3113 
__bam_pgno_gs
 *
gp
;

3114 
u_t32_t
 
ump
;

3115 
u_t8_t
 *
bp
;

3116 
t
;

3118 i((
t
 = 
	`__os_mloc
(
v
,

3119 (
__bam_pgno_gs
+ (
DB_TXN
), &
gp
)) != 0)

3120  (
t
);

3121 
bp
 = 
cbuf
;

3122 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

3123 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

3125 
gp
->
tx
->
td
 =d;

3126 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

3127 
bp
 +(
gp
->
ty
);

3129 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

3130 
bp
 +(
gp
->
tx
->
txnid
);

3132 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

3133 
bp
 +(
DB_LSN
);

3135 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

3136 
gp
->
feid
 = (
t32_t
)
ump
;

3137 
bp
 +(
ump
);

3138 i(
db
 !
NULL
) {

3139 *
db
 = 
NULL
;

3140 
t
 = 
	`__dbg_id_to_db
(

3141 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

3144 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

3145 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

3146 
bp
 +(
ump
);

3148 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

3149 
bp
 +(
DB_LSN
);

3151 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

3152 
bp
 +(
gp
->
dx
);

3154 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

3155 
gp
->
gno
 = (
db_pgno_t
)
ump
;

3156 
bp
 +(
ump
);

3158 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

3159 
gp
->
gno
 = (
db_pgno_t
)
ump
;

3160 
bp
 +(
ump
);

3162 *
g
 = 
gp
;

3163  (
t
);

3164 
	}
}

3172 
	$__bam_pgno_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
l
, 
dx
, 
gno
, 
gno
)

3173 
DB
 *
dbp
;

3174 
DB_TXN
 *
tx
;

3175 
DB_LSN
 *
t_lp
;

3176 
u_t32_t
 
ags
;

3177 
db_pgno_t
 
pgno
;

3178 
DB_LSN
 * 
l
;

3179 
u_t32_t
 
dx
;

3180 
db_pgno_t
 
gno
;

3181 
db_pgno_t
 
gno
;

3183 
DBT
 
logc
;

3184 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

3185 
DB_TXNLOGREC
 *

;

3186 
ENV
 *
v
;

3187 
u_t32_t
 
ump
, 
y
, 
txn_num
;

3188 
u_t
 
ad
;

3189 
u_t8_t
 *
bp
;

3190 
is_dub
, 
t
;

3192 
	`COMPQUIET
(

, 
NULL
);

3194 
v
 = 
dbp
->env;

3195 
p
 = 
t_lp
;

3196 
y
 = 
DB___bam_pgno
;

3197 
ad
 = 0;

3198 
t
 = 0;

3200 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

3201 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

3202 i(
tx
 =
NULL
)

3204 
is_dub
 = 0;

3206 
is_dub
 = 1;

3208 i(
tx
 =
NULL
) {

3209 
txn_num
 = 0;

3210 
lp
 = &
nu_l
;

3211 
nu_l
.
fe
 =u_l.
offt
 = 0;

3213 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

3214 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

3215  (
t
);

3222 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

3223 
txn_num
 = 
tx
->
txnid
;

3226 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

3227 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

3228 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

3229  (
t
);

3231 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

3232 + (
u_t32_t
)

3233 + (
u_t32_t
)

3234 + (*
l
)

3235 + (
u_t32_t
)

3236 + (
u_t32_t
)

3237 + (
u_t32_t
);

3238 i(
	`CRYPTO_ON
(
v
)) {

3239 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

3240 
logc
.
size
 +
ad
;

3243 i(
is_dub
 || 
tx
 =
NULL
) {

3244 i((
t
 =

3245 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

3246  (
t
);

3248 i((
t
 = 
	`__os_mloc
(
v
,

3249 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

3250  (
t
);

3251 #ifde
DIAGNOSTIC


3252 i((
t
 =

3253 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

3254 
	`__os_
(
v
, 

);

3255  (
t
);

3258 
logc
.
da
 = 

->data;

3261 i(
ad
 > 0)

3262 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

3264 
bp
 = 
logc
.
da
;

3266 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

3267 
bp
 +(
y
);

3269 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

3270 
bp
 +(
txn_num
);

3272 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

3273 
bp
 +(
DB_LSN
);

3275 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

3276 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

3277 
bp
 +(
ump
);

3279 
ump
 = (
u_t32_t
)
pgno
;

3280 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

3281 
bp
 +(
ump
);

3283 i(
l
 !
NULL
) {

3284 i(
tx
 !
NULL
) {

3285 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

3286 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

3287 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

3288  (
t
);

3290 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

3292 
	`memt
(
bp
, 0, (*
l
));

3293 
bp
 +(*
l
);

3295 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

3296 
bp
 +(
dx
);

3298 
ump
 = (
u_t32_t
)
gno
;

3299 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

3300 
bp
 +(
ump
);

3302 
ump
 = (
u_t32_t
)
gno
;

3303 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

3304 
bp
 +(
ump
);

3306 
	`DB_ASSERT
(
v
,

3307 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

3309 i(
is_dub
 || 
tx
 =
NULL
) {

3310 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

3311 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

3312 *
lp
 = *
p
;

3313 i(
p
 !
t_lp
)

3314 *
t_lp
 = *
p
;

3317 
t
 = 0;

3318 #ifde
DIAGNOSTIC


3323 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

3324 
y
 |
DB_debug_FLAG
;

3325 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

3327 i(!
	`IS_REP_CLIENT
(
v
))

3328 
t
 = 
	`__log_put
(
v
,

3329 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

3331 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

3332 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

3333 
	`LSN_NOT_LOGGED
(*
t_lp
);

3336 #ifde
LOG_DIAGNOSTIC


3337 i(
t
 != 0)

3338 ()
	`__bam_pgno_t
(
v
,

3339 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

3342 #ifde
DIAGNOSTIC


3343 
	`__os_
(
v
, 
logc
.
da
);

3345 i(
is_dub
 || 
tx
 =
NULL
)

3346 
	`__os_
(
v
, 
logc
.
da
);

3348  (
t
);

3349 
	}
}

3355 
	$__bam__cov
(
v
, 
dbp
)

3356 
ENV
 *
v
;

3357 
DB_DISTAB
 *
dbp
;

3359 
t
;

3361 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3362 
__bam_l_cov
, 
DB___bam_l
)) != 0)

3363  (
t
);

3364 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3365 
__bam_rl_cov
, 
DB___bam_rl
)) != 0)

3366  (
t
);

3367 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3368 
__bam_adj_cov
, 
DB___bam_adj
)) != 0)

3369  (
t
);

3370 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3371 
__bam_dju_cov
, 
DB___bam_dju
)) != 0)

3372  (
t
);

3373 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3374 
__bam_cd_cov
, 
DB___bam_cd
)) != 0)

3375  (
t
);

3376 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3377 
__bam__cov
, 
DB___bam_
)) != 0)

3378  (
t
);

3379 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3380 
__bam_ro_cov
, 
DB___bam_ro
)) != 0)

3381  (
t
);

3382 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3383 
__bam_cudj_cov
, 
DB___bam_cudj
)) != 0)

3384  (
t
);

3385 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3386 
__bam_rcudj_cov
, 
DB___bam_rcudj
)) != 0)

3387  (
t
);

3388 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3389 
__bam_lk_cov
, 
DB___bam_lk
)) != 0)

3390  (
t
);

3391 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3392 
__bam_mge_cov
, 
DB___bam_mge
)) != 0)

3393  (
t
);

3394 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

3395 
__bam_pgno_cov
, 
DB___bam_pgno
)) != 0)

3396  (
t
);

3398 
	}
}

	@../btree/btree_autop.c

3 
	~"db_cfig.h
"

5 
	~"db_t.h
"

6 
	~"dbc/yo.h
"

7 
	~"dbc/db_ge.h
"

8 
	~"dbc/db_am.h
"

9 
	~"dbc/b.h
"

10 
	~"dbc/log.h
"

11 
	~"dbc/txn.h
"

18 
	$__bam_l_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

19 
ENV
 *
v
;

20 
DBT
 *
db
;

21 
DB_LSN
 *
lp
;

22 
db_cs
 
nud2
;

23 *
nud3
;

25 
__bam_l_gs
 *
gp
;

26 
u_t32_t
 
i
;

27 
ch
;

28 
t
;

30 
nud2
 = 
DB_TXN_PRINT
;

31 
nud3
 = 
NULL
;

33 i((
t
 =

34 
	`__bam_l_ad
(
v
, 
NULL
, NULL, 
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_
(
v
, 
gp
);

65 
	}
}

72 
	$__bam_rl_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

73 
ENV
 *
v
;

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
 =

88 
	`__bam_rl_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

89  (
t
);

90 ()
	`tf
(

92 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

93 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

94 (
u_lg
)
gp
->
ty
,

95 (
u_lg
)
gp
->
tx
->
txnid
,

96 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

97 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

98 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

99 ()
	`tf
("\tpgdbt: ");

100 
i
 = 0; i < 
gp
->
pgdbt
.
size
; i++) {

101 
ch
 = ((
u_t8_t
 *)
gp
->
pgdbt
.
da
)[
i
];

102 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

104 ()
	`tf
("\n");

105 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
ro_pgno
);

106 ()
	`tf
("\c: %lu\n", (
u_lg
)
gp
->
ec
);

107 ()
	`tf
("\trootent: ");

108 
i
 = 0; i < 
gp
->
roْt
.
size
; i++) {

109 
ch
 = ((
u_t8_t
 *)
gp
->
roْt
.
da
)[
i
];

110 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

112 ()
	`tf
("\n");

113 ()
	`tf
("\trootlsn: [%lu][%lu]\n",

114 (
u_lg
)
gp
->
rol
.
fe
, (u_lgrgp->rol.
offt
);

115 ()
	`tf
("\n");

116 
	`__os_
(
v
, 
gp
);

118 
	}
}

125 
	$__bam_adj_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

126 
ENV
 *
v
;

127 
DBT
 *
db
;

128 
DB_LSN
 *
lp
;

129 
db_cs
 
nud2
;

130 *
nud3
;

132 
__bam_adj_gs
 *
gp
;

133 
t
;

135 
nud2
 = 
DB_TXN_PRINT
;

136 
nud3
 = 
NULL
;

138 i((
t
 =

139 
	`__bam_adj_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

140  (
t
);

141 ()
	`tf
(

143 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

144 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

145 (
u_lg
)
gp
->
ty
,

146 (
u_lg
)
gp
->
tx
->
txnid
,

147 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

148 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

149 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

150 ()
	`tf
("\tlsn: [%lu][%lu]\n",

151 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

152 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

153 ()
	`tf
("\tdx_cy: %lu\n", (
u_lg
)
gp
->
dx_cy
);

154 ()
	`tf
("\tis_: %lu\n", (
u_lg
)
gp
->
is_
);

155 ()
	`tf
("\n");

156 
	`__os_
(
v
, 
gp
);

158 
	}
}

165 
	$__bam_dju_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

166 
ENV
 *
v
;

167 
DBT
 *
db
;

168 
DB_LSN
 *
lp
;

169 
db_cs
 
nud2
;

170 *
nud3
;

172 
__bam_dju_gs
 *
gp
;

173 
t
;

175 
nud2
 = 
DB_TXN_PRINT
;

176 
nud3
 = 
NULL
;

178 i((
t
 =

179 
	`__bam_dju_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

180  (
t
);

181 ()
	`tf
(

183 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

184 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

185 (
u_lg
)
gp
->
ty
,

186 (
u_lg
)
gp
->
tx
->
txnid
,

187 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

188 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

189 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

190 ()
	`tf
("\tlsn: [%lu][%lu]\n",

191 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

192 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

193 ()
	`tf
("\dju: %ld\n", ()
gp
->
adju
);

194 ()
	`tf
("\tags: %lu\n", (
u_lg
)
gp
->
ags
);

195 ()
	`tf
("\n");

196 
	`__os_
(
v
, 
gp
);

198 
	}
}

205 
	$__bam_cd_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

206 
ENV
 *
v
;

207 
DBT
 *
db
;

208 
DB_LSN
 *
lp
;

209 
db_cs
 
nud2
;

210 *
nud3
;

212 
__bam_cd_gs
 *
gp
;

213 
t
;

215 
nud2
 = 
DB_TXN_PRINT
;

216 
nud3
 = 
NULL
;

218 i((
t
 =

219 
	`__bam_cd_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

220  (
t
);

221 ()
	`tf
(

223 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

224 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

225 (
u_lg
)
gp
->
ty
,

226 (
u_lg
)
gp
->
tx
->
txnid
,

227 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

228 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

229 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

230 ()
	`tf
("\tlsn: [%lu][%lu]\n",

231 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

232 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

233 ()
	`tf
("\n");

234 
	`__os_
(
v
, 
gp
);

236 
	}
}

243 
	$__bam__t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

244 
ENV
 *
v
;

245 
DBT
 *
db
;

246 
DB_LSN
 *
lp
;

247 
db_cs
 
nud2
;

248 *
nud3
;

250 
__bam__gs
 *
gp
;

251 
u_t32_t
 
i
;

252 
ch
;

253 
t
;

255 
nud2
 = 
DB_TXN_PRINT
;

256 
nud3
 = 
NULL
;

258 i((
t
 =

259 
	`__bam__ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

260  (
t
);

261 ()
	`tf
(

263 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

264 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

265 (
u_lg
)
gp
->
ty
,

266 (
u_lg
)
gp
->
tx
->
txnid
,

267 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

268 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

269 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

270 ()
	`tf
("\tlsn: [%lu][%lu]\n",

271 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

272 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

273 ()
	`tf
("\tisded: %lu\n", (
u_lg
)
gp
->
isded
);

274 ()
	`tf
("\torig: ");

275 
i
 = 0; i < 
gp
->
ig
.
size
; i++) {

276 
ch
 = ((
u_t8_t
 *)
gp
->
ig
.
da
)[
i
];

277 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

279 ()
	`tf
("\n");

280 ()
	`tf
("\trepl: ");

281 
i
 = 0; i < 
gp
->

.
size
; i++) {

282 
ch
 = ((
u_t8_t
 *)
gp
->

.
da
)[
i
];

283 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

285 ()
	`tf
("\n");

286 ()
	`tf
("\fix: %lu\n", (
u_lg
)
gp
->
efix
);

287 ()
	`tf
("\tsuffix: %lu\n", (
u_lg
)
gp
->
suffix
);

288 ()
	`tf
("\n");

289 
	`__os_
(
v
, 
gp
);

291 
	}
}

298 
	$__bam_ro_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

299 
ENV
 *
v
;

300 
DBT
 *
db
;

301 
DB_LSN
 *
lp
;

302 
db_cs
 
nud2
;

303 *
nud3
;

305 
__bam_ro_gs
 *
gp
;

306 
t
;

308 
nud2
 = 
DB_TXN_PRINT
;

309 
nud3
 = 
NULL
;

311 i((
t
 =

312 
	`__bam_ro_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

313  (
t
);

314 ()
	`tf
(

316 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

317 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

318 (
u_lg
)
gp
->
ty
,

319 (
u_lg
)
gp
->
tx
->
txnid
,

320 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

321 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

322 ()
	`tf
("\tma_pgno: %lu\n", (
u_lg
)
gp
->
ma_pgno
);

323 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
ro_pgno
);

324 ()
	`tf
("\tmeta_lsn: [%lu][%lu]\n",

325 (
u_lg
)
gp
->
ma_l
.
fe
, (u_lgrgp->ma_l.
offt
);

326 ()
	`tf
("\n");

327 
	`__os_
(
v
, 
gp
);

329 
	}
}

336 
	$__bam_cudj_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

337 
ENV
 *
v
;

338 
DBT
 *
db
;

339 
DB_LSN
 *
lp
;

340 
db_cs
 
nud2
;

341 *
nud3
;

343 
__bam_cudj_gs
 *
gp
;

344 
t
;

346 
nud2
 = 
DB_TXN_PRINT
;

347 
nud3
 = 
NULL
;

349 i((
t
 =

350 
	`__bam_cudj_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

351  (
t
);

352 ()
	`tf
(

354 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

355 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

356 (
u_lg
)
gp
->
ty
,

357 (
u_lg
)
gp
->
tx
->
txnid
,

358 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

359 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

360 ()
	`tf
("\tmode: %ld\n", ()
gp
->
mode
);

361 ()
	`tf
("\tom_pgno: %lu\n", (
u_lg
)
gp
->
om_pgno
);

362 ()
	`tf
("\o_pgno: %lu\n", (
u_lg
)
gp
->
to_pgno
);

363 ()
	`tf
("\e_pgno: %lu\n", (
u_lg
)
gp
->
_pgno
);

364 ()
	`tf
("\tf_dx: %lu\n", (
u_lg
)
gp
->
f_dx
);

365 ()
	`tf
("\tom_dx: %lu\n", (
u_lg
)
gp
->
om_dx
);

366 ()
	`tf
("\o_dx: %lu\n", (
u_lg
)
gp
->
to_dx
);

367 ()
	`tf
("\n");

368 
	`__os_
(
v
, 
gp
);

370 
	}
}

377 
	$__bam_rcudj_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

378 
ENV
 *
v
;

379 
DBT
 *
db
;

380 
DB_LSN
 *
lp
;

381 
db_cs
 
nud2
;

382 *
nud3
;

384 
__bam_rcudj_gs
 *
gp
;

385 
t
;

387 
nud2
 = 
DB_TXN_PRINT
;

388 
nud3
 = 
NULL
;

390 i((
t
 =

391 
	`__bam_rcudj_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

392  (
t
);

393 ()
	`tf
(

395 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

396 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

397 (
u_lg
)
gp
->
ty
,

398 (
u_lg
)
gp
->
tx
->
txnid
,

399 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

400 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

401 ()
	`tf
("\tmode: %ld\n", ()
gp
->
mode
);

402 ()
	`tf
("\o: %ld\n", ()
gp
->
ro
);

403 ()
	`tf
("\eo: %ld\n", ()
gp
->
o
);

404 ()
	`tf
("\td: %lu\n", (
u_lg
)
gp
->
d
);

405 ()
	`tf
("\n");

406 
	`__os_
(
v
, 
gp
);

408 
	}
}

415 
	$__bam_lk_43_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

416 
ENV
 *
v
;

417 
DBT
 *
db
;

418 
DB_LSN
 *
lp
;

419 
db_cs
 
nud2
;

420 *
nud3
;

422 
__bam_lk_43_gs
 *
gp
;

423 
t
;

425 
nud2
 = 
DB_TXN_PRINT
;

426 
nud3
 = 
NULL
;

428 i((
t
 =

429 
	`__bam_lk_43_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

430  (
t
);

431 ()
	`tf
(

433 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

434 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

435 (
u_lg
)
gp
->
ty
,

436 (
u_lg
)
gp
->
tx
->
txnid
,

437 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

438 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

439 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

440 ()
	`tf
("\tlsn: [%lu][%lu]\n",

441 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

442 ()
	`tf
("\v: %lu\n", (
u_lg
)
gp
->
ev
);

443 ()
	`tf
("\tlsn_prev: [%lu][%lu]\n",

444 (
u_lg
)
gp
->
l_ev
.
fe
, (u_lgrgp->l_ev.
offt
);

445 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

446 ()
	`tf
("\tlsn_next: [%lu][%lu]\n",

447 (
u_lg
)
gp
->
l_xt
.
fe
, (u_lgrgp->l_xt.
offt
);

448 ()
	`tf
("\n");

449 
	`__os_
(
v
, 
gp
);

451 
	}
}

458 
	$__bam_lk_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

459 
ENV
 *
v
;

460 
DBT
 *
db
;

461 
DB_LSN
 *
lp
;

462 
db_cs
 
nud2
;

463 *
nud3
;

465 
__bam_lk_gs
 *
gp
;

466 
t
;

468 
nud2
 = 
DB_TXN_PRINT
;

469 
nud3
 = 
NULL
;

471 i((
t
 =

472 
	`__bam_lk_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

473  (
t
);

474 ()
	`tf
(

476 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

477 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

478 (
u_lg
)
gp
->
ty
,

479 (
u_lg
)
gp
->
tx
->
txnid
,

480 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

481 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

482 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

483 ()
	`tf
("\ew_pgno: %lu\n", (
u_lg
)
gp
->
w_pgno
);

484 ()
	`tf
("\v: %lu\n", (
u_lg
)
gp
->
ev
);

485 ()
	`tf
("\tlsn_prev: [%lu][%lu]\n",

486 (
u_lg
)
gp
->
l_ev
.
fe
, (u_lgrgp->l_ev.
offt
);

487 ()
	`tf
("\ext: %lu\n", (
u_lg
)
gp
->
xt
);

488 ()
	`tf
("\tlsn_next: [%lu][%lu]\n",

489 (
u_lg
)
gp
->
l_xt
.
fe
, (u_lgrgp->l_xt.
offt
);

490 ()
	`tf
("\n");

491 
	`__os_
(
v
, 
gp
);

493 
	}
}

500 
	$__bam_mge_44_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

501 
ENV
 *
v
;

502 
DBT
 *
db
;

503 
DB_LSN
 *
lp
;

504 
db_cs
 
nud2
;

505 *
nud3
;

507 
__bam_mge_44_gs
 *
gp
;

508 
u_t32_t
 
i
;

509 
ch
;

510 
t
;

512 
nud2
 = 
DB_TXN_PRINT
;

513 
nud3
 = 
NULL
;

515 i((
t
 =

516 
	`__bam_mge_44_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

517  (
t
);

518 ()
	`tf
(

520 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

521 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

522 (
u_lg
)
gp
->
ty
,

523 (
u_lg
)
gp
->
tx
->
txnid
,

524 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

525 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

526 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

527 ()
	`tf
("\tlsn: [%lu][%lu]\n",

528 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

529 ()
	`tf
("\pgno: %lu\n", (
u_lg
)
gp
->
gno
);

530 ()
	`tf
("\tnlsn: [%lu][%lu]\n",

531 (
u_lg
)
gp
->
Ƣ
.
fe
, (u_lgrgp->Ƣ.
offt
);

532 ()
	`tf
("\thdr: ");

533 
i
 = 0; i < 
gp
->
hdr
.
size
; i++) {

534 
ch
 = ((
u_t8_t
 *)
gp
->
hdr
.
da
)[
i
];

535 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

537 ()
	`tf
("\n");

538 ()
	`tf
("\tdata: ");

539 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

540 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

541 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

543 ()
	`tf
("\n");

544 ()
	`tf
("\tind: ");

545 
i
 = 0; i < 
gp
->
d
.
size
; i++) {

546 
ch
 = ((
u_t8_t
 *)
gp
->
d
.
da
)[
i
];

547 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

549 ()
	`tf
("\n");

550 ()
	`tf
("\n");

551 
	`__os_
(
v
, 
gp
);

553 
	}
}

560 
	$__bam_mge_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

561 
ENV
 *
v
;

562 
DBT
 *
db
;

563 
DB_LSN
 *
lp
;

564 
db_cs
 
nud2
;

565 *
nud3
;

567 
__bam_mge_gs
 *
gp
;

568 
u_t32_t
 
i
;

569 
ch
;

570 
t
;

572 
nud2
 = 
DB_TXN_PRINT
;

573 
nud3
 = 
NULL
;

575 i((
t
 =

576 
	`__bam_mge_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

577  (
t
);

578 ()
	`tf
(

580 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

581 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

582 (
u_lg
)
gp
->
ty
,

583 (
u_lg
)
gp
->
tx
->
txnid
,

584 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

585 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

586 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

587 ()
	`tf
("\tlsn: [%lu][%lu]\n",

588 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

589 ()
	`tf
("\pgno: %lu\n", (
u_lg
)
gp
->
gno
);

590 ()
	`tf
("\tnlsn: [%lu][%lu]\n",

591 (
u_lg
)
gp
->
Ƣ
.
fe
, (u_lgrgp->Ƣ.
offt
);

592 ()
	`tf
("\thdr: ");

593 
i
 = 0; i < 
gp
->
hdr
.
size
; i++) {

594 
ch
 = ((
u_t8_t
 *)
gp
->
hdr
.
da
)[
i
];

595 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

597 ()
	`tf
("\n");

598 ()
	`tf
("\tdata: ");

599 
i
 = 0; i < 
gp
->
da
.
size
; i++) {

600 
ch
 = ((
u_t8_t
 *)
gp
->
da
.da)[
i
];

601 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

603 ()
	`tf
("\n");

604 ()
	`tf
("\g_cy: %lu\n", (
u_lg
)
gp
->
pg_cy
);

605 ()
	`tf
("\n");

606 
	`__os_
(
v
, 
gp
);

608 
	}
}

615 
	$__bam_pgno_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

616 
ENV
 *
v
;

617 
DBT
 *
db
;

618 
DB_LSN
 *
lp
;

619 
db_cs
 
nud2
;

620 *
nud3
;

622 
__bam_pgno_gs
 *
gp
;

623 
t
;

625 
nud2
 = 
DB_TXN_PRINT
;

626 
nud3
 = 
NULL
;

628 i((
t
 =

629 
	`__bam_pgno_ad
(
v
, 
NULL
, NULL, 
db
->
da
, &
gp
)) != 0)

630  (
t
);

631 ()
	`tf
(

633 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

634 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

635 (
u_lg
)
gp
->
ty
,

636 (
u_lg
)
gp
->
tx
->
txnid
,

637 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

638 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

639 ()
	`tf
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

640 ()
	`tf
("\tlsn: [%lu][%lu]\n",

641 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

642 ()
	`tf
("\tdx: %lu\n", (
u_lg
)
gp
->
dx
);

643 ()
	`tf
("\tgno: %lu\n", (
u_lg
)
gp
->
gno
);

644 ()
	`tf
("\pgno: %lu\n", (
u_lg
)
gp
->
gno
);

645 ()
	`tf
("\n");

646 
	`__os_
(
v
, 
gp
);

648 
	}
}

654 
	$__bam__t
(
v
, 
dbp
)

655 
ENV
 *
v
;

656 
DB_DISTAB
 *
dbp
;

658 
t
;

660 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

661 
__bam_l_t
, 
DB___bam_l
)) != 0)

662  (
t
);

663 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

664 
__bam_rl_t
, 
DB___bam_rl
)) != 0)

665  (
t
);

666 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

667 
__bam_adj_t
, 
DB___bam_adj
)) != 0)

668  (
t
);

669 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

670 
__bam_dju_t
, 
DB___bam_dju
)) != 0)

671  (
t
);

672 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

673 
__bam_cd_t
, 
DB___bam_cd
)) != 0)

674  (
t
);

675 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

676 
__bam__t
, 
DB___bam_
)) != 0)

677  (
t
);

678 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

679 
__bam_ro_t
, 
DB___bam_ro
)) != 0)

680  (
t
);

681 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

682 
__bam_cudj_t
, 
DB___bam_cudj
)) != 0)

683  (
t
);

684 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

685 
__bam_rcudj_t
, 
DB___bam_rcudj
)) != 0)

686  (
t
);

687 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

688 
__bam_lk_t
, 
DB___bam_lk
)) != 0)

689  (
t
);

690 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

691 
__bam_mge_t
, 
DB___bam_mge
)) != 0)

692  (
t
);

693 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

694 
__bam_pgno_t
, 
DB___bam_pgno
)) != 0)

695  (
t
);

697 
	}
}

	@../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", 
	`__os_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", 
	`__os_ime
(&
now
, 
time_buf
));

192 i(

)

195 
	`__os_yld
(
dbv
->
v
, 
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", 
	`__os_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_yld
(
dbv
->
v
, 
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
, 
	`__os_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_MODE_700
);

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
, 
	`__os_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
);

413 i((
t
 = 
dbv
->
	`t_rmed_d_mode
(dbenv, "rwx------")) != 0) {

414 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->set_intermediate_dir_mode");

422 i(
log_dp
 !
NULL
 && *log_dirp != NULL &&

423 (
t
 = 
dbv
->
	`t_lg_d
(dbv, *
log_dp
)) != 0) {

424 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->t_lg_d: %s", *
log_dp
);

429 i(
sswd
 !
NULL
 &&

430 (
t
 = 
dbv
->
	`t_y
(dbv, 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

431 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->set_encrypt");

435 
which
) {

436 
OPEN_ORIGINAL
:

442 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

443 (
t
 =
DB_VERSION_MISMATCH
 ||

444 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_CREATE
 |

445 
DB_INIT_LOG
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
,

447 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->ݒ: %s", 
home
);

450 i(
log_dp
 !
NULL
 && *log_dirp == NULL)

451 ()
dbv
->
	`g_lg_d
(dbv, (cڡ **)
log_dp
);

452 i(
da_dp
 !
NULL
 && *data_dirp == NULL)

453 ()
dbv
->
	`g_da_ds
(

454 
dbv
, (cڡ ***)
da_dp
);

456 
OPEN_HOT_BACKUP
:

463 i((
t
 =

464 
dbv
->
	`t_chesize
(dbenv, 0, 64 * 1024 * 10, 0)) != 0) {

465 
dbv
->
	`r
(dbenv,

466 
t
, "DB_ENV->t_chesize: %s", 
home
);

469 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_CREATE
 |

470 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
 |

471 
DB_RECOVER_FATAL
 | 
DB_USE_ENVIRON
, 0)) != 0) {

472 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->ݒ: %s", 
home
);

478 *
dbvp
 = 
dbv
;

480 
	}
}

487 
	$db_hbackup_backup_d_n
(
dbv
, 
backup_d
, 
log_d
, 
move_maxp
, 
upde
, 
vbo
)

488 
DB_ENV
 *
dbv
;

489 *
backup_d
, *
log_d
;

490 *
move_maxp
, 
upde
, 
vbo
;

492 
ENV
 *
v
;

493 
t
, 
ft
, 
t
, 
v
;

494 **
mes
, *
d
, 
buf
[
DB_MAXPATHLEN
], 
th
[DB_MAXPATHLEN];

496 
v
 = 
dbv
->env;

499 i(
log_d
 !
NULL
) {

500 i((
size_t
)
	`tf
(
buf
, (buf), "%s%c%s",

501 
backup_d
, 
PATH_SEPARATOR
[0] ,
log_d
>(
buf
)) {

502 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

503 
backup_d
, 
PATH_SEPARATOR
[0] ,
log_d
);

506 
d
 = 
buf
;

508 
d
 = 
backup_d
;

511 i((
t
 = 
	`__os_dli
(
v
, 
d
, 0, &
mes
, &
ft
)) != 0) {

512 i(
log_d
 !
NULL
 && !
upde
)

514 
dbv
->
	`r
(dbv, 
t
, "%s: deyd", 
d
);

517 
t
 = 
ft
; --cnt >= 0;) {

521 i(
	`cmp
(
mes
[
t
], 
LFPREFIX
, (LFPREFIX) - 1)) {

522 i(
upde
)

526 
v
 = 
	`oi
(
mes
[
t
] + (
LFPREFIX
) - 1);

527 i(*
move_maxp
 < 
v
)

528 *
move_maxp
 = 
v
;

530 i((
size_t
)
	`tf
(
th
, (path), "%s%c%s",

531 
d
, 
PATH_SEPARATOR
[0], 
mes
[
t
]>(
th
)) {

532 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

533 
d
, 
PATH_SEPARATOR
[0], 
mes
[
t
]);

536 i(
vbo
)

537 
	`tf
("%s:emovg %s\n", 
ogme
, 
th
);

538 i(
	`__os_uƚk
(
v
, 
th
, 0) != 0)

542 
	`__os_d
(
v
, 
mes
, 
ft
);

544 i(
vbo
 && *
move_maxp
 != 0)

545 
	`tf
("%s: highestumberedog fileemoved: %d\n",

546 
ogme
, *
move_maxp
);

549 
	}
}

556 
	$db_hbackup_ad_da_d
(
dbv
, 
home
, 
backup_d
, 
d
, 
vbo
, 
db_cfig
)

557 
DB_ENV
 *
dbv
;

558 *
home
, *
backup_d
, *
d
;

559 
vbo
, 
db_cfig
;

561 
ENV
 *
v
;

562 
t
, 
ft
, 
t
;

563 *
bd
, **
mes
;

564 
buf
[
DB_MAXPATHLEN
], 
bbuf
[DB_MAXPATHLEN];

566 
v
 = 
dbv
->env;

568 
bd
 = 
backup_d
;

569 i(
db_cfig
 && 
d
 !
home
) {

571 i((
size_t
)(
t
 = 
	`tf
(
bbuf
, (bbuf), "%s%c%s%c",

572 
backup_d
, 
PATH_SEPARATOR
[0],

573 
d
, 
PATH_SEPARATOR
[0])>(
buf
)) {

574 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

575 
backup_d
, 
PATH_SEPARATOR
[0], 
d
);

578 
bd
 = 
bbuf
;

581 i((
t
 = 
	`__db_mkth
(
v
, 
bd
)) != 0) {

582 
dbv
->
	`r
(dbv, 
t
, "%s: cn ce", 
bd
);

586 
bd
[
t
 - 1] = '\0';

589 i((
size_t
)
	`tf
(
buf
, (buf),

590 "%s%c%s", 
home
, 
PATH_SEPARATOR
[0], 
d
>(
buf
)) {

591 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

592 
home
, 
PATH_SEPARATOR
[0], 
d
);

595 
d
 = 
buf
;

598 i((
t
 = 
	`__os_dli
(
v
, 
d
, 0, &
mes
, &
ft
)) != 0) {

599 
dbv
->
	`r
(dbv, 
t
, "%s: deyd", 
d
);

602 
t
 = 
ft
; --cnt >= 0;) {

607 i(!
	`cmp
(
mes
[
t
], 
LFPREFIX
, (LFPREFIX) - 1))

609 i(!
	`cmp
(
mes
[
t
],

610 
DB_REGION_PREFIX
, (DB_REGION_PREFIX) - 1) &&

611 
	`cmp
(
mes
[
t
],

612 
QUEUE_EXTENT_PREFIX
, (QUEUE_EXTENT_PREFIX) - 1))

618 i(!
db_cfig
 &&

619 !
	`cmp
(
mes
[
t
], "DB_CONFIG", ("DB_CONFIG")))

623 i(
	`db_hbackup_da_cy
(
dbv
, 
mes
[
t
], 
d
, 
bd
, 
vbo
) != 0)

627 
	`__os_d
(
v
, 
mes
, 
ft
);

630 
	}
}

639 
	$db_hbackup_ad_log_d
(
dbv
, 
home
, 
backup_d
, 
log_d
, 
cy_mp
, 
upde
, 
vbo
)

640 
DB_ENV
 *
dbv
;

641 *
home
, *
backup_d
, *
log_d
;

642 *
cy_mp
, 
upde
, 
vbo
;

644 
ENV
 *
v
;

645 
u_t32_t
 
aag
;

646 
t
, 
t
, 
v
;

647 **
beg
, **
mes
, *
backupd
, *
logd
;

648 
om
[
DB_MAXPATHLEN
], 
to
[DB_MAXPATHLEN];

650 
v
 = 
dbv
->env;

652 i(
home
 !
NULL
 && 
log_d
 != NULL) {

653 i((
size_t
)
	`tf
(
om
, (from), "%s%c%s",

654 
home
, 
PATH_SEPARATOR
[0], 
log_d
>(
om
)) {

655 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

656 
home
, 
PATH_SEPARATOR
[0], 
log_d
);

659 
logd
 = 
	`rdup
(
om
);

660 i((
size_t
)(
t
 = 
	`tf
(
to
, (to),

661 "%s%c%s%c", 
backup_d
, 
PATH_SEPARATOR
[0],

662 
log_d
, 
PATH_SEPARATOR
[0])>(
to
)) {

663 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

664 
backup_d
, 
PATH_SEPARATOR
[0], 
log_d
);

667 
backupd
 = 
	`rdup
(
to
);

670 i((
t
 = 
	`__db_mkth
(
v
, 
backupd
)) != 0) {

671 
dbv
->
	`r
(dbv, 
t
, "%s: cn ce", 
backupd
);

675 
backupd
[
t
 - 1] = '\0';

677 
backupd
 = 
backup_d
;

678 
logd
 = 
log_d
;

681 
aga
: 
aag
 = 
DB_ARCH_LOG
;

687 i(
upde
)

688 
aag
 = 0;

690 i((
t
 = 
dbv
->
	`log_chive
(dbv, &
mes
, 
aag
)) != 0) {

691 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_archive");

694 i(
mes
 =
NULL
)

695 
de
;

696 
beg
 = 
mes
;

697 ; *
mes
 !
NULL
;ames++) {

699 
v
 = 
	`oi
(*
mes
 + (
LFPREFIX
) - 1);

700 i(*
cy_mp
 =0 || *cy_m> 
v
)

701 *
cy_mp
 = 
v
;

703 i((
size_t
)
	`tf
(
om
, (from), "%s%c%s",

704 
logd
, 
PATH_SEPARATOR
[0], *
mes
>(
om
)) {

705 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

706 
logd
, 
PATH_SEPARATOR
[0], *
mes
);

718 i(
upde
) {

719 i((
size_t
)
	`tf
(
to
, (to), "%s%c%s",

720 
backupd
, 
PATH_SEPARATOR
[0], *
mes
>(
to
)) {

721 
dbv
->
	`rx
(dbenv, "%s%c%s:athooong",

722 
backupd
, 
PATH_SEPARATOR
[0], *
mes
);

725 i(
	`__os_me
(
v
, 
om
, 
to
, 1) == 0) {

726 i(
vbo
)

727 
	`tf
("%s: moving %so %s\n",

728 
ogme
, 
om
, 
to
);

734 i(
	`db_hbackup_da_cy
(
dbv
, *
mes
, 
logd
, 
backupd
, 
vbo
) != 0)

737 i(
upde
) {

738 i(
vbo
)

739 
	`tf
("%s:emovg %s\n", 
ogme
, 
om
);

740 i((
t
 = 
	`__os_uƚk
(
v
, 
om
, 0)) != 0) {

741 
dbv
->
	`r
(dbv, 
t
,

742 "uƚk o%ed", 
om
);

749 
	`
(
beg
);

750 
de
: i(
upde
) {

751 
upde
 = 0;

752 
aga
;

755 i(
vbo
 && *
cy_mp
 != 0)

756 
	`tf
("%s:owestumberedog file copied: %d\n",

757 
ogme
, *
cy_mp
);

758 i(
logd
 !
log_d
)

759 
	`
(
logd
);

760 i(
backupd
 !
backup_d
)

761 
	`
(
backupd
);

764 
	}
}

771 
	$db_hbackup_da_cy
(
dbv
, 
fe
, 
om_d
, 
to_d
, 
vbo
)

772 
DB_ENV
 *
dbv
;

773 *
fe
, *
om_d
, *
to_d
;

774 
vbo
;

776 
DB_FH
 *
rfhp
, *
wfhp
;

777 
ENV
 *
v
;

778 
size_t
 

, 
nw
;

779 
t
;

780 *
buf
;

782 
rfhp
 = 
wfhp
 = 
NULL
;

783 
v
 = 
dbv
->env;

784 
t
 = 0;

786 i(
vbo
)

787 
	`tf
("%s: cyg %s%c%t%s%c%s\n", 
ogme
, 
om_d
,

788 
PATH_SEPARATOR
[0], 
fe
, 
to_d
, PATH_SEPARATOR[0], file);

800 i((
buf
 = 
	`mloc
(
MEGABYTE
)=
NULL
) {

801 
dbv
->
	`r
(dbenv,

802 
o
, "%lu buf㸮loti", (
u_lg
)
MEGABYTE
);

807 i(
	`tf
(
buf
, 
MEGABYTE
, "%s%c%s",

808 
om_d
, 
PATH_SEPARATOR
[0], 
fe
>
MEGABYTE
) {

809 
dbv
->
	`rx
(dbenv,

810 "%s%c%s:holg", 
om_d
, 
PATH_SEPARATOR
[0], 
fe
);

811 
r
;

813 i((
t
 = 
	`__os_ݒ
(
v
, 
buf
, 0, 
DB_OSO_RDONLY
, 0, &
rfhp
)) != 0) {

814 
dbv
->
	`r
(dbv, 
t
, "%s", 
buf
);

815 
r
;

819 i(
	`tf
(
buf
, 
MEGABYTE
, "%s%c%s",

820 
to_d
, 
PATH_SEPARATOR
[0], 
fe
>
MEGABYTE
) {

821 
dbv
->
	`rx
(dbenv,

822 "%s%c%s:holg", 
to_d
, 
PATH_SEPARATOR
[0], 
fe
);

823 
r
;

825 i((
t
 = 
	`__os_ݒ
(
v
, 
buf
, 0,

826 
DB_OSO_CREATE
 | 
DB_OSO_TRUNC
, 
DB_MODE_600
, &
wfhp
)) != 0) {

827 
dbv
->
	`r
(dbv, 
t
, "%s", 
buf
);

828 
r
;

832 (
t
 = 
	`__os_ad
(
v
, 
rfhp
, 
buf
, 
MEGABYTE
, &

)) == 0 &&

833 

 > 0)

834 i((
t
 = 
	`__os_wre
(
v
, 
wfhp
, 
buf
, 

, &
nw
)) != 0)

838 
r
: 
t
 = 1;

840 i(
buf
 !
NULL
)

841 
	`
(
buf
);

843 i(
rfhp
 !
NULL
 && 
	`__os_ohd
(
v
,fhp) != 0)

844 
t
 = 1;

847 i(
wfhp
 !
NULL
) {

848 i(
	`__os_fsync
(
v
, 
wfhp
) != 0)

849 
t
 = 1;

850 i(
	`__os_ohd
(
v
, 
wfhp
) != 0)

851 
t
 = 1;

853  (
t
);

854 
	}
}

857 
	$db_hbackup_uge
()

859 ()
	`rtf
(
dr
, "uge: %[-cDuVv]\n\t%s\n", 
ogme
,

861  (
EXIT_FAILURE
);

862 
	}
}

865 
	$db_hbackup_vsi_check
()

867 
v_maj
, 
v_m
, 
v_tch
;

870 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

871 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

872 
	`rtf
(
dr
,

874 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

875 
v_maj
, 
v_m
);

876  (
EXIT_FAILURE
);

879 
	}
}

	@../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
->
v
? 
DB_AUTO_COMMIT
 : 0),

414 
DB_MODE_666
)) != 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
->
v
) &&

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 i(
txn
 !
NULL
 && (
t
 =xn->
	`comm
(txn, 0)) != 0) {

543 
txn
 = 
NULL
;

544 
r
;

548 
r
: 
rv
 = 1;

549 i(
txn
 !
NULL
)

550 ()
txn
->
	`abt
(txn);

554 i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 0)) != 0) {

555 
dbv
->
	`r
(dbv, 
t
, "DB->close");

556 
rv
 = 1;

559 i(
	`G
(
hdrbuf
!
NULL
)

560 
	`
(
	`G
(
hdrbuf
));

561 
	`G
(
hdrbuf

NULL
;

563 i(
subdb
 !
NULL
)

564 
	`
(
subdb
);

565 i(
dbty
 !
DB_RECNO
 && dbty !
DB_QUEUE
 && 
key
.
da
 !
NULL
)

566 
	`
(
key
.
da
);

567 i(
rkey
.
da
 !
NULL
)

568 
	`
(
rkey
.
da
);

569 
	`
(
da
.data);

571  (
rv
);

572 
	}
}

579 
	$db_ld_v_
(
dbvp
, 
ldg
)

580 
DB_ENV
 **
dbvp
;

581 
LDG
 *
ldg
;

583 
DB_ENV
 *
dbv
;

584 
t
;

586 i((
t
 = 
	`db_v_
(
dbvp
, 0)) != 0) {

587 
	`rtf
(
dr
,

588 "%s: db_v_: %s\n", 
ldg
->
ogme
, 
	`db_
(
t
));

589  (
t
);

591 
dbv
 = *
dbvp
;

592 
dbv
->
	`t_rfe
(dbv, 
dr
);

593 
dbv
->
	`t_fx
(dbv, 
ldg
->
ogme
);

594 i(
ldg
->
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

595 
ldg
->
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

596 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

597  (
t
);

599 i((
t
 = 
	`db_ld_db_
(
dbv
, 
ldg
->
home
,dg->
che
, &ldg->
ive
)) != 0)

600  (
t
);

601 
dbv
->
p_ive
 = 
ldg
;

604 
	}
}

611 
	$db_ld_db_
(
dbv
, 
home
, 
che
, 
is_ive
)

612 
DB_ENV
 *
dbv
;

613 *
home
;

614 
u_t32_t
 
che
;

615 *
is_ive
;

617 
u_t32_t
 
ags
;

618 
t
;

620 *
is_ive
 = 0;

622 
ags
 = 
DB_USE_ENVIRON
 |

623 
DB_INIT_LOCK
 | 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
;

624 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
ags
, 0)) == 0)

626 i(
t
 =
DB_VERSION_MISMATCH
)

627 
r
;

641 
	`LF_CLR
(
DB_INIT_LOCK
 | 
DB_INIT_LOG
 | 
DB_INIT_TXN
);

642 
	`LF_SET
(
DB_CREATE
 | 
DB_PRIVATE
);

643 *
is_ive
 = 1;

644 i((
t
 = 
dbv
->
	`t_chesize
(dbv, 0, 
che
, 1)) != 0) {

645 
dbv
->
	`r
(dbv, 
t
, "set_cachesize");

648 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
ags
, 0)) == 0)

652 
r
: 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

654 
	}
}

656 
	#FLAG
(
me
, 
vue
, 
keywd
, 
ag
) \

657 i(
	`rcmp
(
me
, 
keywd
) == 0) { \

658 *
vue
) { \

660 i((
t
 = 
dbp
->
	`t_ags
(dbp, 
ag
)) != 0) { \

661 
dbp
->
	`r
(dbp, 
t
, "%s: set_flags: %s", \

662 
	`G
(
ogme
), 
me
); \

663 
r
; \

669 
	`db_ld_badnum
(
dbv
); \

670 
r
; \

673 }

	)

674 
	#NUMBER
(
me
, 
vue
, 
keywd
, 
func
, 
t
) \

675 i(
	`rcmp
(
me
, 
keywd
) == 0) { \

676 i((
t
 = 
	`__db_glg
(
dbv
, \

677 
NULL
, 
vue
, 0, 
LONG_MAX
, &
v
)) != 0 || \

678 (
t
 = 
dbp
->
	`func
(dbp, (
t
)
v
)) != 0) \

679 
m
; \

681 }

	)

682 
	#STRING
(
me
, 
vue
, 
keywd
, 
func
) \

683 i(
	`rcmp
(
me
, 
keywd
) == 0) { \

684 i((
t
 = 
dbp
->
	`func
(dbp, 
vue
[0])) != 0) \

685 
m
; \

687 }

	)

694 
	#CONFIGURATION_LIST_COMPARE
 \

695 
	`NUMBER
(
me
, 
vue
, "bt_mkey", 
t_bt_mkey
, 
u_t32_t
); \

696 
	`FLAG
(
me
, 
vue
, "chksum", 
DB_CHKSUM
); \

697 
	`NUMBER
(
me
, 
vue
, "db_ld", 
t_ld
, ); \

698 
	`NUMBER
(
me
, 
vue
, "db_gesize", 
t_gesize
, 
u_t32_t
); \

699 
	`FLAG
(
me
, 
vue
, "duis", 
DB_DUP
); \

700 
	`FLAG
(
me
, 
vue
, "dupst", 
DB_DUPSORT
); \

701 
	`NUMBER
(
me
, 
vue
, "exsize", 
t_q_exsize
, 
u_t32_t
); \

702 
	`NUMBER
(
me
, 
vue
, "h_f", 
t_h_f
, 
u_t32_t
); \

703 
	`NUMBER
(
me
, 
vue
, "h_m", 
t_h_m
, 
u_t32_t
); \

704 
	`NUMBER
(
me
, 
vue
, "_n", 
t__n
, 
u_t32_t
); \

705 
	`STRING
(
me
, 
vue
, "_d", 
t__d
); \

706 
	`FLAG
(
me
, 
vue
, "um", 
DB_RECNUM
); \

707 
	`FLAG
(
me
, 
vue
, "numb", 
DB_RENUMBER
)

	)

714 
	$db_ld_cfigu
(
dbv
, 
dbp
, 
p
, 
subdbp
, 
key
)

715 
DB_ENV
 *
dbv
;

716 
DB
 *
dbp
;

717 **
p
, **
subdbp
;

718 *
key
;

720 
v
;

721 
t
, 
vech
;

722 *
me
, *
vue
;

724 ; (
me
 = *
p
!
NULL
; *--
vue
 = 
vech
, ++clp) {

725 i((
vue
 = 
	`rchr
(
me
, '=')=
NULL
) {

726 
dbp
->
	`rx
(dbp,

730 
vech
 = *
vue
;

731 *
vue
++ = '\0';

733 i(
	`rcmp
(
me
, "database") == 0 ||

734 
	`rcmp
(
me
, "subdatabase") == 0) {

735 i(*
subdbp
 !
NULL
)

736 
	`
(*
subdbp
);

737 i((*
subdbp
 = 
	`rdup
(
vue
)=
NULL
) {

738 
dbp
->
	`r
(dbp, 
ENOMEM
, 
NULL
);

743 i(
	`rcmp
(
me
, "keys") == 0) {

744 i(
	`rcmp
(
vue
, "1") == 0)

745 *
key
 = 1;

746 i(
	`rcmp
(
vue
, "0") == 0)

747 *
key
 = 0;

749 
	`db_ld_badnum
(
dbv
);

755 
CONFIGURATION_LIST_COMPARE
;

757 
dbp
->
	`rx
(dbp,

758 "unknowcommd-lcfiguti keywd \"%s\"", 
me
);

763 
m
:

764 
dbp
->
	`r
(dbp, 
t
, "%s: %s=%s", 
	`G
(
ogme
), 
me
, 
vue
);

765 
r
:  (1);

766 
	}
}

773 
	$db_ld_rhd
(
dbv
, 
dbp
, 
dbtyp
, 
subdbp
, 
check
, 
key
)

774 
DB_ENV
 *
dbv
;

775 
DB
 *
dbp
;

776 
DBTYPE
 *
dbtyp
;

777 **
subdbp
;

778 *
check
, *
key
;

780 
size_t
 
bu
, 
l
, 
t
;

781 
v
;

782 
ch
, 
f
, 
hdr
, 
t
;

783 *
buf
, *
me
, *
p
, *
vue
;

785 *
dbtyp
 = 
DB_UNKNOWN
;

786 *
check
 = 0;

787 
me
 = 
NULL
;

793 
bu
 = 4096;

794 i(
	`G
(
hdrbuf
=
NULL
) {

795 
hdr
 = 0;

796 i((
buf
 = 
	`mloc
(
bu
)=
NULL
)

797 
memr
;

798 
	`G
(
hdrbuf

buf
;

799 
	`G
(
igle
G(
lo
);

801 
hdr
 = 1;

802 
buf
 = 
	`G
(
hdrbuf
);

803 
	`G
(
lo
G(
igle
);

806 
t
 = 0;

807 
f
 = 1;; first = 0) {

808 ++
	`G
(
lo
);

811 
l
 = 0;

812 
buf
 = &
	`G
(
hdrbuf
)[
t
];

813 i(
hdr
 == 0) {

815 i((
ch
 = 
	`gch
()=
EOF
) {

816 i(!
f
 || 
	`
(
d
))

817 
badfmt
;

818 
	`G
(
dofe
) = 1;

825 i(
l
 + 
t
 =
bu
) {

826 
	`G
(
hdrbuf
) =

827 
	`loc
(
	`G
(
hdrbuf
), 
bu
 *= 2);

828 i(
	`G
(
hdrbuf
=
NULL
)

829 
memr
;

830 
buf
 = &
	`G
(
hdrbuf
)[
t
];

833 i(
ch
 == '\n')

836 
buf
[
l
++] = 
ch
;

838 i(
	`G
(
dofe
) == 1)

840 
buf
[
l
++] = '\0';

842 
l
 = 
	`
(
buf
) + 1;

843 
t
 +
l
;

845 i(
me
 !
NULL
) {

846 
	`
(
me
);

847 
me
 = 
NULL
;

850 i((
me
 = 
	`rdup
(
buf
)=
NULL
)

851 
memr
;

852 i((
p
 = 
	`rchr
(
me
, '=')=
NULL
)

853 
badfmt
;

854 *
p
++ = '\0';

856 
vue
 = 
p
--;

858 i(
me
[0] == '\0')

859 
badfmt
;

868 i(
	`rcmp
(
me
, "database") == 0 ||

869 
	`rcmp
(
me
, "subdatabase") == 0) {

870 i((
t
 = 
	`db_ld_cvb
(
dbv
, 
vue
, 
subdbp
)) != 0) {

871 
dbp
->
	`r
(dbp, 
t
, "erroreading dbame");

872 
r
;

878 i(
vue
[0] == '\0')

879 
badfmt
;

881 i(
	`rcmp
(
me
, "HEADER") == 0)

883 i(
	`rcmp
(
me
, "VERSION") == 0) {

888 
	`G
(
vsi

	`oi
(
vue
);

890 i(
	`G
(
vsi
) > 3) {

891 
dbp
->
	`rx
(dbp,

893 
	`G
(
lo
), G(
vsi
));

894 
r
;

898 i(
	`rcmp
(
me
, "format") == 0) {

899 i(
	`rcmp
(
vue
, "bytevalue") == 0) {

900 *
check
 = 0;

903 i(
	`rcmp
(
vue
, "print") == 0) {

904 *
check
 = 1;

907 
badfmt
;

909 i(
	`rcmp
(
me
, "type") == 0) {

910 i(
	`rcmp
(
vue
, "btree") == 0) {

911 *
dbtyp
 = 
DB_BTREE
;

914 i(
	`rcmp
(
vue
, "hash") == 0) {

915 *
dbtyp
 = 
DB_HASH
;

918 i(
	`rcmp
(
vue
, "recno") == 0) {

919 *
dbtyp
 = 
DB_RECNO
;

922 i(
	`rcmp
(
vue
, "queue") == 0) {

923 *
dbtyp
 = 
DB_QUEUE
;

926 
dbp
->
	`rx
(dbp, "l%lu: unknowty", 
	`G
(
lo
));

927 
r
;

929 i(
	`rcmp
(
me
, "keys") == 0) {

930 i(
	`rcmp
(
vue
, "1") == 0)

931 *
key
 = 1;

932 i(
	`rcmp
(
vue
, "0") == 0)

933 *
key
 = 0;

935 
	`db_ld_badnum
(
dbv
);

936 
r
;

941 
CONFIGURATION_LIST_COMPARE
;

943 
dbp
->
	`rx
(dbp,

945 
me
);

946 
r
;

948 
t
 = 0;

951 
m
: 
dbp
->
	`r
(dbp, 
t
, "%s: %s=%s", 
	`G
(
ogme
), 
me
, 
vue
);

952 
t
 = 1;

955 
badfmt
: 
dbp
->
	`rx
(dbp, "l%lu: uxed fm", 
	`G
(
lo
));

956 
t
 = 1;

959 
memr
: 
dbp
->
	`rx
(dbp, "unableollocate memory");

960 
r
: 
t
 = 1;

962 i(
me
 !
NULL
)

963 
	`
(
me
);

964  (
t
);

965 
	}
}

974 
	#DIGITIZE
(
e
, 
v1
, 
v2
) { \

975 
_v1
, 
_v2
; \

976 
_v1
 = (
v1
); \

977 
_v2
 = (
v2
); \

978 i((
_v1
> 'f' || (
_v2
) > 'f') \

979  (
	`db_ld_badd
(
dbv
)); \

980 (
e
) = \

981 ((
_v1
) == '0' ? 0 : \

982 ((
_v1
) == '1' ? 1 : \

983 ((
_v1
) == '2' ? 2 : \

984 ((
_v1
) == '3' ? 3 : \

985 ((
_v1
) == '4' ? 4 : \

986 ((
_v1
) == '5' ? 5 : \

987 ((
_v1
) == '6' ? 6 : \

988 ((
_v1
) == '7' ? 7 : \

989 ((
_v1
) == '8' ? 8 : \

990 ((
_v1
) == '9' ? 9 : \

991 ((
_v1
) == 'a' ? 10 : \

992 ((
_v1
) == 'b' ? 11 : \

993 ((
_v1
) == 'c' ? 12 : \

994 ((
_v1
) == 'd' ? 13 : \

995 ((
_v1
) == 'e' ? 14 : 15))))))))))))))) << 4 | \

996 ((
_v2
) == '0' ? 0 : \

997 ((
_v2
) == '1' ? 1 : \

998 ((
_v2
) == '2' ? 2 : \

999 ((
_v2
) == '3' ? 3 : \

1000 ((
_v2
) == '4' ? 4 : \

1001 ((
_v2
) == '5' ? 5 : \

1002 ((
_v2
) == '6' ? 6 : \

1003 ((
_v2
) == '7' ? 7 : \

1004 ((
_v2
) == '8' ? 8 : \

1005 ((
_v2
) == '9' ? 9 : \

1006 ((
_v2
) == 'a' ? 10 : \

1007 ((
_v2
) == 'b' ? 11 : \

1008 ((
_v2
) == 'c' ? 12 : \

1009 ((
_v2
) == 'd' ? 13 : \

1010 ((
_v2
) == 'e' ? 14 : 15))))))))))))))); \

1011 }

	)

1027 
	$db_ld_cvb
(
dbv
, 
r
, 
out
)

1028 
DB_ENV
 *
dbv
;

1029 *
r
, **
out
;

1031 *
outr
;

1040 i((
outr
 = 
	`mloc
(
	`
(
r
+ 1)=
NULL
)

1041  (
ENOMEM
);

1043 *
out
 = 
outr
;

1045  ; *
r
 != '\0'; instr++)

1046 i(*
r
 == '\\') {

1047 i(*++
r
 == '\\') {

1048 *
outr
++ = '\\';

1051 
	`DIGITIZE
(*
outr
++, *
r
, *++instr);

1053 *
outr
++ = *
r
;

1055 *
outr
 = '\0';

1058 
	}
}

1065 
	$db_ld_dbt_rt
(
dbv
, 
db
)

1066 
DB_ENV
 *
dbv
;

1067 
DBT
 *
db
;

1069 
u_t32_t
 
n
;

1070 
u_t8_t
 *
p
;

1071 
c1
, 
c2
, 
es
, 
f
;

1072 
buf
[32];

1074 ++
	`G
(
lo
);

1076 
f
 = 1;

1077 
es
 = 0;

1078 
p
 = 
db
->
da
, 
n
 = 0; (
c1
 = 
	`gch
()) != '\n';) {

1079 i(
c1
 =
EOF
) {

1080 i(
n
 == 0) {

1081 
	`G
(
dofe
G(
doda
) = 1;

1084  (
	`db_ld_badd
(
dbv
));

1086 i(
f
) {

1087 
f
 = 0;

1088 i(
	`G
(
vsi
) > 1) {

1089 i(
c1
 != ' ') {

1090 
buf
[0] = 
c1
;

1091 i(
	`fgs
(
buf
 + 1,

1092 (
buf
- 1, 
d
=
NULL
 ||

1093 
	`rcmp
(
buf
, "DATA=END\n") != 0)

1094  (
	`db_ld_badd
(
dbv
));

1095 
	`G
(
doda
) = 1;

1101 i(
es
) {

1102 i(
c1
 != '\\') {

1103 i((
c2
 = 
	`gch
()=
EOF
)

1104  (
	`db_ld_badd
(
dbv
));

1105 
	`DIGITIZE
(
c1
, c1, 
c2
);

1107 
es
 = 0;

1109 i(
c1
 == '\\') {

1110 
es
 = 1;

1113 i(
n
 >
db
->
un
 - 10) {

1114 
db
->
un
 *= 2;

1115 i((
db
->
da
 =

1116 
	`loc
(
db
->
da
, db->
un
)=
NULL
) {

1117 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

1120 
p
 = (
u_t8_t
 *)
db
->
da
 + 
n
;

1122 ++
n
;

1123 *
p
++ = 
c1
;

1125 
db
->
size
 = 
n
;

1128 
	}
}

1135 
	$db_ld_dbt_rdump
(
dbv
, 
db
)

1136 
DB_ENV
 *
dbv
;

1137 
DBT
 *
db
;

1139 
u_t32_t
 
n
;

1140 
u_t8_t
 *
p
;

1141 
c1
, 
c2
, 
f
;

1142 
buf
[32];

1144 ++
	`G
(
lo
);

1146 
f
 = 1;

1147 
p
 = 
db
->
da
, 
n
 = 0; (
c1
 = 
	`gch
()) != '\n';) {

1148 i(
c1
 =
EOF
) {

1149 i(
n
 == 0) {

1150 
	`G
(
dofe
G(
doda
) = 1;

1153  (
	`db_ld_badd
(
dbv
));

1155 i(
f
) {

1156 
f
 = 0;

1157 i(
	`G
(
vsi
) > 1) {

1158 i(
c1
 != ' ') {

1159 
buf
[0] = 
c1
;

1160 i(
	`fgs
(
buf
 + 1,

1161 (
buf
- 1, 
d
=
NULL
 ||

1162 
	`rcmp
(
buf
, "DATA=END\n") != 0)

1163  (
	`db_ld_badd
(
dbv
));

1164 
	`G
(
doda
) = 1;

1170 i((
c2
 = 
	`gch
()=
EOF
)

1171  (
	`db_ld_badd
(
dbv
));

1172 i(
n
 >
db
->
un
 - 10) {

1173 
db
->
un
 *= 2;

1174 i((
db
->
da
 =

1175 
	`loc
(
db
->
da
, db->
un
)=
NULL
) {

1176 
dbv
->
	`r
(dbv, 
ENOMEM
, 
NULL
);

1179 
p
 = (
u_t8_t
 *)
db
->
da
 + 
n
;

1181 ++
n
;

1182 
	`DIGITIZE
(*
p
++, 
c1
, 
c2
);

1184 
db
->
size
 = 
n
;

1187 
	}
}

1194 
	$db_ld_dbt_eo
(
dbv
, 
db
, 
ishex
)

1195 
DB_ENV
 *
dbv
;

1196 
DBT
 *
db
;

1197 
ishex
;

1199 
buf
[32], *
p
, *
q
;

1200 
u_lg
 
o
;

1202 ++
	`G
(
lo
);

1204 i(
	`fgs
(
buf
, (buf), 
d
=
NULL
) {

1205 
	`G
(
dofe
G(
doda
) = 1;

1209 i(
	`rcmp
(
buf
, "DATA=END\n") == 0) {

1210 
	`G
(
doda
) = 1;

1214 i(
buf
[0] != ' ')

1215 
r
;

1221 i(
ishex
) {

1222 
p
 = 
q
 = 
buf
 + 1; *q != '\0' && *q != '\n';) {

1230 i(*
q
++ != '3')

1231 
r
;

1232 i(*
q
 == '\n' || *q == '\0')

1233 
r
;

1234 *
p
++ = *
q
++;

1236 *
p
 = '\0';

1239 i(
	`__db_gulg
(
dbv
, 
	`G
(
ogme
), 
buf
 + 1, 0, 0, &
o
))

1240 
r
;

1242 *((
db_o_t
 *)
db
->
da

o
;

1243 
db
->
size
 = (
db_o_t
);

1246 
r
:  (
	`db_ld_badd
(
dbv
));

1247 
	}
}

1250 
	$db_ld_dbt_to_o
(
dbv
, 
dbt
, 

)

1251 
DB_ENV
 *
dbv
;

1252 
DBT
 *
dbt
;

1253 
db_o_t
 *

;

1255 
buf
[32];

1257 
	`memy
(
buf
, 
dbt
->
da
, dbt->
size
);

1258 
buf
[
dbt
->
size
] = '\0';

1260  (
	`__db_gulg
(
dbv
, 
	`G
(
ogme
), 
buf
, 0, 0, (
u_lg
 *)

));

1261 
	}
}

1268 
	$db_ld_badnum
(
dbv
)

1269 
DB_ENV
 *
dbv
;

1271 
dbv
->
	`rx
(dbenv,

1273 
	}
}

1280 
	$db_ld_badd
(
dbv
)

1281 
DB_ENV
 *
dbv
;

1283 
dbv
->
	`rx
(dbenv, "unexpectednd of input data or key/dataair");

1285 
	}
}

1292 
	$db_ld_uge
()

1294 ()
	`rtf
(
dr
, "uge: %%s\n\t%s\n", 
ogme
,

1297 ()
	`rtf
(
dr
, "usage: %s %s\n",

1298 
ogme
, "-rsn | fileid [-h home] [-Password] db_file");

1299  (
EXIT_FAILURE
);

1300 
	}
}

1303 
	$db_ld_vsi_check
()

1305 
v_maj
, 
v_m
, 
v_tch
;

1308 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

1309 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

1310 
	`rtf
(
dr
,

1312 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

1313 
v_maj
, 
v_m
);

1314  (
EXIT_FAILURE
);

1317 
	}
}

	@../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_t_p_cd
 
__P
((
DB_ENV
 *, 
DBT
 *, 
DB_LSN
 *, 
db_cs
));

26 
db_og_v__t
 
__P
((
ENV
 *, 
u_t32_t
, 
DB_DISTAB
 *));

27 
db_og_v__t_42
 
__P
((
ENV
 *, 
DB_DISTAB
 *));

28 
db_og_v__t_43
 
__P
((
ENV
 *, 
DB_DISTAB
 *));

29 
db_og_v__t_45
 
__P
((
ENV
 *, 
DB_DISTAB
 *));

30 
db_og_l_g
 
__P
((*, 
DB_LSN
 *));

31 
db_og_ma
 
__P
((, *[]));

32 
db_og_ݒ_p_db
 
__P
((
DB_ENV
 *, 
DB
 **, 
DBC
 **));

33 
db_og_uge
 
__P
(());

34 
db_og_vsi_check
 
__P
(());

36 cڡ *
	gogme
;

39 
	$db_og
(
gs
)

40 *
gs
;

42 
gc
;

43 **
gv
;

45 
	`__db_ut_g
("db_og", 
gs
, &
gc
, &
gv
);

46  (
	`db_og_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

47 
	}
}

49 
	~<dio.h
>

50 
	#ERROR_RETURN
 
ERROR


	)

53 
	$db_og_ma
(
gc
, 
gv
)

54 
gc
;

55 *
gv
[];

57 
*
ݏrg
;

58 

td
, 
__db_gt_t
;

59 
DB
 *
dbp
;

60 
DBC
 *
dbc
;

61 
DBT
 
da
, 
keydbt
;

62 
DB_DISTAB
 
db
;

63 
DB_ENV
 *
dbv
;

64 
DB_LOGC
 *
logc
;

65 
DB_LSN
 
key
, 
t
, 

, 
v
;

66 
ENV
 *
v
;

67 
u_t32_t
 
logcag
, 
wvsi
, 
vsi
;

68 
ch
, 
cmp
, 
exv
, 
nag
, 
rag
, 
t
, 
pag
;

69 *
home
, *
sswd
;

71 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

72 
ogme
 = 
gv
[0];

74 ++
ogme
;

76 i((
t
 = 
	`db_og_vsi_check
()) != 0)

77  (
t
);

79 
dbp
 = 
NULL
;

80 
dbc
 = 
NULL
;

81 
dbv
 = 
NULL
;

82 
logc
 = 
NULL
;

83 
	`ZERO_LSN
(
t
);

84 
	`ZERO_LSN
(

);

85 
exv
 = 
nag
 = 
rag
 = 
pag
 = 0;

86 
home
 = 
sswd
 = 
NULL
;

88 
	`memt
(&
db
, 0, (dtab));

90 
__db_gt_t
 = 1;

91 (
ch
 = 
	`gt
(
gc
, 
gv
, "b:e:h:NP:rRV")!
EOF
)

92 
ch
) {

95 i(
	`db_og_l_g
(
ݏrg
, &
t
))

96  (
	`db_og_uge
());

100 i(
	`db_og_l_g
(
ݏrg
, &

))

101  (
	`db_og_uge
());

104 
home
 = 
ݏrg
;

107 
nag
 = 1;

110 
sswd
 = 
	`rdup
(
ݏrg
);

111 
	`memt
(
ݏrg
, 0, 
	`
(optarg));

112 i(
sswd
 =
NULL
) {

113 
	`rtf
(
dr
, "%s: strdup: %s\n",

114 
ogme
, 
	`
(
o
));

115  (
EXIT_FAILURE
);

119 
rag
 = 1;

122 
pag
 = 1;

125 
	`tf
("%s\n", 
	`db_vsi
(
NULL
, NULL, NULL));

126  (
EXIT_SUCCESS
);

129  (
	`db_og_uge
());

131 
gc
 -
td
;

132 
gv
 +
td
;

134 i(
gc
 > 0)

135  (
	`db_og_uge
());

138 
	`__db_ut_sig
();

144 i((
t
 = 
	`db_v_
(&
dbv
, 0)) != 0) {

145 
	`rtf
(
dr
,

146 "%s: db_v_: %s\n", 
ogme
, 
	`db_
(
t
));

147 
shutdown
;

150 
dbv
->
	`t_rfe
(dbv, 
dr
);

151 
dbv
->
	`t_fx
(dbv, 
ogme
);

153 i(
nag
) {

154 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOLOCKING
, 1)) != 0) {

155 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOLOCKING");

156 
shutdown
;

158 i((
t
 = 
dbv
->
	`t_ags
(dbv, 
DB_NOPANIC
, 1)) != 0) {

159 
dbv
->
	`r
(dbv, 
t
, "set_flags: DB_NOPANIC");

160 
shutdown
;

164 i(
sswd
 !
NULL
 && (
t
 = 
dbv
->
	`t_y
(dbenv,

165 
sswd
, 
DB_ENCRYPT_AES
)) != 0) {

166 
dbv
->
	`r
(dbv, 
t
, "set_passwd");

167 
shutdown
;

174 i((
t
 = 
dbv
->
	`t_p_dich
(

175 
dbv
, 
db_og_t_p_cd
)) != 0) {

176 
dbv
->
	`r
(dbv, 
t
, "app_dispatch");

177 
shutdown
;

187 i(
pag
) {

188 i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

189 
DB_INIT_MPOOL
 | 
DB_USE_ENVIRON
, 0)) != 0 &&

190 (
t
 =
DB_VERSION_MISMATCH
 ||

191 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

192 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0))

194 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

195 
shutdown
;

197 } i((
t
 = 
dbv
->
	`ݒ
(dbv, 
home
, 
DB_USE_ENVIRON
, 0)) != 0 &&

198 (
t
 =
DB_VERSION_MISMATCH
 ||

199 (
t
 = 
dbv
->
	`ݒ
(dbv, 
home
,

200 
DB_CREATE
 | 
DB_INIT_LOG
 | 
DB_PRIVATE
 | 
DB_USE_ENVIRON
, 0)) != 0)) {

201 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->open");

202 
shutdown
;

204 
v
 = 
dbv
->env;

207 i(
pag
) {

208 i((
t
 = 
	`db_og_ݒ_p_db
(
dbv
, &
dbp
, &
dbc
)) != 0)

209 
shutdown
;

210 } i((
t
 = 
dbv
->
	`log_curs
(dbv, &
logc
, 0)) != 0) {

211 
dbv
->
	`r
(dbv, 
t
, "DB_ENV->log_cursor");

212 
shutdown
;

215 i(
	`IS_ZERO_LSN
(
t
)) {

216 
	`memt
(&
keydbt
, 0, (keydbt));

217 
logcag
 = 
rag
 ? 
DB_PREV
 : 
DB_NEXT
;

219 
key
 = 
t
;

220 
logcag
 = 
DB_SET
;

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

230 i(
pag
)

231 
vsi
 = 
DB_LOGVERSION
;

233 
vsi
 = 0;

234 
	`ZERO_LSN
(
v
);

237 i(
pag
 &&

238 (
t
 = 
	`db_og_v__t
(
v
, 
vsi
, &
db
)) != 0) {

239 
dbv
->
	`r
(dbv, 
t
, "callback: initialization");

240 
shutdown
;

242 ; !
	`__db_ut_ued
(); 
logcag
 = 
rag
 ? 
DB_PREV
 : 
DB_NEXT
) {

243 i(
pag
) {

244 
t
 = 
dbc
->
	`g
(dbc, &
keydbt
, &
da
, 
logcag
);

245 i(
t
 == 0)

246 
key
 = ((
__p_cڌ_gs
 *)
keydbt
.
da
)->
l
;

248 
t
 = 
logc
->
	`g
ogc, &
key
, &
da
, 
logcag
);

249 i(
t
 != 0) {

250 i(
t
 =
DB_NOTFOUND
)

252 
dbv
->
	`r
(dbenv,

253 
t
, 
pag
 ? "DBC->get" : "DB_LOGC->get");

254 
shutdown
;

260 i(!
	`IS_ZERO_LSN
(

)) {

261 
cmp
 = 
	`LOG_COMPARE
(&
key
, &

);

262 i((
rag
 && 
cmp
 < 0) || (!rflag && cmp > 0))

265 i(!
pag
 && 
key
.
fe
 !
v
.file) {

271 i((
t
 = 
logc
->
	`vsi
ogc, &
wvsi
, 0)) != 0) {

272 
dbv
->
	`r
(dbv, 
t
, "DB_LOGC->version");

273 
shutdown
;

275 i(
vsi
 !
wvsi
) {

276 
vsi
 = 
wvsi
;

277 i((
t
 = 
	`db_og_v__t
(
v
, 
vsi
,

278 &
db
)) != 0) {

279 
dbv
->
	`r
(dbv, 
t
,

281 
shutdown
;

286 
t
 = 
	`__db_dich
(
dbv
->
v
,

287 &
db
, &
da
, &
key
, 
DB_TXN_PRINT
, 
NULL
);

293 ()
	`fush
(
dout
);

295 i(
t
 != 0) {

296 
dbv
->
	`r
(dbv, 
t
, "tx: dispatch");

297 
shutdown
;

302 
shutdown
: 
exv
 = 1;

304 i(
logc
 !
NULL
 && (
t
 =ogc->
	`o
(logc, 0)) != 0)

305 
exv
 = 1;

307 i(
dbc
 !
NULL
 && (
t
 = dbc->
	`o
(dbc)) != 0)

308 
exv
 = 1;

310 i(
dbp
 !
NULL
 && (
t
 = dbp->
	`o
(dbp, 0)) != 0)

311 
exv
 = 1;

313 i(
dbv
 !
NULL
 && (
t
 = dbv->
	`o
(dbenv, 0)) != 0) {

314 
exv
 = 1;

315 
	`rtf
(
dr
,

316 "%s: dbv->o: %s\n", 
ogme
, 
	`db_
(
t
));

319 i(
sswd
 !
NULL
)

320 
	`
(
sswd
);

323 
	`__db_ut_signd
();

325  (
exv
 =0 ? 
EXIT_SUCCESS
 : 
EXIT_FAILURE
);

326 
	}
}

332 
	$db_og_v__t
(
v
, 
vsi
, 
dbp
)

333 
ENV
 *
v
;

334 
u_t32_t
 
vsi
;

335 
DB_DISTAB
 *
dbp
;

337 
t
;

344 i((
t
 = 
	`db_og_v__t_45
(
v
, 
dbp
)) != 0)

345  (
t
);

347 
vsi
) {

355 
DB_LOGVERSION_47
:

356 
DB_LOGVERSION_46
:

357 
DB_LOGVERSION_45
:

358 
DB_LOGVERSION_44
:

359 
t
 = 0;

361 
DB_LOGVERSION_43
:

362 
t
 = 
	`db_og_v__t_43
(
v
, 
dbp
);

364 
DB_LOGVERSION_42
:

365 
t
 = 
	`db_og_v__t_42
(
v
, 
dbp
);

368 
v
->
dbv
->
	`rx
(env->dbenv,

369 "Unknowvsi %lu", (
u_lg
)
vsi
);

370 
t
 = 
EINVAL
;

373  (
t
);

374 
	}
}

377 
	$db_og_v__t_42
(
v
, 
dbp
)

378 
ENV
 *
v
;

379 
DB_DISTAB
 *
dbp
;

381 
t
;

383 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

384 
__db_lk_42_t
, 
DB___db_lk_42
)) != 0)

385 
r
;

386 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

387 
__db_pg_loc_42_t
, 
DB___db_pg_loc_42
)) != 0)

388 
r
;

389 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

390 
__db_pg__42_t
, 
DB___db_pg__42
)) != 0)

391 
r
;

392 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

393 
__db_pg_da_42_t
, 
DB___db_pg_da_42
)) != 0)

394 
r
;

395 #i
HAVE_HASH


396 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

397 
__ham_magroup_42_t
, 
DB___ham_magroup_42
)) != 0)

398 
r
;

399 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

400 
__ham_grouoc_42_t
, 
DB___ham_grouoc_42
)) != 0)

401 
r
;

403 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

404 
__txn_ckp_42_t
, 
DB___txn_ckp_42
)) != 0)

405 
r
;

406 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

407 
__txn_g_42_t
, 
DB___txn_g_42
)) != 0)

408 
r
;

409 
r
:

410  (
t
);

411 
	}
}

414 
	$db_og_v__t_43
(
v
, 
dbp
)

415 
ENV
 *
v
;

416 
DB_DISTAB
 *
dbp
;

418 
t
;

420 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

421 
__bam_lk_43_t
, 
DB___bam_lk_43
)) != 0)

422 
r
;

426 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

427 
__txn_g_42_t
, 
DB___txn_g_42
)) != 0)

428 
r
;

429 
r
:

430  (
t
);

431 
	}
}

438 
	$db_og_v__t_45
(
v
, 
dbp
)

439 
ENV
 *
v
;

440 
DB_DISTAB
 *
dbp
;

442 
t
;

444 i((
t
 = 
	`__bam__t
(
v
, 
dbp
)) != 0)

445 
r
;

446 i((
t
 = 
	`__d__t
(
v
, 
dbp
)) != 0)

447 
r
;

448 i((
t
 = 
	`__db__t
(
v
, 
dbp
)) != 0)

449 
r
;

450 i((
t
 = 
	`__dbg__t
(
v
, 
dbp
)) != 0)

451 
r
;

452 i((
t
 = 
	`__f__t
(
v
, 
dbp
)) != 0)

453 
r
;

454 #ifde
HAVE_HASH


455 i((
t
 = 
	`__ham__t
(
v
, 
dbp
)) != 0)

456 
r
;

458 #ifde
HAVE_QUEUE


459 i((
t
 = 
	`__qam__t
(
v
, 
dbp
)) != 0)

460 
r
;

462 i((
t
 = 
	`__txn__t
(
v
, 
dbp
)) != 0)

463 
r
;

464 
r
:

465  (
t
);

466 
	}
}

469 
	$db_og_uge
()

471 
	`rtf
(
dr
, "uge: %%s\n", 
ogme
,

473  (
EXIT_FAILURE
);

474 
	}
}

477 
	$db_og_vsi_check
()

479 
v_maj
, 
v_m
, 
v_tch
;

482 ()
	`db_vsi
(&
v_maj
, &
v_m
, &
v_tch
);

483 i(
v_maj
 !
DB_VERSION_MAJOR
 || 
v_m
 !
DB_VERSION_MINOR
) {

484 
	`rtf
(
dr
,

486 
ogme
, 
DB_VERSION_MAJOR
, 
DB_VERSION_MINOR
,

487 
v_maj
, 
v_m
);

488  (
EXIT_FAILURE
);

491 
	}
}

495 
	$db_og_t_p_cd
(
dbv
, 
dbt
, 
lp
, 

)

496 
DB_ENV
 *
dbv
;

497 
DBT
 *
dbt
;

498 
DB_LSN
 *
lp
;

499 
db_cs
 

;

501 
u_t32_t
 
i
, 
y
;

502 
ch
;

504 
	`DB_ASSERT
(
dbv
->
v
, 

 =
DB_TXN_PRINT
);

506 
	`COMPQUIET
(
dbv
, 
NULL
);

507 
	`COMPQUIET
(

, 
DB_TXN_PRINT
);

513 
	`memy
(&
y
, 
dbt
->
da
, (rectype));

520 
	`tf
("[%lu][%lu]application specificecord:ec: %lu\n",

521 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
, (u_lg)
y
);

522 
	`tf
("\tdata: ");

523 
i
 = 0; i < 
dbt
->
size
; i++) {

524 
ch
 = ((
u_t8_t
 *)
dbt
->
da
)[
i
];

525 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

527 
	`tf
("\n\n");

530 
	}
}

533 
	$db_og_ݒ_p_db
(
dbv
, 
db
, 
db
)

534 
DB_ENV
 *
dbv
;

535 
DB
 **
db
;

536 
DBC
 **
db
;

538 
t
;

540 
DB
 *
dbp
;

541 *
db
 = 
NULL
;

542 *
db
 = 
NULL
;

544 i((
t
 = 
	`db_
(
db
, 
dbv
, 0)) != 0) {

545 
dbv
->
	`r
(dbv, 
t
, "db_create");

546  (
t
);

549 
dbp
 = *
db
;

550 i((
t
 =

551 
dbp
->
	`ݒ
(dbp, 
NULL
, 
REPDBNAME
, NULL, 
DB_BTREE
, 0, 0)) != 0) {

552 
dbv
->
	`r
(dbv, 
t
, "DB->open");

553 
r
;

556 i((
t
 = 
dbp
->
	`curs
(dbp, 
NULL
, 
db
, 0)) != 0) {

557 
dbv
->
	`r
(dbv, 
t
, "DB->cursor");

558 
r
;

563 
r
: i(*
db
 !
NULL
)

564 ()(*
db
)->
	`o
(*dbpp, 0);

565  (
t
);

566 
	}
}

573 
	$db_og_l_g
(
g
, 
lp
)

574 *
g
;

575 
DB_LSN
 *
lp
;

577 
u_lg
 
uv
;

578 *
p
;

583 i((
p
 = 
	`rchr
(
g
, '/')=
NULL
)

585 *
p
 = '\0';

587 i(
	`__db_gulg
(
NULL
, 
ogme
, 
g
, 0, 
UINT32_MAX
, &
uv
))

589 
lp
->
fe
 = 
uv
;

590 i(
	`__db_gulg
(
NULL
, 
ogme
, 
p
 + 1, 0, 
UINT32_MAX
, &
uv
))

592 
lp
->
offt
 = 
uv
;

594 
	}
}

	@../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
->
v
) &&

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
->
v
&& (
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_vxworks/test_micro/b_curalloc.c

4 
	~"bch.h
"

6 
b_cuoc_uge
();

9 
	$b_cuoc
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB
 *
dbp
;

14 
DBC
 *
cu
;

15 
ch
, 
i
, 
cou
;

17 
cou
 = 100000;

18 
__db_gt_t
 = 1;

19 (
ch
 = 
	`gt
(
gc
, 
gv
, "c:")!
EOF
)

20 
ch
) {

22 
cou
 = 
	`oi
(
ݏrg
);

26  (
	`b_cuoc_uge
());

28 
gc
 -
td
;

29 
gv
 +
td
;

30 i(
gc
 != 0)

31  (
	`b_cuoc_uge
());

34 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

35 
dbp
->
	`t_rfe
(dbp, 
dr
);

37 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

38 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

39 
dbp
, 
NULL
, 
TESTFILE
, NULL, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

41 
	`DB_BENCH_ASSERT
(

42 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

46 
TIMER_START
;

47 
i
 = 0; i < 
cou
; ++i) {

48 
	`DB_BENCH_ASSERT
(
dbp
->
	`curs
(dbp, 
NULL
, &
cu
, 0) == 0);

49 
	`DB_BENCH_ASSERT
(
cu
->
	`c_o
(curp) == 0);

51 
TIMER_STOP
;

53 
	`tf
("# %d curs܇otis\n", 
cou
);

54 
	`TIMER_DISPLAY
(
cou
);

56 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

59 
	}
}

62 
	$b_cuoc_uge
()

64 ()
	`rtf
(
dr
, "usage: b_curalloc [-c count]\n");

65  (
EXIT_FAILURE
);

66 
	}
}

	@../build_vxworks/test_micro/b_curwalk.c

4 
	~"bch.h
"

6 
b_curwk_uge
();

9 
	$b_curwk
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB
 *
dbp
;

14 
DBTYPE
 
ty
;

15 
DBC
 *
dbc
;

16 
DBT
 
key
, 
da
;

17 
db_o_t
 
o
;

18 
u_t32_t
 
chesize
, 
gesize
, 
wkags
;

19 
ch
, 
i
, 
cou
, 
dupcou
, 
j
;

20 
ev
, 
t
, 
skdupwk
, 
s܋d
, 
wkcou
;

21 *
ts
, 
dbuf
[32], 
kbuf
[32];

23 
ty
 = 
DB_BTREE
;

24 
chesize
 = 10 * 
MEGABYTE
;

25 
gesize
 = 16 * 1024;

26 
cou
 = 100000;

27 
dupcou
 = 
ev
 = 
skdupwk
 = 
s܋d
 = 0;

28 
wkcou
 = 1000;

29 
ts
 = "Btree";

30 
__db_gt_t
 = 1;

31 (
ch
 = 
	`gt
(
gc
, 
gv
, "C:c:d:P:pS:w:")!
EOF
)

32 
ch
) {

34 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

37 
cou
 = 
	`oi
(
ݏrg
);

40 
dupcou
 = 
	`oi
(
ݏrg
);

43 
gesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

46 
ev
 = 1;

49 
skdupwk
 = 1;

52 
s܋d
 = 1;

55 
ݏrg
[0]) {

57 
ts
 = "Btree";

58 
ty
 = 
DB_BTREE
;

61 i(
	`b_ut_have_hash
())

63 
ts
 = "Hash";

64 
ty
 = 
DB_HASH
;

67 i(
	`b_ut_have_queue
())

69 
ts
 = "Queue";

70 
ty
 = 
DB_QUEUE
;

73 
ts
 = "Recno";

74 
ty
 = 
DB_RECNO
;

77  (
	`b_curwk_uge
());

81 
wkcou
 = 
	`oi
(
ݏrg
);

85  (
	`b_curwk_uge
());

87 
gc
 -
td
;

88 
gv
 +
td
;

89 i(
gc
 != 0)

90  (
	`b_curwk_uge
());

95 i(
dupcou
 !0 && (
ty
 =
DB_QUEUE
 ||y =
DB_RECNO
)) {

96 
	`rtf
(
dr
,

98  (
	`b_curwk_uge
());

101 #i
DB_VERSION_MAJOR
 < 3 || DB_VERSION_MAJOR =3 && 
DB_VERSION_MINOR
 == 0

102 
	#DB_PREV_NODUP
 0

	)

112 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

113 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_chesize
(dbp, 0, 
chesize
, 0) == 0);

114 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_gesize
(dbp, 
gesize
) == 0);

115 
dbp
->
	`t_rfe
(dbp, 
dr
);

118 i(
ty
 =
DB_QUEUE
)

119 
	`DB_BENCH_ASSERT
(
dbp
->
	`t__n
(dbp, 20) == 0);

122 i(
dupcou
 != 0)

123 
	`DB_BENCH_ASSERT
(

124 
dbp
->
	`t_ags
(dbp, 
s܋d
 ? 
DB_DUPSORT
 : 
DB_DUP
) == 0);

126 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

127 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

128 
dbp
, 
NULL
, 
TESTFILE
, NULL, 
ty
, 
DB_CREATE
, 0666) == 0);

130 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

131 
dbp
, 
TESTFILE
, 
NULL
, 
ty
, 
DB_CREATE
, 0666) == 0);

135 
	`memt
(&
key
, 0, (key));

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

139 
da
.d
dbuf
;

140 
da
.
size
 = 20;

141 i(
ty
 =
DB_BTREE
 ||y =
DB_HASH
) {

142 
key
.
size
 = 10;

143 
key
.
da
 = 
kbuf
;

144 
i
 = 0; i < 
cou
; ++i) {

145 ()
	`tf
(
kbuf
, (kbuf), "%010d", 
i
);

146 
j
 = 0; j <
dupcou
; ++j) {

147 ()
	`tf
(
dbuf
, (dbuf), "%020d", 
j
);

148 
	`DB_BENCH_ASSERT
(

149 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

153 
key
.
da
 = &
o
;

154 
key
.
size
 = (
o
);

155 
i
 = 0, 
o
 = 1; i < 
cou
; ++i, ++recno)

156 
	`DB_BENCH_ASSERT
(

157 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

160 
wkags
 = 
ev
 ?

161 (
skdupwk
 ? 
DB_PREV_NODUP
 : 
DB_PREV
) :

162 (
skdupwk
 ? 
DB_NEXT_NODUP
 : 
DB_NEXT
);

165 
TIMER_START
;

166 
i
 = 0; i < 
wkcou
; ++i) {

167 
	`DB_BENCH_ASSERT
(
dbp
->
	`curs
(dbp, 
NULL
, &
dbc
, 0) == 0);

168 (
t
 = 
dbc
->
	`c_g
(dbc, &
key
, &
da
, 
wkags
)) == 0)

170 
	`DB_BENCH_ASSERT
(
t
 =
DB_NOTFOUND
);

171 
	`DB_BENCH_ASSERT
(
dbc
->
	`c_o
(dbc) == 0);

173 
TIMER_STOP
;

175 
	`tf
("# %d %s %s cursor of %d 10/20 byte key/data items",

176 
wkcou
, 
ts
, 
ev
 ?

177 (
skdupwk
 ? "DB_PREV_NODUP" : "DB_PREV") :

178 (
skdupwk
 ? "DB_NEXT_NODUP" : "DB_NEXT"),

179 
cou
);

180 i(
dupcou
 != 0)

181 
	`tf
(" wh %d dups", 
dupcou
);

182 
	`tf
("\n");

191 
	`TIMER_DISPLAY
(()
cou
 * 
wkcou
);

193 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

195  (
EXIT_SUCCESS
);

196 
	}
}

199 
	$b_curwk_uge
()

201 ()
	`rtf
(
dr
, "%s\n\t%s\n",

204  (
EXIT_FAILURE
);

205 
	}
}

	@../build_vxworks/test_micro/b_del.c

4 
	~"bch.h
"

6 
b_d_uge
();

9 
	$b_d
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB
 *
dbp
;

14 
DBC
 *
dbc
;

15 
DBT
 
key
, 
da
;

16 
DBTYPE
 
ty
;

17 
db_o_t
 
o
;

18 
u_t32_t
 
chesize
;

19 
ch
, 
i
, 
cou
, 
t
, 
u_curs
;

20 *
ts
, 
buf
[32];

22 
ty
 = 
DB_BTREE
;

23 
chesize
 = 
MEGABYTE
;

24 
cou
 = 100000;

25 
u_curs
 = 0;

26 
ts
 = "Btree";

27 
__db_gt_t
 = 1;

28 (
ch
 = 
	`gt
(
gc
, 
gv
, "C:c:t:w")!
EOF
)

29 
ch
) {

31 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

34 
cou
 = 
	`oi
(
ݏrg
);

37 
ݏrg
[0]) {

39 
ts
 = "Btree";

40 
ty
 = 
DB_BTREE
;

43 i(
	`b_ut_have_hash
())

45 
ts
 = "Hash";

46 
ty
 = 
DB_HASH
;

49 i(
	`b_ut_have_queue
())

51 
ts
 = "Queue";

52 
ty
 = 
DB_QUEUE
;

55 
ts
 = "Recno";

56 
ty
 = 
DB_RECNO
;

59  (
	`b_d_uge
());

63 
u_curs
 = 1;

67  (
	`b_d_uge
());

69 
gc
 -
td
;

70 
gv
 +
td
;

71 i(
gc
 != 0)

72  (
	`b_d_uge
());

75 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

76 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_chesize
(dbp, 0, 
chesize
, 0) == 0);

77 
dbp
->
	`t_rfe
(dbp, 
dr
);

80 i(
ty
 =
DB_QUEUE
)

81 
	`DB_BENCH_ASSERT
(
dbp
->
	`t__n
(dbp, 20) == 0);

83 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

84 
	`DB_BENCH_ASSERT
(

85 
dbp
->
	`ݒ
(dbp, 
NULL
, 
TESTFILE
, NULL, 
ty
, 
DB_CREATE
, 0666) == 0);

87 
	`DB_BENCH_ASSERT
(

88 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
ty
, 
DB_CREATE
, 0666) == 0);

92 
	`memt
(&
key
, 0, (key));

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

94 
da
.data = "01234567890123456789";

95 
da
.
size
 = 20;

98 
ty
) {

99 
DB_BTREE
:

100 
DB_HASH
:

101 
key
.
da
 = 
buf
;

102 
key
.
size
 = 10;

104 
DB_QUEUE
:

105 
DB_RECNO
:

106 
key
.
da
 = &
o
;

107 
key
.
size
 = (
o
);

109 
DB_UNKNOWN
:

110 
	`b_ut_abt
();

115 i(
ty
 =
DB_BTREE
 ||y =
DB_HASH
)

116 
i
 = 0; i < 
cou
; ++i) {

117 ()
	`tf
(
buf
, (buf), "%010d", 
i
);

118 
	`DB_BENCH_ASSERT
(

119 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

122 
i
 = 0, 
o
 = 1; i < 
cou
; ++i, ++recno)

123 
	`DB_BENCH_ASSERT
(

124 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

127 
TIMER_START
;

128 i(
u_curs
) {

129 
	`DB_BENCH_ASSERT
(
dbp
->
	`curs
(dbp, 
NULL
, &
dbc
, 0) == 0);

130 (
t
 = 
dbc
->
	`c_g
(dbc, &
key
, &
da
, 
DB_NEXT
)) == 0)

131 
	`DB_BENCH_ASSERT
(
dbc
->
	`c_d
(dbc, 0) == 0);

132 
	`DB_BENCH_ASSERT
 (
t
 =
DB_NOTFOUND
);

134 i(
ty
 =
DB_BTREE
 ||y =
DB_HASH
)

135 
i
 = 0; i < 
cou
; ++i) {

136 ()
	`tf
(
buf
, (buf), "%010d", 
i
);

137 
	`DB_BENCH_ASSERT
(

138 
dbp
->
	`d
(dbp, 
NULL
, &
key
, 0) == 0);

141 
i
 = 0, 
o
 = 1; i < 
cou
; ++i, ++recno)

142 
	`DB_BENCH_ASSERT
(

143 
dbp
->
	`d
(dbp, 
NULL
, &
key
, 0) == 0);

145 
TIMER_STOP
;

147 
	`tf
(

149 
cou
, 
ts
, 
u_curs
 ? "a cursor" : "the key");

150 
	`TIMER_DISPLAY
(
cou
);

152 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

155 
	}
}

158 
	$b_d_uge
()

160 ()
	`rtf
(
dr
,

162  (
EXIT_FAILURE
);

163 
	}
}

	@../build_vxworks/test_micro/b_get.c

4 
	~"bch.h
"

6 
b_g_uge
();

9 
	$b_g
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB
 *
dbp
;

14 
DBTYPE
 
ty
;

15 
DBT
 
key
, 
da
;

16 
db_o_t
 
o
;

17 
u_t32_t
 
chesize
;

18 
ch
, 
i
, 
cou
;

19 *
ts
;

21 
ty
 = 
DB_BTREE
;

22 
chesize
 = 
MEGABYTE
;

23 
cou
 = 100000;

24 
ts
 = "Btree";

25 
__db_gt_t
 = 1;

26 (
ch
 = 
	`gt
(
gc
, 
gv
, "C:c:t:")!
EOF
)

27 
ch
) {

29 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

32 
cou
 = 
	`oi
(
ݏrg
);

35 
ݏrg
[0]) {

37 
ts
 = "Btree";

38 
ty
 = 
DB_BTREE
;

41 i(
	`b_ut_have_hash
())

43 
ts
 = "Hash";

44 
ty
 = 
DB_HASH
;

47 i(
	`b_ut_have_queue
())

49 
ts
 = "Queue";

50 
ty
 = 
DB_QUEUE
;

53 
ts
 = "Recno";

54 
ty
 = 
DB_RECNO
;

57  (
	`b_g_uge
());

62  (
	`b_g_uge
());

64 
gc
 -
td
;

65 
gv
 +
td
;

66 i(
gc
 != 0)

67  (
	`b_g_uge
());

70 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

71 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_chesize
(dbp, 0, 
chesize
, 0) == 0);

72 
dbp
->
	`t_rfe
(dbp, 
dr
);

75 i(
ty
 =
DB_QUEUE
)

76 
	`DB_BENCH_ASSERT
(
dbp
->
	`t__n
(dbp, 10) == 0);

78 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

79 
	`DB_BENCH_ASSERT
(

80 
dbp
->
	`ݒ
(dbp, 
NULL
, 
TESTFILE
, NULL, 
ty
, 
DB_CREATE
, 0666) == 0);

82 
	`DB_BENCH_ASSERT
(

83 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
ty
, 
DB_CREATE
, 0666) == 0);

87 
	`memt
(&
key
, 0, (key));

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

89 
ty
) {

90 
DB_BTREE
:

91 
DB_HASH
:

92 
key
.
da
 = "aaaaa";

93 
key
.
size
 = 5;

95 
DB_QUEUE
:

96 
DB_RECNO
:

97 
o
 = 1;

98 
key
.
da
 = &
o
;

99 
key
.
size
 = (
o
);

101 
DB_UNKNOWN
:

102 
	`b_ut_abt
();

105 
da
.data = "bbbbb";

106 
da
.
size
 = 5;

108 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

111 
TIMER_START
;

112 
i
 = 0; i < 
cou
; ++i)

113 
	`DB_BENCH_ASSERT
(
dbp
->
	`g
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

114 
TIMER_STOP
;

116 
	`tf
("# %d %daba g oched key/dem\n", 
cou
, 
ts
);

117 
	`TIMER_DISPLAY
(
cou
);

119 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

122 
	}
}

125 
	$b_g_uge
()

127 ()
	`rtf
(
dr
,

129  (
EXIT_FAILURE
);

130 
	}
}

	@../build_vxworks/test_micro/b_inmem.c

5 
	~"bch.h
"

7 #i
DB_VERSION_MAJOR
 > 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 > 0

11 #unde
MEGABYTE


12 
	#MEGABYTE
 (1024 * 1024)

	)

14 
u_t32_t
 
	gbulkbufsize
 = 4 * 
MEGABYTE
;

15 
u_t32_t
 
	gchesize
 = 32 * 
MEGABYTE
;

16 
u_t32_t
 
	gdasize
 = 32;

17 
u_t32_t
 
	gkeysize
 = 8;

18 
u_t32_t
 
	glogbufsize
 = 8 * 
MEGABYTE
;

19 
u_t32_t
 
	gnumems
;

20 
u_t32_t
 
	ggesize
 = 32 * 1024;

22 
FILE
 *
	g
;

23 *
	gogme
;

25 
b_mem__ds
 
__P
((
u_t
, ));

26 
b_mem__ds_bulk
 
__P
((
u_t
, u_int *));

27 
b_mem__tds
 
__P
((
u_t
, , 
u_t32_t
, u_int32_t));

28 
b_mem_uge
 
__P
(());

31 
	$b_mem__ds
(
u_t
 
s
, 
upde
)

33 
DB_ENV
 *
dbv
;

34 *
ˉs
 = "abcdefghijklmnopqrstuvwxuz";

35 
DB
 *
dbp
;

36 
DBT
 
key
, 
da
;

37 *
keybuf
, *
dabuf
;

38 
DB_MPOOL_STAT
 *
g
;

40 
	`DB_BENCH_ASSERT
((
keybuf
 = 
	`mloc
(
keysize
)!
NULL
);

41 
	`DB_BENCH_ASSERT
((
dabuf
 = 
	`mloc
(
dasize
)!
NULL
);

43 
	`memt
(&
key
, 0, (key));

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

45 
key
.
da
 = 
keybuf
;

46 
key
.
size
 = 
keysize
;

47 
	`memt
(
keybuf
, 'a', 
keysize
);

49 
da
.d
dabuf
;

50 
da
.
size
 = 
dasize
;

51 
	`memt
(
dabuf
, 'b', 
dasize
);

53 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

54 
dbv
 = 
dbp
->dbenv;

55 
dbp
->
	`t_rfe
(dbp, 
dr
);

57 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_gesize
(dbp, 
gesize
) == 0);

58 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

59 
dbp
, 
NULL
, NULL, NULL, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

61 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 
DB_STAT_CLEAR
);

63 i(
upde
) {

64 
TIMER_START
;

65 ; 
s
 > 0; --ops) {

66 
keybuf
[(
s
 % 
keysize
)] = 
ˉs
[(ops % 26)];

67 
	`DB_BENCH_ASSERT
(

68 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

70 
TIMER_STOP
;

72 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

73 
TIMER_START
;

74 ; 
s
 > 0; --ops)

75 
	`DB_BENCH_ASSERT
(

76 
dbp
->
	`g
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

77 
TIMER_STOP
;

80 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 0);

81 
	`DB_BENCH_ASSERT
(
g
->
_che_miss
 == 0);

83 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

84 
	}
}

87 
	$b_mem__ds_bulk
(
u_t
 
s
, u_*
tٮp
)

89 
DB_ENV
 *
dbv
;

90 
DB
 *
dbp
;

91 
DBC
 *
dbc
;

92 
DBT
 
key
, 
da
;

93 
u_t32_t
 
n
, 
kn
;

94 
u_t
 
i
, 
tٮ
;

95 *
keybuf
, *
dabuf
;

96 *
por
, *
dp
, *
kp
;

97 
DB_MPOOL_STAT
 *
g
;

99 
	`DB_BENCH_ASSERT
((
keybuf
 = 
	`mloc
(
keysize
)!
NULL
);

100 
	`DB_BENCH_ASSERT
((
dabuf
 = 
	`mloc
(
bulkbufsize
)!
NULL
);

102 
	`memt
(&
key
, 0, (key));

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

104 
key
.
da
 = 
keybuf
;

105 
key
.
size
 = 
keysize
;

107 
da
.d
dabuf
;

108 
da
.
size
 = 
dasize
;

109 
	`memt
(
dabuf
, 'b', 
dasize
);

111 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

112 
dbv
 = 
dbp
->dbenv;

113 
dbp
->
	`t_rfe
(dbp, 
dr
);

115 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_gesize
(dbp, 
gesize
) == 0);

116 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_chesize
(dbp, 0, 
chesize
, 1) == 0);

117 
	`DB_BENCH_ASSERT
(

118 
dbp
->
	`ݒ
(dbp, 
NULL
, NULL, NULL, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

120 
i
 = 1; i <
numems
; ++i) {

121 ()
	`tf
(
keybuf
, 
keysize
, "%7d", 
i
);

122 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

126 

 = 
	`fݒ
("before", "w");

127 
dbp
->
	`t_msgfe
(dbp, 

);

128 
	`DB_BENCH_ASSERT
 (
dbp
->
	`_t
(dbp, 
DB_STAT_ALL
) == 0);

131 
	`DB_BENCH_ASSERT
(
dbp
->
	`curs
(dbp, 
NULL
, &
dbc
, 0) == 0);

133 
da
.
un
 = 
bulkbufsize
;

134 
da
.
ags
 = 
DB_DBT_USERMEM
;

136 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 
DB_STAT_CLEAR
);

138 
TIMER_START
;

139 
tٮ
 = 0; 
s
 > 0; --ops) {

140 
	`DB_BENCH_ASSERT
(
dbc
->
	`c_g
(

141 
dbc
, &
key
, &
da
, 
DB_FIRST
 | 
DB_MULTIPLE_KEY
) == 0);

142 
	`DB_MULTIPLE_INIT
(
por
, &
da
);

143 
por
 !
NULL
) {

144 
	`DB_MULTIPLE_KEY_NEXT
(
por
, &
da
, 
kp
, 
kn
, 
dp
, 
n
);

145 i(
kp
 !
NULL
)

146 ++
tٮ
;

149 
TIMER_STOP
;

150 *
tٮp
 = 
tٮ
;

152 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 0);

153 
	`DB_BENCH_ASSERT
(
g
->
_che_miss
 == 0);

156 

 = 
	`fݒ
("before", "w");

157 
dbp
->
	`t_msgfe
(dbp, 

);

158 
	`DB_BENCH_ASSERT
 (
dbp
->
	`_t
(dbp, 
DB_STAT_ALL
) == 0);

161 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

163 
	`COMPQUIET
(
dp
, 
NULL
);

164 
	`COMPQUIET
(
kn
, 0);

165 
	`COMPQUIET
(
n
, 0);

166 
	}
}

169 
	$b_mem__tds
(
u_t
 
s
, 
upde
, 
u_t32_t
 
v_ags
, u_t32_
log_ags
)

171 
DB
 *
dbp
;

172 
DBT
 
key
, 
da
;

173 
DB_ENV
 *
dbv
;

174 
DB_MPOOL_STAT
 *
g
;

175 
DB_TXN
 *
txn
;

176 *
keybuf
, *
dabuf
;

178 
	`DB_BENCH_ASSERT
((
keybuf
 = 
	`mloc
(
keysize
)!
NULL
);

179 
	`DB_BENCH_ASSERT
((
dabuf
 = 
	`mloc
(
dasize
)!
NULL
);

181 
	`memt
(&
key
, 0, (key));

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

183 
key
.
da
 = 
keybuf
;

184 
key
.
size
 = 
keysize
;

185 
	`memt
(
keybuf
, 'a', 
keysize
);

187 
da
.d
dabuf
;

188 
da
.
size
 = 
dasize
;

189 
	`memt
(
dabuf
, 'b', 
dasize
);

191 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

193 
dbv
->
	`t_rfe
(dbv, 
dr
);

196 #ifde
DB_AUTO_COMMIT


197 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_ags
(dbv, 
DB_AUTO_COMMIT
, 1) == 0);

199 i(
v_ags
 != 0)

200 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_ags
(dbv, 
v_ags
, 1) == 0);

203 i(
log_ags
 != 0)

204 #i
DB_VERSION_MINOR
 >= 7

205 
	`DB_BENCH_ASSERT
(

206 
dbv
->
	`log_t_cfig
(dbv, 
log_ags
, 1) == 0);

208 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_ags
(dbv, 
log_ags
, 1) == 0);

210 #ifde
DB_LOG_INMEMORY


211 i(!(
log_ags
 & 
DB_LOG_INMEMORY
))

213 #ifde
DB_LOG_IN_MEMORY


214 i(!(
log_ags
 & 
DB_LOG_IN_MEMORY
))

216 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_lg_max
(dbv, 
logbufsize
 * 10) == 0);

217 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_lg_bsize
(dbv, 
logbufsize
) == 0);

219 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbenv, "TESTDIR",

220 
DB_CREATE
 | 
DB_PRIVATE
 | 
DB_INIT_LOCK
 |

221 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
, 0666) == 0);

223 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

224 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_gesize
(dbp, 
gesize
) == 0);

225 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

226 
dbp
, 
NULL
, 
TESTFILE
, NULL, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

228 i(
upde
) {

229 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 
DB_STAT_CLEAR
);

231 
TIMER_START
;

232 ; 
s
 > 0; --ops)

233 
	`DB_BENCH_ASSERT
(

234 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

235 
TIMER_STOP
;

237 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 0);

238 
	`DB_BENCH_ASSERT
(
g
->
_ge_out
 == 0);

240 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

241 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 
DB_STAT_CLEAR
);

243 
TIMER_START
;

244 ; 
s
 > 0; --ops) {

245 
	`DB_BENCH_ASSERT
(

246 
dbv
->
	`txn_beg
(dbv, 
NULL
, &
txn
, 0) == 0);

247 
	`DB_BENCH_ASSERT
(

248 
dbp
->
	`g
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

249 
	`DB_BENCH_ASSERT
(
txn
->
	`comm
(txn, 0) == 0);

251 
TIMER_STOP
;

253 ()
dbv
->
	`memp_
(dbv, &
g
, 
NULL
, 0);

254 
	`DB_BENCH_ASSERT
(
g
->
_che_miss
 == 0);

257 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

258 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

259 
	}
}

261 
	#DEFAULT_OPS
 1000000

	)

264 
	$b_mem
(
gc
, *
gv
[])

266 
*
ݏrg
;

267 

td
, 
__db_gt_t
;

268 
u_t
 
s
, 
tٮ
;

269 
ch
;

271 i((
ogme
 = 
	`chr
(
gv
[0], '/')=
NULL
)

272 
ogme
 = 
gv
[0];

274 ++
ogme
;

276 
s
 = 0;

277 
__db_gt_t
 = 1;

278 (
ch
 = 
	`gt
(
gc
, 
gv
, "b:C:d:k:l:o:P:")!
EOF
)

279 
ch
) {

281 
bulkbufsize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

284 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

287 
dasize
 = (
u_t
)
	`oi
(
ݏrg
);

290 
keysize
 = (
u_t
)
	`oi
(
ݏrg
);

293 
logbufsize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

296 
s
 = (
u_t
)
	`oi
(
ݏrg
);

299 
gesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

303  (
	`b_mem_uge
());

305 
gc
 -
td
;

306 
gv
 +
td
;

308 i(
gc
 != 1)

309  (
	`b_mem_uge
());

311 
numems
 = (
chesize
 / (
keysize
 + 
dasize
 - 1)) / 2;

313 i(
	`rcmp
(
gv
[0], "read") == 0) {

314 i(
s
 == 0)

315 
s
 = 
DEFAULT_OPS
;

316 
	`b_mem__ds
(
s
, 0);

317 
	`tf
(

319 
s
, 
keysize
, 
dasize
);

320 } i(
	`rcmp
(
gv
[0], "bulk") == 0) {

321 i(
keysize
 < 8) {

322 
	`rtf
(
dr
,

323 "%s: bulkdequekey siz>10\n", 
ogme
);

324  (
EXIT_FAILURE
);

332 i(
s
 == 0)

333 
s
 = 100000;

334 
	`b_mem__ds_bulk
(
s
, &
tٮ
);

335 
s
 = 
tٮ
;

336 
	`tf
(

338 
s
, 
keysize
, 
dasize
);

339 } i(
	`rcmp
(
gv
[0], "write") == 0) {

340 i(
s
 == 0)

341 
s
 = 
DEFAULT_OPS
;

342 
	`b_mem__ds
(
s
, 1);

343 
	`tf
(

345 
s
, 
keysize
, 
dasize
);

346 } i(
	`rcmp
(
gv
[0], "txn-read") == 0) {

347 i(
s
 == 0)

348 
s
 = 
DEFAULT_OPS
;

349 
	`b_mem__tds
(
s
, 0, 0, 0);

350 
	`tf
(

352 
s
, 
keysize
, 
dasize
);

353 } i(
	`rcmp
(
gv
[0], "txn-write") == 0) {

354 i(
s
 == 0)

355 
s
 = 
DEFAULT_OPS
;

356 #i
	`defed
(
DB_LOG_INMEMORY
|| defed(
DB_LOG_IN_MEMORY
)

357 #i
	`defed
(
DB_LOG_INMEMORY
)

358 
	`b_mem__tds
(
s
, 1, 0, 
DB_LOG_INMEMORY
);

360 
	`b_mem__tds
(
s
, 1, 0, 
DB_LOG_IN_MEMORY
);

362 
	`tf
(

364 
s
, 
keysize
, 
dasize
);

366  (
EXIT_SUCCESS
);

368 } i(
	`rcmp
(
gv
[0], "txn-nosync") == 0) {

369 i(
s
 == 0)

370 
s
 = 
DEFAULT_OPS
;

371 
	`b_mem__tds
(
s
, 1, 
DB_TXN_NOSYNC
, 0);

372 
	`tf
(

374 
s
, 
keysize
, 
dasize
);

375 } i(
	`rcmp
(
gv
[0], "txn-write-nosync") == 0) {

376 i(
s
 == 0)

377 
s
 = 
DEFAULT_OPS
;

378 #ifde
DB_TXN_WRITE_NOSYNC


379 
	`b_mem__tds
(
s
, 1, 
DB_TXN_WRITE_NOSYNC
, 0);

380 
	`tf
(

382 
s
, 
keysize
, 
dasize
);

384  (
EXIT_SUCCESS
);

386 } i(
	`rcmp
(
gv
[0], "txn-sync") == 0) {

391 i(
s
 == 0)

392 
s
 = 100000;

393 
	`b_mem__tds
(
s
, 1, 0, 0);

394 
	`tf
(

396 
s
, 
keysize
, 
dasize
);

398 
	`rtf
(
dr
, "%s: unknowkeywd %s\n", 
ogme
, 
gv
[0]);

399  (
EXIT_FAILURE
);

402 
	`TIMER_DISPLAY
(
s
);

403  (
EXIT_SUCCESS
);

404 
	}
}

407 
	$b_mem_uge
()

409 
	`rtf
(
dr
, "usage: %s %s%s%s%s",

410 
ogme
, "[-b bulkbufsz] [-C cachesz]\n\t",

414  (
EXIT_FAILURE
);

415 
	}
}

418 
	$b_mem
(
gc
, *
gv
[])

420 
	`COMPQUIET
(
gc
, 0);

421 
	`COMPQUIET
(
gv
, 
NULL
);

423 
	}
}

	@../build_vxworks/test_micro/b_load.c

4 
	~"bch.h
"

6 
b_ld_uge
();

9 
	$b_ld
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB
 *
dbp
;

14 
DBTYPE
 
ty
;

15 
DBT
 
key
, 
da
;

16 
db_o_t
 
o
;

17 
u_t32_t
 
chesize
;

18 
ch
, 
i
, 
cou
, 
dui
;

19 *
ts
, 
buf
[32];

21 
ty
 = 
DB_BTREE
;

22 
chesize
 = 
MEGABYTE
;

23 
cou
 = 100000;

24 
dui
 = 0;

25 
ts
 = "Btree";

26 
__db_gt_t
 = 1;

27 (
ch
 = 
	`gt
(
gc
, 
gv
, "C:c:dt:")!
EOF
)

28 
ch
) {

30 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

33 
cou
 = 
	`oi
(
ݏrg
);

36 
dui
 = 1;

39 
ݏrg
[0]) {

41 
ts
 = "Btree";

42 
ty
 = 
DB_BTREE
;

45 i(
	`b_ut_have_hash
())

47 
ts
 = "Hash";

48 
ty
 = 
DB_HASH
;

51 i(
	`b_ut_have_queue
())

53 
ts
 = "Queue";

54 
ty
 = 
DB_QUEUE
;

57 
ts
 = "Recno";

58 
ty
 = 
DB_RECNO
;

61  (
	`b_ld_uge
());

66  (
	`b_ld_uge
());

68 
gc
 -
td
;

69 
gv
 +
td
;

70 i(
gc
 != 0)

71  (
	`b_ld_uge
());

74 i(
dui
 && (
ty
 =
DB_QUEUE
 ||y =
DB_RECNO
)) {

75 
	`rtf
(
dr
,

77  (
	`b_ld_uge
());

80 #i
DB_VERSION_MAJOR
 < 3 || DB_VERSION_MAJOR =3 && 
DB_VERSION_MINOR
 < 1

85 i(
dui
)

90 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
NULL
, 0) == 0);

91 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_chesize
(dbp, 0, 
chesize
, 0) == 0);

92 i(
dui
)

93 
	`DB_BENCH_ASSERT
(
dbp
->
	`t_ags
(dbp, 
DB_DUP
) == 0);

94 
dbp
->
	`t_rfe
(dbp, 
dr
);

97 i(
ty
 =
DB_QUEUE
)

98 
	`DB_BENCH_ASSERT
(
dbp
->
	`t__n
(dbp, 20) == 0);

100 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

101 
	`DB_BENCH_ASSERT
(

102 
dbp
->
	`ݒ
(dbp, 
NULL
, 
TESTFILE
, NULL, 
ty
, 
DB_CREATE
, 0666) == 0);

104 
	`DB_BENCH_ASSERT
(

105 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
ty
, 
DB_CREATE
, 0666) == 0);

109 
	`memt
(&
key
, 0, (key));

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

113 
TIMER_START
;

114 i(
dui
) {

115 
key
.
size
 = 10;

116 
key
.
da
 = "01234567890123456789";

117 
da
.d
buf
;

118 
da
.
size
 = 20;

119 
i
 = 0; i < 
cou
; ++i) {

120 ()
	`tf
(
buf
, (buf), "%020d", 
i
);

121 
	`DB_BENCH_ASSERT
(

122 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

125 
da
.d
buf
;

126 
da
.
size
 = 20;

127 i(
ty
 =
DB_BTREE
 ||y =
DB_HASH
) {

128 
key
.
size
 = 10;

129 
key
.
da
 = 
buf
;

130 
i
 = 0; i < 
cou
; ++i) {

131 ()
	`tf
(
buf
, (buf), "%010d", 
i
);

132 
	`DB_BENCH_ASSERT
(

133 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

136 
key
.
da
 = &
o
;

137 
key
.
size
 = (
o
);

138 
i
 = 0, 
o
 = 1; i < 
cou
; ++i, ++recno)

139 
	`DB_BENCH_ASSERT
(

140 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

144 
TIMER_STOP
;

146 
	`tf
("# %d %s database in-orderut of 10/20 byte key/data %sitems\n",

147 
cou
, 
ts
, 
dui
 ? "duplicate " : "");

148 
	`TIMER_DISPLAY
(
cou
);

150 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

153 
	}
}

156 
	$b_ld_uge
()

158 ()
	`rtf
(
dr
,

160  (
EXIT_FAILURE
);

161 
	}
}

	@../build_vxworks/test_micro/b_open.c

4 
	~"bch.h
"

6 
b_ݒ_uge
();

9 
	$b_ݒ
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB_ENV
 *
dbv
;

14 
DB
 *
dbp
;

15 
DBTYPE
 
ty
;

16 
ch
, 
i
, 
cou
;

17 *
ame
, *
dbme
, *
ts
;

19 
ty
 = 
DB_BTREE
;

20 
cou
 = 1000;

21 
ame
 = 
dbme
 = 
NULL
;

22 
ts
 = "Btree";

23 
__db_gt_t
 = 1;

24 (
ch
 = 
	`gt
(
gc
, 
gv
, "c:d:")!
EOF
)

25 
ch
) {

27 
cou
 = 
	`oi
(
ݏrg
);

30 
dbme
 = "dbname";

33 
ame
 = "filename";

36 
ݏrg
[0]) {

38 
ts
 = "Btree";

39 
ty
 = 
DB_BTREE
;

42 i(
	`b_ut_have_hash
())

44 
ts
 = "Hash";

45 
ty
 = 
DB_HASH
;

48 i(
	`b_ut_have_queue
())

50 
ts
 = "Queue";

51 
ty
 = 
DB_QUEUE
;

54 
ts
 = "Recno";

55 
ty
 = 
DB_RECNO
;

58  (
	`b_ݒ_uge
());

63  (
	`b_ݒ_uge
());

65 
gc
 -
td
;

66 
gv
 +
td
;

67 i(
gc
 != 0)

68  (
	`b_ݒ_uge
());

70 #i
DB_VERSION_MAJOR
 < 4

75 i(
ame
 =
NULL
 && 
dbme
 == NULL)

78 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 4

82 i(
ame
 =
NULL
 && 
dbme
 != NULL)

87 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

88 
dbv
->
	`t_rfe
(dbv, 
dr
);

89 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 0

90 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
,

91 
NULL
, 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
, 0666) == 0);

93 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
,

94 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
, 0666) == 0);

98 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

100 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

101 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

102 
dbp
, 
NULL
, 
ame
, 
dbme
, 
ty
, 
DB_CREATE
, 0666) == 0);

104 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

105 
dbp
, 
ame
, 
dbme
, 
ty
, 
DB_CREATE
, 0666) == 0);

107 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

110 
TIMER_START
;

111 
i
 = 0; i < 
cou
; ++i) {

112 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

113 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

114 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

115 
dbp
, 
NULL
, 
ame
, 
dbme
, 
ty
, 
DB_CREATE
, 0666) == 0);

117 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

118 
dbp
, 
ame
, 
dbme
, 
ty
, 
DB_CREATE
, 0666) == 0);

120 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

122 
TIMER_STOP
;

124 
	`tf
("# %d %s %sdatabase open/closeairs\n",

125 
cou
, 
ts
,

126 
ame
 =
NULL
 ?

127 (
dbme
 =
NULL
 ? "in-memory " : "named in-memory ") :

128 (
dbme
 =
NULL
 ? "" : "sub-"));

129 
	`TIMER_DISPLAY
(
cou
);

131 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

134 
	}
}

137 
	$b_ݒ_uge
()

139 ()
	`rtf
(
dr
, "usage: b_open [-df] [-c count] [-type]\n");

140  (
EXIT_FAILURE
);

141 
	}
}

	@../build_vxworks/test_micro/b_put.c

4 
	~"bch.h
"

6 
b_put_uge
();

7 
b_put_cdy
(
DB
 *, cڡ 
DBT
 *, const DBT *, DBT *);

10 
	$b_put
(
gc
, *
gv
[])

12 
*
ݏrg
;

13 

td
, 
__db_gt_t
;

14 
DB_ENV
 *
dbv
;

15 
DB
 *
dbp
, **
cd
;

16 
DBTYPE
 
ty
;

17 
DBT
 
key
, 
da
;

18 
db_o_t
 
o
;

19 
u_t32_t
 
chesize
;

20 
ch
, 
dsize
, 
i
, 
cou
, 
cds
;

21 *
ts
, 
buf
[64];

23 
cd
 = 
NULL
;

24 
ty
 = 
DB_BTREE
;

25 
chesize
 = 
MEGABYTE
;

26 
dsize
 = 20;

27 
cou
 = 100000;

28 
cds
 = 0;

29 
ts
 = "Btree";

30 
__db_gt_t
 = 1;

31 (
ch
 = 
	`gt
(
gc
, 
gv
, "C:c:d:s:t:")!
EOF
)

32 
ch
) {

34 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

37 
cou
 = 
	`oi
(
ݏrg
);

40 
dsize
 = 
	`oi
(
ݏrg
);

43 
cds
 = 
	`oi
(
ݏrg
);

46 
ݏrg
[0]) {

48 
ts
 = "Btree";

49 
ty
 = 
DB_BTREE
;

52 i(
	`b_ut_have_hash
())

54 
ts
 = "Hash";

55 
ty
 = 
DB_HASH
;

58 i(
	`b_ut_have_queue
())

60 
ts
 = "Queue";

61 
ty
 = 
DB_QUEUE
;

64 
ts
 = "Recno";

65 
ty
 = 
DB_RECNO
;

68  (
	`b_put_uge
());

73  (
	`b_put_uge
());

75 
gc
 -
td
;

76 
gv
 +
td
;

77 i(
gc
 != 0)

78  (
	`b_put_uge
());

80 #i
DB_VERSION_MAJOR
 < 3 || DB_VERSION_MAJOR =3 && 
DB_VERSION_MINOR
 < 3

84 i(
cds
)

89 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

90 
dbv
->
	`t_rfe
(dbv, 
dr
);

91 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_chesize
(dbv, 0, 
chesize
, 0) == 0);

92 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 < 1

93 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
,

94 
NULL
, 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
, 0666) == 0);

96 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
,

97 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
, 0666) == 0);

104 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

105 i(
ty
 =
DB_QUEUE
)

106 
	`DB_BENCH_ASSERT
(
dbp
->
	`t__n
(dbp, (
u_t32_t
)
dsize
) == 0);

107 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

108 
	`DB_BENCH_ASSERT
(

109 
dbp
->
	`ݒ
(dbp, 
NULL
, 
TESTFILE
, NULL, 
ty
, 
DB_CREATE
, 0666) == 0);

111 
	`DB_BENCH_ASSERT
(

112 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
ty
, 
DB_CREATE
, 0666) == 0);

116 i(
cds
 != 0) {

117 
	`DB_BENCH_ASSERT
((
cd
 =

118 
	`oc
((
DB
 *), (
size_t
)
cds
)!
NULL
);

119 
i
 = 0; i < 
cds
; ++i) {

120 
	`DB_BENCH_ASSERT
(
	`db_
(&
cd
[
i
], 
dbv
, 0) == 0);

121 
	`tf
(
buf
, (buf), "%d.db", 
i
);

122 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

123 
	`DB_BENCH_ASSERT
(
cd
[
i
]->
	`ݒ
(cd[i], 
NULL
,

124 
buf
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
, 0600) == 0);

126 
	`DB_BENCH_ASSERT
(
cd
[
i
]->
	`ݒ
(second[i],

127 
buf
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
, 0600) == 0);

129 #i
DB_VERSION_MAJOR
 > 3 || DB_VERSION_MAJOR =3 && 
DB_VERSION_MINOR
 >= 3

130 #i
DB_VERSION_MAJOR
 > 3 && 
DB_VERSION_MINOR
 > 0

135 
	`DB_BENCH_ASSERT
(
dbp
->
	`assoc
(

136 
dbp
, 
NULL
, 
cd
[
i
], 
b_put_cdy
, 0) == 0);

138 
	`DB_BENCH_ASSERT
(
dbp
->
	`assoc
(

139 
dbp
, 
cd
[
i
], 
b_put_cdy
, 0) == 0);

146 
	`memt
(&
key
, 0, (key));

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

148 
ty
) {

149 
DB_BTREE
:

150 
DB_HASH
:

151 
key
.
da
 = "01234567890123456789";

152 
key
.
size
 = 20;

154 
DB_QUEUE
:

155 
DB_RECNO
:

156 
o
 = 1;

157 
key
.
da
 = &
o
;

158 
key
.
size
 = (
o
);

160 
DB_UNKNOWN
:

161 
	`b_ut_abt
();

165 
	`DB_BENCH_ASSERT
(

166 (
da
.d
	`mloc
(da.
size
 = (
size_t
)
dsize
)!
NULL
);

169 
TIMER_START
;

170 
i
 = 0; i < 
cou
; ++i)

171 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

172 
TIMER_STOP
;

174 i(
ty
 =
DB_BTREE
 ||y =
DB_HASH
)

175 
	`tf
(

177 
cou
, 
ts
, (
u_lg
)
dsize
);

179 
	`tf
("# %d %s databaseut of key, %lu byte data",

180 
cou
, 
ts
, (
u_lg
)
dsize
);

181 i(
cds
)

182 
	`tf
(" wh %d secds", 
cds
);

183 
	`tf
("\n");

184 
	`TIMER_DISPLAY
(
cou
);

186 i(
cd
 !
NULL
) {

187 
i
 = 0; i < 
cds
; ++i)

188 
	`DB_BENCH_ASSERT
(
cd
[
i
]->
	`o
(second[i], 0) == 0);

189 
	`
(
cd
);

192 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

193 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

196 
	}
}

199 
	$b_put_cdy
(
dbp
, 
pkey
, 
pda
, 
skey
)

200 
DB
 *
dbp
;

201 cڡ 
DBT
 *
pkey
, *
pda
;

202 
DBT
 *
skey
;

204 
skey
->
da
 = 
pkey
->data;

205 
skey
->
size
 = 
pkey
->size;

207 
	`COMPQUIET
(
dbp
, 
NULL
);

208 
	`COMPQUIET
(
pda
, 
NULL
);

210 
	}
}

213 
	$b_put_uge
()

215 ()
	`rtf
(
dr
, "usage: b_put %s\n",

217  (
EXIT_FAILURE
);

218 
	}
}

	@../build_vxworks/test_micro/b_recover.c

4 
	~"bch.h
"

6 
b_cov_uge
();

9 
	$b_cov
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB
 *
dbp
;

14 
DBT
 
key
, 
da
;

15 
DB_ENV
 *
dbv
;

16 
DB_TXN
 *
txn
;

17 
u_t32_t
 
chesize
;

18 
ch
, 
i
, 
cou
;

24 #i
DB_VERSION_MAJOR
 < 4

27 
chesize
 = 
MEGABYTE
;

28 
cou
 = 1000;

29 
__db_gt_t
 = 1;

30 (
ch
 = 
	`gt
(
gc
, 
gv
, "C:c:")!
EOF
)

31 
ch
) {

33 
chesize
 = (
u_t32_t
)
	`oi
(
ݏrg
);

36 
cou
 = 
	`oi
(
ݏrg
);

40  (
	`b_cov_uge
());

42 
gc
 -
td
;

43 
gv
 +
td
;

44 i(
gc
 != 0)

45  (
	`b_cov_uge
());

48 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

49 
dbv
->
	`t_rfe
(dbv, 
dr
);

50 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_chesize
(dbv, 0, 
chesize
, 0) == 0);

52 
	#OFLAGS
 \

53 (
DB_CREATE
 | 
DB_INIT_LOCK
 | \

54 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
)

	)

55 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 0

56 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
NULL
, 
OFLAGS
, 0666) == 0);

58 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 1

59 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
OFLAGS
, 0666) == 0);

61 #i
DB_VERSION_MAJOR
 > 3 || 
DB_VERSION_MINOR
 > 1

62 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
OFLAGS
, 0666) == 0);

66 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

67 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

68 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(dbp, 
NULL
,

69 
TESTFILE
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
 | 
DB_AUTO_COMMIT
, 0666) == 0);

71 
	`DB_BENCH_ASSERT
(

72 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

76 
	`memt
(&
key
, 0, (key));

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

78 
key
.
size
 = 
da
.size = 20;

79 
key
.
da
 = data.data = "01234567890123456789";

82 
i
 = 0; i < 
cou
; ++i) {

83 #i
DB_VERSION_MAJOR
 < 4

84 
	`DB_BENCH_ASSERT
(

85 
	`txn_beg
(
dbv
, 
NULL
, &
txn
, 
DB_TXN_NOSYNC
) == 0);

86 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
txn
, &
key
, &
da
, 0) == 0);

87 
	`DB_BENCH_ASSERT
(
	`txn_comm
(
txn
, 0) == 0);

89 
	`DB_BENCH_ASSERT
(

90 
dbv
->
	`txn_beg
(dbv, 
NULL
, &
txn
, 
DB_TXN_NOSYNC
) == 0);

91 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
txn
, &
key
, &
da
, 0) == 0);

92 
	`DB_BENCH_ASSERT
(
txn
->
	`comm
(txn, 0) == 0);

96 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

97 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

100 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

101 
dbv
->
	`t_rfe
(dbv, 
dr
);

102 
	`DB_BENCH_ASSERT
(

103 
dbv
->
	`t_chesize
(dbenv, 0, 1048576 , 0) == 0);

106 
TIMER_START
;

107 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 0

108 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(

109 
dbv
, 
TESTDIR
, 
NULL
, 
OFLAGS
 | 
DB_RECOVER
, 0666) == 0);

111 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 1

112 
	`DB_BENCH_ASSERT
(

113 
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
OFLAGS
 | 
DB_RECOVER
, 0666) == 0);

115 #i
DB_VERSION_MAJOR
 > 3 || 
DB_VERSION_MINOR
 > 1

116 
	`DB_BENCH_ASSERT
(

117 
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
OFLAGS
 | 
DB_RECOVER
, 0666) == 0);

119 
TIMER_STOP
;

125 
	`tf
("#ecovy %dnis\n", 
cou
);

126 
	`TIMER_DISPLAY
(
cou
);

128 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

131 
	}
}

134 
	$b_cov_uge
()

136 ()
	`rtf
(
dr
, "usage: b_recover [-C cachesz] [-c count]\n");

137  (
EXIT_FAILURE
);

138 
	}
}

	@../build_vxworks/test_micro/b_txn.c

4 
	~"bch.h
"

6 
b_txn_uge
();

9 
	$b_txn
(
gc
, *
gv
[])

11 
*
ݏrg
;

12 

td
, 
__db_gt_t
;

13 
DB_ENV
 *
dbv
;

14 
DB_TXN
 *
txn
;

15 
bt
, 
ch
, 
i
, 
cou
;

17 
cou
 = 1000;

18 
bt
 = 0;

19 
__db_gt_t
 = 1;

20 (
ch
 = 
	`gt
(
gc
, 
gv
, "ac:")!
EOF
)

21 
ch
) {

23 
bt
 = 1;

26 
cou
 = 
	`oi
(
ݏrg
);

30  (
	`b_txn_uge
());

32 
gc
 -
td
;

33 
gv
 +
td
;

34 i(
gc
 != 0)

35  (
	`b_txn_uge
());

38 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

39 
dbv
->
	`t_rfe
(dbv, 
dr
);

40 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 < 1

41 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
,

42 
NULL
, 
DB_CREATE
 | 
DB_INIT_LOCK
 | 
DB_INIT_LOG
 |

43 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
, 0666) == 0);

45 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
,

46 
DB_CREATE
 | 
DB_INIT_LOCK
 | 
DB_INIT_LOG
 |

47 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
, 0666) == 0);

51 
TIMER_START
;

52 i(
bt
)

53 
i
 = 0; i < 
cou
; ++i) {

54 #i
DB_VERSION_MAJOR
 < 4

55 
	`DB_BENCH_ASSERT
(
	`txn_beg
(
dbv
, 
NULL
, &
txn
, 0) == 0);

56 
	`DB_BENCH_ASSERT
(
	`txn_abt
(
txn
) == 0);

58 
	`DB_BENCH_ASSERT
(

59 
dbv
->
	`txn_beg
(dbv, 
NULL
, &
txn
, 0) == 0);

60 
	`DB_BENCH_ASSERT
(
txn
->
	`abt
(txn) == 0);

64 
i
 = 0; i < 
cou
; ++i) {

65 #i
DB_VERSION_MAJOR
 < 4

66 
	`DB_BENCH_ASSERT
(
	`txn_beg
(
dbv
, 
NULL
, &
txn
, 0) == 0);

67 
	`DB_BENCH_ASSERT
(
	`txn_comm
(
txn
, 0) == 0);

69 
	`DB_BENCH_ASSERT
(

70 
dbv
->
	`txn_beg
(dbv, 
NULL
, &
txn
, 0) == 0);

71 
	`DB_BENCH_ASSERT
(
txn
->
	`comm
(txn, 0) == 0);

74 
TIMER_STOP
;

76 
	`tf
("# %dmptyransaction start/%sairs\n",

77 
cou
, 
bt
 ? "abort" : "commit");

78 
	`TIMER_DISPLAY
(
cou
);

80 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

83 
	}
}

86 
	$b_txn_uge
()

88 ()
	`rtf
(
dr
, "usage: b_txn [-a] [-c count]\n");

89  (
EXIT_FAILURE
);

90 
	}
}

	@../build_vxworks/test_micro/b_txn_write.c

4 
	~"bch.h
"

6 
b_txn_wre_uge
 
__P
(());

8 #ifde
DB_INIT_REP


9 
b_txn_wre_nd
 
__P
((
DB_ENV
 *,

10 cڡ 
DBT
 *, cڡ DBT *, cڡ 
DB_LSN
 *, , 
u_t32_t
));

17 
	$b_txn_wre_nd
(
dbv
, 
cڌ
, 
c
, 
l
, 
eid
, 
ags
)

18 
DB_ENV
 *
dbv
;

19 cڡ 
DBT
 *
cڌ
, *
c
;

20 cڡ 
DB_LSN
 *
l
;

21 
eid
;

22 
u_t32_t
 
ags
;

24 
	`COMPQUIET
(
dbv
, 
NULL
);

25 
	`COMPQUIET
(
cڌ
, 
NULL
);

26 
	`COMPQUIET
(
c
, 
NULL
);

27 
	`COMPQUIET
(
l
, 
NULL
);

28 
	`COMPQUIET
(
eid
, 0);

29 
	`COMPQUIET
(
ags
, 0);

31 
	}
}

35 
	$b_txn_wre
(
gc
, *
gv
[])

37 
*
ݏrg
;

38 

td
, 
__db_gt_t
;

39 
DB
 *
dbp
;

40 
DBT
 
key
, 
da
;

41 
DB_ENV
 *
dbv
;

42 
DB_TXN
 *
txn
;

43 
u_t32_t
 
ags
, 
oags
;

44 
ch
, 
i
, 
cou
, 
p_ub
;

45 *
cfig
;

47 
cou
 = 1000;

48 
oags
 = 
ags
 = 0;

49 
p_ub
 = 0;

50 
cfig
 = "synchronous";

51 
__db_gt_t
 = 1;

52 (
ch
 = 
	`gt
(
gc
, 
gv
, "ac:rw")!
EOF
)

53 
ch
) {

55 
cfig
 = "nosync";

56 
ags
 = 
DB_TXN_NOSYNC
;

59 
cou
 = 
	`oi
(
ݏrg
);

62 #ifde
DB_INIT_REP


63 
p_ub
 = 1;

65 
	`ex
(0);

69 
cfig
 = "write-nosync";

70 #ifde
DB_TXN_WRITE_NOSYNC


71 
ags
 = 
DB_TXN_WRITE_NOSYNC
;

73 
	`ex
(0);

78  (
	`b_txn_wre_uge
());

80 
gc
 -
td
;

81 
gv
 +
td
;

82 i(
gc
 != 0)

83  (
	`b_txn_wre_uge
());

86 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

87 
dbv
->
	`t_rfe
(dbv, 
dr
);

89 #ifde
DB_INIT_REP


90 i(
p_ub
) {

91 #i
DB_VERSION_MAJOR
 =4 && 
DB_VERSION_MINOR
 >= 5 || DB_VERSION_MAJOR > 4

92 
	`DB_BENCH_ASSERT
(

93 
dbv
->
	`p_t_t
(dbv, 1, 
b_txn_wre_nd
) == 0);

95 
	`DB_BENCH_ASSERT
(

96 
dbv
->
	`t_p_t
(dbv, 1, 
b_txn_wre_nd
) == 0);

98 
oags
 |
DB_INIT_REP
;

101 
oags
 |
DB_CREATE
 | 
DB_INIT_LOCK
 |

102 
DB_INIT_LOG
 | 
DB_INIT_MPOOL
 | 
DB_INIT_TXN
 | 
DB_PRIVATE
;

103 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 0

104 
	`DB_BENCH_ASSERT
(

105 
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
NULL
, 
ags
 | 
oags
, 0666) == 0);

107 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 == 1

108 
	`DB_BENCH_ASSERT
(

109 
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
ags
 | 
oags
, 0666) == 0);

111 #i
DB_VERSION_MAJOR
 > 3 || 
DB_VERSION_MINOR
 > 1

112 i(
ags
 != 0)

113 
	`DB_BENCH_ASSERT
(
dbv
->
	`t_ags
(dbv, 
ags
, 1) == 0);

114 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbv, 
TESTDIR
, 
oags
, 0666) == 0);

117 #ifde
DB_INIT_REP


118 i(
p_ub
)

119 
	`DB_BENCH_ASSERT
(

120 
dbv
->
	`p_t
(dbv, 
NULL
, 
DB_REP_MASTER
) == 0);

124 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

125 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

126 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(dbp, 
NULL
,

127 
TESTFILE
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
 | 
DB_AUTO_COMMIT
, 0666) == 0);

129 
	`DB_BENCH_ASSERT
(

130 
dbp
->
	`ݒ
(dbp, 
TESTFILE
, 
NULL
, 
DB_BTREE
, 
DB_CREATE
, 0666) == 0);

134 
	`memt
(&
key
, 0, (key));

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

136 
key
.
size
 = 
da
.size = 20;

137 
key
.
da
 = data.data = "01234567890123456789";

140 
TIMER_START
;

141 
i
 = 0; i < 
cou
; ++i) {

142 #i
DB_VERSION_MAJOR
 < 4

143 
	`DB_BENCH_ASSERT
(
	`txn_beg
(
dbv
, 
NULL
, &
txn
, 0) == 0);

144 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
txn
, &
key
, &
da
, 0) == 0);

145 
	`DB_BENCH_ASSERT
(
	`txn_comm
(
txn
, 0) == 0);

147 
	`DB_BENCH_ASSERT
(
dbv
->
	`txn_beg
(dbv, 
NULL
, &
txn
, 0) == 0);

148 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
txn
, &
key
, &
da
, 0) == 0);

149 
	`DB_BENCH_ASSERT
(
txn
->
	`comm
(txn, 0) == 0);

152 
TIMER_STOP
;

154 
	`tf
("# %d %stransactions write %s commitairs\n",

155 
cou
, 
p_ub
 ? "id ": "", 
cfig
);

156 
	`TIMER_DISPLAY
(
cou
);

158 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

159 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

162 
	}
}

165 
	$b_txn_wre_uge
()

167 ()
	`rtf
(
dr
, "usage: b_txn_write [-arw] [-c count]\n");

168  (
EXIT_FAILURE
);

169 
	}
}

	@../build_vxworks/test_micro/b_uname.c

5 
	~"bch.h
"

7 
	#UNAMEFILE
 "NODENAME"

	)

9 
b_ume_wre_fo
 
__P
((
FILE
 *));

12 
	$b_ume
()

14 
FILE
 *

;

15 
t
;

17 i((

 = 
	`fݒ
(
UNAMEFILE
, "w")=
NULL
)

18 
fe_r
;

20 
t
 = 
	`b_ume_wre_fo
(

);

22 i(
	`fo
(

) != 0) {

23 
fe_r
: 
	`rtf
(
dr
,

24 "%s: %s: %s\n", 
ogme
, 
UNAMEFILE
, 
	`
(
o
));

28  (
t
);

29 
	}
}

31 #ifde
DB_WIN32


33 
	$b_ume_wre_fo
(

)

34 
FILE
 *

;

36 
OSVERSIONINFO
 
osv
;

37 
SYSTEM_INFO
 
sysfo
;

38 *
p
;

40 #ifde
DB_WINCE


41 
p
 = "WinCE";

44 
DWORD
 
n
;

45 
buf
[1024];

47 
n
 = (
buf
) - 1;

48 
	`GCompurName
(
buf
, &
n
);

49 
p
 = 
buf
;

52 
	`rtf
(

, "<p>%s, ", 
p
);

54 
	`GSyemInfo
(&
sysfo
);

55 
sysfo
.
wProssArcheu
) {

56 
PROCESSOR_ARCHITECTURE_ALPHA
:

57 
p
 = "alpha";

59 
PROCESSOR_ARCHITECTURE_INTEL
:

60 
p
 = "x86";

62 
PROCESSOR_ARCHITECTURE_MIPS
:

63 
p
 = "mips";

65 
PROCESSOR_ARCHITECTURE_PPC
:

66 
p
 = "ppc";

69 
p
 = "unknown";

72 
	`rtf
(

, "%s<br>\n", 
p
);

73 
	`memt
(&
osv
, 0, (osver));

74 
osv
.
dwOSVsiInfoSize
 = (osver);

75 
	`GVsiEx
(&
osv
);

76 
osv
.
dwPtfmId
) {

77 
VER_PLATFORM_WIN32_NT
:

78 i(
osv
.
dwMajVsi
 == 4)

79 
p
 = "Windows NT4x";

80 i(
osv
.
dwMajVsi
 <= 3)

81 
p
 = "Windows NT3x";

82 i(
osv
.
dwMajVsi
 =5 && osv.
dwMVsi
 < 1)

83 
p
 = "Windows 2000";

84 i(
osv
.
dwMajVsi
 >= 5)

85 
p
 = "Windows XP";

87 
p
 = "unknown";

89 
VER_PLATFORM_WIN32_WINDOWS
:

90 i((
osv
.
dwMajVsi
 > 4) ||

91 ((
osv
.
dwMajVsi
 =4&& (osv.
dwMVsi
 > 0))) {

92 i(
osv
.
dwMVsi
 >= 90)

93 
p
 = "Windows ME";

95 
p
 = "Windows 98";

97 
p
 = "Windows 95";

99 
VER_PLATFORM_WIN32s
:

100 
p
 = "Windows";

103 
p
 = "unknown";

106 
	`rtf
(

,

107 "%s, %ld.%02ld", 
p
, 
osv
.
dwMajVsi
, osv.
dwMVsi
);

109 
	}
}

111 #i
defed
(
HAVE_VXWORKS
)

113 
	$b_ume_wre_fo
(

)

114 
FILE
 *

;

116 
	`rtf
(

, "<p>VxWorks");

118 
	}
}

121 
	~<sys/utame.h
>

124 
	$b_ume_wre_fo
(

)

125 
FILE
 *

;

127 
utame
 
me
;

129 i(
	`ume
(&
me
) == 0)

130 
	`rtf
(

, "<p>%s, %s<br>\n%s, %s, %s</p>\n", 
me
.
nodame
,

131 
me
.
mache
,ame.
syame
,ame.
a
,ame.
vsi
);

137 
	`rtf
(
dr
, "%s: ume: %s\n", 
ogme
, 
	`
(
o
));

139 
	`rtf
(

, "<p>POSIX");

142 
	}
}

	@../build_vxworks/test_micro/b_util.c

5 
	~"bch.h
"

7 
b_ut_d_move
 
__P
((*));

10 
	$b_ut_have_hash
()

12 #i
	`defed
(
HAVE_HASH
) ||\

13 
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 2

16 
	`rtf
(
dr
,

20 
	}
}

23 
	$b_ut_have_queue
()

25 #i
	`defed
(
HAVE_QUEUE
) ||\

26 
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 2

29 
	`rtf
(
dr
,

33 
	}
}

40 
	$b_ut_d_tup
()

42 
t
;

44 #i
DB_VERSION_MAJOR
 > 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 > 3

45 i((
t
 = 
	`__os_mkd
(
NULL
, 
TESTDIR
, 0755)) != 0) {

47 i((
t
 = 
	`mkd
(
TESTDIR
, 0755)) != 0) {

49 
	`rtf
(
dr
,

50 "%s: %s: %s\n", 
ogme
, 
TESTDIR
, 
	`db_
(
t
));

54 
	}
}

56 #i
DB_VERSION_MAJOR
 > 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 > 4

57 
	#OS_EXISTS
(
a
, 
b
, 
c

	`__os_exis
, b, c)

	)

59 
	#OS_EXISTS
(
a
, 
b
, 
c

	`__os_exis
(b, c)

	)

67 
	$b_ut_d_down
()

69 
t
;

71 i(
	`OS_EXISTS
(
NULL
, 
TESTFILE
, NULL) == 0 &&

72 (
t
 = 
	`b_ut_uƚk
(
TESTFILE
)) != 0) {

73 
	`rtf
(
dr
,

74 "%s: %s: %s\n", 
ogme
, 
TESTFILE
, 
	`db_
(
t
));

77  (
	`b_ut_d_move
(
TESTDIR
) ? 1 : 0);

78 
	}
}

87 
	$b_ut_d_move
(
d
)

88 *
d
;

90 
t
, 
i
, 
isd
, 
t
;

91 
buf
[1024], **
mes
;

93 
t
 = 0;

96 i(
	`OS_EXISTS
(
NULL
, 
d
, &
isd
) != 0)

100 #i
DB_VERSION_MAJOR
 > 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 > 6

101 i((
t
 = 
	`__os_dli
(
NULL
, 
d
, 0, &
mes
, &
t
)) != 0)

102  (
t
);

104 i((
t
 = 
	`__os_dli
(
NULL
, 
d
, &
mes
, &
t
)) != 0)

105  (
t
);

108 
i
 = 0; i < 
t
; ++i) {

109 ()
	`tf
(
buf
, (buf),

110 "%s%c%s", 
d
, 
PATH_SEPARATOR
[0], 
mes
[
i
]);

111 i((
t
 = 
	`OS_EXISTS
(
NULL
, 
buf
, &
isd
)) != 0)

112 
fe_r
;

113 i(!
isd
 && (
t
 = 
	`b_ut_uƚk
(
buf
)) != 0) {

114 
fe_r
: 
	`rtf
(
dr
, "%s: %s: %s\n",

115 
ogme
, 
buf
, 
	`db_
(
t
));

120 
	`__os_d
(
NULL
, 
mes
, 
t
);

126 i(
i
 =
t
 && (
t
 = 
	`rmd
(
d
)) != 0)

127 
	`rtf
(
dr
,

128 "%s: %s: %s\n", 
ogme
, 
d
, 
	`db_
(
o
));

129  (
t
);

130 
	}
}

134 
	$b_ut_abt
()

136 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 6

137 
	`abt
();

138 #i
DB_VERSION_MAJOR
 =4 && 
DB_VERSION_MINOR
 == 6

139 
	`__os_abt
();

141 
	`__os_abt
(
NULL
);

143 
	}
}

146 
	$b_ut_uƚk
(
th
)

147 *
th
;

149 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 7

150  (
	`__os_uƚk
(
NULL
, 
th
));

152  (
	`__os_uƚk
(
NULL
, 
th
, 0));

154 
	}
}

	@../build_vxworks/test_micro/b_workload.c

5 
	~"bch.h
"

6 
	~"b_wkld.h
"

8 
b_wkld_dump_vbo_s
 
__P
((
DB
 *, 
CONFIG
 *));

9 
b_wkld_is_d_wkld
 
__P
(());

10 
b_wkld_is_g_wkld
 
__P
(());

11 
b_wkld_is_put_wkld
 
__P
(());

12 
b_wkld_run_mixed_wkld
 
__P
((
DB
 *, 
CONFIG
 *));

13 
b_wkld_run_d_wkld
 
__P
((
DB
 *, 
CONFIG
 *));

14 
b_wkld_uge
 
__P
(());

15 *
b_wkld_wkld_r
 
__P
(());

24 
	$b_wkld
(
gc
, 
gv
)

25 
gc
;

26 *
gv
[];

28 
*
ݏrg
;

29 

td
, 
__db_gt_t
;

30 
CONFIG
 
cf
;

31 
DB
 *
dbp
;

32 
DB_ENV
 *
dbv
;

33 
ch
, 
f
, 
ksz
;

35 
dbv
 = 
NULL
;

36 
	`memt
(&
cf
, 0, (conf));

37 
cf
.
ed
 = 124087;

38 
	`d
(
cf
.
ed
);

40 
cf
.
pcou
 = 100000;

41 
cf
.
ts
 = "Btree";

42 
cf
.
ty
 = 
DB_BTREE
;

43 
cf
.
dsize
 = 20;

44 
cf
.
esize
 = 0;

45 
cf
.
wkld
 = 
T_PUT_GET_DELETE
;

47 
__db_gt_t
 = 1;

48 (
ch
 = 
	`gt
(
gc
, 
gv
, "b:c:d:e:g:ik:m::r:t:vw:")!
EOF
)

49 
ch
) {

51 
cf
.
chesz
 = 
	`oi
(
ݏrg
);

54 
cf
.
pcou
 = 
	`oi
(
ݏrg
);

57 
cf
.
dsize
 = 
	`oi
(
ݏrg
);

60 
cf
.
curs_d
 = 
	`oi
(
ݏrg
);

63 
cf
.
gcou
 = 
	`oi
(
ݏrg
);

66 
cf
.
esize
 = 1;

69 
cf
.
ksize
 = 
	`oi
(
ݏrg
);

72 
cf
.
mesge
 = 
ݏrg
;

75 
cf
.
dedkeys
 = 1;

78 
cf
.
gesz
 = 
	`oi
(
ݏrg
);

81 
cf
.
num_dups
 = 
	`oi
(
ݏrg
);

84 
ݏrg
[0]) {

86 
cf
.
ts
 = "Btree";

87 
cf
.
ty
 = 
DB_BTREE
;

90 i(
	`b_ut_have_hash
())

92 
cf
.
ts
 = "Hash";

93 
cf
.
ty
 = 
DB_HASH
;

96  (
	`b_wkld_uge
());

100 
cf
.
vbo
 = 1;

103 
ݏrg
[0]) {

105 
cf
.
wkld
 = 
T_PUT_GET_DELETE
;

108 
cf
.
wkld
 = 
T_GET
;

111 
cf
.
wkld
 = 
T_PUT
;

114 
cf
.
wkld
 = 
T_DELETE
;

117 
cf
.
wkld
 = 
T_PUT_GET
;

120 
cf
.
wkld
 = 
T_PUT_DELETE
;

123 
cf
.
wkld
 = 
T_GET_DELETE
;

126 
cf
.
wkld
 = 
T_MIXED
;

129  (
	`b_wkld_uge
());

134 
	`rtf
(
dr
, "Invid oi: %c\n", 
ch
);

135  (
	`b_wkld_uge
());

137 
gc
 -
td
;

138 
gv
 +
td
;

139 i(
gc
 != 0)

140  (
	`b_wkld_uge
());

145 i(
cf
.
gesz
 != 0)

146 
	`DB_BENCH_ASSERT
(
cf
.
gesz
 >= 512 && conf.pagesz <= 65536 &&

147 ((
cf
.
gesz
 & (conf.pagesz - 1)) == 0));

149 i(
cf
.
chesz
 != 0)

150 
	`DB_BENCH_ASSERT
(
cf
.
chesz
 > 20480);

151 
	`DB_BENCH_ASSERT
(
cf
.
ksize
 =0 || cf.
dedkeys
 == 0);

154 
	`DB_BENCH_ASSERT
(
	`db_v_
(&
dbv
, 0) == 0);

155 
dbv
->
	`t_rfe
(dbv, 
dr
);

156 i(
cf
.
chesz
 != 0)

157 
	`DB_BENCH_ASSERT
(

158 
dbv
->
	`t_chesize
(dbv, 0, 
cf
.
chesz
, 0) == 0);

160 #i
DB_VERSION_MAJOR
 =3 && 
DB_VERSION_MINOR
 < 1

161 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbenv, "TESTDIR",

162 
NULL
, 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
, 0666) == 0);

164 
	`DB_BENCH_ASSERT
(
dbv
->
	`ݒ
(dbenv, "TESTDIR",

165 
DB_CREATE
 | 
DB_INIT_MPOOL
 | 
DB_PRIVATE
, 0666) == 0);

168 
	`DB_BENCH_ASSERT
(
	`db_
(&
dbp
, 
dbv
, 0) == 0);

169 i(
cf
.
gesz
 != 0)

170 
	`DB_BENCH_ASSERT
(

171 
dbp
->
	`t_gesize
(dbp, 
cf
.
gesz
) == 0);

172 i(
cf
.
esize
 !0 && cf.
ty
 =
DB_HASH
) {

173 
ksz
 = (
cf
.
dedkeys
 !0? (
u_t32_t
: cf.
ksize
;

174 i(
ksz
 == 0)

175 
ksz
 = 10;

176 
f
 = (
cf
.
gesz
 - 32)/(
ksz
 + cf.
dsize
 + 8);

177 
	`rtf
(
dr
, "f: %d\n", 
f
);

178 
	`DB_BENCH_ASSERT
(

179 
dbp
->
	`t_h_f
(dbp, 
f
) == 0);

180 
	`DB_BENCH_ASSERT
(

181 
dbp
->
	`t_h_m
(dbp, 
cf
.
pcou
*10) == 0);

183 #i
DB_VERSION_MAJOR
 >4 && 
DB_VERSION_MINOR
 >= 1

184 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

185 
dbp
, 
NULL
, 
TESTFILE
, NULL, 
cf
.
ty
, 
DB_CREATE
, 0666) == 0);

187 
	`DB_BENCH_ASSERT
(
dbp
->
	`ݒ
(

188 
dbp
, 
TESTFILE
, 
NULL
, 
cf
.
ty
, 
DB_CREATE
, 0666) == 0);

191 i(
cf
.
wkld
 =
T_MIXED
)

192 
	`b_wkld_run_mixed_wkld
(
dbp
, &
cf
);

194 
	`b_wkld_run_d_wkld
(
dbp
, &
cf
);

196 i(
	`b_wkld_is_put_wkld
(
cf
.
wkld
) == 0)

197 
	`timeedd
(&
cf
.
t_time
, &cf.
put_time
);

198 i(
	`b_wkld_is_g_wkld
(
cf
.
wkld
) == 0)

199 
	`timeedd
(&
cf
.
t_time
, &cf.
g_time
);

200 i(
	`b_wkld_is_d_wkld
(
cf
.
wkld
) == 0)

201 
	`timeedd
(&
cf
.
t_time
, &cf.
d_time
);

204 
	`DB_BENCH_ASSERT
(
dbp
->
	`sync
(dbp, 0) == 0);

206 i(
cf
.
vbo
 != 0)

207 
	`b_wkld_dump_vbo_s
(
dbp
, &
cf
);

209 
	`DB_BENCH_ASSERT
(
dbp
->
	`o
(dbp, 0) == 0);

210 
	`DB_BENCH_ASSERT
(
dbv
->
	`o
(dbenv, 0) == 0);

217 
	`tf
("# workloadest: %s: %s<br>%lu ops",

218 
cf
.
ts
, 
	`b_wkld_wkld_r
(cf.
wkld
), (
u_lg
)cf.
pcou
);

219 i(
cf
.
ksize
 != 0)

220 
	`tf
(", key size: %lu", (
u_lg
)
cf
.
ksize
);

221 i(
cf
.
dsize
 != 0)

222 
	`tf
(", dsize: %lu", (
u_lg
)
cf
.
dsize
);

223 i(
cf
.
gesz
 != 0)

224 
	`tf
(",agsize: %lu", (
u_lg
)
cf
.
gesz
);

226 
	`tf
(",age size: default");

227 i(
cf
.
chesz
 != 0)

228 
	`tf
(", cachsize: %lu", (
u_lg
)
cf
.
chesz
);

230 
	`tf
(", cache size: default");

231 
	`tf
(", %keys", 
cf
.
dedkeys
 == 1 ? "ordered" : "unordered");

232 
	`tf
(",um dups: %lu", (
u_lg
)
cf
.
num_dups
);

233 
	`tf
("\n");

235 i(
cf
.
wkld
 !
T_MIXED
) {

236 i(
cf
.
mesge
 !
NULL
)

237 
	`tf
("%%", 
cf
.
mesge
, cf.
ts
);

238 
	`TIME_DISPLAY
(
cf
.
pcou
, cf.
t_time
);

240 
	`TIMER_DISPLAY
(
cf
.
pcou
);

243 
	}
}

256 
	#GET_PROPORTION
 90

	)

257 
	#PUT_PROPORTION
 7

	)

258 
	#DEL_PROPORTION
 3

	)

261 
	$b_wkld_run_mixed_wkld
(
dbp
, 
cfig
)

262 
DB
 *
dbp
;

263 
CONFIG
 *
cfig
;

265 
DBT
 
key
, 
da
;

266 
size_t
 
xt_
, 
i
, 
ioff
;

267 
kbuf
[
KBUF_LEN
];

268 
bch_q
 
ݔi_queue
;

271 
	`DB_BENCH_ASSERT
(
cfig
->
dedkeys
 == 0);

273 
	`d
(
cfig
->
ed
);

274 
	`memt
(&
ݔi_queue
, 0, (
bch_q
));

276 
ioff
 = 0;

277 
	`INIT_KEY
(
key
, 
cfig
);

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

279 
	`DB_BENCH_ASSERT
(

280 (
da
.d
	`mloc
(da.
size
 = 
cfig
->
dsize
)!
NULL
);

287 
i
 = 0; i < 2 * 
cfig
->
pcou
; ++i) {

288 
	`GET_KEY_NEXT
(
key
, 
cfig
, 
kbuf
, 
i
);

289 
	`BENCH_Q_TAIL_INSERT
(
ݔi_queue
, 
kbuf
);

290 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

293 
TIMER_START
;

294 
i
 = 0; i < 
cfig
->
pcou
; ++i) {

295 
xt_
 = 
	`nd
()%100;

297 i(
xt_
 < 
GET_PROPORTION
 ) {

298 
	`BENCH_Q_POP_PUSH
(
ݔi_queue
, 
kbuf
);

299 
key
.
da
 = 
kbuf
;

300 
key
.
size
 = (
kbuf
);

301 
dbp
->
	`g
(dbp, 
NULL
, &
key
, &
da
, 0);

302 } i(
xt_
 < 
GET_PROPORTION
+
PUT_PROPORTION
) {

303 
	`GET_KEY_NEXT
(
key
, 
cfig
, 
kbuf
, 
i
);

304 
	`BENCH_Q_TAIL_INSERT
(
ݔi_queue
, 
kbuf
);

305 
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0);

307 
	`BENCH_Q_POP
(
ݔi_queue
, 
kbuf
);

308 
key
.
da
 = 
kbuf
;

309 
key
.
size
 = (
kbuf
);

310 
dbp
->
	`d
(dbp, 
NULL
, &
key
, 0);

313 
TIMER_STOP
;

314 
	`TIMER_GET
(
cfig
->
t_time
);

317 
	}
}

320 
	$b_wkld_run_d_wkld
(
dbp
, 
cfig
)

321 
DB
 *
dbp
;

322 
CONFIG
 *
cfig
;

324 
DBT
 
key
, 
da
;

325 
DBC
 *
dbc
;

326 
u_t32_t
 
i
;

327 
t
;

328 
kbuf
[
KBUF_LEN
];

331 
	`INIT_KEY
(
key
, 
cfig
);

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

333 
	`DB_BENCH_ASSERT
(

334 (
da
.d
	`mloc
(da.
size
 = 
cfig
->
dsize
)!
NULL
);

337 
TIMER_START
;

338 
i
 = 0; i < 
cfig
->
pcou
; ++i) {

339 
	`GET_KEY_NEXT
(
key
, 
cfig
, 
kbuf
, 
i
);

340 
	`DB_BENCH_ASSERT
(
dbp
->
	`put
(dbp, 
NULL
, &
key
, &
da
, 0) == 0);

342 
TIMER_STOP
;

343 
	`TIMER_GET
(
cfig
->
put_time
);

345 i(
	`b_wkld_is_g_wkld
(
cfig
->
wkld
) == 0) {

346 
TIMER_START
;

347 
i
 = 0; i <
cfig
->
gcou
; ++i) {

348 
	`DB_BENCH_ASSERT
(
dbp
->
	`curs
(dbp, 
NULL
, &
dbc
, 0) == 0);

349 (
dbc
->
	`c_g
(dbc, &
key
, &
da
, 
DB_NEXT
)) == 0);

350 
	`DB_BENCH_ASSERT
(
dbc
->
	`c_o
(dbc) == 0);

352 
TIMER_STOP
;

353 
	`TIMER_GET
(
cfig
->
g_time
);

356 i(
	`b_wkld_is_d_wkld
(
cfig
->
wkld
) == 0) {

358 
	`d
(
cfig
->
ed
);

360 
TIMER_START
;

361 i(
cfig
->
curs_d
 != 0) {

362 
	`DB_BENCH_ASSERT
(
dbp
->
	`curs
(dbp, 
NULL
, &
dbc
, 0) == 0);

364 (
t
 = 
dbc
->
	`c_g
(dbc, &
key
, &
da
, 
DB_NEXT
)) == 0)

365 
	`DB_BENCH_ASSERT
(
dbc
->
	`c_d
(dbc, 0) == 0);

366 
	`DB_BENCH_ASSERT
 (
t
 =
DB_NOTFOUND
);

368 
	`INIT_KEY
(
key
, 
cfig
);

369 
i
 = 0; i < 
cfig
->
pcou
; ++i) {

370 
	`GET_KEY_NEXT
(
key
, 
cfig
, 
kbuf
, 
i
);

372 
t
 = 
dbp
->
	`d
(dbp, 
NULL
, &
key
, 0);

377 i(
cfig
->
ksize
 == 0)

378 
DB_BENCH_ASSERT


379 (
t
 =0 || =
DB_NOTFOUND
);

381 
	`DB_BENCH_ASSERT
(
t
 == 0);

384 
TIMER_STOP
;

385 
	`TIMER_GET
(
cfig
->
d_time
);

388 
	}
}

391 
	$b_wkld_dump_vbo_s
(
dbp
, 
cfig
)

392 
DB
 *
dbp
;

393 
CONFIG
 *
cfig
;

399 #ifde
DB_WIN32


400 
_
 
f
;

402 

 
f
;

404 
DB_HASH_STAT
 *
h
;

405 
DB_BTREE_STAT
 *
b
;

406 
_
;

407 
th
[1024];

409 #ifde
DB_BENCH_INCLUDE_CONFIG_SUMMARY


410 
	`tf
("Completed workload benchmark.\n");

411 
	`tf
("Configuration summary:\n");

412 
	`tf
("\twkldy: %d\n", ()
cfig
->
wkld
);

413 
	`tf
("\tdabay: %s\n", 
cfig
->
ts
);

414 i(
cfig
->
chesz
 != 0)

415 
	`tf
("\tchsize: %lu\n", (
u_lg
)
cfig
->
chesz
);

416 i(
cfig
->
gesz
 != 0)

417 
	`tf
("\tdabaagsize: %lu\n", (
u_lg
)
cfig
->
gesz
);

418 
	`tf
("\uemcou: %lu\n", (
u_lg
)
cfig
->
pcou
);

419 i
	`b_wkld_is_g_wkld
(
cfig
->
wkld
) == 0)

420 
	`tf
("\tgmcou: %lu\n", (
u_lg
)
cfig
->
gcou
);

421 i(
cfig
->
dedkeys
)

422 
	`tf
("\tInserting items in order\n");

423 i(
cfig
->
ksize
 == 0)

424 
	`tf
("\tInserting keys with size 10\n");

426 
	`tf
(

427 "\tIng keywh size: %lu\n", (
u_lg
)
cfig
->
ksize
);

429 
	`tf
("\tIng demtsize: %lu\n", (
u_lg
)
cfig
->
dsize
);

431 i(
	`b_wkld_is_d_wkld
(
cfig
->
wkld
) == 0) {

432 i(
cfig
->
curs_d
)

433 
	`tf
("\tDeleting items using cursor\n");

435 
	`tf
("\tDeleting items without cursor\n");

439 i(
	`b_wkld_is_put_wkld
(
cfig
->
wkld
) == 0)

440 
	`tf
("%s Time spent inserting (%lu) (%s) items: %lu/%lu\n",

441 
cfig
->
mesge
[0] == '\0' ? "" : config->message,

442 (
u_lg
)
cfig
->
pcou
, cfig->
ts
,

443 (
u_lg
)
cfig
->
put_time
.
tv_c
, cfig->put_time.
tv_nc
);

445 i(
	`b_wkld_is_g_wkld
(
cfig
->
wkld
) == 0)

446 
	`tf
("%s Time spent getting (%lu) (%s) items: %lu/%lu\n",

447 
cfig
->
mesge
[0] == '\0' ? "" : config->message,

448 (
u_lg
)
cfig
->
pcou
 * ((cfig->
gcou
 == 0) ?

449 1 : 
cfig
->
gcou
), cfig->
ts
,

450 (
u_lg
)
cfig
->
g_time
.
tv_c
, cfig->g_time.
tv_nc
);

452 i(
	`b_wkld_is_d_wkld
(
cfig
->
wkld
) == 0)

453 
	`tf
("%s Time spent deleting (%lu) (%s) items: %lu/%lu\n",

454 
cfig
->
mesge
[0] == '\0' ? "" : config->message,

455 (
u_lg
)
cfig
->
pcou
, cfig->
ts
,

456 (
u_lg
)
cfig
->
d_time
.
tv_c
, cfig->d_time.
tv_nc
);

458 ()
	`tf
(
th
, (path),

459 "%s%c%s", 
TESTDIR
, 
PATH_SEPARATOR
[0], 
TESTFILE
);

460 #ifde
DB_WIN32


461 i(
	`_
(
th
, &
f
) == 0) {

463 i(
	`
(
th
, &
f
) == 0) {

465 
	`tf
("%s Size of db file (%s): %lu K\n",

466 
cfig
->
mesge
[0] == '\0' ? "" : config->message,

467 
cfig
->
ts
, (
u_lg
)
f
.
_size
/1024);

470 i(
cfig
->
ty
 =
DB_HASH
) {

471 #i
DB_VERSION_MAJOR
 < 3 || DB_VERSION_MAJOR =3 && 
DB_VERSION_MINOR
 <= 2

472 
	`DB_BENCH_ASSERT
(
dbp
->
	`
(dbp, &
h
, 
NULL
, 0) == 0);

473 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 <= 2

474 
	`DB_BENCH_ASSERT
(
dbp
->
	`
(dbp, &
h
, 0) == 0);

476 
	`DB_BENCH_ASSERT
(
dbp
->
	`
(dbp, 
NULL
, &
h
, 0) == 0);

482 
_
 = 
h
->
hash_gesize
*h->
hash_bucks
;

483 
_
 +
h
->
hash_gesize
*h->
hash_ovows
;

484 
_
 =

485 (
_
 - 
h
->
hash_b
 - h->
hash_ov_
)/

486 
_
;

487 
	`tf
("%s db fill factor (%s): %.2f%%\n",

488 
cfig
->
mesge
[0] == '\0' ? "" : config->message,

489 
cfig
->
ts
, 
_
*100);

490 
	`
(
h
);

492 #i
DB_VERSION_MAJOR
 < 3 || DB_VERSION_MAJOR =3 && 
DB_VERSION_MINOR
 <= 2

493 
	`DB_BENCH_ASSERT
(
dbp
->
	`
(dbp, &
b
, 
NULL
, 0) == 0);

494 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 <= 2

495 
	`DB_BENCH_ASSERT
(
dbp
->
	`
(dbp, &
b
, 0) == 0);

497 
	`DB_BENCH_ASSERT
(
dbp
->
	`
(dbp, 
NULL
, &
b
, 0) == 0);

499 
_
 = 
b
->
bt_gesize
*b->
bt_af_pg
;

500 
_
 = (_-
b
->
bt_af_pg
)/free_prop;

501 
	`tf
("%s db fill factor (%s): %.2f%%\n",

502 
cfig
->
mesge
[0] == '\0' ? "" : config->message,

503 
cfig
->
ts
, 
_
*100);

504 
	`
(
b
);

507 
	}
}

510 
	$b_wkld_wkld_r
(
wkld
)

511 
wkld
;

513 
buf
[128];

515 
wkld
) {

516 
T_PUT_GET_DELETE
:

519 
T_GET
:

522 
T_PUT
:

525 
T_DELETE
:

528 
T_PUT_GET
:

531 
T_PUT_DELETE
:

534 
T_GET_DELETE
:

537 
T_MIXED
:

538 
	`tf
(
buf
, (buf), "MIXED (get: %d,ut: %d, del: %d)",

539 ()
GET_PROPORTION
,

540 ()
PUT_PROPORTION
, ()
DEL_PROPORTION
);

541  (
buf
);

546 
	`ex
(
	`b_wkld_uge
());

548 
	}
}

551 
	$b_wkld_is_g_wkld
(
wkld
)

552 
wkld
;

554 
wkld
) {

555 
T_GET
:

556 
T_PUT_GET
:

557 
T_PUT_GET_DELETE
:

558 
T_GET_DELETE
:

562 
	}
}

565 
	$b_wkld_is_put_wkld
(
wkld
)

566 
wkld
;

568 
wkld
) {

569 
T_PUT
:

570 
T_PUT_GET
:

571 
T_PUT_GET_DELETE
:

572 
T_PUT_DELETE
:

576 
	}
}

579 
	$b_wkld_is_d_wkld
(
wkld
)

580 
wkld
;

582 
wkld
) {

583 
T_DELETE
:

584 
T_PUT_DELETE
:

585 
T_PUT_GET_DELETE
:

586 
T_GET_DELETE
:

590 
	}
}

593 
	$b_wkld_uge
()

595 ()
	`rtf
(
dr
,

597 ()
	`rtf
(
dr
,

599 ()
	`rtf
(
dr
, "\t[-r dup_count] [-type] [-wype]\n");

601 ()
	`rtf
(
dr
, "Where:\n");

602 ()
	`rtf
(
dr
, "\t-bhe size ofhe DB cache.\n");

603 ()
	`rtf
(
dr
, "\t-cheumber oflementso be measured.\n");

604 ()
	`rtf
(
dr
, "\t-dhe size ofach datalement.\n");

605 ()
	`rtf
(
dr
, "\t-e deletentries using cursor.\n");

606 ()
	`rtf
(
dr
, "\t-gumber of get cursorraverses.\n");

607 ()
	`rtf
(
dr
, "\t-i Pre-init hash DB bucket count.\n");

608 ()
	`rtf
(
dr
, "\t-khe size ofach key inserted.\n");

609 ()
	`rtf
(
dr
, "\t-m messagere-pendedoog output.\n");

610 ()
	`rtf
(
dr
, "\t-o keys should be ordered for insert.\n");

611 ()
	`rtf
(
dr
, "\t-pheage size forhe database.\n");

612 ()
	`rtf
(
dr
, "\t-rheumber of duplicateso insert\n");

613 ()
	`rtf
(
dr
, "\t-type ofhe underlying database.\n");

614 ()
	`rtf
(
dr
, "\t-whe workloado measure,vailable:\n");

615 ()
	`rtf
(
dr
, "\t\tA - PUT_GET_DELETE\n");

616 ()
	`rtf
(
dr
, "\t\tB - GET\n");

617 ()
	`rtf
(
dr
, "\t\tC - PUT\n");

618 ()
	`rtf
(
dr
, "\t\tD - DELETE\n");

619 ()
	`rtf
(
dr
, "\t\tE - PUT_GET\n");

620 ()
	`rtf
(
dr
, "\t\tF - PUT_DELETE\n");

621 ()
	`rtf
(
dr
, "\t\tG - GET_DELETE\n");

622 ()
	`rtf
(
dr
, "\t\tH - MIXED\n");

623  (
EXIT_FAILURE
);

624 
	}
}

	@../build_vxworks/test_micro/test_micro.c

5 
	~"bch.h
"

7 
_mio_ma
 
__P
((, *[]));

9 
_mio_run
 
__P
((*));

10 
_mio_uge
 
__P
(());

12 *
	gogme
;

14 
	g_t
 = 1;

15 
	g_d
 = 0;

18 *
	mme
;

19 (*
	mf
)(, *[]);

20 } 
	gcmdli
[] = {

21 { "b_cuoc", 
b_cuoc
 },

22 { "b_curwk", 
b_curwk
 },

23 { "b_d", 
b_d
 },

24 { "b_g", 
b_g
 },

25 { "b_mem", 
b_mem
 },

26 { "b_ld", 
b_ld
 },

27 { "b_ݒ", 
b_ݒ
 },

28 { "b_put", 
b_put
 },

29 { "b_cov", 
b_cov
 },

30 { "b_txn", 
b_txn
 },

31 { "b_txn_wre", 
b_txn_wre
 },

32 { "b_wkld", 
b_wkld
 },

33 { 
NULL
, NULL }

37 
	$_mio
(
gs
)

38 *
gs
;

40 
gc
;

41 **
gv
;

43 
	`__db_ut_g
("_mio", 
gs
, &
gc
, &
gv
);

44  (
	`_mio_ma
(
gc
, 
gv
? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

45 
	}
}

47 
	~<dio.h
>

48 
	#ERROR_RETURN
 
ERROR


	)

51 
	$_mio_ma
(
gc
, 
gv
)

52 
gc
;

53 *
gv
[];

55 
*
ݏrg
;

56 

td
, 
__db_gt_t
;

57 
ch
, 
t
;

58 *
run_dey
, *
ife
;

60 i((
ogme
 = 
	`__db_h
(
gv
[0])=
NULL
)

61 
ogme
 = 
gv
[0];

63 ++
ogme
;

65 #ifde
DB_BREW


66 i(
	`bdb_bw_beg
() != 0) {

67 
	`rtf
(
dr
,

69  (
EXIT_FAILURE
);

73 
run_dey
 = 
NULL
;

74 
ife
 = "run.std";

75 
__db_gt_t
 = 1;

76 (
ch
 = 
	`gt
(
gc
, 
gv
, "d:e:i:s:")!
EOF
)

77 
ch
) {

79 
run_dey
 = 
ݏrg
;

82 
_d
 = 
	`oi
(
ݏrg
);

85 
ife
 = 
ݏrg
;

88 
_t
 = 
	`oi
(
ݏrg
);

92  (
	`_mio_uge
());

94 
gc
 -
td
;

95 
gv
 +
td
;

98 i(
run_dey
 !
NULL
 && 
	`chd
(run_directory) != 0) {

99 
	`rtf
(
dr
,

100 "%s: %s: %s\n", 
ogme
, 
run_dey
, 
	`
(
o
));

105 i(
	`b_ut_d_down
())

108 
t
 = 
	`_mio_run
(
ife
);

110 #ifde
DB_BREW


111 
	`bdb_bw_d
();

114  (
t
 ? 
EXIT_FAILURE
 : 
EXIT_SUCCESS
);

115 
	}
}

122 
	$_mio_run
(
ife
)

123 *
ife
;

125 #ifde
HAVE_GETOPT_OPTRESET


126 

݌et
;

128 

td
, 
__db_gt_t
;

129 
_cur
 = 0;

130 
FILE
 *
i
;

131 
gc
, 
cmddx
, 
lo
, 
t
;

132 *
p
, 
cmd
[1024], 
th
[1024], **
gv
;

135 i(
	`b_ume
() != 0)

139 i((
i
 = 
	`fݒ
(
ife
, "r")=
NULL
) {

140 
	`rtf
(
dr
,

141 "%s: %s: %s\n", 
ogme
, 
ife
, 
	`
(
o
));

145 
lo
 = 1; 
	`fgs
(
cmd
, (cmd), 
i
!
NULL
; ++lineno) {

150 i((
p
 = 
	`rchr
(
cmd
, '\n')=
NULL
) {

151 
fm_r
: 
	`rtf
(
dr
, "%s: %s:ine %d: illegal input\n",

152 
ogme
, 
ife
, 
lo
);

155 i(
p
 > 
cmd
 &&[-1] == '\r')

156 --
p
;

157 *
p
 = '\0';

160 i(
cmd
[0] == '\0' || cmd[0] == '#')

164 i(++
_cur
 < 
_t
 ||

165 (
_d
 !0 && 
_cur
 >est_end))

168 
	`rtf
(
dr
, "%d: %s\n", 
_cur
, 
cmd
);

171 i((
p
 = 
	`rchr
(
cmd
, ' ')=
NULL
)

172 
fm_r
;

173 *
p
++ = '\0';

174 
cmddx
 = 0; 
cmdli
[cmddx].
me
 !
NULL
; ++cmdindx)

175 i(
	`rcmp
(
cmd
, 
cmdli
[
cmddx
].
me
) == 0)

177 i(
cmdli
[
cmddx
].
me
 =
NULL
)

178 
fm_r
;

181 i(
	`__db_ut_g
(
cmd
, 
p
, &
gc
, &
gv
) != 0)

185 ()
	`tf
(
th
, թh), "%d", 
_cur
);

186 i(
	`eݒ
(
th
, "a", 
dout
=
NULL
) {

187 
	`rtf
(
dr
,

188 "%s: %s: %s\n", 
ogme
, 
th
, 
	`
(
o
));

196 #ifde
HAVE_GETOPT_OPTRESET


197 
݌et
 = 1;

199 
td
 = 1;

202 i(
	`b_ut_d_tup
())

205 
t
 = 
cmdli
[
cmddx
].
	`f
(
gc
, 
gv
);

208 i(
	`b_ut_d_down
())

211 ()
	`fush
(
dout
);

213 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 1

214 
	`__os_
(
NULL
, 
gv
, 0);

216 
	`__os_
(
NULL
, 
gv
);

218 i(
t
 != 0)

219  (
t
);

223 
	}
}

226 
	$_mio_uge
()

228 ()
	`rtf
(
dr
,

230 
ogme
);

231  (
EXIT_FAILURE
);

232 
	}
}

	@../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_v_t_func_
 @3

7 
db_v_t_func_mloc
 @4

8 
db_v_t_func_loc
 @5

9 
db_qu_
 @6

10 
db_
 @7

11 
db_vsi
 @8

12 
db_xa_swch
 @9

13 
log_com
 @10

14 
__db_dbm_o
 @11

15 
__db_dbm_de
 @12

16 
__db_dbm_tch
 @13

17 
__db_dbm_fkey
 @14

18 
__db_dbm_
 @15

19 
__db_dbm_xtkey
 @16

20 
__db_dbm_e
 @17

21 
__db_g_ags_
 @18

22 
__db_g_q_ags_
 @19

23 
__db_h
 @20

24 
__db_hderoy
 @21

25 
__db_hch
 @22

26 
__db_ldme
 @23

27 
__db_ndbm_
 @24

28 
__db_ndbm_o
 @25

29 
__db_ndbm_de
 @26

30 
__db_ndbm_do
 @27

31 
__db_ndbm_r
 @28

32 
__db_ndbm_tch
 @29

33 
__db_ndbm_fkey
 @30

34 
__db_ndbm_xtkey
 @31

35 
__db_ndbm_ݒ
 @32

36 
__db_ndbm_go
 @33

37 
__db_ndbm_rdly
 @34

38 
__db_ndbm_e
 @35

39 
__db_w32_mux_lock
 @36

40 
__db_w32_mux_uock
 @37

41 
__v_nic
 @38

42 
__ham_func2
 @39

43 
__ham_func3
 @40

44 
__ham_func4
 @41

45 
__ham_func5
 @42

46 
__ham_
 @43

47 
__lock_id_t
 @44

48 
__os_oc
 @45

49 
__os_ohd
 @46

50 
__os_d
 @47

51 
__os_dli
 @48

52 
__os_
 @49

53 
__os_fsync
 @50

54 
__os_g_sy
 @51

55 
__os_gv
 @52

56 
__os_iofo
 @53

57 
__os_mloc
 @54

58 
__os_mkd
 @55

59 
__os_ݒ
 @56

60 
__os_ݒhd
 @57

61 
__os_posix_r
 @58

62 
__os_ad
 @59

63 
__os_loc
 @60

64 
__os_me
 @61

65 
__os_rdup
 @62

66 
__os_umloc
 @63

67 
__os_uƚk
 @64

68 
__os_wre
 @65

69 
__txn_id_t
 @66

70 
__bam_adj_ad
 @67

71 
__bam_dju_ad
 @68

72 
__bam_cd_ad
 @69

73 
__bam_cudj_ad
 @70

74 
__bam_mge_44_ad
 @71

75 
__bam_mge_ad
 @72

76 
__bam_pg
 @73

77 
__bam_pgno_ad
 @74

78 
__bam_pgout
 @75

79 
__bam_rcudj_ad
 @76

80 
__bam_lk_43_ad
 @77

81 
__bam_lk_ad
 @78

82 
__bam__ad
 @79

83 
__bam_ro_ad
 @80

84 
__bam_rl_ad
 @81

85 
__bam_l_ad
 @82

86 
__cfig_l
 @83

87 
__d_mem__ad
 @84

88 
__d_mem_move_ad
 @85

89 
__d_mem_me_ad
 @86

90 
__d_masub_ad
 @87

91 
__db_Crp
 @88

92 
__db_add_covy_t
 @89

93 
__db_addm_ad
 @90

94 
__db_big_ad
 @91

95 
__db_cksum_ad
 @92

96 
__db_debug_ad
 @93

97 
__db_dich
 @94

98 
__db_dl
 @95

99 
__db_dume
 @96

100 
__db_r
 @97

101 
__db_rx
 @98

102 
__db_glg
 @99

103 
__db_gulg
 @100

104 
__db_glob_vues
 @101

105 
__db_isbigdn
 @102

106 
__db_mkth
 @103

107 
__db_msg
 @104

108 
__db_no_ad
 @105

109 
__db_ovf_ad
 @106

110 
__db_pg_loc_42_ad
 @107

111 
__db_pg_loc_ad
 @108

112 
__db_pg__42_ad
 @109

113 
__db_pg__ad
 @110

114 
__db_pg_da_42_ad
 @111

115 
__db_pg_da_ad
 @112

116 
__db_pg__ad
 @113

117 
__db_pg_st_ad
 @114

118 
__db_pg
 @115

119 
__db_pgout
 @116

120 
__db__back
 @117

121 
__db_lk_42_ad
 @118

122 
__db_h
 @119

123 
__db__
 @120

124 
__db__t_
 @121

125 
__db_ut_che
 @122

126 
__db_ut_ued
 @123

127 
__db_ut_logt
 @124

128 
__db_ut_sig
 @125

129 
__db_ut_signd
 @126

130 
__db_vify_
 @127

131 
__dbg_gi_ad
 @128

132 
__f__ad
 @129

133 
__f_fe_move_ad
 @130

134 
__f_move_ad
 @131

135 
__f_me_ad
 @132

136 
__f_wre_ad
 @133

137 
__ham_chgpg_ad
 @134

138 
__ham_cyge_ad
 @135

139 
__ham_cudj_ad
 @136

140 
__ham_g_ma
 @137

141 
__ham_grouoc_42_ad
 @138

142 
__ham_grouoc_ad
 @139

143 
__ham_sd_ad
 @140

144 
__ham_magroup_42_ad
 @141

145 
__ham_magroup_ad
 @142

146 
__ham_wge_ad
 @143

147 
__ham_pg
 @144

148 
__ham_pgout
 @145

149 
__ham_a_ma
 @146

150 
__ham_a_ad
 @147

151 
__ham_lda_ad
 @148

152 
__lock_li_t
 @149

153 
__log__
 @150

154 
__mux_t_wa_fo
 @151

155 
__os_abt
 @152

156 
__os_abh
 @153

157 
__os_u_cou
 @154

158 
__os_ime
 @155

159 
__os_exis
 @156

160 
__os_fdlock
 @157

161 
__os_feid
 @158

162 
__os_addrfo
 @159

163 
__os_g_o
 @160

164 
__os_gaddrfo
 @161

165 
__os_gtime
 @162

166 
__os_id
 @163

167 
__os_io
 @164

168 
__os_io
 @165

169 
__os_mfe
 @166

170 
__os_physwre
 @167

171 
__os_ek
 @168

172 
__os_t_o
 @169

173 
__os_un
 @170

174 
__os_u
 @171

175 
__os_unique_id
 @172

176 
__os_unmfe
 @173

177 
__os_uloc
 @174

178 
__os_yld
 @175

179 
__qam_add_ad
 @176

180 
__qam_d_ad
 @177

181 
__qam_dext_ad
 @178

182 
__qam_cf_ad
 @179

183 
__qam_mvr_ad
 @180

184 
__qam_pg_out
 @181

185 
__p__t
 @182

186 
__txn_chd_ad
 @183

187 
__txn_ckp_42_ad
 @184

188 
__txn_ckp_ad
 @185

189 
__txn_cye_ad
 @186

190 
__txn_g_42_ad
 @187

191 
__txn_g_ad
 @188

192 
__txn_xa_g_ad
 @189

	@../build_windows/libdb.rc

1 1 
VERSIONINFO


2 
	gFILEVERSION
 4,0,7,25

3 
	gPRODUCTVERSION
 4,0,7,25

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.7 DLL\0"

21 
	gVALUE
 "FileVersion", "4.7.25\0"

22 
	gVALUE
 "InternalName", "libdb47.dll\0"

23 
	gVALUE
 "LegalCopyright", "Copyright  Oracle 1997,2008\0"

24 
	gVALUE
 "OriginalFilename", "libdb47.dll\0"

25 
	gVALUE
 "ProductName", "Oracleibdb\0"

26 
	gVALUE
 "ProductVersion", "4.7.25\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/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 i(
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
(
NULL
);

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 
	}
}

	@../clib/time.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
time_t


21 
	$time
(
nowp
)

22 
time_t
 *
nowp
;

24 
db_timeec
 
t
;

25 
time_t
 
s
;

27 
	`__os_gtime
(
NULL
, &
t
, 0);

29 
s
 = 
t
.
tv_c
 +.
tv_nc
 / 
NS_PER_SEC
;

31 i(
nowp
 !
NULL
)

32 *
nowp
 = 
s
;

33  (
s
);

34 
	}
}

	@../common/crypto_stub.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

25 
	$__yo_gi_
(
v
)

26 
ENV
 *
v
;

28 
REGENV
 *
nv
;

29 
REGINFO
 *
f
;

30 
t
;

32 
f
 = 
v
->
gfo
;

33 
nv
 = 
f
->
imy
;

34 
	`MUTEX_LOCK
(
v
, 
nv
->
mtx_gv
);

35 
t
 = !(
nv
->
ch_off
 =
INVALID_ROFF
);

36 
	`MUTEX_UNLOCK
(
v
, 
nv
->
mtx_gv
);

38 i(
t
 == 0)

41 
	`__db_rx
(
v
,

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
(
v
, 
ld
)

43 
ENV
 *
v
;

44 
ld
;

46 
ld
) {

50 i(!
	`F_ISSET
(
v
, 
ENV_LITTLEENDIAN
))

51  (
DB_SWAPBYTES
);

54 i(
	`F_ISSET
(
v
, 
ENV_LITTLEENDIAN
))

55  (
DB_SWAPBYTES
);

58 
	`__db_rx
(
v
,

60  (
EINVAL
);

63 
	}
}

	@../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
(
v
, 
me
, 
ags
, 
ok_ags
)

30 
ENV
 *
v
;

31 cڡ *
me
;

32 
u_t32_t
 
ags
, 
ok_ags
;

34  (
	`LF_ISSET
(~
ok_ags
? 
	`__db_
(
v
, 
me
, 0) : 0);

35 
	}
}

45 
	$__db_fcchk
(
v
, 
me
, 
ags
, 
ag1
, 
ag2
)

46 
ENV
 *
v
;

47 cڡ *
me
;

48 
u_t32_t
 
ags
, 
ag1
, 
ag2
;

50  (
	`LF_ISSET
(
ag1
) &&

51 
	`LF_ISSET
(
ag2
? 
	`__db_
(
v
, 
me
, 1) : 0);

52 
	}
}

61 
	$__db_
(
v
, 
me
, 
iscombo
)

62 cڡ 
ENV
 *
v
;

63 cڡ *
me
;

64 
iscombo
;

66 
	`__db_rx
(
v
, "illegal flag %sspecifiedo %s",

67 
iscombo
 ? "combi " : "", 
me
);

68  (
EINVAL
);

69 
	}
}

78 
	$__db_l
(
v
, 
me
)

79 cڡ 
ENV
 *
v
;

80 cڡ *
me
;

82 
	`__db_rx
(
v
,

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
->
v
,

106 "ubˁ/vg%lu", (
u_lg
)
pgno
);

107  (
	`__v_nic
(
dbp
->
v
, 
rv
));

108 
	}
}

117 
	$__db_pgfmt
(
v
, 
pgno
)

118 
ENV
 *
v
;

119 
db_pgno_t
 
pgno
;

121 
	`__db_rx
(
v
, "g%lu: iegagty ofm", (
u_lg
)
pgno
);

122  (
	`__v_nic
(
v
, 
EINVAL
));

123 
	}
}

125 #ifde
DIAGNOSTIC


135 
	$__db_as
(
v
, 
e
, 
fe
, 
le
)

136 
ENV
 *
v
;

137 cڡ *
e
, *
fe
;

138 
le
;

140 
	`__db_rx
(
v
, "as fau: %s/%d: \"%s\"", 
fe
, 
le
, 
e
);

142 
	`__os_abt
(
v
);

144 
	}
}

154 
	$__v_nic_msg
(
v
)

155 
ENV
 *
v
;

157 
DB_ENV
 *
dbv
;

158 
t
;

160 
dbv
 = 
v
->dbenv;

162 
t
 = 
DB_RUNRECOVERY
;

164 
	`__db_rx
(
v
, "PANIC: fatalegionrror detected;unecovery");

166 i(
dbv
->
db_nic
 !
NULL
)

167 
dbv
->
	`db_nic
(dbv, 
t
);

168 
	`DB_EVENT
(
v
, 
DB_EVENT_PANIC
, &
t
);

170  (
t
);

171 
	}
}

180 
	$__v_nic
(
v
, 
rv
)

181 
ENV
 *
v
;

182 
rv
;

184 
DB_ENV
 *
dbv
;

186 
dbv
 = 
v
->dbenv;

188 i(
v
 !
NULL
) {

189 
	`__v_nic_t
(
v
, 1);

191 
	`__db_r
(
v
, 
rv
, "PANIC");

193 i(
dbv
->
db_nic
 !
NULL
)

194 
dbv
->
	`db_nic
(dbv, 
rv
);

195 
	`DB_EVENT
(
v
, 
DB_EVENT_PANIC
, &
rv
);

198 #i
	`defed
(
DIAGNOSTIC
&& !defed(
CONFIG_TEST
)

206 
	`__os_abt
(
v
);

215  (
DB_RUNRECOVERY
);

216 
	}
}

225 
	$db_
(
r
)

226 
r
;

228 *
p
;

230 i(
r
 == 0)

232 i(
r
 > 0) {

233 i((
p
 = 
	`
(
r
)!
NULL
)

234  (
p
);

235  (
	`__db_unknown_r
(
r
));

245 
r
) {

246 
DB_BUFFER_SMALL
:

249 
DB_DONOTINDEX
:

251 
DB_FOREIGN_CONFLICT
:

254 
DB_KEYEMPTY
:

256 
DB_KEYEXIST
:

258 
DB_LOCK_DEADLOCK
:

261 
DB_LOCK_NOTGRANTED
:

263 
DB_LOG_BUFFER_FULL
:

265 
DB_NOSERVER
:

267 
DB_NOSERVER_HOME
:

269 
DB_NOSERVER_ID
:

271 
DB_NOTFOUND
:

273 
DB_OLD_VERSION
:

275 
DB_PAGE_NOTFOUND
:

277 
DB_REP_DUPMASTER
:

279 
DB_REP_HANDLE_DEAD
:

281 
DB_REP_HOLDELECTION
:

283 
DB_REP_IGNORE
:

285 
DB_REP_ISPERM
:

287 
DB_REP_JOIN_FAILURE
:

290 
DB_REP_LEASE_EXPIRED
:

293 
DB_REP_LOCKOUT
:

296 
DB_REP_NEWSITE
:

298 
DB_REP_NOTPERM
:

300 
DB_REP_UNAVAIL
:

302 
DB_RUNRECOVERY
:

304 
DB_SECONDARY_BAD
:

307 
DB_VERIFY_BAD
:

309 
DB_VERSION_MISMATCH
:

316  (
	`__db_unknown_r
(
r
));

317 
	}
}

326 
	$__db_unknown_r
(
r
)

327 
r
;

340 ()
	`tf
(
	`DB_GLOBAL
(
r_buf
),

341 (
	`DB_GLOBAL
(
r_buf
)), "Unknowr: %d", 
r
);

342  (
	`DB_GLOBAL
(
r_buf
));

343 
	}
}

353 #ifde
STDC_HEADERS


354 
	$__db_sy
(cڡ 
ENV
 *
v
, 
r
, cڡ *
fmt
, ...)

356 
	$__db_sy
(
v
, 
r
, 
fmt
, 
va_i
)

357 cڡ 
ENV
 *
v
;

358 
r
;

359 cڡ *
fmt
;

360 
va_d


363 
DB_ENV
 *
dbv
;

365 
dbv
 = 
v
 =
NULL
 ? NULL :nv->dbenv;

372 
	`DB_REAL_ERR
(
dbv
, 
r
, 
DB_ERROR_SYSTEM
, 0, 
fmt
);

373 
	}
}

383 #ifde
STDC_HEADERS


384 
	$__db_r
(cڡ 
ENV
 *
v
, 
r
, cڡ *
fmt
, ...)

386 
	$__db_r
(
v
, 
r
, 
fmt
, 
va_i
)

387 cڡ 
ENV
 *
v
;

388 
r
;

389 cڡ *
fmt
;

390 
va_d


393 
DB_ENV
 *
dbv
;

395 
dbv
 = 
v
 =
NULL
 ? NULL :nv->dbenv;

401 
	`DB_REAL_ERR
(
dbv
, 
r
, 
DB_ERROR_SET
, 0, 
fmt
);

402 
	}
}

412 #ifde
STDC_HEADERS


413 
	$__db_rx
(cڡ 
ENV
 *
v
, cڡ *
fmt
, ...)

415 
	$__db_rx
(
v
, 
fmt
, 
va_i
)

416 cڡ 
ENV
 *
v
;

417 cڡ *
fmt
;

418 
va_d


421 
DB_ENV
 *
dbv
;

423 
dbv
 = 
v
 =
NULL
 ? NULL :nv->dbenv;

429 
	`DB_REAL_ERR
(
dbv
, 0, 
DB_ERROR_NOT_SET
, 0, 
fmt
);

430 
	}
}

440 
	$__db_r
(
dbv
, 
r
, 
r_t
, 
fmt
, 

)

441 cڡ 
DB_ENV
 *
dbv
;

442 
r
;

443 
db_r_t_t
 
r_t
;

444 cڡ *
fmt
;

445 
va_li
 

;

447 *
p
;

448 
buf
[2048];

449 
sysbuf
[1024];

451 
p
 = 
buf
;

452 i(
fmt
 !
NULL
)

453 
p
 +
	`vtf
(
buf
, (buf), 
fmt
, 

);

454 i(
r_t
 !
DB_ERROR_NOT_SET
)

455 
p
 +
	`tf
(p,

456 (
buf
- (
size_t
)(
p
 - buf), ": %s",

457 
r_t
 =
DB_ERROR_SET
 ? 
	`db_
(
r
) :

458 
	`__os_
(
r
, 
sysbuf
, (sysbuf)));

460 
dbv
->
	`db_r
(dbv, dbv->
db_fx
, 
buf
);

461 
	}
}

471 
	$__db_rfe
(
dbv
, 
r
, 
r_t
, 
fmt
, 

)

472 cڡ 
DB_ENV
 *
dbv
;

473 
r
;

474 
db_r_t_t
 
r_t
;

475 cڡ *
fmt
;

476 
va_li
 

;

478 
FILE
 *

;

479 
ed_p
;

480 
sysbuf
[1024];

482 

 = 
dbv
 =
NULL
 ||

483 
dbv
->
db_rfe
 =
NULL
 ? 
dr
 : dbenv->db_errfile;

484 
ed_p
 = 0;

486 i(
dbv
 !
NULL
 && dbv->
db_fx
 != NULL) {

487 ()
	`rtf
(

, "%s", 
dbv
->
db_fx
);

488 
ed_p
 = 1;

490 i(
fmt
 !
NULL
 && fmt[0] != '\0') {

491 i(
ed_p
)

492 ()
	`rtf
(

, ": ");

493 
ed_p
 = 1;

494 ()
	`vrtf
(

, 
fmt
, 

);

496 i(
r_t
 !
DB_ERROR_NOT_SET
)

497 ()
	`rtf
(

, "%s%s",

498 
ed_p
 ? ": " : "",

499 
r_t
 =
DB_ERROR_SET
 ? 
	`db_
(
r
) :

500 
	`__os_
(
r
, 
sysbuf
, (sysbuf)));

501 ()
	`rtf
(

, "\n");

502 ()
	`fush
(

);

503 
	}
}

513 #ifde
STDC_HEADERS


514 
	$__db_msgadd
(
ENV
 *
v
, 
DB_MSGBUF
 *
mbp
, cڡ *
fmt
, ...)

516 
	$__db_msgadd
(
v
, 
mbp
, 
fmt
, 
va_i
)

517 
ENV
 *
v
;

518 
DB_MSGBUF
 *
mbp
;

519 cڡ *
fmt
;

520 
va_d


523 
va_li
 

;

525 #ifde
STDC_HEADERS


526 
	`va_t
(

, 
fmt
);

528 
	`va_t
(

);

530 
	`__db_msgadd_
(
v
, 
mbp
, 
fmt
, 

);

531 
	`va_d
(

);

532 
	}
}

542 
	$__db_msgadd_
(
v
, 
mbp
, 
fmt
, 

)

543 
ENV
 *
v
;

544 
DB_MSGBUF
 *
mbp
;

545 cڡ *
fmt
;

546 
va_li
 

;

548 
size_t
 
n
, 
ޒ
;

549 
buf
[2048];

551 
n
 = (
size_t
)
	`vtf
(
buf
, (buf), 
fmt
, 

);

558 
ޒ
 = (
size_t
)(
mbp
->
cur
 - mbp->
buf
);

559 i(
ޒ
 + 
n
 >
mbp
->len) {

560 i(
	`__os_loc
(
v
, 
mbp
->
n
 + + 256, &mbp->
buf
))

562 
mbp
->
n
 += (len + 256);

563 
mbp
->
cur
 = mbp->
buf
 + 
ޒ
;

566 
	`memy
(
mbp
->
cur
, 
buf
, 
n
 + 1);

567 
mbp
->
cur
 +
n
;

568 
	}
}

578 #ifde
STDC_HEADERS


579 
	$__db_msg
(cڡ 
ENV
 *
v
, cڡ *
fmt
, ...)

581 
	$__db_msg
(
v
, 
fmt
, 
va_i
)

582 cڡ 
ENV
 *
v
;

583 cڡ *
fmt
;

584 
va_d


587 
DB_ENV
 *
dbv
;

589 
dbv
 = 
v
 =
NULL
 ? NULL :nv->dbenv;

591 
	`DB_REAL_MSG
(
dbv
, 
fmt
);

592 
	}
}

599 
	$__db_msg
(
dbv
, 
fmt
, 

)

600 cڡ 
DB_ENV
 *
dbv
;

601 cڡ *
fmt
;

602 
va_li
 

;

604 
buf
[2048];

606 ()
	`vtf
(
buf
, (buf), 
fmt
, 

);

608 
dbv
->
	`db_msg
(dbv, 
buf
);

609 
	}
}

616 
	$__db_msgfe
(
dbv
, 
fmt
, 

)

617 cڡ 
DB_ENV
 *
dbv
;

618 cڡ *
fmt
;

619 
va_li
 

;

621 
FILE
 *

;

623 

 = 
dbv
 =
NULL
 ||

624 
dbv
->
db_msgfe
 =
NULL
 ? 
dout
 : dbenv->db_msgfile;

625 ()
	`vrtf
(

, 
fmt
, 

);

627 ()
	`rtf
(

, "\n");

628 ()
	`fush
(

);

629 
	}
}

637 
	$__db_unknown_ag
(
v
, 
route
, 
ag
)

638 
ENV
 *
v
;

639 *
route
;

640 
u_t32_t
 
ag
;

642 
	`__db_rx
(
v
, "%s: Unknowag: %#x", 
route
, (
u_t
)
ag
);

644 #ifde
DIAGNOSTIC


645 
	`__os_abt
(
v
);

648  (
EINVAL
);

649 
	}
}

657 
	$__db_unknown_ty
(
v
, 
route
, 
ty
)

658 
ENV
 *
v
;

659 *
route
;

660 
DBTYPE
 
ty
;

662 
	`__db_rx
(
v
,

664 
route
, 
	`__db_dbty_to_rg
(
ty
));

666 #ifde
DIAGNOSTIC


667 
	`__os_abt
(
v
);

670  (
EINVAL
);

671 
	}
}

679 
	$__db_unknown_th
(
v
, 
route
)

680 
ENV
 *
v
;

681 *
route
;

683 
	`__db_rx
(
v
, "%s: Uxed codth", 
route
);

685 #ifde
DIAGNOSTIC


686 
	`__os_abt
(
v
);

689  (
EINVAL
);

690 
	}
}

699 
	$__db_check_txn
(
dbp
, 
txn
, 
assoc_lock
, 
ad_
)

700 
DB
 *
dbp
;

701 
DB_TXN
 *
txn
;

702 
DB_LOCKER
 *
assoc_lock
;

703 
ad_
;

705 
ENV
 *
v
;

706 
i
, 
t
;

708 
v
 = 
dbp
->env;

718 i(
	`IS_RECOVERING
(
v
|| 
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
))

727 i(
txn
 =
NULL
 || 
	`F_ISSET
xn, 
TXN_PRIVATE
)) {

728 i(
dbp
->
cur_lock
 !
NULL
 &&

729 
dbp
->
cur_lock
->
id
 >
TXN_MINIMUM
)

730 
ݒ_r
;

732 i(!
ad_
 && 
	`F_ISSET
(
dbp
, 
DB_AM_TXN
)) {

733 
	`__db_rx
(
v
,

735  (
EINVAL
);

737 } i(
	`F_ISSET
(
txn
, 
TXN_CDSGROUP
)) {

738 i(!
	`CDB_LOCKING
(
v
)) {

739 
	`__db_rx
(
v
,

741  (
EINVAL
);

749 i(!
	`TXN_ON
(
v
))

750  (
	`__db_n_txn_v
(
v
));

752 i(!
	`F_ISSET
(
dbp
, 
DB_AM_TXN
)) {

753 
	`__db_rx
(
v
,

755  (
EINVAL
);

758 i(
	`F_ISSET
(
txn
, 
TXN_DEADLOCK
))

759  (
	`__db_txn_ddlock_r
(
v
, 
txn
));

760 i(
dbp
->
cur_lock
 !
NULL
 &&

761 
dbp
->
cur_lock
->
id
 >
TXN_MINIMUM
 &&

762 
dbp
->
cur_lock
->
id
 !
txn
->
txnid
) {

763 i((
t
 = 
	`__lock_lock_is_
(
v
,

764 
dbp
->
cur_lock
, 
txn
->
lock
, &
i
)) != 0)

765  (
t
);

766 i(!
i
)

767 
ݒ_r
;

786 i(!
ad_
 && 
dbp
->
assoc_lock
 !
NULL
 &&

787 
txn
 !
NULL
 && 
dbp
->
assoc_lock
 !
assoc_lock
) {

788 
	`__db_rx
(
v
,

790  (
EINVAL
);

796 i(
txn
 !
NULL
 && 
v
 !txn->
mg
->env) {

797 
	`__db_rx
(
v
,

799  (
EINVAL
);

803 
ݒ_r
:

804 
	`__db_rx
(
v
,

806  (
EINVAL
);

807 
	}
}

816 
	$__db_txn_ddlock_r
(
v
, 
txn
)

817 
ENV
 *
v
;

818 
DB_TXN
 *
txn
;

820 cڡ *
me
;

822 
me
 = 
NULL
;

823 ()
	`__txn_g_me
(
txn
, &
me
);

825 
	`__db_rx
(
v
,

827 
me
 =
NULL
 ? "" :ame,ame == NULL ? "" : ": ");

829  (
EINVAL
);

830 
	}
}

839 
	$__db_n_txn_v
(
v
)

840 
ENV
 *
v
;

842 
	`__db_rx
(
v
, "DBnvironmentot configured forransactions");

843  (
EINVAL
);

844 
	}
}

853 
	$__db_c_toobig
(
v
, 
da_n
, 
fixed_c_n
)

854 
ENV
 *
v
;

855 
u_t32_t
 
da_n
, 
fixed_c_n
;

857 
	`__db_rx
(
v
,

859 (
u_lg
)
da_n
, (u_lg)
fixed_c_n
);

860  (
EINVAL
);

861 
	}
}

870 
	$__db_c_
(
v
, 
da_size
, 
da_dn
)

871 
ENV
 *
v
;

872 
u_t32_t
 
da_size
, 
da_dn
;

874 
	`__db_rx
(
v
,

876 "Recdgth", (
u_lg
)
da_size
, (u_lg)
da_dn
);

877  (
EINVAL
);

878 
	}
}

880 #i
defed
(
DIAGNOSTIC
|| defed(
DEBUG_ROP
|| defed(
DEBUG_WOP
)

888 
	$__dbc_loggg
(
dbc
)

889 
DBC
 *
dbc
;

891 
DB_REP
 *
db_p
;

892 
ENV
 *
v
;

893 
t
;

895 
v
 = 
dbc
->env;

896 
db_p
 = 
v
->
p_hd
;

898 
t
 = 
	`LOGGING_ON
(
v
) &&

899 !
	`F_ISSET
(
dbc
, 
DBC_RECOVER
&& !
	`IS_REP_CLIENT
(
v
);

904 i(
db_p
 =
NULL
 || 
	`F_ISSET
(
dbc
, 
DBC_RECOVER
))

905  (
t
);

907 #idef 
DEBUG_ROP


914 
REP
 *
p
;

916 
p
 = 
db_p
->
gi
;

921 i(
	`IS_REP_CLIENT
(
v
&& !
	`F_ISSET
(
dbc
->
dbp
, 
DB_AM_NOT_DURABLE
)) {

922 
	`__db_rx
(
v
, "dbc_logging: Client update");

923 
r
;

926 #ide
DEBUG_WOP


931 i(
	`IS_REP_MASTER
(
v
) &&

932 
dbc
->
txn
 =
NULL
 && !
	`F_ISSET
(dbc->
dbp
, 
DB_AM_NOT_DURABLE
)) {

933 
	`__db_rx
(
v
, "Dbc_logging: Masteron-txn update");

934 
r
;

939 
r
: 
	`__db_rx
(
v
, "Rep: flags 0x%lx msg_th %lu",

940 (
u_lg
)
p
->
ags
, (u_lg->
msg_th
);

941 
	`__db_rx
(
v
, "Rep: handle %lu, opcnt %lu",

942 (
u_lg
)
p
->
hd_t
, (u_lg->
_t
);

943 
	`__os_abt
(
v
);

948  (
t
);

949 
	}
}

959 
	$__db_check_l
(
v
, 
l
, 
ev
)

960 
ENV
 *
v
;

961 
DB_LSN
 *
l
, *
ev
;

963 
	`__db_rx
(
v
,

965 (
u_lg
)(
l
)->
fe
, (u_lg)֢)->
offt
,

966 (
u_lg
)(
ev
)->
fe
, (u_lg)ջv)->
offt
);

967  (
EINVAL
);

968 
	}
}

976 
	$__db_rdly
(
v
, 
me
)

977 cڡ 
ENV
 *
v
;

978 cڡ *
me
;

980 
	`__db_rx
(
v
, "%s:emmodifyd-ly daba", 
me
);

981  (
EACCES
);

982 
	}
}

990 
	$__db_a_r
(
dbp
)

991 cڡ 
DB
 *
dbp
;

993 
	`__db_rx
(
dbp
->
v
,

995 
dbp
->
ame
, (
u_lg
)dbp->
mpf
->
m
->
maxpgno
);

996  (
ENOSPC
);

997 
	}
}

1007 
	$__db_ed
(
v
, 
msg
, 
pid
, 
tid
)

1008 cڡ 
ENV
 *
v
;

1009 cڡ *
msg
;

1010 
pid_t
 
pid
;

1011 
db_thadid_t
 
tid
;

1013 
DB_ENV
 *
dbv
;

1014 
buf
[
DB_THREADID_STRLEN
];

1016 
dbv
 = 
v
->dbenv;

1018 
	`__db_rx
(
v
, "Thread/process %s failed: %s",

1019 
dbv
->
	`thad_id_rg
(dbv, 
pid
, 
tid
, 
buf
), 
msg
);

1020  (
DB_RUNRECOVERY
);

1021 
	}
}

	@../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/dbt.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
	$__dbt_urcy
(
v
, 
dbt
)

21 
ENV
 *
v
;

22 
DBT
 *
dbt
;

24 *
buf
;

25 
t
;

27 i(
dbt
 =
NULL
 || !
	`F_ISSET
(dbt, 
DB_DBT_USERCOPY
|| dbt->
size
 == 0 ||

28 
dbt
->
da
 !
NULL
)

31 
buf
 = 
NULL
;

32 i((
t
 = 
	`__os_umloc
(
v
, 
dbt
->
size
, &
buf
)) != 0 ||

33 (
t
 = 
v
->
	`dbt_urcy
(
dbt
, 0, 
buf
, dbt->
size
,

34 
DB_USERCOPY_GETDATA
)) != 0)

35 
r
;

36 
dbt
->
da
 = 
buf
;

40 
r
: i(
buf
 !
NULL
) {

41 
	`__os_u
(
v
, 
buf
);

42 
dbt
->
da
 = 
NULL
;

45  (
t
);

46 
	}
}

55 
	$__dbt_ur
(
v
, 
key
, 
pkey
, 
da
)

56 
ENV
 *
v
;

57 
DBT
 *
key
, *
pkey
, *
da
;

59 i(
key
 !
NULL
 &&

60 
	`F_ISSET
(
key
, 
DB_DBT_USERCOPY
&& key->
da
 !
NULL
) {

61 
	`__os_u
(
v
, 
key
->
da
);

62 
key
->
da
 = 
NULL
;

64 i(
pkey
 !
NULL
 &&

65 
	`F_ISSET
(
pkey
, 
DB_DBT_USERCOPY
&&key->
da
 !
NULL
) {

66 
	`__os_u
(
v
, 
pkey
->
da
);

67 
pkey
->
da
 = 
NULL
;

69 i(
da
 !
NULL
 &&

70 
	`F_ISSET
(
da
, 
DB_DBT_USERCOPY
&& da->d!
NULL
) {

71 
	`__os_u
(
v
, 
da
->data);

72 
da
->d
NULL
;

74 
	}
}

	@../common/mkpath.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

20 
	$__db_mkth
(
v
, 
me
)

21 
ENV
 *
v
;

22 cڡ *
me
;

24 
size_t
 
n
;

25 
t
;

26 *
p
, *
t
, 
vech
;

32 
n
 = 
	`
(
me
) + 1;

33 i((
t
 = 
	`__os_mloc
(
v
, 
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
(
v
, 
t
, 
NULL
) &&

49 (
t
 = 
	`__os_mkd
(

50 
v
, 
t
,nv->
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
(
v
, 
t
, 
NULL
) &&

60 (
t
 = 
	`__os_mkd
(

61 
v
, 
t
,nv->
d_mode
)) != 0)

63 *
p
 = 
vech
;

66 
	`__os_
(
v
, 
t
);

67  (
t
);

68 
	}
}

	@../common/openflags.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

19 
u_t32_t


20 
	$__db_ݒags
(
oags
)

21 
oags
;

23 
u_t32_t
 
dbags
;

25 
dbags
 = 0;

27 i(
oags
 & 
O_CREAT
)

28 
dbags
 |
DB_CREATE
;

30 i(
oags
 & 
O_TRUNC
)

31 
dbags
 |
DB_TRUNCATE
;

39 #idef 
O_ACCMODE


40 
	#O_ACCMODE
 (
O_RDONLY
 | 
O_RDWR
 | 
O_WRONLY
)

	)

42 
oags
 & 
O_ACCMODE
) {

43 
O_RDWR
:

44 
O_WRONLY
:

47 
dbags
 |
DB_RDONLY
;

50  (
dbags
);

51 
	}
}

	@../common/os_method.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

17 
	$db_v_t_func_o
(
func_o
)

18 (*
func_o

	`__P
(());

20 
	`DB_GLOBAL
(
j_o

func_o
;

22 
	}
}

28 
	$db_v_t_func_d
(
func_d
)

29 (*
func_d

	`__P
((**, ));

31 
	`DB_GLOBAL
(
j_d

func_d
;

33 
	}
}

40 
	$db_v_t_func_dli
(
func_dli
)

41 (*
func_dli

	`__P
((const *, ***, *));

43 
	`DB_GLOBAL
(
j_dli

func_dli
;

45 
	}
}

51 
	$db_v_t_func_exis
(
func_exis
)

52 (*
func_exis

	`__P
((const *, *));

54 
	`DB_GLOBAL
(
j_exis

func_exis
;

56 
	}
}

62 
	$db_v_t_func_
(
func_
)

63 (*
func_

	`__P
((*));

65 
	`DB_GLOBAL
(
j_

func_
;

67 
	}
}

73 
	$db_v_t_func_fsync
(
func_fsync
)

74 (*
func_fsync

	`__P
(());

76 
	`DB_GLOBAL
(
j_fsync

func_fsync
;

78 
	}
}

84 
	$db_v_t_func_run
(
func_run
)

85 (*
func_run

	`__P
((, 
off_t
));

87 
	`DB_GLOBAL
(
j_run

func_run
;

89 
	}
}

96 
	$db_v_t_func_iofo
(
func_iofo
)

97 (*
func_iofo
)

98 
	`__P
((cڡ *, , 
u_t32_t
 *, u_int32_t *, u_int32_t *));

100 
	`DB_GLOBAL
(
j_iofo

func_iofo
;

102 
	}
}

108 
	$db_v_t_func_mloc
(
func_mloc
)

109 *(*
func_mloc

	`__P
((
size_t
));

111 
	`DB_GLOBAL
(
j_mloc

func_mloc
;

113 
	}
}

121 
	$db_v_t_func_fe_m
(
func_fe_m
, 
func_fe_unm
)

122 (*
func_fe_m

	`__P
((
DB_ENV
 *, *, 
size_t
, , **));

123 (*
func_fe_unm

	`__P
((
DB_ENV
 *, *));

125 
	`DB_GLOBAL
(
j_fe_m

func_fe_m
;

126 
	`DB_GLOBAL
(
j_fe_unm

func_fe_unm
;

128 
	}
}

136 
	$db_v_t_func_gi_m
(
func_gi_m
, 
func_gi_unm
)

137 (*
func_gi_m

	`__P
((
DB_ENV
 *, *, 
size_t
, *, **));

138 (*
func_gi_unm

	`__P
((
DB_ENV
 *, *));

140 
	`DB_GLOBAL
(
j_gi_m

func_gi_m
;

141 
	`DB_GLOBAL
(
j_gi_unm

func_gi_unm
;

143 
	}
}

150 
	$db_v_t_func_d
(
func_d
)

151 
	$ssize_t
 (*
func_d

	`__P
((, *, 
size_t
, 
off_t
));

153 
	`DB_GLOBAL
(
j_d

func_d
;

155 
	}
}

162 
	$db_v_t_func_pwre
(
func_pwre
)

163 
	$ssize_t
 (*
func_pwre

	`__P
((, cڡ *, 
size_t
, 
off_t
));

165 
	`DB_GLOBAL
(
j_pwre

func_pwre
;

167 
	}
}

173 
	$db_v_t_func_ݒ
(
func_ݒ
)

174 (*
func_ݒ

	`__P
((const *, , ...));

176 
	`DB_GLOBAL
(
j_ݒ

func_ݒ
;

178 
	}
}

184 
	$db_v_t_func_ad
(
func_ad
)

185 
	$ssize_t
 (*
func_ad

	`__P
((, *, 
size_t
));

187 
	`DB_GLOBAL
(
j_ad

func_ad
;

189 
	}
}

195 
	$db_v_t_func_loc
(
func_loc
)

196 *(*
func_loc

	`__P
((*, 
size_t
));

198 
	`DB_GLOBAL
(
j_loc

func_loc
;

200 
	}
}

207 
	$db_v_t_func_me
(
func_me
)

208 (*
func_me

	`__P
((const *, const *));

210 
	`DB_GLOBAL
(
j_me

func_me
;

212 
	}
}

219 
	$db_v_t_func_ek
(
func_ek
)

220 (*
func_ek

	`__P
((, 
off_t
, ));

222 
	`DB_GLOBAL
(
j_ek

func_ek
;

224 
	}
}

230 
	$db_v_t_func_uƚk
(
func_uƚk
)

231 (*
func_uƚk

	`__P
((const *));

233 
	`DB_GLOBAL
(
j_uƚk

func_uƚk
;

235 
	}
}

242 
	$db_v_t_func_wre
(
func_wre
)

243 
	$ssize_t
 (*
func_wre

	`__P
((, cڡ *, 
size_t
));

245 
	`DB_GLOBAL
(
j_wre

func_wre
;

247 
	}
}

253 
	$db_v_t_func_yld
(
func_yld
)

254 (*
func_yld

	`__P
((
u_lg
, u_long));

256 
	`DB_GLOBAL
(
j_yld

func_yld
;

258 
	}
}

	@../common/util_arg.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

13 #i
DB_VERSION_MAJOR
 < 4 || DB_VERSION_MAJOR =4 && 
DB_VERSION_MINOR
 < 5

20 *
rp
();

30 
	$__db_ut_g
(
g0
, 
r
, 
g
, 
gvp
)

31 *
g0
, *
r
, ***
gvp
;

32 *
g
;

34 
n
, 
t
;

35 **

, **
gv
;

37 
	#MAXARGS
 25

	)

38 i((
t
 =

39 
	`__os_mloc
(
NULL
, (
MAXARGS
 + 1* (**), &
gv
)) != 0)

40  (
t
);

42 

 = 
gv
;

43 *

++ = 
g0
;

44 
n
 = 1; (*

 = 
	`rp
(&
r
, " \t")!
NULL
;)

45 i(**

 != '\0') {

46 ++

;

47 i(++
n
 =
MAXARGS
)

50 *

 = 
NULL
;

52 *
g
 = 

 - 
gv
;

53 *
gvp
 = 
gv
;

56 
	}
}

	@../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
, 
	`__os_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 
	}
}

	@../common/zerofill.c

9 
	~"db_cfig.h
"

11 
	~"db_t.h
"

29 
	$__db_zo_fl
(
v
, 
fhp
)

30 
ENV
 *
v
;

31 
DB_FH
 *
fhp
;

33 #ifde
HAVE_FILESYSTEM_NOTZERO


34 
off_t
 
_offt
, 
wre_offt
;

35 
size_t
 
bn
, 
nw
;

36 
u_t32_t
 
bys
, 
mbys
;

37 
group_sync
, 
t
;

38 
u_t8_t
 *
bp
;

41 
wre_offt
 = (
off_t
)
fhp
->
pgno
 * fhp->
pgsize
 + fhp->
offt
;

44 i((
t
 = 
	`__os_iofo
(
v
, 
NULL
, 
fhp
, &
mbys
, &
bys
, NULL)) != 0)

45  (
t
);

46 
_offt
 = (
off_t
)
mbys
 * 
MEGABYTE
 + 
bys
;

49 i(
_offt
 >
wre_offt
)

53 #unde
ZF_LARGE_WRITE


54 
	#ZF_LARGE_WRITE
 (64 * 1024)

	)

55 i((
t
 = 
	`__os_oc
(
v
, 1, 
ZF_LARGE_WRITE
, &
bp
)) != 0)

56  (
t
);

57 
bn
 = 
ZF_LARGE_WRITE
;

60 i((
t
 = 
	`__os_ek
(
v
, 
fhp
, 
mbys
, 
MEGABYTE
, 
bys
)) != 0)

61 
r
;

69 
group_sync
 = 0; 
_offt
 < 
wre_offt
; group_sync = 1) {

70 i(
wre_offt
 - 
_offt
 <(
off_t
)
bn
) {

71 
bn
 = (
size_t
)(
wre_offt
 - 
_offt
);

72 i(
group_sync
 && (
t
 = 
	`__os_fsync
(
v
, 
fhp
)) != 0)

73 
r
;

75 i((
t
 = 
	`__os_physwre
(
v
, 
fhp
, 
bp
, 
bn
, &
nw
)) != 0)

76 
r
;

77 
_offt
 +
bn
;

79 i((
t
 = 
	`__os_fsync
(
v
, 
fhp
)) != 0)

80 
r
;

83 
mbys
 = (
u_t32_t
)(
wre_offt
 / 
MEGABYTE
);

84 
bys
 = (
u_t32_t
)(
wre_offt
 % 
MEGABYTE
);

85 
t
 = 
	`__os_ek
(
v
, 
fhp
, 
mbys
, 
MEGABYTE
, 
bys
);

87 
r
: 
	`__os_
(
v
, 
bp
);

88  (
t
);

90 
	`COMPQUIET
(
v
, 
NULL
);

91 
	`COMPQUIET
(
fhp
, 
NULL
);

94 
	}
}

104 
	$__db_zo_exnd
(
v
, 
fhp
, 
pgno
, 
ϡ_pgno
, 
pgsize
)

105 
ENV
 *
v
;

106 
DB_FH
 *
fhp
;

107 
db_pgno_t
 
pgno
, 
ϡ_pgno
;

108 
u_t32_t
 
pgsize
;

110 
t
;

111 
size_t
 
nwre
;

112 
u_t8_t
 *
buf
;

114 i((
t
 = 
	`__os_oc
(
v
, 1, 
pgsize
, &
buf
)) != 0)

115  (
t
);

116 
	`memt
(
buf
, 0, 
pgsize
);

117 ; 
pgno
 <
ϡ_pgno
;gno++)

118 i((
t
 = 
	`__os_io
(
v
, 
DB_IO_WRITE
,

119 
fhp
, 
pgno
, 
pgsize
, 0,gsize, 
buf
, &
nwre
)) != 0) {

120 i(
t
 == 0) {

121 
t
 = 
EIO
;

122 
r
;

124 
r
;

127 
r
: 
	`__os_
(
v
, 
buf
);

128  (
t
);

129 
	}
}

	@../crypto/aes_method.c

12 
	~"db_cfig.h
"

14 
	~"db_t.h
"

15 
	~"dbc/yo.h
"

16 
	~"dbc/hmac.h
"

18 
__s_r
 
__P
((
ENV
 *, ));

19 
__s_divekeys
 
__P
((
ENV
 *, 
DB_CIPHER
 *, 
u_t8_t
 *, 
size_t
));

28 
	$__s_tup
(
v
, 
db_ch
)

29 
ENV
 *
v
;

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
(
v
, 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
(
v
, 
da
)

70 
ENV
 *
v
;

71 *
da
;

73 
	`__os_
(
v
, 
da
);

75 
	}
}

85 
	$__s_dey
(
v
, 
s_da
, 
iv
, 
ch
, 
ch_n
)

86 
ENV
 *
v
;

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
(
v
, 
t
);

106  (
EAGAIN
);

110 i((
t
 = 
	`__db_blockDey
(&
c
, &
s
->
dey_ki
, 
ch
,

111 
ch_n
 * 8, 
ch
)) < 0) {

112 
	`__s_r
(
v
, 
t
);

113  (
EAGAIN
);

116 
	}
}

126 
	$__s_y
(
v
, 
s_da
, 
iv
, 
da
, 
da_n
)

127 
ENV
 *
v
;

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
(
v
, 
tmp_iv
)) != 0)

153  (
t
);

158 i((
t
 = 
	`__db_chIn
(&
c
, 
MODE_CBC
, (*)
tmp_iv
)) < 0) {

159 
	`__s_r
(
v
, 
t
);

160  (
EAGAIN
);

164 i((
t
 = 
	`__db_blockEny
(&
c
, &
s
->
y_ki
, 
da
, 
da_n
 * 8,

165 
da
)) < 0) {

166 
	`__s_r
(
v
, 
t
);

167  (
EAGAIN
);

169 
	`memy
(
iv
, 
tmp_iv
, 
DB_IV_BYTES
);

171 
	}
}

180 
	$__s_
(
v
, 
db_ch
)

181 
ENV
 *
v
;

182 
DB_CIPHER
 *
db_ch
;

184 
DB_ENV
 *
dbv
;

186 
dbv
 = 
v
->dbenv;

188  (
	`__s_divekeys
(

189 
v
, 
db_ch
, (
u_t8_t
 *)
dbv
->
sswd
, dbv->
sswd_n
));

190 
	}
}

193 
	$__s_divekeys
(
v
, 
db_ch
, 
sswd
, 

)

194 
ENV
 *
v
;

195 
DB_CIPHER
 *
db_ch
;

196 
u_t8_t
 *
sswd
;

197 
size_t
 

;

199 
AES_CIPHER
 *
s
;

200 
SHA1_CTX
 
x
;

201 
t
;

202 
u_t32_t
 
mp
[
DB_MAC_KEY
/4];

204 i(
sswd
 =
NULL
)

205  (
EINVAL
);

207 
s
 = (
AES_CIPHER
 *)
db_ch
->
da
;

210 
	`__db_SHA1In
(&
x
);

211 
	`__db_SHA1Upde
(&
x
, 
sswd
, 

);

212 
	`__db_SHA1Upde
(&
x
, (
u_t8_t
 *)
DB_ENC_MAGIC
, 
	`
(DB_ENC_MAGIC));

213 
	`__db_SHA1Upde
(&
x
, 
sswd
, 

);

214 
	`__db_SHA1F
((
u_t8_t
 *)
mp
, &
x
);

216 i((
t
 = 
	`__db_makeKey
(&
s
->
y_ki
, 
DIR_ENCRYPT
,

217 
DB_AES_KEYLEN
, (*)
mp
)!
TRUE
) {

218 
	`__s_r
(
v
, 
t
);

219  (
EAGAIN
);

221 i((
t
 = 
	`__db_makeKey
(&
s
->
dey_ki
, 
DIR_DECRYPT
,

222 
DB_AES_KEYLEN
, (*)
mp
)!
TRUE
) {

223 
	`__s_r
(
v
, 
t
);

224  (
EAGAIN
);

227 
	}
}

235 
	$__s_r
(
v
, 
r
)

236 
ENV
 *
v
;

237 
r
;

239 *
rr
;

241 
r
) {

242 
BAD_KEY_DIR
:

243 
rr
 = "AES key direction is invalid";

245 
BAD_KEY_MAT
:

246 
rr
 = "AES key materialot of correctength";

248 
BAD_KEY_INSTANCE
:

249 
rr
 = "AES keyasswdot valid";

251 
BAD_CIPHER_MODE
:

252 
rr
 = "AES cipher in wrong state (not initialized)";

254 
BAD_BLOCK_LENGTH
:

255 
rr
 = "AES bad blockength";

257 
BAD_CIPHER_INSTANCE
:

258 
rr
 = "AES cipher instance is invalid";

260 
BAD_DATA
:

261 
rr
 = "AES data contentsre invalid";

263 
BAD_OTHER
:

264 
rr
 = "AES unknownrror";

267 
rr
 = "AESrror unrecognized";

270 
	`__db_rx
(
v
, 
rr
);

272 
	}
}

	@../crypto/crypto.c

12 
	~"db_cfig.h
"

14 
	~"db_t.h
"

15 
	~"dbc/db_ge.h
"

16 
	~"dbc/yo.h
"

23 
	$__yo_gi_
(
v
)

24 
ENV
 *
v
;

26 
CIPHER
 *
ch
;

27 
DB_CIPHER
 *
db_ch
;

28 
DB_ENV
 *
dbv
;

29 
REGENV
 *
nv
;

30 
REGINFO
 *
f
;

31 *
sh_sswd
;

32 
t
;

34 
dbv
 = 
v
->dbenv;

35 
f
 = 
v
->
gfo
;

36 
nv
 = 
f
->
imy
;

37 
db_ch
 = 
v
->
yo_hd
;

38 
t
 = 0;

40 i(
nv
->
ch_off
 =
INVALID_ROFF
) {

41 i(!
	`CRYPTO_ON
(
v
))

43 i(!
	`F_ISSET
(
f
, 
REGION_CREATE
)) {

44 
	`__db_rx
(
v
,

46  (
EINVAL
);

48 i(
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
)) {

49 
	`__db_rx
(
v
, "Encryptionlgorithmot supplied");

50  (
EINVAL
);

57 i((
t
 = 
	`__v_loc
(
f
, (
CIPHER
), &
ch
)) != 0)

58  (
t
);

59 
	`memt
(
ch
, 0, (*cipher));

60 i((
t
 =

61 
	`__v_loc
(
f
, 
dbv
->
sswd_n
, &
sh_sswd
)) != 0) {

62 
	`__v_loc_
(
f
, 
ch
);

63  (
t
);

65 
	`memt
(
sh_sswd
, 0, 
dbv
->
sswd_n
);

66 
ch
->
sswd
 = 
	`R_OFFSET
(
f
, 
sh_sswd
);

67 
ch
->
sswd_n
 = 
dbv
->passwd_len;

68 
ch
->
ags
 = 
db_ch
->
g
;

69 
	`memy
(
sh_sswd
, 
dbv
->
sswd
, 
ch
->
sswd_n
);

70 
nv
->
ch_off
 = 
	`R_OFFSET
(
f
, 
ch
);

72 i(!
	`CRYPTO_ON
(
v
)) {

73 
	`__db_rx
(
v
,

75  (
EINVAL
);

77 
ch
 = 
	`R_ADDR
(
f
, 
nv
->
ch_off
);

78 
sh_sswd
 = 
	`R_ADDR
(
f
, 
ch
->
sswd
);

79 i((
ch
->
sswd_n
 !
dbv
->passwd_len) ||

80 
	`memcmp
(
dbv
->
sswd
, 
sh_sswd
, 
ch
->
sswd_n
) != 0) {

81 
	`__db_rx
(
v
, "Invalidassword");

82  (
EPERM
);

84 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
) &&

85 
db_ch
->
g
 !
ch
->
ags
) {

86 
	`__db_rx
(
v
,

88  (
EINVAL
);

90 i(
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
))

96 i((
t
 = 
	`__yo_gtup
(
v
, 
db_ch
,

97 
ch
->
ags
, 0)) != 0)

98  (
t
);

100 
t
 = 
db_ch
->
	`
(
v
, db_cipher);

107 
	`memt
(
dbv
->
sswd
, 0xff, dbv->
sswd_n
-1);

108 
	`__os_
(
v
, 
dbv
->
sswd
);

109 
dbv
->
sswd
 = 
NULL
;

110 
dbv
->
sswd_n
 = 0;

112  (
t
);

113 
	}
}

122 
	$__yo_v_o
(
v
)

123 
ENV
 *
v
;

125 
DB_CIPHER
 *
db_ch
;

126 
DB_ENV
 *
dbv
;

127 
t
;

129 
dbv
 = 
v
->dbenv;

131 i(
dbv
->
sswd
 !
NULL
) {

132 
	`memt
(
dbv
->
sswd
, 0xff, dbv->
sswd_n
-1);

133 
	`__os_
(
v
, 
dbv
->
sswd
);

134 
dbv
->
sswd
 = 
NULL
;

137 i(!
	`CRYPTO_ON
(
v
))

140 
t
 = 0;

141 
db_ch
 = 
v
->
yo_hd
;

142 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
))

143 
t
 = 
db_ch
->
	`o
(
v
, db_ch->
da
);

144 
	`__os_
(
v
, 
db_ch
);

146 
v
->
yo_hd
 = 
NULL
;

147  (
t
);

148 
	}
}

157 
	$__yo_v_esh
(
v
)

158 
ENV
 *
v
;

160 
CIPHER
 *
ch
;

161 
REGENV
 *
nv
;

162 
REGINFO
 *
f
;

169 i(
	`F_ISSET
(
v
, 
ENV_PRIVATE
)) {

170 
f
 = 
v
->
gfo
;

171 
nv
 = 
f
->
imy
;

172 i(
nv
->
ch_off
 !
INVALID_ROFF
) {

173 
ch
 = 
	`R_ADDR
(
f
, 
nv
->
ch_off
);

174 
	`__v_loc_
(
f
, 
	`R_ADDR
(f, 
ch
->
sswd
));

175 
	`__v_loc_
(
f
, 
ch
);

179 
	}
}

189 
	$__yo_gtup
(
v
, 
db_ch
, 
g
, 
do_
)

190 
ENV
 *
v
;

191 
DB_CIPHER
 *
db_ch
;

192 
u_t32_t
 
g
;

193 
do_
;

195 
t
;

197 
t
 = 0;

198 i(!
	`CRYPTO_ON
(
v
)) {

199 
	`__db_rx
(
v
, "No cipher structure given");

200  (
EINVAL
);

202 
	`F_CLR
(
db_ch
, 
CIPHER_ANY
);

203 
g
) {

204 
CIPHER_AES
:

205 
db_ch
->
g
 = 
CIPHER_AES
;

206 
t
 = 
	`__s_tup
(
v
, 
db_ch
);

209 
t
 = 
	`__v_nic
(
v
, 
EINVAL
);

212 i(
t
 =0 && 
do_
)

213 
t
 = 
db_ch
->
	`
(
v
, db_cipher);

214  (
t
);

215 
	}
}

224 
	$__yo_dey_ma
(
v
, 
dbp
, 
mbuf
, 
do_machk
)

225 
ENV
 *
v
;

226 
DB
 *
dbp
;

227 
u_t8_t
 *
mbuf
;

228 
do_machk
;

230 
DB
 
dummydb
;

231 
DBMETA
 *
ma
;

232 
DB_CIPHER
 *
db_ch
;

233 
size_t
 
pg_off
;

234 
t
;

235 
u_t8_t
 *
iv
;

243 i(
dbp
 =
NULL
) {

244 
	`memt
(&
dummydb
, 0, (
DB
));

245 
dbp
 = &
dummydb
;

248 
t
 = 0;

249 
ma
 = (
DBMETA
 *)
mbuf
;

267 i(
ma
->
magic
 =
DB_HASHMAGIC
 && ma->
vsi
 <= 5)

285 i(
ma
->
y_g
 != 0) {

286 
db_ch
 = 
v
->
yo_hd
;

287 i(!
	`F_ISSET
(
dbp
, 
DB_AM_ENCRYPT
)) {

288 i(!
	`CRYPTO_ON
(
v
)) {

289 
	`__db_rx
(
v
,

291  (
EINVAL
);

299 
	`F_SET
(
dbp
, 
DB_AM_ENCRYPT
|
DB_AM_CHKSUM
);

305 
	`DB_ASSERT
(
v
, 
	`CRYPTO_ON
(env));

306 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
) &&

307 
ma
->
y_g
 !
db_ch
->
g
) {

308 
	`__db_rx
(
v
,

310  (
EINVAL
);

312 
	`DB_ASSERT
(
v
, 
	`F_ISSET
(
dbp
, 
DB_AM_CHKSUM
));

313 
iv
 = ((
BTMETA
 *)
mbuf
)->iv;

319 
pg_off
 = 
	`P_OVERHEAD
(
dbp
);

320 
g_y
:

325 i(!
	`F_ISSET
(
db_ch
, 
CIPHER_ANY
)) {

326 i(
do_machk
 && (
t
 = 
db_ch
->
	`dey
(
v
,

327 
db_ch
->
da
, 
iv
, 
mbuf
 + 
pg_off
,

328 
DBMETASIZE
 - 
pg_off
)))

329  (
t
);

330 i(((
BTMETA
 *)
ma
)->
yo_magic
 !=

331 
ma
->
magic
) {

332 
	`__db_rx
(
v
, "Invalidassword");

333  (
EINVAL
);

347 
t
 = 
	`__yo_gtup
(
v
, 
db_ch
, 
ma
->
y_g
, 1);

348 
g_y
;

349 } i(
	`F_ISSET
(
dbp
, 
DB_AM_ENCRYPT
)) {

370 
	`__db_rx
(
v
,

372  (
EINVAL
);

374  (
t
);

375 
	}
}

385 
	$__yo_t_sswd
(
v_c
, 
v_de
)

386 
ENV
 *
v_c
, *
v_de
;

388 
CIPHER
 *
ch
;

389 
REGENV
 *
nv
;

390 
REGINFO
 *
f
;

391 *
sh_sswd
;

393 
f
 = 
v_c
->
gfo
;

394 
nv
 = 
f
->
imy
;

396 
	`DB_ASSERT
(
v_c
, 
	`CRYPTO_ON
(env_src));

398 
ch
 = 
	`R_ADDR
(
f
, 
nv
->
ch_off
);

399 
sh_sswd
 = 
	`R_ADDR
(
f
, 
ch
->
sswd
);

400  (
	`__v_t_y
(
v_de
->
dbv
, 
sh_sswd
, 
DB_ENCRYPT_AES
));

401 
	}
}

	@../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
((
ENV
 *));

64 
	$__db_ge_iv
(
v
, 
iv
)

65 
ENV
 *
v
;

66 
u_t32_t
 *
iv
;

68 
i
, 
n
, 
t
;

70 
t
 = 0;

71 
n
 = 
DB_IV_BYTES
 / (
u_t32_t
);

72 
	`MUTEX_LOCK
(
v
,nv->
mtx_mt
);

73 i(
v
->
mt
 =
NULL
) {

74 i((
t
 = 
	`__os_oc
(
v
, 1, 
N
*(),

75 &
v
->
mt
)) != 0)

76  (
t
);

78 
v
->
mti
 = 
N
 + 1;

80 
i
 = 0; i < 
n
; i++) {

85 
iv
[
i
] = (
u_t32_t
)
	`__db_gnd
(
v
);

86 } 
iv
[
i
] == 0);

89 
	`MUTEX_UNLOCK
(
v
,nv->
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
(
v
)

139 
ENV
 *
v
;

141 
db_timeec
 
ts
;

142 
y
;

143 
mag01
[2]={0x0, 
MATRIX_A
};

145 
u_t32_t
 
ed
;

150 i(
v
->
mti
 >
N
) {

151 
kk
;

153 i(
v
->
mti
 =
N
+1) {

159 
	`__os_gtime
(
v
, &
ts
, 1);

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
, 
v
->
mt
, &v->
mti
);

166 
kk
=0;kk<
N
-
M
;kk++) {

167 
y
 = (
v
->
mt
[
kk
]&
UPPER_MASK
)|nv->mt[kk+1]&
LOWER_MASK
);

168 
v
->
mt
[
kk
] =nv->mt[kk+
M
] ^ (
y
 >> 1^ 
mag01
[y & 0x1];

170 ;
kk
<
N
-1;kk++) {

171 
y
 = (
v
->
mt
[
kk
]&
UPPER_MASK
)|nv->mt[kk+1]&
LOWER_MASK
);

172 
v
->
mt
[
kk
] =nv->mt[kk+(
M
-
N
)] ^ (
y
 >> 1^ 
mag01
[y & 0x1];

174 
y
 = (
v
->
mt
[
N
-1]&
UPPER_MASK
)|nv->mt[0]&
LOWER_MASK
);

175 
v
->
mt
[
N
-1] =nv->mt[
M
-1] ^ (
y
 >> 1^ 
mag01
[y & 0x1];

177 
v
->
mti
 = 0;

180 
y
 = 
v
->
mt
[v->
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
(
dbv_
, "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
(
dbv_
, "Db::" #_me, 
EINVAL
, 
	`r_picy
()); \

49  (
EINVAL
); \

51 
t
 = 
db
->
_me
 
_gli
; \

52 
	`nup
(); \

53 i(!
	`_tok
(
t
)) \

54 
	`DB_ERROR
(
dbv_
, "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
 *
dbv
, 
u_t32_t
 
ags
)

87 : 
	`imp_
(0)

88 , 
	`dbv_
(
dbv
)

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(
dbv_
 == 0)

103 
ags_
 |
DB_CXX_PRIVATE_ENV
;

105 i((
cڡru_r_
 = 
	`lize
()) != 0)

106 
	`DB_ERROR
(
dbv_
, "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
(
dbv_
);

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 
dbv_
 = 
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 
dbv_
->
	`nup
();

181 
de
 
dbv_
;

182 
dbv_
 = 0;

185 
de
 
mpf_
;

187 
	}
}

195 
	gDb
::
	$r_picy
()

197 i(
dbv_
 !
NULL
)

198  (
dbv_
->
	`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
(
dbv_
, "Db::g", 
vue
, 
	`r_picy
());

258 
	`DB_ERROR
(
dbv_
, "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
(
dbv_
, "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
(
dbv_
, "Db::pg", 
vue
, 
	`r_picy
());

336 
	`DB_ERROR
(
dbv_
, "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
->
v
, 
cxxthis
 !
NULL
); \

411 
	`DB_ASSERT
(
his
->
dbv
->
v
, 
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
(
dbv_
, "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 
dbv_
->
	`t_r
(
g
);

621 
	}
}

623 
Db
::
t_msg
((*
g
)(cڡ 
DbEnv
 *, const *))

625 
dbv_
->
	`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  (
dbv_
->
	`t_nic
(
back
));

646 
	}
}

648 
__DB_STD
(
oam
*
Db
::
	$g_r_am
()

650  
dbv_
->
	`g_r_am
();

651 
	}
}

653 
Db
::
t_r_am
(
__DB_STD
(
oam
*
r_am
)

655 
dbv_
->
t_r_am
(
r_am
);

658 
__DB_STD
(
oam
*
Db
::
	$g_mesge_am
()

660  
dbv_
->
	`g_mesge_am
();

661 
	}
}

663 
Db
::
t_mesge_am
(
__DB_STD
(
oam
*
mesge_am
)

665 
dbv_
->
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
->
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
->
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
->
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
->
dbv
),

85 "Dbc::g", 
da
, 
ON_ERROR_UNKNOWN
);

87 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbc
->
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
->
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
->
dbv
),

108 "Dbc::pg", 
da
, 
ON_ERROR_UNKNOWN
);

110 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbc
->
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
 *
dbv
, 
code
, 
p
)

83 
DbEnv
::
	`_edback_r
(
dbv
, 
code
, 
p
);

84 
	}
}

87 
	$_nic_r_c
(
DB_ENV
 *
dbv
, 
rv
)

89 
DbEnv
::
	`_nic_r
(
dbv
, 
rv
);

90 
	}
}

93 
	$_evt_func_r_c
(
DB_ENV
 *
dbv
, 
u_t32_t
 
evt
, *
evt_fo
)

95 
DbEnv
::
	`_evt_func_r
(
dbv
, 
evt
, 
evt_fo
);

96 
	}
}

99 
	$_am_r_funi_c
(cڡ 
DB_ENV
 *
dbv
,

100 cڡ *
efix
, cڡ *
mesge
)

102 
DbEnv
::
	`_am_r_funi
(
dbv
, 
efix
, 
mesge
);

103 
	}
}

106 
	$_am_mesge_funi_c
(cڡ 
DB_ENV
 *
dbv
, cڡ *
mesge
)

108 
DbEnv
::
	`_am_mesge_funi
(
dbv
, 
mesge
);

109 
	}
}

112 
	$_p_dich_r_c
(
DB_ENV
 *
dbv
, 
DBT
 *
dbt
, 
DB_LSN
 *
l
, 
db_cs
 

)

114  (
DbEnv
::
	`_p_dich_r
(
dbv
, 
dbt
, 
l
, 

));

115 
	}
}

118 
	$_p_nd_r_c
(
DB_ENV
 *
dbv
, cڡ 
DBT
 *
l
, cڡ DBT *
da
,

119 cڡ 
DB_LSN
 *
l
, 
id
, 
u_t32_t
 
ags
)

121  (
DbEnv
::
	`_p_nd_r
(
dbv
,

122 
l
, 
da
, 
l
, 
id
, 
ags
));

123 
	}
}

126 
	$_ilive_r_c
(

127 
DB_ENV
 *
dbv
, 
pid_t
 
pid
, 
db_thadid_t
 
thrid
, 
u_t32_t
 
ags
)

129  (
DbEnv
::
	`_ilive_r
(
dbv
, 
pid
, 
thrid
, 
ags
));

130 
	}
}

133 
	$_thad_id_r_c
(
DB_ENV
 *
dbv
, 
pid_t
 *
pidp
, 
db_thadid_t
 *
thridp
)

135 
DbEnv
::
	`_thad_id_r
(
dbv
, 
pidp
, 
thridp
);

136 
	}
}

139 *
	$_thad_id_rg_r_c
(
DB_ENV
 *
dbv
, 
pid_t
 
pid
,

140 
db_thadid_t
 
thrid
, *
buf
)

142  (
DbEnv
::
	`_thad_id_rg_r
(
dbv
, 
pid
, 
thrid
, 
buf
));

143 
	}
}

145 
DbEnv
::
	$_edback_r
(
DB_ENV
 *
dbv
, 
code
, 
p
)

147 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

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
(
dbv
),

155 "DbEnv::edback_back", 
EINVAL
, 
cxxv
->
	`r_picy
());

158 (*
cxxv
->
edback_back_
)(cxxv, 
code
, 
p
);

159 
	}
}

161 
DbEnv
::
	$_nic_r
(
DB_ENV
 *
dbv
, 
rv
)

163 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

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
 *
dbv
, 
u_t32_t
 
evt
, *
evt_fo
)

180 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

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
 *
dbv
, 
DBT
 *
dbt
, 
DB_LSN
 *
l
,

195 
db_cs
 

)

197 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

198 i(
cxxv
 == 0) {

199 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbv
),

200 "DbEnv::p_dich_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

201  (
EINVAL
);

203 i(
cxxv
->
p_dich_back_
 == 0) {

204 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbv
),

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
 *
dbv
, 
pid_t
 
pid
, 
db_thadid_t
 
thrid
, 
u_t32_t
 
ags
)

217 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

218 i(
cxxv
 == 0) {

219 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbv
),

220 "DbEnv::ilive_back", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

223  ((*
cxxv
->
ilive_back_
)(cxxv, 
pid
, 
thrid
, 
ags
));

224 
	}
}

226 
DbEnv
::
	$_p_nd_r
(
DB_ENV
 *
dbv
, cڡ 
DBT
 *
l
, cڡ DBT *
da
,

227 cڡ 
DB_LSN
 *
l
, 
id
, 
u_t32_t
 
ags
)

229 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

230 i(
cxxv
 == 0) {

231 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbv
),

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
 *
dbv
,

243 
pid_t
 *
pidp
, 
db_thadid_t
 *
thridp
)

245 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

246 i(
cxxv
 == 0) {

247 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbv
),

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
 *
dbv
,

254 
pid_t
 
pid
, 
db_thadid_t
 
thrid
, *
buf
)

256 
DbEnv
 *
cxxv
 = DbEnv::
	`g_DbEnv
(
dbv
);

257 i(
cxxv
 == 0) {

258 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
dbv
),

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
 *
dbv
, 
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
(
dbv
)) != 0)

308 
	`DB_ERROR
(
this
, "DbEnv::DbEnv", 
cڡru_r_
,

309 
	`r_picy
());

310 
	}
}

319 
DbEnv
::~
	$DbEnv
()

321 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

323 i(
dbv
 !
NULL
) {

324 ()
dbv
->
	`o
(dbenv, 0);

325 
	`nup
();

327 
	}
}

330 
DbEnv
::
	$nup
()

332 
imp_
 = 0;

333 
	}
}

335 
DbEnv
::
	$o
(
u_t32_t
 
ags
)

337 
t
;

338 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

340 
t
 = 
dbv
->
	`o
(dbv, 
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
 *
dbv
 = 
	`unwp
(
this
);

367 
	`DB_REAL_ERR
(
dbv
, 
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
 *
dbv
 = 
	`unwp
(
this
);

390 
	`DB_REAL_ERR
(
dbv
, 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
 *
dbv
)

419 
t
;

421 
ϡ_known_r_picy
 = 
	`r_picy
();

423 i(
dbv
 == 0) {

425 i((
t
 = ::
	`db_v_
(&
dbv
,

426 
cڡru_ags_
 & ~
DB_CXX_NO_EXCEPTIONS
)) != 0)

427  (
t
);

429 
imp_
 = 
dbv
;

430 
dbv
->
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_g_cfig
, (
u_t32_t
 
which
, *
of
),

474 (
dbv
, 
which
, 
of
))

475 
DBENV_METHOD
(
log_put
, (
DbL
 *
l
, cڡ 
Dbt
 *
da
, 
u_t32_t
 
ags
),

476 (
dbv
, 
l
, 
da
, 
ags
))

478 
DbEnv
::
	$log_tf
(
DbTxn
 *
txn
, cڡ *
fmt
, ...)

480 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

481 
va_li
 

;

482 
t
;

484 
	`va_t
(

, 
fmt
);

485 
t
 = 
	`__log_tf_
(
dbv
, 
	`unwp
(
txn
), 
fmt
, 

);

486 
	`va_d
(

);

488  (
t
);

489 
	}
}

491 
DBENV_METHOD
(
log_t_cfig
, (
u_t32_t
 
which
, 
off
),

492 (
dbv
, 
which
, 
off
))

493 
DBENV_METHOD
(
log_
, (
DB_LOG_STAT
 **
p
, 
u_t32_t
 
ags
),

494 (
dbv
, 
p
, 
ags
))

495 
DBENV_METHOD
(
log__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

497 
DBENV_METHOD
(
l_t
, (cڡ *
fe
, 
u_t32_t
 
ags
),

498 (
dbv
, 
fe
, 
ags
))

500 
DbEnv
::
	$memp_f
(
DbMpoFe
 **
dbm
, 
u_t32_t
 
ags
)

502 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

503 
t
;

504 
DB_MPOOLFILE
 *
mpf
;

506 i(
dbv
 =
NULL
)

507 
t
 = 
EINVAL
;

509 
t
 = 
dbv
->
	`memp_f
(dbv, &
mpf
, 
ags
);

511 i(
	`DB_RETOK_STD
(
t
)) {

512 *
dbm
 = 
w
 
	`DbMpoFe
();

513 (*
dbm
)->
imp_
 = 
mpf
;

515 
	`DB_ERROR
(
this
, "DbMpoFe::f_", 
t
, 
ON_ERROR_UNKNOWN
);

517  (
t
);

518 
	}
}

520 
DBENV_METHOD
(
memp_gi
,

521 (
y
, 
pg_f_ty
 
pg_f
, 
pgout_f_ty
 
pgout_f
),

522 (
dbv
, 
y
, 
pg_f
, 
pgout_f
))

525 
DBENV_METHOD
(
memp_
,

526 (
DB_MPOOL_STAT
 **
g
, 
DB_MPOOL_FSTAT
 ***
f
, 
u_t32_t
 
ags
),

527 (
dbv
, 
g
, 
f
, 
ags
))

528 
DBENV_METHOD
(
memp__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

529 
DBENV_METHOD
(
memp_sync
, (
DbL
 *

), (
dbv
, sn))

530 
DBENV_METHOD
(
memp_ick
, (
p
, *
nwrٕ
), (
dbv
,ct,wrotep))

535 
DbEnv
::
	$ݒ
(cڡ *
db_home
, 
u_t32_t
 
ags
, 
mode
)

537 
t
;

538 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

540 i(
cڡru_r_
 != 0)

541 
t
 = 
cڡru_r_
;

543 
t
 = 
dbv
->
	`ݒ
(dbv, 
db_home
, 
ags
, 
mode
);

545 i(!
	`DB_RETOK_STD
(
t
))

546 
	`DB_ERROR
(
this
, "DbEnv::ݒ", 
t
, 
	`r_picy
());

548  (
t
);

549 
	}
}

551 
DbEnv
::
	$move
(cڡ *
db_home
, 
u_t32_t
 
ags
)

553 
t
;

554 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

556 
t
 = 
dbv
->
	`move
(dbv, 
db_home
, 
ags
);

562 
	`nup
();

564 i(
t
 != 0)

565 
	`DB_ERROR
(
this
, "DbEnv::move", 
t
, 
	`r_picy
());

567  (
t
);

568 
	}
}

576 
DbEnv
::
	$ruime_r
(
DbEnv
 *
dbv
,

577 cڡ *
Δ
, 
r
, 
r_picy
)

579 i(
r_picy
 =
ON_ERROR_UNKNOWN
)

580 
r_picy
 = 
ϡ_known_r_picy
;

581 i(
r_picy
 =
ON_ERROR_THROW
) {

584 
r
) {

585 
DB_LOCK_DEADLOCK
:

587 
DbDdlockExi
 
	`dl_ex
(
Δ
);

588 
dl_ex
.
	`t_v
(
dbv
);

589 
throw
 
dl_ex
;

591 
DB_LOCK_NOTGRANTED
:

593 
DbLockNGedExi
 
	`g_ex
(
Δ
);

594 
g_ex
.
	`t_v
(
dbv
);

595 
throw
 
g_ex
;

597 
DB_REP_HANDLE_DEAD
:

599 
DbRHdDdExi
 
	`hd_ex
(
Δ
);

600 
hd_ex
.
	`t_v
(
dbv
);

601 
throw
 
hd_ex
;

603 
DB_RUNRECOVERY
:

605 
DbRunRecovyExi
 
	`_ex
(
Δ
);

606 
_ex
.
	`t_v
(
dbv
);

607 
throw
 
_ex
;

611 
DbExi
 
	`ex
(
Δ
, 
r
);

612 
ex
.
	`t_v
(
dbv
);

613 
throw
 
ex
;

617 
	}
}

621 
DbEnv
::
	$ruime_r_dbt
(
DbEnv
 *
dbv
,

622 cڡ *
Δ
, 
Dbt
 *
dbt
, 
r_picy
)

624 i(
r_picy
 =
ON_ERROR_UNKNOWN
)

625 
r_picy
 = 
ϡ_known_r_picy
;

626 i(
r_picy
 =
ON_ERROR_THROW
) {

629 
DbMemyExi
 
	`ex
(
Δ
, 
dbt
);

630 
ex
.
	`t_v
(
dbv
);

631 
throw
 
ex
;

633 
	}
}

638 
DbEnv
::
	$ruime_r_lock_g
(
DbEnv
 *
dbv
,

639 cڡ *
Δ
, 
r
,

640 
db_lock_t
 

, 
db_lockmode_t
 
mode
, cڡ 
Dbt
 *
obj
,

641 
DbLock
 
lock
, 
dex
, 
r_picy
)

643 i(
r
 !
DB_LOCK_NOTGRANTED
) {

644 
	`ruime_r
(
dbv
, 
Δ
, 
r
, 
r_picy
);

648 i(
r_picy
 =
ON_ERROR_UNKNOWN
)

649 
r_picy
 = 
ϡ_known_r_picy
;

650 i(
r_picy
 =
ON_ERROR_THROW
) {

653 
DbLockNGedExi
 
	`ex
(
Δ
, 

, 
mode
,

654 
obj
, 
lock
, 
dex
);

655 
ex
.
	`t_v
(
dbv
);

656 
throw
 
ex
;

658 
	}
}

660 
DbEnv
::
	$_am_r_funi
(

661 cڡ 
DB_ENV
 *
dbv
, cڡ *
efix
, cڡ *
mesge
)

663 cڡ 
DbEnv
 *
cxxv
 = DbEnv::
	`g_cڡ_DbEnv
(
dbv
);

664 i(
cxxv
 == 0) {

665 
	`DB_ERROR
(0,

666 "DbEnv::am_r", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

670 i(
cxxv
->
r_back_
)

671 
cxxv
->
	`r_back_
(cxxv, 
efix
, 
mesge
);

672 i(
cxxv
->
r_am_
) {

674 i(
efix
) {

675 (*
cxxv
->
r_am_
<< 
efix
;

676 (*
cxxv
->
r_am_
) << (const *)": ";

678 i(
mesge
)

679 (*
cxxv
->
r_am_
<< (cڡ *)
mesge
;

680 (*
cxxv
->
r_am_
) << (const *)"\n";

682 
	}
}

684 
DbEnv
::
	$_am_mesge_funi
(cڡ 
DB_ENV
 *
dbv
, cڡ *
mesge
)

686 cڡ 
DbEnv
 *
cxxv
 = DbEnv::
	`g_cڡ_DbEnv
(
dbv
);

687 i(
cxxv
 == 0) {

688 
	`DB_ERROR
(0,

689 "DbEnv::am_mesge", 
EINVAL
, 
ON_ERROR_UNKNOWN
);

693 i(
cxxv
->
mesge_back_
)

694 
cxxv
->
	`mesge_back_
(cxxv, 
mesge
);

695 i(
cxxv
->
mesge_am_
) {

697 (*
cxxv
->
mesge_am_
<< (cڡ *)
mesge
;

698 (*
cxxv
->
mesge_am_
) << (const *)"\n";

700 
	}
}

703 *
DbEnv
::
	$
(
r
)

705  (
	`db_
(
r
));

706 
	}
}

711 
DBENV_METHOD
(
t_da_d
, (cڡ *
d
), (
dbv
, dir))

712 
DBENV_METHOD
(
g_y_ags
, (
u_t32_t
 *
ag
),

713 (
dbv
, 
ag
))

714 
DBENV_METHOD
(
t_y
, (cڡ *
sswd
, 
u_t32_t
 
ags
),

715 (
dbv
, 
sswd
, 
ags
))

716 
DBENV_METHOD_VOID
(
g_rfe
, (
FILE
 **
rf
), (
dbv
,rrfilep))

717 
DBENV_METHOD_VOID
(
t_rfe
, (
FILE
 *
rfe
), (
dbv
,rrfile))

718 
DBENV_METHOD_VOID
(
g_fx
, (cڡ **
fxp
), (
dbv
,rrpfxp))

719 
DBENV_METHOD_VOID
(
t_fx
, (cڡ *
fx
), (
dbv
,rrpfx))

720 
DBENV_METHOD
(
g_rmed_d_mode
, (cڡ **
mod
), (
dbv
, modep))

721 
DBENV_METHOD
(
t_rmed_d_mode
, (cڡ *
mode
), (
dbv
, mode))

722 
DBENV_METHOD
(
g_lg_bsize
, (
u_t32_t
 *
bsiz
), (
dbv
, bsizep))

723 
DBENV_METHOD
(
t_lg_bsize
, (
u_t32_t
 
bsize
), (
dbv
, bsize))

724 
DBENV_METHOD
(
g_lg_d
, (cڡ **
dp
), (
dbv
, dirp))

725 
DBENV_METHOD
(
t_lg_d
, (cڡ *
d
), (
dbv
, dir))

726 
DBENV_METHOD
(
g_lg_femode
, (*
mod
), (
dbv
, modep))

727 
DBENV_METHOD
(
t_lg_femode
, (
mode
), (
dbv
, mode))

728 
DBENV_METHOD
(
g_lg_max
, (
u_t32_t
 *
maxp
), (
dbv
, maxp))

729 
DBENV_METHOD
(
t_lg_max
, (
u_t32_t
 
max
), (
dbv
, max))

730 
DBENV_METHOD
(
g_lg_gimax
, (
u_t32_t
 *
gimaxp
), (
dbv
,egionmaxp))

731 
DBENV_METHOD
(
t_lg_gimax
, (
u_t32_t
 
gimax
), (
dbv
,egionmax))

732 
DBENV_METHOD
(
g_lk_cis
, (cڡ 
u_t8_t
 **
lk_ci
, *
lk_maxp
),

733 (
dbv
, 
lk_ci
, 
lk_maxp
))

734 
DBENV_METHOD
(
t_lk_cis
, (
u_t8_t
 *
lk_cis
, 
lk_max
),

735 (
dbv
, 
lk_cis
, 
lk_max
))

736 
DBENV_METHOD
(
g_lk_de
, (
u_t32_t
 *
dep
), (
dbv
, detectp))

737 
DBENV_METHOD
(
t_lk_de
, (
u_t32_t
 
de
), (
dbv
, detect))

738 
DBENV_METHOD
(
g_lk_max_locks
, (
u_t32_t
 *
max_lock
),

739 (
dbv
, 
max_lock
))

740 
DBENV_METHOD
(
t_lk_max_locks
, (
u_t32_t
 
max_locks
), (
dbv
, max_lockers))

741 
DBENV_METHOD
(
g_lk_max_locks
, (
u_t32_t
 *
max_lock
), (
dbv
, max_locksp))

742 
DBENV_METHOD
(
t_lk_max_locks
, (
u_t32_t
 
max_locks
), (
dbv
, max_locks))

743 
DBENV_METHOD
(
g_lk_max_objes
, (
u_t32_t
 *
max_obje
),

744 (
dbv
, 
max_obje
))

745 
DBENV_METHOD
(
t_lk_max_objes
, (
u_t32_t
 
max_objes
), (
dbv
, max_objects))

746 
DBENV_METHOD
(
g_mp_max_ݒfd
, (*
maxݒfdp
), (
dbv
, maxopenfdp))

747 
DBENV_METHOD
(
t_mp_max_ݒfd
, (
maxݒfd
), (
dbv
, maxopenfd))

748 
DBENV_METHOD
(
g_mp_max_wre
, (*
maxwr
, 
db_timeout_t
 *
maxwre_
),

749 (
dbv
, 
maxwr
, 
maxwre_
))

750 
DBENV_METHOD
(
t_mp_max_wre
, (
maxwre
, 
db_timeout_t
 
maxwre_p
),

751 (
dbv
, 
maxwre
, 
maxwre_p
))

752 
DBENV_METHOD
(
g_mp_mmsize
, (
size_t
 *
mmsiz
), (
dbv
, mmapsizep))

753 
DBENV_METHOD
(
t_mp_mmsize
, (
size_t
 
mmsize
), (
dbv
, mmapsize))

754 
DBENV_METHOD_VOID
(
g_msgfe
, (
FILE
 **
msgf
), (
dbv
, msgfilep))

755 
DBENV_METHOD_VOID
(
t_msgfe
, (
FILE
 *
msgfe
), (
dbv
, msgfile))

756 
DBENV_METHOD
(
g_tmp_d
, (cڡ **
tmp_dp
), (
dbv
,mp_dirp))

757 
DBENV_METHOD
(
t_tmp_d
, (cڡ *
tmp_d
), (
dbv
,mp_dir))

758 
DBENV_METHOD
(
g_tx_max
, (
u_t32_t
 *
tx_maxp
), (
dbv
,x_maxp))

759 
DBENV_METHOD
(
t_tx_max
, (
u_t32_t
 
tx_max
), (
dbv
,x_max))

761 
DBENV_METHOD
(
_t
, (
u_t32_t
 
ags
), (
dbv
, flags))

763 
DBENV_METHOD_QUIET
(
t_loc
,

764 (
db_mloc_f_ty
 
mloc_f
, 
db_loc_f_ty
 
loc_f
,

765 
db__f_ty
 
_f
),

766 (
dbv
, 
mloc_f
, 
loc_f
, 
_f
))

768 
DbEnv
::
	$t_p_ive
(*
vue
)

770 
	`unwp
(
this
)->
p_ive
 = 
vue
;

771 
	}
}

773 
DBENV_METHOD
(
g_chesize
,

774 (
u_t32_t
 *
gby
, u_t32_*
by
, *
nch
),

775 (
dbv
, 
gby
, 
by
, 
nch
))

776 
DBENV_METHOD
(
t_chesize
,

777 (
u_t32_t
 
gbys
, u_t32_
bys
, 
nche
),

778 (
dbv
, 
gbys
, 
bys
, 
nche
))

779 
DBENV_METHOD
(
g_che_max
, (
u_t32_t
 *
gby
, u_t32_*
by
),

780 (
dbv
, 
gby
, 
by
))

781 
DBENV_METHOD
(
t_che_max
, (
u_t32_t
 
gbys
, u_t32_
bys
),

782 (
dbv
, 
gbys
, 
bys
))

784 
DbEnv
::
t_r
((*
g
)(const DbEnv *, const *, const *))

786 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

788 
r_back_
 = 
g
;

789 
r_am_
 = 0;

791 
dbv
->
	`t_r
(dbv, (
g
 == 0) ? 0 :

792 
_am_r_funi_c
);

793 
	}
}

795 
__DB_STD
(
oam
*
DbEnv
::
	$g_r_am
()

797  (
r_am_
);

798 
	}
}

800 
DbEnv
::
t_r_am
(
__DB_STD
(
oam
*
am
)

802 
DB_ENV
 *
dbv
 = 
unwp
(
this
);

804 
r_am_
 = 
am
;

805 
r_back_
 = 0;

807 
dbv
->
t_r
(dbv, (
am
 == 0) ? 0 :

808 
_am_r_funi_c
);

811 
DbEnv
::
t_edback
((*
g
)(DbEnv *, , ))

813 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

815 
edback_back_
 = 
g
;

817  (
dbv
->
	`t_edback
(dbenv,

818 
g
 =0 ? 0 : 
_edback_r_c
));

819 
	}
}

821 
DBENV_METHOD
(
g_ags
, (
u_t32_t
 *
ag
), (
dbv
, flagsp))

822 
DBENV_METHOD
(
t_ags
, (
u_t32_t
 
ags
, 
off
), (
dbv
, flags, onoff))

824 
DbEnv
::
t_msg
((*
g
)(const DbEnv *, const *))

826 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

828 
mesge_back_
 = 
g
;

829 
mesge_am_
 = 0;

831 
dbv
->
	`t_msg
(dbv, (
g
 == 0) ? 0 :

832 
_am_mesge_funi_c
);

833 
	}
}

835 
__DB_STD
(
oam
*
DbEnv
::
	$g_mesge_am
()

837  (
mesge_am_
);

838 
	}
}

840 
DbEnv
::
t_mesge_am
(
__DB_STD
(
oam
*
am
)

842 
DB_ENV
 *
dbv
 = 
unwp
(
this
);

844 
mesge_am_
 = 
am
;

845 
mesge_back_
 = 0;

847 
dbv
->
t_msg
(dbv, (
am
 == 0) ? 0 :

848 
_am_mesge_funi_c
);

851 
DbEnv
::
t_nic
((*
g
)(DbEnv *, ))

853 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

855 
nic_back_
 = 
g
;

857  (
dbv
->
	`t_nic
(dbenv,

858 
g
 =0 ? 0 : 
_nic_r_c
));

859 
	}
}

861 
DbEnv
::
t_evt_nify
((*
g
)(DbEnv *, 
u_t32_t
, *))

863 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

865 
evt_func_back_
 = 
g
;

867  (
dbv
->
	`t_evt_nify
(dbenv,

868 
g
 =0 ? 0 : 
_evt_func_r_c
));

869 
	}
}

871 
DBENV_METHOD
(
t_c_rv
,

872 (*

, *
ho
, 
tc
, 
sc
, 
u_t32_t
 
ags
),

873 (
dbv
, 

, 
ho
, 
tc
, 
sc
, 
ags
))

874 
DBENV_METHOD
(
g_shm_key
, (*
shm_keyp
), (
dbv
, shm_keyp))

875 
DBENV_METHOD
(
t_shm_key
, (
shm_key
), (
dbv
, shm_key))

877 
DbEnv
::
t_p_dich


878 ((*
g
)(
DbEnv
 *, 
Dbt
 *, 
DbL
 *, 
db_cs
))

880 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

881 
t
;

883 
p_dich_back_
 = 
g
;

884 i((
t
 = 
dbv
->
	`t_p_dich
(dbenv,

885 
g
 =0 ? 0 : 
_p_dich_r_c
)) != 0)

886 
	`DB_ERROR
(
this
, "DbEnv::t_p_dich", 
t
, 
	`r_picy
());

888  (
t
);

889 
	}
}

891 
DbEnv
::
t_ilive


892 ((*
g
)(
DbEnv
 *, 
pid_t
, 
db_thadid_t
, 
u_t32_t
))

894 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

895 
t
;

897 
ilive_back_
 = 
g
;

898 i((
t
 = 
dbv
->
	`t_ilive
(dbenv,

899 
g
 =0 ? 0 : 
_ilive_r_c
)) != 0)

900 
	`DB_ERROR
(
this
, "DbEnv::t_ilive", 
t
, 
	`r_picy
());

902  (
t
);

903 
	}
}

905 
DBENV_METHOD
(
g_tx_timeamp
, (
time_t
 *
timeamp
), (
dbv
,imestamp))

906 
DBENV_METHOD
(
t_tx_timeamp
, (
time_t
 *
timeamp
), (
dbv
,imestamp))

907 
DBENV_METHOD
(
g_vbo
, (
u_t32_t
 
which
, *
of
),

908 (
dbv
, 
which
, 
of
))

909 
DBENV_METHOD
(
t_vbo
, (
u_t32_t
 
which
, 
off
), (
dbv
, which, onoff))

911 
DBENV_METHOD
(
mux_loc
,

912 (
u_t32_t
 
ags
, 
db_mux_t
 *
muxp
), (
dbv
, flags, mutexp))

913 
DBENV_METHOD
(
mux_
, (
db_mux_t
 
mux
), (
dbv
, mutex))

914 
DBENV_METHOD
(
mux_g_ign
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

915 
DBENV_METHOD
(
mux_g_emt
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

916 
DBENV_METHOD
(
mux_g_max
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

917 
DBENV_METHOD
(
mux_g_s_s
, (
u_t32_t
 *
gp
), (
dbv
,rgp))

918 
DBENV_METHOD
(
mux_lock
, (
db_mux_t
 
mux
), (
dbv
, mutex))

919 
DBENV_METHOD
(
mux_t_ign
, (
u_t32_t
 
g
), (
dbv
,rg))

920 
DBENV_METHOD
(
mux_t_emt
, (
u_t32_t
 
g
), (
dbv
,rg))

921 
DBENV_METHOD
(
mux_t_max
, (
u_t32_t
 
g
), (
dbv
,rg))

922 
DBENV_METHOD
(
mux_t_s_s
, (
u_t32_t
 
g
), (
dbv
,rg))

923 
DBENV_METHOD
(
mux_
,

924 (
DB_MUTEX_STAT
 **
p
, 
u_t32_t
 
ags
), (
dbv
, statp, flags))

925 
DBENV_METHOD
(
mux__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

926 
DBENV_METHOD
(
mux_uock
, (
db_mux_t
 
mux
), (
dbv
, mutex))

928 
DbEnv
::
t_thad_id
((*
g
)(DbEnv *, 
pid_t
 *, 
db_thadid_t
 *))

930 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

931 
t
;

933 
thad_id_back_
 = 
g
;

934 i((
t
 = 
dbv
->
	`t_thad_id
(dbenv,

935 
g
 =0 ? 0 : 
_thad_id_r_c
)) != 0)

936 
	`DB_ERROR
(
this
, "DbEnv::t_thad_id", 
t
, 
	`r_picy
());

938  (
t
);

939 
	}
}

941 
DbEnv
::
t_thad_id_rg
(

942 *(*
g
)(
DbEnv
 *, 
pid_t
, 
db_thadid_t
, *))

944 
DB_ENV
 *
dbv
 = 
unwp
(
this
);

945 
t
;

947 
thad_id_rg_back_
 = 
g
;

948 i((
t
 = 
dbv
->
t_thad_id_rg
(dbenv,

949 
g
 =0 ? 0 : 
_thad_id_rg_r_c
)) != 0)

950 
DB_ERROR
(
this
, "DbEnv::t_thad_id_rg", 
t
,

951 
r_picy
());

953  (
t
);

956 
DbEnv
::
	$cdsgroup_beg
(
DbTxn
 **
tid
)

958 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

959 
DB_TXN
 *
txn
;

960 
t
;

962 
t
 = 
dbv
->
	`cdsgroup_beg
(dbv, &
txn
);

963 i(
	`DB_RETOK_STD
(
t
))

964 *
tid
 = 
w
 
	`DbTxn
(
txn
);

966 
	`DB_ERROR
(
this
, "DbEnv::cdsgroup_beg", 
t
, 
	`r_picy
());

968  (
t
);

969 
	}
}

971 
DbEnv
::
	$txn_beg
(
DbTxn
 *
pid
, DbTx**
tid
, 
u_t32_t
 
ags
)

973 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

974 
DB_TXN
 *
txn
;

975 
t
;

977 
t
 = 
dbv
->
	`txn_beg
(dbv, 
	`unwp
(
pid
), &
txn
, 
ags
);

978 i(
	`DB_RETOK_STD
(
t
))

979 *
tid
 = 
w
 
	`DbTxn
(
txn
);

981 
	`DB_ERROR
(
this
, "DbEnv::txn_beg", 
t
, 
	`r_picy
());

983  (
t
);

984 
	}
}

986 
DBENV_METHOD
(
txn_checkpot
, (
u_t32_t
 
kby
, u_t32_
m
, u_t32_
ags
),

987 (
dbv
, 
kby
, 
m
, 
ags
))

989 
DbEnv
::
	$txn_cov
(
DbPi
 *
li
, 
cou
,

990 *

, 
u_t32_t
 
ags
)

992 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

993 
DB_PREPLIST
 *
c_li
;

994 
i
;

995 
t
;

1002 i(
cou
 <= 0)

1003 
t
 = 
EINVAL
;

1005 
t
 = 
	`__os_mloc
(
dbv
->
v
, (
DB_PREPLIST
* 
cou
,

1006 &
c_li
);

1008 i(
t
 != 0) {

1009 
	`DB_ERROR
(
this
, "DbEnv::txn_cov", 
t
, 
	`r_picy
());

1010  (
t
);

1013 i((
t
 =

1014 
dbv
->
	`txn_cov
(dbv, 
c_li
, 
cou
, 

, 
ags
)) != 0) {

1015 
	`__os_
(
dbv
->
v
, 
c_li
);

1016 
	`DB_ERROR
(
this
, "DbEnv::txn_cov", 
t
, 
	`r_picy
());

1017  (
t
);

1020 
i
 = 0; i < *

; i++) {

1021 
li
[
i
].
txn
 = 
w
 
	`DbTxn
();

1022 
li
[
i
].
txn
->
imp_
 = 
c_li
[i].txn;

1023 
	`memy
(
li
[
i
].
gid
, 
c_li
[i].gid,

1024 (
li
[
i
].
gid
));

1027 
	`__os_
(
dbv
->
v
, 
c_li
);

1030 
	}
}

1032 
DBENV_METHOD
(
txn_
, (
DB_TXN_STAT
 **
p
, 
u_t32_t
 
ags
),

1033 (
dbv
, 
p
, 
ags
))

1034 
DBENV_METHOD
(
txn__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

1036 
DbEnv
::
p_t_t
(
myid
, (*
g
)(DbEnv *,

1037 cڡ 
Dbt
 *, cڡ Db*, cڡ 
DbL
 *, , 
u_t32_t
))

1039 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

1040 
t
;

1042 
p_nd_back_
 = 
g
;

1043 i((
t
 = 
dbv
->
	`p_t_t
(dbv, 
myid
,

1044 
g
 =0 ? 0 : 
_p_nd_r_c
)) != 0)

1045 
	`DB_ERROR
(
this
, "DbEnv::p_t_t", 
t
, 
	`r_picy
());

1047  (
t
);

1048 
	}
}

1050 
DBENV_METHOD
(
p_e
, (
u_t32_t
 
nses
, u_t32_
nves
, u_t32_
ags
),

1051 (
dbv
, 
nses
, 
nves
, 
ags
))

1052 
DBENV_METHOD
(
p_ush
, (), (
dbv
))

1053 
DBENV_METHOD
(
p_g_cfig
, (
u_t32_t
 
which
, *
of
),

1054 (
dbv
, 
which
, 
of
))

1055 
DBENV_METHOD
(
p_g_que
, (
u_t32_t
 *
m
, u_t32_*
max
),

1056 (
dbv
, 
m
, 
max
))

1057 
DBENV_METHOD
(
p_t_que
, (
u_t32_t
 
m
, u_t32_
max
), (
dbv
, min, max))

1059 
DbEnv
::
	$p_oss_mesge
(
Dbt
 *
cڌ
,

1060 
Dbt
 *
c
, 
id
, 
DbL
 *
t_lp
)

1062 
DB_ENV
 *
dbv
 = 
	`unwp
(
this
);

1063 
t
;

1065 
t
 = 
dbv
->
	`p_oss_mesge
(dbv, 
cڌ
, 
c
, 
id
, 
t_lp
);

1066 i(!
	`DB_RETOK_REPPMSG
(
t
))

1067 
	`DB_ERROR
(
this
, "DbEnv::p_oss_mesge", 
t
,

1068 
	`r_picy
());

1070  (
t
);

1071 
	}
}

1073 
DBENV_METHOD
(
p_t_cfig
,

1074 (
u_t32_t
 
which
, 
off
), (
dbv
, which, onoff))

1075 
DBENV_METHOD
(
p_t
,

1076 (
Dbt
 *
cook
, 
u_t32_t
 
ags
),

1077 (
dbv
, (
DBT
 *)
cook
, 
ags
))

1079 
DBENV_METHOD
(
p_
, (
DB_REP_STAT
 **
p
, 
u_t32_t
 
ags
),

1080 (
dbv
, 
p
, 
ags
))

1081 
DBENV_METHOD
(
p__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

1082 
DBENV_METHOD
(
p_sync
, (
u_t32_t
 
ags
), (
dbv
, flags))

1084 
DBENV_METHOD
(
p_g_ockskew
, (
u_t32_t
 *
_ockp
, u_t32_*
ow_ockp
),

1085 (
dbv
, 
_ockp
, 
ow_ockp
))

1086 
DBENV_METHOD
(
p_t_ockskew
, (
u_t32_t
 
_ock
, u_t32_
ow_ock
),

1087 (
dbv
, 
_ock
, 
ow_ock
))

1088 
DBENV_METHOD
(
p_g_lim
, (
u_t32_t
 *
gby
, u_t32_*
by
),

1089 (
dbv
, 
gby
, 
by
))

1090 
DBENV_METHOD
(
p_t_lim
, (
u_t32_t
 
gbys
, u_t32_
bys
),

1091 (
dbv
, 
gbys
, 
bys
))

1095 
DBENV_METHOD
(
p_g_nses
, (
u_t32_t
 *
n
), (
dbv
,))

1096 
DBENV_METHOD
(
p_t_nses
, (
u_t32_t
 
n
), (
dbv
,))

1097 
DBENV_METHOD
(
p_g_iܙy
, (
u_t32_t
 *
iܙy
),

1098 (
dbv
, 
iܙy
))

1099 
DBENV_METHOD
(
p_t_iܙy
, (
u_t32_t
 
iܙy
),

1100 (
dbv
, 
iܙy
))

1101 
DBENV_METHOD
(
p_g_timeout
, (
which
, 
db_timeout_t
 * 
timeout
),

1102 (
dbv
, 
which
, 
timeout
))

1103 
DBENV_METHOD
(
p_t_timeout
, (
which
, 
db_timeout_t
 
timeout
),

1104 (
dbv
, 
which
, 
timeout
))

1105 
DBENV_METHOD
(
pmgr_add_me_se
, (cڡ * 
ho
, 
u_t16_t
 
pt
,

1106 * 
eidp
, 
u_t32_t
 
ags
), (
dbv
, 
ho
, 
pt
,idp, flags))

1107 
DBENV_METHOD
(
pmgr_g_ack_picy
, (*
picy
), (
dbv
,olicy))

1108 
DBENV_METHOD
(
pmgr_t_ack_picy
, (
picy
), (
dbv
,olicy))

1109 
DBENV_METHOD
(
pmgr_t_lol_se
, (cڡ * 
ho
, 
u_t16_t
 
pt
,

1110 
u_t32_t
 
ags
), (
dbv
, 
ho
, 
pt
, flags))

1111 
DBENV_METHOD
(
pmgr_se_li
, (
u_t
 *
coup
, 
DB_REPMGR_SITE
 **
lip
),

1112 (
dbv
, 
coup
, 
lip
))

1113 
DBENV_METHOD
(
pmgr_t
, (
hads
, 
u_t32_t
 
ags
),

1114 (
dbv
, 
hads
, 
ags
))

1115 
DBENV_METHOD
(
pmgr_
, (
DB_REPMGR_STAT
 **
p
, 
u_t32_t
 
ags
),

1116 (
dbv
, 
p
, 
ags
))

1117 
DBENV_METHOD
(
pmgr__t
, (
u_t32_t
 
ags
), (
dbv
, flags))

1121 
DBENV_METHOD
(
g_timeout
,

1122 (
db_timeout_t
 *
timeou
, 
u_t32_t
 
ags
),

1123 (
dbv
, 
timeou
, 
ags
))

1124 
DBENV_METHOD
(
t_timeout
,

1125 (
db_timeout_t
 
timeout
, 
u_t32_t
 
ags
),

1126 (
dbv
, 
timeout
, 
ags
))

1129 *
DbEnv
::
	$vsi
(*
maj
, *
m
, *
tch
)

1131  (
	`db_vsi
(
maj
, 
m
, 
tch
));

1132 
	}
}

1135 
DbEnv
 *DbEnv::
	$wp_DB_ENV
(
DB_ENV
 *
dbv
)

1137 
DbEnv
 *
wed_v
 = 
	`g_DbEnv
(
dbv
);

1138  (
wed_v
 !
NULL
? wed_v : 
w
 
	`DbEnv
(
dbv
, 0);

1139 
	}
}

	@../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 , 
	$dbv_
(0)

44 
	`desibe
(0, 0);

45 
	}
}

47 
	gDbExi
::
	$DbExi
(cڡ *
desti
)

48 : 
	`r_
(0)

49 , 
	$dbv_
(0)

51 
	`desibe
(0, 
desti
);

52 
	}
}

54 
	gDbExi
::
	$DbExi
(cڡ *
desti
, 
r
)

55 : 
	`r_
(
r
)

56 , 
	$dbv_
(0)

58 
	`desibe
(0, 
desti
);

59 
	}
}

61 
	gDbExi
::
	$DbExi
(cڡ *
efix
, cڡ *
desti
, 
r
)

62 : 
	`r_
(
r
)

63 , 
	$dbv_
(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 , 
	$dbv_
(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  
dbv_
;

137 
	}
}

139 
	gDbExi
::
	$t_v
(
DbEnv
 *
dbv
)

141 
dbv_

dbv
;

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
->
v
->
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
->
v
->
dbv
),

56 "DbLogc::g", 
da
, 
ON_ERROR_UNKNOWN
);

58 
	`DB_ERROR
(
DbEnv
::
	`g_DbEnv
(
logc
->
v
->
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
->
v
->
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
->
v
->
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
->
v
->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
->
v
->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
"

4 
	~"db_t.h
"

5 
	~"dbc/yo.h
"

6 
	~"dbc/db_ge.h
"

7 
	~"dbc/db_dich.h
"

8 
	~"dbc/db_am.h
"

9 
	~"dbc/log.h
"

10 
	~"dbc/txn.h
"

17 
	$__d_masub_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

18 
ENV
 *
v
;

19 
DB
 **
db
;

20 *
td
;

21 *
cbuf
;

22 
__d_masub_gs
 **
g
;

24 
__d_masub_gs
 *
gp
;

25 
u_t32_t
 
ump
;

26 
u_t8_t
 *
bp
;

27 
t
;

29 i((
t
 = 
	`__os_mloc
(
v
,

30 (
__d_masub_gs
+ (
DB_TXN
), &
gp
)) != 0)

31  (
t
);

32 
bp
 = 
cbuf
;

33 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

34 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

36 
gp
->
tx
->
td
 =d;

37 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

38 
bp
 +(
gp
->
ty
);

40 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

41 
bp
 +(
gp
->
tx
->
txnid
);

43 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

44 
bp
 +(
DB_LSN
);

46 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

47 
gp
->
feid
 = (
t32_t
)
ump
;

48 
bp
 +(
ump
);

49 i(
db
 !
NULL
) {

50 *
db
 = 
NULL
;

51 
t
 = 
	`__dbg_id_to_db
(

52 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

55 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

56 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

57 
bp
 +(
ump
);

59 
	`memt
(&
gp
->
ge
, 0, (argp->page));

60 
	`LOGCOPY_32
(
v
,&
gp
->
ge
.
size
, 
bp
);

61 
bp
 +(
u_t32_t
);

62 
gp
->
ge
.
da
 = 
bp
;

63 
bp
 +
gp
->
ge
.
size
;

64 i(
	`LOG_SWAPPED
(
v
&& 
db
 !
NULL
 && *dbpp != NULL) {

65 
t_t
;

66 i((
t_t
 = 
	`__db_gesw
(*
db
, (
PAGE
 *)
gp
->
ge
.
da
,

67 (
size_t
)
gp
->
ge
.
size
, 
NULL
, 1)) != 0)

68  (
t_t
);

71 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

72 
bp
 +(
DB_LSN
);

74 *
g
 = 
gp
;

75  (
t
);

76 
	}
}

83 
	$__d_masub_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ge
, 
l
)

84 
DB
 *
dbp
;

85 
DB_TXN
 *
tx
;

86 
DB_LSN
 *
t_lp
;

87 
u_t32_t
 
ags
;

88 
db_pgno_t
 
pgno
;

89 cڡ 
DBT
 *
ge
;

90 
DB_LSN
 * 
l
;

92 
DBT
 
logc
;

93 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

94 
DB_TXNLOGREC
 *

;

95 
ENV
 *
v
;

96 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

97 
u_t
 
ad
;

98 
u_t8_t
 *
bp
;

99 
is_dub
, 
t
;

101 
	`COMPQUIET
(

, 
NULL
);

103 
v
 = 
dbp
->env;

104 
p
 = 
t_lp
;

105 
y
 = 
DB___d_masub
;

106 
ad
 = 0;

107 
t
 = 0;

109 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

110 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

111 i(
tx
 =
NULL
)

113 
is_dub
 = 0;

115 
is_dub
 = 1;

117 i(
tx
 =
NULL
) {

118 
txn_num
 = 0;

119 
lp
 = &
nu_l
;

120 
nu_l
.
fe
 =u_l.
offt
 = 0;

122 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

123 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

124  (
t
);

131 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

132 
txn_num
 = 
tx
->
txnid
;

135 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

136 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

137 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

138  (
t
);

140 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

141 + (
u_t32_t
)

142 + (
u_t32_t
)

143 + (
u_t32_t
+ (
ge
 =
NULL
 ? 0 :age->
size
)

144 + (*
l
);

145 i(
	`CRYPTO_ON
(
v
)) {

146 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

147 
logc
.
size
 +
ad
;

150 i(
is_dub
 || 
tx
 =
NULL
) {

151 i((
t
 =

152 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

153  (
t
);

155 i((
t
 = 
	`__os_mloc
(
v
,

156 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

157  (
t
);

158 #ifde
DIAGNOSTIC


159 i((
t
 =

160 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

161 
	`__os_
(
v
, 

);

162  (
t
);

165 
logc
.
da
 = 

->data;

168 i(
ad
 > 0)

169 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

171 
bp
 = 
logc
.
da
;

173 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

174 
bp
 +(
y
);

176 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

177 
bp
 +(
txn_num
);

179 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

180 
bp
 +(
DB_LSN
);

182 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

183 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

184 
bp
 +(
ump
);

186 
ump
 = (
u_t32_t
)
pgno
;

187 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

188 
bp
 +(
ump
);

190 i(
ge
 =
NULL
) {

191 
zo
 = 0;

192 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

193 
bp
 +(
u_t32_t
);

195 
	`LOGCOPY_32
(
v
, 
bp
, &
ge
->
size
);

196 
bp
 +(
ge
->
size
);

197 
	`memy
(
bp
, 
ge
->
da
,age->
size
);

198 i(
	`LOG_SWAPPED
(
v
))

199 i((
t
 = 
	`__db_gesw
(
dbp
,

200 (
PAGE
 *)
bp
, (
size_t
)
ge
->
size
, (
DBT
 *)
NULL
, 0)) != 0)

201  (
t
);

202 
bp
 +
ge
->
size
;

205 i(
l
 !
NULL
) {

206 i(
tx
 !
NULL
) {

207 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

208 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

209 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

210  (
t
);

212 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

214 
	`memt
(
bp
, 0, (*
l
));

215 
bp
 +(*
l
);

217 
	`DB_ASSERT
(
v
,

218 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

220 i(
is_dub
 || 
tx
 =
NULL
) {

221 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

222 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

223 *
lp
 = *
p
;

224 i(
p
 !
t_lp
)

225 *
t_lp
 = *
p
;

228 
t
 = 0;

229 #ifde
DIAGNOSTIC


234 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

235 
y
 |
DB_debug_FLAG
;

236 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

238 i(!
	`IS_REP_CLIENT
(
v
))

239 
t
 = 
	`__log_put
(
v
,

240 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

242 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

243 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

244 
	`LSN_NOT_LOGGED
(*
t_lp
);

247 #ifde
LOG_DIAGNOSTIC


248 i(
t
 != 0)

249 ()
	`__d_masub_t
(
v
,

250 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

253 #ifde
DIAGNOSTIC


254 
	`__os_
(
v
, 
logc
.
da
);

256 i(
is_dub
 || 
tx
 =
NULL
)

257 
	`__os_
(
v
, 
logc
.
da
);

259  (
t
);

260 
	}
}

267 
	$__d_mem__ad
(
v
, 
cbuf
, 
g
)

268 
ENV
 *
v
;

269 *
cbuf
;

270 
__d_mem__gs
 **
g
;

272 
__d_mem__gs
 *
gp
;

273 
u_t32_t
 
ump
;

274 
u_t8_t
 *
bp
;

275 
t
;

277 i((
t
 = 
	`__os_mloc
(
v
,

278 (
__d_mem__gs
+ (
DB_TXN
), &
gp
)) != 0)

279  (
t
);

280 
bp
 = 
cbuf
;

281 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

282 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

284 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

285 
bp
 +(
gp
->
ty
);

287 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

288 
bp
 +(
gp
->
tx
->
txnid
);

290 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

291 
bp
 +(
DB_LSN
);

293 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

294 
gp
->
feid
 = (
t32_t
)
ump
;

295 
bp
 +(
ump
);

297 
	`memt
(&
gp
->
me
, 0, (argp->name));

298 
	`LOGCOPY_32
(
v
,&
gp
->
me
.
size
, 
bp
);

299 
bp
 +(
u_t32_t
);

300 
gp
->
me
.
da
 = 
bp
;

301 
bp
 +
gp
->
me
.
size
;

303 
	`memt
(&
gp
->
fid
, 0, (argp->fid));

304 
	`LOGCOPY_32
(
v
,&
gp
->
fid
.
size
, 
bp
);

305 
bp
 +(
u_t32_t
);

306 
gp
->
fid
.
da
 = 
bp
;

307 
bp
 +
gp
->
fid
.
size
;

309 
	`LOGCOPY_32
(
v
, &
gp
->
pgsize
, 
bp
);

310 
bp
 +(
gp
->
pgsize
);

312 *
g
 = 
gp
;

313  (
t
);

314 
	}
}

322 
	$__d_mem__log
(
v
, 
tx
, 
t_lp
, 
ags
,

323 
feid
, 
me
, 
fid
, 
pgsize
)

324 
ENV
 *
v
;

325 
DB_TXN
 *
tx
;

326 
DB_LSN
 *
t_lp
;

327 
u_t32_t
 
ags
;

328 
t32_t
 
feid
;

329 cڡ 
DBT
 *
me
;

330 cڡ 
DBT
 *
fid
;

331 
u_t32_t
 
pgsize
;

333 
DBT
 
logc
;

334 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

335 
DB_TXNLOGREC
 *

;

336 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

337 
u_t
 
ad
;

338 
u_t8_t
 *
bp
;

339 
is_dub
, 
t
;

341 
	`COMPQUIET
(

, 
NULL
);

343 
p
 = 
t_lp
;

344 
y
 = 
DB___d_mem_
;

345 
ad
 = 0;

346 
t
 = 0;

348 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

349 i(
tx
 =
NULL
)

351 i(
tx
 =
NULL
)

353 
is_dub
 = 0;

355 
is_dub
 = 1;

357 i(
tx
 =
NULL
) {

358 
txn_num
 = 0;

359 
lp
 = &
nu_l
;

360 
nu_l
.
fe
 =u_l.
offt
 = 0;

362 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

363 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

364  (
t
);

371 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

372 
txn_num
 = 
tx
->
txnid
;

375 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

376 + (
u_t32_t
)

377 + (
u_t32_t
+ (
me
 =
NULL
 ? 0 :ame->
size
)

378 + (
u_t32_t
+ (
fid
 =
NULL
 ? 0 : fid->
size
)

379 + (
u_t32_t
);

380 i(
	`CRYPTO_ON
(
v
)) {

381 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

382 
logc
.
size
 +
ad
;

385 i(
is_dub
 || 
tx
 =
NULL
) {

386 i((
t
 =

387 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

388  (
t
);

390 i((
t
 = 
	`__os_mloc
(
v
,

391 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

392  (
t
);

393 #ifde
DIAGNOSTIC


394 i((
t
 =

395 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

396 
	`__os_
(
v
, 

);

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 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

409 
bp
 +(
y
);

411 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

412 
bp
 +(
txn_num
);

414 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

415 
bp
 +(
DB_LSN
);

417 
ump
 = (
u_t32_t
)
feid
;

418 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

419 
bp
 +(
ump
);

421 i(
me
 =
NULL
) {

422 
zo
 = 0;

423 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

424 
bp
 +(
u_t32_t
);

426 
	`LOGCOPY_32
(
v
, 
bp
, &
me
->
size
);

427 
bp
 +(
me
->
size
);

428 
	`memy
(
bp
, 
me
->
da
,ame->
size
);

429 
bp
 +
me
->
size
;

432 i(
fid
 =
NULL
) {

433 
zo
 = 0;

434 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

435 
bp
 +(
u_t32_t
);

437 
	`LOGCOPY_32
(
v
, 
bp
, &
fid
->
size
);

438 
bp
 +(
fid
->
size
);

439 
	`memy
(
bp
, 
fid
->
da
, fid->
size
);

440 
bp
 +
fid
->
size
;

443 
	`LOGCOPY_32
(
v
, 
bp
, &
pgsize
);

444 
bp
 +(
pgsize
);

446 
	`DB_ASSERT
(
v
,

447 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

449 i(
is_dub
 || 
tx
 =
NULL
) {

450 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

451 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

452 *
lp
 = *
p
;

453 i(
p
 !
t_lp
)

454 *
t_lp
 = *
p
;

457 
t
 = 0;

458 #ifde
DIAGNOSTIC


463 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

464 
y
 |
DB_debug_FLAG
;

465 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

467 i(!
	`IS_REP_CLIENT
(
v
))

468 
t
 = 
	`__log_put
(
v
,

469 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

471 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

472 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

473 
	`LSN_NOT_LOGGED
(*
t_lp
);

476 #ifde
LOG_DIAGNOSTIC


477 i(
t
 != 0)

478 ()
	`__d_mem__t
(
v
,

479 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

482 #ifde
DIAGNOSTIC


483 
	`__os_
(
v
, 
logc
.
da
);

485 i(
is_dub
 || 
tx
 =
NULL
)

486 
	`__os_
(
v
, 
logc
.
da
);

488  (
t
);

489 
	}
}

496 
	$__d_mem_me_ad
(
v
, 
cbuf
, 
g
)

497 
ENV
 *
v
;

498 *
cbuf
;

499 
__d_mem_me_gs
 **
g
;

501 
__d_mem_me_gs
 *
gp
;

502 
u_t8_t
 *
bp
;

503 
t
;

505 i((
t
 = 
	`__os_mloc
(
v
,

506 (
__d_mem_me_gs
+ (
DB_TXN
), &
gp
)) != 0)

507  (
t
);

508 
bp
 = 
cbuf
;

509 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

510 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

512 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

513 
bp
 +(
gp
->
ty
);

515 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

516 
bp
 +(
gp
->
tx
->
txnid
);

518 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

519 
bp
 +(
DB_LSN
);

521 
	`memt
(&
gp
->
dme
, 0, (argp->oldname));

522 
	`LOGCOPY_32
(
v
,&
gp
->
dme
.
size
, 
bp
);

523 
bp
 +(
u_t32_t
);

524 
gp
->
dme
.
da
 = 
bp
;

525 
bp
 +
gp
->
dme
.
size
;

527 
	`memt
(&
gp
->
wme
, 0, (argp->newname));

528 
	`LOGCOPY_32
(
v
,&
gp
->
wme
.
size
, 
bp
);

529 
bp
 +(
u_t32_t
);

530 
gp
->
wme
.
da
 = 
bp
;

531 
bp
 +
gp
->
wme
.
size
;

533 
	`memt
(&
gp
->
fid
, 0, (argp->fid));

534 
	`LOGCOPY_32
(
v
,&
gp
->
fid
.
size
, 
bp
);

535 
bp
 +(
u_t32_t
);

536 
gp
->
fid
.
da
 = 
bp
;

537 
bp
 +
gp
->
fid
.
size
;

539 *
g
 = 
gp
;

540  (
t
);

541 
	}
}

548 
	$__d_mem_me_log
(
v
, 
tx
, 
t_lp
, 
ags
,

549 
dme
, 
wme
, 
fid
)

550 
ENV
 *
v
;

551 
DB_TXN
 *
tx
;

552 
DB_LSN
 *
t_lp
;

553 
u_t32_t
 
ags
;

554 cڡ 
DBT
 *
dme
;

555 cڡ 
DBT
 *
wme
;

556 cڡ 
DBT
 *
fid
;

558 
DBT
 
logc
;

559 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

560 
DB_TXNLOGREC
 *

;

561 
u_t32_t
 
zo
, 
y
, 
txn_num
;

562 
u_t
 
ad
;

563 
u_t8_t
 *
bp
;

564 
is_dub
, 
t
;

566 
	`COMPQUIET
(

, 
NULL
);

568 
p
 = 
t_lp
;

569 
y
 = 
DB___d_mem_me
;

570 
ad
 = 0;

571 
t
 = 0;

573 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

574 i(
tx
 =
NULL
)

576 i(
tx
 =
NULL
)

578 
is_dub
 = 0;

580 
is_dub
 = 1;

582 i(
tx
 =
NULL
) {

583 
txn_num
 = 0;

584 
lp
 = &
nu_l
;

585 
nu_l
.
fe
 =u_l.
offt
 = 0;

587 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

588 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

589  (
t
);

596 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

597 
txn_num
 = 
tx
->
txnid
;

600 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

601 + (
u_t32_t
+ (
dme
 =
NULL
 ? 0 : oldme->
size
)

602 + (
u_t32_t
+ (
wme
 =
NULL
 ? 0 :ewme->
size
)

603 + (
u_t32_t
+ (
fid
 =
NULL
 ? 0 : fid->
size
);

604 i(
	`CRYPTO_ON
(
v
)) {

605 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

606 
logc
.
size
 +
ad
;

609 i(
is_dub
 || 
tx
 =
NULL
) {

610 i((
t
 =

611 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

612  (
t
);

614 i((
t
 = 
	`__os_mloc
(
v
,

615 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

616  (
t
);

617 #ifde
DIAGNOSTIC


618 i((
t
 =

619 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

620 
	`__os_
(
v
, 

);

621  (
t
);

624 
logc
.
da
 = 

->data;

627 i(
ad
 > 0)

628 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

630 
bp
 = 
logc
.
da
;

632 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

633 
bp
 +(
y
);

635 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

636 
bp
 +(
txn_num
);

638 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

639 
bp
 +(
DB_LSN
);

641 i(
dme
 =
NULL
) {

642 
zo
 = 0;

643 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

644 
bp
 +(
u_t32_t
);

646 
	`LOGCOPY_32
(
v
, 
bp
, &
dme
->
size
);

647 
bp
 +(
dme
->
size
);

648 
	`memy
(
bp
, 
dme
->
da
, oldme->
size
);

649 
bp
 +
dme
->
size
;

652 i(
wme
 =
NULL
) {

653 
zo
 = 0;

654 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

655 
bp
 +(
u_t32_t
);

657 
	`LOGCOPY_32
(
v
, 
bp
, &
wme
->
size
);

658 
bp
 +(
wme
->
size
);

659 
	`memy
(
bp
, 
wme
->
da
,ewme->
size
);

660 
bp
 +
wme
->
size
;

663 i(
fid
 =
NULL
) {

664 
zo
 = 0;

665 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

666 
bp
 +(
u_t32_t
);

668 
	`LOGCOPY_32
(
v
, 
bp
, &
fid
->
size
);

669 
bp
 +(
fid
->
size
);

670 
	`memy
(
bp
, 
fid
->
da
, fid->
size
);

671 
bp
 +
fid
->
size
;

674 
	`DB_ASSERT
(
v
,

675 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

677 i(
is_dub
 || 
tx
 =
NULL
) {

678 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

679 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

680 *
lp
 = *
p
;

681 i(
p
 !
t_lp
)

682 *
t_lp
 = *
p
;

685 
t
 = 0;

686 #ifde
DIAGNOSTIC


691 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

692 
y
 |
DB_debug_FLAG
;

693 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

695 i(!
	`IS_REP_CLIENT
(
v
))

696 
t
 = 
	`__log_put
(
v
,

697 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

699 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

700 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

701 
	`LSN_NOT_LOGGED
(*
t_lp
);

704 #ifde
LOG_DIAGNOSTIC


705 i(
t
 != 0)

706 ()
	`__d_mem_me_t
(
v
,

707 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

710 #ifde
DIAGNOSTIC


711 
	`__os_
(
v
, 
logc
.
da
);

713 i(
is_dub
 || 
tx
 =
NULL
)

714 
	`__os_
(
v
, 
logc
.
da
);

716  (
t
);

717 
	}
}

724 
	$__d_mem_move_ad
(
v
, 
cbuf
, 
g
)

725 
ENV
 *
v
;

726 *
cbuf
;

727 
__d_mem_move_gs
 **
g
;

729 
__d_mem_move_gs
 *
gp
;

730 
u_t8_t
 *
bp
;

731 
t
;

733 i((
t
 = 
	`__os_mloc
(
v
,

734 (
__d_mem_move_gs
+ (
DB_TXN
), &
gp
)) != 0)

735  (
t
);

736 
bp
 = 
cbuf
;

737 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

738 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

740 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

741 
bp
 +(
gp
->
ty
);

743 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

744 
bp
 +(
gp
->
tx
->
txnid
);

746 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

747 
bp
 +(
DB_LSN
);

749 
	`memt
(&
gp
->
me
, 0, (argp->name));

750 
	`LOGCOPY_32
(
v
,&
gp
->
me
.
size
, 
bp
);

751 
bp
 +(
u_t32_t
);

752 
gp
->
me
.
da
 = 
bp
;

753 
bp
 +
gp
->
me
.
size
;

755 
	`memt
(&
gp
->
fid
, 0, (argp->fid));

756 
	`LOGCOPY_32
(
v
,&
gp
->
fid
.
size
, 
bp
);

757 
bp
 +(
u_t32_t
);

758 
gp
->
fid
.
da
 = 
bp
;

759 
bp
 +
gp
->
fid
.
size
;

761 *
g
 = 
gp
;

762  (
t
);

763 
	}
}

770 
	$__d_mem_move_log
(
v
, 
tx
, 
t_lp
, 
ags
,

771 
me
, 
fid
)

772 
ENV
 *
v
;

773 
DB_TXN
 *
tx
;

774 
DB_LSN
 *
t_lp
;

775 
u_t32_t
 
ags
;

776 cڡ 
DBT
 *
me
;

777 cڡ 
DBT
 *
fid
;

779 
DBT
 
logc
;

780 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

781 
DB_TXNLOGREC
 *

;

782 
u_t32_t
 
zo
, 
y
, 
txn_num
;

783 
u_t
 
ad
;

784 
u_t8_t
 *
bp
;

785 
is_dub
, 
t
;

787 
	`COMPQUIET
(

, 
NULL
);

789 
p
 = 
t_lp
;

790 
y
 = 
DB___d_mem_move
;

791 
ad
 = 0;

792 
t
 = 0;

794 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

795 i(
tx
 =
NULL
)

797 i(
tx
 =
NULL
)

799 
is_dub
 = 0;

801 
is_dub
 = 1;

803 i(
tx
 =
NULL
) {

804 
txn_num
 = 0;

805 
lp
 = &
nu_l
;

806 
nu_l
.
fe
 =u_l.
offt
 = 0;

808 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

809 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

810  (
t
);

817 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

818 
txn_num
 = 
tx
->
txnid
;

821 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

822 + (
u_t32_t
+ (
me
 =
NULL
 ? 0 :ame->
size
)

823 + (
u_t32_t
+ (
fid
 =
NULL
 ? 0 : fid->
size
);

824 i(
	`CRYPTO_ON
(
v
)) {

825 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

826 
logc
.
size
 +
ad
;

829 i(
is_dub
 || 
tx
 =
NULL
) {

830 i((
t
 =

831 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

832  (
t
);

834 i((
t
 = 
	`__os_mloc
(
v
,

835 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

836  (
t
);

837 #ifde
DIAGNOSTIC


838 i((
t
 =

839 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

840 
	`__os_
(
v
, 

);

841  (
t
);

844 
logc
.
da
 = 

->data;

847 i(
ad
 > 0)

848 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

850 
bp
 = 
logc
.
da
;

852 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

853 
bp
 +(
y
);

855 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

856 
bp
 +(
txn_num
);

858 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

859 
bp
 +(
DB_LSN
);

861 i(
me
 =
NULL
) {

862 
zo
 = 0;

863 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

864 
bp
 +(
u_t32_t
);

866 
	`LOGCOPY_32
(
v
, 
bp
, &
me
->
size
);

867 
bp
 +(
me
->
size
);

868 
	`memy
(
bp
, 
me
->
da
,ame->
size
);

869 
bp
 +
me
->
size
;

872 i(
fid
 =
NULL
) {

873 
zo
 = 0;

874 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

875 
bp
 +(
u_t32_t
);

877 
	`LOGCOPY_32
(
v
, 
bp
, &
fid
->
size
);

878 
bp
 +(
fid
->
size
);

879 
	`memy
(
bp
, 
fid
->
da
, fid->
size
);

880 
bp
 +
fid
->
size
;

883 
	`DB_ASSERT
(
v
,

884 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

886 i(
is_dub
 || 
tx
 =
NULL
) {

887 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

888 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

889 *
lp
 = *
p
;

890 i(
p
 !
t_lp
)

891 *
t_lp
 = *
p
;

894 
t
 = 0;

895 #ifde
DIAGNOSTIC


900 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

901 
y
 |
DB_debug_FLAG
;

902 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

904 i(!
	`IS_REP_CLIENT
(
v
))

905 
t
 = 
	`__log_put
(
v
,

906 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

908 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

909 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

910 
	`LSN_NOT_LOGGED
(*
t_lp
);

913 #ifde
LOG_DIAGNOSTIC


914 i(
t
 != 0)

915 ()
	`__d_mem_move_t
(
v
,

916 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

919 #ifde
DIAGNOSTIC


920 
	`__os_
(
v
, 
logc
.
da
);

922 i(
is_dub
 || 
tx
 =
NULL
)

923 
	`__os_
(
v
, 
logc
.
da
);

925  (
t
);

926 
	}
}

932 
	$__d__cov
(
v
, 
dbp
)

933 
ENV
 *
v
;

934 
DB_DISTAB
 *
dbp
;

936 
t
;

938 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

939 
__d_masub_cov
, 
DB___d_masub
)) != 0)

940  (
t
);

941 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

942 
__d_mem__cov
, 
DB___d_mem_
)) != 0)

943  (
t
);

944 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

945 
__d_mem_me_cov
, 
DB___d_mem_me
)) != 0)

946  (
t
);

947 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

948 
__d_mem_move_cov
, 
DB___d_mem_move
)) != 0)

949  (
t
);

951 
	}
}

	@../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
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

19 
ENV
 *
v
;

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
 =

34 
	`__d_masub_ad
(
v
, 
NULL
, NULL, 
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
("\gno: %lu\n", (
u_lg
)
gp
->
pgno
);

45 ()
	`tf
("\tpage: ");

46 
i
 = 0; i < 
gp
->
ge
.
size
; i++) {

47 
ch
 = ((
u_t8_t
 *)
gp
->
ge
.
da
)[
i
];

48 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

50 ()
	`tf
("\n");

51 ()
	`tf
("\tlsn: [%lu][%lu]\n",

52 (
u_lg
)
gp
->
l
.
fe
, (u_lgrgp->l.
offt
);

53 ()
	`tf
("\n");

54 
	`__os_
(
v
, 
gp
);

56 
	}
}

63 
	$__d_mem__t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

64 
ENV
 *
v
;

65 
DBT
 *
db
;

66 
DB_LSN
 *
lp
;

67 
db_cs
 
nud2
;

68 *
nud3
;

70 
__d_mem__gs
 *
gp
;

71 
u_t32_t
 
i
;

72 
ch
;

73 
t
;

75 
nud2
 = 
DB_TXN_PRINT
;

76 
nud3
 = 
NULL
;

78 i((
t
 = 
	`__d_mem__ad
(
v
, 
db
->
da
, &
gp
)) != 0)

79  (
t
);

80 ()
	`tf
(

82 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

83 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

84 (
u_lg
)
gp
->
ty
,

85 (
u_lg
)
gp
->
tx
->
txnid
,

86 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

87 ()
	`tf
("\tfeid: %ld\n", ()
gp
->
feid
);

88 ()
	`tf
("\tname: ");

89 
i
 = 0; i < 
gp
->
me
.
size
; i++) {

90 
ch
 = ((
u_t8_t
 *)
gp
->
me
.
da
)[
i
];

91 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

93 ()
	`tf
("\n");

94 ()
	`tf
("\tfid: ");

95 
i
 = 0; i < 
gp
->
fid
.
size
; i++) {

96 
ch
 = ((
u_t8_t
 *)
gp
->
fid
.
da
)[
i
];

97 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

99 ()
	`tf
("\n");

100 ()
	`tf
("\gsize: %lu\n", (
u_lg
)
gp
->
pgsize
);

101 ()
	`tf
("\n");

102 
	`__os_
(
v
, 
gp
);

104 
	}
}

111 
	$__d_mem_me_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

112 
ENV
 *
v
;

113 
DBT
 *
db
;

114 
DB_LSN
 *
lp
;

115 
db_cs
 
nud2
;

116 *
nud3
;

118 
__d_mem_me_gs
 *
gp
;

119 
u_t32_t
 
i
;

120 
ch
;

121 
t
;

123 
nud2
 = 
DB_TXN_PRINT
;

124 
nud3
 = 
NULL
;

126 i((
t
 = 
	`__d_mem_me_ad
(
v
, 
db
->
da
, &
gp
)) != 0)

127  (
t
);

128 ()
	`tf
(

130 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

131 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

132 (
u_lg
)
gp
->
ty
,

133 (
u_lg
)
gp
->
tx
->
txnid
,

134 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

135 ()
	`tf
("\toldname: ");

136 
i
 = 0; i < 
gp
->
dme
.
size
; i++) {

137 
ch
 = ((
u_t8_t
 *)
gp
->
dme
.
da
)[
i
];

138 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

140 ()
	`tf
("\n");

141 ()
	`tf
("\tnewname: ");

142 
i
 = 0; i < 
gp
->
wme
.
size
; i++) {

143 
ch
 = ((
u_t8_t
 *)
gp
->
wme
.
da
)[
i
];

144 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

146 ()
	`tf
("\n");

147 ()
	`tf
("\tfid: ");

148 
i
 = 0; i < 
gp
->
fid
.
size
; i++) {

149 
ch
 = ((
u_t8_t
 *)
gp
->
fid
.
da
)[
i
];

150 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

152 ()
	`tf
("\n");

153 ()
	`tf
("\n");

154 
	`__os_
(
v
, 
gp
);

156 
	}
}

163 
	$__d_mem_move_t
(
v
, 
db
, 
lp
, 
nud2
, 
nud3
)

164 
ENV
 *
v
;

165 
DBT
 *
db
;

166 
DB_LSN
 *
lp
;

167 
db_cs
 
nud2
;

168 *
nud3
;

170 
__d_mem_move_gs
 *
gp
;

171 
u_t32_t
 
i
;

172 
ch
;

173 
t
;

175 
nud2
 = 
DB_TXN_PRINT
;

176 
nud3
 = 
NULL
;

178 i((
t
 = 
	`__d_mem_move_ad
(
v
, 
db
->
da
, &
gp
)) != 0)

179  (
t
);

180 ()
	`tf
(

182 (
u_lg
)
lp
->
fe
, (u_lgp->
offt
,

183 (
gp
->
ty
 & 
DB_debug_FLAG
) ? "_debug" : "",

184 (
u_lg
)
gp
->
ty
,

185 (
u_lg
)
gp
->
tx
->
txnid
,

186 (
u_lg
)
gp
->
ev_l
.
fe
, (u_lgrgp->ev_l.
offt
);

187 ()
	`tf
("\tname: ");

188 
i
 = 0; i < 
gp
->
me
.
size
; i++) {

189 
ch
 = ((
u_t8_t
 *)
gp
->
me
.
da
)[
i
];

190 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

192 ()
	`tf
("\n");

193 ()
	`tf
("\tfid: ");

194 
i
 = 0; i < 
gp
->
fid
.
size
; i++) {

195 
ch
 = ((
u_t8_t
 *)
gp
->
fid
.
da
)[
i
];

196 
	`tf
(
	`irt
(
ch
) || ch == 0x0a ? "%c" : "%#x ", ch);

198 ()
	`tf
("\n");

199 ()
	`tf
("\n");

200 
	`__os_
(
v
, 
gp
);

202 
	}
}

208 
	$__d__t
(
v
, 
dbp
)

209 
ENV
 *
v
;

210 
DB_DISTAB
 *
dbp
;

212 
t
;

214 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

215 
__d_masub_t
, 
DB___d_masub
)) != 0)

216  (
t
);

217 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

218 
__d_mem__t
, 
DB___d_mem_
)) != 0)

219  (
t
);

220 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

221 
__d_mem_me_t
, 
DB___d_mem_me
)) != 0)

222  (
t
);

223 i((
t
 = 
	`__db_add_covy_t
(
v
, 
dbp
,

224 
__d_mem_move_t
, 
DB___d_mem_move
)) != 0)

225  (
t
);

227 
	}
}

	@../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
(
v
, 
db
, 
lp
, 

, 
fo
)

28 
ENV
 *
v
;

29 
DBT
 *
db
;

30 
DB_LSN
 *
lp
;

31 
db_cs
 

;

32 *
fo
;

34 
__d_masub_gs
 *
gp
;

35 
DB_THREAD_INFO
 *

;

36 
DB
 *
fe_dbp
;

37 
DBC
 *
dbc
;

38 
DB_MPOOLFILE
 *
mpf
;

39 
PAGE
 *
g
;

40 
cmp_p
, 
t
, 
t_t
;

42 

 = ((
DB_TXNHEAD
 *)
fo
)->
thad_fo
;

43 
g
 = 
NULL
;

44 
	`REC_PRINT
(
__d_masub_t
);

45 
	`REC_INTRO
(
__d_masub_ad
, 

, 0);

47 i((
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
,

48 

, 
NULL
, 0, &
g
)) != 0) {

50 i(
	`F_ISSET
(
fe_dbp
, 
DB_AM_INMEM
) &&

51 (
t
 = 
	`__memp_fg
(
mpf
, &
gp
->
pgno
, 

, 
NULL
,

52 
DB_MPOOL_CREATE
 | 
DB_MPOOL_DIRTY
, &
g
)) == 0) {

53 
	`LSN_NOT_LOGGED
(
	`LSN
(
g
));

55 *
lp
 = 
gp
->
ev_l
;

56 
t
 = 0;

57 
out
;

61 
cmp_p
 = 
	`LOG_COMPARE
(&
	`LSN
(
g
), &
gp
->
l
);

62 
	`CHECK_LSN
(
v
, 

, 
cmp_p
, &
	`LSN
(
g
), &
gp
->
l
);

64 i(
cmp_p
 =0 && 
	`DB_REDO
(

)) {

65 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

66 
	`memy
(
g
, 
gp
->
ge
.
da
,rgp->ge.
size
);

67 
	`LSN
(
g
*
lp
;

74 i(
	`F_ISSET
(
fe_dbp
, 
DB_AM_INMEM
) &&

75 
gp
->
pgno
 =
PGNO_BASE_MD
 &&

76 (
t
 = 
	`__db_ma_tup
(
fe_dbp
->
v
, file_dbp,

77 
fe_dbp
->
dme
, (
DBMETA
 *)
g
, 0, 
DB_CHK_META
)) != 0)

78 
out
;

79 } i(
	`DB_UNDO
(

)) {

92 
	`REC_DIRTY
(
mpf
, 

, 
fe_dbp
->
iܙy
, &
g
);

93 
	`LSN
(
g

gp
->
l
;

96 
de
: *
lp
 = 
gp
->
ev_l
;

97 
t
 = 0;

99 
out
: i(
g
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mpf
,

100 

, 
g
, 
fe_dbp
->
iܙy
)) != 0 &&

101 
t
 == 0)

102 
t
 = 
t_t
;

104 
REC_CLOSE
;

105 
	}
}

115 
	$__d_mem__cov
(
v
, 
db
, 
lp
, 

, 
fo
)

116 
ENV
 *
v
;

117 
DBT
 *
db
;

118 
DB_LSN
 *
lp
;

119 
db_cs
 

;

120 *
fo
;

122 
__d_mem__gs
 *
gp
;

123 
DB
 *
dbp
;

124 
do_o
, 
t
, 
t_t
;

126 
	`COMPQUIET
(
fo
, 
NULL
);

128 
dbp
 = 
NULL
;

129 
do_o
 = 0;

130 
	`REC_PRINT
(
__d_mem__t
);

131 
	`REC_NOOP_INTRO
(
__d_mem__ad
);

134 i(
gp
->
feid
 =
DB_LOGFILEID_INVALID
) {

135 i(
	`DB_REDO
(

))

136 
t
 = 
ENOENT
;

138 
t
 = 0;

140 
t
 = 
	`__dbg_id_to_db
(
v
, 
gp
->
tx
, &
dbp
,rgp->
feid
, 0);

142 i(
	`DB_REDO
(

)) {

147 i(
t
 != 0) {

148 i((
t
 = 
	`__db__
(&
dbp
, 
v
, 0)) != 0)

149 
out
;

151 
	`F_SET
(
dbp
, 
DB_AM_RECOVER
 | 
DB_AM_INMEM
);

152 
	`memy
(
dbp
->
feid
, 
gp
->
fid
.
da
, 
DB_FILE_ID_LEN
);

153 i(((
t
 = 
	`__os_rdup
(
v
,

154 
gp
->
me
.
da
, &
dbp
->
dme
)) != 0))

155 
out
;

162 
do_o
 = 1;

166 
	`memy
(
dbp
->
feid
, 
gp
->
fid
.
da
,rgp->fid.
size
);

167 i((
t
 = 
	`__memp_t_feid
(
dbp
->
mpf
, dbp->
feid
)) != 0)

168 
out
;

169 
dbp
->
erve_fid
 = 1;

170 
	`MAKE_INMEM
(
dbp
);

171 i((
t
 = 
	`__v_tup
(
dbp
,

172 
NULL
, NULL, 
gp
->
me
.
da
, 
TXN_INVALID
, 0)) != 0)

173 
out
;

174 
t
 = 
	`__v_mpo
(
dbp
, 
gp
->
me
.
da
, 0);

176 i(
t
 =
ENOENT
) {

177 
dbp
->
pgsize
 = 
gp
->pgsize;

178 i((
t
 = 
	`__v_mpo
(
dbp
,

179 
gp
->
me
.
da
, 
DB_CREATE
)) != 0)

180 
out
;

181 } i(
t
 != 0)

182 
out
;

185 i(
	`DB_UNDO
(

)) {

186 i(
t
 == 0)

187 
t
 = 
	`__memp_me
(
v
, 
gp
->
fid
.
da
, 
NULL
,

188 (cڡ *)
gp
->
me
.
da
, 
NULL
, 1);

190 i(
t
 =
ENOENT
 || =
DB_DELETED
)

191 
t
 = 0;

193 
out
;

196 *
lp
 = 
gp
->
ev_l
;

198 
out
: i(
dbp
 !
NULL
) {

199 
t_t
 = 0;

201 i(
do_o
 || 
t
 != 0)

202 
t_t
 = 
	`__db_o
(
dbp
, 
NULL
, 
DB_NOSYNC
);

203 i(
t_t
 !0 && 
t
 == 0)

204 
t
 = 
t_t
;

206 
REC_NOOP_CLOSE
;

207 
	}
}

217 
	$__d_mem_me_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

218 
ENV
 *
v
;

219 
DBT
 *
db
;

220 
DB_LSN
 *
lp
;

221 
db_cs
 

;

222 *
fo
;

224 
__d_mem_me_gs
 *
gp
;

225 
u_t8_t
 *
feid
;

226 
t
;

228 
	`COMPQUIET
(
fo
, 
NULL
);

230 
	`REC_PRINT
(
__d_mem_me_t
);

231 
	`REC_NOOP_INTRO
(
__d_mem_me_ad
);

232 
feid
 = 
gp
->
fid
.
da
;

235 i(
	`DB_REDO
(

))

236 ()
	`__memp_me
(
v
, 
feid
,

237 (cڡ *)
gp
->
wme
.
da
,

238 (cڡ *)
gp
->
dme
.
da
,

239 (cڡ *)
gp
->
wme
.
da
, 1);

241 i(
	`DB_UNDO
(

))

242 ()
	`__memp_me
(
v
, 
feid
,

243 (cڡ *)
gp
->
dme
.
da
,

244 (cڡ *)
gp
->
wme
.
da
,

245 (cڡ *)
gp
->
dme
.
da
, 1);

247 *
lp
 = 
gp
->
ev_l
;

248 
t
 = 0;

250 
REC_NOOP_CLOSE
;

251 
	}
}

261 
	$__d_mem_move_cov
(
v
, 
db
, 
lp
, 

, 
fo
)

262 
ENV
 *
v
;

263 
DBT
 *
db
;

264 
DB_LSN
 *
lp
;

265 
db_cs
 

;

266 *
fo
;

268 
__d_mem_move_gs
 *
gp
;

269 
t
;

271 
	`COMPQUIET
(
fo
, 
NULL
);

273 
	`REC_PRINT
(
__d_mem_move_t
);

274 
	`REC_NOOP_INTRO
(
__d_mem_move_ad
);

280 i(
	`DB_REDO
(

)) {

281 ()
	`__memp_me
(
v
,

282 
gp
->
fid
.
da
, 
NULL
,rgp->
me
.data, NULL, 1);

285 *
lp
 = 
gp
->
ev_l
;

286 
t
 = 0;

288 
REC_NOOP_CLOSE
;

289 
	}
}

	@../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
 *));

56 
__db_dissoc_feign
 
__P
 ((
DB
 *));

58 #ifde
CONFIG_TEST


59 
__db_makecy
 
__P
((
ENV
 *, const *, const *));

60 
__db_docy
 
__P
((
ENV
 *, const *));

61 
__qam_docy
 
__P
((
DB
 *, const *));

77 
	$__db_ma_ݒ
(
subdbp
, 

, 
txn
, 
me
, 
ags
, 
mode
, 
db
)

78 
DB
 *
subdbp
;

79 
DB_THREAD_INFO
 *

;

80 
DB_TXN
 *
txn
;

81 cڡ *
me
;

82 
u_t32_t
 
ags
;

83 
mode
;

84 
DB
 **
db
;

86 
DB
 *
dbp
;

87 
t
;

89 *
db
 = 
NULL
;

92 i((
t
 = 
	`__db__
(&
dbp
, 
subdbp
->
v
, 0)) != 0)

93  (
t
);

101 
dbp
->
pgsize
 = 
subdbp
->pgsize;

102 
	`F_SET
(
dbp
, 
DB_AM_SUBDB
);

103 
	`F_SET
(
dbp
, 
	`F_ISSET
(
subdbp
,

104 
DB_AM_RECOVER
 | 
DB_AM_SWAP
 |

105 
DB_AM_ENCRYPT
 | 
DB_AM_CHKSUM
 | 
DB_AM_NOT_DURABLE
));

112 
	`LF_CLR
(
DB_EXCL
);

113 
	`LF_SET
(
DB_RDWRMASTER
);

114 i((
t
 = 
	`__db_ݒ
(
dbp
, 

,

115 
txn
, 
me
, 
NULL
, 
DB_BTREE
, 
ags
, 
mode
, 
PGNO_BASE_MD
)) != 0)

116 
r
;

125 i(
	`F_ISSET
(
dbp
, 
DB_AM_CHKSUM
))

126 
	`F_SET
(
subdbp
, 
DB_AM_CHKSUM
);

132 
subdbp
->
pgsize
 = 
dbp
->pgsize;

133 *
db
 = 
dbp
;

136 
r
: i(!
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
))

137 ()
	`__db_o
(
dbp
, 
txn
, 0);

140  (
t
);

141 
	}
}

151 
	$__db_ma_upde
(
mdbp
, 
sdbp
, 

, 
txn
, 
subdb
, 
ty
, 
ai
, 
wme
, 
ags
)

152 
DB
 *
mdbp
, *
sdbp
;

153 
DB_TXN
 *
txn
;

154 
DB_THREAD_INFO
 *

;

155 cڡ *
subdb
;

156 
DBTYPE
 
ty
;

157 
mu_ai
 
ai
;

158 cڡ *
wme
;

159 
u_t32_t
 
ags
;

161 
DBC
 *
dbc
, *
ndbc
;

162 
DBT
 
key
, 
da
, 
nda
;

163 
ENV
 *
v
;

164 
PAGE
 *
p
, *
r
;

165 
db_pgno_t
 
t_pgno
;

166 
modify
, 
t
, 
t_t
;

168 
v
 = 
mdbp
->env;

169 
dbc
 = 
ndbc
 = 
NULL
;

170 
p
 = 
NULL
;

178 
modify
 = (
ai
 !
MU_OPEN
 || 
	`LF_ISSET
(
DB_CREATE
)) ? 1 : 0;

180 i((
t
 = 
	`__db_curs
(
mdbp
, 

, 
txn
, &
dbc
,

181 (
	`CDB_LOCKING
(
v
&& 
modify
? 
DB_WRITECURSOR
 : 0)) != 0)

182  (
t
);

197 
	`DB_INIT_DBT
(
key
, 
subdb
, 
	`
(subdb));

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

199 
	`F_SET
(&
da
, 
DB_DBT_MALLOC
);

201 
t
 = 
	`__dbc_g
(
dbc
, &
key
, &
da
,

202 
DB_SET
 | ((
	`STD_LOCKING
(
dbc
&& 
modify
? 
DB_RMW
 : 0));

209 
ai
) {

210 
MU_REMOVE
:

217 i(
t
 != 0)

218 
r
;

224 i((
t
 = 
	`__dbc_d
(
dbc
, 0)) != 0)

225 
r
;

232 
	`memy
(&
sdbp
->
ma_pgno
, 
da
.da, (
db_pgno_t
));

233 
	`DB_NTOHL_SWAP
(
v
, &
sdbp
->
ma_pgno
);

234 i((
t
 = 
	`__memp_fg
(
mdbp
->
mpf
, &
sdbp
->
ma_pgno
,

235 

, 
dbc
->
txn
, 
DB_MPOOL_DIRTY
, &
p
)) != 0)

236 
r
;

239 i(
	`TYPE
(
p
=
P_BTREEMETA
 &&

240 ((
BTMETA
 *)
p
)->
ro
 !
PGNO_INVALID
) {

241 i((
t
 = 
	`__memp_fg
(
mdbp
->
mpf
,

242 &((
BTMETA
 *)
p
)->
ro
, 

, 
dbc
->
txn
,

243 
DB_MPOOL_DIRTY
, &
r
)) != 0)

244 
r
;

247 i((
t
 = 
	`__db_
(
dbc
, 
r
)) != 0) {

248 
r
 = 
NULL
;

249 
r
;

253 i((
t
 = 
	`__db_
(
dbc
, 
p
)) != 0) {

254 
p
 = 
NULL
;

255 
r
;

257 
p
 = 
NULL
;

259 
MU_RENAME
:

261 i(
t
 != 0)

262 
r
;

271 i((
t
 = 
	`__db_curs
(
mdbp
, 

, 
txn
, &
ndbc
,

272 
	`CDB_LOCKING
(
v
? 
DB_WRITECURSOR
 : 0)) != 0)

273 
r
;

274 
	`DB_SET_DBT
(
key
, 
wme
, 
	`
(newname));

280 
	`memt
(&
nda
, 0, (ndata));

281 
	`F_SET
(&
nda
, 
DB_DBT_USERMEM
 | 
DB_DBT_PARTIAL
);

283 i((
t
 = 
	`__dbc_g
(
ndbc
, &
key
, &
nda
, 
DB_SET
)) == 0) {

285 
t
 = 
EEXIST
;

286 
	`__db_rx
(
v
, "me: daba %exis", 
wme
);

287 
r
;

288 } i(
t
 !
DB_NOTFOUND
)

289 
r
;

296 i((
t
 = 
	`__dbc_put
(
ndbc
, &
key
, &
da
, 
DB_KEYFIRST
)) != 0)

297 
r
;

298 i((
t
 = 
	`__dbc_d
(
dbc
, 0)) != 0) {

303 ()
	`__dbc_d
(
ndbc
, 0);

304 
r
;

308 
MU_OPEN
:

313 
t
) {

315 i(
	`LF_ISSET
(
DB_CREATE
&& LF_ISSET(
DB_EXCL
)) {

316 
t
 = 
EEXIST
;

317 
r
;

319 
	`memy
(&
sdbp
->
ma_pgno
, 
da
.da, (
db_pgno_t
));

320 
	`DB_NTOHL_SWAP
(
v
, &
sdbp
->
ma_pgno
);

321 
de
;

322 
DB_NOTFOUND
:

323 i(
	`LF_ISSET
(
DB_CREATE
))

329 
t
 = 
ENOENT
;

330 
r
;

332 
r
;

336 i((
t
 = 
	`__db_w
(
dbc
,

337 
ty
 =
DB_HASH
 ? 
P_HASHMETA
 : 
P_BTREEMETA
, &
p
)) != 0)

338 
r
;

339 
sdbp
->
ma_pgno
 = 
	`PGNO
(
p
);

347 
t_pgno
 = 
	`PGNO
(
p
);

348 
	`DB_HTONL_SWAP
(
v
, &
t_pgno
);

349 
	`memt
(&
nda
, 0, (ndata));

350 
nda
.
da
 = &
t_pgno
;

351 
nda
.
size
 = (
db_pgno_t
);

352 i((
t
 = 
	`__dbc_put
(
dbc
, &
key
, &
nda
, 
DB_KEYLAST
)) != 0)

353 
r
;

354 
	`F_SET
(
sdbp
, 
DB_AM_CREATED
);

358 
r
:

359 
de
:

363 i(
p
 !
NULL
 && (
t_t
 = 
	`__memp_ut
(
mdbp
->
mpf
,

364 
dbc
->
thad_fo
, 
p
, dbc->
iܙy
)!0 && 
t
 == 0)

365 
t
 = 
t_t
;

368 i(
da
.d!
NULL
)

369 
	`__os_u
(
v
, 
da
.data);

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

371 
t
 = 
t_t
;

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

373 
t
 = 
t_t
;

375  (
t
);

376 
	}
}

386 
	$__v_tup
(
dbp
, 
txn
, 
ame
, 
dme
, 
id
, 
ags
)

387 
DB
 *
dbp
;

388 
DB_TXN
 *
txn
;

389 cڡ *
ame
, *
dme
;

390 
u_t32_t
 
id
, 
ags
;

392 
DB
 *
ldbp
;

393 
DB_ENV
 *
dbv
;

394 
ENV
 *
v
;

395 
u_t32_t
 
maxid
;

396 
t
;

398 
v
 = 
dbp
->env;

399 
dbv
 = 
v
->dbenv;

402 i(!
	`F_ISSET
(
v
, 
ENV_OPEN_CALLED
)) {

404 i(
dbv
->
mp_gbys
 == 0 &&

405 
dbv
->
mp_bys
 < 
dbp
->
pgsize
 * 
DB_MINPAGECACHE
 &&

406 (
t
 = 
	`__memp_t_chesize
(

407 
dbv
, 0, 
dbp
->
pgsize
 * 
DB_MINPAGECACHE
, 0)) != 0)

408  (
t
);

410 i((
t
 = 
	`__v_ݒ
(
dbv
, 
NULL
, 
DB_CREATE
 |

411 
DB_INIT_MPOOL
 | 
DB_PRIVATE
 | 
	`LF_ISSET
(
DB_THREAD
), 0)) != 0)

412  (
t
);

416 i((!
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
|| 
dme
 =
NULL
) &&

417 (
t
 = 
	`__v_mpo
(
dbp
, 
ame
, 
ags
)) != 0)

418  (
t
);

421 i(
	`LF_ISSET
(
DB_THREAD
&& (
t
 = 
	`__mux_loc
(

422 
v
, 
MTX_DB_HANDLE
, 
DB_MUTEX_PROCESS_ONLY
, &
dbp
->
mux
)) != 0)

423  (
t
);

431 i(
	`LOGGING_ON
(
v
&& 
dbp
->
log_fame
 =
NULL


432 #i!
	`defed
(
DEBUG_ROP
&& !defed(
DEBUG_WOP
&& !defed(
DIAGNOSTIC
)

433 && (
txn
 !
NULL
 || 
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
))

435 #i!
	`defed
(
DEBUG_ROP
)

436 && !
	`F_ISSET
(
dbp
, 
DB_AM_RDONLY
)

439 i((
t
 = 
	`__dbg_tup
(
dbp
,

440 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
? 
dme
 : 
ame
,

441 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
? 
NULL
 : 
dme
, 
id
)) != 0)

442  (
t
);

449 i(
	`DBENV_LOGGING
(
v
&& !
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
) &&

450 (
t
 = 
	`__dbg_w_id
(
dbp
, 
txn
)) != 0)

451  (
t
);

463 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

464 
maxid
 = 0;

465 
	`TAILQ_FOREACH
(
ldbp
, &
v
->
dbli
, 
dblilks
) {

471 i(!
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
)) {

472 i(
	`memcmp
(
ldbp
->
feid
, 
dbp
->feid, 
DB_FILE_ID_LEN
)

473 =0 && 
ldbp
->
ma_pgno
 =
dbp
->meta_pgno)

475 } i(
dme
 !
NULL
) {

476 i(
	`F_ISSET
(
ldbp
, 
DB_AM_INMEM
) &&

477 
ldbp
->
dme
 !
NULL
 &&

478 
	`rcmp
(
ldbp
->
dme
, dname) == 0)

481 i(
ldbp
->
adj_feid
 > 
maxid
)

482 
maxid
 = 
ldbp
->
adj_feid
;

494 i(
ldbp
 =
NULL
) {

495 
dbp
->
adj_feid
 = 
maxid
 + 1;

496 
	`TAILQ_INSERT_HEAD
(&
v
->
dbli
, 
dbp
, 
dblilks
);

498 
dbp
->
adj_feid
 = 
ldbp
->adj_fileid;

499 
	`TAILQ_INSERT_AFTER
(&
v
->
dbli
, 
ldbp
, 
dbp
, 
dblilks
);

501 
	`MUTEX_UNLOCK
(
v
,nv->
mtx_dbli
);

504 
	}
}

513 
	$__v_mpo
(
dbp
, 
ame
, 
ags
)

514 
DB
 *
dbp
;

515 cڡ *
ame
;

516 
u_t32_t
 
ags
;

518 
DBT
 
pgcook
;

519 
DB_MPOOLFILE
 *
mpf
;

520 
DB_PGINFO
 
pgfo
;

521 
ENV
 *
v
;

522 
fidt
, 
y
, 
t
;

523 
t32_t
 
l_off
;

524 
u_t8_t
 
nufid
[
DB_FILE_ID_LEN
];

525 
u_t32_t
 
r_n
;

527 
v
 = 
dbp
->env;

530 
l_off
 = 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_LSN_OFF_NOTSET
 : 0;

533 i(
	`F_ISSET
(
dbp
, 
DB_AM_OPEN_CALLED
))

544 
dbp
->
ty
) {

545 
DB_BTREE
:

546 
DB_RECNO
:

547 
y
 = 
	`F_ISSET
(
dbp
, 
DB_AM_SWAP
 | 
DB_AM_ENCRYPT
 | 
DB_AM_CHKSUM
)

548 ? 
DB_FTYPE_SET
 : 
DB_FTYPE_NOTSET
;

549 
r_n
 = 
	`CRYPTO_ON
(
v
) ?

550 (
dbp
->
pgsize
 !0 ? dbp->pgsiz: 
DB_CLEARLEN_NOTSET
) :

551 
DB_PAGE_DB_LEN
;

553 
DB_HASH
:

554 
y
 = 
DB_FTYPE_SET
;

555 
r_n
 = 
	`CRYPTO_ON
(
v
) ?

556 (
dbp
->
pgsize
 !0 ? dbp->pgsiz: 
DB_CLEARLEN_NOTSET
) :

557 
DB_PAGE_DB_LEN
;

559 
DB_QUEUE
:

560 
y
 = 
	`F_ISSET
(
dbp
,

561 
DB_AM_SWAP
 | 
DB_AM_ENCRYPT
 | 
DB_AM_CHKSUM
) ?

562 
DB_FTYPE_SET
 : 
DB_FTYPE_NOTSET
;

570 
r_n
 = 
dbp
->
pgsize
 !0 ? dbp->pgsiz: 
DB_CLEARLEN_NOTSET
;

572 
DB_UNKNOWN
:

585 i(
	`F_ISSET
(
dbp
, 
DB_AM_VERIFYING
)) {

586 
y
 = 
DB_FTYPE_NOTSET
;

587 
r_n
 = 
DB_PAGE_DB_LEN
;

596 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
)) {

597 
r_n
 = 
DB_CLEARLEN_NOTSET
;

598 
y
 = 
DB_FTYPE_NOTSET
;

599 
l_off
 = 
DB_LSN_OFF_NOTSET
;

604  (
	`__db_unknown_ty
(
v
, "DB->ݒ", 
dbp
->
ty
));

607 
mpf
 = 
dbp
->mpf;

609 
	`memt
(
nufid
, 0, 
DB_FILE_ID_LEN
);

610 
fidt
 = 
	`memcmp
(
nufid
, 
dbp
->
feid
, 
DB_FILE_ID_LEN
);

611 i(
fidt
)

612 ()
	`__memp_t_feid
(
mpf
, 
dbp
->
feid
);

614 ()
	`__memp_t_r_n
(
mpf
, 
r_n
);

615 ()
	`__memp_t_y
(
mpf
, 
y
);

616 ()
	`__memp_t_l_offt
(
mpf
, 
l_off
);

618 
pgfo
.
db_gesize
 = 
dbp
->
pgsize
;

619 
pgfo
.
ags
 =

620 
	`F_ISSET
(
dbp
, (
DB_AM_CHKSUM
 | 
DB_AM_ENCRYPT
 | 
DB_AM_SWAP
));

621 
pgfo
.
ty
 = 
dbp
->type;

622 
pgcook
.
da
 = &
pgfo
;

623 
pgcook
.
size
 = (
DB_PGINFO
);

624 ()
	`__memp_t_pgcook
(
mpf
, &
pgcook
);

626 #ide
DIAG_MVCC


627 i(
	`F_ISSET
(
v
->
dbv
, 
DB_ENV_MULTIVERSION
))

629 i(
	`F_ISSET
(
dbp
, 
DB_AM_TXN
) &&

630 
dbp
->
ty
 !
DB_QUEUE
 && dbp->ty !
DB_UNKNOWN
)

631 
	`LF_SET
(
DB_MULTIVERSION
);

633 i((
t
 = 
	`__memp_fݒ
(
mpf
, 
NULL
, 
ame
,

634 
	`LF_ISSET
(
DB_CREATE
 | 
DB_DURABLE_UNKNOWN
 | 
DB_MULTIVERSION
 |

635 
DB_NOMMAP
 | 
DB_ODDFILESIZE
 | 
DB_RDONLY
 | 
DB_TRUNCATE
) |

636 (
	`F_ISSET
(
v
->
dbv
, 
DB_ENV_DIRECT_DB
? 
DB_DIRECT
 : 0) |

637 (
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
? 
DB_TXN_NOT_DURABLE
 : 0),

638 0, 
dbp
->
pgsize
)) != 0) {

643 ()
	`__memp_fo
(
dbp
->
mpf
, 0);

644 ()
	`__memp_f
(
v
, &
dbp
->
mpf
);

645 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
))

646 
	`MAKE_INMEM
(
dbp
);

647  (
t
);

657 
	`F_SET
(
dbp
, 
DB_AM_OPEN_CALLED
);

658 i(!
fidt
 && 
ame
 !
NULL
) {

659 ()
	`__memp_g_feid
(
dbp
->
mpf
, dbp->
feid
);

660 
dbp
->
erve_fid
 = 1;

664 
	}
}

673 
	$__db_o
(
dbp
, 
txn
, 
ags
)

674 
DB
 *
dbp
;

675 
DB_TXN
 *
txn
;

676 
u_t32_t
 
ags
;

678 
ENV
 *
v
;

679 
db_f
, 
deed_o
, 
t
, 
t_t
;

681 
v
 = 
dbp
->env;

682 
deed_o
 = 
t
 = 0;

691 i(
txn
 !
NULL
)

692 ()
	`__db_check_txn
(
dbp
, 
txn
, 
DB_LOCK_INVALIDID
, 0);

695 
t
 = 
	`__db_esh
(
dbp
, 
txn
, 
ags
, &
deed_o
, 0);

701 i(
deed_o
)

702  (
t
);

715 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

716 
db_f
 = --
v
->db_ref;

717 
	`MUTEX_UNLOCK
(
v
,nv->
mtx_dbli
);

718 i(
	`F_ISSET
(
v
, 
ENV_DBLOCAL
&& 
db_f
 == 0 &&

719 (
t_t
 = 
	`__v_o
(
v
->
dbv
, 0)!0 && 
t
 == 0)

720 
t
 = 
t_t
;

723 
	`memt
(
dbp
, 
CLEAR_BYTE
, (*dbp));

724 
	`__os_
(
v
, 
dbp
);

726  (
t
);

727 
	}
}

740 
	$__db_esh
(
dbp
, 
txn
, 
ags
, 
deed_op
, 
u
)

741 
DB
 *
dbp
;

742 
DB_TXN
 *
txn
;

743 
u_t32_t
 
ags
;

744 *
deed_op
, 
u
;

746 
DB
 *
sdbp
;

747 
DBC
 *
dbc
;

748 
DB_FOREIGN_INFO
 *
f_fo
, *
tmp
;

749 
DB_LOCKER
 *
lock
;

750 
DB_LOCKREQ
 
eq
;

751 
ENV
 *
v
;

752 
REGENV
 *
nv
;

753 
REGINFO
 *
f
;

754 
u_t32_t
 
ve_ags
;

755 
sync
, 
t
, 
t_t
;

757 
t
 = 0;

759 
v
 = 
dbp
->env;

760 
f
 = 
v
->
gfo
;

761 i(
f
 !
NULL
)

762 
nv
 = 
f
->
imy
;

764 
nv
 = 
NULL
;

770 i(
dbp
->
mpf
 =
NULL
)

771 
	`LF_SET
(
DB_NOSYNC
);

774 i(!
	`F_ISSET
(
dbp
, 
DB_AM_OPEN_CALLED
))

775 
v_ݒed
;

786 
	`LIST_FOREACH
(
sdbp
, &
dbp
->
s_cds
, 
s_lks
) {

787 
	`LIST_REMOVE
(
sdbp
, 
s_lks
);

788 i((
t_t
 = 
	`__db_dissoc
(
sdbp
)!0 && 
t
 == 0)

789 
t
 = 
t_t
;

796 
f_fo
 = 
	`LIST_FIRST
(&
dbp
->
f_ims
);

797 
f_fo
 !
NULL
) {

798 
tmp
 = 
	`LIST_NEXT
(
f_fo
, 
f_lks
);

799 
	`LIST_REMOVE
(
f_fo
, 
f_lks
);

800 
f_fo
->
dbp
->
s_feign
 = 
NULL
;

801 
	`__os_
(
v
, 
f_fo
);

802 
f_fo
 = 
tmp
;

805 i(
dbp
->
s_feign
 !
NULL
 &&

806 (
t_t
 = 
	`__db_dissoc_feign
(
dbp
)!0 && 
t
 == 0)

807 
t
 = 
t_t
;

818 i(!
	`LF_ISSET
(
DB_NOSYNC
) &&

819 !
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
 | 
DB_AM_RECOVER
) &&

820 (
t_t
 = 
	`__db_sync
(
dbp
)!0 && 
t
 == 0)

821 
t
 = 
t_t
;

830 
sync
 = 
	`TAILQ_FIRST
(&
dbp
->
aive_queue
=
NULL
 ? 0 : 1;

831 (
dbc
 = 
	`TAILQ_FIRST
(&
dbp
->
aive_queue
)!
NULL
)

832 i((
t_t
 = 
	`__dbc_o
(
dbc
)) != 0) {

833 i(
t
 == 0)

834 
t
 = 
t_t
;

838 (
dbc
 = 
	`TAILQ_FIRST
(&
dbp
->
_queue
)!
NULL
)

839 i((
t_t
 = 
	`__dbc_deroy
(
dbc
)) != 0) {

840 i(
t
 == 0)

841 
t
 = 
t_t
;

850 (
dbc
 = 
	`TAILQ_FIRST
(&
dbp
->
jo_queue
)!
NULL
)

851 i((
t_t
 = 
	`__db_jo_o
(
dbc
)) != 0) {

852 i(
t
 == 0)

853 
t
 = 
t_t
;

866 i(
sync
 && !
	`LF_ISSET
(
DB_NOSYNC
) &&

867 !
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
 | 
DB_AM_RECOVER
) &&

868 (
t_t
 = 
	`__memp_fsync
(
dbp
->
mpf
)!0 && 
t
 == 0)

869 
t
 = 
t_t
;

871 
v_ݒed
:

883 i(!
u
 && 
	`LOGGING_ON
(
dbp
->
v
&& dbp->
log_fame
 !
NULL
) {

889 
	`DB_ASSERT
(
v
, 
nv
 !
NULL
);

890 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
|| 
	`IS_REP_CLIENT
(
v
) ||

891 
dbp
->
timeamp
 !
nv
->
p_timeamp
) {

892 i((
t_t
 = 
	`__dbg_voke_id
(
dbp
,

893 0, 
DB_LOGFILEID_INVALID
)=0 && 
t
 == 0)

894 
t
 = 
t_t
;

895 i((
t_t
 = 
	`__dbg_down
(
dbp
)!0 && 
t
 == 0)

896 
t
 = 
t_t
;

898 i((
t_t
 = 
	`__dbg_o_id
(
dbp
,

899 
txn
, 
DBREG_CLOSE
)!0 &&x!
NULL
) {

912 i((
t
 =

913 
	`__txn_oevt
(
v
, 
txn
, 
dbp
)) != 0)

914  (
	`__v_nic
(
v
, 
t
));

915 i(
deed_op
 !
NULL
)

916 *
deed_op
 = 1;

917  (
t_t
);

935 i(
dbp
->
ved_ݒ_fhp
 !
NULL
 &&

936 (
t_t
 = 
	`__os_ohd
(
v
, 
dbp
->
ved_ݒ_fhp
)) != 0 &&

937 
t
 == 0)

938 
t
 = 
t_t
;

951 
	`MUTEX_LOCK
(
v
,nv->
mtx_dbli
);

952 i(!
u
 &&

953 (
dbp
->
dblilks
.
tqe_xt
 !
NULL
 ||

954 
dbp
->
dblilks
.
tqe_ev
 !
NULL
)) {

955 
	`TAILQ_REMOVE
(&
v
->
dbli
, 
dbp
, 
dblilks
);

956 
dbp
->
dblilks
.
tqe_xt
 = 
NULL
;

957 
dbp
->
dblilks
.
tqe_ev
 = 
NULL
;

961 i(
dbp
->
mpf
 !
NULL
) {

962 i((
t_t
 = 
	`__memp_fo
(
dbp
->
mpf
,

963 
	`F_ISSET
(
dbp
, 
DB_AM_DISCARD
? 
DB_MPOOL_DISCARD
 : 0)) != 0 &&

964 
t
 == 0)

965 
t
 = 
t_t
;

966 
dbp
->
mpf
 = 
NULL
;

967 i(
u
 &&

968 (
t_t
 = 
	`__memp_f
(
v
, &
dbp
->
mpf
)) != 0 &&

969 
t
 == 0)

970 
t
 = 
t_t
;

973 
	`MUTEX_UNLOCK
(
v
,nv->
mtx_dbli
);

995 i((
t_t
 = 
	`__bam_db_o
(
dbp
)!0 && 
t
 == 0)

996 
t
 = 
t_t
;

997 i((
t_t
 = 
	`__ham_db_o
(
dbp
)!0 && 
t
 == 0)

998 
t
 = 
t_t
;

999 i((
t_t
 = 
	`__qam_db_o
(
dbp
, dbp->
ags
)!0 && 
t
 == 0)

1000 
t
 = 
t_t
;

1009 i(!
u
 && 
dbp
->
lock
 !
NULL
) {

1011 i(
txn
 =
NULL
)

1012 
txn
 = 
dbp
->
cur_txn
;

1013 i(
	`IS_REAL_TXN
(
txn
))

1014 
	`__txn_mlock
(
v
,

1015 
txn
, &
dbp
->
hd_lock
, dbp->
lock
);

1018 
eq
.

 = 
DB_LOCK_PUT_ALL
;

1019 
eq
.
obj
 = 
NULL
;

1020 i((
t_t
 = 
	`__lock_vec
(
v
,

1021 
dbp
->
lock
, 0, &
eq
, 1, 
NULL
)!0 && 
t
 == 0)

1022 
t
 = 
t_t
;

1024 i((
t_t
 =

1025 
	`__lock_id_
(
v
, 
dbp
->
lock
)!0 && 
t
 == 0)

1026 
t
 = 
t_t
;

1027 
dbp
->
lock
 = 
NULL
;

1028 
	`LOCK_INIT
(
dbp
->
hd_lock
);

1035 i(
	`LOCKING_ON
(
v
) &&

1036 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
&& !dbp->
erve_fid
 &&

1037 *(
u_t32_t
 *)
dbp
->
feid
 !
DB_LOCK_INVALIDID
) {

1038 i((
t_t
 = 
	`__lock_glock
(
v
->
lk_hd
,

1039 *(
u_t32_t
 *)
dbp
->
feid
, 0, &
lock
)) == 0)

1040 
t_t
 = 
	`__lock_id_
(
v
, 
lock
);

1041 i(
t
 == 0)

1042 
t
 = 
t_t
;

1045 i(
u
) {

1052 
ve_ags
 = 
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
 | 
DB_AM_TXN
);

1058 i((
t
 = 
	`__bam_db_
(
dbp
)) != 0)

1059  (
t
);

1060 i((
t
 = 
	`__ham_db_
(
dbp
)) != 0)

1061  (
t
);

1062 i((
t
 = 
	`__qam_db_
(
dbp
)) != 0)

1063  (
t
);

1066 
dbp
->
ags
 = dbp->
ig_ags
 | 
ve_ags
;

1068 i(
	`FLD_ISSET
(
ve_ags
, 
DB_AM_INMEM
)) {

1074 
	`memt
(
dbp
->
feid
, 0, (dbp->fileid));

1075 
	`MAKE_INMEM
(
dbp
);

1077  (
t
);

1080 
dbp
->
ty
 = 
DB_UNKNOWN
;

1086 i((
t_t
 = 
	`__mux_
(
v
, &
dbp
->
mux
)!0 && 
t
 == 0)

1087 
t
 = 
t_t
;

1090 i(
dbp
->
ame
 !
NULL
) {

1091 
	`__os_
(
dbp
->
v
, dbp->
ame
);

1092 
dbp
->
ame
 = 
NULL
;

1094 i(
dbp
->
dme
 !
NULL
) {

1095 
	`__os_
(
dbp
->
v
, dbp->
dme
);

1096 
dbp
->
dme
 = 
NULL
;

1100 i(
dbp
->
my_rskey
.
da
 !
NULL
)

1101 
	`__os_
(
dbp
->
v
, dbp->
my_rskey
.
da
);

1102 i(
dbp
->
my_rkey
.
da
 !
NULL
)

1103 
	`__os_
(
dbp
->
v
, dbp->
my_rkey
.
da
);

1104 i(
dbp
->
my_rda
.
da
 !
NULL
)

1105 
	`__os_
(
dbp
->
v
, dbp->
my_rda
.
da
);

1108 
	`memt
(&
dbp
->
my_rskey
, 0, (
DBT
));

1109 
	`memt
(&
dbp
->
my_rkey
, 0, (
DBT
));

1110 
	`memt
(&
dbp
->
my_rda
, 0, (
DBT
));

1113 
	`memt
(
dbp
->
feid
, 0, (dbp->fileid));

1114 
dbp
->
adj_feid
 = 0;

1115 
dbp
->
ma_pgno
 = 0;

1116 
dbp
->
cur_lock
 = 
NULL
;

1117 
dbp
->
cur_txn
 = 
NULL
;

1118 
dbp
->
assoc_lock
 = 
NULL
;

1119 
dbp
->
_id
 = 0;

1120 
dbp
->
ݒ_ags
 = 0;

1129 i(
txn
 !
NULL
)

1130 
	`LOCK_INIT
(
dbp
->
hd_lock
);

1133 
dbp
->
ags
 = dbp->
ig_ags
;

1135  (
t
);

1136 
	}
}

1143 
	$__db_dissoc
(
sdbp
)

1144 
DB
 *
sdbp
;

1146 
DBC
 *
dbc
;

1147 
t
, 
t_t
;

1149 
t
 = 0;

1151 
sdbp
->
s_back
 = 
NULL
;

1152 
sdbp
->
s_imy
 = 
NULL
;

1153 
sdbp
->
g
 = sdbp->
ed_g
;

1154 
sdbp
->
o
 = sdbp->
ed_o
;

1160 i(
sdbp
->
s_ft
 != 1 ||

1161 
	`TAILQ_FIRST
(&
sdbp
->
aive_queue
!
NULL
 ||

1162 
	`TAILQ_FIRST
(&
sdbp
->
jo_queue
!
NULL
) {

1163 
	`__db_rx
(
sdbp
->
v
,

1165 
t
 = 
EINVAL
;

1167 
sdbp
->
s_ft
 = 0;

1169 (
dbc
 = 
	`TAILQ_FIRST
(&
sdbp
->
_queue
)!
NULL
)

1170 i((
t_t
 = 
	`__dbc_deroy
(
dbc
)!0 && 
t
 == 0)

1171 
t
 = 
t_t
;

1173 
	`F_CLR
(
sdbp
, 
DB_AM_SECONDARY
);

1174  (
t
);

1175 
	}
}

1182 
	$__db_dissoc_feign
(
sdbp
)

1183 
DB
 *
sdbp
;

1185 
DB
 *
fdbp
;

1186 
DB_FOREIGN_INFO
 *
f_fo
, *
tmp
;

1187 
t
;

1189 i(
sdbp
->
s_feign
 =
NULL
)

1191 i((
t
 = 
	`__os_mloc
(
sdbp
->
v
, (
DB_FOREIGN_INFO
), &
tmp
)) != 0)

1192  (
t
);

1194 
fdbp
 = 
sdbp
->
s_feign
;

1195 
t
 = 0;

1196 
f_fo
 = 
	`LIST_FIRST
(&
fdbp
->
f_ims
);

1197 
f_fo
 !
NULL
) {

1198 
tmp
 = 
	`LIST_NEXT
(
f_fo
, 
f_lks
);

1199 i(
f_fo
 ->
dbp
 =
sdbp
) {

1200 
	`LIST_REMOVE
(
f_fo
, 
f_lks
);

1201 
	`__os_
(
sdbp
->
v
, 
f_fo
);

1203 
f_fo
 = 
tmp
;

1206  (
t
);

1207 
	}
}

1216 
	$__db_log_ge
(
dbp
, 
txn
, 
l
, 
pgno
, 
ge
)

1217 
DB
 *
dbp
;

1218 
DB_TXN
 *
txn
;

1219 
DB_LSN
 *
l
;

1220 
db_pgno_t
 
pgno
;

1221 
PAGE
 *
ge
;

1223 
DBT
 
ge_dbt
;

1224 
DB_LSN
 
w_l
;

1225 
t
;

1227 i(!
	`LOGGING_ON
(
dbp
->
v
|| 
txn
 =
NULL
)

1230 
	`memt
(&
ge_dbt
, 0, (page_dbt));

1231 
ge_dbt
.
size
 = 
dbp
->
pgsize
;

1232 
ge_dbt
.
da
 = 
ge
;

1234 
t
 = 
	`__d_masub_log
(
dbp
, 
txn
, &
w_l
, 0, 
pgno
, &
ge_dbt
, 
l
);

1236 i(
t
 == 0)

1237 
ge
->
l
 = 
w_l
;

1238  (
t
);

1239 
	}
}

1248 #unde
BACKUP_PREFIX


1249 
	#BACKUP_PREFIX
 "__db."

	)

1251 #unde
MAX_INT_TO_HEX


1252 
	#MAX_INT_TO_HEX
 8

	)

1255 
	$__db_backup_me
(
v
, 
me
, 
txn
, 
backup
)

1256 
ENV
 *
v
;

1257 cڡ *
me
;

1258 
DB_TXN
 *
txn
;

1259 **
backup
;

1261 
u_t32_t
 
id
;

1262 
size_t
 
n
;

1263 
t
;

1264 *
p
, *

;

1266 *
backup
 = 
NULL
;

1273 
n
 = 
	`
(
me
+ sn(
BACKUP_PREFIX
+ 2 * 
MAX_INT_TO_HEX
 + 1;

1274 i((
t
 = 
	`__os_mloc
(
v
, 
n
, &

)) != 0)

1275  (
t
);

1292 
p
 = 
	`__db_h
(
me
);

1293 i(
	`IS_REAL_TXN
(
txn
)) {

1294 
	`__os_unique_id
(
v
, &
id
);

1295 i(
p
 =
NULL
)

1296 
	`tf
(

, 
n
, "%s%x.%x",

1297 
BACKUP_PREFIX
, 
txn
->
txnid
, 
id
);

1299 
	`tf
(

, 
n
, "%.*s%x.%x",

1300 ()(
p
 - 
me
+ 1,ame, 
txn
->
txnid
, 
id
);

1302 i(
p
 =
NULL
)

1303 
	`tf
(

, 
n
, "%s%s", 
BACKUP_PREFIX
, 
me
);

1305 
	`tf
(

, 
n
, "%.*s%s%s",

1306 ()(
p
 - 
me
+ 1,ame, 
BACKUP_PREFIX
, + 1);

1309 *
backup
 = 

;

1311 
	}
}

1313 #ifde
CONFIG_TEST


1323 
	$__db_cy
(
v
, 
dbp
, 
me
)

1324 
ENV
 *
v
;

1325 
DB
 *
dbp
;

1326 cڡ *
me
;

1328 
DB_MPOOL
 *
dbmp
;

1329 
DB_MPOOLFILE
 *
mpf
;

1331 
	`DB_ASSERT
(
v
, 
dbp
 !
NULL
 || 
me
 != NULL);

1333 i(
me
 =
NULL
) {

1334 
dbmp
 = 
v
->
mp_hd
;

1335 
mpf
 = 
dbp
->mpf;

1336 
me
 = 
	`R_ADDR
(
dbmp
->
gfo
, 
mpf
->
m
->
th_off
);

1339 i(
dbp
 !
NULL
 && dbp->
ty
 =
DB_QUEUE
)

1340  (
	`__qam_docy
(
dbp
, 
me
));

1342  (
	`__db_docy
(
v
, 
me
));

1343 
	}
}

1346 
	$__qam_docy
(
dbp
, 
me
)

1347 
DB
 *
dbp
;

1348 cڡ *
me
;

1350 
DB_THREAD_INFO
 *

;

1351 
QUEUE_FILELIST
 *
fi
, *

;

1352 
t
;

1353 
buf
[
DB_MAXPATHLEN
], *
d
;

1355 
fi
 = 
NULL
;

1356 i((
t
 = 
	`__db_docy
(
dbp
->
v
, 
me
)) != 0)

1357  (
t
);

1360 
	`ENV_GET_THREAD_INFO
(
dbp
->
v
, 

);

1361 i(
dbp
->
mpf
 !
NULL
 &&

1362 (
t
 = 
	`__qam_g_fi
(
dbp
, 

, &
fi
)) != 0)

1363 
de
;

1365 i(
fi
 =
NULL
)

1367 
d
 = ((
QUEUE
 *)
dbp
->
q_
)->dir;

1368 

 = 
fi
; fp->
mpf
 !
NULL
; fp++) {

1369 
	`tf
(
buf
, (buf),

1370 
QUEUE_EXTENT
, 
d
, 
PATH_SEPARATOR
[0], 
me
, 

->
id
);

1371 i((
t
 = 
	`__db_docy
(
dbp
->
v
, 
buf
)) != 0)

1372  (
t
);

1375 
de
: 
	`__os_
(
dbp
->
v
, 
fi
);

1377 
	}
}

1384 
	$__db_docy
(
v
, 
me
)

1385 
ENV
 *
v
;

1386 cڡ *
me
;

1388 
size_t
 
n
;

1389 
dt
, 
i
, 
t
;

1390 *
cy
, **
me
, *
p
, *
_me
;

1392 
dt
 = 0;

1393 
cy
 = 
NULL
;

1394 
me
 = 
NULL
;

1397 i((
t
 = 
	`__db_ame
(
v
,

1398 
DB_APP_DATA
, 
me
, 0, 
NULL
, &
_me
)) != 0)

1399  (
t
);

1407 i(
	`__os_exis
(
v
, 
_me
, 
NULL
) != 0) {

1408 
	`__os_
(
v
, 
_me
);

1418 
n
 = 
	`
(
_me
) + (".afterop");

1419 i((
t
 = 
	`__os_mloc
(
v
, 
n
, &
cy
)) != 0)

1420 
r
;

1421 
	`tf
(
cy
, 
n
, "%s.a", 
_me
);

1422 i((
t
 = 
	`__db_makecy
(
v
, 
_me
, 
cy
)) != 0)

1423 
r
;

1428 i((
p
 = 
	`__db_h
(
_me
)!
NULL
)

1429 *
p
 = '\0';

1430 i((
t
 = 
	`__os_dli
(
v
, 
_me
, 0, &
me
, &
dt
)) != 0)

1431 
r
;

1439 
i
 = 0; i < 
dt
; i++) {

1441 i(
	`cmp
(

1442 
me
[
i
], 
BACKUP_PREFIX
, (BACKUP_PREFIX) - 1) != 0)

1444 
p
 = 
me
[
i
] + (
BACKUP_PREFIX
);

1445 
p
 +
	`rn
(p, "0123456789ABCDEFabcdef");

1446 i(*
p
 != '.')

1448 ++
p
;

1449 
p
 +
	`rn
(p, "0123456789ABCDEFabcdef");

1450 i(*
p
 != '\0')

1459 i(
_me
 !
NULL
) {

1460 
	`__os_
(
v
, 
_me
);

1461 
_me
 = 
NULL
;

1463 i((
t
 = 
	`__db_ame
(

1464 
v
, 
DB_APP_DATA
, 
me
[
i
], 0, 
NULL
, &
_me
)) != 0)

1465 
r
;

1466 i(
cy
 !
NULL
) {

1467 
	`__os_
(
v
, 
cy
);

1468 
cy
 = 
NULL
;

1470 
n
 = 
	`
(
_me
) + (".afterop");

1471 i((
t
 = 
	`__os_mloc
(
v
, 
n
, &
cy
)) != 0)

1472 
r
;

1473 
	`tf
(
cy
, 
n
, "%s.a", 
_me
);

1474 i((
t
 = 
	`__db_makecy
(
v
, 
_me
, 
cy
)) != 0)

1475 
r
;

1478 
r
: i(
me
 !
NULL
)

1479 
	`__os_d
(
v
, 
me
, 
dt
);

1480 i(
cy
 !
NULL
)

1481 
	`__os_
(
v
, 
cy
);

1482 i(
_me
 !
NULL
)

1483 
	`__os_
(
v
, 
_me
);

1484  (
t
);

1485 
	}
}

1488 
	$__db_makecy
(
v
, 
c
, 
de
)

1489 
ENV
 *
v
;

1490 cڡ *
c
, *
de
;

1492 
DB_FH
 *
rfhp
, *
wfhp
;

1493 
size_t
 
rt
, 
wt
;

1494 
t
;

1495 *
buf
;

1497 
rfhp
 = 
wfhp
 = 
NULL
;

1499 i((
t
 = 
	`__os_mloc
(
v
, 64 * 1024, &
buf
)) != 0)

1500 
r
;

1502 i((
t
 = 
	`__os_ݒ
(
v
, 
c
, 0,

1503 
DB_OSO_RDONLY
, 
DB_MODE_600
, &
rfhp
)) != 0)

1504 
r
;

1505 i((
t
 = 
	`__os_ݒ
(
v
, 
de
, 0,

1506 
DB_OSO_CREATE
 | 
DB_OSO_TRUNC
, 
DB_MODE_600
, &
wfhp
)) != 0)

1507 
r
;

1510 i((
t
 =

1511 
	`__os_ad
(
v
, 
rfhp
, 
buf
, (buf), &
rt
)) != 0)

1512 
r
;

1513 i(
rt
 == 0)

1515 i((
t
 =

1516 
	`__os_wre
(
v
, 
wfhp
, 
buf
, (buf), &
wt
)) != 0)

1517 
r
;

1521 
r
: 
	`__db_r
(
v
, 
t
, "__db_makecy: %-> %s", 
c
, 
de
);

1524 i(
buf
 !
NULL
)

1525 
	`__os_
(
v
, 
buf
);

1526 i(
rfhp
 !
NULL
)

1527 ()
	`__os_ohd
(
v
, 
rfhp
);

1528 i(
wfhp
 !
NULL
)

1529 ()
	`__os_ohd
(
v
, 
wfhp
);

1530  (
t
);

1531 
	}
}

	@../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
, 
ags
, 
lock
, 
db
)

35 
DB
 *
dbp
;

36 
DB_THREAD_INFO
 *

;

37 
DB_TXN
 *
txn
;

38 
DBTYPE
 
dbty
;

39 
db_pgno_t
 
ro
;

40 
ags
;

41 
DB_LOCKER
 *
lock
;

42 
DBC
 **
db
;

44 
DBC
 *
dbc
;

45 
DBC_INTERNAL
 *

;

46 
ENV
 *
v
;

47 
db_thadid_t
 
tid
;

48 
lod
, 
t
;

49 
pid_t
 
pid
;

51 
v
 = 
dbp
->env;

52 
lod
 = 0;

62 
	`MUTEX_LOCK
(
v
, 
dbp
->
mux
);

64 #ide
HAVE_NO_DB_REFCOUNT


74 i(
txn
 !
NULL
 &&

75 !
	`LF_ISSET
(
DBC_OPD
|
DBC_DUPLICATE
&& !
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
) &&

76 
dbp
->
log_fame
 !
NULL
 && !
	`IS_REP_CLIENT
(
v
) &&

77 (
t
 = 
	`__txn_cd_ame
(
v
, 
txn
, 
dbp
->
log_fame
)) != 0)

78  (
t
);

81 
	`TAILQ_FOREACH
(
dbc
, &
dbp
->
_queue
, 
lks
)

82 i(
dbty
 =
dbc
->dbtype) {

83 
	`TAILQ_REMOVE
(&
dbp
->
_queue
, 
dbc
, 
lks
);

84 
	`F_CLR
(
dbc
, ~
DBC_OWN_LID
);

87 
	`MUTEX_UNLOCK
(
v
, 
dbp
->
mux
);

89 i(
dbc
 =
NULL
) {

90 i((
t
 = 
	`__os_oc
(
v
, 1, (
DBC
), &
dbc
)) != 0)

91  (
t
);

92 
lod
 = 1;

93 
dbc
->
ags
 = 0;

95 
dbc
->
dbp
 = dbp;

96 
dbc
->
dbv
 = 
dbp
->dbenv;

97 
dbc
->
v
 = 
dbp
->env;

100 i(
	`LOCKING_ON
(
v
)) {

111 i(!
	`DB_IS_THREADED
(
dbp
)) {

112 i(
v
->
v_ef
 =
NULL
 && (
t
 =

113 
	`__lock_id
(
v
, 
NULL
, &v->
v_ef
)) != 0)

114 
r
;

115 
dbc
->
ef
 = 
v
->
v_ef
;

117 i((
t
 =

118 
	`__lock_id
(
v
, 
NULL
, &
dbc
->
ef
)) != 0)

119 
r
;

120 
	`F_SET
(
dbc
, 
DBC_OWN_LID
);

136 i(
	`CDB_LOCKING
(
v
) &&

137 
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
))

138 
	`memy
(
dbc
->
lock
.
feid
,

139 
dbp
->
s_imy
->
feid
, 
DB_FILE_ID_LEN
);

141 
	`memy
(
dbc
->
lock
.
feid
,

142 
dbp
->
feid
, 
DB_FILE_ID_LEN
);

144 i(
	`CDB_LOCKING
(
v
)) {

145 i(
	`F_ISSET
(
v
->
dbv
, 
DB_ENV_CDB_ALLDB
)) {

152 
	`DB_ASSERT
(
v
, (
db_pgno_t
) ==

153 (
u_t32_t
));

154 
dbc
->
lock_dbt
.
size
 = (
u_t32_t
);

155 
dbc
->
lock_dbt
.
da
 = &dbc->
lock
.
pgno
;

156 
dbc
->
lock
.
pgno
 = 0;

158 
dbc
->
lock_dbt
.
size
 = 
DB_FILE_ID_LEN
;

159 
dbc
->
lock_dbt
.
da
 = dbc->
lock
.
feid
;

162 
dbc
->
lock
.
ty
 = 
DB_PAGE_LOCK
;

163 
dbc
->
lock_dbt
.
size
 = (dbc->
lock
);

164 
dbc
->
lock_dbt
.
da
 = &dbc->
lock
;

168 
dbty
) {

169 
DB_BTREE
:

170 
DB_RECNO
:

171 i((
t
 = 
	`__bamc_
(
dbc
, 
dbty
)) != 0)

172 
r
;

174 
DB_HASH
:

175 i((
t
 = 
	`__hamc_
(
dbc
)) != 0)

176 
r
;

178 
DB_QUEUE
:

179 i((
t
 = 
	`__qamc_
(
dbc
)) != 0)

180 
r
;

182 
DB_UNKNOWN
:

184 
t
 = 
	`__db_unknown_ty
(
v
, "DB->curs", 
dbty
);

185 
r
;

188 

 = 
dbc
->

;

192 
dbc
->
dbty
 = dbtype;

193 
	`RESET_RET_MEM
(
dbc
);

194 
dbc
->
t_iܙy
 = 
__dbc_t_iܙy
;

195 
dbc
->
g_iܙy
 = 
__dbc_g_iܙy
;

196 
dbc
->
iܙy
 = 
dbp
->priority;

198 i((
dbc
->
txn
 =xn!
NULL
)

199 
dbc
->
lock
 = 
txn
->locker;

200 i(
	`LOCKING_ON
(
v
)) {

222 i(
lock
 !
NULL
)

223 
dbc
->
lock
 =ocker;

229 i(
	`DB_IS_THREADED
(
dbp
)) {

230 
v
->
dbv
->
	`thad_id
nv->dbv, &
pid
, &
tid
);

231 
	`__lock_t_thad_id
(
dbc
->
ef
, 
pid
, 
tid
);

233 
dbc
->
lock
 = dbc->
ef
;

244 i(
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
))

245 
dbc
->
g
 = dbc->
c_g
 = 
__dbc_cdy_g_
;

247 i(
	`LF_ISSET
(
DBC_OPD
))

248 
	`F_SET
(
dbc
, 
DBC_OPD
);

249 i(
	`F_ISSET
(
dbp
, 
DB_AM_RECOVER
))

250 
	`F_SET
(
dbc
, 
DBC_RECOVER
);

251 i(
	`F_ISSET
(
dbp
, 
DB_AM_COMPENSATE
))

252 
	`F_SET
(
dbc
, 
DBC_DONTLOCK
);

255 

 = 
dbc
->

;

256 

->
d
 = 
NULL
;

258 

->
dx
 = 0;

259 

->
ge
 = 
NULL
;

260 

->
pgno
 = 
PGNO_INVALID
;

261 

->
ro
 =oot;

263 
dbty
) {

264 
DB_BTREE
:

265 
DB_RECNO
:

266 i((
t
 = 
	`__bamc_esh
(
dbc
)) != 0)

267 
r
;

269 
DB_HASH
:

270 
DB_QUEUE
:

272 
DB_UNKNOWN
:

274 
t
 = 
	`__db_unknown_ty
(
v
, "DB->curs", 
dbp
->
ty
);

275 
r
;

283 i(
txn
 !
NULL
)

284 ++
txn
->
curss
;

285 i(

 !
NULL
)

286 
dbc
->
thad_fo
 = 

;

287 i(
txn
 !
NULL
)

288 
dbc
->
thad_fo
 = 
txn
->thread_info;

290 
	`ENV_GET_THREAD_INFO
(
v
, 
dbc
->
thad_fo
);

292 
	`MUTEX_LOCK
(
v
, 
dbp
->
mux
);

293 
	`TAILQ_INSERT_TAIL
(&
dbp
->
aive_queue
, 
dbc
, 
lks
);

294 
	`F_SET
(
dbc
, 
DBC_ACTIVE
);

295 
	`MUTEX_UNLOCK
(
v
, 
dbp
->
mux
);

297 *
db
 = 
dbc
;

300 
r
: i(
lod
)

301 
	`__os_
(
v
, 
dbc
);

302  (
t
);

303 
	}
}

313 
	$__db_put
(
dbp
, 

, 
txn
, 
key
, 
da
, 
ags
)

314 
DB
 *
dbp
;

315 
DB_THREAD_INFO
 *

;

316 
DB_TXN
 *
txn
;

317 
DBT
 *
key
, *
da
;

318 
u_t32_t
 
ags
;

320 
DBC
 *
dbc
;

321 
DBT
 
tda
;

322 
ENV
 *
v
;

323 
t
, 
t_t
;

325 
v
 = 
dbp
->env;

327 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 
DB_WRITELOCK
)) != 0)

328  (
t
);

330 
	`DEBUG_LWRITE
(
dbc
, 
txn
, "DB->put", 
key
, 
da
, 
ags
);

332 
	`SET_RET_MEM
(
dbc
, 
dbp
);

344 
	`F_SET
(
dbc
, 
DBC_TRANSIENT
);

346 
ags
) {

347 
DB_APPEND
:

354 
tda
 = *
da
;

360 
dbp
->
ty
) {

361 
DB_QUEUE
:

362 i((
t
 = 
	`__qam_nd
(
dbc
, 
key
, &
tda
)) != 0)

363 
r
;

365 
DB_RECNO
:

366 i((
t
 = 
	`__m_nd
(
dbc
, 
key
, &
tda
)) != 0)

367 
r
;

369 
DB_BTREE
:

370 
DB_HASH
:

371 
DB_UNKNOWN
:

374 
	`DB_ASSERT
(
v
,

375 
dbp
->
ty
 =
DB_QUEUE
 || dbp->ty =
DB_RECNO
);

377 
t
 = 
	`__db_
(
v
, "DB->put", 0);

378 
r
;

391 
	`DB_ASSERT
(
v
, !
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
));

393 i(
	`LIST_FIRST
(&
dbp
->
s_cds
!
NULL
 &&

394 (
t
 = 
	`__dbt_urcy
(
v
, 
key
)) == 0)

395 
t
 = 
	`__db_nd_imy
(
dbc
, 
key
, &
tda
);

401 
	`FREE_IF_NEEDED
(
v
, &
tda
);

404 
de
;

410 i(
t
 == 0)

411 
t
 = 
	`__dbc_put
(
dbc
,

412 
key
, 
da
, 
ags
 =0 ? 
DB_KEYLAST
 : flags);

414 
r
:

415 
de
:

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

417 
t
 = 
t_t
;

419  (
t
);

420 
	}
}

430 
	$__db_d
(
dbp
, 

, 
txn
, 
key
, 
ags
)

431 
DB
 *
dbp
;

432 
DB_THREAD_INFO
 *

;

433 
DB_TXN
 *
txn
;

434 
DBT
 *
key
;

435 
u_t32_t
 
ags
;

437 
DBC
 *
dbc
;

438 
DBT
 
da
;

439 
u_t32_t
 
f_
, 
f_xt
;

440 
t
, 
t_t
;

443 i((
t
 = 
	`__db_curs
(
dbp
, 

, 
txn
, &
dbc
, 
DB_WRITELOCK
)) != 0)

444 
r
;

446 
	`DEBUG_LWRITE
(
dbc
, 
txn
, "DB->d", 
key
, 
NULL
, 
ags
);

447 
	`COMPQUIET
(
ags
, 0);

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

457 
	`F_SET
(&
da
, 
DB_DBT_USERMEM
 | 
DB_DBT_ISSET
);

458 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

464 
f_
 = 
DB_SET
;

465 
f_xt
 = 
DB_NEXT_DUP
;

466 i(
	`STD_LOCKING
(
dbc
)) {

467 
f_
 |
DB_RMW
;

468 
f_xt
 |
DB_RMW
;

496 i(!
	`F_ISSET
(
dbp
, 
DB_AM_SECONDARY
) &&

497 
	`LIST_FIRST
(&
dbp
->
s_cds
=
NULL
 &&

498 
	`LIST_FIRST
(&
dbp
->
f_ims
=
NULL
) {

499 #ifde
HAVE_QUEUE


500 i(
dbp
->
ty
 =
DB_QUEUE
) {

501 
t
 = 
	`__qam_de
(
dbc
, 
key
);

502 
	`F_CLR
(
key
, 
DB_DBT_ISSET
);

503 
de
;

508 i((
t
 = 
	`__dbc_g
(
dbc
, 
key
, &
da
, 
f_
)) != 0)

509 
r
;

511 #ifde
HAVE_HASH


512 i(
dbp
->
ty
 =
DB_HASH
 && 
dbc
->

->
d
 =
NULL
) {

513 
t
 = 
	`__ham_quick_de
(
dbc
);

514 
de
;

518 i((
dbp
->
ty
 =
DB_BTREE
 || dbp->ty =
DB_RECNO
) &&

519 !
	`F_ISSET
(
dbp
, 
DB_AM_DUP
)) {

520 
t
 = 
dbc
->
	`am_d
(dbc);

521 
de
;

523 } i((
t
 = 
	`__dbc_g
(
dbc
, 
key
, &
da
, 
f_
)) != 0)

524 
r
;

528 i((
t
 = 
	`__dbc_d
(
dbc
, 0)) != 0)

530 
	`F_SET
(
key
, 
DB_DBT_ISSET
);

531 
	`F_SET
(&
da
, 
DB_DBT_ISSET
);

532 i((
t
 = 
	`__dbc_g
(
dbc
, 
key
, &
da
, 
f_xt
)) != 0) {

533 i(
t
 =
DB_NOTFOUND
)

534 
t
 = 0;

539 
de
:

540 
r
:

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

542 
t
 = 
t_t
;

544  (
t
);

545 
	}
}

554 
	$__db_sync
(
dbp
)

555 
DB
 *
dbp
;

557 
t
, 
t_t
;

559 
t
 = 0;

562 i(
	`F_ISSET
(
dbp
, 
DB_AM_RDONLY
))

566 i(
dbp
->
ty
 =
DB_RECNO
)

567 
t
 = 
	`__m_wreback
(
dbp
);

570 i(
	`F_ISSET
(
dbp
, 
DB_AM_INMEM
))

571  (
t
);

573 i(
dbp
->
ty
 =
DB_QUEUE
)

574 
t
 = 
	`__qam_sync
(
dbp
);

577 i((
t_t
 = 
	`__memp_fsync
(
dbp
->
mpf
)!0 && 
t
 == 0)

578 
t
 = 
t_t
;

580  (
t
);

581 
	}
}

591 
	$__db_assoc
(
dbp
, 

, 
txn
, 
sdbp
, 
back
, 
ags
)

592 
DB
 *
dbp
, *
sdbp
;

593 
DB_THREAD_INFO
 *

;

594 
DB_TXN
 *
txn
;

595 (*
back

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

596 
u_t32_t
 
ags
;

598 
DBC
 *
pdbc
, *
sdbc
;

599 
DBT
 
key
, 
da
, 
skey
, *
tskeyp
;

600 
ENV
 *
v
;

601 
bud
, 
t
, 
t_t
;

602 
u_t32_t
 
nskey
;

604 
v
 = 
dbp
->env;

605 
pdbc
 = 
sdbc
 = 
NULL
;

606 
t
 = 0;

608 
	`memt
(&
skey
, 0, (
DBT
));

609 
nskey
 = 0;

610 
tskeyp
 = 
NULL
;

618 
bud
 = 0;

619 i(
	`LF_ISSET
(
DB_CREATE
)) {

620 i((
t
 = 
	`__db_curs
(
sdbp
, 

, 
txn
, &
sdbc
, 0)) != 0)

621 
r
;

627 
	`memt
(&
key
, 0, (
DBT
));

628 
	`memt
(&
da
, 0, (
DBT
));

629 
	`F_SET
(&
key
, 
DB_DBT_PARTIAL
 | 
DB_DBT_USERMEM
);

630 
	`F_SET
(&
da
, 
DB_DBT_PARTIAL
 | 
DB_DBT_USERMEM
);

631 i((
t
 = 
	`__dbc_g
(
sdbc
, &
key
, &
da
,

632 (
	`STD_LOCKING
(
sdbc
? 
DB_RMW
 : 0) |

633 
DB_FIRST
)=
DB_NOTFOUND
) {

634 
bud
 = 1;

635 
t
 = 0;

638 i((
t_t
 = 
	`__dbc_o
(
sdbc
)!0 && 
t
 == 0)

639 
t
 = 
t_t
;

642 
sdbc
 = 
NULL
;

644 i(
t
 != 0)

645 
r
;

651 
sdbp
->
s_back
 = 
back
;

652 
sdbp
->
s_imy
 = 
dbp
;

654 
sdbp
->
ed_g
 = sdbp->
g
;

655 
sdbp
->
g
 = 
__db_cdy_g
;

657 
sdbp
->
ed_o
 = sdbp->
o
;

658 
sdbp
->
o
 = 
__db_cdy_o_
;

660 
	`F_SET
(
sdbp
, 
DB_AM_SECONDARY
);

662 i(
	`LF_ISSET
(
DB_IMMUTABLE_KEY
))

663 
	`FLD_SET
(
sdbp
->
s_assoc_ags
, 
DB_ASSOC_IMMUTABLE_KEY
);

670 
	`MUTEX_LOCK
(
v
, 
dbp
->
mux
);

673 
	`DB_ASSERT
(
v
, 
sdbp
->
s_ft
 == 0);

674 
sdbp
->
s_ft
 = 1;

675 
	`LIST_INSERT_HEAD
(&
dbp
->
s_cds
, 
sdbp
, 
s_lks
);

676 
	`MUTEX_UNLOCK
(
v
, 
dbp
->
mux
);

678 i(
bud
) {

692 i((
t
 = 
	`__db_curs
(
sdbp
, 

, 
txn
, &
sdbc
,

693 
	`CDB_LOCKING
(
sdbp
->
v
? 
DB_WRITECURSOR
 : 0)) != 0)

694 
r
;

695 i((
t
 = 
	`__db_curs_t
(
dbp
, 

,

696 
txn
, 
dbp
->
ty
, 
PGNO_INVALID
, 0, 
sdbc
->
lock
, &
pdbc
)) != 0)

697 
r
;

700 
dbp
->
assoc_lock
 = 
sdbc
->
lock
;

702 
	`memt
(&
key
, 0, (
DBT
));

703 
	`memt
(&
da
, 0, (
DBT
));

704 (
t
 = 
	`__dbc_g
(
pdbc
, &
key
, &
da
, 
DB_NEXT
)) == 0) {

705 i((
t
 = 
	`back
(
sdbp
, &
key
, &
da
, &
skey
)) != 0) {

706 i(
t
 =
DB_DONOTINDEX
)

708 
r
;

710 i(
	`F_ISSET
(&
skey
, 
DB_DBT_MULTIPLE
)) {

711 #ifde
DIAGNOSTIC


712 
	`__db_check_skeyt
(
sdbp
, &
skey
);

714 
nskey
 = 
skey
.
size
;

715 
tskeyp
 = (
DBT
 *)
skey
.
da
;

717 
nskey
 = 1;

718 
tskeyp
 = &
skey
;

720 
	`SWAP_IF_NEEDED
(
sdbp
, &
key
);

721 ; 
nskey
 > 0;skey--, 
tskeyp
++) {

722 i((
t
 = 
	`__dbc_put
(
sdbc
,

723 
tskeyp
, &
key
, 
DB_UPDATE_SECONDARY
)) != 0)

724 
r
;

725 
	`FREE_IF_NEEDED
(
v
, 
tskeyp
);

727 
	`SWAP_IF_NEEDED
(
sdbp
, &
key
);

728 
	`FREE_IF_NEEDED
(
v
, &
skey
);

730 i(
t
 =
DB_NOTFOUND
)

731 
t
 = 0;

734 
r
: i(
sdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
(sdbc)!0 && 
t
 == 0)

735 
t
 = 
t_t
;

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

738 
t
 = 
t_t
;

740 
dbp
->
assoc_lock
 = 
NULL
;

742 ; 
nskey
 > 0;skey--, 
tskeyp
++)

743 
	`FREE_IF_NEEDED
(
v
, 
tskeyp
);

744 
	`FREE_IF_NEEDED
(
v
, &
skey
);

746  (
t
);

747 
	}
}

755 
	$__db_cdy_g
(
sdbp
, 
txn
, 
skey
, 
da
, 
ags
)

756 
DB
 *
sdbp
;

757 
DB_TXN
 *
txn
;

758 
DBT
 *
skey
, *
da
;

759 
u_t32_t
 
ags
;

761 
	`DB_ASSERT
(
sdbp
->
v
, 
	`F_ISSET
(sdbp, 
DB_AM_SECONDARY
));

762  (
	`__db_pg_
(
sdbp
, 
txn
, 
skey
, 
NULL
, 
da
, 
ags
));

763 
	}
}

774 
	$__db_cdy_o
(
sdbp
, 
ags
)

775 
DB
 *
sdbp
;

776 
u_t32_t
 
ags
;

778 
DB
 *
imy
;

779 
ENV
 *
v
;

780 
doo
;

782 
doo
 = 0;

783 
imy
 = 
sdbp
->
s_imy
;

784 
v
 = 
imy
->env;

786 
	`MUTEX_LOCK
(
v
, 
imy
->
mux
);

796 
	`DB_ASSERT
(
v
, 
sdbp
->
s_ft
 != 0);

797 i(--
sdbp
->
s_ft
 == 0) {

798 
	`LIST_REMOVE
(
sdbp
, 
s_lks
);

800 
doo
 = 1;

802 
	`MUTEX_UNLOCK
(
v
, 
imy
->
mux
);

808  (
doo
 ? 
	`__db_o
(
sdbp
, 
NULL
, 
ags
) : 0);

809 
	}
}

817 
	$__db_nd_imy
(
dbc
, 
key
, 
da
)

818 
DBC
 *
dbc
;

819 
DBT
 *
key
, *
da
;

821 
DB
 *
dbp
, *
sdbp
;

822 
DBC
 *
fdbc
, *
sdbc
, *
pdbc
;

823 
DBT
 
fda
, 
dpkey
, 
pkey
, 
pda
, 
skey
;

824 
ENV
 *
v
;

825 
cmp
, 
t
, 
t_t
;

827 
dbp
 = 
dbc
->dbp;

828 
v
 = 
dbp
->env;

829 
sdbp
 = 
NULL
;

830 
t
 = 0;

837 
pdbc
 = 
NULL
;

838 i(
	`F_ISSET
(
da
, 
DB_DBT_PARTIAL
|| F_ISSET(
key
, DB_DBT_PARTIAL)) {

851 i((
t
 = 
	`__dbc_idup
(
dbc
, &
pdbc
, 
DB_POSITION
)) != 0)

852  (
t
);

853 
	`memt
(&
pkey
, 0, (
DBT
));

854 
	`memt
(&
pda
, 0, (
DBT
));

856 i((
t
 = 
	`__dbc_g
(
pdbc
, &
pkey
, &
pda
, 
DB_CURRENT
)) != 0)

857 
r
;

859 
key
 = &
pkey
;

860 
da
 = &
pda
;

872 i((
t
 = 
	`__db_s_f
(
dbp
, &
sdbp
)) != 0)

873 
r
;

874 ; 
sdbp
 !
NULL
 && 
t
 =0; = 
	`__db_s_xt
(&sdbp, 
dbc
->
txn
)) {

875 
	`memt
(&
skey
, 0, (
DBT
));

876 i((
t
 = 
sdbp
->
	`s_back
(sdbp, 
key
, 
da
, &
skey
)) != 0) {

877 i(
t
 =
DB_DONOTINDEX
)

879 
r
;

888 
	`memt
(&
fda
, 0, (
DBT
));

889 
	`F_SET
(&
fda
, 
DB_DBT_PARTIAL
 | 
DB_DBT_USERMEM
);

890 i(
sdbp
->
s_feign
 !
NULL
) {

891 i((
t
 = 
	`__db_curs_t
(
sdbp
->
s_feign
,

892 
dbc
->
thad_fo
, dbc->
txn
, 
sdbp
->
s_feign
->
ty
,

893 
PGNO_INVALID
, 0, 
dbc
->
lock
, &
fdbc
)) != 0)

894 
r
;

895 i((
t
 = 
	`__dbc_g
(
fdbc
, &
skey
, &
fda
,

896 
DB_SET
 | (
	`STD_LOCKING
(
dbc
? 
DB_RMW
 : 0))) != 0) {

897 i(
t
 =
DB_NOTFOUND
 || =
DB_KEYEMPTY
)

898 
t
 = 
DB_FOREIGN_CONFLICT
;

899 
r
;

901 i((
t
 = 
	`__dbc_o
(
fdbc
)) != 0)

902 
r
;

905 i((
t
 = 
	`__db_curs_t
(
sdbp
, 
dbc
->
thad_fo
, dbc->
txn
,

906 
sdbp
->
ty
, 
PGNO_INVALID
, 0, 
dbc
->
lock
, &
sdbc
)) != 0) {

907 
	`FREE_IF_NEEDED
(
v
, &
skey
);

908 
r
;

910 i(
	`CDB_LOCKING
(
v
)) {

911 
	`DB_ASSERT
(
v
, 
sdbc
->
mylock
.
off
 =
LOCK_INVALID
);

912 
	`F_SET
(
sdbc
, 
DBC_WRITER
);

922 i(!
	`F_ISSET
(
sdbp
, 
DB_AM_DUP
)) {

923 
	`memt
(&
dpkey
, 0, (
DBT
));

924 
	`F_SET
(&
dpkey
, 
DB_DBT_MALLOC
);

925 
t
 = 
	`__dbc_g
(
sdbc
, &
skey
, &
dpkey
,

926 
DB_SET
 | (
	`STD_LOCKING
(
dbc
? 
DB_RMW
 : 0));

927 i(
t
 == 0) {

928 
cmp
 = 
	`__bam_defcmp
(
sdbp
, &
dpkey
, 
key
);

934 
	`__os_u
(
v
, 
dpkey
.
da
);

935 i(
cmp
 != 0) {

936 
	`__db_rx
(
v
, "%s%s",

939 
t
 = 
EINVAL
;

940 
r1
;

942 } i(
t
 !
DB_NOTFOUND
 && !
DB_KEYEMPTY
)

943 
r1
;

946 
t
 = 
	`__dbc_put
(
sdbc
, &
skey
, 
key
, 
DB_UPDATE_SECONDARY
);

948 
r1
: 
	`FREE_IF_NEEDED
(
v
, &
skey
);

950 i((
t_t
 = 
	`__dbc_o
(
sdbc
)!0 && 
t
 == 0)

951 
t
 = 
t_t
;

952 i(
t
 != 0)

953 
r
;

956 
r
: i(
pdbc
 !
NULL
 && (
t_t
 = 
	`__dbc_o
dbc)!0 && 
t
 == 0)

957 
t
 = 
t_t
;

958 i(
sdbp
 !
NULL
 &&

959 (
t_t
 = 
	`__db_s_de
(
sdbp
, 
dbc
->
txn
)!0 && 
t
 == 0)

960 
t
 = 
t_t
;

961  (
t
);

962 
	}
}

975 
	$__db_assoc_feign
(
fdbp
, 
pdbp
, 
back
, 
ags
)

976 
DB
 *
fdbp
, *
pdbp
;

977 (*
back
)(
DB
 *, cڡ 
DBT
 *, DBT *, const DBT *, *);

978 
u_t32_t
 
ags
;

980 
DB_FOREIGN_INFO
 *
f_fo
;

981 
ENV
 *
v
;

982 
t
;

984 
v
 = 
fdbp
->env;

985 
t
 = 0;

987 i((
t
 = 
	`__os_mloc
(
v
, (
DB_FOREIGN_INFO
), &
f_fo
)) != 0) {

988  
t
;

990 
	`memt
(
f_fo
, 0, (
DB_FOREIGN_INFO
));

992 
f_fo
->
dbp
 = 
pdbp
;

993 
f_fo
->
back
 = callback;

999 
	`FLD_SET
(
f_fo
->
ags
, flags);

1006 
	`MUTEX_LOCK
(
v
, 
fdbp
->
mux
);

1007 
	`LIST_INSERT_HEAD
(&
fdbp
->
f_ims
, 
f_fo
, 
f_lks
);

1008 
	`MUTEX_UNLOCK
(
v
, 
fdbp
->
mux
);

1016 i(
pdbp
->
s_feign
 !
NULL
)

1017  (
EINVAL
);

1018 
pdbp
->
s_feign
 = 
fdbp
;

1020  (
t
);

1021 
	}
}

1024 
	$__dbc_t_iܙy
(
dbc
, 
iܙy
)

1025 
DBC
 *
dbc
;

1026 
DB_CACHE_PRIORITY
 
iܙy
;

1028 
dbc
->
iܙy
 =riority;

1030 
	}
}

1033 
	$__dbc_g_iܙy
(
dbc
, 
iܙy
)

1034 
DBC
 *
dbc
;

1035 
DB_CACHE_PRIORITY
 *
iܙy
;

1037 *
iܙy
 = 
dbc
->priority;

1039 
	}
}

	@../db/db_auto.c

3 
	~"db_cfig.h
"

4 
	~"db_t.h
"

5 
	~"dbc/yo.h
"

6 
	~"dbc/db_ge.h
"

7 
	~"dbc/db_dich.h
"

8 
	~"dbc/db_am.h
"

9 
	~"dbc/log.h
"

10 
	~"dbc/txn.h
"

17 
	$__db_addm_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

18 
ENV
 *
v
;

19 
DB
 **
db
;

20 *
td
;

21 *
cbuf
;

22 
__db_addm_gs
 **
g
;

24 
__db_addm_gs
 *
gp
;

25 
u_t32_t
 
ump
;

26 
u_t8_t
 *
bp
;

27 
t
;

29 i((
t
 = 
	`__os_mloc
(
v
,

30 (
__db_addm_gs
+ (
DB_TXN
), &
gp
)) != 0)

31  (
t
);

32 
bp
 = 
cbuf
;

33 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

34 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

36 
gp
->
tx
->
td
 =d;

37 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

38 
bp
 +(
gp
->
ty
);

40 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

41 
bp
 +(
gp
->
tx
->
txnid
);

43 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

44 
bp
 +(
DB_LSN
);

46 
	`LOGCOPY_32
(
v
, &
gp
->
code
, 
bp
);

47 
bp
 +(
gp
->
code
);

49 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

50 
gp
->
feid
 = (
t32_t
)
ump
;

51 
bp
 +(
ump
);

52 i(
db
 !
NULL
) {

53 *
db
 = 
NULL
;

54 
t
 = 
	`__dbg_id_to_db
(

55 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

58 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

59 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

60 
bp
 +(
ump
);

62 
	`LOGCOPY_32
(
v
, &
gp
->
dx
, 
bp
);

63 
bp
 +(
gp
->
dx
);

65 
	`LOGCOPY_32
(
v
, &
gp
->
nbys
, 
bp
);

66 
bp
 +(
gp
->
nbys
);

68 
	`memt
(&
gp
->
hdr
, 0, (argp->hdr));

69 
	`LOGCOPY_32
(
v
,&
gp
->
hdr
.
size
, 
bp
);

70 
bp
 +(
u_t32_t
);

71 
gp
->
hdr
.
da
 = 
bp
;

72 
bp
 +
gp
->
hdr
.
size
;

74 
	`memt
(&
gp
->
dbt
, 0, (argp->dbt));

75 
	`LOGCOPY_32
(
v
,&
gp
->
dbt
.
size
, 
bp
);

76 
bp
 +(
u_t32_t
);

77 
gp
->
dbt
.
da
 = 
bp
;

78 
bp
 +
gp
->
dbt
.
size
;

80 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
g
, 
bp
);

81 
bp
 +(
DB_LSN
);

83 *
g
 = 
gp
;

84  (
t
);

85 
	}
}

93 
	$__db_addm_log
(
dbp
, 
tx
, 
t_lp
, 
ags
,

94 
code
, 
pgno
, 
dx
, 
nbys
, 
hdr
,

95 
dbt
, 
g
)

96 
DB
 *
dbp
;

97 
DB_TXN
 *
tx
;

98 
DB_LSN
 *
t_lp
;

99 
u_t32_t
 
ags
;

100 
u_t32_t
 
code
;

101 
db_pgno_t
 
pgno
;

102 
u_t32_t
 
dx
;

103 
u_t32_t
 
nbys
;

104 cڡ 
DBT
 *
hdr
;

105 cڡ 
DBT
 *
dbt
;

106 
DB_LSN
 * 
g
;

108 
DBT
 
logc
;

109 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

110 
DB_TXNLOGREC
 *

;

111 
ENV
 *
v
;

112 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

113 
u_t
 
ad
;

114 
u_t8_t
 *
bp
;

115 
is_dub
, 
t
;

117 
	`COMPQUIET
(

, 
NULL
);

119 
v
 = 
dbp
->env;

120 
p
 = 
t_lp
;

121 
y
 = 
DB___db_addm
;

122 
ad
 = 0;

123 
t
 = 0;

125 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

126 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

127 i(
tx
 =
NULL
)

129 
is_dub
 = 0;

131 
is_dub
 = 1;

133 i(
tx
 =
NULL
) {

134 
txn_num
 = 0;

135 
lp
 = &
nu_l
;

136 
nu_l
.
fe
 =u_l.
offt
 = 0;

138 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

139 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

140  (
t
);

147 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

148 
txn_num
 = 
tx
->
txnid
;

151 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

152 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

153 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

154  (
t
);

156 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

157 + (
u_t32_t
)

158 + (
u_t32_t
)

159 + (
u_t32_t
)

160 + (
u_t32_t
)

161 + (
u_t32_t
)

162 + (
u_t32_t
+ (
hdr
 =
NULL
 ? 0 : hdr->
size
)

163 + (
u_t32_t
+ (
dbt
 =
NULL
 ? 0 : dbt->
size
)

164 + (*
g
);

165 i(
	`CRYPTO_ON
(
v
)) {

166 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

167 
logc
.
size
 +
ad
;

170 i(
is_dub
 || 
tx
 =
NULL
) {

171 i((
t
 =

172 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

173  (
t
);

175 i((
t
 = 
	`__os_mloc
(
v
,

176 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

177  (
t
);

178 #ifde
DIAGNOSTIC


179 i((
t
 =

180 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

181 
	`__os_
(
v
, 

);

182  (
t
);

185 
logc
.
da
 = 

->data;

188 i(
ad
 > 0)

189 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

191 
bp
 = 
logc
.
da
;

193 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

194 
bp
 +(
y
);

196 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

197 
bp
 +(
txn_num
);

199 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

200 
bp
 +(
DB_LSN
);

202 
	`LOGCOPY_32
(
v
, 
bp
, &
code
);

203 
bp
 +(
code
);

205 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

206 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

207 
bp
 +(
ump
);

209 
ump
 = (
u_t32_t
)
pgno
;

210 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

211 
bp
 +(
ump
);

213 
	`LOGCOPY_32
(
v
, 
bp
, &
dx
);

214 
bp
 +(
dx
);

216 
	`LOGCOPY_32
(
v
, 
bp
, &
nbys
);

217 
bp
 +(
nbys
);

219 i(
hdr
 =
NULL
) {

220 
zo
 = 0;

221 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

222 
bp
 +(
u_t32_t
);

224 
	`LOGCOPY_32
(
v
, 
bp
, &
hdr
->
size
);

225 
bp
 +(
hdr
->
size
);

226 
	`memy
(
bp
, 
hdr
->
da
, hdr->
size
);

227 
bp
 +
hdr
->
size
;

230 i(
dbt
 =
NULL
) {

231 
zo
 = 0;

232 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

233 
bp
 +(
u_t32_t
);

235 
	`LOGCOPY_32
(
v
, 
bp
, &
dbt
->
size
);

236 
bp
 +(
dbt
->
size
);

237 
	`memy
(
bp
, 
dbt
->
da
, dbt->
size
);

238 
bp
 +
dbt
->
size
;

241 i(
g
 !
NULL
) {

242 i(
tx
 !
NULL
) {

243 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

244 i(
	`LOG_COMPARE
(
g
, &

->
l
>0 && (
t
 =

245 
	`__log_check_ge_l
(
v
, 
dbp
, 
g
) != 0))

246  (
t
);

248 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
g
);

250 
	`memt
(
bp
, 0, (*
g
));

251 
bp
 +(*
g
);

253 
	`DB_ASSERT
(
v
,

254 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

256 i(
is_dub
 || 
tx
 =
NULL
) {

257 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

258 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

259 *
lp
 = *
p
;

260 i(
p
 !
t_lp
)

261 *
t_lp
 = *
p
;

264 
t
 = 0;

265 #ifde
DIAGNOSTIC


270 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

271 
y
 |
DB_debug_FLAG
;

272 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

274 i(!
	`IS_REP_CLIENT
(
v
))

275 
t
 = 
	`__log_put
(
v
,

276 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

278 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

279 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

280 
	`LSN_NOT_LOGGED
(*
t_lp
);

283 #ifde
LOG_DIAGNOSTIC


284 i(
t
 != 0)

285 ()
	`__db_addm_t
(
v
,

286 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

289 #ifde
DIAGNOSTIC


290 
	`__os_
(
v
, 
logc
.
da
);

292 i(
is_dub
 || 
tx
 =
NULL
)

293 
	`__os_
(
v
, 
logc
.
da
);

295  (
t
);

296 
	}
}

303 
	$__db_big_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

304 
ENV
 *
v
;

305 
DB
 **
db
;

306 *
td
;

307 *
cbuf
;

308 
__db_big_gs
 **
g
;

310 
__db_big_gs
 *
gp
;

311 
u_t32_t
 
ump
;

312 
u_t8_t
 *
bp
;

313 
t
;

315 i((
t
 = 
	`__os_mloc
(
v
,

316 (
__db_big_gs
+ (
DB_TXN
), &
gp
)) != 0)

317  (
t
);

318 
bp
 = 
cbuf
;

319 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

320 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

322 
gp
->
tx
->
td
 =d;

323 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

324 
bp
 +(
gp
->
ty
);

326 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

327 
bp
 +(
gp
->
tx
->
txnid
);

329 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

330 
bp
 +(
DB_LSN
);

332 
	`LOGCOPY_32
(
v
, &
gp
->
code
, 
bp
);

333 
bp
 +(
gp
->
code
);

335 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

336 
gp
->
feid
 = (
t32_t
)
ump
;

337 
bp
 +(
ump
);

338 i(
db
 !
NULL
) {

339 *
db
 = 
NULL
;

340 
t
 = 
	`__dbg_id_to_db
(

341 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

344 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

345 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

346 
bp
 +(
ump
);

348 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

349 
gp
->
ev_pgno
 = (
db_pgno_t
)
ump
;

350 
bp
 +(
ump
);

352 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

353 
gp
->
xt_pgno
 = (
db_pgno_t
)
ump
;

354 
bp
 +(
ump
);

356 
	`memt
(&
gp
->
dbt
, 0, (argp->dbt));

357 
	`LOGCOPY_32
(
v
,&
gp
->
dbt
.
size
, 
bp
);

358 
bp
 +(
u_t32_t
);

359 
gp
->
dbt
.
da
 = 
bp
;

360 
bp
 +
gp
->
dbt
.
size
;

362 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
g
, 
bp
);

363 
bp
 +(
DB_LSN
);

365 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
evl
, 
bp
);

366 
bp
 +(
DB_LSN
);

368 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
x
, 
bp
);

369 
bp
 +(
DB_LSN
);

371 *
g
 = 
gp
;

372  (
t
);

373 
	}
}

381 
	$__db_big_log
(
dbp
, 
tx
, 
t_lp
, 
ags
,

382 
code
, 
pgno
, 
ev_pgno
, 
xt_pgno
, 
dbt
,

383 
g
, 
evl
, 
x
)

384 
DB
 *
dbp
;

385 
DB_TXN
 *
tx
;

386 
DB_LSN
 *
t_lp
;

387 
u_t32_t
 
ags
;

388 
u_t32_t
 
code
;

389 
db_pgno_t
 
pgno
;

390 
db_pgno_t
 
ev_pgno
;

391 
db_pgno_t
 
xt_pgno
;

392 cڡ 
DBT
 *
dbt
;

393 
DB_LSN
 * 
g
;

394 
DB_LSN
 * 
evl
;

395 
DB_LSN
 * 
x
;

397 
DBT
 
logc
;

398 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

399 
DB_TXNLOGREC
 *

;

400 
ENV
 *
v
;

401 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

402 
u_t
 
ad
;

403 
u_t8_t
 *
bp
;

404 
is_dub
, 
t
;

406 
	`COMPQUIET
(

, 
NULL
);

408 
v
 = 
dbp
->env;

409 
p
 = 
t_lp
;

410 
y
 = 
DB___db_big
;

411 
ad
 = 0;

412 
t
 = 0;

414 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

415 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

416 i(
tx
 =
NULL
)

418 
is_dub
 = 0;

420 
is_dub
 = 1;

422 i(
tx
 =
NULL
) {

423 
txn_num
 = 0;

424 
lp
 = &
nu_l
;

425 
nu_l
.
fe
 =u_l.
offt
 = 0;

427 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

428 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

429  (
t
);

436 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

437 
txn_num
 = 
tx
->
txnid
;

440 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

441 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

442 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

443  (
t
);

445 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

446 + (
u_t32_t
)

447 + (
u_t32_t
)

448 + (
u_t32_t
)

449 + (
u_t32_t
)

450 + (
u_t32_t
)

451 + (
u_t32_t
+ (
dbt
 =
NULL
 ? 0 : dbt->
size
)

452 + (*
g
)

453 + (*
evl
)

454 + (*
x
);

455 i(
	`CRYPTO_ON
(
v
)) {

456 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

457 
logc
.
size
 +
ad
;

460 i(
is_dub
 || 
tx
 =
NULL
) {

461 i((
t
 =

462 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

463  (
t
);

465 i((
t
 = 
	`__os_mloc
(
v
,

466 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

467  (
t
);

468 #ifde
DIAGNOSTIC


469 i((
t
 =

470 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

471 
	`__os_
(
v
, 

);

472  (
t
);

475 
logc
.
da
 = 

->data;

478 i(
ad
 > 0)

479 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

481 
bp
 = 
logc
.
da
;

483 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

484 
bp
 +(
y
);

486 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

487 
bp
 +(
txn_num
);

489 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

490 
bp
 +(
DB_LSN
);

492 
	`LOGCOPY_32
(
v
, 
bp
, &
code
);

493 
bp
 +(
code
);

495 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

496 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

497 
bp
 +(
ump
);

499 
ump
 = (
u_t32_t
)
pgno
;

500 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

501 
bp
 +(
ump
);

503 
ump
 = (
u_t32_t
)
ev_pgno
;

504 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

505 
bp
 +(
ump
);

507 
ump
 = (
u_t32_t
)
xt_pgno
;

508 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

509 
bp
 +(
ump
);

511 i(
dbt
 =
NULL
) {

512 
zo
 = 0;

513 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

514 
bp
 +(
u_t32_t
);

516 
	`LOGCOPY_32
(
v
, 
bp
, &
dbt
->
size
);

517 
bp
 +(
dbt
->
size
);

518 
	`memy
(
bp
, 
dbt
->
da
, dbt->
size
);

519 
bp
 +
dbt
->
size
;

522 i(
g
 !
NULL
) {

523 i(
tx
 !
NULL
) {

524 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

525 i(
	`LOG_COMPARE
(
g
, &

->
l
>0 && (
t
 =

526 
	`__log_check_ge_l
(
v
, 
dbp
, 
g
) != 0))

527  (
t
);

529 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
g
);

531 
	`memt
(
bp
, 0, (*
g
));

532 
bp
 +(*
g
);

534 i(
evl
 !
NULL
) {

535 i(
tx
 !
NULL
) {

536 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

537 i(
	`LOG_COMPARE
(
evl
, &

->
l
>0 && (
t
 =

538 
	`__log_check_ge_l
(
v
, 
dbp
, 
evl
) != 0))

539  (
t
);

541 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
evl
);

543 
	`memt
(
bp
, 0, (*
evl
));

544 
bp
 +(*
evl
);

546 i(
x
 !
NULL
) {

547 i(
tx
 !
NULL
) {

548 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

549 i(
	`LOG_COMPARE
(
x
, &

->
l
>0 && (
t
 =

550 
	`__log_check_ge_l
(
v
, 
dbp
, 
x
) != 0))

551  (
t
);

553 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
x
);

555 
	`memt
(
bp
, 0, (*
x
));

556 
bp
 +(*
x
);

558 
	`DB_ASSERT
(
v
,

559 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

561 i(
is_dub
 || 
tx
 =
NULL
) {

562 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

563 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

564 *
lp
 = *
p
;

565 i(
p
 !
t_lp
)

566 *
t_lp
 = *
p
;

569 
t
 = 0;

570 #ifde
DIAGNOSTIC


575 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

576 
y
 |
DB_debug_FLAG
;

577 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

579 i(!
	`IS_REP_CLIENT
(
v
))

580 
t
 = 
	`__log_put
(
v
,

581 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

583 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

584 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

585 
	`LSN_NOT_LOGGED
(*
t_lp
);

588 #ifde
LOG_DIAGNOSTIC


589 i(
t
 != 0)

590 ()
	`__db_big_t
(
v
,

591 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

594 #ifde
DIAGNOSTIC


595 
	`__os_
(
v
, 
logc
.
da
);

597 i(
is_dub
 || 
tx
 =
NULL
)

598 
	`__os_
(
v
, 
logc
.
da
);

600  (
t
);

601 
	}
}

608 
	$__db_ovf_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

609 
ENV
 *
v
;

610 
DB
 **
db
;

611 *
td
;

612 *
cbuf
;

613 
__db_ovf_gs
 **
g
;

615 
__db_ovf_gs
 *
gp
;

616 
u_t32_t
 
ump
;

617 
u_t8_t
 *
bp
;

618 
t
;

620 i((
t
 = 
	`__os_mloc
(
v
,

621 (
__db_ovf_gs
+ (
DB_TXN
), &
gp
)) != 0)

622  (
t
);

623 
bp
 = 
cbuf
;

624 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

625 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

627 
gp
->
tx
->
td
 =d;

628 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

629 
bp
 +(
gp
->
ty
);

631 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

632 
bp
 +(
gp
->
tx
->
txnid
);

634 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

635 
bp
 +(
DB_LSN
);

637 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

638 
gp
->
feid
 = (
t32_t
)
ump
;

639 
bp
 +(
ump
);

640 i(
db
 !
NULL
) {

641 *
db
 = 
NULL
;

642 
t
 = 
	`__dbg_id_to_db
(

643 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

646 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

647 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

648 
bp
 +(
ump
);

650 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

651 
gp
->
adju
 = (
t32_t
)
ump
;

652 
bp
 +(
ump
);

654 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

655 
bp
 +(
DB_LSN
);

657 *
g
 = 
gp
;

658  (
t
);

659 
	}
}

666 
	$__db_ovf_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
adju
, 
l
)

667 
DB
 *
dbp
;

668 
DB_TXN
 *
tx
;

669 
DB_LSN
 *
t_lp
;

670 
u_t32_t
 
ags
;

671 
db_pgno_t
 
pgno
;

672 
t32_t
 
adju
;

673 
DB_LSN
 * 
l
;

675 
DBT
 
logc
;

676 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

677 
DB_TXNLOGREC
 *

;

678 
ENV
 *
v
;

679 
u_t32_t
 
ump
, 
y
, 
txn_num
;

680 
u_t
 
ad
;

681 
u_t8_t
 *
bp
;

682 
is_dub
, 
t
;

684 
	`COMPQUIET
(

, 
NULL
);

686 
v
 = 
dbp
->env;

687 
p
 = 
t_lp
;

688 
y
 = 
DB___db_ovf
;

689 
ad
 = 0;

690 
t
 = 0;

692 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

693 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

694 i(
tx
 =
NULL
)

696 
is_dub
 = 0;

698 
is_dub
 = 1;

700 i(
tx
 =
NULL
) {

701 
txn_num
 = 0;

702 
lp
 = &
nu_l
;

703 
nu_l
.
fe
 =u_l.
offt
 = 0;

705 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

706 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

707  (
t
);

714 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

715 
txn_num
 = 
tx
->
txnid
;

718 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

719 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

720 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

721  (
t
);

723 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

724 + (
u_t32_t
)

725 + (
u_t32_t
)

726 + (
u_t32_t
)

727 + (*
l
);

728 i(
	`CRYPTO_ON
(
v
)) {

729 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

730 
logc
.
size
 +
ad
;

733 i(
is_dub
 || 
tx
 =
NULL
) {

734 i((
t
 =

735 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

736  (
t
);

738 i((
t
 = 
	`__os_mloc
(
v
,

739 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

740  (
t
);

741 #ifde
DIAGNOSTIC


742 i((
t
 =

743 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

744 
	`__os_
(
v
, 

);

745  (
t
);

748 
logc
.
da
 = 

->data;

751 i(
ad
 > 0)

752 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

754 
bp
 = 
logc
.
da
;

756 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

757 
bp
 +(
y
);

759 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

760 
bp
 +(
txn_num
);

762 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

763 
bp
 +(
DB_LSN
);

765 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

766 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

767 
bp
 +(
ump
);

769 
ump
 = (
u_t32_t
)
pgno
;

770 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

771 
bp
 +(
ump
);

773 
ump
 = (
u_t32_t
)
adju
;

774 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

775 
bp
 +(
ump
);

777 i(
l
 !
NULL
) {

778 i(
tx
 !
NULL
) {

779 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

780 i(
	`LOG_COMPARE
(
l
, &

->l>0 && (
t
 =

781 
	`__log_check_ge_l
(
v
, 
dbp
, 
l
) != 0))

782  (
t
);

784 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
l
);

786 
	`memt
(
bp
, 0, (*
l
));

787 
bp
 +(*
l
);

789 
	`DB_ASSERT
(
v
,

790 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

792 i(
is_dub
 || 
tx
 =
NULL
) {

793 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

794 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

795 *
lp
 = *
p
;

796 i(
p
 !
t_lp
)

797 *
t_lp
 = *
p
;

800 
t
 = 0;

801 #ifde
DIAGNOSTIC


806 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

807 
y
 |
DB_debug_FLAG
;

808 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

810 i(!
	`IS_REP_CLIENT
(
v
))

811 
t
 = 
	`__log_put
(
v
,

812 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

814 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

815 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

816 
	`LSN_NOT_LOGGED
(*
t_lp
);

819 #ifde
LOG_DIAGNOSTIC


820 i(
t
 != 0)

821 ()
	`__db_ovf_t
(
v
,

822 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

825 #ifde
DIAGNOSTIC


826 
	`__os_
(
v
, 
logc
.
da
);

828 i(
is_dub
 || 
tx
 =
NULL
)

829 
	`__os_
(
v
, 
logc
.
da
);

831  (
t
);

832 
	}
}

839 
	$__db_lk_42_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

840 
ENV
 *
v
;

841 
DB
 **
db
;

842 *
td
;

843 *
cbuf
;

844 
__db_lk_42_gs
 **
g
;

846 
__db_lk_42_gs
 *
gp
;

847 
u_t32_t
 
ump
;

848 
u_t8_t
 *
bp
;

849 
t
;

851 i((
t
 = 
	`__os_mloc
(
v
,

852 (
__db_lk_42_gs
+ (
DB_TXN
), &
gp
)) != 0)

853  (
t
);

854 
bp
 = 
cbuf
;

855 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

856 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

858 
gp
->
tx
->
td
 =d;

859 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

860 
bp
 +(
gp
->
ty
);

862 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

863 
bp
 +(
gp
->
tx
->
txnid
);

865 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

866 
bp
 +(
DB_LSN
);

868 
	`LOGCOPY_32
(
v
, &
gp
->
code
, 
bp
);

869 
bp
 +(
gp
->
code
);

871 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

872 
gp
->
feid
 = (
t32_t
)
ump
;

873 
bp
 +(
ump
);

874 i(
db
 !
NULL
) {

875 *
db
 = 
NULL
;

876 
t
 = 
	`__dbg_id_to_db
(

877 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

880 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

881 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

882 
bp
 +(
ump
);

884 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l
, 
bp
);

885 
bp
 +(
DB_LSN
);

887 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

888 
gp
->
ev
 = (
db_pgno_t
)
ump
;

889 
bp
 +(
ump
);

891 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l_ev
, 
bp
);

892 
bp
 +(
DB_LSN
);

894 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

895 
gp
->
xt
 = (
db_pgno_t
)
ump
;

896 
bp
 +(
ump
);

898 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
l_xt
, 
bp
);

899 
bp
 +(
DB_LSN
);

901 *
g
 = 
gp
;

902  (
t
);

903 
	}
}

909 
	$__db_debug_ad
(
v
, 
cbuf
, 
g
)

910 
ENV
 *
v
;

911 *
cbuf
;

912 
__db_debug_gs
 **
g
;

914 
__db_debug_gs
 *
gp
;

915 
u_t32_t
 
ump
;

916 
u_t8_t
 *
bp
;

917 
t
;

919 i((
t
 = 
	`__os_mloc
(
v
,

920 (
__db_debug_gs
+ (
DB_TXN
), &
gp
)) != 0)

921  (
t
);

922 
bp
 = 
cbuf
;

923 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

924 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

926 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

927 
bp
 +(
gp
->
ty
);

929 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

930 
bp
 +(
gp
->
tx
->
txnid
);

932 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

933 
bp
 +(
DB_LSN
);

935 
	`memt
(&
gp
->

, 0, (argp->op));

936 
	`LOGCOPY_32
(
v
,&
gp
->

.
size
, 
bp
);

937 
bp
 +(
u_t32_t
);

938 
gp
->

.
da
 = 
bp
;

939 
bp
 +
gp
->

.
size
;

941 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

942 
gp
->
feid
 = (
t32_t
)
ump
;

943 
bp
 +(
ump
);

945 
	`memt
(&
gp
->
key
, 0, (argp->key));

946 
	`LOGCOPY_32
(
v
,&
gp
->
key
.
size
, 
bp
);

947 
bp
 +(
u_t32_t
);

948 
gp
->
key
.
da
 = 
bp
;

949 
bp
 +
gp
->
key
.
size
;

951 
	`memt
(&
gp
->
da
, 0, (argp->data));

952 
	`LOGCOPY_32
(
v
,&
gp
->
da
.
size
, 
bp
);

953 
bp
 +(
u_t32_t
);

954 
gp
->
da
.d
bp
;

955 
bp
 +
gp
->
da
.
size
;

957 
	`LOGCOPY_32
(
v
, &
gp
->
g_ags
, 
bp
);

958 
bp
 +(
gp
->
g_ags
);

960 *
g
 = 
gp
;

961  (
t
);

962 
	}
}

970 
	$__db_debug_log
(
v
, 
tx
, 
t_lp
, 
ags
,

971 

, 
feid
, 
key
, 
da
, 
g_ags
)

972 
ENV
 *
v
;

973 
DB_TXN
 *
tx
;

974 
DB_LSN
 *
t_lp
;

975 
u_t32_t
 
ags
;

976 cڡ 
DBT
 *

;

977 
t32_t
 
feid
;

978 cڡ 
DBT
 *
key
;

979 cڡ 
DBT
 *
da
;

980 
u_t32_t
 
g_ags
;

982 
DBT
 
logc
;

983 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

984 
DB_TXNLOGREC
 *

;

985 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

986 
u_t
 
ad
;

987 
u_t8_t
 *
bp
;

988 
is_dub
, 
t
;

990 
	`COMPQUIET
(

, 
NULL
);

992 
p
 = 
t_lp
;

993 
y
 = 
DB___db_debug
;

994 
ad
 = 0;

995 
t
 = 0;

997 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

998 i(
tx
 =
NULL
)

1000 i(
tx
 =
NULL
)

1002 
is_dub
 = 0;

1004 
is_dub
 = 1;

1006 i(
tx
 =
NULL
) {

1007 
txn_num
 = 0;

1008 
lp
 = &
nu_l
;

1009 
nu_l
.
fe
 =u_l.
offt
 = 0;

1017 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1018 
txn_num
 = 
tx
->
txnid
;

1021 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1022 + (
u_t32_t
+ (

 =
NULL
 ? 0 : op->
size
)

1023 + (
u_t32_t
)

1024 + (
u_t32_t
+ (
key
 =
NULL
 ? 0 : key->
size
)

1025 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
)

1026 + (
u_t32_t
);

1027 i(
	`CRYPTO_ON
(
v
)) {

1028 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1029 
logc
.
size
 +
ad
;

1032 i(
is_dub
 || 
tx
 =
NULL
) {

1033 i((
t
 =

1034 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1035  (
t
);

1037 i((
t
 = 
	`__os_mloc
(
v
,

1038 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1039  (
t
);

1040 #ifde
DIAGNOSTIC


1041 i((
t
 =

1042 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1043 
	`__os_
(
v
, 

);

1044  (
t
);

1047 
logc
.
da
 = 

->data;

1050 i(
ad
 > 0)

1051 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1053 
bp
 = 
logc
.
da
;

1055 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1056 
bp
 +(
y
);

1058 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1059 
bp
 +(
txn_num
);

1061 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1062 
bp
 +(
DB_LSN
);

1064 i(

 =
NULL
) {

1065 
zo
 = 0;

1066 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

1067 
bp
 +(
u_t32_t
);

1069 
	`LOGCOPY_32
(
v
, 
bp
, &

->
size
);

1070 
bp
 +(

->
size
);

1071 
	`memy
(
bp
, 

->
da
, op->
size
);

1072 
bp
 +

->
size
;

1075 
ump
 = (
u_t32_t
)
feid
;

1076 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1077 
bp
 +(
ump
);

1079 i(
key
 =
NULL
) {

1080 
zo
 = 0;

1081 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

1082 
bp
 +(
u_t32_t
);

1084 
	`LOGCOPY_32
(
v
, 
bp
, &
key
->
size
);

1085 
bp
 +(
key
->
size
);

1086 
	`memy
(
bp
, 
key
->
da
, key->
size
);

1087 
bp
 +
key
->
size
;

1090 i(
da
 =
NULL
) {

1091 
zo
 = 0;

1092 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

1093 
bp
 +(
u_t32_t
);

1095 
	`LOGCOPY_32
(
v
, 
bp
, &
da
->
size
);

1096 
bp
 +(
da
->
size
);

1097 
	`memy
(
bp
, 
da
->da, da->
size
);

1098 
bp
 +
da
->
size
;

1101 
	`LOGCOPY_32
(
v
, 
bp
, &
g_ags
);

1102 
bp
 +(
g_ags
);

1104 
	`DB_ASSERT
(
v
,

1105 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1107 i(
is_dub
 || 
tx
 =
NULL
) {

1108 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1109 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1110 *
lp
 = *
p
;

1111 i(
p
 !
t_lp
)

1112 *
t_lp
 = *
p
;

1115 
t
 = 0;

1116 #ifde
DIAGNOSTIC


1121 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1122 
y
 |
DB_debug_FLAG
;

1123 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1125 i(!
	`IS_REP_CLIENT
(
v
))

1126 
t
 = 
	`__log_put
(
v
,

1127 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1129 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1130 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1131 
	`LSN_NOT_LOGGED
(*
t_lp
);

1134 #ifde
LOG_DIAGNOSTIC


1135 i(
t
 != 0)

1136 ()
	`__db_debug_t
(
v
,

1137 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1140 #ifde
DIAGNOSTIC


1141 
	`__os_
(
v
, 
logc
.
da
);

1143 i(
is_dub
 || 
tx
 =
NULL
)

1144 
	`__os_
(
v
, 
logc
.
da
);

1146  (
t
);

1147 
	}
}

1154 
	$__db_no_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1155 
ENV
 *
v
;

1156 
DB
 **
db
;

1157 *
td
;

1158 *
cbuf
;

1159 
__db_no_gs
 **
g
;

1161 
__db_no_gs
 *
gp
;

1162 
u_t32_t
 
ump
;

1163 
u_t8_t
 *
bp
;

1164 
t
;

1166 i((
t
 = 
	`__os_mloc
(
v
,

1167 (
__db_no_gs
+ (
DB_TXN
), &
gp
)) != 0)

1168  (
t
);

1169 
bp
 = 
cbuf
;

1170 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1171 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1173 
gp
->
tx
->
td
 =d;

1174 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1175 
bp
 +(
gp
->
ty
);

1177 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1178 
bp
 +(
gp
->
tx
->
txnid
);

1180 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1181 
bp
 +(
DB_LSN
);

1183 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1184 
gp
->
feid
 = (
t32_t
)
ump
;

1185 
bp
 +(
ump
);

1186 i(
db
 !
NULL
) {

1187 *
db
 = 
NULL
;

1188 
t
 = 
	`__dbg_id_to_db
(

1189 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1192 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1193 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1194 
bp
 +(
ump
);

1196 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
evl
, 
bp
);

1197 
bp
 +(
DB_LSN
);

1199 *
g
 = 
gp
;

1200  (
t
);

1201 
	}
}

1208 
	$__db_no_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
evl
)

1209 
DB
 *
dbp
;

1210 
DB_TXN
 *
tx
;

1211 
DB_LSN
 *
t_lp
;

1212 
u_t32_t
 
ags
;

1213 
db_pgno_t
 
pgno
;

1214 
DB_LSN
 * 
evl
;

1216 
DBT
 
logc
;

1217 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1218 
DB_TXNLOGREC
 *

;

1219 
ENV
 *
v
;

1220 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1221 
u_t
 
ad
;

1222 
u_t8_t
 *
bp
;

1223 
is_dub
, 
t
;

1225 
	`COMPQUIET
(

, 
NULL
);

1227 
v
 = 
dbp
->env;

1228 
p
 = 
t_lp
;

1229 
y
 = 
DB___db_no
;

1230 
ad
 = 0;

1231 
t
 = 0;

1233 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1234 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1235 i(
tx
 =
NULL
)

1237 
is_dub
 = 0;

1239 
is_dub
 = 1;

1241 i(
tx
 =
NULL
) {

1242 
txn_num
 = 0;

1243 
lp
 = &
nu_l
;

1244 
nu_l
.
fe
 =u_l.
offt
 = 0;

1246 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1247 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

1248  (
t
);

1255 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1256 
txn_num
 = 
tx
->
txnid
;

1259 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1260 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1261 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1262  (
t
);

1264 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1265 + (
u_t32_t
)

1266 + (
u_t32_t
)

1267 + (*
evl
);

1268 i(
	`CRYPTO_ON
(
v
)) {

1269 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1270 
logc
.
size
 +
ad
;

1273 i(
is_dub
 || 
tx
 =
NULL
) {

1274 i((
t
 =

1275 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1276  (
t
);

1278 i((
t
 = 
	`__os_mloc
(
v
,

1279 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1280  (
t
);

1281 #ifde
DIAGNOSTIC


1282 i((
t
 =

1283 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1284 
	`__os_
(
v
, 

);

1285  (
t
);

1288 
logc
.
da
 = 

->data;

1291 i(
ad
 > 0)

1292 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1294 
bp
 = 
logc
.
da
;

1296 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1297 
bp
 +(
y
);

1299 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1300 
bp
 +(
txn_num
);

1302 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1303 
bp
 +(
DB_LSN
);

1305 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1306 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1307 
bp
 +(
ump
);

1309 
ump
 = (
u_t32_t
)
pgno
;

1310 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1311 
bp
 +(
ump
);

1313 i(
evl
 !
NULL
) {

1314 i(
tx
 !
NULL
) {

1315 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1316 i(
	`LOG_COMPARE
(
evl
, &

->
l
>0 && (
t
 =

1317 
	`__log_check_ge_l
(
v
, 
dbp
, 
evl
) != 0))

1318  (
t
);

1320 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
evl
);

1322 
	`memt
(
bp
, 0, (*
evl
));

1323 
bp
 +(*
evl
);

1325 
	`DB_ASSERT
(
v
,

1326 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1328 i(
is_dub
 || 
tx
 =
NULL
) {

1329 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1330 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1331 *
lp
 = *
p
;

1332 i(
p
 !
t_lp
)

1333 *
t_lp
 = *
p
;

1336 
t
 = 0;

1337 #ifde
DIAGNOSTIC


1342 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1343 
y
 |
DB_debug_FLAG
;

1344 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1346 i(!
	`IS_REP_CLIENT
(
v
))

1347 
t
 = 
	`__log_put
(
v
,

1348 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1350 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1351 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1352 
	`LSN_NOT_LOGGED
(*
t_lp
);

1355 #ifde
LOG_DIAGNOSTIC


1356 i(
t
 != 0)

1357 ()
	`__db_no_t
(
v
,

1358 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1361 #ifde
DIAGNOSTIC


1362 
	`__os_
(
v
, 
logc
.
da
);

1364 i(
is_dub
 || 
tx
 =
NULL
)

1365 
	`__os_
(
v
, 
logc
.
da
);

1367  (
t
);

1368 
	}
}

1375 
	$__db_pg_loc_42_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1376 
ENV
 *
v
;

1377 
DB
 **
db
;

1378 *
td
;

1379 *
cbuf
;

1380 
__db_pg_loc_42_gs
 **
g
;

1382 
__db_pg_loc_42_gs
 *
gp
;

1383 
u_t32_t
 
ump
;

1384 
u_t8_t
 *
bp
;

1385 
t
;

1387 i((
t
 = 
	`__os_mloc
(
v
,

1388 (
__db_pg_loc_42_gs
+ (
DB_TXN
), &
gp
)) != 0)

1389  (
t
);

1390 
bp
 = 
cbuf
;

1391 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1392 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1394 
gp
->
tx
->
td
 =d;

1395 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1396 
bp
 +(
gp
->
ty
);

1398 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1399 
bp
 +(
gp
->
tx
->
txnid
);

1401 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1402 
bp
 +(
DB_LSN
);

1404 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1405 
gp
->
feid
 = (
t32_t
)
ump
;

1406 
bp
 +(
ump
);

1407 i(
db
 !
NULL
) {

1408 *
db
 = 
NULL
;

1409 
t
 = 
	`__dbg_id_to_db
(

1410 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1413 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

1414 
bp
 +(
DB_LSN
);

1416 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1417 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1418 
bp
 +(
ump
);

1420 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ge_l
, 
bp
);

1421 
bp
 +(
DB_LSN
);

1423 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1424 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1425 
bp
 +(
ump
);

1427 
	`LOGCOPY_32
(
v
, &
gp
->
y
, 
bp
);

1428 
bp
 +(
gp
->
y
);

1430 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1431 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1432 
bp
 +(
ump
);

1434 *
g
 = 
gp
;

1435  (
t
);

1436 
	}
}

1443 
	$__db_pg_loc_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1444 
ENV
 *
v
;

1445 
DB
 **
db
;

1446 *
td
;

1447 *
cbuf
;

1448 
__db_pg_loc_gs
 **
g
;

1450 
__db_pg_loc_gs
 *
gp
;

1451 
u_t32_t
 
ump
;

1452 
u_t8_t
 *
bp
;

1453 
t
;

1455 i((
t
 = 
	`__os_mloc
(
v
,

1456 (
__db_pg_loc_gs
+ (
DB_TXN
), &
gp
)) != 0)

1457  (
t
);

1458 
bp
 = 
cbuf
;

1459 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1460 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1462 
gp
->
tx
->
td
 =d;

1463 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1464 
bp
 +(
gp
->
ty
);

1466 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1467 
bp
 +(
gp
->
tx
->
txnid
);

1469 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1470 
bp
 +(
DB_LSN
);

1472 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1473 
gp
->
feid
 = (
t32_t
)
ump
;

1474 
bp
 +(
ump
);

1475 i(
db
 !
NULL
) {

1476 *
db
 = 
NULL
;

1477 
t
 = 
	`__dbg_id_to_db
(

1478 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1481 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

1482 
bp
 +(
DB_LSN
);

1484 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1485 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1486 
bp
 +(
ump
);

1488 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ge_l
, 
bp
);

1489 
bp
 +(
DB_LSN
);

1491 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1492 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1493 
bp
 +(
ump
);

1495 
	`LOGCOPY_32
(
v
, &
gp
->
y
, 
bp
);

1496 
bp
 +(
gp
->
y
);

1498 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1499 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1500 
bp
 +(
ump
);

1502 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1503 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

1504 
bp
 +(
ump
);

1506 *
g
 = 
gp
;

1507  (
t
);

1508 
	}
}

1516 
	$__db_pg_loc_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
ma_l
, 
ma_pgno
, 
ge_l
, 
pgno
, 
y
,

1517 
xt
, 
ϡ_pgno
)

1518 
DB
 *
dbp
;

1519 
DB_TXN
 *
tx
;

1520 
DB_LSN
 *
t_lp
;

1521 
u_t32_t
 
ags
;

1522 
DB_LSN
 * 
ma_l
;

1523 
db_pgno_t
 
ma_pgno
;

1524 
DB_LSN
 * 
ge_l
;

1525 
db_pgno_t
 
pgno
;

1526 
u_t32_t
 
y
;

1527 
db_pgno_t
 
xt
;

1528 
db_pgno_t
 
ϡ_pgno
;

1530 
DBT
 
logc
;

1531 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1532 
DB_TXNLOGREC
 *

;

1533 
ENV
 *
v
;

1534 
u_t32_t
 
ump
, 
y
, 
txn_num
;

1535 
u_t
 
ad
;

1536 
u_t8_t
 *
bp
;

1537 
is_dub
, 
t
;

1539 
	`COMPQUIET
(

, 
NULL
);

1541 
v
 = 
dbp
->env;

1542 
p
 = 
t_lp
;

1543 
y
 = 
DB___db_pg_loc
;

1544 
ad
 = 0;

1545 
t
 = 0;

1547 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1548 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1549 i(
tx
 =
NULL
)

1551 
is_dub
 = 0;

1553 
is_dub
 = 1;

1555 i(
tx
 =
NULL
) {

1556 
txn_num
 = 0;

1557 
lp
 = &
nu_l
;

1558 
nu_l
.
fe
 =u_l.
offt
 = 0;

1560 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1561 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

1562  (
t
);

1569 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1570 
txn_num
 = 
tx
->
txnid
;

1573 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1574 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1575 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1576  (
t
);

1578 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1579 + (
u_t32_t
)

1580 + (*
ma_l
)

1581 + (
u_t32_t
)

1582 + (*
ge_l
)

1583 + (
u_t32_t
)

1584 + (
u_t32_t
)

1585 + (
u_t32_t
)

1586 + (
u_t32_t
);

1587 i(
	`CRYPTO_ON
(
v
)) {

1588 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1589 
logc
.
size
 +
ad
;

1592 i(
is_dub
 || 
tx
 =
NULL
) {

1593 i((
t
 =

1594 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1595  (
t
);

1597 i((
t
 = 
	`__os_mloc
(
v
,

1598 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1599  (
t
);

1600 #ifde
DIAGNOSTIC


1601 i((
t
 =

1602 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1603 
	`__os_
(
v
, 

);

1604  (
t
);

1607 
logc
.
da
 = 

->data;

1610 i(
ad
 > 0)

1611 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1613 
bp
 = 
logc
.
da
;

1615 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1616 
bp
 +(
y
);

1618 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1619 
bp
 +(
txn_num
);

1621 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1622 
bp
 +(
DB_LSN
);

1624 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1625 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1626 
bp
 +(
ump
);

1628 i(
ma_l
 !
NULL
) {

1629 i(
tx
 !
NULL
) {

1630 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1631 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

1632 
	`__log_check_ge_l
(
v
, 
dbp
, 
ma_l
) != 0))

1633  (
t
);

1635 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
ma_l
);

1637 
	`memt
(
bp
, 0, (*
ma_l
));

1638 
bp
 +(*
ma_l
);

1640 
ump
 = (
u_t32_t
)
ma_pgno
;

1641 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1642 
bp
 +(
ump
);

1644 i(
ge_l
 !
NULL
) {

1645 i(
tx
 !
NULL
) {

1646 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1647 i(
	`LOG_COMPARE
(
ge_l
, &

->
l
>0 && (
t
 =

1648 
	`__log_check_ge_l
(
v
, 
dbp
, 
ge_l
) != 0))

1649  (
t
);

1651 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
ge_l
);

1653 
	`memt
(
bp
, 0, (*
ge_l
));

1654 
bp
 +(*
ge_l
);

1656 
ump
 = (
u_t32_t
)
pgno
;

1657 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1658 
bp
 +(
ump
);

1660 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1661 
bp
 +(
y
);

1663 
ump
 = (
u_t32_t
)
xt
;

1664 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1665 
bp
 +(
ump
);

1667 
ump
 = (
u_t32_t
)
ϡ_pgno
;

1668 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1669 
bp
 +(
ump
);

1671 
	`DB_ASSERT
(
v
,

1672 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

1674 i(
is_dub
 || 
tx
 =
NULL
) {

1675 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

1676 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

1677 *
lp
 = *
p
;

1678 i(
p
 !
t_lp
)

1679 *
t_lp
 = *
p
;

1682 
t
 = 0;

1683 #ifde
DIAGNOSTIC


1688 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

1689 
y
 |
DB_debug_FLAG
;

1690 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

1692 i(!
	`IS_REP_CLIENT
(
v
))

1693 
t
 = 
	`__log_put
(
v
,

1694 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

1696 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

1697 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

1698 
	`LSN_NOT_LOGGED
(*
t_lp
);

1701 #ifde
LOG_DIAGNOSTIC


1702 i(
t
 != 0)

1703 ()
	`__db_pg_loc_t
(
v
,

1704 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

1707 #ifde
DIAGNOSTIC


1708 
	`__os_
(
v
, 
logc
.
da
);

1710 i(
is_dub
 || 
tx
 =
NULL
)

1711 
	`__os_
(
v
, 
logc
.
da
);

1713  (
t
);

1714 
	}
}

1721 
	$__db_pg__42_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1722 
ENV
 *
v
;

1723 
DB
 **
db
;

1724 *
td
;

1725 *
cbuf
;

1726 
__db_pg__42_gs
 **
g
;

1728 
__db_pg__42_gs
 *
gp
;

1729 
u_t32_t
 
ump
;

1730 
u_t8_t
 *
bp
;

1731 
t
;

1733 i((
t
 = 
	`__os_mloc
(
v
,

1734 (
__db_pg__42_gs
+ (
DB_TXN
), &
gp
)) != 0)

1735  (
t
);

1736 
bp
 = 
cbuf
;

1737 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1738 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1740 
gp
->
tx
->
td
 =d;

1741 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1742 
bp
 +(
gp
->
ty
);

1744 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1745 
bp
 +(
gp
->
tx
->
txnid
);

1747 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1748 
bp
 +(
DB_LSN
);

1750 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1751 
gp
->
feid
 = (
t32_t
)
ump
;

1752 
bp
 +(
ump
);

1753 i(
db
 !
NULL
) {

1754 *
db
 = 
NULL
;

1755 
t
 = 
	`__dbg_id_to_db
(

1756 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1759 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1760 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1761 
bp
 +(
ump
);

1763 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

1764 
bp
 +(
DB_LSN
);

1766 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1767 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1768 
bp
 +(
ump
);

1770 
	`memt
(&
gp
->
hd
, 0, (argp->header));

1771 
	`LOGCOPY_32
(
v
,&
gp
->
hd
.
size
, 
bp
);

1772 
bp
 +(
u_t32_t
);

1773 
gp
->
hd
.
da
 = 
bp
;

1774 
bp
 +
gp
->
hd
.
size
;

1776 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1777 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1778 
bp
 +(
ump
);

1780 *
g
 = 
gp
;

1781  (
t
);

1782 
	}
}

1789 
	$__db_pg__ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

1790 
ENV
 *
v
;

1791 
DB
 **
db
;

1792 *
td
;

1793 *
cbuf
;

1794 
__db_pg__gs
 **
g
;

1796 
__db_pg__gs
 *
gp
;

1797 
u_t32_t
 
ump
;

1798 
u_t8_t
 *
bp
;

1799 
t
;

1801 i((
t
 = 
	`__os_mloc
(
v
,

1802 (
__db_pg__gs
+ (
DB_TXN
), &
gp
)) != 0)

1803  (
t
);

1804 
bp
 = 
cbuf
;

1805 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

1806 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

1808 
gp
->
tx
->
td
 =d;

1809 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

1810 
bp
 +(
gp
->
ty
);

1812 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

1813 
bp
 +(
gp
->
tx
->
txnid
);

1815 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

1816 
bp
 +(
DB_LSN
);

1818 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1819 
gp
->
feid
 = (
t32_t
)
ump
;

1820 
bp
 +(
ump
);

1821 i(
db
 !
NULL
) {

1822 *
db
 = 
NULL
;

1823 
t
 = 
	`__dbg_id_to_db
(

1824 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

1827 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1828 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

1829 
bp
 +(
ump
);

1831 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

1832 
bp
 +(
DB_LSN
);

1834 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1835 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

1836 
bp
 +(
ump
);

1838 
	`memt
(&
gp
->
hd
, 0, (argp->header));

1839 
	`LOGCOPY_32
(
v
,&
gp
->
hd
.
size
, 
bp
);

1840 
bp
 +(
u_t32_t
);

1841 
gp
->
hd
.
da
 = 
bp
;

1842 
bp
 +
gp
->
hd
.
size
;

1843 i(
	`LOG_SWAPPED
(
v
&& 
db
 !
NULL
 && *dbpp != NULL) {

1844 
t_t
;

1845 i((
t_t
 = 
	`__db_gesw
(*
db
, (
PAGE
 *)
gp
->
hd
.
da
,

1846 (
size_t
)
gp
->
hd
.
size
, 
NULL
, 1)) != 0)

1847  (
t_t
);

1850 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1851 
gp
->
xt
 = (
db_pgno_t
)
ump
;

1852 
bp
 +(
ump
);

1854 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

1855 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

1856 
bp
 +(
ump
);

1858 *
g
 = 
gp
;

1859  (
t
);

1860 
	}
}

1868 
	$__db_pg__log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ma_l
, 
ma_pgno
, 
hd
, 
xt
,

1869 
ϡ_pgno
)

1870 
DB
 *
dbp
;

1871 
DB_TXN
 *
tx
;

1872 
DB_LSN
 *
t_lp
;

1873 
u_t32_t
 
ags
;

1874 
db_pgno_t
 
pgno
;

1875 
DB_LSN
 * 
ma_l
;

1876 
db_pgno_t
 
ma_pgno
;

1877 cڡ 
DBT
 *
hd
;

1878 
db_pgno_t
 
xt
;

1879 
db_pgno_t
 
ϡ_pgno
;

1881 
DBT
 
logc
;

1882 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

1883 
DB_TXNLOGREC
 *

;

1884 
ENV
 *
v
;

1885 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

1886 
u_t
 
ad
;

1887 
u_t8_t
 *
bp
;

1888 
is_dub
, 
t
;

1890 
	`COMPQUIET
(

, 
NULL
);

1892 
v
 = 
dbp
->env;

1893 
p
 = 
t_lp
;

1894 
y
 = 
DB___db_pg_
;

1895 
ad
 = 0;

1896 
t
 = 0;

1898 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

1899 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

1900 i(
tx
 =
NULL
)

1902 
is_dub
 = 0;

1904 
is_dub
 = 1;

1906 i(
tx
 =
NULL
) {

1907 
txn_num
 = 0;

1908 
lp
 = &
nu_l
;

1909 
nu_l
.
fe
 =u_l.
offt
 = 0;

1911 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

1912 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

1913  (
t
);

1920 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

1921 
txn_num
 = 
tx
->
txnid
;

1924 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

1925 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

1926 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

1927  (
t
);

1929 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

1930 + (
u_t32_t
)

1931 + (
u_t32_t
)

1932 + (*
ma_l
)

1933 + (
u_t32_t
)

1934 + (
u_t32_t
+ (
hd
 =
NULL
 ? 0 : hd->
size
)

1935 + (
u_t32_t
)

1936 + (
u_t32_t
);

1937 i(
	`CRYPTO_ON
(
v
)) {

1938 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

1939 
logc
.
size
 +
ad
;

1942 i(
is_dub
 || 
tx
 =
NULL
) {

1943 i((
t
 =

1944 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

1945  (
t
);

1947 i((
t
 = 
	`__os_mloc
(
v
,

1948 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

1949  (
t
);

1950 #ifde
DIAGNOSTIC


1951 i((
t
 =

1952 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

1953 
	`__os_
(
v
, 

);

1954  (
t
);

1957 
logc
.
da
 = 

->data;

1960 i(
ad
 > 0)

1961 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

1963 
bp
 = 
logc
.
da
;

1965 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

1966 
bp
 +(
y
);

1968 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

1969 
bp
 +(
txn_num
);

1971 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

1972 
bp
 +(
DB_LSN
);

1974 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

1975 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

1976 
bp
 +(
ump
);

1978 
ump
 = (
u_t32_t
)
pgno
;

1979 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1980 
bp
 +(
ump
);

1982 i(
ma_l
 !
NULL
) {

1983 i(
tx
 !
NULL
) {

1984 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

1985 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

1986 
	`__log_check_ge_l
(
v
, 
dbp
, 
ma_l
) != 0))

1987  (
t
);

1989 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
ma_l
);

1991 
	`memt
(
bp
, 0, (*
ma_l
));

1992 
bp
 +(*
ma_l
);

1994 
ump
 = (
u_t32_t
)
ma_pgno
;

1995 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

1996 
bp
 +(
ump
);

1998 i(
hd
 =
NULL
) {

1999 
zo
 = 0;

2000 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

2001 
bp
 +(
u_t32_t
);

2003 
	`LOGCOPY_32
(
v
, 
bp
, &
hd
->
size
);

2004 
bp
 +(
hd
->
size
);

2005 
	`memy
(
bp
, 
hd
->
da
, hd->
size
);

2006 i(
	`LOG_SWAPPED
(
v
))

2007 i((
t
 = 
	`__db_gesw
(
dbp
,

2008 (
PAGE
 *)
bp
, (
size_t
)
hd
->
size
, (
DBT
 *)
NULL
, 0)) != 0)

2009  (
t
);

2010 
bp
 +
hd
->
size
;

2013 
ump
 = (
u_t32_t
)
xt
;

2014 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2015 
bp
 +(
ump
);

2017 
ump
 = (
u_t32_t
)
ϡ_pgno
;

2018 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2019 
bp
 +(
ump
);

2021 
	`DB_ASSERT
(
v
,

2022 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2024 i(
is_dub
 || 
tx
 =
NULL
) {

2025 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

2026 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2027 *
lp
 = *
p
;

2028 i(
p
 !
t_lp
)

2029 *
t_lp
 = *
p
;

2032 
t
 = 0;

2033 #ifde
DIAGNOSTIC


2038 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2039 
y
 |
DB_debug_FLAG
;

2040 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

2042 i(!
	`IS_REP_CLIENT
(
v
))

2043 
t
 = 
	`__log_put
(
v
,

2044 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2046 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2047 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2048 
	`LSN_NOT_LOGGED
(*
t_lp
);

2051 #ifde
LOG_DIAGNOSTIC


2052 i(
t
 != 0)

2053 ()
	`__db_pg__t
(
v
,

2054 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2057 #ifde
DIAGNOSTIC


2058 
	`__os_
(
v
, 
logc
.
da
);

2060 i(
is_dub
 || 
tx
 =
NULL
)

2061 
	`__os_
(
v
, 
logc
.
da
);

2063  (
t
);

2064 
	}
}

2070 
	$__db_cksum_ad
(
v
, 
cbuf
, 
g
)

2071 
ENV
 *
v
;

2072 *
cbuf
;

2073 
__db_cksum_gs
 **
g
;

2075 
__db_cksum_gs
 *
gp
;

2076 
u_t8_t
 *
bp
;

2077 
t
;

2079 i((
t
 = 
	`__os_mloc
(
v
,

2080 (
__db_cksum_gs
+ (
DB_TXN
), &
gp
)) != 0)

2081  (
t
);

2082 
bp
 = 
cbuf
;

2083 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2084 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2086 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2087 
bp
 +(
gp
->
ty
);

2089 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2090 
bp
 +(
gp
->
tx
->
txnid
);

2092 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2093 
bp
 +(
DB_LSN
);

2095 *
g
 = 
gp
;

2096  (
t
);

2097 
	}
}

2103 
	$__db_cksum_log
(
v
, 
tx
, 
t_lp
, 
ags
)

2104 
ENV
 *
v
;

2105 
DB_TXN
 *
tx
;

2106 
DB_LSN
 *
t_lp
;

2107 
u_t32_t
 
ags
;

2109 
DBT
 
logc
;

2110 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2111 
DB_TXNLOGREC
 *

;

2112 
u_t32_t
 
y
, 
txn_num
;

2113 
u_t
 
ad
;

2114 
u_t8_t
 *
bp
;

2115 
is_dub
, 
t
;

2117 
	`COMPQUIET
(

, 
NULL
);

2119 
p
 = 
t_lp
;

2120 
y
 = 
DB___db_cksum
;

2121 
ad
 = 0;

2122 
t
 = 0;

2124 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
)) {

2125 i(
tx
 =
NULL
)

2127 i(
tx
 =
NULL
)

2129 
is_dub
 = 0;

2131 
is_dub
 = 1;

2133 i(
tx
 =
NULL
) {

2134 
txn_num
 = 0;

2135 
lp
 = &
nu_l
;

2136 
nu_l
.
fe
 =u_l.
offt
 = 0;

2138 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2139 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

2140  (
t
);

2147 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2148 
txn_num
 = 
tx
->
txnid
;

2151 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
);

2152 i(
	`CRYPTO_ON
(
v
)) {

2153 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

2154 
logc
.
size
 +
ad
;

2157 i(
is_dub
 || 
tx
 =
NULL
) {

2158 i((
t
 =

2159 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

2160  (
t
);

2162 i((
t
 = 
	`__os_mloc
(
v
,

2163 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2164  (
t
);

2165 #ifde
DIAGNOSTIC


2166 i((
t
 =

2167 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

2168 
	`__os_
(
v
, 

);

2169  (
t
);

2172 
logc
.
da
 = 

->data;

2175 i(
ad
 > 0)

2176 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2178 
bp
 = 
logc
.
da
;

2180 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

2181 
bp
 +(
y
);

2183 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

2184 
bp
 +(
txn_num
);

2186 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

2187 
bp
 +(
DB_LSN
);

2189 
	`DB_ASSERT
(
v
,

2190 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2192 i(
is_dub
 || 
tx
 =
NULL
) {

2193 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

2194 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NULL
) {

2195 *
lp
 = *
p
;

2196 i(
p
 !
t_lp
)

2197 *
t_lp
 = *
p
;

2200 
t
 = 0;

2201 #ifde
DIAGNOSTIC


2206 
	`memy
(

->
da
, 
logc
.da,ogc.
size
);

2207 
y
 |
DB_debug_FLAG
;

2208 
	`LOGCOPY_32
(
v
, 
logc
.
da
, &
y
);

2210 i(!
	`IS_REP_CLIENT
(
v
))

2211 
t
 = 
	`__log_put
(
v
,

2212 
p
, (
DBT
 *)&
logc
, 
ags
 | 
DB_LOG_NOCOPY
);

2214 
	`STAILQ_INSERT_HEAD
(&
tx
->
logs
, 

, 
lks
);

2215 
	`F_SET
((
TXN_DETAIL
 *)
tx
->
td
, 
TXN_DTL_INMEMORY
);

2216 
	`LSN_NOT_LOGGED
(*
t_lp
);

2219 #ifde
LOG_DIAGNOSTIC


2220 i(
t
 != 0)

2221 ()
	`__db_cksum_t
(
v
,

2222 (
DBT
 *)&
logc
, 
t_lp
, 
DB_TXN_PRINT
, 
NULL
);

2225 #ifde
DIAGNOSTIC


2226 
	`__os_
(
v
, 
logc
.
da
);

2228 i(
is_dub
 || 
tx
 =
NULL
)

2229 
	`__os_
(
v
, 
logc
.
da
);

2231  (
t
);

2232 
	}
}

2239 
	$__db_pg_da_42_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2240 
ENV
 *
v
;

2241 
DB
 **
db
;

2242 *
td
;

2243 *
cbuf
;

2244 
__db_pg_da_42_gs
 **
g
;

2246 
__db_pg_da_42_gs
 *
gp
;

2247 
u_t32_t
 
ump
;

2248 
u_t8_t
 *
bp
;

2249 
t
;

2251 i((
t
 = 
	`__os_mloc
(
v
,

2252 (
__db_pg_da_42_gs
+ (
DB_TXN
), &
gp
)) != 0)

2253  (
t
);

2254 
bp
 = 
cbuf
;

2255 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2256 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2258 
gp
->
tx
->
td
 =d;

2259 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2260 
bp
 +(
gp
->
ty
);

2262 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2263 
bp
 +(
gp
->
tx
->
txnid
);

2265 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2266 
bp
 +(
DB_LSN
);

2268 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2269 
gp
->
feid
 = (
t32_t
)
ump
;

2270 
bp
 +(
ump
);

2271 i(
db
 !
NULL
) {

2272 *
db
 = 
NULL
;

2273 
t
 = 
	`__dbg_id_to_db
(

2274 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2277 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2278 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2279 
bp
 +(
ump
);

2281 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

2282 
bp
 +(
DB_LSN
);

2284 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2285 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

2286 
bp
 +(
ump
);

2288 
	`memt
(&
gp
->
hd
, 0, (argp->header));

2289 
	`LOGCOPY_32
(
v
,&
gp
->
hd
.
size
, 
bp
);

2290 
bp
 +(
u_t32_t
);

2291 
gp
->
hd
.
da
 = 
bp
;

2292 
bp
 +
gp
->
hd
.
size
;

2294 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2295 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2296 
bp
 +(
ump
);

2298 
	`memt
(&
gp
->
da
, 0, (argp->data));

2299 
	`LOGCOPY_32
(
v
,&
gp
->
da
.
size
, 
bp
);

2300 
bp
 +(
u_t32_t
);

2301 
gp
->
da
.d
bp
;

2302 
bp
 +
gp
->
da
.
size
;

2304 *
g
 = 
gp
;

2305  (
t
);

2306 
	}
}

2313 
	$__db_pg_da_ad
(
v
, 
db
, 
td
, 
cbuf
, 
g
)

2314 
ENV
 *
v
;

2315 
DB
 **
db
;

2316 *
td
;

2317 *
cbuf
;

2318 
__db_pg_da_gs
 **
g
;

2320 
__db_pg_da_gs
 *
gp
;

2321 
u_t32_t
 
ump
;

2322 
u_t8_t
 *
bp
;

2323 
t
;

2325 i((
t
 = 
	`__os_mloc
(
v
,

2326 (
__db_pg_da_gs
+ (
DB_TXN
), &
gp
)) != 0)

2327  (
t
);

2328 
bp
 = 
cbuf
;

2329 
gp
->
tx
 = (
DB_TXN
 *)&argp[1];

2330 
	`memt
(
gp
->
tx
, 0, (
DB_TXN
));

2332 
gp
->
tx
->
td
 =d;

2333 
	`LOGCOPY_32
(
v
, &
gp
->
ty
, 
bp
);

2334 
bp
 +(
gp
->
ty
);

2336 
	`LOGCOPY_32
(
v
, &
gp
->
tx
->
txnid
, 
bp
);

2337 
bp
 +(
gp
->
tx
->
txnid
);

2339 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ev_l
, 
bp
);

2340 
bp
 +(
DB_LSN
);

2342 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2343 
gp
->
feid
 = (
t32_t
)
ump
;

2344 
bp
 +(
ump
);

2345 i(
db
 !
NULL
) {

2346 *
db
 = 
NULL
;

2347 
t
 = 
	`__dbg_id_to_db
(

2348 
v
, 
gp
->
tx
, 
db
,rgp->
feid
, 1);

2351 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2352 
gp
->
pgno
 = (
db_pgno_t
)
ump
;

2353 
bp
 +(
ump
);

2355 
	`LOGCOPY_TOLSN
(
v
, &
gp
->
ma_l
, 
bp
);

2356 
bp
 +(
DB_LSN
);

2358 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2359 
gp
->
ma_pgno
 = (
db_pgno_t
)
ump
;

2360 
bp
 +(
ump
);

2362 
	`memt
(&
gp
->
hd
, 0, (argp->header));

2363 
	`LOGCOPY_32
(
v
,&
gp
->
hd
.
size
, 
bp
);

2364 
bp
 +(
u_t32_t
);

2365 
gp
->
hd
.
da
 = 
bp
;

2366 
bp
 +
gp
->
hd
.
size
;

2368 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2369 
gp
->
xt
 = (
db_pgno_t
)
ump
;

2370 
bp
 +(
ump
);

2372 
	`LOGCOPY_32
(
v
, &
ump
, 
bp
);

2373 
gp
->
ϡ_pgno
 = (
db_pgno_t
)
ump
;

2374 
bp
 +(
ump
);

2376 
	`memt
(&
gp
->
da
, 0, (argp->data));

2377 
	`LOGCOPY_32
(
v
,&
gp
->
da
.
size
, 
bp
);

2378 
bp
 +(
u_t32_t
);

2379 
gp
->
da
.d
bp
;

2380 
bp
 +
gp
->
da
.
size
;

2381 i(
	`LOG_SWAPPED
(
v
&& 
db
 !
NULL
 && *dbpp != NULL) {

2382 
t_t
;

2383 i((
t_t
 = 
	`__db_gesw
(*
db
,

2384 (
PAGE
 *)
gp
->
hd
.
da
, (
size_t
rgp->hd.
size
,

2385 &
gp
->
da
, 1)) != 0)

2386  (
t_t
);

2389 *
g
 = 
gp
;

2390  (
t
);

2391 
	}
}

2399 
	$__db_pg_da_log
(
dbp
, 
tx
, 
t_lp
, 
ags
, 
pgno
, 
ma_l
, 
ma_pgno
, 
hd
, 
xt
,

2400 
ϡ_pgno
, 
da
)

2401 
DB
 *
dbp
;

2402 
DB_TXN
 *
tx
;

2403 
DB_LSN
 *
t_lp
;

2404 
u_t32_t
 
ags
;

2405 
db_pgno_t
 
pgno
;

2406 
DB_LSN
 * 
ma_l
;

2407 
db_pgno_t
 
ma_pgno
;

2408 cڡ 
DBT
 *
hd
;

2409 
db_pgno_t
 
xt
;

2410 
db_pgno_t
 
ϡ_pgno
;

2411 cڡ 
DBT
 *
da
;

2413 
DBT
 
logc
;

2414 
DB_LSN
 *
lp
, 
nu_l
, *
p
;

2415 
DB_TXNLOGREC
 *

;

2416 
ENV
 *
v
;

2417 
u_t32_t
 
zo
, 
ump
, 
y
, 
txn_num
;

2418 
u_t
 
ad
;

2419 
u_t8_t
 *
bp
;

2420 
is_dub
, 
t
;

2422 
	`COMPQUIET
(

, 
NULL
);

2424 
v
 = 
dbp
->env;

2425 
p
 = 
t_lp
;

2426 
y
 = 
DB___db_pg_da
;

2427 
ad
 = 0;

2428 
t
 = 0;

2430 i(
	`LF_ISSET
(
DB_LOG_NOT_DURABLE
) ||

2431 
	`F_ISSET
(
dbp
, 
DB_AM_NOT_DURABLE
)) {

2432 i(
tx
 =
NULL
)

2434 
is_dub
 = 0;

2436 
is_dub
 = 1;

2438 i(
tx
 =
NULL
) {

2439 
txn_num
 = 0;

2440 
lp
 = &
nu_l
;

2441 
nu_l
.
fe
 =u_l.
offt
 = 0;

2443 i(
	`TAILQ_FIRST
(&
tx
->
kids
!
NULL
 &&

2444 (
t
 = 
	`__txn_aivekids
(
v
, 
y
, 
tx
)) != 0)

2445  (
t
);

2452 
	`DB_SET_TXN_LSNP
(
tx
, &
p
, &
lp
);

2453 
txn_num
 = 
tx
->
txnid
;

2456 
	`DB_ASSERT
(
v
, 
dbp
->
log_fame
 !
NULL
);

2457 i(
dbp
->
log_fame
->
id
 =
DB_LOGFILEID_INVALID
 &&

2458 (
t
 = 
	`__dbg_zy_id
(
dbp
)) != 0)

2459  (
t
);

2461 
logc
.
size
 = (
y
+ (
txn_num
+ (
DB_LSN
)

2462 + (
u_t32_t
)

2463 + (
u_t32_t
)

2464 + (*
ma_l
)

2465 + (
u_t32_t
)

2466 + (
u_t32_t
+ (
hd
 =
NULL
 ? 0 : hd->
size
)

2467 + (
u_t32_t
)

2468 + (
u_t32_t
)

2469 + (
u_t32_t
+ (
da
 =
NULL
 ? 0 : da->
size
);

2470 i(
	`CRYPTO_ON
(
v
)) {

2471 
ad
 = 
v
->
yo_hd
->
	`adj_size
(
logc
.
size
);

2472 
logc
.
size
 +
ad
;

2475 i(
is_dub
 || 
tx
 =
NULL
) {

2476 i((
t
 =

2477 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0)

2478  (
t
);

2480 i((
t
 = 
	`__os_mloc
(
v
,

2481 
logc
.
size
 + (
DB_TXNLOGREC
), &

)) != 0)

2482  (
t
);

2483 #ifde
DIAGNOSTIC


2484 i((
t
 =

2485 
	`__os_mloc
(
v
, 
logc
.
size
, &logc.
da
)) != 0) {

2486 
	`__os_
(
v
, 

);

2487  (
t
);

2490 
logc
.
da
 = 

->data;

2493 i(
ad
 > 0)

2494 
	`memt
((
u_t8_t
 *)
logc
.
da
 +ogc.
size
 - 
ad
, 0,pad);

2496 
bp
 = 
logc
.
da
;

2498 
	`LOGCOPY_32
(
v
, 
bp
, &
y
);

2499 
bp
 +(
y
);

2501 
	`LOGCOPY_32
(
v
, 
bp
, &
txn_num
);

2502 
bp
 +(
txn_num
);

2504 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
lp
);

2505 
bp
 +(
DB_LSN
);

2507 
ump
 = (
u_t32_t
)
dbp
->
log_fame
->
id
;

2508 
	`LOGCOPY_32
(
v
, 
bp
, &
ump
);

2509 
bp
 +(
ump
);

2511 
ump
 = (
u_t32_t
)
pgno
;

2512 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2513 
bp
 +(
ump
);

2515 i(
ma_l
 !
NULL
) {

2516 i(
tx
 !
NULL
) {

2517 
LOG
 *

 = 
v
->
lg_hd
->
gfo
.
imy
;

2518 i(
	`LOG_COMPARE
(
ma_l
, &

->
l
>0 && (
t
 =

2519 
	`__log_check_ge_l
(
v
, 
dbp
, 
ma_l
) != 0))

2520  (
t
);

2522 
	`LOGCOPY_FROMLSN
(
v
, 
bp
, 
ma_l
);

2524 
	`memt
(
bp
, 0, (*
ma_l
));

2525 
bp
 +(*
ma_l
);

2527 
ump
 = (
u_t32_t
)
ma_pgno
;

2528 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2529 
bp
 +(
ump
);

2531 i(
hd
 =
NULL
) {

2532 
zo
 = 0;

2533 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

2534 
bp
 +(
u_t32_t
);

2536 
	`LOGCOPY_32
(
v
, 
bp
, &
hd
->
size
);

2537 
bp
 +(
hd
->
size
);

2538 
	`memy
(
bp
, 
hd
->
da
, hd->
size
);

2539 i(
	`LOG_SWAPPED
(
v
))

2540 i((
t
 = 
	`__db_gesw
(
dbp
,

2541 (
PAGE
 *)
bp
, (
size_t
)
hd
->
size
, (
DBT
 *)
da
, 0)) != 0)

2542  (
t
);

2543 
bp
 +
hd
->
size
;

2546 
ump
 = (
u_t32_t
)
xt
;

2547 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2548 
bp
 +(
ump
);

2550 
ump
 = (
u_t32_t
)
ϡ_pgno
;

2551 
	`LOGCOPY_32
(
v
,
bp
, &
ump
);

2552 
bp
 +(
ump
);

2554 i(
da
 =
NULL
) {

2555 
zo
 = 0;

2556 
	`LOGCOPY_32
(
v
, 
bp
, &
zo
);

2557 
bp
 +(
u_t32_t
);

2559 
	`LOGCOPY_32
(
v
, 
bp
, &
da
->
size
);

2560 
bp
 +(
da
->
size
);

2561 
	`memy
(
bp
, 
da
->da, da->
size
);

2562 i(
	`LOG_SWAPPED
(
v
&& 
	`F_ISSET
(
da
, 
DB_DBT_APPMALLOC
))

2563 
	`__os_
(
v
, 
da
->data);

2564 
bp
 +
da
->
size
;

2567 
	`DB_ASSERT
(
v
,

2568 (
u_t32_t
)(
bp
 - (
u_t8_t
 *)
logc
.
da
<logc.
size
);

2570 i(
is_dub
 || 
tx
 =
NULL
) {

2571 i((
t
 = 
	`__log_put
(
v
, 
p
,(
DBT
 *)&
logc
,

2572 
ags
 | 
DB_LOG_NOCOPY
)=0 && 
tx
 !
NUL