]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
New function Conn_GetProcStat()
[ngircd-alex.git] / src / ngircd / conn.c
index 9da618f1aee53ed6ff25a71409ad3bb0038b20b5..f4efff1655002f5687b44b8beb9f9cb38c90fbf2 100644 (file)
@@ -68,7 +68,6 @@
 #include "log.h"
 #include "ng_ipaddr.h"
 #include "parse.h"
-#include "proc.h"
 #include "resolve.h"
 #include "tool.h"
 
@@ -2099,6 +2098,22 @@ Conn_GetClient( CONN_ID Idx )
        return c ? c->client : NULL;
 }
 
+/**
+ * Get PROC_STAT sub-process structure of a connection.
+ * @param Idx Connection index number
+ * @return PROC_STAT structure
+ */
+GLOBAL PROC_STAT *
+Conn_GetProcStat(CONN_ID Idx)
+{
+       CONNECTION *c;
+
+       assert(Idx >= 0);
+       c = array_get(&My_ConnArray, sizeof (CONNECTION), (size_t)Idx);
+       assert(c != NULL);
+       return &c->proc_stat;
+} /* Conn_GetProcStat */
+
 
 /**
  * Get CONN_ID from file descriptor associated to a subprocess structure.