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: 2013-07-15 16:07+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:36
26 #: build/C/man3/btree.3:36 build/C/man3/hash.3:36 build/C/man3/recno.3:36
32 #: 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
34 msgid "Linux Programmer's Manual"
38 #: 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
44 #: build/C/man3/btree.3:40
45 msgid "btree - btree database access method"
49 #: build/C/man3/btree.3:40 build/C/man3/dbopen.3:40 build/C/man3/hash.3:40 build/C/man3/mpool.3:40 build/C/man3/recno.3:40
55 #: build/C/man3/btree.3:45 build/C/man3/hash.3:45 build/C/man3/recno.3:45
58 "B<#include E<lt>sys/types.hE<gt>\n"
59 "#include E<lt>db.hE<gt>>\n"
63 #: build/C/man3/btree.3:47 build/C/man3/dbopen.3:51 build/C/man3/hash.3:47 build/C/man3/mpool.3:62 build/C/man3/recno.3:47
69 #: build/C/man3/btree.3:54 build/C/man3/dbopen.3:58 build/C/man3/hash.3:54 build/C/man3/mpool.3:69 build/C/man3/recno.3:54
71 "I<Note well>: This page documents interfaces provided in glibc up until "
72 "version 2.1. Since version 2.2, glibc no longer provides these interfaces. "
73 "Probably, you are looking for the APIs provided by the I<libdb> library "
78 #: build/C/man3/btree.3:62
80 "The routine B<dbopen>(3) is the library interface to database files. One "
81 "of the supported file formats is btree files. The general description of "
82 "the database access methods is in B<dbopen>(3), this manual page describes "
83 "only the btree specific information."
87 #: build/C/man3/btree.3:65
89 "The btree data structure is a sorted, balanced tree structure storing "
90 "associated key/data pairs."
94 #: build/C/man3/btree.3:71
96 "The btree access method specific data structure provided to B<dbopen>(3) is "
97 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
101 #: build/C/man3/btree.3:84
105 " unsigned long flags;\n"
106 " unsigned int cachesize;\n"
109 " unsigned int psize;\n"
110 " int (*compare)(const DBT *key1, const DBT *key2);\n"
111 " size_t (*prefix)(const DBT *key1, const DBT *key2);\n"
117 #: build/C/man3/btree.3:88 build/C/man3/hash.3:85
118 msgid "The elements of this structure are as follows:"
122 #: build/C/man3/btree.3:88
128 #: build/C/man3/btree.3:91 build/C/man3/recno.3:97
129 msgid "The flag value is specified by ORing any of the following values:"
133 #: build/C/man3/btree.3:92
139 #: build/C/man3/btree.3:111
141 "Permit duplicate keys in the tree, that is, permit insertion if the key to "
142 "be inserted already exists in the tree. The default behavior, as described "
143 "in B<dbopen>(3), is to overwrite a matching key when inserting a new key or "
144 "to fail if the B<R_NOOVERWRITE> flag is specified. The B<R_DUP> flag is "
145 "overridden by the B<R_NOOVERWRITE> flag, and if the B<R_NOOVERWRITE> flag is "
146 "specified, attempts to insert duplicate keys into the tree will fail."
150 #: build/C/man3/btree.3:121
152 "If the database contains duplicate keys, the order of retrieval of key/data "
153 "pairs is undefined if the I<get> routine is used, however, I<seq> routine "
154 "calls with the B<R_CURSOR> flag set will always return the logical \"first\" "
155 "of any group of duplicate keys."
159 #: build/C/man3/btree.3:122 build/C/man3/hash.3:102 build/C/man3/recno.3:129
165 #: build/C/man3/btree.3:137
167 "A suggested maximum size (in bytes) of the memory cache. This value is "
168 "I<only> advisory, and the access method will allocate more memory rather "
169 "than fail. Since every search examines the root page of the tree, caching "
170 "the most recently used pages substantially improves access time. In "
171 "addition, physical writes are delayed as long as possible, so a moderate "
172 "cache can reduce the number of I/O operations significantly. Obviously, "
173 "using a cache increases (but only increases) the likelihood of corruption or "
174 "lost data if the system crashes while a tree is being modified. If "
175 "I<cachesize> is 0 (no size is specified) a default cache is used."
179 #: build/C/man3/btree.3:137
181 msgid "I<maxkeypage>"
184 #. The maximum number of keys which will be stored on any single page.
185 #. Because of the way the btree data structure works,
187 #. must always be greater than or equal to 2.
190 #. is 0 (no maximum number of keys is specified) the page fill factor is
191 #. made as large as possible (which is almost invariably what is wanted).
193 #: build/C/man3/btree.3:149
195 "The maximum number of keys which will be stored on any single page. Not "
196 "currently implemented."
200 #: build/C/man3/btree.3:149
202 msgid "I<minkeypage>"
206 #: build/C/man3/btree.3:159
208 "The minimum number of keys which will be stored on any single page. This "
209 "value is used to determine which keys will be stored on overflow pages, that "
210 "is, if a key or data item is longer than the pagesize divided by the "
211 "minkeypage value, it will be stored on overflow pages instead of in the page "
212 "itself. If I<minkeypage> is 0 (no minimum number of keys is specified) a "
213 "value of 2 is used."
217 #: build/C/man3/btree.3:159 build/C/man3/recno.3:138
223 #: build/C/man3/btree.3:167
225 "Page size is the size (in bytes) of the pages used for nodes in the tree. "
226 "The minimum page size is 512 bytes and the maximum page size is 64K. If "
227 "I<psize> is 0 (no page size is specified) a page size is chosen based on the "
228 "underlying file system I/O block size."
232 #: build/C/man3/btree.3:167
238 #: build/C/man3/btree.3:179
240 "Compare is the key comparison function. It must return an integer less "
241 "than, equal to, or greater than zero if the first key argument is considered "
242 "to be respectively less than, equal to, or greater than the second key "
243 "argument. The same comparison function must be used on a given tree every "
244 "time it is opened. If I<compare> is NULL (no comparison function is "
245 "specified), the keys are compared lexically, with shorter keys considered "
246 "less than longer keys."
250 #: build/C/man3/btree.3:179
256 #: build/C/man3/btree.3:198
258 "Prefix is the prefix comparison function. If specified, this routine must "
259 "return the number of bytes of the second key argument which are necessary to "
260 "determine that it is greater than the first key argument. If the keys are "
261 "equal, the key length should be returned. Note, the usefulness of this "
262 "routine is very data-dependent, but, in some data sets can produce "
263 "significantly reduced tree sizes and search times. If I<prefix> is NULL (no "
264 "prefix function is specified), I<and> no comparison function is specified, a "
265 "default lexical comparison routine is used. If I<prefix> is NULL and a "
266 "comparison routine is specified, no prefix comparison is done."
270 #: build/C/man3/btree.3:198 build/C/man3/hash.3:117 build/C/man3/recno.3:150
276 #: build/C/man3/btree.3:206 build/C/man3/recno.3:158
278 "The byte order for integers in the stored database metadata. The number "
279 "should represent the order as an integer; for example, big endian order "
280 "would be the number 4,321. If I<lorder> is 0 (no order is specified) the "
281 "current host order is used."
285 #: build/C/man3/btree.3:217
287 "If the file already exists (and the B<O_TRUNC> flag is not specified), the "
288 "values specified for the arguments I<flags>, I<lorder> and I<psize> are "
289 "ignored in favor of the values used when the tree was created."
293 #: build/C/man3/btree.3:219
294 msgid "Forward sequential scans of a tree are from the least key to the greatest."
298 #: build/C/man3/btree.3:225
300 "Space freed up by deleting key/data pairs from the tree is never reclaimed, "
301 "although it is normally made available for reuse. This means that the btree "
302 "storage structure is grow-only. The only solutions are to avoid excessive "
303 "deletions, or to create a fresh tree periodically from a scan of an existing "
308 #: build/C/man3/btree.3:231
310 "Searches, insertions, and deletions in a btree will all complete in O lg "
311 "base N where base is the average fill factor. Often, inserting ordered data "
312 "into btrees results in a low fill factor. This implementation has been "
313 "modified to make ordered insertion the best case, resulting in a much better "
314 "than normal page fill factor."
318 #: build/C/man3/btree.3:231 build/C/man3/dbopen.3:481 build/C/man3/hash.3:151 build/C/man3/mpool.3:185 build/C/man3/recno.3:210
324 #: build/C/man3/btree.3:238
326 "The I<btree> access method routines may fail and set I<errno> for any of the "
327 "errors specified for the library routine B<dbopen>(3)."
331 #: build/C/man3/btree.3:238 build/C/man3/dbopen.3:543 build/C/man3/hash.3:158 build/C/man3/recno.3:222
337 #: build/C/man3/btree.3:240 build/C/man3/recno.3:224
338 msgid "Only big and little endian byte order is supported."
342 #: build/C/man3/btree.3:240 build/C/man3/dbopen.3:554 build/C/man3/hash.3:160 build/C/man3/mpool.3:230 build/C/man3/recno.3:224
348 #: build/C/man3/btree.3:245
349 msgid "B<dbopen>(3), B<hash>(3), B<mpool>(3), B<recno>(3)"
353 #: build/C/man3/btree.3:248
355 "I<The Ubiquitous B-tree>, Douglas Comer, ACM Comput. Surv. 11, 2 (June "
360 #: build/C/man3/btree.3:252
362 "I<Prefix B-trees>, Bayer and Unterauer, ACM Transactions on Database "
363 "Systems, Vol. 2, 1 (March 1977), 11-26."
367 #: build/C/man3/btree.3:255
369 "I<The Art of Computer Programming Vol. 3: Sorting and Searching>, "
370 "D.E. Knuth, 1968, pp 471-480."
374 #: build/C/man3/btree.3:255 build/C/man3/dbopen.3:562 build/C/man3/hash.3:171 build/C/man3/mpool.3:235 build/C/man3/recno.3:233
380 #: build/C/man3/btree.3:262 build/C/man3/dbopen.3:569 build/C/man3/hash.3:178 build/C/man3/mpool.3:242 build/C/man3/recno.3:240
382 "This page is part of release 3.52 of the Linux I<man-pages> project. A "
383 "description of the project, and information about reporting bugs, can be "
384 "found at \\%http://www.kernel.org/doc/man-pages/."
388 #: build/C/man3/dbopen.3:36
394 #: build/C/man3/dbopen.3:36
400 #: build/C/man3/dbopen.3:40
401 msgid "dbopen - database access methods"
405 #: build/C/man3/dbopen.3:46
408 "B<#include E<lt>sys/types.hE<gt>>\n"
409 "B<#include E<lt>limits.hE<gt>>\n"
410 "B<#include E<lt>db.hE<gt>>\n"
411 "B<#include E<lt>fcntl.hE<gt>>\n"
415 #: build/C/man3/dbopen.3:50
418 "B<DB *dbopen(const char *>I<file>B<, int >I<flags>B<, int >I<mode>B<, DBTYPE "
420 "B< const void *>I<openinfo>B<);>\n"
424 #: build/C/man3/dbopen.3:72
426 "B<dbopen>() is the library interface to database files. The supported file "
427 "formats are btree, hashed and UNIX file oriented. The btree format is a "
428 "representation of a sorted, balanced tree structure. The hashed format is "
429 "an extensible, dynamic hashing scheme. The flat-file format is a byte "
430 "stream file with fixed or variable length records. The formats and file "
431 "format specific information are described in detail in their respective "
432 "manual pages B<btree>(3), B<hash>(3) and B<recno>(3)."
436 #: build/C/man3/dbopen.3:81
438 "B<dbopen>() opens I<file> for reading and/or writing. Files never intended "
439 "to be preserved on disk may be created by setting the I<file> argument to "
443 #. Three additional options may be specified by ORing
449 #. Do the necessary locking in the database to support concurrent access.
450 #. If concurrent access isn't needed or the database is read-only this
451 #. flag should not be set, as it tends to have an associated performance
455 #. Place the underlying memory pool used by the database in shared
457 #. Necessary for concurrent access.
460 #. Support transactions in the database.
461 #. The DB_LOCK and DB_SHMEM flags must be set as well.
463 #: build/C/man3/dbopen.3:121
465 "The I<flags> and I<mode> arguments are as specified to the B<open>(2) "
466 "routine, however, only the B<O_CREAT>, B<O_EXCL>, B<O_EXLOCK>, "
467 "B<O_NONBLOCK>, B<O_RDONLY>, B<O_RDWR>, B<O_SHLOCK>, and B<O_TRUNC> flags are "
468 "meaningful. (Note, opening a database file B<O_WRONLY> is not possible.)"
472 #: build/C/man3/dbopen.3:134
474 "The I<type> argument is of type I<DBTYPE> (as defined in the "
475 "I<E<lt>db.hE<gt>> include file) and may be set to B<DB_BTREE>, B<DB_HASH>, "
480 #: build/C/man3/dbopen.3:143
482 "The I<openinfo> argument is a pointer to an access method specific structure "
483 "described in the access method's manual page. If I<openinfo> is NULL, each "
484 "access method will use defaults appropriate for the system and the access "
489 #: build/C/man3/dbopen.3:154
491 "B<dbopen>() returns a pointer to a I<DB> structure on success and NULL on "
492 "error. The I<DB> structure is defined in the I<E<lt>db.hE<gt>> include "
493 "file, and contains at least the following fields:"
497 #: build/C/man3/dbopen.3:170
502 " int (*close)(const DB *db);\n"
503 " int (*del)(const DB *db, const DBT *key, unsigned int flags);\n"
504 " int (*fd)(const DB *db);\n"
505 " int (*get)(const DB *db, DBT *key, DBT *data,\n"
506 " unsigned int flags);\n"
507 " int (*put)(const DB *db, DBT *key, const DBT *data,\n"
508 " unsigned int flags);\n"
509 " int (*sync)(const DB *db, unsigned int flags);\n"
510 " int (*seq)(const DB *db, DBT *key, DBT *data,\n"
511 " unsigned int flags);\n"
516 #: build/C/man3/dbopen.3:178
518 "These elements describe a database type and a set of functions performing "
519 "various actions. These functions take a pointer to a structure as returned "
520 "by B<dbopen>(), and sometimes one or more pointers to key/data structures "
525 #: build/C/man3/dbopen.3:178
531 #: build/C/man3/dbopen.3:181
532 msgid "The type of the underlying access method (and file format)."
536 #: build/C/man3/dbopen.3:181
542 #: build/C/man3/dbopen.3:195
544 "A pointer to a routine to flush any cached information to disk, free any "
545 "allocated resources, and close the underlying file(s). Since key/data pairs "
546 "may be cached in memory, failing to sync the file with a I<close> or I<sync> "
547 "function may result in inconsistent or lost information. I<close> routines "
548 "return -1 on error (setting I<errno>) and 0 on success."
552 #: build/C/man3/dbopen.3:195
558 #: build/C/man3/dbopen.3:198
559 msgid "A pointer to a routine to remove key/data pairs from the database."
563 #: build/C/man3/dbopen.3:202
564 msgid "The argument I<flag> may be set to the following value:"
568 #: build/C/man3/dbopen.3:203 build/C/man3/dbopen.3:259 build/C/man3/dbopen.3:359
574 #: build/C/man3/dbopen.3:207
576 "Delete the record referenced by the cursor. The cursor must have previously "
581 #: build/C/man3/dbopen.3:215
583 "I<delete> routines return -1 on error (setting I<errno>), 0 on success, and "
584 "1 if the specified I<key> was not in the file."
588 #: build/C/man3/dbopen.3:215
594 #: build/C/man3/dbopen.3:237
596 "A pointer to a routine which returns a file descriptor representative of the "
597 "underlying database. A file descriptor referencing the same file will be "
598 "returned to all processes which call B<dbopen>() with the same I<file> "
599 "name. This file descriptor may be safely used as an argument to the "
600 "B<fcntl>(2) and B<flock>(2) locking functions. The file descriptor is not "
601 "necessarily associated with any of the underlying files used by the access "
602 "method. No file descriptor is available for in memory databases. I<fd> "
603 "routines return -1 on error (setting I<errno>), and the file descriptor on "
608 #: build/C/man3/dbopen.3:237
614 #: build/C/man3/dbopen.3:251
616 "A pointer to a routine which is the interface for keyed retrieval from the "
617 "database. The address and length of the data associated with the specified "
618 "I<key> are returned in the structure referenced by I<data>. I<get> routines "
619 "return -1 on error (setting I<errno>), 0 on success, and 1 if the I<key> was "
624 #: build/C/man3/dbopen.3:251
630 #: build/C/man3/dbopen.3:254
631 msgid "A pointer to a routine to store key/data pairs in the database."
635 #: build/C/man3/dbopen.3:258
636 msgid "The argument I<flag> may be set to one of the following values:"
640 #: build/C/man3/dbopen.3:263
642 "Replace the key/data pair referenced by the cursor. The cursor must have "
643 "previously been initialized."
647 #: build/C/man3/dbopen.3:263
653 #: build/C/man3/dbopen.3:274
655 "Append the data immediately after the data referenced by I<key>, creating a "
656 "new key/data pair. The record number of the appended key/data pair is "
657 "returned in the I<key> structure. (Applicable only to the B<DB_RECNO> "
662 #: build/C/man3/dbopen.3:274
668 #: build/C/man3/dbopen.3:285
670 "Insert the data immediately before the data referenced by I<key>, creating a "
671 "new key/data pair. The record number of the inserted key/data pair is "
672 "returned in the I<key> structure. (Applicable only to the B<DB_RECNO> "
677 #: build/C/man3/dbopen.3:285
679 msgid "B<R_NOOVERWRITE>"
683 #: build/C/man3/dbopen.3:288
684 msgid "Enter the new key/data pair only if the key does not previously exist."
688 #: build/C/man3/dbopen.3:288
690 msgid "B<R_SETCURSOR>"
694 #: build/C/man3/dbopen.3:297
696 "Store the key/data pair, setting or initializing the position of the cursor "
697 "to reference it. (Applicable only to the B<DB_BTREE> and B<DB_RECNO> access "
702 #: build/C/man3/dbopen.3:307
704 "B<R_SETCURSOR> is available only for the B<DB_BTREE> and B<DB_RECNO> access "
705 "methods because it implies that the keys have an inherent order which does "
710 #: build/C/man3/dbopen.3:317
712 "B<R_IAFTER> and B<R_IBEFORE> are available only for the B<DB_RECNO> access "
713 "method because they each imply that the access method is able to create new "
714 "keys. This is true only if the keys are ordered and independent, record "
715 "numbers for example."
719 #: build/C/man3/dbopen.3:322
721 "The default behavior of the I<put> routines is to enter the new key/data "
722 "pair, replacing any previously existing key."
726 #: build/C/man3/dbopen.3:330
728 "I<put> routines return -1 on error (setting I<errno>), 0 on success, and 1 "
729 "if the B<R_NOOVERWRITE> I<flag> was set and the key already exists in the "
734 #: build/C/man3/dbopen.3:330
740 #: build/C/man3/dbopen.3:341
742 "A pointer to a routine which is the interface for sequential retrieval from "
743 "the database. The address and length of the key are returned in the "
744 "structure referenced by I<key>, and the address and length of the data are "
745 "returned in the structure referenced by I<data>."
749 #: build/C/man3/dbopen.3:354
751 "Sequential key/data pair retrieval may begin at any time, and the position "
752 "of the \"cursor\" is not affected by calls to the I<del>, I<get>, I<put>, or "
753 "I<sync> routines. Modifications to the database during a sequential scan "
754 "will be reflected in the scan, that is, records inserted behind the cursor "
755 "will not be returned while records inserted in front of the cursor will be "
760 #: build/C/man3/dbopen.3:358
761 msgid "The flag value B<must> be set to one of the following values:"
765 #: build/C/man3/dbopen.3:372
767 "The data associated with the specified key is returned. This differs from "
768 "the I<get> routines in that it sets or initializes the cursor to the "
769 "location of the key as well. (Note, for the B<DB_BTREE> access method, the "
770 "returned key is not necessarily an exact match for the specified key. The "
771 "returned key is the smallest key greater than or equal to the specified key, "
772 "permitting partial key matches and range searches.)"
776 #: build/C/man3/dbopen.3:372
782 #: build/C/man3/dbopen.3:376
784 "The first key/data pair of the database is returned, and the cursor is set "
785 "or initialized to reference it."
789 #: build/C/man3/dbopen.3:376
795 #: build/C/man3/dbopen.3:385
797 "The last key/data pair of the database is returned, and the cursor is set or "
798 "initialized to reference it. (Applicable only to the B<DB_BTREE> and "
799 "B<DB_RECNO> access methods.)"
803 #: build/C/man3/dbopen.3:385
809 #: build/C/man3/dbopen.3:391
811 "Retrieve the key/data pair immediately after the cursor. If the cursor is "
812 "not yet set, this is the same as the B<R_FIRST> flag."
816 #: build/C/man3/dbopen.3:391
822 #: build/C/man3/dbopen.3:402
824 "Retrieve the key/data pair immediately before the cursor. If the cursor is "
825 "not yet set, this is the same as the B<R_LAST> flag. (Applicable only to "
826 "the B<DB_BTREE> and B<DB_RECNO> access methods.)"
830 #: build/C/man3/dbopen.3:413
832 "B<R_LAST> and B<R_PREV> are available only for the B<DB_BTREE> and "
833 "B<DB_RECNO> access methods because they each imply that the keys have an "
834 "inherent order which does not change."
838 #: build/C/man3/dbopen.3:426
840 "I<seq> routines return -1 on error (setting I<errno>), 0 on success and 1 if "
841 "there are no key/data pairs less than or greater than the specified or "
842 "current key. If the B<DB_RECNO> access method is being used, and if the "
843 "database file is a character special file and no complete key/data pairs are "
844 "currently available, the I<seq> routines return 2."
848 #: build/C/man3/dbopen.3:426
854 #: build/C/man3/dbopen.3:432
856 "A pointer to a routine to flush any cached information to disk. If the "
857 "database is in memory only, the I<sync> routine has no effect and will "
862 #: build/C/man3/dbopen.3:434
863 msgid "The flag value may be set to the following value:"
867 #: build/C/man3/dbopen.3:435
869 msgid "B<R_RECNOSYNC>"
873 #: build/C/man3/dbopen.3:447
875 "If the B<DB_RECNO> access method is being used, this flag causes the sync "
876 "routine to apply to the btree file which underlies the recno file, not the "
877 "recno file itself. (See the I<bfname> field of the B<recno>(3) manual page "
878 "for more information.)"
882 #: build/C/man3/dbopen.3:453
883 msgid "I<sync> routines return -1 on error (setting I<errno>) and 0 on success."
887 #: build/C/man3/dbopen.3:453
889 msgid "Key/data pairs"
893 #: build/C/man3/dbopen.3:456
895 "Access to all file types is based on key/data pairs. Both keys and data are "
896 "represented by the following data structure:"
900 #: build/C/man3/dbopen.3:463
910 #: build/C/man3/dbopen.3:469
911 msgid "The elements of the I<DBT> structure are defined as follows:"
915 #: build/C/man3/dbopen.3:469
921 #: build/C/man3/dbopen.3:472
922 msgid "A pointer to a byte string."
926 #: build/C/man3/dbopen.3:472
932 #: build/C/man3/dbopen.3:475
933 msgid "The length of the byte string."
937 #: build/C/man3/dbopen.3:481
939 "Key and data byte strings may reference strings of essentially unlimited "
940 "length although any two of them must fit into available memory at the same "
941 "time. It should be noted that the access methods provide no guarantees "
942 "about byte string alignment."
946 #: build/C/man3/dbopen.3:491
948 "The B<dbopen>() routine may fail and set I<errno> for any of the errors "
949 "specified for the library routines B<open>(2) and B<malloc>(3) or the "
954 #: build/C/man3/dbopen.3:491
960 #: build/C/man3/dbopen.3:494
961 msgid "A file is incorrectly formatted."
965 #: build/C/man3/dbopen.3:494 build/C/man3/mpool.3:198 build/C/man3/recno.3:218
971 #: build/C/man3/dbopen.3:501
973 "A parameter has been specified (hash function, pad byte, etc.) that is "
974 "incompatible with the current file specification or which is not meaningful "
975 "for the function (for example, use of the cursor without prior "
976 "initialization) or there is a mismatch between the version number of file "
981 #: build/C/man3/dbopen.3:513
983 "The I<close> routines may fail and set I<errno> for any of the errors "
984 "specified for the library routines B<close>(2), B<read>(2), B<write>(2), "
985 "B<free>(3), or B<fsync>(2)."
989 #: build/C/man3/dbopen.3:528
991 "The I<del>, I<get>, I<put> and I<seq> routines may fail and set I<errno> for "
992 "any of the errors specified for the library routines B<read>(2), "
993 "B<write>(2), B<free>(3) or B<malloc>(3)."
997 #: build/C/man3/dbopen.3:536
999 "The I<fd> routines will fail and set I<errno> to B<ENOENT> for in memory "
1004 #: build/C/man3/dbopen.3:543
1006 "The I<sync> routines may fail and set I<errno> for any of the errors "
1007 "specified for the library routine B<fsync>(2)."
1011 #: build/C/man3/dbopen.3:548
1013 "The typedef I<DBT> is a mnemonic for \"data base thang\", and was used "
1014 "because no-one could think of a reasonable name that wasn't already used."
1018 #: build/C/man3/dbopen.3:551
1020 "The file descriptor interface is a kludge and will be deleted in a future "
1021 "version of the interface."
1025 #: build/C/man3/dbopen.3:554
1027 "None of the access methods provide any form of concurrent access, locking, "
1032 #: build/C/man3/dbopen.3:559
1033 msgid "B<btree>(3), B<hash>(3), B<mpool>(3), B<recno>(3)"
1037 #: build/C/man3/dbopen.3:562
1039 "I<LIBTP: Portable, Modular Transactions for UNIX>, Margo Seltzer, Michael "
1040 "Olson, USENIX proceedings, Winter 1992."
1044 #: build/C/man3/hash.3:36
1050 #: build/C/man3/hash.3:40
1051 msgid "hash - hash database access method"
1055 #: build/C/man3/hash.3:62
1057 "The routine B<dbopen>(3) is the library interface to database files. One "
1058 "of the supported file formats is hash files. The general description of the "
1059 "database access methods is in B<dbopen>(3), this manual page describes only "
1060 "the hash specific information."
1064 #: build/C/man3/hash.3:64
1065 msgid "The hash data structure is an extensible, dynamic hashing scheme."
1069 #: build/C/man3/hash.3:70
1071 "The access method specific data structure provided to B<dbopen>(3) is "
1072 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
1076 #: build/C/man3/hash.3:81
1079 "typedef struct {\n"
1080 " unsigned int bsize;\n"
1081 " unsigned int ffactor;\n"
1082 " unsigned int nelem;\n"
1083 " unsigned int cachesize;\n"
1084 " uint32_t (*hash)(const void *, size_t);\n"
1090 #: build/C/man3/hash.3:85
1096 #: build/C/man3/hash.3:90
1098 "defines the hash table bucket size, and is, by default, 256 bytes. It may "
1099 "be preferable to increase the page size for disk-resident tables and tables "
1100 "with large data items."
1104 #: build/C/man3/hash.3:90
1110 #: build/C/man3/hash.3:96
1112 "indicates a desired density within the hash table. It is an approximation "
1113 "of the number of keys allowed to accumulate in any one bucket, determining "
1114 "when the hash table grows or shrinks. The default value is 8."
1118 #: build/C/man3/hash.3:96
1124 #: build/C/man3/hash.3:102
1126 "is an estimate of the final size of the hash table. If not set or set too "
1127 "low, hash tables will expand gracefully as keys are entered, although a "
1128 "slight performance degradation may be noticed. The default value is 1."
1132 #: build/C/man3/hash.3:108
1134 "is the suggested maximum size, in bytes, of the memory cache. This value is "
1135 "I<only advisory>, and the access method will allocate more memory rather "
1140 #: build/C/man3/hash.3:108
1146 #: build/C/man3/hash.3:117
1148 "is a user-defined hash function. Since no hash function performs equally "
1149 "well on all possible data, the user may find that the built-in hash function "
1150 "does poorly on a particular data set. A user-specified hash functions must "
1151 "take two arguments (a pointer to a byte string and a length) and return a "
1152 "32-bit quantity to be used as the hash value."
1156 #: build/C/man3/hash.3:127
1158 "is the byte order for integers in the stored database metadata. The number "
1159 "should represent the order as an integer; for example, big endian order "
1160 "would be the number 4,321. If I<lorder> is 0 (no order is specified) the "
1161 "current host order is used. If the file already exists, the specified value "
1162 "is ignored and the value specified when the tree was created is used."
1166 #: build/C/man3/hash.3:139
1168 "If the file already exists (and the B<O_TRUNC> flag is not specified), the "
1169 "values specified for I<bsize>, I<ffactor>, I<lorder>, and I<nelem> are "
1170 "ignored and the values specified when the tree was created are used."
1174 #: build/C/man3/hash.3:144
1176 "If a hash function is specified, I<hash_open> will attempt to determine if "
1177 "the hash function specified is the same as the one with which the database "
1178 "was created, and will fail if it is not."
1182 #: build/C/man3/hash.3:151
1184 "Backward-compatible interfaces to the routines described in B<dbm>(3), and "
1185 "B<ndbm>(3) are provided, however these interfaces are not compatible with "
1186 "previous file formats."
1190 #: build/C/man3/hash.3:158
1192 "The I<hash> access method routines may fail and set I<errno> for any of the "
1193 "errors specified for the library routine B<dbopen>(3)."
1197 #: build/C/man3/hash.3:160
1198 msgid "Only big and little endian byte order are supported."
1202 #: build/C/man3/hash.3:165
1203 msgid "B<btree>(3), B<dbopen>(3), B<mpool>(3), B<recno>(3)"
1207 #: build/C/man3/hash.3:168
1209 "I<Dynamic Hash Tables>, Per-Ake Larson, Communications of the ACM, April "
1214 #: build/C/man3/hash.3:171
1216 "I<A New Hash Package for UNIX>, Margo Seltzer, USENIX Proceedings, Winter "
1221 #: build/C/man3/mpool.3:36
1227 #: build/C/man3/mpool.3:36
1233 #: build/C/man3/mpool.3:40
1234 msgid "mpool - shared memory buffer pool"
1238 #: build/C/man3/mpool.3:44
1241 "B<#include E<lt>db.hE<gt>>\n"
1242 "B<#include E<lt>mpool.hE<gt>>\n"
1246 #: build/C/man3/mpool.3:47
1249 "B<MPOOL *mpool_open(DBT *>I<key>B<, int >I<fd>B<, pgno_t >I<pagesize>B<, "
1250 "pgno_t >I<maxcache>B<);>\n"
1254 #: build/C/man3/mpool.3:51
1257 "B<void mpool_filter(MPOOL *>I<mp>B<, void (*pgin)(void *, pgno_t, void "
1259 "B< void (*>I<pgout>B<)(void *, pgno_t, void *),>\n"
1260 "B< void *>I<pgcookie>B<);>\n"
1264 #: build/C/man3/mpool.3:53
1266 msgid "B<void *mpool_new(MPOOL *>I<mp>B<, pgno_t *>I<pgnoaddr>B<);>\n"
1270 #: build/C/man3/mpool.3:55
1273 "B<void *mpool_get(MPOOL *>I<mp>B<, pgno_t >I<pgno>B<, unsigned int "
1278 #: build/C/man3/mpool.3:57
1281 "B<int mpool_put(MPOOL *>I<mp>B<, void *>I<pgaddr>B<, unsigned int "
1286 #: build/C/man3/mpool.3:59
1288 msgid "B<int mpool_sync(MPOOL *>I<mp>B<);>\n"
1292 #: build/C/man3/mpool.3:61
1294 msgid "B<int mpool_close(MPOOL *>I<mp>B<);>\n"
1298 #: build/C/man3/mpool.3:74
1300 "I<Mpool> is the library interface intended to provide page oriented buffer "
1301 "management of files. The buffers may be shared between processes."
1305 #: build/C/man3/mpool.3:95
1307 "The function B<mpool_open>() initializes a memory pool. The I<key> "
1308 "argument is the byte string used to negotiate between multiple processes "
1309 "wishing to share buffers. If the file buffers are mapped in shared memory, "
1310 "all processes using the same key will share the buffers. If I<key> is NULL, "
1311 "the buffers are mapped into private memory. The I<fd> argument is a file "
1312 "descriptor for the underlying file, which must be seekable. If I<key> is "
1313 "non-NULL and matches a file already being mapped, the I<fd> argument is "
1318 #: build/C/man3/mpool.3:106
1320 "The I<pagesize> argument is the size, in bytes, of the pages into which the "
1321 "file is broken up. The I<maxcache> argument is the maximum number of pages "
1322 "from the underlying file to cache at any one time. This value is not "
1323 "relative to the number of processes which share a file's buffers, but will "
1324 "be the largest value specified by any of the processes sharing the file."
1328 #: build/C/man3/mpool.3:122
1330 "The B<mpool_filter>() function is intended to make transparent input and "
1331 "output processing of the pages possible. If the I<pgin> function is "
1332 "specified, it is called each time a buffer is read into the memory pool from "
1333 "the backing file. If the I<pgout> function is specified, it is called each "
1334 "time a buffer is written into the backing file. Both functions are called "
1335 "with the I<pgcookie> pointer, the page number and a pointer to the page to "
1336 "being read or written."
1340 #: build/C/man3/mpool.3:135
1342 "The function B<mpool_new>() takes an I<MPOOL> pointer and an address as "
1343 "arguments. If a new page can be allocated, a pointer to the page is "
1344 "returned and the page number is stored into the I<pgnoaddr> address. "
1345 "Otherwise, NULL is returned and I<errno> is set."
1349 #: build/C/man3/mpool.3:148
1351 "The function B<mpool_get>() takes an I<MPOOL> pointer and a page number as "
1352 "arguments. If the page exists, a pointer to the page is returned. "
1353 "Otherwise, NULL is returned and I<errno> is set. The I<flags> argument is "
1354 "not currently used."
1358 #: build/C/man3/mpool.3:160
1360 "The function B<mpool_put>() unpins the page referenced by I<pgaddr>. "
1361 "I<pgaddr> must be an address previously returned by B<mpool_get>() or "
1362 "B<mpool_new>(). The flag value is specified by ORing any of the following "
1367 #: build/C/man3/mpool.3:160
1369 msgid "B<MPOOL_DIRTY>"
1373 #: build/C/man3/mpool.3:163
1374 msgid "The page has been modified and needs to be written to the backing file."
1378 #: build/C/man3/mpool.3:166
1379 msgid "B<mpool_put>() returns 0 on success and -1 if an error occurs."
1383 #: build/C/man3/mpool.3:175
1385 "The function B<mpool_sync>() writes all modified pages associated with the "
1386 "I<MPOOL> pointer to the backing file. B<mpool_sync>() returns 0 on success "
1387 "and -1 if an error occurs."
1391 #: build/C/man3/mpool.3:185
1393 "The B<mpool_close>() function free's up any allocated memory associated "
1394 "with the memory pool cookie. Modified pages are B<not> written to the "
1395 "backing file. B<mpool_close>() returns 0 on success and -1 if an error "
1400 #: build/C/man3/mpool.3:192
1402 "The B<mpool_open>() function may fail and set I<errno> for any of the "
1403 "errors specified for the library routine B<malloc>(3)."
1407 #: build/C/man3/mpool.3:198
1408 msgid "The B<mpool_get>() function may fail and set I<errno> for the following:"
1412 #: build/C/man3/mpool.3:201
1413 msgid "The requested record doesn't exist."
1417 #: build/C/man3/mpool.3:213
1419 "The B<mpool_new>() and B<mpool_get>() functions may fail and set I<errno> "
1420 "for any of the errors specified for the library routines B<read>(2), "
1421 "B<write>(2), and B<malloc>(3)."
1425 #: build/C/man3/mpool.3:220
1427 "The B<mpool_sync>() function may fail and set I<errno> for any of the "
1428 "errors specified for the library routine B<write>(2)."
1432 #: build/C/man3/mpool.3:227
1434 "The B<mpool_close>() function may fail and set I<errno> for any of the "
1435 "errors specified for the library routine B<free>(3)."
1439 #: build/C/man3/mpool.3:227
1441 msgid "CONFORMING TO"
1445 #: build/C/man3/mpool.3:230
1446 msgid "Not in POSIX.1-2001. Present on the BSDs."
1450 #: build/C/man3/mpool.3:235
1451 msgid "B<btree>(3), B<dbopen>(3), B<hash>(3), B<recno>(3)"
1455 #: build/C/man3/recno.3:36
1461 #: build/C/man3/recno.3:40
1462 msgid "recno - record number database access method"
1466 #: build/C/man3/recno.3:62
1468 "The routine B<dbopen>(3) is the library interface to database files. One "
1469 "of the supported file formats is record number files. The general "
1470 "description of the database access methods is in B<dbopen>(3), this manual "
1471 "page describes only the recno specific information."
1475 #: build/C/man3/recno.3:71
1477 "The record number data structure is either variable or fixed-length records "
1478 "stored in a flat-file format, accessed by the logical record number. The "
1479 "existence of record number five implies the existence of records one through "
1480 "four, and the deletion of record number one causes record number five to be "
1481 "renumbered to record number four, as well as the cursor, if positioned after "
1482 "record number one, to shift down one record."
1486 #: build/C/man3/recno.3:77
1488 "The recno access method specific data structure provided to B<dbopen>(3) is "
1489 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
1493 #: build/C/man3/recno.3:89
1496 "typedef struct {\n"
1497 " unsigned long flags;\n"
1498 " unsigned int cachesize;\n"
1499 " unsigned int psize;\n"
1502 " unsigned char bval;\n"
1508 #: build/C/man3/recno.3:93
1509 msgid "The elements of this structure are defined as follows:"
1513 #: build/C/man3/recno.3:93
1519 #: build/C/man3/recno.3:98
1521 msgid "B<R_FIXEDLEN>"
1525 #: build/C/man3/recno.3:109
1527 "The records are fixed-length, not byte delimited. The structure element "
1528 "I<reclen> specifies the length of the record, and the structure element "
1529 "I<bval> is used as the pad character. Any records, inserted into the "
1530 "database, that are less than I<reclen> bytes long are automatically padded."
1534 #: build/C/man3/recno.3:109
1540 #: build/C/man3/recno.3:122
1542 "In the interface specified by B<dbopen>(3), the sequential record retrieval "
1543 "fills in both the caller's key and data structures. If the B<R_NOKEY> flag "
1544 "is specified, the I<cursor> routines are not required to fill in the key "
1545 "structure. This permits applications to retrieve records at the end of "
1546 "files without reading all of the intervening records."
1550 #: build/C/man3/recno.3:122
1552 msgid "B<R_SNAPSHOT>"
1556 #: build/C/man3/recno.3:128
1558 "This flag requires that a snapshot of the file be taken when B<dbopen>(3) "
1559 "is called, instead of permitting any unmodified records to be read from the "
1564 #: build/C/man3/recno.3:138
1566 "A suggested maximum size, in bytes, of the memory cache. This value is "
1567 "B<only> advisory, and the access method will allocate more memory rather "
1568 "than fail. If I<cachesize> is 0 (no size is specified) a default cache is "
1573 #: build/C/man3/recno.3:150
1575 "The recno access method stores the in-memory copies of its records in a "
1576 "btree. This value is the size (in bytes) of the pages used for nodes in "
1577 "that tree. If I<psize> is 0 (no page size is specified) a page size is "
1578 "chosen based on the underlying file system I/O block size. See B<btree>(3) "
1579 "for more information."
1583 #: build/C/man3/recno.3:158
1589 #: build/C/man3/recno.3:161
1590 msgid "The length of a fixed-length record."
1594 #: build/C/man3/recno.3:161
1600 #: build/C/man3/recno.3:169
1602 "The delimiting byte to be used to mark the end of a record for "
1603 "variable-length records, and the pad character for fixed-length records. If "
1604 "no value is specified, newlines (\"\\en\") are used to mark the end of "
1605 "variable-length records and fixed-length records are padded with spaces."
1609 #: build/C/man3/recno.3:169
1615 #: build/C/man3/recno.3:179
1617 "The recno access method stores the in-memory copies of its records in a "
1618 "btree. If I<bfname> is non-NULL, it specifies the name of the btree file, "
1619 "as if specified as the filename for a B<dbopen>(3) of a btree file."
1623 #: build/C/man3/recno.3:197
1625 "The data part of the key/data pair used by the I<recno> access method is the "
1626 "same as other access methods. The key is different. The I<data> field of "
1627 "the key should be a pointer to a memory location of type I<recno_t>, as "
1628 "defined in th I<E<lt>db.hE<gt>> include file. This type is normally the "
1629 "largest unsigned integral type available to the implementation. The I<size> "
1630 "field of the key should be the size of that type."
1634 #: build/C/man3/recno.3:202
1636 "Because there can be no metadata associated with the underlying recno access "
1637 "method files, any changes made to the default values (e.g., fixed record "
1638 "length or byte separator value) must be explicitly specified each time the "
1643 #: build/C/man3/recno.3:210
1645 "In the interface specified by B<dbopen>(3), using the I<put> interface to "
1646 "create a new record will cause the creation of multiple, empty records if "
1647 "the record number is more than one greater than the largest record currently "
1652 #: build/C/man3/recno.3:218
1654 "The I<recno> access method routines may fail and set I<errno> for any of the "
1655 "errors specified for the library routine B<dbopen>(3) or the following:"
1659 #: build/C/man3/recno.3:222
1661 "An attempt was made to add a record to a fixed-length database that was too "
1666 #: build/C/man3/recno.3:229
1667 msgid "B<btree>(3), B<dbopen>(3), B<hash>(3), B<mpool>(3)"
1671 #: build/C/man3/recno.3:233
1673 "I<Document Processing in a Relational Database System>, Michael Stonebraker, "
1674 "Heidi Stettner, Joseph Kalash, Antonin Guttman, Nadene Lynn, Memorandum "
1675 "No. UCB/ERL M82/32, May 1982."