1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
|
#
# $Id: rpc.src,v 1.30 2000/12/20 21:53:05 ubell Exp $
# Syntax:
# BEGIN function_name RPC # {CODE | NOCLNTCODE | RETCODE | NOFUNC}
# CODE: generate XDR and client code, return status
# Used for functions that just return a status and nothing else.
# RETCODE:generate XDR and client code, call return function
# (generate template return function)
# Used for functions that returns data.
# NOCLNTCODE: generate only XDR and server functions
# Used for functions that are "different" on the client.
# Primarily used for envcreate (which is called from
# the dbenv->set_server method on the client side) and
# dbcreate, which is called from non-generated code.
# NOFUNC: generate a client "unsupported function" with right args
# Used for unsupported functions.
#
# ARG {IGNORE | STRING | INT | DBT | LIST | ID | CONST} C-type varname
# IGNORE: not passed to server
# STRING: string passed to server
# DBT: DBT arg passed to server
# LIST: opaque list passed to server (NULL-terminated opaque list)
# INT: integer passed to server
# ID: cl_id from arg passed to server
# CONST: do not generate COMPQUIET (for NOFUNC only)
# FUNCPROT prototype
# FUNCARG functiontype
# These two *MUST* go together and FUNCPROT *MUST* be first. These
# are for the tricky user-supplied functions to some methods. They
# are not supported in RPC, so will be ignored, but the complicated
# syntax of their argument requires we have a special flag for them
# that contains the verbatim text to use in the prototype and the
# c-type, respectively. The FUNCARG must include the function, and
# must call it 'funcN', where N is the count of functions. Almost
# always it must be func0. A *very* few methods have more than one
# user-supplied functions, in those cases, it must be func0, func1, etc.
#
# All messages automatically return "status" and return that from
# the call to the function. RET's are additional things the server
# may return. RET is like ARG but does not need the IGNORE option.
# RET {STRING | INT | DBT | LIST | ID} varname [STRING | INT | ID]
# STRING: string from server
# DBT: DBT arg from server
# LIST: opaque list from server (NULL-terminated opaque list)
# Must have list type of STRING, ID or INT specified
# INT: integer from server
# ID: id from server stored in cl_id
# END function end.
#
# Environment functions
#
BEGIN env_cachesize 1 CODE
ARG ID DB_ENV * dbenv
ARG INT u_int32_t gbytes
ARG INT u_int32_t bytes
ARG INT int ncache
END
BEGIN env_close 1 RETCODE
ARG ID DB_ENV * dbenv
ARG INT u_int32_t flags
END
BEGIN env_create 1 NOCLNTCODE
ARG INT long timeout
RET ID long env
END
BEGIN set_data_dir 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG STRING const char * dir
END
BEGIN env_set_feedback 1 NOFUNC
ARG ID DB_ENV * dbenv
FUNCPROT void (*)(DB_ENV *, int, int)
FUNCARG void (*func0) __P((DB_ENV *, int, int))
END
BEGIN env_flags 1 CODE
ARG ID DB_ENV * dbenv
ARG INT u_int32_t flags
ARG INT int onoff
END
BEGIN set_lg_bsize 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t bsize
END
BEGIN set_lg_dir 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG STRING const char * dir
END
BEGIN set_lg_max 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t max
END
BEGIN set_lk_conflict 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int8_t * conflicts
ARG INT int modes
END
BEGIN set_lk_detect 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t detect
END
BEGIN set_lk_max 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t max
END
BEGIN set_lk_max_locks 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t max
END
BEGIN set_lk_max_lockers 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t max
END
BEGIN set_lk_max_objects 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t max
END
BEGIN set_mp_mmapsize 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT size_t mmapsize
END
BEGIN set_mutex_locks 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT int do_lock
END
BEGIN env_open 1 RETCODE
ARG ID DB_ENV * dbenv
ARG STRING const char * home
ARG INT u_int32_t flags
ARG INT int mode
END
BEGIN env_paniccall 1 NOFUNC
ARG ID DB_ENV * dbenv
FUNCPROT void (*)(DB_ENV *, int)
FUNCARG void (*func0) __P((DB_ENV *, int))
END
BEGIN set_recovery_init 1 NOFUNC
ARG ID DB_ENV * dbenv
FUNCPROT int (*)(DB_ENV *)
FUNCARG int (*func0) __P((DB_ENV *))
END
BEGIN env_remove 1 RETCODE
ARG ID DB_ENV * dbenv
ARG STRING const char * home
ARG INT u_int32_t flags
END
BEGIN set_shm_key 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT long shm_key
END
BEGIN set_tmp_dir 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG STRING const char * dir
END
BEGIN set_tx_recover 1 NOFUNC
ARG ID DB_ENV * dbenv
FUNCPROT int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)
FUNCARG int (*func0) __P((DB_ENV *, DBT *, DB_LSN *, db_recops))
END
BEGIN set_tx_max 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t max
END
BEGIN set_tx_timestamp 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT time_t * max
END
BEGIN set_verbose 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t which
ARG INT int onoff
END
#
# Transaction functions
#
BEGIN txn_abort 1 RETCODE
ARG ID DB_TXN * txnp
END
BEGIN txn_begin 1 RETCODE
ARG ID DB_ENV * envp
ARG ID DB_TXN * parent
ARG IGNORE DB_TXN ** txnpp
ARG INT u_int32_t flags
RET ID long txnid
END
BEGIN txn_checkpoint 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t kbyte
ARG INT u_int32_t min
END
BEGIN txn_commit 1 RETCODE
ARG ID DB_TXN * txnp
ARG INT u_int32_t flags
END
BEGIN txn_prepare 1 NOFUNC
ARG ID DB_TXN * txnp
END
BEGIN txn_stat 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_TXN_STAT ** statp
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
END
#
# Database functions
#
BEGIN db_bt_compare 1 NOFUNC
ARG ID DB * dbp
FUNCPROT int (*)(DB *, const DBT *, const DBT *)
FUNCARG int (*func0) __P((DB *, const DBT *, const DBT *))
END
BEGIN db_bt_maxkey 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t maxkey
END
BEGIN db_bt_minkey 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t minkey
END
BEGIN db_bt_prefix 1 NOFUNC
ARG ID DB * dbp
FUNCPROT size_t(*)(DB *, const DBT *, const DBT *)
FUNCARG size_t (*func0) __P((DB *, const DBT *, const DBT *))
END
BEGIN db_set_append_recno 1 NOFUNC
ARG ID DB * dbp
FUNCPROT int (*)(DB *, DBT *, db_recno_t)
FUNCARG int (*func0) __P((DB *, DBT *, db_recno_t))
END
BEGIN db_cachesize 1 NOFUNC
ARG ID DB * dbp
ARG INT u_int32_t gbytes
ARG INT u_int32_t bytes
ARG INT int ncache
END
BEGIN db_close 1 RETCODE
ARG ID DB * dbp
ARG INT u_int32_t flags
END
BEGIN db_create 1 NOCLNTCODE
ARG INT u_int32_t flags
ARG ID DB_ENV * envp
RET ID long dbp
END
BEGIN db_del 1 CODE
ARG ID DB * dbp
ARG ID DB_TXN * txnp
ARG DBT DBT * key
ARG INT u_int32_t flags
END
BEGIN db_extentsize 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t extentsize
END
BEGIN db_fd 1 NOFUNC
ARG ID DB * dbp
ARG IGNORE int * fdp
END
BEGIN db_feedback 1 NOFUNC
ARG ID DB * dbp
FUNCPROT void (*)(DB *, int, int)
FUNCARG void (*func0) __P((DB *, int, int))
END
BEGIN db_flags 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t flags
END
BEGIN db_get 1 RETCODE
ARG ID DB * dbp
ARG ID DB_TXN * txnp
ARG DBT DBT * key
ARG DBT DBT * data
ARG INT u_int32_t flags
RET DBT DBT * key
RET DBT DBT * data
END
BEGIN db_h_ffactor 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t ffactor
END
BEGIN db_h_hash 1 NOFUNC
ARG ID DB * dbp
FUNCPROT u_int32_t(*)(DB *, const void *, u_int32_t)
FUNCARG u_int32_t (*func0) __P((DB *, const void *, u_int32_t))
END
BEGIN db_h_nelem 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t nelem
END
BEGIN db_key_range 1 RETCODE
ARG ID DB * dbp
ARG ID DB_TXN * txnp
ARG DBT DBT * key
ARG IGNORE DB_KEY_RANGE * range
ARG INT u_int32_t flags
RET DBL double less
RET DBL double equal
RET DBL double greater
END
BEGIN db_lorder 1 CODE
ARG ID DB * dbp
ARG INT int lorder
END
BEGIN db_malloc 1 NOFUNC
ARG ID DB * dbp
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
END
# XXX
# The line:
# RET INT u_int32_t dbflags
# should go away when a get_flags method exists. It is
# needed now because Tcl looks at dbp->flags.
#
BEGIN db_open 1 RETCODE
ARG ID DB * dbp
ARG STRING const char * name
ARG STRING const char * subdb
ARG INT DBTYPE type
ARG INT u_int32_t flags
ARG INT int mode
RET INT DBTYPE type
RET INT u_int32_t dbflags
END
BEGIN db_pagesize 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t pagesize
END
BEGIN db_panic 1 NOFUNC
ARG ID DB * dbp
FUNCPROT void (*)(DB_ENV *, int)
FUNCARG void (*func0) __P((DB_ENV *, int))
END
BEGIN db_put 1 RETCODE
ARG ID DB * dbp
ARG ID DB_TXN * txnp
ARG DBT DBT * key
ARG DBT DBT * data
ARG INT u_int32_t flags
RET DBT DBT * key
END
BEGIN db_realloc 1 NOFUNC
ARG ID DB * dbp
FUNCPROT void *(*)(void *, size_t)
FUNCARG void *(*func0) __P((void *, size_t))
END
BEGIN db_re_delim 1 CODE
ARG ID DB * dbp
ARG INT int delim
END
BEGIN db_re_len 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t len
END
BEGIN db_re_pad 1 CODE
ARG ID DB * dbp
ARG INT int pad
END
BEGIN db_re_source 1 NOFUNC
ARG ID DB * dbp
ARG STRING const char * re_source
END
BEGIN db_remove 1 RETCODE
ARG ID DB * dbp
ARG STRING const char * name
ARG STRING const char * subdb
ARG INT u_int32_t flags
END
BEGIN db_rename 1 RETCODE
ARG ID DB * dbp
ARG STRING const char * name
ARG STRING const char * subdb
ARG STRING const char * newname
ARG INT u_int32_t flags
END
BEGIN db_stat 1 RETCODE
ARG ID DB * dbp
ARG IGNORE void * sp
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
ARG INT u_int32_t flags
RET LIST u_int32_t * stats INT
END
BEGIN db_swapped 1 CODE
ARG ID DB * dbp
END
BEGIN db_sync 1 CODE
ARG ID DB * dbp
ARG INT u_int32_t flags
END
BEGIN db_upgrade 1 NOFUNC
ARG ID DB * dbp
ARG STRING const char * fname
ARG INT u_int32_t flags
END
#
# Cursor functions
#
BEGIN db_cursor 1 RETCODE
ARG ID DB * dbp
ARG ID DB_TXN * txnp
ARG IGNORE DBC ** dbcpp
ARG INT u_int32_t flags
RET ID long dbcid
END
BEGIN db_join 1 RETCODE
ARG ID DB * dbp
ARG LIST DBC ** curs ID
ARG IGNORE DBC ** dbcp
ARG INT u_int32_t flags
RET ID long dbcid
END
BEGIN dbc_close 1 RETCODE
ARG ID DBC * dbc
END
BEGIN dbc_count 1 RETCODE
ARG ID DBC * dbc
ARG IGNORE db_recno_t * countp
ARG INT u_int32_t flags
RET INT db_recno_t dupcount
END
BEGIN dbc_del 1 CODE
ARG ID DBC * dbc
ARG INT u_int32_t flags
END
BEGIN dbc_dup 1 RETCODE
ARG ID DBC * dbc
ARG IGNORE DBC ** dbcp
ARG INT u_int32_t flags
RET ID long dbcid
END
BEGIN dbc_get 1 RETCODE
ARG ID DBC * dbc
ARG DBT DBT * key
ARG DBT DBT * data
ARG INT u_int32_t flags
RET DBT DBT * key
RET DBT DBT * data
END
BEGIN dbc_put 1 RETCODE
ARG ID DBC * dbc
ARG DBT DBT * key
ARG DBT DBT * data
ARG INT u_int32_t flags
RET DBT DBT * key
END
#
# Unsupported environment subsystems
#
#
# Locking subsystem
#
BEGIN lock_detect 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t flags
ARG INT u_int32_t atype
ARG IGNORE int * aborted
END
BEGIN lock_get 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t locker
ARG INT u_int32_t flags
ARG CONST const DBT * obj
ARG INT db_lockmode_t mode
ARG IGNORE DB_LOCK * lock
END
BEGIN lock_id 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t * idp
END
BEGIN lock_put 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG ID DB_LOCK * lock
END
BEGIN lock_stat 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_LOCK_STAT ** statp
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
END
BEGIN lock_vec 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT u_int32_t locker
ARG INT u_int32_t flags
ARG IGNORE DB_LOCKREQ * list
ARG INT int nlist
ARG IGNORE DB_LOCKREQ ** elistp
END
#
# Logging subsystem
#
BEGIN log_archive 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE char *** listp
ARG INT u_int32_t flags
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
END
#
# Don't do log_compare. It doesn't have an env we can get at,
# and it doesn't manipulate DB internal information.
#
BEGIN log_file 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG CONST const DB_LSN * lsn
ARG STRING char * namep
ARG INT size_t len
END
BEGIN log_flush 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG CONST const DB_LSN * lsn
END
BEGIN log_get 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_LSN * lsn
ARG DBT DBT * data
ARG INT u_int32_t flags
END
BEGIN log_put 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_LSN * lsn
ARG CONST const DBT * data
ARG INT u_int32_t flags
END
BEGIN log_register 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG ID DB * dbp
ARG CONST const char * namep
END
BEGIN log_stat 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_LOG_STAT ** statp
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
END
BEGIN log_unregister 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG ID DB * dbp
END
#
# Mpool Subsystem
#
BEGIN memp_fclose 1 NOFUNC
ARG ID DB_MPOOLFILE * mpf
END
BEGIN memp_fget 1 NOFUNC
ARG ID DB_MPOOLFILE * mpf
ARG IGNORE db_pgno_t * pgno
ARG INT u_int32_t flags
ARG IGNORE void ** pagep
END
BEGIN memp_fopen 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG CONST const char * file
ARG INT u_int32_t flags
ARG INT int mode
ARG INT size_t pagesize
ARG IGNORE DB_MPOOL_FINFO * finfop
ARG IGNORE DB_MPOOLFILE ** mpf
END
BEGIN memp_fput 1 NOFUNC
ARG ID DB_MPOOLFILE * mpf
ARG IGNORE void * pgaddr
ARG INT u_int32_t flags
END
BEGIN memp_fset 1 NOFUNC
ARG ID DB_MPOOLFILE * mpf
ARG IGNORE void * pgaddr
ARG INT u_int32_t flags
END
BEGIN memp_fsync 1 NOFUNC
ARG ID DB_MPOOLFILE * mpf
END
BEGIN memp_register 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT int ftype
FUNCPROT int (*)(DB_ENV *, db_pgno_t, void *, DBT *)
FUNCARG int (*func0) __P((DB_ENV *, db_pgno_t, void *, DBT *))
FUNCPROT int (*)(DB_ENV *, db_pgno_t, void *, DBT *)
FUNCARG int (*func1) __P((DB_ENV *, db_pgno_t, void *, DBT *))
END
BEGIN memp_stat 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_MPOOL_STAT ** gstatp
ARG IGNORE DB_MPOOL_FSTAT *** fstatp
FUNCPROT void *(*)(size_t)
FUNCARG void *(*func0) __P((size_t))
END
BEGIN memp_sync 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG IGNORE DB_LSN * lsn
END
BEGIN memp_trickle 1 NOFUNC
ARG ID DB_ENV * dbenv
ARG INT int pct
ARG IGNORE int * nwrotep
END
|