Utility Functions : List of Utility Functions : stm_save

stm_save
Function Type
None
Description
Saves a chart (or any other configuration item file) from the current workarea to an external 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 the following call:

 

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

Syntax
stm_save (file_name, item_name, message, &status)
Arguments
Any name in any directory can be specified for file_name. In charts, the chart is converted into an ASCII format and written to the specified file. The specified file should not exist before calling this function.
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
pnl - Panels of the Prototyper
req - Requirement files
sch - For statecharts
scp - Simulation SCL files
A buffer that holds the error message, if an error occurs. This buffer can hold 127 characters.
Status Codes
Example
The following call saves a statechart in the workarea named SYSTEM_CHART to an external file named saved_chart in the /tmp directory:

 

int status;
char mess[128];
.
.
stm_save ("system_chart.sch", "/tmp/saved_chart",
message, &status);
if (status != stm_success)
.
.