[Settings] show_setting() functions return snprintf()-style length.

show_setting() and related functions now return an "actual length" in the
style of snprintf().  This is to allow consumers to allocate buffers large
enough to hold the formatted setting.
This commit is contained in:
Michael Brown
2008-03-18 00:48:23 +00:00
parent 08b19abf94
commit 5a08b434c7
4 changed files with 11 additions and 14 deletions

View File

@@ -48,7 +48,7 @@ struct config_setting_type {
* @v setting Configuration setting
* @v buf Buffer to contain value
* @v len Length of buffer
* @ret rc Return status code
* @ret len Length of formatted value, or negative error
*/
int ( * show ) ( struct config_context *context,
struct config_setting *setting,
@@ -108,7 +108,7 @@ struct config_setting {
* @v setting Configuration setting
* @v buf Buffer to contain value
* @v len Length of buffer
* @ret rc Return status code
* @ret len Length of formatted value, or negative error
*/
static inline int show_setting ( struct config_context *context,
struct config_setting *setting,