All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Matthias Tafelmeier <matthias.tafelmeier@gmx.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"hagen@jauu.net" <hagen@jauu.net>,
	"shemminger@osdl.org" <shemminger@osdl.org>,
	"fw@strlen.de" <fw@strlen.de>,
	"edumazet@google.com" <edumazet@google.com>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>
Subject: Re: [PATCH v4 10/10] ss: extended json_writer for hex field and value output
Date: Mon, 31 Aug 2015 12:20:04 -0700	[thread overview]
Message-ID: <20150831122004.3a3aba15@urahara> (raw)
In-Reply-To: <ec6b5a61cd6849f5bc3f1707fab052b6@HQ1WP-EXMB11.corp.brocade.com>


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

      parent reply	other threads:[~2015-08-31 19:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-30 13:24 iproute2 v4: full ss json support and general output simplification Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 01/10] ss: rooted out ss type declarations for output formatters Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 02/10] ss: created formatters for json and hr Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 03/10] ss: removed obsolet fmt functions Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 04/10] ss: prepare timer for output handler usage Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 05/10] ss: replaced old output with new generic output mechanisms Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 06/10] ss: renaming and export of current_filter Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 07/10] ss: symmetrical subhandler output extension example Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 08/10] ss: symmetrical formatter " Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 09/10] ss: fixed free on local array for valid json output Matthias Tafelmeier
2015-08-30 13:24 ` [PATCH v4 10/10] ss: extended json_writer for hex field and value output Matthias Tafelmeier
     [not found] ` <ec6b5a61cd6849f5bc3f1707fab052b6@HQ1WP-EXMB11.corp.brocade.com>
2015-08-31 19:20   ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150831122004.3a3aba15@urahara \
    --to=stephen@networkplumber.org \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=hagen@jauu.net \
    --cc=matthias.tafelmeier@gmx.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.