Ets_Obj_Attr_Get_As_String_Sized()
Abstract
Gets the value of a given ETS object’s attribute, as a string, using a sized buffer.
Syntax
Ets_Obj_Attr_Get_As_String_Sized (obj_hndl, attr_name, size_ptr, value_buf)
| Argument | Type | Description |
|---|---|---|
obj_hndl |
EtsT_Obj_Handle |
Handle of the object of interest. |
attr_name |
const char * |
Name of the attribute of interest. |
size_ptr |
size_t * |
On call, the size of val_ptr.On return, the actual size of the attribute value string (including the terminating null). |
value_buf |
char * |
Buffer to be filled with a string representation of the attribute value. |
Return Type
EtsT_Compcode
EtsC_Compcode_Success if the value was successfully obtained; EtsC_Compcode_Failure otherwise.
Header
ets_api_obj.h
Details
This function is similar to Ets_Obj_Attr_Get_As_String(), except that it has a size argument and will not overrun the value_buf buffer when returning the attribute value. (If size_ptr is NULL, this function acts identically to Ets_Obj_Attr_Get_As_String().)
If the string attribute value is larger than value_buf, a truncated string is returned.
size_ptr allows you to detect buffer-size problems and reallocate the buffer to hold the requested attribute value. See Ets_Obj_Attr_Get_Sized() for an example.