[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090226185635.GA12895@elte.hu>
Date: Thu, 26 Feb 2009 19:56:35 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
Lai Jiangshan <laijs@...fujitsu.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 1/3] add binary printf
* Frederic Weisbecker <fweisbec@...il.com> wrote:
> Instead of calling the in/out helper from the decoder, why not
> calling the decoder from these three functions and let them
> take the appropriate actions for each decoded format token?
>
> Naive example:
>
> bstr_printf() {
> while (decode_format(...))
> if (type == number)
> read_number_from_buf()
> str = number(....)
> ....
> }
>
> vsnprintf {
> while (decode_format(...))
> if (type == number)
> var_arg(...)
> str = number(....)
> ....
> }
>
> vbin_printf {
> while (decode_format(...))
> if (type == number)
> var_arg(...)
> write_number_to_buffer()
> ...
> }
>
> And the standard in/out pieces can be invoked through helpers.
ok, that looks rather clean too. And maybe vsnprintf() and
bstr_printf() could be further unified?
I guess it depends on how it all looks like in the end. Only one
way to find out ...
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists