| 1 |
/**************************************************************************/ |
| 2 |
/* */ |
| 3 |
/* This file is part of Frama-C. */ |
| 4 |
/* */ |
| 5 |
/* Copyright (C) 2007-2022 */ |
| 6 |
/* CEA (Commissariat à l'énergie atomique et aux énergies */ |
| 7 |
/* alternatives) */ |
| 8 |
/* */ |
| 9 |
/* you can redistribute it and/or modify it under the terms of the GNU */ |
| 10 |
/* Lesser General Public License as published by the Free Software */ |
| 11 |
/* Foundation, version 2.1. */ |
| 12 |
/* */ |
| 13 |
/* It is distributed in the hope that it will be useful, */ |
| 14 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 15 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 16 |
/* GNU Lesser General Public License for more details. */ |
| 17 |
/* */ |
| 18 |
/* See the GNU Lesser General Public License version 2.1 */ |
| 19 |
/* for more details (enclosed in the file licenses/LGPLv2.1). */ |
| 20 |
/* */ |
| 21 |
/**************************************************************************/ |
| 22 |
|
| 23 |
#ifndef __FC_NDBM |
| 24 |
#define __FC_NDBM |
| 25 |
#include "features.h" |
| 26 |
__PUSH_FC_STDLIB |
| 27 |
#include "__fc_define_mode_t.h" |
| 28 |
#include "__fc_define_size_t.h" |
| 29 |
|
| 30 |
__BEGIN_DECLS |
| 31 |
|
| 32 |
typedef struct __fc_datum { |
| 33 |
void *dptr; |
| 34 |
size_t dsize; |
| 35 |
} datum; |
| 36 |
|
| 37 |
typedef int DBM; |
| 38 |
|
| 39 |
#define DBM_INSERT 0 |
| 40 |
#define DBM_REPLACE 1 |
| 41 |
|
| 42 |
extern int dbm_clearerr(DBM *db); |
| 43 |
|
| 44 |
extern void dbm_close(DBM *db); |
| 45 |
|
| 46 |
extern int dbm_delete(DBM *db, datum key); |
| 47 |
|
| 48 |
extern int dbm_error(DBM *db); |
| 49 |
|
| 50 |
extern datum dbm_fetch(DBM *db, datum key); |
| 51 |
|
| 52 |
extern datum dbm_firstkey(DBM *db); |
| 53 |
|
| 54 |
extern datum dbm_nextkey(DBM *db); |
| 55 |
|
| 56 |
extern DBM *dbm_open(const char *file, int open_flags, mode_t file_mode); |
| 57 |
|
| 58 |
extern int dbm_store(DBM *db, datum key, datum content, int store_mode); |
| 59 |
|
| 60 |
__END_DECLS |
| 61 |
|
| 62 |
__POP_FC_STDLIB |
| 63 |
#endif |