To initialize the import process, add the following statement to your program before any calls to Data Import library functions:
●project_name
- The name of the Rational Statemate project.
●workarea_dir
- The directory pathname of your workarea in which the specification database is found.This function returns a
STMContextHandle
pointer if successful, or NULL if unsuccessful.The following example shows how to initialize the process in a C program. In this example, the user is prompted for the name of the project to open.
main( )
{
STMContextHandle *stm_handle;
char name[32];
char dir[30];
printf ("Enter name of Statemate project: ");
scanf ("%s", name);
printf ("Enter directory pathname
for your Workarea: ");
scanf ("%s", dir);
stm_handle = stmInitImport(dir,name);
if (!stm_handle)
printf ("Init function failed.");
}
● The project name (in this case, the content of the variablename
) is not case sensitive.
● It is recommended that you write theinit
function in the form shown in the example (stm_handle=...; if(!stm_handle)...;
) to ensure that theinit
function succeeds before continuing.