On 15/04/16 12:00, Gao, Liming wrote:
   In UI, the question is shown to user, such as checkbox, oneof,
orderlist, password. One HII driver exposes multiple questions. Those
questions may refer to one buffer storage. For this usage, the C
structure can be used as the buffer storage. Each question refers to one
field in C structure. HiiConfigAccess ExtractConfig can retrieve the
settings of all questions by ConfigResp string (&Offset=&Width=&Value=).
And, those questions may refer to Name/Value storage. HiiConfigAccess
ExtractConfig can retrieve the settings of all questions by ConfigResp
string (&Name=&Value=). These two styles are supported.

Consider a hypothetical alternative memcpy() modelled on the design approach taken by the EFI HII API. Using such a call might look something like this:

  char action_string[ 128 /* should be large enough */ ];

  snprintf ( action_string, sizeof ( action_string ),
             "SourceAddress=%p&DestinationAddress=%p&CopyLength=%zd",
             src, dest, len );
  efi_hii_memcpy ( action_string );


Does that look to you like a sensible API for memcpy()?

If yes, then there's no point in any further discussion.

If no, then consider that "&Offset=&Width=&Value=" represents the same API design flaw.

Michael
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to