Ticket #493: database.h
| File database.h, 1.6 KB (added by zanchey, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | /*** |
| 2 | This file is part of PulseAudio. |
| 3 | |
| 4 | Copyright 2009 Lennart Poettering |
| 5 | |
| 6 | PulseAudio is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU Lesser General Public License as |
| 8 | published by the Free Software Foundation; either version 2 of the |
| 9 | License, or (at your option) any later version. |
| 10 | |
| 11 | PulseAudio is distributed in the hope that it will be useful, but |
| 12 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU Lesser General Public |
| 17 | License along with PulseAudio; if not, write to the Free Software |
| 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 19 | USA. |
| 20 | ***/ |
| 21 | |
| 22 | #ifdef HAVE_CONFIG_H |
| 23 | #include <config.h> |
| 24 | #endif |
| 25 | |
| 26 | #include <string.h> |
| 27 | |
| 28 | #include <pulsecore/macro.h> |
| 29 | |
| 30 | typedef struct pa_database pa_database; |
| 31 | |
| 32 | typedef struct pa_database_datum { |
| 33 | void *data; |
| 34 | size_t size; |
| 35 | } pa_database_datum; |
| 36 | |
| 37 | pa_database* pa_database_open(const char *fname, pa_bool_t for_write, mode_t mode); |
| 38 | void pa_database_close(pa_database *db); |
| 39 | |
| 40 | void pa_database_put(pa_database *db, const pa_database_datum *key, const pa_database_datum *data); |
| 41 | int pa_database_get(pa_database *db, const pa_database_datum *key, pa_database_datum *data); |
| 42 | int pa_database_remove(pa_database *db, const pa_database_datum *key); |
| 43 | int pa_database_first(pa_database *db, pa_database_datum *key); |
| 44 | int pa_database_next(pa_database *db, pa_database_datum *key); |
| 45 | |
| 46 | void pa_database_sync(pa_database *db); |
| 47 | void pa_database_vacuum(pa_database *db); |
