fix transport_fd to have the right parent, and fix transport_test
authorTero Marttila <terom@fixme.fi>
Thu, 07 May 2009 02:49:49 +0300
changeset 182 471ca1e744da
parent 181 b12a6081fc85
child 183 7bfbe9070c50
fix transport_fd to have the right parent, and fix transport_test
src/transport_fd.c
src/transport_test.c
--- a/src/transport_fd.c	Thu May 07 02:49:10 2009 +0300
+++ b/src/transport_fd.c	Thu May 07 02:49:49 2009 +0300
@@ -122,7 +122,7 @@
 
 const struct transport_type transport_fd_type = {
     .base_type  = {
-        .parent     = NULL,
+        .parent     = &transport_type_type,
     },
     .methods    = {
         .read       = transport_fd__read,
--- a/src/transport_test.c	Thu May 07 02:49:10 2009 +0300
+++ b/src/transport_test.c	Thu May 07 02:49:49 2009 +0300
@@ -150,7 +150,7 @@
 /**
  * transport_methods::read implementation.
  */
-static err_t transport_test_read (transport_t *transport, void *buf_ptr, size_t *len, error_t *err)
+static err_t transport_test__read (transport_t *transport, void *buf_ptr, size_t *len, error_t *err)
 {
     struct transport_test *tp = transport_check(transport, &transport_test_type);
     struct io_buf *buf = &tp->recv_buf;
@@ -204,7 +204,7 @@
 /**
  * transport_methods::write implementation.
  */
-static err_t transport_test_write (transport_t *transport, const void *data, size_t *len, error_t *err)
+static err_t transport_test__write (transport_t *transport, const void *data, size_t *len, error_t *err)
 {
     struct transport_test *tp = transport_check(transport, &transport_test_type);
 
@@ -220,7 +220,7 @@
     return ERROR_CODE(err);
 }
 
-static err_t transport_test_events (transport_t *transport, short mask, error_t *err)
+static err_t transport_test__events (transport_t *transport, short mask, error_t *err)
 {
     struct transport_test *tp = transport_check(transport, &transport_test_type);
 
@@ -233,7 +233,7 @@
     return SUCCESS;
 }
 
-static void _transport_test_destroy (transport_t *transport)
+static void transport_test__deinit (transport_t *transport)
 {
     struct transport_test *tp = transport_check(transport, &transport_test_type);
 
@@ -244,11 +244,14 @@
  * Our sock_stream_type
  */
 const struct transport_type transport_test_type = {
+    .base_type = {
+        .parent     = &transport_type_type,
+    },
     .methods                = {
-        .read               = transport_test_read,
-        .write              = transport_test_write,
-        .events             = transport_test_events,
-        .destroy            = _transport_test_destroy
+        .read       = transport_test__read,
+        .write      = transport_test__write,
+        .events     = transport_test__events,
+        .deinit     = transport_test__deinit
     },
 };