Not logged in

Artifact e1559f3840f17d41c8e13847f378b24b1acdbc58:


/* zdb.h

   Copyright © 2013, 2016 Brandon Invergo <brandon@invergo.net>

   This file is part of zeptodb

   zeptodb is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   zeptodb is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with zeptodb.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef ZDB_H
#define ZDB_H
#define _GNU_SOURCE

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "error.h"
#include <errno.h>
#include <sys/stat.h>
#include <stdbool.h>
#include <gdbm.h>

#define ZDB_READER 1<<0
#define ZDB_WRITER 1<<1
#define ZDB_CREATOR 1<<2
#define ZDB_SYNC 1<<3
#define ZDB_NOLOCK 1<<4
#define ZDB_NOMMAP 1<<5

GDBM_FILE zdb_open (char *, int, size_t, size_t, size_t, bool);
int zdb_close (GDBM_FILE , bool);
int zdb_store (GDBM_FILE , char *, size_t, char *, size_t, bool);
void printrec (char *, char *, char *);
int zdb_fetch (GDBM_FILE , char *, size_t, char *);
int zdb_fetchall (GDBM_FILE , char *);
int zdb_remove (GDBM_FILE , char *, size_t, bool);
int zdb_reorganize (GDBM_FILE );
void zdb_print_info (GDBM_FILE db);

#endif