From f9fb22f530b782f2859a6e0f9dddd16193a5eae3 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 17 Feb 2013 14:55:00 +1300 Subject: [PATCH] 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. --- src/fde.cc | 2 ++ src/fde.h | 6 ++++++ src/globals.h | 2 -- 3 files changed, 8 insertions(+), 2 deletions(-) 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 */ -- 2.47.2