[pulseaudio-tickets] [PulseAudio] #493: gdbm makes building difficult on Solaris

PulseAudio trac-noreply at tango.0pointer.de
Thu Feb 26 02:39:35 PST 2009


#493: gdbm makes building difficult on Solaris
------------------------------------+---------------------------------------
  Reporter:  zanchey                |       Owner:  lennart
      Type:  enhancement            |      Status:  new    
  Priority:  normal                 |   Milestone:  0.9.15 
 Component:  module-device-restore  |    Severity:  normal 
Resolution:                         |    Keywords:         
------------------------------------+---------------------------------------

Comment(by lennart):

 I must admit that I expected that picking gdbm would eventually burn me.

 The requirements towards a db interface in PA are very soft: we don't need
 locking, we don't need particular NFS safety (there's always only exactly
 one process on exactly one machine accessing a file), we don't need CPU
 independance or portability, nor do we need any other special
 functionality.

 Here's my suggested solution. There should be a little abstraction
 src/pulsecore/database.h that abstracts over the database interface.
 Should be very very simple and should fix all API issues gdbm exposes:

  typedef struct pa_database pa_database;
  typedef struct pa_database_datum {
      void *data;
      size_t size;
  } pa_database_datum;

  pa_database* pa_database_open(const char *fname, pa_bool_t for_write,
 mode_t mode);
  void pa_database_close(pa_database *db);
  void pa_database_put(pa_database *db, const pa_database_datum *key, const
 pa_database_datum *data);
  int pa_database_get(pa_database *db, const pa_database_datum *key,
 pa_database_datum *data);
  int pa_database_remove(pa_database *db, const pa_database_datum *key);
  int pa_database_first(pa_database *db, pa_database_datum *key);
  int pa_database_next(pa_database *db, pa_database_datum *key);
  void pa_database_sync(pa_database *db);
  void pa_database_vacuum(pa_database *db);

 Then we could provide multiple implementations of this for different
 systems: database-gbdm.c, database-ndbm.c and so on.

 Setting the gdbm cache size is used in PA to cut down a bit of gdbm's
 memory waste. This issue can be ignore for an ndbm backend.

 Patches welcome of course ;-)

-- 
Ticket URL: <http://pulseaudio.org/ticket/493#comment:1>
PulseAudio <http://pulseaudio.org/>
The PulseAudio Sound Server


More information about the pulseaudio-bugs mailing list