From: Ian Campbell Subject: Re: [PATCH v8 4/8] libxl IDL: generate code to parse libxl__json_object to libxl_FOO struct Date: Fri, 27 Jun 2014 12:40:28 +0100 Message-ID: <1403869228.25894.44.camel@kazak.uk.xensource.com> References: <1403199864-5816-1-git-send-email-wei.liu2@citrix.com> <1403199864-5816-5-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: <1403199864-5816-5-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 Thu, 2014-06-19 at 18:44 +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_*_private.h so that they don't contaminate public header. > The suffix "private is chosen so we can avoid clashing with > libxl_types_internal.idl stuffs. > > Signed-off-by: Wei Liu Acked-by: Ian Campbell But you should consider two things: > diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile > index 7fc42c8..b1ad8d4 100644 > --- a/tools/libxl/Makefile > +++ b/tools/libxl/Makefile > @@ -184,8 +184,10 @@ $(LIBXL_OBJS) $(LIBXL_TEST_OBJS) $(LIBXLU_OBJS) \ > $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): libxl_internal.h > > _libxl_type%.h _libxl_type%_json.h _libxl_type%.c: libxl_type%.idl gentypes.py idl.py Listing the new output file as a target here (before the :). and whether you should be extending the existing: libxl.h: _libxl_types.h libxl_json.h: _libxl_types_json.h libxl_internal.h: _libxl_types_internal.h _paths.h libxl_internal_json.h: _libxl_types_internal_json.h xl.h: _paths.h To declare the new relationships from: > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 9e8bc4c..a5803d2 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -3186,6 +3186,9 @@ int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o, > int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o, > char **p); > > +#include "_libxl_types_private.h" > +#include "_libxl_types_internal_private.h" > + > /* This always return false, there's no "default value" for hw cap */ > static inline int libxl__hwcap_is_default(libxl_hwcap *hwcap) > { Ian.