summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-25 01:33:14 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-25 01:33:14 +0200
commitda2c352f04de5b9c4f071a0f0ad57cb2cdd51eff (patch)
tree944178d5a7726c4ffbcd34960f98394e7a4e281f
parent2fea8e406bdf975cff8a1b972170cdd3d6b7862a (diff)
export the driver_order as ca_driver_order
-rw-r--r--src/driver-order.c39
-rw-r--r--src/driver-order.h26
-rw-r--r--src/dso.c14
3 files changed, 67 insertions, 12 deletions
diff --git a/src/driver-order.c b/src/driver-order.c
new file mode 100644
index 0000000..d97c0e1
--- /dev/null
+++ b/src/driver-order.c
@@ -0,0 +1,39 @@
+/***
+ This file is part of libcanberra.
+
+ Copyright 2008 Lennart Poettering
+
+ libcanberra 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.
+
+ libcanberra 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 libcanberra. If not, If not, see
+ <http://www.gnu.org/licenses/>.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+
+#include "canberra.h"
+#include "driver-order.h"
+
+const char* const ca_driver_order[] = {
+#ifdef HAVE_PULSE
+ "pulse",
+#endif
+#ifdef HAVE_ALSA
+ "alsa",
+#endif
+ /* ... */
+ NULL
+};
diff --git a/src/driver-order.h b/src/driver-order.h
new file mode 100644
index 0000000..23e0783
--- /dev/null
+++ b/src/driver-order.h
@@ -0,0 +1,26 @@
+#ifndef foocanberradriverorderhfoo
+#define foocanberradriverorderhfoo
+
+/***
+ This file is part of libcanberra.
+
+ Copyright 2008 Lennart Poettering
+
+ libcanberra 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.
+
+ libcanberra 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 libcanberra. If not, If not, see
+ <http://www.gnu.org/licenses/>.
+***/
+
+extern const char* const ca_driver_order[];
+
+#endif
diff --git a/src/dso.c b/src/dso.c
index 02eb672..aacec71 100644
--- a/src/dso.c
+++ b/src/dso.c
@@ -29,6 +29,7 @@
#include "driver.h"
#include "common.h"
#include "malloc.h"
+#include "driver-order.h"
struct private_dso {
lt_dlhandle module;
@@ -45,17 +46,6 @@ struct private_dso {
#define PRIVATE_DSO(c) ((struct private_dso *) ((c)->private_dso))
-static const char* const driver_order[] = {
-#ifdef HAVE_PULSE
- "pulse",
-#endif
-#ifdef HAVE_ALSA
- "alsa",
-#endif
- /* ... */
- NULL
-};
-
static int ca_error_from_lt_error(int code) {
static const int table[] = {
@@ -214,7 +204,7 @@ int driver_open(ca_context *c) {
} else {
const char *const * e;
- for (e = driver_order; *e; e++) {
+ for (e = ca_driver_order; *e; e++) {
if ((ret = try_open(c, *e)) == CA_SUCCESS)
break;