pulseaudio  14.2
About: PulseAudio is a networked sound server (for POSIX OSes), a proxy for your sound applications.
  Fossies Dox: pulseaudio-14.2.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

database-tdb.c File Reference
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <tdb.h>
#include <pulse/xmalloc.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include "database.h"
Include dependency graph for database-tdb.c:

Go to the source code of this file.

Macros

#define MAKE_TDB_CONTEXT(x)   ((struct tdb_context*) (x))
 This file is part of PulseAudio. More...
 

Functions

static TDB_DATA * datum_to_tdb (TDB_DATA *to, const pa_datum *from)
 
static pa_datumdatum_from_tdb (pa_datum *to, const TDB_DATA *from)
 
void pa_datum_free (pa_datum *d)
 
static struct tdb_context * tdb_open_cloexec (const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode)
 
const char * pa_database_get_filename_suffix (void)
 
pa_databasepa_database_open_internal (const char *path, bool for_write)
 
void pa_database_close (pa_database *db)
 
pa_datumpa_database_get (pa_database *db, const pa_datum *key, pa_datum *data)
 
int pa_database_set (pa_database *db, const pa_datum *key, const pa_datum *data, bool overwrite)
 
int pa_database_unset (pa_database *db, const pa_datum *key)
 
int pa_database_clear (pa_database *db)
 
signed pa_database_size (pa_database *db)
 
pa_datumpa_database_first (pa_database *db, pa_datum *key, pa_datum *data)
 
pa_datumpa_database_next (pa_database *db, const pa_datum *key, pa_datum *next, pa_datum *data)
 
int pa_database_sync (pa_database *db)
 

Macro Definition Documentation

◆ MAKE_TDB_CONTEXT

#define MAKE_TDB_CONTEXT (   x)    ((struct tdb_context*) (x))

This file is part of PulseAudio.

Copyright 2009 Lennart Poettering

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

PulseAudio 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with PulseAudio; if not, see http://www.gnu.org/licenses/.

Definition at line 38 of file database-tdb.c.

Function Documentation

◆ datum_from_tdb()

static pa_datum* datum_from_tdb ( pa_datum to,
const TDB_DATA *  from 
)
inlinestatic

Definition at line 50 of file database-tdb.c.

References pa_datum::data, pa_assert, and pa_datum::size.

Referenced by pa_database_first(), pa_database_get(), and pa_database_next().

◆ datum_to_tdb()

static TDB_DATA* datum_to_tdb ( TDB_DATA *  to,
const pa_datum from 
)
inlinestatic

◆ pa_database_clear()

int pa_database_clear ( pa_database db)

Definition at line 163 of file database-tdb.c.

References MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_close()

void pa_database_close ( pa_database db)

Definition at line 121 of file database-tdb.c.

References MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_first()

pa_datum* pa_database_first ( pa_database db,
pa_datum key,
pa_datum data 
)

Definition at line 192 of file database-tdb.c.

References datum_from_tdb(), MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_get()

pa_datum* pa_database_get ( pa_database db,
const pa_datum key,
pa_datum data 
)

Definition at line 127 of file database-tdb.c.

References datum_from_tdb(), datum_to_tdb(), MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_get_filename_suffix()

const char* pa_database_get_filename_suffix ( void  )

Definition at line 100 of file database-tdb.c.

◆ pa_database_next()

pa_datum* pa_database_next ( pa_database db,
const pa_datum key,
pa_datum next,
pa_datum data 
)

Definition at line 219 of file database-tdb.c.

References datum_from_tdb(), datum_to_tdb(), MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_open_internal()

pa_database* pa_database_open_internal ( const char *  path,
bool  for_write 
)

Definition at line 104 of file database-tdb.c.

References pa_assert, pa_log_debug(), and tdb_open_cloexec().

◆ pa_database_set()

int pa_database_set ( pa_database db,
const pa_datum key,
const pa_datum data,
bool  overwrite 
)

Definition at line 141 of file database-tdb.c.

References datum_to_tdb(), MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_size()

signed pa_database_size ( pa_database db)

Definition at line 169 of file database-tdb.c.

References MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_database_sync()

int pa_database_sync ( pa_database db)

Definition at line 246 of file database-tdb.c.

References pa_assert.

◆ pa_database_unset()

int pa_database_unset ( pa_database db,
const pa_datum key 
)

Definition at line 154 of file database-tdb.c.

References datum_to_tdb(), MAKE_TDB_CONTEXT, and pa_assert.

◆ pa_datum_free()

void pa_datum_free ( pa_datum d)

Definition at line 60 of file database-tdb.c.

References pa_datum::data, pa_assert, and pa_zero.

◆ tdb_open_cloexec()

static struct tdb_context* tdb_open_cloexec ( const char *  name,
int  hash_size,
int  tdb_flags,
int  open_flags,
mode_t  mode 
)
static

Definition at line 67 of file database-tdb.c.

References mode, and pa_make_fd_cloexec().

Referenced by pa_database_open_internal().