op_ima_obj_hname_get()
Abstract
Generates the hierarchical name of an object.
Syntax
op_ima_obj_hname_get (objid, hname, max_len)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of the object-of-interest |
hname |
char * |
character buffer in which to place the generated hierarchical name (size must be at least max_len characters) |
max_len |
int |
maximum length for hierarchical name |
Return Type
Compcode
Completion code indicating whether the operation completed successfully. OPC_COMPCODE_FAILURE if an error occurs (see Errors section); OPC_COMPCODE_SUCCESS otherwise.
Example
char name[100];
if (op_ima_obj_hname_get (op_id_self (), name, 100) == OPC_COMPCODE_SUCCESS)
printf ("This object's name is %s\n", name);
Details
This KP obtains the hierarchical name of the specified object and, if necessary, drops characters from the front of the hierarchical name to limit the name to max_len.
Purpose
This KP generates the hierarchical name of a specified object. The name is placed in hname. op_ima_obj_hname_get() provides a quicker way of generating a hierarchical name than by using repeated calls to op_ima_obj_attr_get() to get the names of an object and each of its parents.
Errors
- Recoverable Error: Object ID (
<site_objid>) is out-of-range. - Recoverable Error: Object ID (
<site_objid>) refers to a restricted object.
Reference
- Use the KP op_id_from_name() to get an object ID from its hierarchical name