Various: Report errors encountered while doing channel I/O.
[fwd] / fwd.h
diff --git a/fwd.h b/fwd.h
index 6c16fb6..2d139e4 100644 (file)
--- a/fwd.h
+++ b/fwd.h
@@ -154,6 +154,7 @@ typedef struct chan {
   unsigned base, len;                  /* Base and length of data */
   unsigned f;                          /* Various interesting flags */
   void (*func)(void */*p*/);           /* Function to call on closure */
+  int err;                             /* What's wrong with the channel */
   void *p;                             /* Argument to pass function */
   sel_file r, w;                       /* Reader and writer selectors */
   char buf[CHAN_BUFSZ];                        /* The actual data buffer */
@@ -891,13 +892,21 @@ extern void endpt_killall(void);
  *
  * Arguments:  @endpt *a@ = pointer to first endpoint
  *             @endpt *b@ = pointer to second endpoint
+ *             @const char *desc@ = description of connection
  *
  * Returns:    ---
  *
- * Use:                Joins two endpoints together.
+ * Use:                Joins two endpoints together.  It's OK to join endpoints
+ *             which are already joined; in fact, the the right thing to do
+ *             when your endpoint decides that it's not pending any more is
+ *             to join it to its partner again.
+ *
+ *             If the endpoints are already connected then the description
+ *             string is ignored.  The endpoint manager takes a copy of
+ *             the string, so you don't need to keep it around.
  */
 
-extern void endpt_join(endpt */*a*/, endpt */*b*/);
+extern void endpt_join(endpt */*a*/, endpt */*b*/, const char */*desc*/);
 
 /* --- @source_add@ --- *
  *