From: Ian Campbell Subject: Re: [PATCH v7 5/9] libxl IDL: generate code to parse libxl__json_object to libxl_FOO struct Date: Wed, 18 Jun 2014 15:22:13 +0100 Message-ID: <1403101333.6568.46.camel@kazak.uk.xensource.com> References: <1402997549-23136-1-git-send-email-wei.liu2@citrix.com> <1402997549-23136-6-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402997549-23136-6-git-send-email-wei.liu2@citrix.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: Wei Liu Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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))) 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 think you need to put the first function into a new _libxl_types_*_internal.h (no need to make it specific to internal json functions), and the second into just regular _libxl_types.h (it doesn't require the application to opt into using yajl so it doesn't have to go into _libxl_types_json.h) Ian.