]> arthur.barton.de Git - ngircd-alex.git/commitdiff
New function Conn_GetProcStat()
authorAlexander Barton <alex@barton.de>
Sun, 11 Jul 2010 13:15:23 +0000 (15:15 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 11 Jul 2010 13:15:23 +0000 (15:15 +0200)
Get PROC_STAT sub-process structure of a given connection.

src/ngircd/conn.c
src/ngircd/conn.h
src/ngircd/resolve.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.
index e9b470bcf1327d08bdd3cf0598762ddc831a5326..a63fcbb602ea5f7fe7dd72231538f76346177802 100644 (file)
 typedef long CONN_ID;
 
 #include "client.h"
+#include "proc.h"
 
 #ifdef CONN_MODULE
 
 #include "defines.h"
-#include "proc.h"
 #include "array.h"
 #include "tool.h"
 #include "ng_ipaddr.h"
@@ -115,6 +115,7 @@ GLOBAL void Conn_SyncServerStruct PARAMS(( void ));
 
 GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd));
 GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i));
+GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i));
 #ifdef SSL_SUPPORT
 GLOBAL bool Conn_GetCipherInfo PARAMS((CONN_ID Idx, char *buf, size_t len));
 GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
index f8c39cf7160962c96e523f66143dee96d1931add..26ad103cf58deb6eaf2fbb064563408917f2d969 100644 (file)
@@ -35,7 +35,6 @@
 #include "defines.h"
 #include "log.h"
 #include "ng_ipaddr.h"
-#include "proc.h"
 
 #include "exp.h"
 #include "resolve.h"