1 .\" Copyright (c) 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" SPDX-License-Identifier: BSD-4-Clause-UC
6 .\" @(#)recno.3 8.5 (Berkeley) 8/18/94
8 .TH RECNO 3 2017-09-15 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
11 recno \- record number database access method
14 .RI ( libc ", " \-lc )
18 #include <sys/types.h>
24 This page documents interfaces provided in glibc up until version 2.1.
25 Since version 2.2, glibc no longer provides these interfaces.
26 Probably, you are looking for the APIs provided by the
32 is the library interface to database files.
33 One of the supported file formats is record number files.
34 The general description of the database access methods is in
36 this manual page describes only the recno-specific information.
38 The record number data structure is either variable or fixed-length
39 records stored in a flat-file format, accessed by the logical record
41 The existence of record number five implies the existence of records
42 one through four, and the deletion of record number one causes
43 record number five to be renumbered to record number four, as well
44 as the cursor, if positioned after record number one, to shift down
47 The recno access-method-specific data structure provided to
51 include file as follows:
57 unsigned int cachesize;
67 The elements of this structure are defined as follows:
70 The flag value is specified by ORing
71 any of the following values:
75 The records are fixed-length, not byte delimited.
78 specifies the length of the record, and the structure element
80 is used as the pad character.
81 Any records, inserted into the database, that are less than
83 bytes long are automatically padded.
86 In the interface specified by
88 the sequential record retrieval fills in both the caller's key and
92 flag is specified, the
94 routines are not required to fill in the key structure.
95 This permits applications to retrieve records at the end of files without
96 reading all of the intervening records.
99 This flag requires that a snapshot of the file be taken when
101 is called, instead of permitting any unmodified records to be read from
106 A suggested maximum size, in bytes, of the memory cache.
109 advisory, and the access method will allocate more memory rather than fail.
112 is 0 (no size is specified), a default cache is used.
115 The recno access method stores the in-memory copies of its records
117 This value is the size (in bytes) of the pages used for nodes in that tree.
120 is 0 (no page size is specified), a page size is chosen based on the
121 underlying filesystem I/O block size.
124 for more information.
127 The byte order for integers in the stored database metadata.
128 The number should represent the order as an integer; for example,
129 big endian order would be the number 4,321.
132 is 0 (no order is specified), the current host order is used.
135 The length of a fixed-length record.
138 The delimiting byte to be used to mark the end of a record for
139 variable-length records, and the pad character for fixed-length
141 If no value is specified, newlines ("\en") are used to mark the end
142 of variable-length records and fixed-length records are padded with
146 The recno access method stores the in-memory copies of its records
150 is non-NULL, it specifies the name of the btree file,
151 as if specified as the filename for a
155 The data part of the key/data pair used by the
158 is the same as other access methods.
159 The key is different.
162 field of the key should be a pointer to a memory location of type
167 This type is normally the largest unsigned integral type available to
171 field of the key should be the size of that type.
173 Because there can be no metadata associated with the underlying
174 recno access method files, any changes made to the default values
175 (e.g., fixed record length or byte separator value) must be explicitly
176 specified each time the file is opened.
178 In the interface specified by
182 interface to create a new record will cause the creation of multiple,
183 empty records if the record number is more than one greater than the
184 largest record currently in the database.
188 access method routines may fail and set
190 for any of the errors specified for the library routine
195 An attempt was made to add a record to a fixed-length database that
196 was too large to fit.
198 Only big and little endian byte order is supported.
205 .IR "Document Processing in a Relational Database System" ,
206 Michael Stonebraker, Heidi Stettner, Joseph Kalash, Antonin Guttman,
207 Nadene Lynn, Memorandum No. UCB/ERL M82/32, May 1982.