Single-Element Functions : List of Functions : stm_r_xx_name

stm_r_xx_name
Returns the element name. For hierarchical elements, the function returns the name associated with the box. Because hierarchical elements can share the same name, the return value does not necessarily uniquely identify an element. To return a unique name, use the function stm_r_xx_uniquename.
This function returns a pointer to a static area of memory. Subsequent calls to this procedure overwrite the old string. If the name needs to be preserved, use the strdup() function from the string library.

stm_r_name (id, &status)

 

For boxes that have no names, this function returns the definition chart name. For example, for box @ABC, this function returns ABC.
Function Type
stm_element_name
Syntax
stm_r_xx_name (xx_id, &status)
Arguments
 
Input/Output
For Elements
Status Codes
Example
To retrieve and print the name of a state in a statechart, use the following statements:

 

stm_id state_id;
int status;
.
.
state_id = stm_r_st ("S1.S3", &status);
printf ("%s", stm_r_st_name (state_id, &status));
.
.

In this example, the state name is provided and this value is used to retrieve the same state name from the database. The purpose of this example is to demonstrate the value returned by this function, in contrast to the value returned by the function stm_r_xx_uniquename.