From: Amos Jeffries Date: Sun, 17 Feb 2013 01:55:00 +0000 (+1300) Subject: SourceLayout: shuffle fd_table definition into fde.h X-Git-Tag: SQUID_3_4_0_1~271 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9fb22f530b782f2859a6e0f9dddd16193a5eae3;p=thirdparty%2Fsquid.git SourceLayout: shuffle fd_table definition into fde.h 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. --- diff --git a/src/fde.cc b/src/fde.cc index 2eef778abb..8455719a91 100644 --- a/src/fde.cc +++ b/src/fde.cc @@ -38,6 +38,8 @@ #include "SquidTime.h" #include "Store.h" +fde *fd_table = NULL; + bool fde::readPending(int fdNumber) { diff --git a/src/fde.h b/src/fde.h index 126b2e0b3e..e692fd1ed7 100644 --- 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) diff --git a/src/globals.h b/src/globals.h index 517e0d895f..211dcf84ce 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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 */