~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to srclib/apr-util/include/private/apr_dbm_private.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
 
2
 * applicable.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
 
 
17
#ifndef APR_DBM_PRIVATE_H
 
18
#define APR_DBM_PRIVATE_H
 
19
 
 
20
#include "apr.h"
 
21
#include "apr_errno.h"
 
22
#include "apr_pools.h"
 
23
#include "apr_dbm.h"
 
24
#include "apr_file_io.h"
 
25
 
 
26
#include "apu.h"
 
27
 
 
28
/* ### for now, include the DBM selection; this will go away once we start
 
29
   ### building and linking all of the DBMs at once. */
 
30
#include "apu_select_dbm.h"
 
31
 
 
32
#ifdef __cplusplus
 
33
extern "C" {
 
34
#endif
 
35
 
 
36
/** @internal */
 
37
 
 
38
/**
 
39
 * Most DBM libraries take a POSIX mode for creating files.  Don't trust
 
40
 * the mode_t type, some platforms may not support it, int is safe.
 
41
 */
 
42
APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm);
 
43
 
 
44
/**
 
45
 * Structure to describe the operations of the DBM
 
46
 */
 
47
typedef struct {
 
48
    /** The name of the DBM Type */
 
49
    const char *name;
 
50
 
 
51
    /** Open the DBM */
 
52
    apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname,
 
53
                         apr_int32_t mode, apr_fileperms_t perm,
 
54
                         apr_pool_t *pool);
 
55
 
 
56
    /** Close the DBM */
 
57
    void (*close)(apr_dbm_t *dbm);
 
58
 
 
59
    /** Fetch a dbm record value by key */
 
60
    apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key,
 
61
                                   apr_datum_t * pvalue);
 
62
 
 
63
    /** Store a dbm record value by key */
 
64
    apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value);
 
65
 
 
66
    /** Delete a dbm record value by key */
 
67
    apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key);
 
68
 
 
69
    /** Search for a key within the dbm */
 
70
    int (*exists)(apr_dbm_t *dbm, apr_datum_t key);
 
71
 
 
72
    /** Retrieve the first record key from a dbm */
 
73
    apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
 
74
 
 
75
    /** Retrieve the next record key from a dbm */
 
76
    apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
 
77
 
 
78
    /** Proactively toss any memory associated with the apr_datum_t. */
 
79
    void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data);
 
80
 
 
81
    /** Get the names that the DBM will use for a given pathname. */
 
82
    void (*getusednames)(apr_pool_t *pool,
 
83
                         const char *pathname,
 
84
                         const char **used1,
 
85
                         const char **used2);
 
86
 
 
87
} apr_dbm_type_t;
 
88
 
 
89
 
 
90
/**
 
91
 * The actual DBM
 
92
 */
 
93
struct apr_dbm_t
 
94
 
95
    /** Associated pool */
 
96
    apr_pool_t *pool;
 
97
 
 
98
    /** pointer to DB Implementation Specific data */
 
99
    void *file;
 
100
 
 
101
    /** Current integer error code */
 
102
    int errcode;
 
103
    /** Current string error code */
 
104
    const char *errmsg;
 
105
 
 
106
    /** the type of DBM */
 
107
    const apr_dbm_type_t *type;
 
108
};
 
109
 
 
110
 
 
111
/* Declare all of the builtin DBM providers */
 
112
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
 
113
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
 
114
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
 
115
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db1;
 
116
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db2;
 
117
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db3;
 
118
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db4;
 
119
APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
 
120
 
 
121
#ifdef __cplusplus
 
122
}
 
123
#endif
 
124
 
 
125
#endif /* APR_DBM_PRIVATE_H */