[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 5/9] libxl IDL: generate code to parse libxl__json_object to libxl_FOO struct



On Wed, 2014-06-18 at 18:21 +0100, Wei Liu wrote:
> 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.

Sorry, somehow I thought this was the prototype.

>  I don't see the need
> to separate them to different implementation files.

Indeed, there is no reason to do so. My confusion.

> > 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.

Smashing. I'll have another look at this patch with that in mind once
I've dealt with my backlog from being away.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.