~vlad-lesin/percona-server/mysql-5.0.33-original

« back to all changes in this revision

Viewing changes to bdb/db185/db185_int.in

  • Committer: Vlad Lesin
  • Date: 2012-07-31 09:21:34 UTC
  • Revision ID: vladislav.lesin@percona.com-20120731092134-zfodx022b7992wsi
VirginĀ 5.0.33

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-
 
2
 * See the file LICENSE for redistribution information.
 
3
 *
 
4
 * Copyright (c) 1997-2002
 
5
 *      Sleepycat Software.  All rights reserved.
 
6
 */
 
7
/*
 
8
 * Copyright (c) 1990, 1993, 1994, 1995, 1996
 
9
 *      Keith Bostic.  All rights reserved.
 
10
 */
 
11
/*
 
12
 * Copyright (c) 1990, 1993, 1994
 
13
 *      The Regents of the University of California.  All rights reserved.
 
14
 *
 
15
 * Redistribution and use in source and binary forms, with or without
 
16
 * modification, are permitted provided that the following conditions
 
17
 * are met:
 
18
 * 1. Redistributions of source code must retain the above copyright
 
19
 *    notice, this list of conditions and the following disclaimer.
 
20
 * 2. Redistributions in binary form must reproduce the above copyright
 
21
 *    notice, this list of conditions and the following disclaimer in the
 
22
 *    documentation and/or other materials provided with the distribution.
 
23
 * 3. Neither the name of the University nor the names of its contributors
 
24
 *    may be used to endorse or promote products derived from this software
 
25
 *    without specific prior written permission.
 
26
 *
 
27
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
28
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
29
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
30
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
31
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
32
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
33
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
34
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
35
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
36
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
37
 * SUCH DAMAGE.
 
38
 *
 
39
 * $Id: db185_int.in,v 11.12 2002/01/11 15:51:51 bostic Exp $
 
40
 */
 
41
 
 
42
#ifndef _DB185_INT_H_
 
43
#define _DB185_INT_H_
 
44
 
 
45
/* Routine flags. */
 
46
#define R_CURSOR        1               /* del, put, seq */
 
47
#define __R_UNUSED      2               /* UNUSED */
 
48
#define R_FIRST         3               /* seq */
 
49
#define R_IAFTER        4               /* put (RECNO) */
 
50
#define R_IBEFORE       5               /* put (RECNO) */
 
51
#define R_LAST          6               /* seq (BTREE, RECNO) */
 
52
#define R_NEXT          7               /* seq */
 
53
#define R_NOOVERWRITE   8               /* put */
 
54
#define R_PREV          9               /* seq (BTREE, RECNO) */
 
55
#define R_SETCURSOR     10              /* put (RECNO) */
 
56
#define R_RECNOSYNC     11              /* sync (RECNO) */
 
57
 
 
58
typedef struct {
 
59
        void    *data;                  /* data */
 
60
        size_t   size;                  /* data length */
 
61
} DBT185;
 
62
 
 
63
/* Access method description structure. */
 
64
typedef struct __db185 {
 
65
        DBTYPE type;                    /* Underlying db type. */
 
66
        int (*close)    __P((struct __db185 *));
 
67
        int (*del)      __P((const struct __db185 *, const DBT185 *, u_int));
 
68
        int (*get)
 
69
            __P((const struct __db185 *, const DBT185 *, DBT185 *, u_int));
 
70
        int (*put)
 
71
            __P((const struct __db185 *, DBT185 *, const DBT185 *, u_int));
 
72
        int (*seq)
 
73
            __P((const struct __db185 *, DBT185 *, DBT185 *, u_int));
 
74
        int (*sync)     __P((const struct __db185 *, u_int));
 
75
        DB        *dbp;                 /* DB structure.  Was void *internal. */
 
76
        int (*fd)       __P((const struct __db185 *));
 
77
 
 
78
        /*
 
79
         * !!!
 
80
         * The following elements added to the end of the DB 1.85 DB
 
81
         * structure.
 
82
         */
 
83
        DBC       *dbc;                 /* DB cursor. */
 
84
                                        /* Various callback functions. */
 
85
        int       (*compare) __P((const DBT *, const DBT *));
 
86
        size_t    (*prefix) __P((const DBT *, const DBT *));
 
87
        u_int32_t (*hash) __P((const void *, size_t));
 
88
} DB185;
 
89
 
 
90
/* Structure used to pass parameters to the btree routines. */
 
91
typedef struct {
 
92
#define R_DUP           0x01    /* duplicate keys */
 
93
        u_int32_t flags;
 
94
        u_int32_t cachesize;    /* bytes to cache */
 
95
        u_int32_t maxkeypage;   /* maximum keys per page */
 
96
        u_int32_t minkeypage;   /* minimum keys per page */
 
97
        u_int32_t psize;        /* page size */
 
98
        int     (*compare)      /* comparison function */
 
99
            __P((const DBT *, const DBT *));
 
100
        size_t  (*prefix)       /* prefix function */
 
101
            __P((const DBT *, const DBT *));
 
102
        int     lorder;         /* byte order */
 
103
} BTREEINFO;
 
104
 
 
105
/* Structure used to pass parameters to the hashing routines. */
 
106
typedef struct {
 
107
        u_int32_t bsize;        /* bucket size */
 
108
        u_int32_t ffactor;      /* fill factor */
 
109
        u_int32_t nelem;        /* number of elements */
 
110
        u_int32_t cachesize;    /* bytes to cache */
 
111
        u_int32_t               /* hash function */
 
112
                (*hash) __P((const void *, size_t));
 
113
        int     lorder;         /* byte order */
 
114
} HASHINFO;
 
115
 
 
116
/* Structure used to pass parameters to the record routines. */
 
117
typedef struct {
 
118
#define R_FIXEDLEN      0x01    /* fixed-length records */
 
119
#define R_NOKEY         0x02    /* key not required */
 
120
#define R_SNAPSHOT      0x04    /* snapshot the input */
 
121
        u_int32_t flags;
 
122
        u_int32_t cachesize;    /* bytes to cache */
 
123
        u_int32_t psize;        /* page size */
 
124
        int     lorder;         /* byte order */
 
125
        size_t  reclen;         /* record length (fixed-length records) */
 
126
        u_char  bval;           /* delimiting byte (variable-length records */
 
127
        char    *bfname;        /* btree file name */
 
128
} RECNOINFO;
 
129
#endif /* !_DB185_INT_H_ */