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
, andstm_unload_all
) that provide an interface between the workarea of the Rational Statemate user and external files.You must work in theautomatic_transaction
mode when using this function by specifyingautomatic_transaction
as the third argument (trans_mode
) of thestm_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)
...
Any name in any directory can be specified forfile_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.Note that no description or lock files are created by this function. The item name and type. The possible values are as follows:
•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. The following call saves a statechart in the workarea namedSYSTEM_CHART
to an external file namedsaved_chart
in the/tmp
directory:int status;
char mess[128];
.
.
stm_save ("system_chart.sch", "/tmp/saved_chart",
message, &status);
if (status != stm_success)
.
.