From: Francesco Chemolli Date: Thu, 6 Sep 2012 12:47:15 +0000 (+0200) Subject: Renamed customlog to CustomLog and moved to own header and implementation file in... X-Git-Tag: sourceformat-review-1~6^2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87ddff6ea2500a7674a4424f6d0d158d72d51aaa;p=thirdparty%2Fsquid.git Renamed customlog to CustomLog and moved to own header and implementation file in liblog --- diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h index de15185d11..022ecac34d 100644 --- a/src/AccessLogEntry.h +++ b/src/AccessLogEntry.h @@ -275,7 +275,7 @@ class ACLChecklist; class StoreEntry; /* Should be in 'AccessLog.h' as the driver */ -extern void accessLogLogTo(customlog* log, AccessLogEntry::Pointer &al, ACLChecklist* checklist = NULL); +extern void accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist* checklist = NULL); extern void accessLogLog(AccessLogEntry::Pointer &, ACLChecklist * checklist); extern void accessLogRotate(void); extern void accessLogClose(void); diff --git a/src/SquidConfig.h b/src/SquidConfig.h index d2daaf97a1..1e2fb33835 100644 --- a/src/SquidConfig.h +++ b/src/SquidConfig.h @@ -174,9 +174,9 @@ public: struct { char *store; char *swap; - customlog *accesslogs; + CustomLog *accesslogs; #if ICAP_CLIENT - customlog *icaplogs; + CustomLog *icaplogs; #endif int rotateNumber; } Log; diff --git a/src/adaptation/icap/icap_log.cc b/src/adaptation/icap/icap_log.cc index 9231a47af7..0da66d9ee0 100644 --- a/src/adaptation/icap/icap_log.cc +++ b/src/adaptation/icap/icap_log.cc @@ -10,7 +10,7 @@ int IcapLogfileStatus = LOG_DISABLE; void icapLogOpen() { - customlog *log; + CustomLog *log; for (log = Config.Log.icaplogs; log; log = log->next) { if (log->type == Log::Format::CLF_NONE) @@ -25,7 +25,7 @@ icapLogOpen() void icapLogClose() { - customlog *log; + CustomLog *log; for (log = Config.Log.icaplogs; log; log = log->next) { if (log->logfile) { @@ -38,7 +38,7 @@ icapLogClose() void icapLogRotate() { - for (customlog* log = Config.Log.icaplogs; log; log = log->next) { + for (CustomLog* log = Config.Log.icaplogs; log; log = log->next) { if (log->logfile) { logfileRotate(log->logfile); } diff --git a/src/cache_cf.cc b/src/cache_cf.cc index d2b9617394..ca61ea3d43 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -173,10 +173,10 @@ static const char *const B_GBYTES_STR = "GB"; static const char *const list_sep = ", \t\n\r"; -static void parse_access_log(customlog ** customlog_definitions); -static int check_null_access_log(customlog *customlog_definitions); -static void dump_access_log(StoreEntry * entry, const char *name, customlog * definitions); -static void free_access_log(customlog ** definitions); +static void parse_access_log(CustomLog ** customlog_definitions); +static int check_null_access_log(CustomLog *customlog_definitions); +static void dump_access_log(StoreEntry * entry, const char *name, CustomLog * definitions); +static void free_access_log(CustomLog ** definitions); static void update_maxobjsize(void); static void configDoConfigure(void); @@ -3974,11 +3974,11 @@ strtokFile(void) #include "AccessLogEntry.h" static void -parse_access_log(customlog ** logs) +parse_access_log(CustomLog ** logs) { const char *filename, *logdef_name; - customlog *cl = (customlog *)xcalloc(1, sizeof(*cl)); + CustomLog *cl = (CustomLog *)xcalloc(1, sizeof(*cl)); if ((filename = strtok(NULL, w_space)) == NULL) { self_destruct(); @@ -4048,15 +4048,15 @@ parse_access_log(customlog ** logs) } static int -check_null_access_log(customlog *customlog_definitions) +check_null_access_log(CustomLog *customlog_definitions) { return customlog_definitions == NULL; } static void -dump_access_log(StoreEntry * entry, const char *name, customlog * logs) +dump_access_log(StoreEntry * entry, const char *name, CustomLog * logs) { - customlog *log; + CustomLog *log; for (log = logs; log; log = log->next) { storeAppendPrintf(entry, "%s ", name); @@ -4108,10 +4108,10 @@ dump_access_log(StoreEntry * entry, const char *name, customlog * logs) } static void -free_access_log(customlog ** definitions) +free_access_log(CustomLog ** definitions) { while (*definitions) { - customlog *log = *definitions; + CustomLog *log = *definitions; *definitions = log->next; log->logFormat = NULL; diff --git a/src/log/CustomLog.cc b/src/log/CustomLog.cc new file mode 100644 index 0000000000..22be6826b5 --- /dev/null +++ b/src/log/CustomLog.cc @@ -0,0 +1,31 @@ +/* + * 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. + * + */ +#include "squid.h" +#include "CustomLog.h" + diff --git a/src/log/CustomLog.h b/src/log/CustomLog.h new file mode 100644 index 0000000000..05519db577 --- /dev/null +++ b/src/log/CustomLog.h @@ -0,0 +1,35 @@ +#ifndef SQUID_CUSTOMLOG_H_ +#define SQUID_CUSTOMLOG_H_ +/* + * 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. + * + */ + +class CustomLog_ { +}; + +#endif /* SQUID_CUSTOMLOG_H_ */ diff --git a/src/log/FormatSquidCustom.cc b/src/log/FormatSquidCustom.cc index 7fb2a45970..cefffa39ea 100644 --- a/src/log/FormatSquidCustom.cc +++ b/src/log/FormatSquidCustom.cc @@ -37,7 +37,7 @@ #include "MemBuf.h" void -Log::Format::SquidCustom(const AccessLogEntry::Pointer &al, customlog * log) +Log::Format::SquidCustom(const AccessLogEntry::Pointer &al, CustomLog * log) { static MemBuf mb; mb.reset(); diff --git a/src/log/Formats.h b/src/log/Formats.h index 8d60a08622..9ca1c324da 100644 --- a/src/log/Formats.h +++ b/src/log/Formats.h @@ -40,7 +40,7 @@ void SquidUserAgent(const AccessLogEntryPointer &al, Logfile * logfile); void SquidReferer(const AccessLogEntryPointer &al, Logfile * logfile); /// Log with a local custom format -void SquidCustom(const AccessLogEntryPointer &al, customlog * log); +void SquidCustom(const AccessLogEntryPointer &al, CustomLog * log); /// Log with Apache httpd common format void HttpdCommon(const AccessLogEntryPointer &al, Logfile * logfile); diff --git a/src/log/Makefile.am b/src/log/Makefile.am index 5018962d74..93c49d009c 100644 --- a/src/log/Makefile.am +++ b/src/log/Makefile.am @@ -27,5 +27,7 @@ liblog_la_SOURCES = \ ModTcp.cc \ ModTcp.h \ ModUdp.cc \ - ModUdp.h + ModUdp.h \ + CustomLog.h \ + CustomLog.cc diff --git a/src/log/access_log.cc b/src/log/access_log.cc index 019c3ca2a6..8b724b1539 100644 --- a/src/log/access_log.cc +++ b/src/log/access_log.cc @@ -90,7 +90,7 @@ static void fvdbRegisterWithCacheManager(); int LogfileStatus = LOG_DISABLE; void -accessLogLogTo(customlog* log, AccessLogEntry::Pointer &al, ACLChecklist * checklist) +accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist * checklist) { if (al->url == NULL) @@ -203,7 +203,7 @@ accessLogLog(AccessLogEntry::Pointer &al, ACLChecklist * checklist) void accessLogRotate(void) { - customlog *log; + CustomLog *log; #if USE_FORW_VIA_DB fvdbClear(); @@ -225,7 +225,7 @@ accessLogRotate(void) void accessLogClose(void) { - customlog *log; + CustomLog *log; for (log = Config.Log.accesslogs; log; log = log->next) { if (log->logfile) { @@ -300,7 +300,7 @@ accessLogRegisterWithCacheManager(void) void accessLogInit(void) { - customlog *log; + CustomLog *log; accessLogRegisterWithCacheManager(); diff --git a/src/structs.h b/src/structs.h index f58422b0c8..af346fac8c 100644 --- a/src/structs.h +++ b/src/structs.h @@ -103,7 +103,7 @@ class CpuAffinityMap; class RemovalPolicySettings; class external_acl; class Store; -class customlog; +class CustomLog; class cachemgr_passwd; class refresh_t; namespace AnyP @@ -384,13 +384,13 @@ class Logfile; #include "format/Format.h" #include "log/Formats.h" -class customlog { +class CustomLog { public: char *filename; ACLList *aclList; Format::Format *logFormat; Logfile *logfile; - customlog *next; + CustomLog *next; Log::Format::log_type type; };