From: Francesco Chemolli Date: Mon, 20 Aug 2012 14:08:35 +0000 (+0200) Subject: moved tools.cc-related prototypes to tools.h X-Git-Tag: sourceformat-review-1~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e5405559c6e119b56ce67d6935fd2493399a783;p=thirdparty%2Fsquid.git moved tools.cc-related prototypes to tools.h --- diff --git a/src/Makefile.am b/src/Makefile.am index b4f54fe018..5917c5f6ea 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -496,6 +496,7 @@ squid_SOURCES = \ MemStore.h \ time.cc \ TimeOrTag.h \ + tools.h \ tools.cc \ tunnel.cc \ typedefs.h \ @@ -1116,6 +1117,7 @@ tests_testHttpReply_SOURCES=\ tests/stub_StatHist.cc \ tests/stub_store.cc \ tests/stub_store_stats.cc \ + tools.h \ tests/stub_tools.cc \ tests/stub_HttpRequest.cc \ tests/testHttpReply.cc \ @@ -1224,6 +1226,7 @@ tests_testACLMaxUserIP_SOURCES= \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ tests/stub_store_swapout.cc \ + tools.h \ tests/stub_tools.cc \ tests/stub_cache_manager.cc \ tests/stub_UdsOp.cc \ @@ -1429,6 +1432,7 @@ tests_testCacheManager_SOURCES = \ StoreMetaURL.cc \ StoreMetaVary.cc \ StoreSwapLogData.cc \ + tools.h \ tools.cc \ tunnel.cc \ SwapDir.cc \ @@ -1582,6 +1586,7 @@ tests_testDiskIO_SOURCES = \ tests/stub_store_client.cc \ tests/stub_store_stats.cc \ tests/stub_store_rebuild.cc \ + tools.h \ tests/stub_tools.cc \ tests/stub_UdsOp.cc \ tests/testDiskIO.cc \ @@ -1789,6 +1794,7 @@ tests_testEvent_SOURCES = \ tests/stub_ipc_Forwarder.cc \ tests/stub_store_stats.cc \ time.cc \ + tools.h \ tools.cc \ tunnel.cc \ MemStore.cc \ @@ -1993,6 +1999,7 @@ tests_testEventLoop_SOURCES = \ tests/stub_ipc_Forwarder.cc \ tests/stub_store_stats.cc \ time.cc \ + tools.h \ tools.cc \ tunnel.cc \ MemStore.cc \ @@ -2193,6 +2200,7 @@ tests_test_http_range_SOURCES = \ tests/stub_MemStore.cc \ tests/stub_store_stats.cc \ time.cc \ + tools.h \ tools.cc \ tunnel.cc \ $(UNLINKDSOURCE) \ @@ -2263,6 +2271,7 @@ tests_testHttpParser_SOURCES = \ tests/stub_debug.cc \ tests/stub_event.cc \ tests/stub_HelperChildConfig.cc \ + tools.h \ tests/stub_tools.cc \ tests/testHttpParser.cc \ tests/testHttpParser.h \ @@ -2427,6 +2436,7 @@ tests_testHttpRequest_SOURCES = \ StoreMetaVary.cc \ StoreSwapLogData.cc \ event.cc \ + tools.h \ tools.cc \ tunnel.cc \ SwapDir.cc \ @@ -2572,6 +2582,7 @@ tests_testStore_SOURCES= \ tests/stub_store_stats.cc \ tests/stub_store_rebuild.cc \ tests/stub_store_swapout.cc \ + tools.h \ tests/stub_tools.cc \ tests/stub_UdsOp.cc \ tests/testMain.cc \ @@ -2644,6 +2655,7 @@ tests_testString_SOURCES = \ tests/stub_cache_manager.cc \ tests/stub_debug.cc \ tests/stub_HelperChildConfig.cc \ + tools.h \ tests/stub_tools.cc \ time.cc \ wordlist.h \ @@ -2780,6 +2792,7 @@ tests_testUfs_SOURCES = \ refresh.h \ refresh.cc \ tests/stub_store_client.cc \ + tools.h \ tests/stub_tools.cc \ tests/testStoreSupport.cc \ tests/testStoreSupport.h \ @@ -2919,6 +2932,7 @@ tests_testRock_SOURCES = \ tests/stub_store_client.cc \ tests/stub_store_rebuild.cc \ tests/stub_store_stats.cc \ + tools.h \ tests/stub_tools.cc \ time.cc \ url.cc \ @@ -3058,6 +3072,7 @@ tests_testCoss_SOURCES = \ tests/stub_Port.cc \ tests/stub_store_client.cc \ tests/stub_store_stats.cc \ + tools.h \ tests/stub_tools.cc \ tests/stub_UdsOp.cc \ tests/testStoreSupport.cc \ @@ -3196,6 +3211,7 @@ tests_testNull_SOURCES = \ refresh.cc \ tests/stub_store_client.cc \ tests/stub_store_stats.cc \ + tools.h \ tests/stub_tools.cc \ tests/testStoreSupport.cc \ tests/testStoreSupport.h \ @@ -3388,6 +3404,7 @@ tests_testURL_SOURCES = \ tests/testURLScheme.h \ tests/testMain.cc \ time.cc \ + tools.h \ tools.cc \ tunnel.cc \ url.cc \ @@ -3456,6 +3473,7 @@ tests_testConfigParser_SOURCES = \ tests/stub_cache_manager.cc \ tests/stub_debug.cc \ tests/stub_HelperChildConfig.cc \ + tools.h \ tests/stub_tools.cc \ time.cc \ wordlist.h \ @@ -3494,6 +3512,7 @@ tests_testStatHist_SOURCES = \ tests/stub_stmem.cc \ tests/stub_store.cc \ tests/stub_store_stats.cc \ + tools.h \ tests/stub_tools.cc \ tests/testMain.cc \ tests/testStatHist.cc \ diff --git a/src/Server.cc b/src/Server.cc index 2c00478262..77f584437c 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -47,6 +47,7 @@ #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" +#include "tools.h" #if USE_ADAPTATION #include "adaptation/AccessCheck.h" diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 7d1dfc8959..1b72f39b1c 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -64,6 +64,7 @@ #include "SwapDir.h" #include "wordlist.h" #include "neighbors.h" +#include "tools.h" /* wccp2 has its own conditional definitions */ #include "wccp2.h" #if USE_ADAPTATION diff --git a/src/client_db.cc b/src/client_db.cc index 5a92bab76f..55bef76cd0 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -45,7 +45,7 @@ #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" - +#include "tools.h" static hash_table *client_table = NULL; diff --git a/src/client_side.cc b/src/client_side.cc index bcb7f6d89f..e0cf5b262f 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -122,6 +122,7 @@ #include "StatHist.h" #include "Store.h" #include "TimeOrTag.h" +#include "tools.h" #if USE_AUTH #include "auth/UserRequest.h" diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 440492c3a5..772e7f3093 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -56,6 +56,7 @@ #include "SquidTime.h" #include "Store.h" #include "StoreClient.h" +#include "tools.h" #if USE_AUTH #include "auth/UserRequest.h" #endif diff --git a/src/errorpage.cc b/src/errorpage.cc index e37e51063f..c9c7f7a5fd 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -36,13 +36,6 @@ #include "comm/Write.h" #include "err_detail_type.h" #include "errorpage.h" -#if USE_AUTH -#include "auth/UserRequest.h" -#endif -#include "SquidTime.h" -#if USE_SSL -#include "ssl/ErrorDetailManager.h" -#endif #include "Store.h" #include "html_quote.h" #include "HttpReply.h" @@ -53,7 +46,15 @@ #include "protos.h" #include "rfc1738.h" #include "URLScheme.h" +#include "tools.h" #include "wordlist.h" +#if USE_AUTH +#include "auth/UserRequest.h" +#endif +#include "SquidTime.h" +#if USE_SSL +#include "ssl/ErrorDetailManager.h" +#endif /** \defgroup ErrorPageInternal Error Page Internals diff --git a/src/external_acl.cc b/src/external_acl.cc index 6eef5a2216..0959830eff 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -59,6 +59,7 @@ #include "SquidTime.h" #include "Store.h" #include "URLScheme.h" +#include "tools.h" #include "wordlist.h" #if USE_SSL #include "ssl/support.h" diff --git a/src/ftp.cc b/src/ftp.cc index 7698a9f60f..f5cea25178 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -57,6 +57,7 @@ #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" +#include "tools.h" #include "URLScheme.h" #include "wordlist.h" diff --git a/src/gopher.cc b/src/gopher.cc index 648268b868..bda65cc03c 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -47,6 +47,7 @@ #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" +#include "tools.h" #if USE_DELAY_POOLS #include "DelayPools.h" diff --git a/src/http.cc b/src/http.cc index 8c173319b2..1802b429ed 100644 --- a/src/http.cc +++ b/src/http.cc @@ -67,6 +67,7 @@ #include "SquidTime.h" #include "StatCounters.h" #include "Store.h" +#include "tools.h" #if USE_AUTH #include "auth/UserRequest.h" diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 764732ebd4..9ffb8ff2c0 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -59,6 +59,7 @@ #include "StatCounters.h" #include "Store.h" #include "SwapDir.h" +#include "tools.h" #include "wordlist.h" #if HAVE_ERRNO_H diff --git a/src/internal.cc b/src/internal.cc index 118df8a8a7..7812fb5b0e 100644 --- a/src/internal.cc +++ b/src/internal.cc @@ -44,6 +44,7 @@ #include "MemBuf.h" #include "protos.h" #include "SquidTime.h" +#include "tools.h" #include "wordlist.h" /* called when we "miss" on an internal object; diff --git a/src/main.cc b/src/main.cc index 5a8c0c9ea4..fb0fb1691a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -74,6 +74,7 @@ #include "profiler/Profiler.h" #include "protos.h" #include "refresh.h" +#include "tools.h" #include "SquidDns.h" #include "SquidTime.h" #include "StatCounters.h" diff --git a/src/peer_digest.cc b/src/peer_digest.cc index ad50fd09f5..74238503c9 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -48,6 +48,7 @@ #include "SquidTime.h" #include "Store.h" #include "StoreClient.h" +#include "tools.h" /* local types */ diff --git a/src/protos.h b/src/protos.h index 0d2422472c..dda745e537 100644 --- a/src/protos.h +++ b/src/protos.h @@ -439,21 +439,14 @@ SQUIDCEXTERN void urlExtMethodConfigure(void); SQUIDCEXTERN peer_t parseNeighborType(const char *s); -/* tools.c */ - -SQUIDCEXTERN void kb_incr(kb_t *, size_t); -SQUIDCEXTERN int stringHasWhitespace(const char *); -SQUIDCEXTERN int stringHasCntl(const char *); -SQUIDCEXTERN void linklistPush(link_list **, void *); -SQUIDCEXTERN void *linklistShift(link_list **); -SQUIDCEXTERN int xrename(const char *from, const char *to); -extern int isPowTen(int); -SQUIDCEXTERN void parseEtcHosts(void); -SQUIDCEXTERN int getMyPort(void); -SQUIDCEXTERN void setUmask(mode_t mask); - -SQUIDCEXTERN char *strwordtok(char *buf, char **t); -SQUIDCEXTERN void strwordquote(MemBuf * mb, const char *str); +SQUIDCEXTERN int stringHasWhitespace(const char *); //String.cc +SQUIDCEXTERN int stringHasCntl(const char *); //String.cc +SQUIDCEXTERN void linklistPush(link_list **, void *); //list.cc +SQUIDCEXTERN void *linklistShift(link_list **); //list.cc +SQUIDCEXTERN int xrename(const char *from, const char *to); //disk.cc +extern int isPowTen(int); //int.cc + +SQUIDCEXTERN char *strwordtok(char *buf, char **t); //String.cc /* diff --git a/src/send-announce.cc b/src/send-announce.cc index b5ee95a87f..df6830f5c1 100644 --- a/src/send-announce.cc +++ b/src/send-announce.cc @@ -42,6 +42,7 @@ #include "ipcache.h" #include "protos.h" #include "SquidTime.h" +#include "tools.h" static IPH send_announce; diff --git a/src/tools.h b/src/tools.h new file mode 100644 index 0000000000..d1ac242999 --- /dev/null +++ b/src/tools.h @@ -0,0 +1,48 @@ +/* + * DEBUG: section + * AUTHOR: + * + * SQUID Web Proxy Cache http://www.squid-cache.org/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + + +#ifndef SQUID_TOOLS_H_ +#define SQUID_TOOLS_H_ + +/* for kb_t */ +#include "typedefs.h" + +class MemBuf; + +extern void kb_incr(kb_t *, size_t); +extern void parseEtcHosts(void); +extern int getMyPort(void); +extern void setUmask(mode_t mask); +extern void strwordquote(MemBuf * mb, const char *str); + +#endif /* SQUID_TOOLS_H_ */ diff --git a/src/tunnel.cc b/src/tunnel.cc index 547eec19ec..5aca7e97cb 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -50,6 +50,7 @@ #include "PeerSelectState.h" #include "protos.h" #include "StatCounters.h" +#include "tools.h" #if USE_DELAY_POOLS #include "DelayId.h" diff --git a/src/whois.cc b/src/whois.cc index 551413e992..d4a0c6d9f8 100644 --- a/src/whois.cc +++ b/src/whois.cc @@ -44,6 +44,7 @@ #include "protos.h" #include "StatCounters.h" #include "Store.h" +#include "tools.h" #if HAVE_ERRNO_H #include