aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/streams.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-22 14:51:54 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-22 14:51:54 +0000
commit11215c3bcb0b0cbe5794cfc92d0c20de6c8696d9 (patch)
treeb8e85145673bfaee0bd0e3444e1d640b3a5be155 /os/kernel/include/streams.h
parent11a6a2bf6476beda7a3a6d8504aa74c03c3b9731 (diff)
downloadChibiOS-11215c3bcb0b0cbe5794cfc92d0c20de6c8696d9.tar.gz
ChibiOS-11215c3bcb0b0cbe5794cfc92d0c20de6c8696d9.tar.bz2
ChibiOS-11215c3bcb0b0cbe5794cfc92d0c20de6c8696d9.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1539 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/streams.h')
-rw-r--r--os/kernel/include/streams.h30
1 files changed, 8 insertions, 22 deletions
diff --git a/os/kernel/include/streams.h b/os/kernel/include/streams.h
index f01d0999b..80fa72e46 100644
--- a/os/kernel/include/streams.h
+++ b/os/kernel/include/streams.h
@@ -30,33 +30,22 @@
/**
* @brief BaseSequentialStream specific methods.
*/
-struct _base_sequental_stream_methods {
- /**
- * @brief Stream write buffer method.
- */
- size_t (*write)(void *instance, const uint8_t *bp, size_t n);
- /**
- * @brief Stream read buffer method.
- */
- size_t (*read)(void *instance, uint8_t *bp, size_t n);
-};
+#define _base_sequental_stream_methods \
+ size_t (*write)(void *instance, const uint8_t *bp, size_t n); \
+ size_t (*read)(void *instance, uint8_t *bp, size_t n)
/**
* @brief @p BaseSequentialStream specific data.
* @note It is empty because @p BaseSequentialStream is only an interface
* without implementation.
*/
-struct _base_sequental_stream_data {
-};
+#define _base_sequental_stream_data
/**
* @brief @p BaseSequentialStream virtual methods table.
*/
struct BaseSequentialStreamVMT {
- /**
- * @p BaseSequentialStream class specific methods.
- */
- struct _base_sequental_stream_methods bss;
+ _base_sequental_stream_methods;
};
/**
@@ -69,10 +58,7 @@ typedef struct {
* Virtual Methods Table.
*/
const struct BaseSequentialStreamVMT *vmt;
- /**
- * @p BaseSequentialStream class specific data.
- */
- struct _base_sequental_stream_data bss;
+ _base_sequental_stream_data;
} BaseSequentialStream;
/**
@@ -86,7 +72,7 @@ typedef struct {
* than the specified number of bytes if the stream reaches a
* physical end of file and cannot be extended.
*/
-#define chSequentialStreamWrite(ip, bp, n) ((ip)->vmt->bss.write(ip, bp, n))
+#define chSequentialStreamWrite(ip, bp, n) ((ip)->vmt->write(ip, bp, n))
/**
* @brief Sequential Stream read.
@@ -99,7 +85,7 @@ typedef struct {
* than the specified number of bytes if the stream reaches the end
* of the available data.
*/
-#define chSequentialStreamRead(ip, bp, n) ((ip)->vmt->bss.read(ip, bp, n))
+#define chSequentialStreamRead(ip, bp, n) ((ip)->vmt->read(ip, bp, n))
#endif /* _STREAMS_H_ */