.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "BEFS_BTREE_READ" "9" "09 October 2005" "" ""
.SH NAME
befs_btree_read \- Traverse leafnodes of a btree
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int befs_btree_read (struct super_block * \fIsb\fB, befs_data_stream * \fIds\fB, loff_t \fIkey_no\fB, size_t \fIbufsize\fB, char * \fIkeybuf\fB, size_t * \fIkeysize\fB, befs_off_t * \fIvalue\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIsb\fB\fR
Filesystem superblock
.TP
\fB\fIds\fB\fR
Datastream containing btree
.TP
\fB\fIkey_no\fB\fR
Key number (alphabetical order) of key to read
.TP
\fB\fIbufsize\fB\fR
Size of the buffer to return key in
.TP
\fB\fIkeybuf\fB\fR
Pointer to a buffer to put the key in
.TP
\fB\fIkeysize\fB\fR
Length of the returned key
.TP
\fB\fIvalue\fB\fR
Value stored with the returned key
.SH "HERES HOW IT WORKS"
.PP
Key_no is the index of the key/value pair to
return in keybuf/value.
Bufsize is the size of keybuf (BEFS_NAME_LEN+1 is a good size). Keysize is
the number of charecters in the key (just a convenience).
.SH "ALGORITHM"
.PP
Get the first leafnode of the tree. See if the requested key is in that
node. If not, follow the node->right link to the next leafnode. Repeat
until the (key_no)th key is found or the tree is out of keys.