From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 710513DC for ; Fri, 3 Mar 2017 12:17:19 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2017 03:17:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,236,1484035200"; d="scan'208";a="231860952" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga004.fm.intel.com with ESMTP; 03 Mar 2017 03:17:14 -0800 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 3 Mar 2017 11:17:13 +0000 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by irsmsx112.ger.corp.intel.com ([169.254.1.175]) with mapi id 14.03.0248.002; Fri, 3 Mar 2017 11:17:12 +0000 From: "Dumitrescu, Cristian" To: Yuanhan Liu , "Richardson, Bruce" CC: "Legacy, Allain (Wind River)" , "dev@dpdk.org" , "Jolliffe, Ian (Wind River)" Thread-Topic: [dpdk-dev] [PATCH 1/5] cfgfile: configurable comment character Thread-Index: AQHSk4tgAm80mLhvyUurDX68XH1fJKGCC6+AgAA+aICAAKeiQA== Date: Fri, 3 Mar 2017 11:17:11 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912652758102@IRSMSX108.ger.corp.intel.com> References: <1488482971-170522-1-git-send-email-allain.legacy@windriver.com> <1488482971-170522-2-git-send-email-allain.legacy@windriver.com> <20170302211015.GA18940@bricha3-MOBL3.ger.corp.intel.com> <20170303005337.GB18844@yliu-dev.sh.intel.com> In-Reply-To: <20170303005337.GB18844@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODE1ZDE5ZjUtYzQ5MS00ZDYzLWFmMGMtNDczN2I3N2RlY2Y3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiIwKzhYMTlmKzUzRHFaTFhWVmxYeGJWUTFkMmdGRURmTUdCMGhcL2xUdTg0VT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/5] cfgfile: configurable comment character X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 11:17:20 -0000 > > We are trying to avoid adding in extra build-time options to DPDK, so > > can you please rework this patch to make it a run-time option instead. >=20 > +1 for making it a run-time option. >=20 > --yliu >=20 +1 > > Perhaps just add a set_comment_char() API call to the library. If this > > is a setting per cfgfile instance it would then allow applications to > > simultaneously use files with different formats. For example, if in > > future we use cfgfile library to configure DPDK EAL, a preexisting file > > for that shipped with DPDK may conflict in format with an > > application-specific one. > > I don't think this approach will work well for the current implementation, = as the config file load function simply complete the parsing on the file in= a single step, so any update of the comment char after the load function w= ill not produce any effects. Possible options that I see: 1. Add a new parameters argument to the load functions (e.g. struct cfgfile= _params *p), whit the comment char as one (and currently only) field of thi= s struct. Drawbacks: API change that might have to be announced one release= before the actual API change. 2. Use the flags argument. Basically define a new flag value for each accep= table comment char. It does not require an API change, it has the advantage= of limiting the characters that can be accepted as comments (as we probabl= y do not want to allow e.g. letters, digits, tab, space, unprintable chars,= etc here). I am OK with adding all the commonly used single character comm= ent separators ("; # % @ !"), with the default as the current option of ";" My vote will be to go for option 2. Naming convention proposal: RTE_CFGFILE_COMMENT_SEPARATOR_CHR33; /**< ! */ RTE_CFGFILE_COMMENT_SEPARATOR_CHR35; /**< # */ RTE_CFGFILE_COMMENT_SEPARATOR_CHR37; /**< % */ RTE_CFGFILE_COMMENT_SEPARATOR_CHR59; /**< ; */ RTE_CFGFILE_COMMENT_SEPARATOR_CHR64; /**< @ */ Of course, the flags argument needs to be checked for the presence of a sin= gle separator char flag. Regards, Cristian