From 070635cb6e0b42c7a485189d1a58db04482de0f8 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 6 May 2001 21:38:13 +0000 Subject: support for gtk binary devices added --- mixlib/xmix_device.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'mixlib/xmix_device.c') diff --git a/mixlib/xmix_device.c b/mixlib/xmix_device.c index 4754015..c93153a 100644 --- a/mixlib/xmix_device.c +++ b/mixlib/xmix_device.c @@ -1,7 +1,7 @@ /* -*-c-*- -------------- xmix_device.c : * Implementation of the functions declared in xmix_device.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "01/03/02 23:14:57 jose" + * Last change: Time-stamp: "2001-05-04 23:40:31 jao" * ------------------------------------------------------------------ * Copyright (C) 2001 Free Software Foundation, Inc. * @@ -54,6 +54,51 @@ const mix_fmode_t FMODES_[] = { mix_io_READ, mix_io_WRITE, mix_io_WRITE, mix_io_WRITE, mix_io_WRITE }; +/* constructors */ +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_; +} + + +void +construct_device_with_name_ (mix_device_t *result, + mix_device_type_t type, const gchar *name) +{ + result->type = type; + if (type != mix_dev_CONSOLE) + { + result->file = MIX_IOCHANNEL(mix_file_new_with_def_ext (name, + FMODES_[type], + DEV_EXT_)); + } + else + { + result->file = mix_io_new (stdout); + } + result->vtable = DEF_DEV_VTABLE_; +} + + +void +construct_device_with_file_ (mix_device_t *result, + mix_device_type_t type, FILE *file) +{ + result->type = type; + result->file = mix_io_new (file); + result->vtable = DEF_DEV_VTABLE_; +} + + + /* Write a block to the device. */ -- cgit v1.2.3