📄 recno.3
字号:
.\" Copyright (c) 1990, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)recno.3 8.3 (Berkeley) 2/21/94.\".TH RECNO 3 "February 21, 1994".UC 7.SH NAMErecno \- record number database access method.SH SYNOPSIS.nf.ft B#include <sys/types.h>#include <db.h>.ft R.fi.SH DESCRIPTIONThe routine.IR dbopenis the library interface to database files.One of the supported file formats is record number files.The general description of the database access methods is in.IR dbopen (3),this manual page describes only the recno specific information..PPThe record number data structure is either variable or fixed-lengthrecords stored in a flat-file format, accessed by the logical recordnumber.The existence of record number five implies the existence of recordsone through four, and the deletion of record number one causesrecord number five to be renumbered to record number four, as wellas the cursor, if positioned after record number one, to shift downone record..PPThe recno access method specific data structure provided to.I dbopenis defined in the <db.h> include file as follows:.PPtypedef struct {.RSu_long flags;.bru_int cachesize;.bru_int psize;.brint lorder;.brsize_t reclen;.bru_char bval;.brchar *bfname;.RE} RECNOINFO;.PPThe elements of this structure are defined as follows:.TPflagsThe flag value is specified by.IR or 'ingany of the following values:.RS.TPR_FIXEDLENThe records are fixed-length, not byte delimited.The structure element.I reclenspecifies the length of the record, and the structure element.I bvalis used as the pad character..TPR_NOKEYIn the interface specified by.IR dbopen ,the sequential record retrieval fills in both the caller's key anddata structures.If the R_NOKEY flag is specified, the.I cursorroutines are not required to fill in the key structure.This permits applications to retrieve records at the end of files withoutreading all of the intervening records..TPR_SNAPSHOTThis flag requires that a snapshot of the file be taken when.I dbopenis called, instead of permitting any unmodified records to be read fromthe original file..RE.TPcachesizeA suggested maximum size, in bytes, of the memory cache.This value is.B onlyadvisory, and the access method will allocate more memory rather than fail.If.I cachesizeis 0 (no size is specified) a default cache is used..TPpsizeThe recno access method stores the in-memory copies of its recordsin a btree.This value is the size (in bytes) of the pages used for nodes in that tree.If.I psizeis 0 (no page size is specified) a page size is chosen based on theunderlying file system I/O block size.See.IR btree (3)for more information..TPlorderThe byte order for integers in the stored database metadata.The number should represent the order as an integer; for example,big endian order would be the number 4,321.If.I lorderis 0 (no order is specified) the current host order is used..TPreclenThe length of a fixed-length record..TPbvalThe delimiting byte to be used to mark the end of a record forvariable-length records, and the pad character for fixed-lengthrecords.If no value is specified, newlines (``\en'') are used to mark the endof variable-length records and fixed-length records are padded withspaces..TPbfnameThe recno access method stores the in-memory copies of its recordsin a btree.If bfname is non-NULL, it specifies the name of the btree file,as if specified as the file name for a dbopen of a btree file..PPThe data part of the key/data pair used by the recno access methodis the same as other access methods.The key is different.The.I datafield of the key should be a pointer to a memory location of type.IR recno_t ,as defined in the <db.h> include file.This type is normally the largest unsigned integral type available tothe implementation.The.I sizefield of the key should be the size of that type..PPIn the interface specified by.IR dbopen ,using the.I putinterface to create a new record will cause the creation of multiple,empty records if the record number is more than one greater than thelargest record currently in the database..SH "SEE ALSO".IR dbopen (3),.IR hash (3),.IR mpool (3),.IR recno (3).sp.IR "Document Processing in a Relational Database System" ,Michael Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman,Nadene Lynn, Memorandum No. UCB/ERL M82/32, May 1982..SH BUGSOnly big and little endian byte order is supported.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -