[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.11-19-gd36c5c9
Lennart Poettering
gitmailer-noreply at 0pointer.de
Thu Jul 31 16:02:49 PDT 2008
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 80428d80b03b3c26bd25169fa4083e16cf6bfafc (commit)
- Log -----------------------------------------------------------------
d36c5c9... rename props.[ch] to shared.[ch]
edc56a7... rename pa_property_xxx to pa_shared_xxx to avoid confusion with property lists
a5a7b79... fix build without ALSA
d757dc7... Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio
297267b... Merge branches 'master' and 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio
-----------------------------------------------------------------------
Summary of changes:
src/Makefile.am | 4 +-
src/modules/dbus-util.c | 8 ++--
src/modules/module-hal-detect.c | 2 +
src/modules/module-x11-publish.c | 4 +-
src/pulsecore/authkey-prop.c | 16 +++----
src/pulsecore/cli-command.c | 10 ++--
src/pulsecore/core.c | 6 +-
src/pulsecore/core.h | 2 +-
src/pulsecore/protocol-native.c | 12 +++---
src/pulsecore/{props.c => shared.c} | 76 +++++++++++++++++-----------------
src/pulsecore/{props.h => shared.h} | 41 ++++++++++---------
src/pulsecore/x11wrap.c | 8 ++--
12 files changed, 96 insertions(+), 93 deletions(-)
rename src/pulsecore/{props.c => shared.c} (51%)
rename src/pulsecore/{props.h => shared.h} (51%)
-----------------------------------------------------------------------
commit d757dc7ff47a47d760cc5959579b010fb5a8b214
Merge: 297267b... 80428d8...
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Jul 31 23:34:09 2008 +0300
Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio
commit a5a7b79938c14d3ca89da52e3d25d276bbbafc7b
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Aug 1 01:54:53 2008 +0300
fix build without ALSA
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index b2f97a1..bfabd91 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -789,7 +789,9 @@ int pa__init(pa_module*m) {
u->connection = conn;
u->devices = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
u->capability = api;
+#ifdef HAVE_ALSA
u->use_tsched = use_tsched;
+#endif
m->userdata = u;
#ifdef HAVE_ALSA
commit edc56a7f7a993aa60b979a4093e39f66e7f7a8c8
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Aug 1 01:56:09 2008 +0300
rename pa_property_xxx to pa_shared_xxx to avoid confusion with property lists
diff --git a/src/modules/dbus-util.c b/src/modules/dbus-util.c
index 905be13..e18b6ab 100644
--- a/src/modules/dbus-util.c
+++ b/src/modules/dbus-util.c
@@ -254,7 +254,7 @@ static pa_dbus_connection* pa_dbus_connection_new(pa_core* c, DBusConnection *co
pconn->connection = conn;
pconn->dispatch_event = c->mainloop->defer_new(c->mainloop, dispatch_cb, conn);
- pa_property_set(c, name, pconn);
+ pa_shared_set(c, name, pconn);
return pconn;
}
@@ -282,7 +282,7 @@ void pa_dbus_connection_unref(pa_dbus_connection *c) {
}
/* already disconnected, just free */
- pa_property_remove(c->core, c->property_name);
+ pa_shared_remove(c->core, c->property_name);
c->core->mainloop->defer_free(c->dispatch_event);
dbus_connection_unref(c->connection);
pa_xfree(c);
@@ -309,7 +309,7 @@ pa_dbus_connection* pa_dbus_bus_get(pa_core *c, DBusBusType type, DBusError *err
pa_assert(type == DBUS_BUS_SYSTEM || type == DBUS_BUS_SESSION || type == DBUS_BUS_STARTER);
- if ((pconn = pa_property_get(c, prop_name[type])))
+ if ((pconn = pa_shared_get(c, prop_name[type])))
return pa_dbus_connection_ref(pconn);
if (!(conn = dbus_bus_get_private(type, error)))
diff --git a/src/modules/module-x11-publish.c b/src/modules/module-x11-publish.c
index 705d90f..d0ce344 100644
--- a/src/modules/module-x11-publish.c
+++ b/src/modules/module-x11-publish.c
@@ -152,7 +152,7 @@ int pa__init(pa_module*m) {
if (!(u->x11_wrapper = pa_x11_wrapper_get(m->core, pa_modargs_get_value(ma, "display", NULL))))
goto fail;
- if (!(l = pa_property_get(m->core, PA_NATIVE_SERVER_PROPERTY_NAME)))
+ if (!(l = pa_shared_get(m->core, PA_NATIVE_SERVER_PROPERTY_NAME)))
goto fail;
l = pa_strlist_reverse(l);
diff --git a/src/pulsecore/authkey-prop.c b/src/pulsecore/authkey-prop.c
index a953bf7..9e147ec 100644
--- a/src/pulsecore/authkey-prop.c
+++ b/src/pulsecore/authkey-prop.c
@@ -47,7 +47,7 @@ int pa_authkey_prop_get(pa_core *c, const char *name, void *data, size_t len) {
pa_assert(data);
pa_assert(len > 0);
- if (!(a = pa_property_get(c, name)))
+ if (!(a = pa_shared_get(c, name)))
return -1;
pa_assert(a->length == len);
@@ -62,7 +62,7 @@ int pa_authkey_prop_put(pa_core *c, const char *name, const void *data, size_t l
pa_assert(c);
pa_assert(name);
- if (pa_property_get(c, name))
+ if (pa_shared_get(c, name))
return -1;
a = pa_xmalloc(PA_ALIGN(sizeof(struct authkey_data)) + len);
@@ -70,7 +70,7 @@ int pa_authkey_prop_put(pa_core *c, const char *name, const void *data, size_t l
a->length = len;
memcpy((uint8_t*) a + PA_ALIGN(sizeof(struct authkey_data)), data, len);
- pa_property_set(c, name, a);
+ pa_shared_set(c, name, a);
return 0;
}
@@ -81,7 +81,7 @@ void pa_authkey_prop_ref(pa_core *c, const char *name) {
pa_assert(c);
pa_assert(name);
- a = pa_property_get(c, name);
+ a = pa_shared_get(c, name);
pa_assert(a);
pa_assert(PA_REFCNT_VALUE(a) >= 1);
PA_REFCNT_INC(a);
@@ -93,14 +93,12 @@ void pa_authkey_prop_unref(pa_core *c, const char *name) {
pa_assert(c);
pa_assert(name);
- a = pa_property_get(c, name);
+ a = pa_shared_get(c, name);
pa_assert(a);
pa_assert(PA_REFCNT_VALUE(a) >= 1);
if (PA_REFCNT_DEC(a) <= 0) {
- pa_property_remove(c, name);
+ pa_shared_remove(c, name);
pa_xfree(a);
}
}
-
-
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index cbdb602..43ec104 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -110,7 +110,7 @@ static int pa_cli_command_autoload_list(pa_core *c, pa_tokenizer *t, pa_strbuf *
static int pa_cli_command_autoload_add(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_autoload_remove(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
-static int pa_cli_command_list_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
+static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_move_sink_input(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
@@ -160,7 +160,7 @@ static const struct command commands[] = {
{ "remove-autoload-sink", pa_cli_command_autoload_remove, NULL /*"Remove autoload entry for a sink (args: name)"*/, 2},
{ "remove-autoload-source", pa_cli_command_autoload_remove, NULL /*"Remove autoload entry for a source (args: name)"*/, 2},
{ "dump", pa_cli_command_dump, "Dump daemon configuration", 1},
- { "list-props", pa_cli_command_list_props, NULL, 1},
+ { "shared", pa_cli_command_list_shared_props, NULL, 1},
{ "move-sink-input", pa_cli_command_move_sink_input, "Move sink input to another sink (args: index, sink)", 3},
{ "move-source-output", pa_cli_command_move_source_output, "Move source output to another source (args: index, source)", 3},
{ "vacuum", pa_cli_command_vacuum, NULL, 1},
@@ -996,13 +996,13 @@ static int pa_cli_command_autoload_list(pa_core *c, pa_tokenizer *t, pa_strbuf *
return 0;
}
-static int pa_cli_command_list_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
+static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
pa_core_assert_ref(c);
pa_assert(t);
pa_assert(buf);
pa_assert(fail);
- pa_property_dump(c, buf);
+ pa_shared_dump(c, buf);
return 0;
}
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index b2638b1..9aabd37 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.c
@@ -141,7 +141,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, int shared) {
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
pa_hook_init(&c->hooks[j], c);
- pa_property_init(c);
+ pa_shared_init(c);
pa_random(&c->cookie, sizeof(c->cookie));
@@ -189,7 +189,7 @@ static void core_free(pa_object *o) {
pa_silence_cache_done(&c->silence_cache);
pa_mempool_free(c->mempool);
- pa_property_cleanup(c);
+ pa_shared_cleanup(c);
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
pa_hook_free(&c->hooks[j]);
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 14a2c78..e11655e 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -94,7 +94,7 @@ struct pa_core {
pa_idxset *clients, *sinks, *sources, *sink_inputs, *source_outputs, *modules, *scache, *autoload_idxset;
/* Some hashmaps for all sorts of entities */
- pa_hashmap *namereg, *autoload_hashmap, *properties;
+ pa_hashmap *namereg, *autoload_hashmap, *shared;
/* The name of the default sink/source */
char *default_source_name, *default_sink_name;
diff --git a/src/pulsecore/props.c b/src/pulsecore/props.c
index 23d432e..1bfb297 100644
--- a/src/pulsecore/props.c
+++ b/src/pulsecore/props.c
@@ -29,110 +29,110 @@
#include "props.h"
-typedef struct pa_property {
- char *name; /* Points to memory allocated by the property subsystem */
+typedef struct pa_shared {
+ char *name; /* Points to memory allocated by the shared property system */
void *data; /* Points to memory maintained by the caller */
-} pa_property;
+} pa_shared;
-/* Allocate a new property object */
-static pa_property* property_new(const char *name, void *data) {
- pa_property* p;
+/* Allocate a new shared property object */
+static pa_shared* shared_new(const char *name, void *data) {
+ pa_shared* p;
pa_assert(name);
pa_assert(data);
- p = pa_xnew(pa_property, 1);
+ p = pa_xnew(pa_shared, 1);
p->name = pa_xstrdup(name);
p->data = data;
return p;
}
-/* Free a property object */
-static void property_free(pa_property *p) {
+/* Free a shared property object */
+static void shared_free(pa_shared *p) {
pa_assert(p);
pa_xfree(p->name);
pa_xfree(p);
}
-void* pa_property_get(pa_core *c, const char *name) {
- pa_property *p;
+void* pa_shared_get(pa_core *c, const char *name) {
+ pa_shared *p;
pa_assert(c);
pa_assert(name);
- pa_assert(c->properties);
+ pa_assert(c->shared);
- if (!(p = pa_hashmap_get(c->properties, name)))
+ if (!(p = pa_hashmap_get(c->shared, name)))
return NULL;
return p->data;
}
-int pa_property_set(pa_core *c, const char *name, void *data) {
- pa_property *p;
+int pa_shared_set(pa_core *c, const char *name, void *data) {
+ pa_shared *p;
pa_assert(c);
pa_assert(name);
pa_assert(data);
- pa_assert(c->properties);
+ pa_assert(c->shared);
- if (pa_hashmap_get(c->properties, name))
+ if (pa_hashmap_get(c->shared, name))
return -1;
- p = property_new(name, data);
- pa_hashmap_put(c->properties, p->name, p);
+ p = shared_new(name, data);
+ pa_hashmap_put(c->shared, p->name, p);
return 0;
}
-int pa_property_remove(pa_core *c, const char *name) {
- pa_property *p;
+int pa_shared_remove(pa_core *c, const char *name) {
+ pa_shared *p;
pa_assert(c);
pa_assert(name);
- pa_assert(c->properties);
+ pa_assert(c->shared);
- if (!(p = pa_hashmap_remove(c->properties, name)))
+ if (!(p = pa_hashmap_remove(c->shared, name)))
return -1;
- property_free(p);
+ shared_free(p);
return 0;
}
-void pa_property_init(pa_core *c) {
+void pa_shared_init(pa_core *c) {
pa_assert(c);
- c->properties = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
+ c->shared = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
}
-void pa_property_cleanup(pa_core *c) {
+void pa_shared_cleanup(pa_core *c) {
pa_assert(c);
- if (!c->properties)
+ if (!c->shared)
return;
- pa_assert(!pa_hashmap_size(c->properties));
+ pa_assert(pa_hashmap_isempty(c->shared));
- pa_hashmap_free(c->properties, NULL, NULL);
- c->properties = NULL;
+ pa_hashmap_free(c->shared, NULL, NULL);
+ c->shared = NULL;
}
-void pa_property_dump(pa_core *c, pa_strbuf *s) {
+void pa_shared_dump(pa_core *c, pa_strbuf *s) {
void *state = NULL;
- pa_property *p;
+ pa_shared *p;
pa_assert(c);
pa_assert(s);
- while ((p = pa_hashmap_iterate(c->properties, &state, NULL)))
+ while ((p = pa_hashmap_iterate(c->shared, &state, NULL)))
pa_strbuf_printf(s, "[%s] -> [%p]\n", p->name, p->data);
}
-int pa_property_replace(pa_core *c, const char *name, void *data) {
+int pa_shared_replace(pa_core *c, const char *name, void *data) {
pa_assert(c);
pa_assert(name);
- pa_property_remove(c, name);
- return pa_property_set(c, name, data);
+ pa_shared_remove(c, name);
+ return pa_shared_set(c, name, data);
}
diff --git a/src/pulsecore/props.h b/src/pulsecore/props.h
index 95db229..dd3f94e 100644
--- a/src/pulsecore/props.h
+++ b/src/pulsecore/props.h
@@ -1,5 +1,5 @@
-#ifndef foopropshfoo
-#define foopropshfoo
+#ifndef foosharedshfoo
+#define foosharedshfoo
/***
This file is part of PulseAudio.
@@ -25,34 +25,37 @@
#include <pulsecore/core.h>
#include <pulsecore/strbuf.h>
-/* The property subsystem is to be used to share data between
+/* The shared property subsystem is to be used to share data between
* modules. Consider them to be kind of "global" variables for a
* core. Why not use the hashmap functions directly? The hashmap
* functions copy neither the key nor value, while this property
* system copies the key. Users of this system have to think about
* reference counting themselves. */
-/* Return a pointer to the value of the specified property. */
-void* pa_property_get(pa_core *c, const char *name);
+/* Note: please don't confuse this with the proplist framework in
+ * pulse/proplist.[ch]! */
-/* Set the property 'name' to 'data'. This function fails in case a
- * property by this name already exists. The property data is not
- * copied or reference counted. This is the caller's job. */
-int pa_property_set(pa_core *c, const char *name, void *data);
+/* Return a pointer to the value of the specified shared property. */
+void* pa_shared_get(pa_core *c, const char *name);
-/* Remove the specified property. Return non-zero on failure */
-int pa_property_remove(pa_core *c, const char *name);
+/* Set the shared property 'name' to 'data'. This function fails in
+ * case a property by this name already exists. The property data is
+ * not copied or reference counted. This is the caller's job. */
+int pa_shared_set(pa_core *c, const char *name, void *data);
-/* A combination of pa_property_remove() and pa_property_set() */
-int pa_property_replace(pa_core *c, const char *name, void *data);
+/* Remove the specified shared property. Return non-zero on failure */
+int pa_shared_remove(pa_core *c, const char *name);
-/* Free all memory used by the property system */
-void pa_property_cleanup(pa_core *c);
+/* A combination of pa_shared_remove() and pa_shared_set() */
+int pa_shared_replace(pa_core *c, const char *name, void *data);
-/* Initialize the properties subsystem */
-void pa_property_init(pa_core *c);
+/* Free all memory used by the shared property system */
+void pa_shared_cleanup(pa_core *c);
-/* Dump the current set of properties */
-void pa_property_dump(pa_core *c, pa_strbuf *s);
+/* Initialize the shared property system */
+void pa_shared_init(pa_core *c);
+
+/* Dump the current set of shared properties */
+void pa_shared_dump(pa_core *c, pa_strbuf *s);
#endif
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index e130359..f279b6a 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -4134,9 +4134,9 @@ pa_protocol_native* pa_protocol_native_new(pa_core *core, pa_socket_server *serv
if (pa_socket_server_get_address(p->server, t, sizeof(t))) {
pa_strlist *l;
- l = pa_property_get(core, PA_NATIVE_SERVER_PROPERTY_NAME);
+ l = pa_shared_get(core, PA_NATIVE_SERVER_PROPERTY_NAME);
l = pa_strlist_prepend(l, t);
- pa_property_replace(core, PA_NATIVE_SERVER_PROPERTY_NAME, l);
+ pa_shared_replace(core, PA_NATIVE_SERVER_PROPERTY_NAME, l);
}
return p;
@@ -4155,13 +4155,13 @@ void pa_protocol_native_free(pa_protocol_native *p) {
if (pa_socket_server_get_address(p->server, t, sizeof(t))) {
pa_strlist *l;
- l = pa_property_get(p->core, PA_NATIVE_SERVER_PROPERTY_NAME);
+ l = pa_shared_get(p->core, PA_NATIVE_SERVER_PROPERTY_NAME);
l = pa_strlist_remove(l, t);
if (l)
- pa_property_replace(p->core, PA_NATIVE_SERVER_PROPERTY_NAME, l);
+ pa_shared_replace(p->core, PA_NATIVE_SERVER_PROPERTY_NAME, l);
else
- pa_property_remove(p->core, PA_NATIVE_SERVER_PROPERTY_NAME);
+ pa_shared_remove(p->core, PA_NATIVE_SERVER_PROPERTY_NAME);
}
pa_socket_server_unref(p->server);
diff --git a/src/pulsecore/x11wrap.c b/src/pulsecore/x11wrap.c
index 00b6a15..9186cf7 100644
--- a/src/pulsecore/x11wrap.c
+++ b/src/pulsecore/x11wrap.c
@@ -192,7 +192,7 @@ static pa_x11_wrapper* x11_wrapper_new(pa_core *c, const char *name, const char
XAddConnectionWatch(d, x11_watch, (XPointer) w);
- pa_assert_se(pa_property_set(c, w->property_name, w) >= 0);
+ pa_assert_se(pa_shared_set(c, w->property_name, w) >= 0);
return w;
}
@@ -200,7 +200,7 @@ static pa_x11_wrapper* x11_wrapper_new(pa_core *c, const char *name, const char
static void x11_wrapper_free(pa_x11_wrapper*w) {
pa_assert(w);
- pa_assert_se(pa_property_remove(w->core, w->property_name) >= 0);
+ pa_assert_se(pa_shared_remove(w->core, w->property_name) >= 0);
pa_assert(!w->clients);
@@ -224,7 +224,7 @@ pa_x11_wrapper* pa_x11_wrapper_get(pa_core *c, const char *name) {
pa_core_assert_ref(c);
pa_snprintf(t, sizeof(t), "x11-wrapper%s%s", name ? "-" : "", name ? name : "");
- if ((w = pa_property_get(c, t)))
+ if ((w = pa_shared_get(c, t)))
return pa_x11_wrapper_ref(w);
return x11_wrapper_new(c, name, t);
commit d36c5c97e53ac8865971bdd34ea27bf11bde49e1
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Aug 1 02:10:54 2008 +0300
rename props.[ch] to shared.[ch]
diff --git a/src/Makefile.am b/src/Makefile.am
index 6370719..268409b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -686,7 +686,7 @@ noinst_HEADERS = \
pulsecore/pid.h \
pulsecore/play-memchunk.h \
pulsecore/play-memblockq.h \
- pulsecore/props.h \
+ pulsecore/shared.h \
pulsecore/queue.h \
pulsecore/random.h \
pulsecore/resampler.h \
@@ -758,7 +758,7 @@ libpulsecore_la_SOURCES += \
pulsecore/play-memchunk.c pulsecore/play-memchunk.h \
pulsecore/play-memblockq.c pulsecore/play-memblockq.h \
pulsecore/poll.c pulsecore/poll.h \
- pulsecore/props.c pulsecore/props.h \
+ pulsecore/shared.c pulsecore/shared.h \
pulsecore/queue.c pulsecore/queue.h \
pulsecore/random.c pulsecore/random.h \
pulsecore/resampler.c pulsecore/resampler.h \
diff --git a/src/modules/dbus-util.c b/src/modules/dbus-util.c
index e18b6ab..8e0066b 100644
--- a/src/modules/dbus-util.c
+++ b/src/modules/dbus-util.c
@@ -27,7 +27,7 @@
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
#include <pulsecore/log.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include "dbus-util.h"
diff --git a/src/modules/module-x11-publish.c b/src/modules/module-x11-publish.c
index d0ce344..4ef4873 100644
--- a/src/modules/module-x11-publish.c
+++ b/src/modules/module-x11-publish.c
@@ -47,7 +47,7 @@
#include <pulsecore/authkey.h>
#include <pulsecore/x11prop.h>
#include <pulsecore/strlist.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include "module-x11-publish-symdef.h"
diff --git a/src/pulsecore/authkey-prop.c b/src/pulsecore/authkey-prop.c
index 9e147ec..d52bdcf 100644
--- a/src/pulsecore/authkey-prop.c
+++ b/src/pulsecore/authkey-prop.c
@@ -27,7 +27,7 @@
#include <pulse/xmalloc.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include <pulsecore/macro.h>
#include <pulsecore/log.h>
#include <pulsecore/refcnt.h>
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 43ec104..0bd4070 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -49,7 +49,7 @@
#include <pulsecore/play-memchunk.h>
#include <pulsecore/autoload.h>
#include <pulsecore/sound-file-stream.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include <pulsecore/core-util.h>
#include <pulsecore/core-error.h>
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index 9aabd37..fd836fb 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.c
@@ -39,7 +39,7 @@
#include <pulsecore/core-scache.h>
#include <pulsecore/autoload.h>
#include <pulsecore/core-subscribe.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include <pulsecore/random.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
diff --git a/src/pulsecore/props.c b/src/pulsecore/props.c
deleted file mode 100644
index 1bfb297..0000000
--- a/src/pulsecore/props.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/***
- This file is part of PulseAudio.
-
- Copyright 2004-2006 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 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
- General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PulseAudio; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA.
-***/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pulse/xmalloc.h>
-#include <pulsecore/log.h>
-#include <pulsecore/macro.h>
-
-#include "props.h"
-
-typedef struct pa_shared {
- char *name; /* Points to memory allocated by the shared property system */
- void *data; /* Points to memory maintained by the caller */
-} pa_shared;
-
-/* Allocate a new shared property object */
-static pa_shared* shared_new(const char *name, void *data) {
- pa_shared* p;
-
- pa_assert(name);
- pa_assert(data);
-
- p = pa_xnew(pa_shared, 1);
- p->name = pa_xstrdup(name);
- p->data = data;
-
- return p;
-}
-
-/* Free a shared property object */
-static void shared_free(pa_shared *p) {
- pa_assert(p);
-
- pa_xfree(p->name);
- pa_xfree(p);
-}
-
-void* pa_shared_get(pa_core *c, const char *name) {
- pa_shared *p;
-
- pa_assert(c);
- pa_assert(name);
- pa_assert(c->shared);
-
- if (!(p = pa_hashmap_get(c->shared, name)))
- return NULL;
-
- return p->data;
-}
-
-int pa_shared_set(pa_core *c, const char *name, void *data) {
- pa_shared *p;
-
- pa_assert(c);
- pa_assert(name);
- pa_assert(data);
- pa_assert(c->shared);
-
- if (pa_hashmap_get(c->shared, name))
- return -1;
-
- p = shared_new(name, data);
- pa_hashmap_put(c->shared, p->name, p);
- return 0;
-}
-
-int pa_shared_remove(pa_core *c, const char *name) {
- pa_shared *p;
-
- pa_assert(c);
- pa_assert(name);
- pa_assert(c->shared);
-
- if (!(p = pa_hashmap_remove(c->shared, name)))
- return -1;
-
- shared_free(p);
- return 0;
-}
-
-void pa_shared_init(pa_core *c) {
- pa_assert(c);
-
- c->shared = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
-}
-
-void pa_shared_cleanup(pa_core *c) {
- pa_assert(c);
-
- if (!c->shared)
- return;
-
- pa_assert(pa_hashmap_isempty(c->shared));
-
- pa_hashmap_free(c->shared, NULL, NULL);
- c->shared = NULL;
-
-}
-
-void pa_shared_dump(pa_core *c, pa_strbuf *s) {
- void *state = NULL;
- pa_shared *p;
-
- pa_assert(c);
- pa_assert(s);
-
- while ((p = pa_hashmap_iterate(c->shared, &state, NULL)))
- pa_strbuf_printf(s, "[%s] -> [%p]\n", p->name, p->data);
-}
-
-int pa_shared_replace(pa_core *c, const char *name, void *data) {
- pa_assert(c);
- pa_assert(name);
-
- pa_shared_remove(c, name);
- return pa_shared_set(c, name, data);
-}
diff --git a/src/pulsecore/props.h b/src/pulsecore/props.h
deleted file mode 100644
index dd3f94e..0000000
--- a/src/pulsecore/props.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef foosharedshfoo
-#define foosharedshfoo
-
-/***
- This file is part of PulseAudio.
-
- Copyright 2004-2006 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 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
- General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with PulseAudio; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- USA.
-***/
-
-#include <pulsecore/core.h>
-#include <pulsecore/strbuf.h>
-
-/* The shared property subsystem is to be used to share data between
- * modules. Consider them to be kind of "global" variables for a
- * core. Why not use the hashmap functions directly? The hashmap
- * functions copy neither the key nor value, while this property
- * system copies the key. Users of this system have to think about
- * reference counting themselves. */
-
-/* Note: please don't confuse this with the proplist framework in
- * pulse/proplist.[ch]! */
-
-/* Return a pointer to the value of the specified shared property. */
-void* pa_shared_get(pa_core *c, const char *name);
-
-/* Set the shared property 'name' to 'data'. This function fails in
- * case a property by this name already exists. The property data is
- * not copied or reference counted. This is the caller's job. */
-int pa_shared_set(pa_core *c, const char *name, void *data);
-
-/* Remove the specified shared property. Return non-zero on failure */
-int pa_shared_remove(pa_core *c, const char *name);
-
-/* A combination of pa_shared_remove() and pa_shared_set() */
-int pa_shared_replace(pa_core *c, const char *name, void *data);
-
-/* Free all memory used by the shared property system */
-void pa_shared_cleanup(pa_core *c);
-
-/* Initialize the shared property system */
-void pa_shared_init(pa_core *c);
-
-/* Dump the current set of shared properties */
-void pa_shared_dump(pa_core *c, pa_strbuf *s);
-
-#endif
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index f279b6a..853f244 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -52,7 +52,7 @@
#include <pulsecore/autoload.h>
#include <pulsecore/authkey-prop.h>
#include <pulsecore/strlist.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/llist.h>
#include <pulsecore/creds.h>
diff --git a/src/pulsecore/shared.c b/src/pulsecore/shared.c
new file mode 100644
index 0000000..77d919d
--- /dev/null
+++ b/src/pulsecore/shared.c
@@ -0,0 +1,138 @@
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 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 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <pulse/xmalloc.h>
+#include <pulsecore/log.h>
+#include <pulsecore/macro.h>
+
+#include "shared.h"
+
+typedef struct pa_shared {
+ char *name; /* Points to memory allocated by the shared property system */
+ void *data; /* Points to memory maintained by the caller */
+} pa_shared;
+
+/* Allocate a new shared property object */
+static pa_shared* shared_new(const char *name, void *data) {
+ pa_shared* p;
+
+ pa_assert(name);
+ pa_assert(data);
+
+ p = pa_xnew(pa_shared, 1);
+ p->name = pa_xstrdup(name);
+ p->data = data;
+
+ return p;
+}
+
+/* Free a shared property object */
+static void shared_free(pa_shared *p) {
+ pa_assert(p);
+
+ pa_xfree(p->name);
+ pa_xfree(p);
+}
+
+void* pa_shared_get(pa_core *c, const char *name) {
+ pa_shared *p;
+
+ pa_assert(c);
+ pa_assert(name);
+ pa_assert(c->shared);
+
+ if (!(p = pa_hashmap_get(c->shared, name)))
+ return NULL;
+
+ return p->data;
+}
+
+int pa_shared_set(pa_core *c, const char *name, void *data) {
+ pa_shared *p;
+
+ pa_assert(c);
+ pa_assert(name);
+ pa_assert(data);
+ pa_assert(c->shared);
+
+ if (pa_hashmap_get(c->shared, name))
+ return -1;
+
+ p = shared_new(name, data);
+ pa_hashmap_put(c->shared, p->name, p);
+ return 0;
+}
+
+int pa_shared_remove(pa_core *c, const char *name) {
+ pa_shared *p;
+
+ pa_assert(c);
+ pa_assert(name);
+ pa_assert(c->shared);
+
+ if (!(p = pa_hashmap_remove(c->shared, name)))
+ return -1;
+
+ shared_free(p);
+ return 0;
+}
+
+void pa_shared_init(pa_core *c) {
+ pa_assert(c);
+
+ c->shared = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
+}
+
+void pa_shared_cleanup(pa_core *c) {
+ pa_assert(c);
+
+ if (!c->shared)
+ return;
+
+ pa_assert(pa_hashmap_isempty(c->shared));
+
+ pa_hashmap_free(c->shared, NULL, NULL);
+ c->shared = NULL;
+
+}
+
+void pa_shared_dump(pa_core *c, pa_strbuf *s) {
+ void *state = NULL;
+ pa_shared *p;
+
+ pa_assert(c);
+ pa_assert(s);
+
+ while ((p = pa_hashmap_iterate(c->shared, &state, NULL)))
+ pa_strbuf_printf(s, "[%s] -> [%p]\n", p->name, p->data);
+}
+
+int pa_shared_replace(pa_core *c, const char *name, void *data) {
+ pa_assert(c);
+ pa_assert(name);
+
+ pa_shared_remove(c, name);
+ return pa_shared_set(c, name, data);
+}
diff --git a/src/pulsecore/shared.h b/src/pulsecore/shared.h
new file mode 100644
index 0000000..dd3f94e
--- /dev/null
+++ b/src/pulsecore/shared.h
@@ -0,0 +1,61 @@
+#ifndef foosharedshfoo
+#define foosharedshfoo
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2004-2006 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 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <pulsecore/core.h>
+#include <pulsecore/strbuf.h>
+
+/* The shared property subsystem is to be used to share data between
+ * modules. Consider them to be kind of "global" variables for a
+ * core. Why not use the hashmap functions directly? The hashmap
+ * functions copy neither the key nor value, while this property
+ * system copies the key. Users of this system have to think about
+ * reference counting themselves. */
+
+/* Note: please don't confuse this with the proplist framework in
+ * pulse/proplist.[ch]! */
+
+/* Return a pointer to the value of the specified shared property. */
+void* pa_shared_get(pa_core *c, const char *name);
+
+/* Set the shared property 'name' to 'data'. This function fails in
+ * case a property by this name already exists. The property data is
+ * not copied or reference counted. This is the caller's job. */
+int pa_shared_set(pa_core *c, const char *name, void *data);
+
+/* Remove the specified shared property. Return non-zero on failure */
+int pa_shared_remove(pa_core *c, const char *name);
+
+/* A combination of pa_shared_remove() and pa_shared_set() */
+int pa_shared_replace(pa_core *c, const char *name, void *data);
+
+/* Free all memory used by the shared property system */
+void pa_shared_cleanup(pa_core *c);
+
+/* Initialize the shared property system */
+void pa_shared_init(pa_core *c);
+
+/* Dump the current set of shared properties */
+void pa_shared_dump(pa_core *c, pa_strbuf *s);
+
+#endif
diff --git a/src/pulsecore/x11wrap.c b/src/pulsecore/x11wrap.c
index 9186cf7..1519aa8 100644
--- a/src/pulsecore/x11wrap.c
+++ b/src/pulsecore/x11wrap.c
@@ -29,7 +29,7 @@
#include <pulsecore/llist.h>
#include <pulsecore/log.h>
-#include <pulsecore/props.h>
+#include <pulsecore/shared.h>
#include <pulsecore/core-util.h>
#include <pulsecore/macro.h>
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list