[waffle] [wflinfo] [RFC] platform-specific info from wflinfo
Chad Versace
chad.versace at intel.com
Tue Feb 10 13:59:44 PST 2015
On 02/10/2015 01:08 PM, Frank Henigman wrote:
> On Tue, Feb 10, 2015 at 3:09 PM, Chad Versace <chad.versace at intel.com> wrote:
>> I see two significant design decisions that need to be made:
>>
>> Issue #1: Should Waffle provide a query mechanism for the native
>> platform info? Or should it just dump the info as a well-formatted
>> string?
>>
>> Resolved: I like the way that your waffle_display_print_info() just dumps
>> the information as a string. That's much simpler and more
>> extensible than a true query mechanism.
>>
>> Issue #2: How should Waffle give that information string to the user?
>>
>> I think hardcoding stdout as the destination for the information
>> is too restrictive. A very simple alternative would be that
>> waffle_display_print_info() return a C-string that the user is
>> required to free. Or perhaps the user should pass a string
>> buffer and max length to waffle_display_print_info(),
>> similar to snprintf(). Or maybe something completely different.
>> What do you think is the best approach?
>
> Returning a string. If the user has to supply a buffer they won't
> know how big it needs to be.
> I think the function will want an enum or bitmask parameter for
> controlling, for example, verbosity.
> If we ever want a fancy query interface that returns structs instead
> of a string, we'll be able to
> re-implement the string-returning function over that interface for
> backward compatibility.
> I suggest calling this one waffle_display_info_string() instead of
> taking a name we might want to
> use later, like waffle_display_info or waffle_display_query.
This all sounds good to me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/waffle/attachments/20150210/2d629b18/attachment-0001.sig>
More information about the waffle
mailing list