Main Page | Modules | Namespace List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

apr_dbm_private.h

00001 /* Copyright 2000-2004 The Apache Software Foundation
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 #ifndef APR_DBM_PRIVATE_H
00017 #define APR_DBM_PRIVATE_H
00018 
00019 #include "apr.h"
00020 #include "apr_errno.h"
00021 #include "apr_pools.h"
00022 #include "apr_dbm.h"
00023 #include "apr_file_io.h"
00024 
00025 #include "apu.h"
00026 
00027 /* ### for now, include the DBM selection; this will go away once we start
00028    ### building and linking all of the DBMs at once. */
00029 #include "apu_select_dbm.h"
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00041 APU_DECLARE(int) apr_posix_perms2mode(apr_fileperms_t perm);
00042 
00046 typedef struct {
00048     const char *name;
00049 
00051     apr_status_t (*open)(apr_dbm_t **pdb, const char *pathname,
00052                          apr_int32_t mode, apr_fileperms_t perm,
00053                          apr_pool_t *pool);
00054 
00056     void (*close)(apr_dbm_t *dbm);
00057 
00059     apr_status_t (*fetch)(apr_dbm_t *dbm, apr_datum_t key,
00060                                    apr_datum_t * pvalue);
00061 
00063     apr_status_t (*store)(apr_dbm_t *dbm, apr_datum_t key, apr_datum_t value);
00064 
00066     apr_status_t (*del)(apr_dbm_t *dbm, apr_datum_t key);
00067 
00069     int (*exists)(apr_dbm_t *dbm, apr_datum_t key);
00070 
00072     apr_status_t (*firstkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
00073 
00075     apr_status_t (*nextkey)(apr_dbm_t *dbm, apr_datum_t * pkey);
00076 
00078     void (*freedatum)(apr_dbm_t *dbm, apr_datum_t data);
00079 
00081     void (*getusednames)(apr_pool_t *pool,
00082                          const char *pathname,
00083                          const char **used1,
00084                          const char **used2);
00085 
00086 } apr_dbm_type_t;
00087 
00088 
00092 struct apr_dbm_t
00093 { 
00095     apr_pool_t *pool;
00096 
00098     void *file;
00099 
00101     int errcode;
00103     const char *errmsg;
00104 
00106     const apr_dbm_type_t *type;
00107 };
00108 
00109 
00110 /* Declare all of the builtin DBM providers */
00111 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
00112 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
00113 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
00114 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db1;
00115 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db2;
00116 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db3;
00117 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db4;
00118 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db;
00119 
00120 #ifdef __cplusplus
00121 }
00122 #endif
00123 
00124 #endif /* APR_DBM_PRIVATE_H */

Generated on Thu Sep 8 12:20:49 2005 for Apache Portable Runtime Utility Library by  doxygen 1.4.4