~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/dbinc/db_server_int.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

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) 2000-2002
5
 
 *      Sleepycat Software.  All rights reserved.
6
 
 *
7
 
 * $Id$
8
 
 */
9
 
 
10
 
#ifndef _DB_SERVER_INT_H_
11
 
#define _DB_SERVER_INT_H_
12
 
 
13
 
#define DB_SERVER_TIMEOUT       300     /* 5 minutes */
14
 
#define DB_SERVER_MAXTIMEOUT    1200    /* 20 minutes */
15
 
#define DB_SERVER_IDLETIMEOUT   86400   /* 1 day */
16
 
 
17
 
/*
18
 
 * Ignore/mask off the following env->open flags:
19
 
 * Most are illegal for a client to specify as they would control
20
 
 * server resource usage.  We will just ignore them.
21
 
 *      DB_LOCKDOWN
22
 
 *      DB_PRIVATE
23
 
 *      DB_RECOVER
24
 
 *      DB_RECOVER_FATAL
25
 
 *      DB_SYSTEM_MEM
26
 
 *      DB_USE_ENVIRON, DB_USE_ENVIRON_ROOT     - handled on client
27
 
 */
28
 
#define DB_SERVER_FLAGMASK      (                                       \
29
 
DB_LOCKDOWN | DB_PRIVATE | DB_RECOVER | DB_RECOVER_FATAL |              \
30
 
DB_SYSTEM_MEM | DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT)
31
 
 
32
 
#define CT_CURSOR       0x001           /* Cursor */
33
 
#define CT_DB           0x002           /* Database */
34
 
#define CT_ENV          0x004           /* Env */
35
 
#define CT_TXN          0x008           /* Txn */
36
 
 
37
 
#define CT_JOIN         0x10000000      /* Join cursor component */
38
 
#define CT_JOINCUR      0x20000000      /* Join cursor */
39
 
 
40
 
typedef struct home_entry home_entry;
41
 
struct home_entry {
42
 
        LIST_ENTRY(home_entry) entries;
43
 
        char *home;
44
 
        char *dir;
45
 
        char *name;
46
 
        char *passwd;
47
 
};
48
 
 
49
 
/*
50
 
 * Data needed for sharing handles.
51
 
 * To share an env handle, on the open call, they must have matching
52
 
 * env flags, and matching set_flags.
53
 
 *
54
 
 * To share a db handle on the open call, the db, subdb and flags must
55
 
 * all be the same.
56
 
 */
57
 
#define DB_SERVER_ENVFLAGS       (                                      \
58
 
DB_INIT_CDB | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |              \
59
 
DB_INIT_TXN | DB_JOINENV)
60
 
 
61
 
#define DB_SERVER_DBFLAGS        (DB_DIRTY_READ | DB_NOMMAP | DB_RDONLY)
62
 
#define DB_SERVER_DBNOSHARE      (DB_EXCL | DB_TRUNCATE)
63
 
 
64
 
typedef struct ct_envdata ct_envdata;
65
 
typedef struct ct_dbdata ct_dbdata;
66
 
struct ct_envdata {
67
 
        u_int32_t       envflags;
68
 
        u_int32_t       onflags;
69
 
        u_int32_t       offflags;
70
 
        home_entry      *home;
71
 
};
72
 
 
73
 
struct ct_dbdata {
74
 
        u_int32_t       dbflags;
75
 
        u_int32_t       setflags;
76
 
        char            *db;
77
 
        char            *subdb;
78
 
        DBTYPE          type;
79
 
};
80
 
 
81
 
/*
82
 
 * We maintain an activity timestamp for each handle.  However, we
83
 
 * set it to point, possibly to the ct_active field of its own handle
84
 
 * or it may point to the ct_active field of a parent.  In the case
85
 
 * of nested transactions and any cursors within transactions it must
86
 
 * point to the ct_active field of the ultimate parent of the transaction
87
 
 * no matter how deeply it is nested.
88
 
 */
89
 
typedef struct ct_entry ct_entry;
90
 
struct ct_entry {
91
 
        LIST_ENTRY(ct_entry) entries;           /* List of entries */
92
 
        union {
93
 
#ifdef __cplusplus
94
 
                DbEnv *envp;                    /* H_ENV */
95
 
                DbTxn *txnp;                    /* H_TXN */
96
 
                Db *dbp;                        /* H_DB */
97
 
                Dbc *dbc;                       /* H_CURSOR */
98
 
#else
99
 
                DB_ENV *envp;                   /* H_ENV */
100
 
                DB_TXN *txnp;                   /* H_TXN */
101
 
                DB *dbp;                        /* H_DB */
102
 
                DBC *dbc;                       /* H_CURSOR */
103
 
#endif
104
 
                void *anyp;
105
 
        } handle_u;
106
 
        union {                                 /* Private data per type */
107
 
                ct_envdata      envdp;          /* Env info */
108
 
                ct_dbdata       dbdp;           /* Db info */
109
 
        } private_u;
110
 
        long ct_id;                             /* Client ID */
111
 
        long *ct_activep;                       /* Activity timestamp pointer*/
112
 
        long *ct_origp;                         /* Original timestamp pointer*/
113
 
        long ct_active;                         /* Activity timestamp */
114
 
        long ct_timeout;                        /* Resource timeout */
115
 
        long ct_idle;                           /* Idle timeout */
116
 
        u_int32_t ct_refcount;                  /* Ref count for sharing */
117
 
        u_int32_t ct_type;                      /* This entry's type */
118
 
        struct ct_entry *ct_parent;             /* Its parent */
119
 
        struct ct_entry *ct_envparent;          /* Its environment */
120
 
};
121
 
 
122
 
#define ct_envp handle_u.envp
123
 
#define ct_txnp handle_u.txnp
124
 
#define ct_dbp handle_u.dbp
125
 
#define ct_dbc handle_u.dbc
126
 
#define ct_anyp handle_u.anyp
127
 
 
128
 
#define ct_envdp private_u.envdp
129
 
#define ct_dbdp private_u.dbdp
130
 
 
131
 
extern int __dbsrv_verbose;
132
 
 
133
 
/*
134
 
 * Get ctp and activate it.
135
 
 * Assumes local variable 'replyp'.
136
 
 * NOTE: May 'return' from macro.
137
 
 */
138
 
#define ACTIVATE_CTP(ctp, id, type) {           \
139
 
        (ctp) = get_tableent(id);               \
140
 
        if ((ctp) == NULL) {                    \
141
 
                replyp->status = DB_NOSERVER_ID;\
142
 
                return;                         \
143
 
        }                                       \
144
 
        DB_ASSERT((ctp)->ct_type & (type));     \
145
 
        __dbsrv_active(ctp);                    \
146
 
}
147
 
 
148
 
#endif  /* !_DB_SERVER_INT_H_ */