trafficserver-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <jpe...@apache.org>
Subject Re: Is it correct to include a header file that is named with prefix P_ in proxy directory ?
Date Thu, 28 Jul 2016 09:44:23 GMT

> On Jul 26, 2016, at 7:18 PM, Chao Xu <xuchao@gmail.com> wrote:
> 
> Hi All,
> 
> https://cwiki.apache.org/confluence/display/TS/Coding+Style#CodingStyle-MemberVariables
> Header files
> 
> In most subsystems, header files are named with a P_ or I_ prefix. P_ files
> should contain any types and definitions that are private to the subsystem,
> while the public interface should be contained in a I_-prefixed header.

Strictly, I think that P_ headers should never be used outside a subsystem. In practice, we
have not worried about it too much. My view is that this is an anachronism that we ought to
remove, focusing instead on simplifying the subsystem APIs.

> $ cd proxy
> $ grep -H -R "#include" * | grep "P_"
> CacheControl.cc:#include "P_EventSystem.h"
> CacheControl.cc:#include "P_Cache.h"
> CacheControl.h:#include "P_EventSystem.h"
> ControlMatcher.cc:#include "P_EventSystem.h"
> ControlMatcher.cc:#include "P_Net.h"
> ControlMatcher.cc:#include "P_Cache.h"
> ControlMatcher.cc:#include "P_SplitDNS.h"
> EventName.cc:#include "P_EventSystem.h"
> EventName.cc://#include "P_Cluster.h"
> EventName.cc:#include "P_MultiCache.h"
> FetchSM.h:#include "P_Net.h"
> ICP.cc:#include "P_EventSystem.h"
> ICP.cc:#include "P_Cache.h"
> ICP.cc:#include "P_Net.h"
> ICP.cc:#include "P_RecProcess.h"
> ICP.h:#include "P_Net.h"
> ICP.h:#include "P_Cache.h"
> ICPConfig.cc:#include "P_EventSystem.h"
> ICPConfig.cc:#include "P_Cache.h"
> ICPConfig.cc:#include "P_Net.h"
> ICPConfig.cc:#include "P_RecProcess.h"
> ICPProcessor.h:#include "P_EventSystem.h"
> ICPStats.cc:#include "P_EventSystem.h"
> ICPStats.cc:#include "P_Cache.h"
> ICPStats.cc:#include "P_RecProcess.h"
> IPAllow.cc:#include "P_EventSystem.h"
> IPAllow.cc:#include "P_Cache.h"
> InkAPI.cc:#include "P_Net.h"
> InkAPI.cc:#include "P_UDPNet.h"
> InkAPI.cc:#include "P_HostDB.h"
> InkAPI.cc:#include "P_Cache.h"
> InkAPIInternal.h:#include "P_EventSystem.h"
> InkAPIInternal.h:#include "P_Net.h"
> InkAPIInternal.h:#include "P_Cache.h"
> InkAPITestTool.cc:#include "P_Net.h"
> InkIOCoreAPI.cc:#include "P_EventSystem.h" // I_EventSystem.h
> InkIOCoreAPI.cc:#include "P_Net.h"         // I_Net.h
> InkPool_r.h:#include "P_EventSystem.h"
> Main.cc:#include "P_EventSystem.h"
> Main.cc:#include "P_Net.h"
> Main.cc:#include "P_UDPNet.h"
> Main.cc:#include "P_DNS.h"
> Main.cc:#include "P_SplitDNS.h"
> Main.cc:#include "P_Cluster.h"
> Main.cc:#include "P_HostDB.h"
> Main.cc:#include "P_Cache.h"
> ParentSelection.cc:#include "P_EventSystem.h"
> ParentSelection.h:#include "P_RecProcess.h"
> PluginVC.cc:#include "P_EventSystem.h"
> PluginVC.cc:#include "P_Net.h"
> PluginVC.h:#include "P_Net.h"
> ProtocolProbeSessionAccept.cc:#include "P_Net.h"
> ProxyClientSession.h:#include "P_Net.h"
> RegressionSM.cc:#include "P_EventSystem.h"
> ReverseProxy.cc:#include "P_EventSystem.h"
> ReverseProxy.cc:#include "P_Cache.h"
> ReverseProxy.h:#include "P_RecProcess.h"
> SocksProxy.cc:#include "P_Net.h"
> StatPages.h:#include "P_EventSystem.h"
> StatSystem.cc:#include "P_EventSystem.h"
> Transform.cc:#include "P_Net.h"
> Transform.h:#include "P_EventSystem.h"
> TransformInternal.h:#include "P_EventSystem.h"
> api/ts/InkAPIPrivateIOCore.h:#include "P_EventSystem.h"
> api/ts/InkAPIPrivateIOCore.h:#include "P_Cache.h"
> api/ts/InkAPIPrivateIOCore.h:#include "P_Net.h"
> congest/Congestion.h:#include "P_EventSystem.h"
> congest/CongestionDB.cc:#include "P_EventSystem.h"
> congest/CongestionDB.cc:#include "P_Net.h"
> congest/CongestionDB.h:#include "P_EventSystem.h"
> congest/CongestionStats.h:#include "P_RecProcess.h"
> hdrs/HdrTSOnly.cc:#include "P_EventSystem.h"
> http/HttpCacheSM.h:#include "P_Cache.h"
> http/HttpClientSession.h:#include "P_Net.h"
> http/HttpConfig.cc:#include "P_Net.h"
> http/HttpConfig.cc:#include "P_RecUtils.h"
> http/HttpConfig.h:#include "P_RecProcess.h"
> http/HttpDebugNames.cc:#include "P_EventSystem.h"
> http/HttpPages.h:#include "P_EventSystem.h"
> http/HttpProxyServerMain.cc:#include "P_Net.h"
> http/HttpProxyServerMain.cc:#include "P_SSLNextProtocolAccept.h"
> http/HttpServerSession.h:#include "P_Net.h"
> http/HttpSessionAccept.h:#include "P_EventSystem.h"
> http/HttpSessionManager.h:#include "P_EventSystem.h"
> http/HttpSM.cc:#include "P_Cache.h"
> http/HttpSM.cc:#include "P_Net.h"
> http/HttpSM.cc:#include "P_SSLConfig.h"
> http/HttpSM.h:#include "P_EventSystem.h"
> http/HttpTransact.h:#include "P_HostDB.h"
> http/HttpTransact.h:#include "P_Net.h"
> http/HttpTunnel.h:#include "P_EventSystem.h"
> http/HttpUpdateSM.h:#include "P_EventSystem.h"
> http2/HTTP2.cc:#include "P_RecCore.h"
> http2/HTTP2.cc:#include "P_RecProcess.h"
> http2/HTTP2.h:#include "P_RecDefs.h"
> http2/Http2ConnectionState.cc:#include "P_Net.h"
> logging/Log.cc:#include "P_EventSystem.h"
> logging/Log.cc:#include "P_Net.h"
> logging/Log.h:#include "P_RecProcess.h"
> logging/LogAccess.cc:#include "P_Net.h"
> logging/LogAccess.cc:#include "P_Cache.h"
> logging/LogBuffer.cc:#include "P_EventSystem.h"
> logging/LogCollationAccept.cc:#include "P_EventSystem.h"
> logging/LogCollationAccept.h:#include "P_EventSystem.h"
> logging/LogCollationAccept.h:#include "P_Net.h"
> logging/LogCollationClientSM.cc:#include "P_EventSystem.h"
> logging/LogCollationClientSM.cc:#include "P_Net.h"
> logging/LogCollationClientSM.h:#include "P_HostDB.h"
> logging/LogCollationClientSM.h:#include "P_Net.h"
> logging/LogCollationHostSM.cc:#include "P_EventSystem.h"
> logging/LogCollationHostSM.cc:#include "P_Net.h"
> logging/LogCollationHostSM.h:#include "P_EventSystem.h"
> logging/LogConfig.h:#include "P_RecProcess.h"
> logging/LogFile.cc:#include "P_EventSystem.h"
> logging/LogObject.cc:#include "P_EventSystem.h"
> logging/LogSock.cc:#include "P_EventSystem.h"
> logging/LogStandalone.cc:#include "P_EventSystem.h"
> logging/LogStandalone.cc:#include "P_RecProcess.h"
> logging/LogUtils.cc:#include "P_RecProcess.h"
> sac.cc:#include "P_Net.h"
> shared/DiagsConfig.cc:#include "P_RecCore.h"
> shared/UglyLogStubs.cc:#include "P_Net.h"
> spdy/SpdyCommon.h:#include "P_Net.h"
> spdy/SpdySessionAccept.h:#include "P_Net.h"
> spdy/SpdySessionAccept.h:#include "P_EventSystem.h"
> spdy/SpdySessionAccept.h:#include "P_UnixNet.h"
> 
> 
> Is it correct?
> 
> Thanks!
> 
> B/R
> 
> Chao Xu


Mime
View raw message