Ets_Topo_Parent_Attr_Get_Sized()
Abstract
Obtains the value of a top-level attribute, given the object handle and name of the attribute, using a sized buffer.
Syntax
Ets_Topo_Parent_Attr_Get_Sized (child_obj_hndl, attr_name, size_ptr, result_value_ptr)
| Argument | Type | Description |
|---|---|---|
child_obj_hndl |
EtsT_Obj_Handle |
Handle to child object. |
attr_name |
const char * |
Name of top-level attribute of interest. |
size_ptr |
size_t * |
On call, the size of result_value_ptr.On return, the actual size of the attribute value (for strings, this includes the terminating null). |
result_value_ptr |
void * |
Value of the attribute of interest. (See Ets_Obj_Attr_Get() on page 958 for details about this argument.) |
Return Type
EtsT_Compcode
EtsC_Compcode_Success if the attribute value is obtained; EtsC_Compcode_Failure otherwise.
Header
ets_api_topo.h
Details
This function is similar to Ets_Topo_Parent_Attr_Get(), except that it has a size argument and will not overrun the result_value_ptr buffer when returning the attribute value. (If size_ptr is NULL, this function acts identically to Ets_Topo_Parent_Attr_Get().)
For string attribute values that are larger than result_value_ptr, a truncated string is returned. For other data types, if the attribute value is too big, result_value_ptr remains empty.
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() on page 960 for an example.