WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [PATCH V6 2/3] libxl: Introduce JSON parsing stuff.

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH V6 2/3] libxl: Introduce JSON parsing stuff.
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Date: Fri, 1 Jul 2011 11:16:33 +0100
Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 01 Jul 2011 03:17:34 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=wH0B+MEun7tSm2efvLJWYwhOre8h++mF90fEEFER9S8=; b=mmkp0XWJt5IgdkmEs/kK4gth50ie0W3xazgGiFVeuFaNyW1dL7uVc/wcIb58+SFcvK S1mizeRkWvyg/h9Jpzl0hMtzSK6k1PJAO/zn6tQhhQ+k02rXOpmUVy7xs1avpwD544av /7IN+Hk7YlZEpIZgjzZln5cl2E1wZef5lPuj0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1309508074.634.13.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1309455045-3062-1-git-send-email-anthony.perard@xxxxxxxxxx> <1309455045-3062-3-git-send-email-anthony.perard@xxxxxxxxxx> <1309508074.634.13.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, Jul 1, 2011 at 09:14, Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx> wrote:
>> +/* from libxl_json */
>> +typedef enum {
>> +    JSON_ERROR,
>> +    JSON_NULL,
>> +    JSON_TRUE,
>> +    JSON_FALSE,
>> +    JSON_INTEGER,
>> +    JSON_DOUBLE,
>> +    JSON_STRING,
>> +    JSON_MAP,
>> +    JSON_ARRAY,
>> +    JSON_ANY
>> +} libxl__json_node_type;
>
> Could be internal IDL? Maybe no much point if you aren't using the
> to_string functions etc?

The to_string function could be use for debug messages. But that all.

>> +
>> +typedef struct libxl__json_object {
>> +    libxl__json_node_type type;
>> +    union {
>> +        long i;
>> +        double d;
>> +        const char *string;
>
> Is it really const? Seems to be malloc/freed?

Yes, the string belong only to this structure. In that case, there is no const ?

>> [...]+#ifdef DEBUG_ANSWER
>> +#  define DEBUG_GEN_ALLOC(h) \
>> +    if (h == NULL) { \
>> +        yajl_gen_config conf = { 1, "  " }; \
>> +        h = yajl_gen_alloc(&conf, NULL); \
>> +    }
>
> All the callers of these macros use ctx->g. I think you could push the
> ->g down into the macros.

Yes, maybe better, specially for the case of the _alloc where the
parameter is modified.

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>