1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-03-22 04:25+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man3/btree.3:34
26 #: build/C/man3/btree.3:34 build/C/man3/hash.3:34 build/C/man3/recno.3:34
32 #: build/C/man3/btree.3:34 build/C/man3/dbopen.3:34 build/C/man3/hash.3:34 build/C/man3/mpool.3:34 build/C/man3/recno.3:34
34 msgid "Linux Programmer's Manual"
38 #: build/C/man3/btree.3:36 build/C/man3/dbopen.3:36 build/C/man3/hash.3:36 build/C/man3/mpool.3:36 build/C/man3/recno.3:36
44 #: build/C/man3/btree.3:38
45 msgid "btree - btree database access method"
49 #: build/C/man3/btree.3:38 build/C/man3/dbopen.3:38 build/C/man3/hash.3:38 build/C/man3/mpool.3:38 build/C/man3/recno.3:38
55 #: build/C/man3/btree.3:43 build/C/man3/hash.3:43 build/C/man3/recno.3:43
58 "B<#include E<lt>sys/types.hE<gt>\n"
59 "#include E<lt>db.hE<gt>>\n"
63 #: build/C/man3/btree.3:45 build/C/man3/dbopen.3:48 build/C/man3/hash.3:45 build/C/man3/mpool.3:60 build/C/man3/recno.3:45
69 #: build/C/man3/btree.3:53
71 "The routine B<dbopen>(3) is the library interface to database files. One "
72 "of the supported file formats is btree files. The general description of "
73 "the database access methods is in B<dbopen>(3), this manual page describes "
74 "only the btree specific information."
78 #: build/C/man3/btree.3:56
80 "The btree data structure is a sorted, balanced tree structure storing "
81 "associated key/data pairs."
85 #: build/C/man3/btree.3:62
87 "The btree access method specific data structure provided to B<dbopen>(3) is "
88 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
92 #: build/C/man3/btree.3:75
96 " unsigned long flags;\n"
97 " unsigned int cachesize;\n"
100 " unsigned int psize;\n"
101 " int (*compare)(const DBT *key1, const DBT *key2);\n"
102 " size_t (*prefix)(const DBT *key1, const DBT *key2);\n"
108 #: build/C/man3/btree.3:79 build/C/man3/hash.3:76
109 msgid "The elements of this structure are as follows:"
113 #: build/C/man3/btree.3:79
119 #: build/C/man3/btree.3:82 build/C/man3/recno.3:88
120 msgid "The flag value is specified by ORing any of the following values:"
124 #: build/C/man3/btree.3:83
130 #: build/C/man3/btree.3:102
132 "Permit duplicate keys in the tree, that is, permit insertion if the key to "
133 "be inserted already exists in the tree. The default behavior, as described "
134 "in B<dbopen>(3), is to overwrite a matching key when inserting a new key or "
135 "to fail if the B<R_NOOVERWRITE> flag is specified. The B<R_DUP> flag is "
136 "overridden by the B<R_NOOVERWRITE> flag, and if the B<R_NOOVERWRITE> flag is "
137 "specified, attempts to insert duplicate keys into the tree will fail."
141 #: build/C/man3/btree.3:112
143 "If the database contains duplicate keys, the order of retrieval of key/data "
144 "pairs is undefined if the I<get> routine is used, however, I<seq> routine "
145 "calls with the B<R_CURSOR> flag set will always return the logical \"first\" "
146 "of any group of duplicate keys."
150 #: build/C/man3/btree.3:113 build/C/man3/hash.3:93 build/C/man3/recno.3:120
156 #: build/C/man3/btree.3:128
158 "A suggested maximum size (in bytes) of the memory cache. This value is "
159 "I<only> advisory, and the access method will allocate more memory rather "
160 "than fail. Since every search examines the root page of the tree, caching "
161 "the most recently used pages substantially improves access time. In "
162 "addition, physical writes are delayed as long as possible, so a moderate "
163 "cache can reduce the number of I/O operations significantly. Obviously, "
164 "using a cache increases (but only increases) the likelihood of corruption or "
165 "lost data if the system crashes while a tree is being modified. If "
166 "I<cachesize> is 0 (no size is specified) a default cache is used."
170 #: build/C/man3/btree.3:128
172 msgid "I<maxkeypage>"
175 #. The maximum number of keys which will be stored on any single page.
176 #. Because of the way the btree data structure works,
178 #. must always be greater than or equal to 2.
181 #. is 0 (no maximum number of keys is specified) the page fill factor is
182 #. made as large as possible (which is almost invariably what is wanted).
184 #: build/C/man3/btree.3:140
186 "The maximum number of keys which will be stored on any single page. Not "
187 "currently implemented."
191 #: build/C/man3/btree.3:140
193 msgid "I<minkeypage>"
197 #: build/C/man3/btree.3:150
199 "The minimum number of keys which will be stored on any single page. This "
200 "value is used to determine which keys will be stored on overflow pages, that "
201 "is, if a key or data item is longer than the pagesize divided by the "
202 "minkeypage value, it will be stored on overflow pages instead of in the page "
203 "itself. If I<minkeypage> is 0 (no minimum number of keys is specified) a "
204 "value of 2 is used."
208 #: build/C/man3/btree.3:150 build/C/man3/recno.3:129
214 #: build/C/man3/btree.3:158
216 "Page size is the size (in bytes) of the pages used for nodes in the tree. "
217 "The minimum page size is 512 bytes and the maximum page size is 64K. If "
218 "I<psize> is 0 (no page size is specified) a page size is chosen based on the "
219 "underlying file system I/O block size."
223 #: build/C/man3/btree.3:158
229 #: build/C/man3/btree.3:170
231 "Compare is the key comparison function. It must return an integer less "
232 "than, equal to, or greater than zero if the first key argument is considered "
233 "to be respectively less than, equal to, or greater than the second key "
234 "argument. The same comparison function must be used on a given tree every "
235 "time it is opened. If I<compare> is NULL (no comparison function is "
236 "specified), the keys are compared lexically, with shorter keys considered "
237 "less than longer keys."
241 #: build/C/man3/btree.3:170
247 #: build/C/man3/btree.3:189
249 "Prefix is the prefix comparison function. If specified, this routine must "
250 "return the number of bytes of the second key argument which are necessary to "
251 "determine that it is greater than the first key argument. If the keys are "
252 "equal, the key length should be returned. Note, the usefulness of this "
253 "routine is very data-dependent, but, in some data sets can produce "
254 "significantly reduced tree sizes and search times. If I<prefix> is NULL (no "
255 "prefix function is specified), I<and> no comparison function is specified, a "
256 "default lexical comparison routine is used. If I<prefix> is NULL and a "
257 "comparison routine is specified, no prefix comparison is done."
261 #: build/C/man3/btree.3:189 build/C/man3/hash.3:108 build/C/man3/recno.3:141
267 #: build/C/man3/btree.3:197 build/C/man3/recno.3:149
269 "The byte order for integers in the stored database metadata. The number "
270 "should represent the order as an integer; for example, big endian order "
271 "would be the number 4,321. If I<lorder> is 0 (no order is specified) the "
272 "current host order is used."
276 #: build/C/man3/btree.3:208
278 "If the file already exists (and the B<O_TRUNC> flag is not specified), the "
279 "values specified for the arguments I<flags>, I<lorder> and I<psize> are "
280 "ignored in favor of the values used when the tree was created."
284 #: build/C/man3/btree.3:210
285 msgid "Forward sequential scans of a tree are from the least key to the greatest."
289 #: build/C/man3/btree.3:216
291 "Space freed up by deleting key/data pairs from the tree is never reclaimed, "
292 "although it is normally made available for reuse. This means that the btree "
293 "storage structure is grow-only. The only solutions are to avoid excessive "
294 "deletions, or to create a fresh tree periodically from a scan of an existing "
299 #: build/C/man3/btree.3:222
301 "Searches, insertions, and deletions in a btree will all complete in O lg "
302 "base N where base is the average fill factor. Often, inserting ordered data "
303 "into btrees results in a low fill factor. This implementation has been "
304 "modified to make ordered insertion the best case, resulting in a much better "
305 "than normal page fill factor."
309 #: build/C/man3/btree.3:222 build/C/man3/dbopen.3:471 build/C/man3/hash.3:142 build/C/man3/mpool.3:176 build/C/man3/recno.3:201
315 #: build/C/man3/btree.3:229
317 "The I<btree> access method routines may fail and set I<errno> for any of the "
318 "errors specified for the library routine B<dbopen>(3)."
322 #: build/C/man3/btree.3:229 build/C/man3/dbopen.3:533 build/C/man3/hash.3:149 build/C/man3/recno.3:213
328 #: build/C/man3/btree.3:231 build/C/man3/recno.3:215
329 msgid "Only big and little endian byte order is supported."
333 #: build/C/man3/btree.3:231 build/C/man3/dbopen.3:544 build/C/man3/hash.3:151 build/C/man3/mpool.3:221 build/C/man3/recno.3:215
339 #: build/C/man3/btree.3:236
340 msgid "B<dbopen>(3), B<hash>(3), B<mpool>(3), B<recno>(3)"
344 #: build/C/man3/btree.3:239
346 "I<The Ubiquitous B-tree>, Douglas Comer, ACM Comput. Surv. 11, 2 (June "
351 #: build/C/man3/btree.3:243
353 "I<Prefix B-trees>, Bayer and Unterauer, ACM Transactions on Database "
354 "Systems, Vol. 2, 1 (March 1977), 11-26."
358 #: build/C/man3/btree.3:246
360 "I<The Art of Computer Programming Vol. 3: Sorting and Searching>, "
361 "D.E. Knuth, 1968, pp 471-480."
365 #: build/C/man3/btree.3:246 build/C/man3/dbopen.3:552 build/C/man3/hash.3:162 build/C/man3/mpool.3:226 build/C/man3/recno.3:224
371 #: build/C/man3/btree.3:253 build/C/man3/dbopen.3:559 build/C/man3/hash.3:169 build/C/man3/mpool.3:233 build/C/man3/recno.3:231
373 "This page is part of release 3.37 of the Linux I<man-pages> project. A "
374 "description of the project, and information about reporting bugs, can be "
375 "found at http://www.kernel.org/doc/man-pages/."
379 #: build/C/man3/dbopen.3:34
385 #: build/C/man3/dbopen.3:34
391 #: build/C/man3/dbopen.3:38
392 msgid "dbopen - database access methods"
396 #: build/C/man3/dbopen.3:43
399 "B<#include E<lt>sys/types.hE<gt>>\n"
400 "B<#include E<lt>limits.hE<gt>>\n"
401 "B<#include E<lt>db.hE<gt>>\n"
405 #: build/C/man3/dbopen.3:47
408 "B<DB *dbopen(const char *>I<file>B<, int >I<flags>B<, int >I<mode>B<, DBTYPE "
410 "B< const void *>I<openinfo>B<);>\n"
414 #: build/C/man3/dbopen.3:62
416 "B<dbopen>() is the library interface to database files. The supported file "
417 "formats are btree, hashed and UNIX file oriented. The btree format is a "
418 "representation of a sorted, balanced tree structure. The hashed format is "
419 "an extensible, dynamic hashing scheme. The flat-file format is a byte "
420 "stream file with fixed or variable length records. The formats and file "
421 "format specific information are described in detail in their respective "
422 "manual pages B<btree>(3), B<hash>(3) and B<recno>(3)."
426 #: build/C/man3/dbopen.3:71
428 "B<dbopen>() opens I<file> for reading and/or writing. Files never intended "
429 "to be preserved on disk may be created by setting the I<file> argument to "
433 #. Three additional options may be specified by ORing
439 #. Do the necessary locking in the database to support concurrent access.
440 #. If concurrent access isn't needed or the database is read-only this
441 #. flag should not be set, as it tends to have an associated performance
445 #. Place the underlying memory pool used by the database in shared
447 #. Necessary for concurrent access.
450 #. Support transactions in the database.
451 #. The DB_LOCK and DB_SHMEM flags must be set as well.
453 #: build/C/man3/dbopen.3:111
455 "The I<flags> and I<mode> arguments are as specified to the B<open>(2) "
456 "routine, however, only the B<O_CREAT>, B<O_EXCL>, B<O_EXLOCK>, "
457 "B<O_NONBLOCK>, B<O_RDONLY>, B<O_RDWR>, B<O_SHLOCK>, and B<O_TRUNC> flags are "
458 "meaningful. (Note, opening a database file B<O_WRONLY> is not possible.)"
462 #: build/C/man3/dbopen.3:124
464 "The I<type> argument is of type I<DBTYPE> (as defined in the "
465 "I<E<lt>db.hE<gt>> include file) and may be set to B<DB_BTREE>, B<DB_HASH>, "
470 #: build/C/man3/dbopen.3:133
472 "The I<openinfo> argument is a pointer to an access method specific structure "
473 "described in the access method's manual page. If I<openinfo> is NULL, each "
474 "access method will use defaults appropriate for the system and the access "
479 #: build/C/man3/dbopen.3:144
481 "B<dbopen>() returns a pointer to a I<DB> structure on success and NULL on "
482 "error. The I<DB> structure is defined in the I<E<lt>db.hE<gt>> include "
483 "file, and contains at least the following fields:"
487 #: build/C/man3/dbopen.3:160
492 " int (*close)(const DB *db);\n"
493 " int (*del)(const DB *db, const DBT *key, unsigned int flags);\n"
494 " int (*fd)(const DB *db);\n"
495 " int (*get)(const DB *db, DBT *key, DBT *data,\n"
496 " unsigned int flags);\n"
497 " int (*put)(const DB *db, DBT *key, const DBT *data,\n"
498 " unsigned int flags);\n"
499 " int (*sync)(const DB *db, unsigned int flags);\n"
500 " int (*seq)(const DB *db, DBT *key, DBT *data,\n"
501 " unsigned int flags);\n"
506 #: build/C/man3/dbopen.3:168
508 "These elements describe a database type and a set of functions performing "
509 "various actions. These functions take a pointer to a structure as returned "
510 "by B<dbopen>(), and sometimes one or more pointers to key/data structures "
515 #: build/C/man3/dbopen.3:168
521 #: build/C/man3/dbopen.3:171
522 msgid "The type of the underlying access method (and file format)."
526 #: build/C/man3/dbopen.3:171
532 #: build/C/man3/dbopen.3:185
534 "A pointer to a routine to flush any cached information to disk, free any "
535 "allocated resources, and close the underlying file(s). Since key/data pairs "
536 "may be cached in memory, failing to sync the file with a I<close> or I<sync> "
537 "function may result in inconsistent or lost information. I<close> routines "
538 "return -1 on error (setting I<errno>) and 0 on success."
542 #: build/C/man3/dbopen.3:185
548 #: build/C/man3/dbopen.3:188
549 msgid "A pointer to a routine to remove key/data pairs from the database."
553 #: build/C/man3/dbopen.3:192
554 msgid "The argument I<flag> may be set to the following value:"
558 #: build/C/man3/dbopen.3:193 build/C/man3/dbopen.3:249 build/C/man3/dbopen.3:349
564 #: build/C/man3/dbopen.3:197
566 "Delete the record referenced by the cursor. The cursor must have previously "
571 #: build/C/man3/dbopen.3:205
573 "I<delete> routines return -1 on error (setting I<errno>), 0 on success, and "
574 "1 if the specified I<key> was not in the file."
578 #: build/C/man3/dbopen.3:205
584 #: build/C/man3/dbopen.3:227
586 "A pointer to a routine which returns a file descriptor representative of the "
587 "underlying database. A file descriptor referencing the same file will be "
588 "returned to all processes which call B<dbopen>() with the same I<file> "
589 "name. This file descriptor may be safely used as an argument to the "
590 "B<fcntl>(2) and B<flock>(2) locking functions. The file descriptor is not "
591 "necessarily associated with any of the underlying files used by the access "
592 "method. No file descriptor is available for in memory databases. I<fd> "
593 "routines return -1 on error (setting I<errno>), and the file descriptor on "
598 #: build/C/man3/dbopen.3:227
604 #: build/C/man3/dbopen.3:241
606 "A pointer to a routine which is the interface for keyed retrieval from the "
607 "database. The address and length of the data associated with the specified "
608 "I<key> are returned in the structure referenced by I<data>. I<get> routines "
609 "return -1 on error (setting I<errno>), 0 on success, and 1 if the I<key> was "
614 #: build/C/man3/dbopen.3:241
620 #: build/C/man3/dbopen.3:244
621 msgid "A pointer to a routine to store key/data pairs in the database."
625 #: build/C/man3/dbopen.3:248
626 msgid "The argument I<flag> may be set to one of the following values:"
630 #: build/C/man3/dbopen.3:253
632 "Replace the key/data pair referenced by the cursor. The cursor must have "
633 "previously been initialized."
637 #: build/C/man3/dbopen.3:253
643 #: build/C/man3/dbopen.3:264
645 "Append the data immediately after the data referenced by I<key>, creating a "
646 "new key/data pair. The record number of the appended key/data pair is "
647 "returned in the I<key> structure. (Applicable only to the B<DB_RECNO> "
652 #: build/C/man3/dbopen.3:264
658 #: build/C/man3/dbopen.3:275
660 "Insert the data immediately before the data referenced by I<key>, creating a "
661 "new key/data pair. The record number of the inserted key/data pair is "
662 "returned in the I<key> structure. (Applicable only to the B<DB_RECNO> "
667 #: build/C/man3/dbopen.3:275
669 msgid "B<R_NOOVERWRITE>"
673 #: build/C/man3/dbopen.3:278
674 msgid "Enter the new key/data pair only if the key does not previously exist."
678 #: build/C/man3/dbopen.3:278
680 msgid "B<R_SETCURSOR>"
684 #: build/C/man3/dbopen.3:287
686 "Store the key/data pair, setting or initializing the position of the cursor "
687 "to reference it. (Applicable only to the B<DB_BTREE> and B<DB_RECNO> access "
692 #: build/C/man3/dbopen.3:297
694 "B<R_SETCURSOR> is available only for the B<DB_BTREE> and B<DB_RECNO> access "
695 "methods because it implies that the keys have an inherent order which does "
700 #: build/C/man3/dbopen.3:307
702 "B<R_IAFTER> and B<R_IBEFORE> are available only for the B<DB_RECNO> access "
703 "method because they each imply that the access method is able to create new "
704 "keys. This is only true if the keys are ordered and independent, record "
705 "numbers for example."
709 #: build/C/man3/dbopen.3:312
711 "The default behavior of the I<put> routines is to enter the new key/data "
712 "pair, replacing any previously existing key."
716 #: build/C/man3/dbopen.3:320
718 "I<put> routines return -1 on error (setting I<errno>), 0 on success, and 1 "
719 "if the B<R_NOOVERWRITE> I<flag> was set and the key already exists in the "
724 #: build/C/man3/dbopen.3:320
730 #: build/C/man3/dbopen.3:331
732 "A pointer to a routine which is the interface for sequential retrieval from "
733 "the database. The address and length of the key are returned in the "
734 "structure referenced by I<key>, and the address and length of the data are "
735 "returned in the structure referenced by I<data>."
739 #: build/C/man3/dbopen.3:344
741 "Sequential key/data pair retrieval may begin at any time, and the position "
742 "of the \"cursor\" is not affected by calls to the I<del>, I<get>, I<put>, or "
743 "I<sync> routines. Modifications to the database during a sequential scan "
744 "will be reflected in the scan, that is, records inserted behind the cursor "
745 "will not be returned while records inserted in front of the cursor will be "
750 #: build/C/man3/dbopen.3:348
751 msgid "The flag value B<must> be set to one of the following values:"
755 #: build/C/man3/dbopen.3:362
757 "The data associated with the specified key is returned. This differs from "
758 "the I<get> routines in that it sets or initializes the cursor to the "
759 "location of the key as well. (Note, for the B<DB_BTREE> access method, the "
760 "returned key is not necessarily an exact match for the specified key. The "
761 "returned key is the smallest key greater than or equal to the specified key, "
762 "permitting partial key matches and range searches.)"
766 #: build/C/man3/dbopen.3:362
772 #: build/C/man3/dbopen.3:366
774 "The first key/data pair of the database is returned, and the cursor is set "
775 "or initialized to reference it."
779 #: build/C/man3/dbopen.3:366
785 #: build/C/man3/dbopen.3:375
787 "The last key/data pair of the database is returned, and the cursor is set or "
788 "initialized to reference it. (Applicable only to the B<DB_BTREE> and "
789 "B<DB_RECNO> access methods.)"
793 #: build/C/man3/dbopen.3:375
799 #: build/C/man3/dbopen.3:381
801 "Retrieve the key/data pair immediately after the cursor. If the cursor is "
802 "not yet set, this is the same as the B<R_FIRST> flag."
806 #: build/C/man3/dbopen.3:381
812 #: build/C/man3/dbopen.3:392
814 "Retrieve the key/data pair immediately before the cursor. If the cursor is "
815 "not yet set, this is the same as the B<R_LAST> flag. (Applicable only to "
816 "the B<DB_BTREE> and B<DB_RECNO> access methods.)"
820 #: build/C/man3/dbopen.3:403
822 "B<R_LAST> and B<R_PREV> are available only for the B<DB_BTREE> and "
823 "B<DB_RECNO> access methods because they each imply that the keys have an "
824 "inherent order which does not change."
828 #: build/C/man3/dbopen.3:416
830 "I<seq> routines return -1 on error (setting I<errno>), 0 on success and 1 if "
831 "there are no key/data pairs less than or greater than the specified or "
832 "current key. If the B<DB_RECNO> access method is being used, and if the "
833 "database file is a character special file and no complete key/data pairs are "
834 "currently available, the I<seq> routines return 2."
838 #: build/C/man3/dbopen.3:416
844 #: build/C/man3/dbopen.3:422
846 "A pointer to a routine to flush any cached information to disk. If the "
847 "database is in memory only, the I<sync> routine has no effect and will "
852 #: build/C/man3/dbopen.3:424
853 msgid "The flag value may be set to the following value:"
857 #: build/C/man3/dbopen.3:425
859 msgid "B<R_RECNOSYNC>"
863 #: build/C/man3/dbopen.3:437
865 "If the B<DB_RECNO> access method is being used, this flag causes the sync "
866 "routine to apply to the btree file which underlies the recno file, not the "
867 "recno file itself. (See the I<bfname> field of the B<recno>(3) manual page "
868 "for more information.)"
872 #: build/C/man3/dbopen.3:443
873 msgid "I<sync> routines return -1 on error (setting I<errno>) and 0 on success."
877 #: build/C/man3/dbopen.3:443
879 msgid "Key/Data Pairs"
883 #: build/C/man3/dbopen.3:446
885 "Access to all file types is based on key/data pairs. Both keys and data are "
886 "represented by the following data structure:"
890 #: build/C/man3/dbopen.3:453
900 #: build/C/man3/dbopen.3:459
901 msgid "The elements of the I<DBT> structure are defined as follows:"
905 #: build/C/man3/dbopen.3:459
911 #: build/C/man3/dbopen.3:462
912 msgid "A pointer to a byte string."
916 #: build/C/man3/dbopen.3:462
922 #: build/C/man3/dbopen.3:465
923 msgid "The length of the byte string."
927 #: build/C/man3/dbopen.3:471
929 "Key and data byte strings may reference strings of essentially unlimited "
930 "length although any two of them must fit into available memory at the same "
931 "time. It should be noted that the access methods provide no guarantees "
932 "about byte string alignment."
936 #: build/C/man3/dbopen.3:481
938 "The B<dbopen>() routine may fail and set I<errno> for any of the errors "
939 "specified for the library routines B<open>(2) and B<malloc>(3) or the "
944 #: build/C/man3/dbopen.3:481
950 #: build/C/man3/dbopen.3:484
951 msgid "A file is incorrectly formatted."
955 #: build/C/man3/dbopen.3:484 build/C/man3/mpool.3:189 build/C/man3/recno.3:209
961 #: build/C/man3/dbopen.3:491
963 "A parameter has been specified (hash function, pad byte etc.) that is "
964 "incompatible with the current file specification or which is not meaningful "
965 "for the function (for example, use of the cursor without prior "
966 "initialization) or there is a mismatch between the version number of file "
971 #: build/C/man3/dbopen.3:503
973 "The I<close> routines may fail and set I<errno> for any of the errors "
974 "specified for the library routines B<close>(2), B<read>(2), B<write>(2), "
975 "B<free>(3), or B<fsync>(2)."
979 #: build/C/man3/dbopen.3:518
981 "The I<del>, I<get>, I<put> and I<seq> routines may fail and set I<errno> for "
982 "any of the errors specified for the library routines B<read>(2), "
983 "B<write>(2), B<free>(3) or B<malloc>(3)."
987 #: build/C/man3/dbopen.3:526
989 "The I<fd> routines will fail and set I<errno> to B<ENOENT> for in memory "
994 #: build/C/man3/dbopen.3:533
996 "The I<sync> routines may fail and set I<errno> for any of the errors "
997 "specified for the library routine B<fsync>(2)."
1001 #: build/C/man3/dbopen.3:538
1003 "The typedef I<DBT> is a mnemonic for \"data base thang\", and was used "
1004 "because no-one could think of a reasonable name that wasn't already used."
1008 #: build/C/man3/dbopen.3:541
1010 "The file descriptor interface is a kludge and will be deleted in a future "
1011 "version of the interface."
1015 #: build/C/man3/dbopen.3:544
1017 "None of the access methods provide any form of concurrent access, locking, "
1022 #: build/C/man3/dbopen.3:549
1023 msgid "B<btree>(3), B<hash>(3), B<mpool>(3), B<recno>(3)"
1027 #: build/C/man3/dbopen.3:552
1029 "I<LIBTP: Portable, Modular Transactions for UNIX>, Margo Seltzer, Michael "
1030 "Olson, USENIX proceedings, Winter 1992."
1034 #: build/C/man3/hash.3:34
1040 #: build/C/man3/hash.3:38
1041 msgid "hash - hash database access method"
1045 #: build/C/man3/hash.3:53
1047 "The routine B<dbopen>(3) is the library interface to database files. One "
1048 "of the supported file formats is hash files. The general description of the "
1049 "database access methods is in B<dbopen>(3), this manual page describes only "
1050 "the hash specific information."
1054 #: build/C/man3/hash.3:55
1055 msgid "The hash data structure is an extensible, dynamic hashing scheme."
1059 #: build/C/man3/hash.3:61
1061 "The access method specific data structure provided to B<dbopen>(3) is "
1062 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
1066 #: build/C/man3/hash.3:72
1069 "typedef struct {\n"
1070 " unsigned int bsize;\n"
1071 " unsigned int ffactor;\n"
1072 " unsigned int nelem;\n"
1073 " unsigned int cachesize;\n"
1074 " uint32_t (*hash)(const void *, size_t);\n"
1080 #: build/C/man3/hash.3:76
1086 #: build/C/man3/hash.3:81
1088 "defines the hash table bucket size, and is, by default, 256 bytes. It may "
1089 "be preferable to increase the page size for disk-resident tables and tables "
1090 "with large data items."
1094 #: build/C/man3/hash.3:81
1100 #: build/C/man3/hash.3:87
1102 "indicates a desired density within the hash table. It is an approximation "
1103 "of the number of keys allowed to accumulate in any one bucket, determining "
1104 "when the hash table grows or shrinks. The default value is 8."
1108 #: build/C/man3/hash.3:87
1114 #: build/C/man3/hash.3:93
1116 "is an estimate of the final size of the hash table. If not set or set too "
1117 "low, hash tables will expand gracefully as keys are entered, although a "
1118 "slight performance degradation may be noticed. The default value is 1."
1122 #: build/C/man3/hash.3:99
1124 "is the suggested maximum size, in bytes, of the memory cache. This value is "
1125 "I<only advisory>, and the access method will allocate more memory rather "
1130 #: build/C/man3/hash.3:99
1136 #: build/C/man3/hash.3:108
1138 "is a user-defined hash function. Since no hash function performs equally "
1139 "well on all possible data, the user may find that the built-in hash function "
1140 "does poorly on a particular data set. A user-specified hash functions must "
1141 "take two arguments (a pointer to a byte string and a length) and return a "
1142 "32-bit quantity to be used as the hash value."
1146 #: build/C/man3/hash.3:118
1148 "is the byte order for integers in the stored database metadata. The number "
1149 "should represent the order as an integer; for example, big endian order "
1150 "would be the number 4,321. If I<lorder> is 0 (no order is specified) the "
1151 "current host order is used. If the file already exists, the specified value "
1152 "is ignored and the value specified when the tree was created is used."
1156 #: build/C/man3/hash.3:130
1158 "If the file already exists (and the B<O_TRUNC> flag is not specified), the "
1159 "values specified for I<bsize>, I<ffactor>, I<lorder>, and I<nelem> are "
1160 "ignored and the values specified when the tree was created are used."
1164 #: build/C/man3/hash.3:135
1166 "If a hash function is specified, I<hash_open> will attempt to determine if "
1167 "the hash function specified is the same as the one with which the database "
1168 "was created, and will fail if it is not."
1172 #: build/C/man3/hash.3:142
1174 "Backward-compatible interfaces to the routines described in B<dbm>(3), and "
1175 "B<ndbm>(3) are provided, however these interfaces are not compatible with "
1176 "previous file formats."
1180 #: build/C/man3/hash.3:149
1182 "The I<hash> access method routines may fail and set I<errno> for any of the "
1183 "errors specified for the library routine B<dbopen>(3)."
1187 #: build/C/man3/hash.3:151
1188 msgid "Only big and little endian byte order are supported."
1192 #: build/C/man3/hash.3:156
1193 msgid "B<btree>(3), B<dbopen>(3), B<mpool>(3), B<recno>(3)"
1197 #: build/C/man3/hash.3:159
1199 "I<Dynamic Hash Tables>, Per-Ake Larson, Communications of the ACM, April "
1204 #: build/C/man3/hash.3:162
1206 "I<A New Hash Package for UNIX>, Margo Seltzer, USENIX Proceedings, Winter "
1211 #: build/C/man3/mpool.3:34
1217 #: build/C/man3/mpool.3:34
1223 #: build/C/man3/mpool.3:38
1224 msgid "mpool - shared memory buffer pool"
1228 #: build/C/man3/mpool.3:42
1231 "B<#include E<lt>db.hE<gt>>\n"
1232 "B<#include E<lt>mpool.hE<gt>>\n"
1236 #: build/C/man3/mpool.3:45
1239 "B<MPOOL *mpool_open(DBT *>I<key>B<, int >I<fd>B<, pgno_t >I<pagesize>B<, "
1240 "pgno_t >I<maxcache>B<);>\n"
1244 #: build/C/man3/mpool.3:49
1247 "B<void mpool_filter(MPOOL *>I<mp>B<, void (*pgin)(void *, pgno_t, void "
1249 "B< void (*>I<pgout>B<)(void *, pgno_t, void *),>\n"
1250 "B< void *>I<pgcookie>B<);>\n"
1254 #: build/C/man3/mpool.3:51
1256 msgid "B<void *mpool_new(MPOOL *>I<mp>B<, pgno_t *>I<pgnoaddr>B<);>\n"
1260 #: build/C/man3/mpool.3:53
1263 "B<void *mpool_get(MPOOL *>I<mp>B<, pgno_t >I<pgno>B<, unsigned int "
1268 #: build/C/man3/mpool.3:55
1271 "B<int mpool_put(MPOOL *>I<mp>B<, void *>I<pgaddr>B<, unsigned int "
1276 #: build/C/man3/mpool.3:57
1278 msgid "B<int mpool_sync(MPOOL *>I<mp>B<);>\n"
1282 #: build/C/man3/mpool.3:59
1284 msgid "B<int mpool_close(MPOOL *>I<mp>B<);>\n"
1288 #: build/C/man3/mpool.3:65
1290 "I<Mpool> is the library interface intended to provide page oriented buffer "
1291 "management of files. The buffers may be shared between processes."
1295 #: build/C/man3/mpool.3:86
1297 "The function B<mpool_open>() initializes a memory pool. The I<key> "
1298 "argument is the byte string used to negotiate between multiple processes "
1299 "wishing to share buffers. If the file buffers are mapped in shared memory, "
1300 "all processes using the same key will share the buffers. If I<key> is NULL, "
1301 "the buffers are mapped into private memory. The I<fd> argument is a file "
1302 "descriptor for the underlying file, which must be seekable. If I<key> is "
1303 "non-NULL and matches a file already being mapped, the I<fd> argument is "
1308 #: build/C/man3/mpool.3:97
1310 "The I<pagesize> argument is the size, in bytes, of the pages into which the "
1311 "file is broken up. The I<maxcache> argument is the maximum number of pages "
1312 "from the underlying file to cache at any one time. This value is not "
1313 "relative to the number of processes which share a file's buffers, but will "
1314 "be the largest value specified by any of the processes sharing the file."
1318 #: build/C/man3/mpool.3:113
1320 "The B<mpool_filter>() function is intended to make transparent input and "
1321 "output processing of the pages possible. If the I<pgin> function is "
1322 "specified, it is called each time a buffer is read into the memory pool from "
1323 "the backing file. If the I<pgout> function is specified, it is called each "
1324 "time a buffer is written into the backing file. Both functions are called "
1325 "with the I<pgcookie> pointer, the page number and a pointer to the page to "
1326 "being read or written."
1330 #: build/C/man3/mpool.3:126
1332 "The function B<mpool_new>() takes an I<MPOOL> pointer and an address as "
1333 "arguments. If a new page can be allocated, a pointer to the page is "
1334 "returned and the page number is stored into the I<pgnoaddr> address. "
1335 "Otherwise, NULL is returned and I<errno> is set."
1339 #: build/C/man3/mpool.3:139
1341 "The function B<mpool_get>() takes an I<MPOOL> pointer and a page number as "
1342 "arguments. If the page exists, a pointer to the page is returned. "
1343 "Otherwise, NULL is returned and I<errno> is set. The I<flags> argument is "
1344 "not currently used."
1348 #: build/C/man3/mpool.3:151
1350 "The function B<mpool_put>() unpins the page referenced by I<pgaddr>. "
1351 "I<pgaddr> must be an address previously returned by B<mpool_get>() or "
1352 "B<mpool_new>(). The flag value is specified by ORing any of the following "
1357 #: build/C/man3/mpool.3:151
1359 msgid "B<MPOOL_DIRTY>"
1363 #: build/C/man3/mpool.3:154
1364 msgid "The page has been modified and needs to be written to the backing file."
1368 #: build/C/man3/mpool.3:157
1369 msgid "B<mpool_put>() returns 0 on success and -1 if an error occurs."
1373 #: build/C/man3/mpool.3:166
1375 "The function B<mpool_sync>() writes all modified pages associated with the "
1376 "I<MPOOL> pointer to the backing file. B<mpool_sync>() returns 0 on success "
1377 "and -1 if an error occurs."
1381 #: build/C/man3/mpool.3:176
1383 "The B<mpool_close>() function free's up any allocated memory associated "
1384 "with the memory pool cookie. Modified pages are B<not> written to the "
1385 "backing file. B<mpool_close>() returns 0 on success and -1 if an error "
1390 #: build/C/man3/mpool.3:183
1392 "The B<mpool_open>() function may fail and set I<errno> for any of the "
1393 "errors specified for the library routine B<malloc>(3)."
1397 #: build/C/man3/mpool.3:189
1398 msgid "The B<mpool_get>() function may fail and set I<errno> for the following:"
1402 #: build/C/man3/mpool.3:192
1403 msgid "The requested record doesn't exist."
1407 #: build/C/man3/mpool.3:204
1409 "The B<mpool_new>() and B<mpool_get>() functions may fail and set I<errno> "
1410 "for any of the errors specified for the library routines B<read>(2), "
1411 "B<write>(2), and B<malloc>(3)."
1415 #: build/C/man3/mpool.3:211
1417 "The B<mpool_sync>() function may fail and set I<errno> for any of the "
1418 "errors specified for the library routine B<write>(2)."
1422 #: build/C/man3/mpool.3:218
1424 "The B<mpool_close>() function may fail and set I<errno> for any of the "
1425 "errors specified for the library routine B<free>(3)."
1429 #: build/C/man3/mpool.3:218
1431 msgid "CONFORMING TO"
1435 #: build/C/man3/mpool.3:221
1436 msgid "Not in POSIX.1-2001. Present on the BSDs."
1440 #: build/C/man3/mpool.3:226
1441 msgid "B<btree>(3), B<dbopen>(3), B<hash>(3), B<recno>(3)"
1445 #: build/C/man3/recno.3:34
1451 #: build/C/man3/recno.3:38
1452 msgid "recno - record number database access method"
1456 #: build/C/man3/recno.3:53
1458 "The routine B<dbopen>(3) is the library interface to database files. One "
1459 "of the supported file formats is record number files. The general "
1460 "description of the database access methods is in B<dbopen>(3), this manual "
1461 "page describes only the recno specific information."
1465 #: build/C/man3/recno.3:62
1467 "The record number data structure is either variable or fixed-length records "
1468 "stored in a flat-file format, accessed by the logical record number. The "
1469 "existence of record number five implies the existence of records one through "
1470 "four, and the deletion of record number one causes record number five to be "
1471 "renumbered to record number four, as well as the cursor, if positioned after "
1472 "record number one, to shift down one record."
1476 #: build/C/man3/recno.3:68
1478 "The recno access method specific data structure provided to B<dbopen>(3) is "
1479 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
1483 #: build/C/man3/recno.3:80
1486 "typedef struct {\n"
1487 " unsigned long flags;\n"
1488 " unsigned int cachesize;\n"
1489 " unsigned int psize;\n"
1492 " unsigned char bval;\n"
1498 #: build/C/man3/recno.3:84
1499 msgid "The elements of this structure are defined as follows:"
1503 #: build/C/man3/recno.3:84
1509 #: build/C/man3/recno.3:89
1511 msgid "B<R_FIXEDLEN>"
1515 #: build/C/man3/recno.3:100
1517 "The records are fixed-length, not byte delimited. The structure element "
1518 "I<reclen> specifies the length of the record, and the structure element "
1519 "I<bval> is used as the pad character. Any records, inserted into the "
1520 "database, that are less than I<reclen> bytes long are automatically padded."
1524 #: build/C/man3/recno.3:100
1530 #: build/C/man3/recno.3:113
1532 "In the interface specified by B<dbopen>(3), the sequential record retrieval "
1533 "fills in both the caller's key and data structures. If the B<R_NOKEY> flag "
1534 "is specified, the I<cursor> routines are not required to fill in the key "
1535 "structure. This permits applications to retrieve records at the end of "
1536 "files without reading all of the intervening records."
1540 #: build/C/man3/recno.3:113
1542 msgid "B<R_SNAPSHOT>"
1546 #: build/C/man3/recno.3:119
1548 "This flag requires that a snapshot of the file be taken when B<dbopen>(3) "
1549 "is called, instead of permitting any unmodified records to be read from the "
1554 #: build/C/man3/recno.3:129
1556 "A suggested maximum size, in bytes, of the memory cache. This value is "
1557 "B<only> advisory, and the access method will allocate more memory rather "
1558 "than fail. If I<cachesize> is 0 (no size is specified) a default cache is "
1563 #: build/C/man3/recno.3:141
1565 "The recno access method stores the in-memory copies of its records in a "
1566 "btree. This value is the size (in bytes) of the pages used for nodes in "
1567 "that tree. If I<psize> is 0 (no page size is specified) a page size is "
1568 "chosen based on the underlying file system I/O block size. See B<btree>(3) "
1569 "for more information."
1573 #: build/C/man3/recno.3:149
1579 #: build/C/man3/recno.3:152
1580 msgid "The length of a fixed-length record."
1584 #: build/C/man3/recno.3:152
1590 #: build/C/man3/recno.3:160
1592 "The delimiting byte to be used to mark the end of a record for "
1593 "variable-length records, and the pad character for fixed-length records. If "
1594 "no value is specified, newlines (\"\\en\") are used to mark the end of "
1595 "variable-length records and fixed-length records are padded with spaces."
1599 #: build/C/man3/recno.3:160
1605 #: build/C/man3/recno.3:170
1607 "The recno access method stores the in-memory copies of its records in a "
1608 "btree. If I<bfname> is non-NULL, it specifies the name of the btree file, "
1609 "as if specified as the filename for a B<dbopen>(3) of a btree file."
1613 #: build/C/man3/recno.3:188
1615 "The data part of the key/data pair used by the I<recno> access method is the "
1616 "same as other access methods. The key is different. The I<data> field of "
1617 "the key should be a pointer to a memory location of type I<recno_t>, as "
1618 "defined in th I<E<lt>db.hE<gt>> include file. This type is normally the "
1619 "largest unsigned integral type available to the implementation. The I<size> "
1620 "field of the key should be the size of that type."
1624 #: build/C/man3/recno.3:193
1626 "Because there can be no metadata associated with the underlying recno access "
1627 "method files, any changes made to the default values (e.g., fixed record "
1628 "length or byte separator value) must be explicitly specified each time the "
1633 #: build/C/man3/recno.3:201
1635 "In the interface specified by B<dbopen>(3), using the I<put> interface to "
1636 "create a new record will cause the creation of multiple, empty records if "
1637 "the record number is more than one greater than the largest record currently "
1642 #: build/C/man3/recno.3:209
1644 "The I<recno> access method routines may fail and set I<errno> for any of the "
1645 "errors specified for the library routine B<dbopen>(3) or the following:"
1649 #: build/C/man3/recno.3:213
1651 "An attempt was made to add a record to a fixed-length database that was too "
1656 #: build/C/man3/recno.3:220
1657 msgid "B<btree>(3), B<dbopen>(3), B<hash>(3), B<mpool>(3)"
1661 #: build/C/man3/recno.3:224
1663 "I<Document Processing in a Relational Database System>, Michael Stonebraker, "
1664 "Heidi Stettner, Joseph Kalash, Antonin Guttman, Nadene Lynn, Memorandum "
1665 "No. UCB/ERL M82/32, May 1982."