chiark / gitweb /
More support scripts and other cool stuff.
[tripe] / tripe.h
diff --git a/tripe.h b/tripe.h
index a358fb91c1d2a908e4f6d3d40f6a30219e7fb337..47719fe99353ee1b54a1330e8d40172d395d2247 100644 (file)
--- a/tripe.h
+++ b/tripe.h
@@ -372,6 +372,7 @@ typedef struct admin_pingop {
 typedef struct admin {
   struct admin *next, *prev;           /* Links to next and previous */
   unsigned f;                          /* Various useful flags */
+  unsigned ref;                                /* Reference counter */
 #ifndef NTRACE
   unsigned seq;                                /* Sequence number for tracing */
 #endif
@@ -383,13 +384,12 @@ typedef struct admin {
 } admin;
 
 #define AF_DEAD 1u                     /* Destroy this admin block */
-#define AF_LOCK 2u                     /* Don't destroy it yet */
+#define AF_CLOSE 2u                    /* Client closed connection */
 #define AF_NOTE 4u                     /* Catch notifications */
 #define AF_WARN 8u                     /* Catch warning messages */
 #ifndef NTRACE
   #define AF_TRACE 16u                 /* Catch tracing */
 #endif
-#define AF_CLOSE 32u                   /* Client closed connection */
 
 #ifndef NTRACE
 #  define AF_ALLMSGS (AF_NOTE | AF_TRACE | AF_WARN)
@@ -918,10 +918,21 @@ extern peer *p_create(peerspec */*spec*/);
  * Arguments:  @peer *p@ = pointer to a peer block
  *
  * Returns:    A pointer to the peer's name.
+ *
+ * Use:                Equivalent to @p_spec(p)->name@.
  */
 
 extern const char *p_name(peer */*p*/);
 
+/* --- @p_spec@ --- *
+ *
+ * Arguments:  @peer *p@ = pointer to a peer block
+ *
+ * Returns:    Pointer to the peer's specification
+ */
+
+extern const peerspec *p_spec(peer */*p*/);
+
 /* --- @p_find@ --- *
  *
  * Arguments:  @const char *name@ = name to look up