[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-netdev
Subject:    Re: [PATCH v4 10/10] ss: extended json_writer for hex field and value output
From:       Stephen Hemminger <stephen () networkplumber ! org>
Date:       2015-08-31 19:20:04
Message-ID: 20150831122004.3a3aba15 () urahara
[Download RAW message or body]


> diff --git a/lib/json_writer.c b/lib/json_writer.c
> index 2af16e1..495ce57 100644
> --- a/lib/json_writer.c
> +++ b/lib/json_writer.c
> @@ -22,6 +22,8 @@
>  
>  #include "json_writer.h"
>  
> +#define notused
> +

Gack. Just take out the #ifdef

>  struct json_writer {
>  	FILE		*out;	/* output file */
>  	unsigned	depth;  /* nesting */
> @@ -223,6 +225,14 @@ void jsonw_int(json_writer_t *self, int64_t num)
>  	jsonw_printf(self, "%"PRId64, num);
>  }
>  
> +void jsonw_hex(json_writer_t *self, uint64_t num)
> +{
> +	char tmp[17];
> +
> +	sprintf(tmp, "%"PRIx64, num);
> +	jsonw_string(self, tmp);
> +}
> +

No. JSON is a standard. The output has to be one of the formats in the
standard. hex is a display issue not an encoding style.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic