summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_device.h
diff options
context:
space:
mode:
authorjaortega <jaortega>2001-03-01 23:56:08 +0000
committerjaortega <jaortega>2001-03-01 23:56:08 +0000
commit3cd180b262db4490f811aaa2f19ef7a4d00ce24f (patch)
tree95bba17660bd67204609f4916a64cb6c86f9122b /mixlib/mix_device.h
parentf20d7ac8e744fde911545618e96d52c26f008910 (diff)
downloadmdk-3cd180b262db4490f811aaa2f19ef7a4d00ce24f.tar.gz
mdk-3cd180b262db4490f811aaa2f19ef7a4d00ce24f.tar.bz2
mix device operations handled via a vtable
Diffstat (limited to 'mixlib/mix_device.h')
-rw-r--r--mixlib/mix_device.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/mixlib/mix_device.h b/mixlib/mix_device.h
index 73f16af..7248d72 100644
--- a/mixlib/mix_device.h
+++ b/mixlib/mix_device.h
@@ -1,7 +1,7 @@
/* -*-c-*- ---------------- mix_device.h :
* Declaration of mix_device_t and associated methods.
* ------------------------------------------------------------------
- * Copyright (C) 2000 Free Software Foundation, Inc.
+ * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
#define MIX_DEVICE_H
#include <stddef.h>
+#include <stdio.h>
#include "mix.h"
#include "mix_types.h"
@@ -56,7 +57,8 @@ typedef enum {
mix_dev_CARD_WR,
mix_dev_PRINTER,
mix_dev_CONSOLE,
- mix_dev_PAPER_TAPE
+ mix_dev_PAPER_TAPE,
+ mix_dev_INVALID
} mix_device_type_t;
/*
@@ -80,28 +82,42 @@ extern mix_device_t *
mix_device_new_with_name (mix_device_type_t type, const gchar *name);
/*
+ Create a new device with a given type and stream
+*/
+extern mix_device_t *
+mix_device_new_with_file (mix_device_type_t type, FILE *file);
+
+/*
Delete a device.
*/
extern void
mix_device_delete(mix_device_t *dev);
+
+/*
+ Get a device type
+*/
+extern mix_device_type_t
+mix_device_type (const mix_device_t *dev);
+
+
/*
Get a device name
*/
extern const char *
-mix_device_get_name (mix_device_t *dev);
+mix_device_get_name (const mix_device_t *dev);
/*
Get the device block size
*/
extern size_t
-mix_device_block_size (mix_device_t *dev);
+mix_device_block_size (const mix_device_t *dev);
/*
Get the device io mode
*/
extern mix_device_mode_t
-mix_device_mode (mix_device_t *dev);
+mix_device_mode (const mix_device_t *dev);
/*
Write a block to the device.
@@ -129,7 +145,7 @@ mix_device_ioc (mix_device_t *dev, mix_short_t arg);
Check if a device is busy
*/
extern gboolean
-mix_device_busy (mix_device_t *dev);
+mix_device_busy (const mix_device_t *dev);
#endif /* MIX_DEVICE_H */