summaryrefslogtreecommitdiffhomepage
path: root/mixlib/xmix_device.c
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-05 23:38:41 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-05 23:38:41 +0000
commit317a54ec28fe13fa5ba850486dcb922d146e4be3 (patch)
tree7fabe6e57d054a2871eee385eb75c366c7cc6292 /mixlib/xmix_device.c
parent551ec2bb5fb690a9bfa7db1691b54946163473b6 (diff)
downloadmdk-317a54ec28fe13fa5ba850486dcb922d146e4be3.tar.gz
mdk-317a54ec28fe13fa5ba850486dcb922d146e4be3.tar.bz2
externally provided device files directory
Diffstat (limited to 'mixlib/xmix_device.c')
-rw-r--r--mixlib/xmix_device.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mixlib/xmix_device.c b/mixlib/xmix_device.c
index b0ec547..47b6397 100644
--- a/mixlib/xmix_device.c
+++ b/mixlib/xmix_device.c
@@ -24,6 +24,8 @@
#include "xmix_device.h"
+gchar *DEV_DIR_ = NULL;
+
const char *DEV_EXT_ = ".dev";
const char *DEF_NAMES_[] = {
@@ -58,14 +60,11 @@ const mix_fmode_t FMODES_[] = {
void
construct_device_ (mix_device_t *result, mix_device_type_t type)
{
- result->type = type;
- if (type != mix_dev_CONSOLE) {
- result->file = MIX_IOCHANNEL(mix_file_new_with_def_ext (DEF_NAMES_[type],
- FMODES_[type],
- DEV_EXT_));
- } else
- result->file = mix_io_new (stdout);
- result->vtable = DEF_DEV_VTABLE_;
+ gchar *name;
+ name = DEV_DIR_ ? g_strdup_printf ("%s/%s", DEV_DIR_, DEF_NAMES_[type])
+ : g_strdup (DEF_NAMES_[type]);
+ construct_device_with_name_ (result, type, name);
+ g_free (name);
}