Utility Functions : List of Utility Functions : stm_unload

stm_unload
Function Type
void
Description
Unloads (deletes from the current workarea) a chart or any other configuration item file. It is one of the four utility functions (stm_load, stm_save, stm_unload, and stm_unload_all) that provide an interface between the workarea of the Rational Statemate user and external files.
You must work in the automatic_transaction mode when using this function by specifying automatic_transaction as the third argument (trans_mode) of the stm_init_uad function. Your program should contain lines similar to the following:

 

int success, status;
.
.
success = stm_init_uad ("MY_PROJECT",
"/local/my_work_area", automatic_transaction,
&status);
if (!success)
.
.

Syntax
stm_unload (item_name, enforce, message, &status)
Arguments
Input/Output
ach - Activity-charts
cgenset - Compilation profiles
chk_mdl_set - Check Model profiles
cnf - Simulation status files
config - Configuration files
dgl - Documentor templates
dic - Global definition sets
dyn_set - Simulation analysis profiles
inc - Documentor include files
mch - Module-charts
req - Requirement files
sch - Statecharts
scp - Simulation SCL files
If this is true, it enforces the load—even in cases when the new or modified item with the same name already exists in the workarea. If this is false, the load operation fails, in these cases, with the corresponding status code and error message.
A buffer that holds the error message, if an error occurs. This buffer can hold 127 characters.
 
Status Codes
Example
To unload (delete from the current workarea) an activity-chart named bad_chart, use the following statements:

 

#define DONT_ENFORCE 0
int status;
char mess[128];
.
.
stm_unload ("bad_chart.ach", DONT_ENFORCE, message,
&status);
if (status != stm_success)
.
.

To avoid losing information, do not enforce the operation in case this chart is new or modified.