On 02/10/2015 01:08 PM, Frank Henigman wrote:
> On Tue, Feb 10, 2015 at 3:09 PM, Chad Versace <chad.vers...@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.


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to