Annotation of researchv10no/cmd/btree/cbt.3, revision 1.1

1.1     ! root        1: .SH NAME
        !             2: bread, bwrite, bopen, bclose, bseek, bkey, bdelete, bfirst, bflush, breclen
        !             3: .TH
        !             4: cbt(3)
        !             5: .SH SYNOPSIS
        !             6: .nf
        !             7: .B typedef struct { char *mdata; unsigned short mlen; } mbuf;
        !             8: .B #include "cbt.h"
        !             9: .B bfile *bopen(file, type) char *file;
        !            10: .B bseek(bf, key) bfile *bf; mbuf key;
        !            11: .B bfirst(bf) bfile *bf;
        !            12: .B bclose(bf) bfile *bf;
        !            13: .B breclen(bf) bfile *bf;
        !            14: .B bread(bf, key, value) bfile *bf; mbuf *key, *value;
        !            15: .B bdelete(bf, key) bfile *bf; mbuf key;
        !            16: .B bflush(bf) bfile *bf;
        !            17: .fi
        !            18: .SH DESCRIPTION
        !            19: These subroutines are the C interface to B-tree files.
        !            20: Load them using
        !            21: .I -lcbt.
        !            22: The include file contains the definition of
        !            23: .I mbuf.
        !            24: B-trees may be shared by multiple readers and a single writer, since the effect of a writer's changes
        !            25: are not seen until the root of the tree is written back.
        !            26: Keys can be no longer than 255 bytes.
        !            27: The routines communicate by means of
        !            28: a
        !            29: .I bfile
        !            30: pointer returned by
        !            31: .I bopen.
        !            32: A B-tree named
        !            33: .I file
        !            34: corresponds to two
        !            35: .UX
        !            36: files,
        !            37: .I file.T
        !            38: and (if the file is not an index)
        !            39: .I file.F.
        !            40: The
        !            41: .I type
        !            42: parameter to
        !            43: .I bopen
        !            44: should be either 0 or 2, as in open (2).
        !            45: .br
        !            46: .I bclose
        !            47: closes a B-tree and (if necessary) rewrites
        !            48: its root.
        !            49: .br
        !            50: .I bflush
        !            51: writes the root without closing the B-tree.
        !            52: .PP
        !            53: The subroutines keep track of a current
        !            54: position in each open B-tree.
        !            55: When the B-tree is opened the current
        !            56: position is just before the first key.
        !            57: Calling
        !            58: .I bfirst
        !            59: has the same effect.
        !            60: .I bseek
        !            61: makes the current position just before the
        !            62: .I key
        !            63: and returns FOUND,
        !            64: if the key exists in the file,
        !            65: or it makes the current position just before
        !            66: the next largest key and returns NOTFOUND,
        !            67: or, if there is no larger key in the file
        !            68: it returns EOF.
        !            69: .I bread
        !            70: returns the key and value at the current
        !            71: position, and advances the current position.
        !            72: Note that the arguments to
        !            73: .I bread
        !            74: are all pointers.
        !            75: If either
        !            76: .I key
        !            77: or
        !            78: .I value
        !            79: are NULL, the corresponding argument is not returned.
        !            80: .I bread stores its results in the buffers
        !            81: given in the arguments, and sets the lengths
        !            82: of the results in the arguments.
        !            83: .I breclen
        !            84: returns the length of the value which will
        !            85: be returned by the next call to
        !            86: .I bread.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.