From b65ce00c4cc5b1e66409bc045d25f8e259d6e906 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Wed, 29 Aug 2012 14:56:25 +0200 Subject: [PATCH] Moved mime.cc-related prototypes to newly-created mime.h --- src/Makefile.am | 15 +++++++++++++++ src/ftp.cc | 1 + src/gopher.cc | 1 + src/main.cc | 1 + src/mime.cc | 5 +++++ src/mime.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/protos.h | 9 --------- 7 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 src/mime.h diff --git a/src/Makefile.am b/src/Makefile.am index 8570103320..827dba4405 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -411,6 +411,7 @@ squid_SOURCES = \ MemBuf.cc \ MemObject.cc \ MemObject.h \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -1248,6 +1249,7 @@ tests_testACLMaxUserIP_SOURCES= \ tests/stub_libsslsquid.cc \ tests/stub_MemObject.cc \ tests/stub_MemStore.cc \ + mime.h \ tests/stub_mime.cc \ tests/stub_pconn.cc \ tests/stub_Port.cc \ @@ -1420,6 +1422,7 @@ tests_testCacheManager_SOURCES = \ mem_node.cc \ MemBuf.cc \ MemObject.cc \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -1632,6 +1635,7 @@ tests_testDiskIO_SOURCES = \ tests/stub_libformat.cc \ tests/stub_libicmp.cc \ tests/stub_MemStore.cc \ + mime.h \ tests/stub_mime.cc \ tests/stub_pconn.cc \ tests/stub_Port.cc \ @@ -1793,6 +1797,7 @@ tests_testEvent_SOURCES = \ mem_node.cc \ MemBuf.cc \ MemObject.cc \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -2012,6 +2017,7 @@ tests_testEventLoop_SOURCES = \ Mem.h \ mem.cc \ mem_node.cc \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -2228,6 +2234,7 @@ tests_test_http_range_SOURCES = \ Mem.h \ mem.cc \ mem_node.cc \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -2487,6 +2494,7 @@ tests_testHttpRequest_SOURCES = \ mem_node.cc \ MemBuf.cc \ MemObject.cc \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -2692,6 +2700,7 @@ tests_testStore_SOURCES= \ tests/stub_HttpRequest.cc \ tests/stub_libcomm.cc \ tests/stub_MemStore.cc \ + mime.h \ tests/stub_mime.cc \ tests/stub_Port.cc \ tests/stub_store_client.cc \ @@ -2887,6 +2896,7 @@ tests_testUfs_SOURCES = \ tests/stub_http.cc \ mem_node.cc \ stmem.cc \ + mime.h \ tests/stub_mime.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ @@ -3062,6 +3072,7 @@ tests_testRock_SOURCES = \ tests/stub_libformat.cc \ tests/stub_libicmp.cc \ tests/stub_MemStore.cc \ + mime.h \ tests/stub_mime.cc \ tests/stub_Port.cc \ tests/stub_pconn.cc \ @@ -3184,6 +3195,7 @@ tests_testCoss_SOURCES = \ tests/stub_http.cc \ mem_node.cc \ stmem.cc \ + mime.h \ tests/stub_mime.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ @@ -3332,6 +3344,7 @@ tests_testNull_SOURCES = \ tests/stub_http.cc \ mem_node.cc \ stmem.cc \ + mime.h \ tests/stub_mime.cc \ HttpHeaderTools.h \ HttpHeaderTools.cc \ @@ -3498,6 +3511,7 @@ tests_testURL_SOURCES = \ mem_node.cc \ MemBuf.cc \ MemObject.cc \ + mime.h \ mime.cc \ mime_header.h \ mime_header.cc \ @@ -3673,6 +3687,7 @@ tests_testStatHist_SOURCES = \ Mem.h \ tests/stub_mem.cc \ tests/stub_MemObject.cc \ + mime.h \ tests/stub_mime.cc \ tests/stub_pconn.cc \ tests/stub_stmem.cc \ diff --git a/src/ftp.cc b/src/ftp.cc index 645bdd6348..9550e7ccc8 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -52,6 +52,7 @@ #include "ip/tools.h" #include "Mem.h" #include "MemBuf.h" +#include "mime.h" #include "protos.h" #include "rfc1738.h" #include "Server.h" diff --git a/src/gopher.cc b/src/gopher.cc index 7ca4a5f6c9..68ca56fc9b 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -44,6 +44,7 @@ #include "HttpRequest.h" #include "Mem.h" #include "MemBuf.h" +#include "mime.h" #include "protos.h" #include "rfc1738.h" #include "SquidTime.h" diff --git a/src/main.cc b/src/main.cc index eb0a330603..5091e692ff 100644 --- a/src/main.cc +++ b/src/main.cc @@ -70,6 +70,7 @@ #include "ip/tools.h" #include "Mem.h" #include "MemPool.h" +#include "mime.h" #include "neighbors.h" #include "pconn.h" #include "PeerSelectState.h" diff --git a/src/mime.cc b/src/mime.cc index e8d94a24c2..4511ba58b1 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -43,6 +43,7 @@ #include "internal.h" #include "Mem.h" #include "MemBuf.h" +#include "mime.h" #include "MemObject.h" #include "protos.h" #include "Store.h" @@ -54,6 +55,10 @@ #define GET_HDR_SZ 1024 +/* forward declarations */ +static void mimeFreeMemory(void); +static char const *mimeGetIcon(const char *fn); + class MimeIcon : public StoreClient { diff --git a/src/mime.h b/src/mime.h new file mode 100644 index 0000000000..b7209ef679 --- /dev/null +++ b/src/mime.h @@ -0,0 +1,44 @@ +/* + * 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_MIME_H_ +#define SQUID_MIME_H_ + +extern void mimeInit(char *filename); +extern char *mimeGetContentEncoding(const char *fn); +extern char *mimeGetContentType(const char *fn); +extern const char *mimeGetIconURL(const char *fn); +extern char mimeGetTransferMode(const char *fn); +extern int mimeGetDownloadOption(const char *fn); +extern int mimeGetViewOption(const char *fn); + +#endif /* SQUID_MIME_H_ */ diff --git a/src/protos.h b/src/protos.h index c3480ac94b..ac2dd14077 100644 --- a/src/protos.h +++ b/src/protos.h @@ -80,15 +80,6 @@ extern variable_list *snmp_meshPtblFn(variable_list *, snint *); extern variable_list *snmp_meshCtblFn(variable_list *, snint *); #endif /* SQUID_SNMP */ -extern void mimeInit(char *filename); -extern void mimeFreeMemory(void); -extern char *mimeGetContentEncoding(const char *fn); -extern char *mimeGetContentType(const char *fn); -extern char const *mimeGetIcon(const char *fn); -extern const char *mimeGetIconURL(const char *fn); -extern char mimeGetTransferMode(const char *fn); -extern int mimeGetDownloadOption(const char *fn); -extern int mimeGetViewOption(const char *fn); #include "ipcache.h" extern int mcastSetTtl(int, int); -- 2.39.5