]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceLayout: shuffle fd_table definition into fde.h
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 17 Feb 2013 01:55:00 +0000 (14:55 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 17 Feb 2013 01:55:00 +0000 (14:55 +1300)
Shift the definition out of globals.h into fde.h where the type class
is defined, and the instance into fde.cc.

Also, move it into the fde class scope as a static Table member.
Provides wrapper definition of fd_table to reduce patch impact.

src/fde.cc
src/fde.h
src/globals.h

index 2eef778abb4bd1af6d353207a15d1b3afe9fe419..8455719a9155b0f970953456761db20d9c022e9e 100644 (file)
@@ -38,6 +38,8 @@
 #include "SquidTime.h"
 #include "Store.h"
 
+fde *fd_table = NULL;
+
 bool
 fde::readPending(int fdNumber)
 {
index 126b2e0b3e2c1602ca5dad7df5d7cf32f3a4a078..e692fd1ed7a07d417d88b32910245b5262bdcb2c 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -73,6 +73,10 @@ public:
     void noteUse(PconnPool *);
 
 public:
+
+    /// global table of FD and their state.
+    static fde* Table;
+
     unsigned int type;
     unsigned short remote_port;
 
@@ -193,6 +197,8 @@ private:
     }
 };
 
+#define fd_table fde::Table
+
 int fdNFree(void);
 
 #define FD_READ_METHOD(fd, buf, len) (*fd_table[fd].read_method)(fd, buf, len)
index 517e0d895ff94c912128a532c455628573f1a0d6..211dcf84ce28f0949ec633a0f5b57e0ad41d1630 100644 (file)
@@ -60,8 +60,6 @@ extern const char *memStatusStr[];
 extern const char *pingStatusStr[];
 extern const char *storeStatusStr[];
 extern const char *swapStatusStr[];
-class fde;
-extern fde *fd_table;          /* NULL */
 extern int Biggest_FD;         /* -1 */
 extern int Number_FD;          /* 0 */
 extern int Opening_FD;         /* 0 */