Loading...
Searching...
No Matches
apr_sdbm.h
Go to the documentation of this file.
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* sdbm - ndbm work-alike hashed database library
* based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978).
* author: oz@nexus.yorku.ca
* status: ex-public domain
*/
#ifndef APR_SDBM_H
#define APR_SDBM_H
#include "apu.h"
#include "apr_errno.h"
#include "apr_file_io.h" /* for apr_fileperms_t */
typedef struct apr_sdbm_t apr_sdbm_t;
typedef struct {
char *dptr;
/* apr_ssize_t for release 2.0??? */
int dsize;
} apr_sdbm_datum_t;
/* The extensions used for the database files */
#define APR_SDBM_DIRFEXT ".dir"
#define APR_SDBM_PAGFEXT ".pag"
/* flags to sdbm_store */
#define APR_SDBM_INSERT 0
#define APR_SDBM_REPLACE 1
#define APR_SDBM_INSERTDUP 2
APU_DECLARE(apr_status_t) apr_sdbm_open(apr_sdbm_t **db, const char *name,
apr_int32_t mode,
apr_fileperms_t perms, apr_pool_t *p);
APU_DECLARE(apr_status_t) apr_sdbm_close(apr_sdbm_t *db);
APU_DECLARE(apr_status_t) apr_sdbm_lock(apr_sdbm_t *db, int type);
APU_DECLARE(apr_status_t) apr_sdbm_unlock(apr_sdbm_t *db);
APU_DECLARE(apr_status_t) apr_sdbm_fetch(apr_sdbm_t *db,
apr_sdbm_datum_t *value,
apr_sdbm_datum_t key);
APU_DECLARE(apr_status_t) apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key,
apr_sdbm_datum_t value, int opt);
APU_DECLARE(apr_status_t) apr_sdbm_delete(apr_sdbm_t *db,
const apr_sdbm_datum_t key);
APU_DECLARE(apr_status_t) apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
APU_DECLARE(apr_status_t) apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key);
APU_DECLARE(int) apr_sdbm_rdonly(apr_sdbm_t *db);
#endif /* APR_SDBM_H */
apr_sdbm_open
apr_status_t apr_sdbm_open(apr_sdbm_t **db, const char *name, apr_int32_t mode, apr_fileperms_t perms, apr_pool_t *p)
apr_sdbm_lock
apr_status_t apr_sdbm_lock(apr_sdbm_t *db, int type)
apr_sdbm_delete
apr_status_t apr_sdbm_delete(apr_sdbm_t *db, const apr_sdbm_datum_t key)
apr_sdbm_nextkey
apr_status_t apr_sdbm_nextkey(apr_sdbm_t *db, apr_sdbm_datum_t *key)
apr_sdbm_fetch
apr_status_t apr_sdbm_fetch(apr_sdbm_t *db, apr_sdbm_datum_t *value, apr_sdbm_datum_t key)
apr_sdbm_unlock
apr_status_t apr_sdbm_unlock(apr_sdbm_t *db)
apr_sdbm_rdonly
int apr_sdbm_rdonly(apr_sdbm_t *db)
apr_sdbm_store
apr_status_t apr_sdbm_store(apr_sdbm_t *db, apr_sdbm_datum_t key, apr_sdbm_datum_t value, int opt)
apr_sdbm_firstkey
apr_status_t apr_sdbm_firstkey(apr_sdbm_t *db, apr_sdbm_datum_t *key)
apr_sdbm_t
struct apr_sdbm_t apr_sdbm_t
Definition apr_sdbm.h:44
apr_sdbm_close
apr_status_t apr_sdbm_close(apr_sdbm_t *db)
apr_sdbm_datum_t
Definition apr_sdbm.h:49
apr_sdbm_datum_t::dptr
char * dptr
Definition apr_sdbm.h:51
apr_sdbm_datum_t::dsize
int dsize
Definition apr_sdbm.h:54