fix doc things new-transport
authorTero Marttila <terom@fixme.fi>
Sun, 03 May 2009 17:18:16 +0300
branchnew-transport
changeset 165 b3e95108c884
parent 164 7847a7c3b678
child 166 cb8cb023cf06
fix doc things
TODO
src/transport.c
src/transport.h
src/transport_fd.h
src/transport_internal.h
--- a/TODO	Sun May 03 17:16:30 2009 +0300
+++ b/TODO	Sun May 03 17:18:16 2009 +0300
@@ -11,6 +11,7 @@
 
 irc_net:
  * reconnect, maybe cycling servers?
+ * proper case-insensitive lookups for channel names
 
 config:
  * user-defined types (!)
--- a/src/transport.c	Sun May 03 17:16:30 2009 +0300
+++ b/src/transport.c	Sun May 03 17:18:16 2009 +0300
@@ -90,7 +90,7 @@
     if (transport->type->methods.read(transport, buf, &len, err))
         return -ERROR_CODE(err);
     
-    // return updated bytes-read len
+    // return updated 'bytes-read' len
     return len;
 }
 
@@ -104,7 +104,7 @@
     if (transport->type->methods.write(transport, buf, &len, err))
         return -ERROR_CODE(err);
 
-    // return updated bytes-written len
+    // return updated 'bytes-written' len
     return len;
 }
 
--- a/src/transport.h	Sun May 03 17:16:30 2009 +0300
+++ b/src/transport.h	Sun May 03 17:18:16 2009 +0300
@@ -24,7 +24,7 @@
  * These implement unbuffered I/O, so they may do partial reads/writes. In terms of the system read/write calls, the
  * main difference is in the error return codes. On EOF, instead of returning zero, they return ERR_EOF (or
  * ERR_WRITE_EOF for transport_write, for whoever knows what that means...). This means that when the underlying
- * transport is unable to fufill the request due to lack of data/buffer space, these can return zero to signifiy s
+ * transport is unable to fufill the request due to lack of data/buffer space, these can return zero to signifiy
  * something simliar to EAGAIN.
  *
  * The transport API also implements non-blocking/event-based operation (usually on top of libevent), although at a
@@ -40,7 +40,7 @@
  * the socket (i.e. normal select() semantics). If masked out using transport_events(), there should be no event
  * activity on the transport (i.e. the fd read event is removed).
  *
- * For writes, the transport maintains a write event that is disabled by default. If on_write returns zero, it will
+ * For writes, the transport maintains a write event that is disabled by default. If transport_write() returns zero, it will
  * become enabled *once*, and consequently trigger transport_callbacks::on_write *once*, after which you must call
  * transport_write() to possibly enable it again. If masked out using transport_events(), transport_write() will not
  * enable the write event, and any pending write event is cancelled. If masked back in using transport_events(), the
@@ -131,8 +131,6 @@
  * returns the number of bytes written (which may be less than \a len). If the transport is nonblocking, and the
  * operation would have blocked, no data will be written, and zero is returned.
  *
- * XXX: behaviour of transport_callbacks::on_write?
- *
  * On errors, this returns the negative error code, along with extended info via \a err.
  *
  * @param transport the transport state
--- a/src/transport_fd.h	Sun May 03 17:16:30 2009 +0300
+++ b/src/transport_fd.h	Sun May 03 17:18:16 2009 +0300
@@ -6,7 +6,7 @@
  *
  * Support for transport implementations that use POSIX file descriptor streams.
  *
- * This provides the read/write methods, as well as functions to help implement the event-based behaviour
+ * This provides the read/write methods, as well as functions to implement the event-based behaviour.
  */
 #include "transport_internal.h"
 
@@ -96,7 +96,7 @@
  * Initialize the transport_fd to use the given, connected fd, or TRANSPORT_FD_INVALID if we don't yet have an fd.
  *
  * It is an error to call this if the transport_fd already has an fd set
- i*
+ *
  * @param fd the transport_fd state
  * @param ev_base the libevent base to use
  * @param _fd the OS file descriptor, or TRANSPORT_FD_INVALID
@@ -121,7 +121,7 @@
 err_t transport_fd_enable (struct transport_fd *fd, short mask);
 
 /**
- * Disable the specifid events, any of { TRANSPORT_READ, TRANSPORT_WRITE }.
+ * Disable the specified events, any of { TRANSPORT_READ, TRANSPORT_WRITE }.
  */
 err_t transport_fd_disable (struct transport_fd *fd, short mask);
 
@@ -150,17 +150,16 @@
 err_t transport_fd_set (struct transport_fd *fd, int _fd);
 
 /**
- * Invoke the transport_callbacks based on the given mask of libevent EV_* bits
- */
-void transport_fd_invoke (struct transport_fd *fd, short what);
-
-/**
  * Close an opened fd, releasing all resources within our state.
  */
 err_t transport_fd_close (struct transport_fd *fd);
 
 /**
  * Destroy the fd immediately.
+ *
+ * This logs a warning if the close() fails.
+ *
+ * XXX: this may actually block, I think? SO_LINGER?
  */
 void transport_fd_destroy (struct transport_fd *fd);
 
--- a/src/transport_internal.h	Sun May 03 17:16:30 2009 +0300
+++ b/src/transport_internal.h	Sun May 03 17:18:16 2009 +0300
@@ -23,7 +23,7 @@
     err_t (*write) (transport_t *transport, const void *buf, size_t *len, error_t *err);
 
     /**
-     * The mask of event flags will be set to the given mask if this method is succesfully.
+     * The mask of event flags will be set to the given mask if this method is succesfull.
      *
      * The old mask is still available in transport::info::ev_mask.
      */
@@ -101,9 +101,9 @@
  *
  * If called from the transport_methods::_connected method, pass in direct to avoid recursion.
  *
- * This sets the transport::connected flag, regardless of which callback it invokes.
+ * XXX: This sets the transport::connected flag, regardless of which callback it invokes.
  *
- * XXX: implement proper layering of types, linkig transport_type's together
+ * XXX: implement proper layering of types by taking a transport_type arg and chaining down from there.
  *
  * @param transport the transport state
  * @param err NULL for success, otherwise connect error code