From: Wei Liu Subject: Re: [PATCH v7 5/9] libxl IDL: generate code to parse libxl__json_object to libxl_FOO struct Date: Wed, 18 Jun 2014 18:21:15 +0100 Message-ID: <20140618172115.GL20819@zion.uk.xensource.com> References: <1402997549-23136-1-git-send-email-wei.liu2@citrix.com> <1402997549-23136-6-git-send-email-wei.liu2@citrix.com> <1403101333.6568.46.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1403101333.6568.46.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: ian.jackson@eu.citrix.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Jun 18, 2014 at 03:22:13PM +0100, Ian Campbell wrote: > On Tue, 2014-06-17 at 10:32 +0100, Wei Liu wrote: > > libxl_FOO_parse_json functions are generated. > > > > Note that these functions are used to parse libxl__json_object to > > libxl__FOO struct. They don't consume JSON string. > > > > The new function definitions are generated to new header files called > > __libxl_types_*_json_internal.h so that they don't contaiminate public > > header. > > "contaminate". > > I'm a bit confused what is going into this file. It seems to be these > two: > > f.write("int %s_parse_json(libxl__gc *gc, const libxl__json_object *%s, %s)\n" % (ty.typename,"o",ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))) > f.write("int %s_from_json(libxl_ctx *ctx, %s, const char *s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))) > This hunk is in fact generating the implementation. I don't see the need to separate them to different implementation files. > The first looks internal (it takes const libxl__json_object which is > internal) but it is in the libxl_ namespace. > > The second looks like it should be public in _libxl_json.h, shouldn't > it? > I agree with you that the public functions should to go _libxl_types.h -- it's done like that in this version already. So actually nothing to worry about with regard to header files. Wei.