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-05-01 04:38+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/dbopen.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:52 build/C/man3/dbopen.3:55 build/C/man3/hash.3:52 build/C/man3/mpool.3:67 build/C/man3/recno.3:52
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:60
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:63
89 "The btree data structure is a sorted, balanced tree structure storing "
90 "associated key/data pairs."
94 #: build/C/man3/btree.3:69
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:82
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:86 build/C/man3/hash.3:83
118 msgid "The elements of this structure are as follows:"
122 #: build/C/man3/btree.3:86
128 #: build/C/man3/btree.3:89 build/C/man3/recno.3:95
129 msgid "The flag value is specified by ORing any of the following values:"
133 #: build/C/man3/btree.3:90
139 #: build/C/man3/btree.3:109
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:119
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:120 build/C/man3/hash.3:100 build/C/man3/recno.3:127
165 #: build/C/man3/btree.3:135
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:135
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:147
195 "The maximum number of keys which will be stored on any single page. Not "
196 "currently implemented."
200 #: build/C/man3/btree.3:147
202 msgid "I<minkeypage>"
206 #: build/C/man3/btree.3:157
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:157 build/C/man3/recno.3:136
223 #: build/C/man3/btree.3:165
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:165
238 #: build/C/man3/btree.3:177
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:177
256 #: build/C/man3/btree.3:196
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:196 build/C/man3/hash.3:115 build/C/man3/recno.3:148
276 #: build/C/man3/btree.3:204 build/C/man3/recno.3:156
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:215
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:217
294 msgid "Forward sequential scans of a tree are from the least key to the greatest."
298 #: build/C/man3/btree.3:223
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:229
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:229 build/C/man3/dbopen.3:478 build/C/man3/hash.3:149 build/C/man3/mpool.3:183 build/C/man3/recno.3:208
324 #: build/C/man3/btree.3:236
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:236 build/C/man3/dbopen.3:540 build/C/man3/hash.3:156 build/C/man3/recno.3:220
337 #: build/C/man3/btree.3:238 build/C/man3/recno.3:222
338 msgid "Only big and little endian byte order is supported."
342 #: build/C/man3/btree.3:238 build/C/man3/dbopen.3:551 build/C/man3/hash.3:158 build/C/man3/mpool.3:228 build/C/man3/recno.3:222
348 #: build/C/man3/btree.3:243
349 msgid "B<dbopen>(3), B<hash>(3), B<mpool>(3), B<recno>(3)"
353 #: build/C/man3/btree.3:246
355 "I<The Ubiquitous B-tree>, Douglas Comer, ACM Comput. Surv. 11, 2 (June "
360 #: build/C/man3/btree.3:250
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:253
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: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
380 #: build/C/man3/btree.3:260 build/C/man3/dbopen.3:566 build/C/man3/hash.3:176 build/C/man3/mpool.3:240 build/C/man3/recno.3:238
382 "This page is part of release 3.40 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:34
394 #: build/C/man3/dbopen.3:38
395 msgid "dbopen - database access methods"
399 #: build/C/man3/dbopen.3:43
402 "B<#include E<lt>sys/types.hE<gt>>\n"
403 "B<#include E<lt>limits.hE<gt>>\n"
404 "B<#include E<lt>db.hE<gt>>\n"
408 #: build/C/man3/dbopen.3:47
411 "B<DB *dbopen(const char *>I<file>B<, int >I<flags>B<, int >I<mode>B<, DBTYPE "
413 "B< const void *>I<openinfo>B<);>\n"
417 #: build/C/man3/dbopen.3:69
419 "B<dbopen>() is the library interface to database files. The supported file "
420 "formats are btree, hashed and UNIX file oriented. The btree format is a "
421 "representation of a sorted, balanced tree structure. The hashed format is "
422 "an extensible, dynamic hashing scheme. The flat-file format is a byte "
423 "stream file with fixed or variable length records. The formats and file "
424 "format specific information are described in detail in their respective "
425 "manual pages B<btree>(3), B<hash>(3) and B<recno>(3)."
429 #: build/C/man3/dbopen.3:78
431 "B<dbopen>() opens I<file> for reading and/or writing. Files never intended "
432 "to be preserved on disk may be created by setting the I<file> argument to "
436 #. Three additional options may be specified by ORing
442 #. Do the necessary locking in the database to support concurrent access.
443 #. If concurrent access isn't needed or the database is read-only this
444 #. flag should not be set, as it tends to have an associated performance
448 #. Place the underlying memory pool used by the database in shared
450 #. Necessary for concurrent access.
453 #. Support transactions in the database.
454 #. The DB_LOCK and DB_SHMEM flags must be set as well.
456 #: build/C/man3/dbopen.3:118
458 "The I<flags> and I<mode> arguments are as specified to the B<open>(2) "
459 "routine, however, only the B<O_CREAT>, B<O_EXCL>, B<O_EXLOCK>, "
460 "B<O_NONBLOCK>, B<O_RDONLY>, B<O_RDWR>, B<O_SHLOCK>, and B<O_TRUNC> flags are "
461 "meaningful. (Note, opening a database file B<O_WRONLY> is not possible.)"
465 #: build/C/man3/dbopen.3:131
467 "The I<type> argument is of type I<DBTYPE> (as defined in the "
468 "I<E<lt>db.hE<gt>> include file) and may be set to B<DB_BTREE>, B<DB_HASH>, "
473 #: build/C/man3/dbopen.3:140
475 "The I<openinfo> argument is a pointer to an access method specific structure "
476 "described in the access method's manual page. If I<openinfo> is NULL, each "
477 "access method will use defaults appropriate for the system and the access "
482 #: build/C/man3/dbopen.3:151
484 "B<dbopen>() returns a pointer to a I<DB> structure on success and NULL on "
485 "error. The I<DB> structure is defined in the I<E<lt>db.hE<gt>> include "
486 "file, and contains at least the following fields:"
490 #: build/C/man3/dbopen.3:167
495 " int (*close)(const DB *db);\n"
496 " int (*del)(const DB *db, const DBT *key, unsigned int flags);\n"
497 " int (*fd)(const DB *db);\n"
498 " int (*get)(const DB *db, DBT *key, DBT *data,\n"
499 " unsigned int flags);\n"
500 " int (*put)(const DB *db, DBT *key, const DBT *data,\n"
501 " unsigned int flags);\n"
502 " int (*sync)(const DB *db, unsigned int flags);\n"
503 " int (*seq)(const DB *db, DBT *key, DBT *data,\n"
504 " unsigned int flags);\n"
509 #: build/C/man3/dbopen.3:175
511 "These elements describe a database type and a set of functions performing "
512 "various actions. These functions take a pointer to a structure as returned "
513 "by B<dbopen>(), and sometimes one or more pointers to key/data structures "
518 #: build/C/man3/dbopen.3:175
524 #: build/C/man3/dbopen.3:178
525 msgid "The type of the underlying access method (and file format)."
529 #: build/C/man3/dbopen.3:178
535 #: build/C/man3/dbopen.3:192
537 "A pointer to a routine to flush any cached information to disk, free any "
538 "allocated resources, and close the underlying file(s). Since key/data pairs "
539 "may be cached in memory, failing to sync the file with a I<close> or I<sync> "
540 "function may result in inconsistent or lost information. I<close> routines "
541 "return -1 on error (setting I<errno>) and 0 on success."
545 #: build/C/man3/dbopen.3:192
551 #: build/C/man3/dbopen.3:195
552 msgid "A pointer to a routine to remove key/data pairs from the database."
556 #: build/C/man3/dbopen.3:199
557 msgid "The argument I<flag> may be set to the following value:"
561 #: build/C/man3/dbopen.3:200 build/C/man3/dbopen.3:256 build/C/man3/dbopen.3:356
567 #: build/C/man3/dbopen.3:204
569 "Delete the record referenced by the cursor. The cursor must have previously "
574 #: build/C/man3/dbopen.3:212
576 "I<delete> routines return -1 on error (setting I<errno>), 0 on success, and "
577 "1 if the specified I<key> was not in the file."
581 #: build/C/man3/dbopen.3:212
587 #: build/C/man3/dbopen.3:234
589 "A pointer to a routine which returns a file descriptor representative of the "
590 "underlying database. A file descriptor referencing the same file will be "
591 "returned to all processes which call B<dbopen>() with the same I<file> "
592 "name. This file descriptor may be safely used as an argument to the "
593 "B<fcntl>(2) and B<flock>(2) locking functions. The file descriptor is not "
594 "necessarily associated with any of the underlying files used by the access "
595 "method. No file descriptor is available for in memory databases. I<fd> "
596 "routines return -1 on error (setting I<errno>), and the file descriptor on "
601 #: build/C/man3/dbopen.3:234
607 #: build/C/man3/dbopen.3:248
609 "A pointer to a routine which is the interface for keyed retrieval from the "
610 "database. The address and length of the data associated with the specified "
611 "I<key> are returned in the structure referenced by I<data>. I<get> routines "
612 "return -1 on error (setting I<errno>), 0 on success, and 1 if the I<key> was "
617 #: build/C/man3/dbopen.3:248
623 #: build/C/man3/dbopen.3:251
624 msgid "A pointer to a routine to store key/data pairs in the database."
628 #: build/C/man3/dbopen.3:255
629 msgid "The argument I<flag> may be set to one of the following values:"
633 #: build/C/man3/dbopen.3:260
635 "Replace the key/data pair referenced by the cursor. The cursor must have "
636 "previously been initialized."
640 #: build/C/man3/dbopen.3:260
646 #: build/C/man3/dbopen.3:271
648 "Append the data immediately after the data referenced by I<key>, creating a "
649 "new key/data pair. The record number of the appended key/data pair is "
650 "returned in the I<key> structure. (Applicable only to the B<DB_RECNO> "
655 #: build/C/man3/dbopen.3:271
661 #: build/C/man3/dbopen.3:282
663 "Insert the data immediately before the data referenced by I<key>, creating a "
664 "new key/data pair. The record number of the inserted key/data pair is "
665 "returned in the I<key> structure. (Applicable only to the B<DB_RECNO> "
670 #: build/C/man3/dbopen.3:282
672 msgid "B<R_NOOVERWRITE>"
676 #: build/C/man3/dbopen.3:285
677 msgid "Enter the new key/data pair only if the key does not previously exist."
681 #: build/C/man3/dbopen.3:285
683 msgid "B<R_SETCURSOR>"
687 #: build/C/man3/dbopen.3:294
689 "Store the key/data pair, setting or initializing the position of the cursor "
690 "to reference it. (Applicable only to the B<DB_BTREE> and B<DB_RECNO> access "
695 #: build/C/man3/dbopen.3:304
697 "B<R_SETCURSOR> is available only for the B<DB_BTREE> and B<DB_RECNO> access "
698 "methods because it implies that the keys have an inherent order which does "
703 #: build/C/man3/dbopen.3:314
705 "B<R_IAFTER> and B<R_IBEFORE> are available only for the B<DB_RECNO> access "
706 "method because they each imply that the access method is able to create new "
707 "keys. This is only true if the keys are ordered and independent, record "
708 "numbers for example."
712 #: build/C/man3/dbopen.3:319
714 "The default behavior of the I<put> routines is to enter the new key/data "
715 "pair, replacing any previously existing key."
719 #: build/C/man3/dbopen.3:327
721 "I<put> routines return -1 on error (setting I<errno>), 0 on success, and 1 "
722 "if the B<R_NOOVERWRITE> I<flag> was set and the key already exists in the "
727 #: build/C/man3/dbopen.3:327
733 #: build/C/man3/dbopen.3:338
735 "A pointer to a routine which is the interface for sequential retrieval from "
736 "the database. The address and length of the key are returned in the "
737 "structure referenced by I<key>, and the address and length of the data are "
738 "returned in the structure referenced by I<data>."
742 #: build/C/man3/dbopen.3:351
744 "Sequential key/data pair retrieval may begin at any time, and the position "
745 "of the \"cursor\" is not affected by calls to the I<del>, I<get>, I<put>, or "
746 "I<sync> routines. Modifications to the database during a sequential scan "
747 "will be reflected in the scan, that is, records inserted behind the cursor "
748 "will not be returned while records inserted in front of the cursor will be "
753 #: build/C/man3/dbopen.3:355
754 msgid "The flag value B<must> be set to one of the following values:"
758 #: build/C/man3/dbopen.3:369
760 "The data associated with the specified key is returned. This differs from "
761 "the I<get> routines in that it sets or initializes the cursor to the "
762 "location of the key as well. (Note, for the B<DB_BTREE> access method, the "
763 "returned key is not necessarily an exact match for the specified key. The "
764 "returned key is the smallest key greater than or equal to the specified key, "
765 "permitting partial key matches and range searches.)"
769 #: build/C/man3/dbopen.3:369
775 #: build/C/man3/dbopen.3:373
777 "The first key/data pair of the database is returned, and the cursor is set "
778 "or initialized to reference it."
782 #: build/C/man3/dbopen.3:373
788 #: build/C/man3/dbopen.3:382
790 "The last key/data pair of the database is returned, and the cursor is set or "
791 "initialized to reference it. (Applicable only to the B<DB_BTREE> and "
792 "B<DB_RECNO> access methods.)"
796 #: build/C/man3/dbopen.3:382
802 #: build/C/man3/dbopen.3:388
804 "Retrieve the key/data pair immediately after the cursor. If the cursor is "
805 "not yet set, this is the same as the B<R_FIRST> flag."
809 #: build/C/man3/dbopen.3:388
815 #: build/C/man3/dbopen.3:399
817 "Retrieve the key/data pair immediately before the cursor. If the cursor is "
818 "not yet set, this is the same as the B<R_LAST> flag. (Applicable only to "
819 "the B<DB_BTREE> and B<DB_RECNO> access methods.)"
823 #: build/C/man3/dbopen.3:410
825 "B<R_LAST> and B<R_PREV> are available only for the B<DB_BTREE> and "
826 "B<DB_RECNO> access methods because they each imply that the keys have an "
827 "inherent order which does not change."
831 #: build/C/man3/dbopen.3:423
833 "I<seq> routines return -1 on error (setting I<errno>), 0 on success and 1 if "
834 "there are no key/data pairs less than or greater than the specified or "
835 "current key. If the B<DB_RECNO> access method is being used, and if the "
836 "database file is a character special file and no complete key/data pairs are "
837 "currently available, the I<seq> routines return 2."
841 #: build/C/man3/dbopen.3:423
847 #: build/C/man3/dbopen.3:429
849 "A pointer to a routine to flush any cached information to disk. If the "
850 "database is in memory only, the I<sync> routine has no effect and will "
855 #: build/C/man3/dbopen.3:431
856 msgid "The flag value may be set to the following value:"
860 #: build/C/man3/dbopen.3:432
862 msgid "B<R_RECNOSYNC>"
866 #: build/C/man3/dbopen.3:444
868 "If the B<DB_RECNO> access method is being used, this flag causes the sync "
869 "routine to apply to the btree file which underlies the recno file, not the "
870 "recno file itself. (See the I<bfname> field of the B<recno>(3) manual page "
871 "for more information.)"
875 #: build/C/man3/dbopen.3:450
876 msgid "I<sync> routines return -1 on error (setting I<errno>) and 0 on success."
880 #: build/C/man3/dbopen.3:450
882 msgid "Key/Data Pairs"
886 #: build/C/man3/dbopen.3:453
888 "Access to all file types is based on key/data pairs. Both keys and data are "
889 "represented by the following data structure:"
893 #: build/C/man3/dbopen.3:460
903 #: build/C/man3/dbopen.3:466
904 msgid "The elements of the I<DBT> structure are defined as follows:"
908 #: build/C/man3/dbopen.3:466
914 #: build/C/man3/dbopen.3:469
915 msgid "A pointer to a byte string."
919 #: build/C/man3/dbopen.3:469
925 #: build/C/man3/dbopen.3:472
926 msgid "The length of the byte string."
930 #: build/C/man3/dbopen.3:478
932 "Key and data byte strings may reference strings of essentially unlimited "
933 "length although any two of them must fit into available memory at the same "
934 "time. It should be noted that the access methods provide no guarantees "
935 "about byte string alignment."
939 #: build/C/man3/dbopen.3:488
941 "The B<dbopen>() routine may fail and set I<errno> for any of the errors "
942 "specified for the library routines B<open>(2) and B<malloc>(3) or the "
947 #: build/C/man3/dbopen.3:488
953 #: build/C/man3/dbopen.3:491
954 msgid "A file is incorrectly formatted."
958 #: build/C/man3/dbopen.3:491 build/C/man3/mpool.3:196 build/C/man3/recno.3:216
964 #: build/C/man3/dbopen.3:498
966 "A parameter has been specified (hash function, pad byte etc.) that is "
967 "incompatible with the current file specification or which is not meaningful "
968 "for the function (for example, use of the cursor without prior "
969 "initialization) or there is a mismatch between the version number of file "
974 #: build/C/man3/dbopen.3:510
976 "The I<close> routines may fail and set I<errno> for any of the errors "
977 "specified for the library routines B<close>(2), B<read>(2), B<write>(2), "
978 "B<free>(3), or B<fsync>(2)."
982 #: build/C/man3/dbopen.3:525
984 "The I<del>, I<get>, I<put> and I<seq> routines may fail and set I<errno> for "
985 "any of the errors specified for the library routines B<read>(2), "
986 "B<write>(2), B<free>(3) or B<malloc>(3)."
990 #: build/C/man3/dbopen.3:533
992 "The I<fd> routines will fail and set I<errno> to B<ENOENT> for in memory "
997 #: build/C/man3/dbopen.3:540
999 "The I<sync> routines may fail and set I<errno> for any of the errors "
1000 "specified for the library routine B<fsync>(2)."
1004 #: build/C/man3/dbopen.3:545
1006 "The typedef I<DBT> is a mnemonic for \"data base thang\", and was used "
1007 "because no-one could think of a reasonable name that wasn't already used."
1011 #: build/C/man3/dbopen.3:548
1013 "The file descriptor interface is a kludge and will be deleted in a future "
1014 "version of the interface."
1018 #: build/C/man3/dbopen.3:551
1020 "None of the access methods provide any form of concurrent access, locking, "
1025 #: build/C/man3/dbopen.3:556
1026 msgid "B<btree>(3), B<hash>(3), B<mpool>(3), B<recno>(3)"
1030 #: build/C/man3/dbopen.3:559
1032 "I<LIBTP: Portable, Modular Transactions for UNIX>, Margo Seltzer, Michael "
1033 "Olson, USENIX proceedings, Winter 1992."
1037 #: build/C/man3/hash.3:34
1043 #: build/C/man3/hash.3:38
1044 msgid "hash - hash database access method"
1048 #: build/C/man3/hash.3:60
1050 "The routine B<dbopen>(3) is the library interface to database files. One "
1051 "of the supported file formats is hash files. The general description of the "
1052 "database access methods is in B<dbopen>(3), this manual page describes only "
1053 "the hash specific information."
1057 #: build/C/man3/hash.3:62
1058 msgid "The hash data structure is an extensible, dynamic hashing scheme."
1062 #: build/C/man3/hash.3:68
1064 "The access method specific data structure provided to B<dbopen>(3) is "
1065 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
1069 #: build/C/man3/hash.3:79
1072 "typedef struct {\n"
1073 " unsigned int bsize;\n"
1074 " unsigned int ffactor;\n"
1075 " unsigned int nelem;\n"
1076 " unsigned int cachesize;\n"
1077 " uint32_t (*hash)(const void *, size_t);\n"
1083 #: build/C/man3/hash.3:83
1089 #: build/C/man3/hash.3:88
1091 "defines the hash table bucket size, and is, by default, 256 bytes. It may "
1092 "be preferable to increase the page size for disk-resident tables and tables "
1093 "with large data items."
1097 #: build/C/man3/hash.3:88
1103 #: build/C/man3/hash.3:94
1105 "indicates a desired density within the hash table. It is an approximation "
1106 "of the number of keys allowed to accumulate in any one bucket, determining "
1107 "when the hash table grows or shrinks. The default value is 8."
1111 #: build/C/man3/hash.3:94
1117 #: build/C/man3/hash.3:100
1119 "is an estimate of the final size of the hash table. If not set or set too "
1120 "low, hash tables will expand gracefully as keys are entered, although a "
1121 "slight performance degradation may be noticed. The default value is 1."
1125 #: build/C/man3/hash.3:106
1127 "is the suggested maximum size, in bytes, of the memory cache. This value is "
1128 "I<only advisory>, and the access method will allocate more memory rather "
1133 #: build/C/man3/hash.3:106
1139 #: build/C/man3/hash.3:115
1141 "is a user-defined hash function. Since no hash function performs equally "
1142 "well on all possible data, the user may find that the built-in hash function "
1143 "does poorly on a particular data set. A user-specified hash functions must "
1144 "take two arguments (a pointer to a byte string and a length) and return a "
1145 "32-bit quantity to be used as the hash value."
1149 #: build/C/man3/hash.3:125
1151 "is the byte order for integers in the stored database metadata. The number "
1152 "should represent the order as an integer; for example, big endian order "
1153 "would be the number 4,321. If I<lorder> is 0 (no order is specified) the "
1154 "current host order is used. If the file already exists, the specified value "
1155 "is ignored and the value specified when the tree was created is used."
1159 #: build/C/man3/hash.3:137
1161 "If the file already exists (and the B<O_TRUNC> flag is not specified), the "
1162 "values specified for I<bsize>, I<ffactor>, I<lorder>, and I<nelem> are "
1163 "ignored and the values specified when the tree was created are used."
1167 #: build/C/man3/hash.3:142
1169 "If a hash function is specified, I<hash_open> will attempt to determine if "
1170 "the hash function specified is the same as the one with which the database "
1171 "was created, and will fail if it is not."
1175 #: build/C/man3/hash.3:149
1177 "Backward-compatible interfaces to the routines described in B<dbm>(3), and "
1178 "B<ndbm>(3) are provided, however these interfaces are not compatible with "
1179 "previous file formats."
1183 #: build/C/man3/hash.3:156
1185 "The I<hash> access method routines may fail and set I<errno> for any of the "
1186 "errors specified for the library routine B<dbopen>(3)."
1190 #: build/C/man3/hash.3:158
1191 msgid "Only big and little endian byte order are supported."
1195 #: build/C/man3/hash.3:163
1196 msgid "B<btree>(3), B<dbopen>(3), B<mpool>(3), B<recno>(3)"
1200 #: build/C/man3/hash.3:166
1202 "I<Dynamic Hash Tables>, Per-Ake Larson, Communications of the ACM, April "
1207 #: build/C/man3/hash.3:169
1209 "I<A New Hash Package for UNIX>, Margo Seltzer, USENIX Proceedings, Winter "
1214 #: build/C/man3/mpool.3:34
1220 #: build/C/man3/mpool.3:34
1226 #: build/C/man3/mpool.3:38
1227 msgid "mpool - shared memory buffer pool"
1231 #: build/C/man3/mpool.3:42
1234 "B<#include E<lt>db.hE<gt>>\n"
1235 "B<#include E<lt>mpool.hE<gt>>\n"
1239 #: build/C/man3/mpool.3:45
1242 "B<MPOOL *mpool_open(DBT *>I<key>B<, int >I<fd>B<, pgno_t >I<pagesize>B<, "
1243 "pgno_t >I<maxcache>B<);>\n"
1247 #: build/C/man3/mpool.3:49
1250 "B<void mpool_filter(MPOOL *>I<mp>B<, void (*pgin)(void *, pgno_t, void "
1252 "B< void (*>I<pgout>B<)(void *, pgno_t, void *),>\n"
1253 "B< void *>I<pgcookie>B<);>\n"
1257 #: build/C/man3/mpool.3:51
1259 msgid "B<void *mpool_new(MPOOL *>I<mp>B<, pgno_t *>I<pgnoaddr>B<);>\n"
1263 #: build/C/man3/mpool.3:53
1266 "B<void *mpool_get(MPOOL *>I<mp>B<, pgno_t >I<pgno>B<, unsigned int "
1271 #: build/C/man3/mpool.3:55
1274 "B<int mpool_put(MPOOL *>I<mp>B<, void *>I<pgaddr>B<, unsigned int "
1279 #: build/C/man3/mpool.3:57
1281 msgid "B<int mpool_sync(MPOOL *>I<mp>B<);>\n"
1285 #: build/C/man3/mpool.3:59
1287 msgid "B<int mpool_close(MPOOL *>I<mp>B<);>\n"
1291 #: build/C/man3/mpool.3:72
1293 "I<Mpool> is the library interface intended to provide page oriented buffer "
1294 "management of files. The buffers may be shared between processes."
1298 #: build/C/man3/mpool.3:93
1300 "The function B<mpool_open>() initializes a memory pool. The I<key> "
1301 "argument is the byte string used to negotiate between multiple processes "
1302 "wishing to share buffers. If the file buffers are mapped in shared memory, "
1303 "all processes using the same key will share the buffers. If I<key> is NULL, "
1304 "the buffers are mapped into private memory. The I<fd> argument is a file "
1305 "descriptor for the underlying file, which must be seekable. If I<key> is "
1306 "non-NULL and matches a file already being mapped, the I<fd> argument is "
1311 #: build/C/man3/mpool.3:104
1313 "The I<pagesize> argument is the size, in bytes, of the pages into which the "
1314 "file is broken up. The I<maxcache> argument is the maximum number of pages "
1315 "from the underlying file to cache at any one time. This value is not "
1316 "relative to the number of processes which share a file's buffers, but will "
1317 "be the largest value specified by any of the processes sharing the file."
1321 #: build/C/man3/mpool.3:120
1323 "The B<mpool_filter>() function is intended to make transparent input and "
1324 "output processing of the pages possible. If the I<pgin> function is "
1325 "specified, it is called each time a buffer is read into the memory pool from "
1326 "the backing file. If the I<pgout> function is specified, it is called each "
1327 "time a buffer is written into the backing file. Both functions are called "
1328 "with the I<pgcookie> pointer, the page number and a pointer to the page to "
1329 "being read or written."
1333 #: build/C/man3/mpool.3:133
1335 "The function B<mpool_new>() takes an I<MPOOL> pointer and an address as "
1336 "arguments. If a new page can be allocated, a pointer to the page is "
1337 "returned and the page number is stored into the I<pgnoaddr> address. "
1338 "Otherwise, NULL is returned and I<errno> is set."
1342 #: build/C/man3/mpool.3:146
1344 "The function B<mpool_get>() takes an I<MPOOL> pointer and a page number as "
1345 "arguments. If the page exists, a pointer to the page is returned. "
1346 "Otherwise, NULL is returned and I<errno> is set. The I<flags> argument is "
1347 "not currently used."
1351 #: build/C/man3/mpool.3:158
1353 "The function B<mpool_put>() unpins the page referenced by I<pgaddr>. "
1354 "I<pgaddr> must be an address previously returned by B<mpool_get>() or "
1355 "B<mpool_new>(). The flag value is specified by ORing any of the following "
1360 #: build/C/man3/mpool.3:158
1362 msgid "B<MPOOL_DIRTY>"
1366 #: build/C/man3/mpool.3:161
1367 msgid "The page has been modified and needs to be written to the backing file."
1371 #: build/C/man3/mpool.3:164
1372 msgid "B<mpool_put>() returns 0 on success and -1 if an error occurs."
1376 #: build/C/man3/mpool.3:173
1378 "The function B<mpool_sync>() writes all modified pages associated with the "
1379 "I<MPOOL> pointer to the backing file. B<mpool_sync>() returns 0 on success "
1380 "and -1 if an error occurs."
1384 #: build/C/man3/mpool.3:183
1386 "The B<mpool_close>() function free's up any allocated memory associated "
1387 "with the memory pool cookie. Modified pages are B<not> written to the "
1388 "backing file. B<mpool_close>() returns 0 on success and -1 if an error "
1393 #: build/C/man3/mpool.3:190
1395 "The B<mpool_open>() function may fail and set I<errno> for any of the "
1396 "errors specified for the library routine B<malloc>(3)."
1400 #: build/C/man3/mpool.3:196
1401 msgid "The B<mpool_get>() function may fail and set I<errno> for the following:"
1405 #: build/C/man3/mpool.3:199
1406 msgid "The requested record doesn't exist."
1410 #: build/C/man3/mpool.3:211
1412 "The B<mpool_new>() and B<mpool_get>() functions may fail and set I<errno> "
1413 "for any of the errors specified for the library routines B<read>(2), "
1414 "B<write>(2), and B<malloc>(3)."
1418 #: build/C/man3/mpool.3:218
1420 "The B<mpool_sync>() function may fail and set I<errno> for any of the "
1421 "errors specified for the library routine B<write>(2)."
1425 #: build/C/man3/mpool.3:225
1427 "The B<mpool_close>() function may fail and set I<errno> for any of the "
1428 "errors specified for the library routine B<free>(3)."
1432 #: build/C/man3/mpool.3:225
1434 msgid "CONFORMING TO"
1438 #: build/C/man3/mpool.3:228
1439 msgid "Not in POSIX.1-2001. Present on the BSDs."
1443 #: build/C/man3/mpool.3:233
1444 msgid "B<btree>(3), B<dbopen>(3), B<hash>(3), B<recno>(3)"
1448 #: build/C/man3/recno.3:34
1454 #: build/C/man3/recno.3:38
1455 msgid "recno - record number database access method"
1459 #: build/C/man3/recno.3:60
1461 "The routine B<dbopen>(3) is the library interface to database files. One "
1462 "of the supported file formats is record number files. The general "
1463 "description of the database access methods is in B<dbopen>(3), this manual "
1464 "page describes only the recno specific information."
1468 #: build/C/man3/recno.3:69
1470 "The record number data structure is either variable or fixed-length records "
1471 "stored in a flat-file format, accessed by the logical record number. The "
1472 "existence of record number five implies the existence of records one through "
1473 "four, and the deletion of record number one causes record number five to be "
1474 "renumbered to record number four, as well as the cursor, if positioned after "
1475 "record number one, to shift down one record."
1479 #: build/C/man3/recno.3:75
1481 "The recno access method specific data structure provided to B<dbopen>(3) is "
1482 "defined in the I<E<lt>db.hE<gt>> include file as follows:"
1486 #: build/C/man3/recno.3:87
1489 "typedef struct {\n"
1490 " unsigned long flags;\n"
1491 " unsigned int cachesize;\n"
1492 " unsigned int psize;\n"
1495 " unsigned char bval;\n"
1501 #: build/C/man3/recno.3:91
1502 msgid "The elements of this structure are defined as follows:"
1506 #: build/C/man3/recno.3:91
1512 #: build/C/man3/recno.3:96
1514 msgid "B<R_FIXEDLEN>"
1518 #: build/C/man3/recno.3:107
1520 "The records are fixed-length, not byte delimited. The structure element "
1521 "I<reclen> specifies the length of the record, and the structure element "
1522 "I<bval> is used as the pad character. Any records, inserted into the "
1523 "database, that are less than I<reclen> bytes long are automatically padded."
1527 #: build/C/man3/recno.3:107
1533 #: build/C/man3/recno.3:120
1535 "In the interface specified by B<dbopen>(3), the sequential record retrieval "
1536 "fills in both the caller's key and data structures. If the B<R_NOKEY> flag "
1537 "is specified, the I<cursor> routines are not required to fill in the key "
1538 "structure. This permits applications to retrieve records at the end of "
1539 "files without reading all of the intervening records."
1543 #: build/C/man3/recno.3:120
1545 msgid "B<R_SNAPSHOT>"
1549 #: build/C/man3/recno.3:126
1551 "This flag requires that a snapshot of the file be taken when B<dbopen>(3) "
1552 "is called, instead of permitting any unmodified records to be read from the "
1557 #: build/C/man3/recno.3:136
1559 "A suggested maximum size, in bytes, of the memory cache. This value is "
1560 "B<only> advisory, and the access method will allocate more memory rather "
1561 "than fail. If I<cachesize> is 0 (no size is specified) a default cache is "
1566 #: build/C/man3/recno.3:148
1568 "The recno access method stores the in-memory copies of its records in a "
1569 "btree. This value is the size (in bytes) of the pages used for nodes in "
1570 "that tree. If I<psize> is 0 (no page size is specified) a page size is "
1571 "chosen based on the underlying file system I/O block size. See B<btree>(3) "
1572 "for more information."
1576 #: build/C/man3/recno.3:156
1582 #: build/C/man3/recno.3:159
1583 msgid "The length of a fixed-length record."
1587 #: build/C/man3/recno.3:159
1593 #: build/C/man3/recno.3:167
1595 "The delimiting byte to be used to mark the end of a record for "
1596 "variable-length records, and the pad character for fixed-length records. If "
1597 "no value is specified, newlines (\"\\en\") are used to mark the end of "
1598 "variable-length records and fixed-length records are padded with spaces."
1602 #: build/C/man3/recno.3:167
1608 #: build/C/man3/recno.3:177
1610 "The recno access method stores the in-memory copies of its records in a "
1611 "btree. If I<bfname> is non-NULL, it specifies the name of the btree file, "
1612 "as if specified as the filename for a B<dbopen>(3) of a btree file."
1616 #: build/C/man3/recno.3:195
1618 "The data part of the key/data pair used by the I<recno> access method is the "
1619 "same as other access methods. The key is different. The I<data> field of "
1620 "the key should be a pointer to a memory location of type I<recno_t>, as "
1621 "defined in th I<E<lt>db.hE<gt>> include file. This type is normally the "
1622 "largest unsigned integral type available to the implementation. The I<size> "
1623 "field of the key should be the size of that type."
1627 #: build/C/man3/recno.3:200
1629 "Because there can be no metadata associated with the underlying recno access "
1630 "method files, any changes made to the default values (e.g., fixed record "
1631 "length or byte separator value) must be explicitly specified each time the "
1636 #: build/C/man3/recno.3:208
1638 "In the interface specified by B<dbopen>(3), using the I<put> interface to "
1639 "create a new record will cause the creation of multiple, empty records if "
1640 "the record number is more than one greater than the largest record currently "
1645 #: build/C/man3/recno.3:216
1647 "The I<recno> access method routines may fail and set I<errno> for any of the "
1648 "errors specified for the library routine B<dbopen>(3) or the following:"
1652 #: build/C/man3/recno.3:220
1654 "An attempt was made to add a record to a fixed-length database that was too "
1659 #: build/C/man3/recno.3:227
1660 msgid "B<btree>(3), B<dbopen>(3), B<hash>(3), B<mpool>(3)"
1664 #: build/C/man3/recno.3:231
1666 "I<Document Processing in a Relational Database System>, Michael Stonebraker, "
1667 "Heidi Stettner, Joseph Kalash, Antonin Guttman, Nadene Lynn, Memorandum "
1668 "No. UCB/ERL M82/32, May 1982."