added basic ssl support to ircu
[ircu2.10.12-pk.git] / include / msgq.h
index 8f3747c649e261f4b8898484ad0b5dea137e3dfc..409daabcb7e9ded8248e05924a1723afeeb08ede 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
+ */
+/** @file
+ * @brief Outbound message queue interface and declarations.
+ * @version $Id$
  */
 #ifndef INCLUDED_ircd_defs_h
 #include "ircd_defs.h" /* BUFSIZE */
 struct iovec;
 
 struct Client;
-
-struct MsgCounts {
-  int alloc;
-  int used;
-};
-
-/*
- * These should be considered read-only
- */
-extern struct MsgCounts msgBufCounts;  /* resource count for struct MsgBuf */
-extern struct MsgCounts msgCounts;     /* resource count for struct Msg */
+struct StatDesc;
 
 struct Msg;
 struct MsgBuf;
 
+/** Queue of individual messages. */
 struct MsgQList {
-  struct Msg *head;            /* First Msg in queue list */
-  struct Msg *tail;            /* Last Msg in queue list */
+  struct Msg *head;            /**< First Msg in queue list */
+  struct Msg *tail;            /**< Last Msg in queue list */
 };
 
+/** Entire two-priority message queue for a destination. */
 struct MsgQ {
-  unsigned int length;         /* Current number of bytes stored */
-  unsigned int count;          /* Current number of messages stored */
-  struct MsgQList queue;       /* Normal Msg queue */
-  struct MsgQList prio;                /* Priority Msg queue */
+  unsigned int length;         /**< Current number of bytes stored */
+  unsigned int count;          /**< Current number of messages stored */
+  struct MsgQList queue;       /**< Normal Msg queue */
+  struct MsgQList prio;                /**< Priority Msg queue */
 };
 
-/*
- * MsgQLength - Returns the current number of bytes stored in the buffer.
- */
+/** Returns the current number of bytes stored in \a mq. */
 #define MsgQLength(mq) ((mq)->length)
 
-/*
- * MsgQCount - Returns the current number of messages stored in the buffer
- */
+/** Returns the current number of messages stored in \a mq. */
 #define MsgQCount(mq) ((mq)->count)
 
-/*
- * MsgQClear - Scratch the current content of the buffer.
+/** Scratch the current content of the buffer.
  * Release all allocated buffers and make it empty.
  */
 #define MsgQClear(mq) msgq_delete((mq), MsgQLength(mq))
@@ -83,8 +72,8 @@ struct MsgQ {
  */
 extern void msgq_init(struct MsgQ *mq);
 extern void msgq_delete(struct MsgQ *mq, unsigned int length);
-extern const char *msgq_map(const struct MsgQ *mq, unsigned int *length_p);
-extern int msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count);
+extern int msgq_mapiov(const struct MsgQ *mq, struct iovec *iov, int count,
+                      unsigned int *len);
 extern struct MsgBuf *msgq_make(struct Client *dest, const char *format, ...);
 extern struct MsgBuf *msgq_vmake(struct Client *dest, const char *format,
                                 va_list args);
@@ -92,8 +81,10 @@ extern void msgq_append(struct Client *dest, struct MsgBuf *mb,
                        const char *format, ...);
 extern void msgq_clean(struct MsgBuf *mb);
 extern void msgq_add(struct MsgQ *mq, struct MsgBuf *mb, int prio);
-extern void msgq_count_memory(size_t *msg_alloc, size_t *msg_used,
-                             size_t *msgbuf_alloc, size_t *msgbuf_used);
+extern void msgq_count_memory(struct Client *cptr,
+                              size_t *msg_alloc, size_t *msg_used);
+extern void msgq_histogram(struct Client *cptr, const struct StatDesc *sd,
+                           char *param);
 extern unsigned int msgq_bufleft(struct MsgBuf *mb);
 
 #endif /* INCLUDED_msgq_h */