Reactis API V2020
API - Reactis: C Bindings - Reactis Info File (General)
rsRsiOpen
Open an existing or create a new .rsi file.
Open an existing .rsi file or create a new .rsi file if it does not
exist. If the .rsi file does not exist, this function creates the .rsi file
on disk and pre-populates the list of input ports as specified in
modelFileName.
Syntax
RsiFile *rsRsiOpen ( RsHandle * h, const char *rsiFileName, const char
*modelFileName);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- rsiFileName
- Path and name of Reactis info file.
- modelFileName
- Path and name of model that corresponds to this info file.
Return Value
Pointer to an RsiFile structure that must be used in all subsequent calls
to rsRsi* functions. NULL, if an error occurred. In that case, call
rsGetLastError to retrieve the error message string.
rsRsiClose
Close an .rsi file.
Close a .rsi file that was opened with rsRsiOpen.
Syntax
void rsRsiClose (RsiFile *h);
Parameters
- h
-
- Pointer to an RsiFile structure as returned by rsRsiOpen.
Return Value
None.
rsRsiGetModelName
Returns a pointer to the name of the model.
Returns a pointer to the name of the model specified in the rsRsiOpen call.
Syntax
const char *rsRsiGetModelName(RsRsiFile *h);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
Return Value
Pointer to a string representing the model name.
rsRsiSave
Save changes to an .rsi file.
Save a .rsi file after modifying it.
Syntax
int rsRsiSave (RsiFile *h, const char *filename);
Parameters
- h
- Pointer to an RsiFile structure as returned by rsRsiOpen.
- filename
- Filename and path under which to save the .rsi file. Can be NULL. In that
case, the .rsi file is saved under the same name as it was opened
originally.
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get the
error string.
- 1
- If no error occurred.
rsRsiGetParameterValue
Get the value of a model-specific setting.
Get the value of a parameter in the .rsi file. Parameters are listed in
section Model-Specific and Harness-Library-Specific Parameters.
Syntax
int rsRsiGetParameterValue (RsiFile *h, const char *parameterName, char
*buffer, int bufferSize);
Parameters
- h
- Pointer to RsiFile structure as returned by rsRsiOpen.
- parameterName
- One of the parameter names listed in section
Model-Specific and Harness-Library-Specific Parameters.
- buffer
- The buffer that receives the value of the parameter. The buffer’s size
must correspond to the value of the bufferSize parameter. If the buffer
parameter is NULL, then the value returned by rsGetParameterValue will
be the buffer size required to store the parameter’s value.
- bufferSize
- The size of the buffer passed in as the second argument. If the actual
value of the parameter is longer than this value, it will be truncated to
the length of the buffer. In that case, the return value of
rsGetParameterValue will be the buffer size that would be required to
receive the whole value.
Return Value
- 0
- If an error occurred. In this case, call rsGetLastError to get the
error string.
- 1
- If no error occurred.
rsRsiGetNumDependencies
Get number of files listed in the "Additional Dependencies" list.
Get number of files listed in the "Additional Dependencies" list of
the .rsi file.
Syntax
int rsRsiGetNumDependencies(RsRsiFile *hRsi);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
Return Value
Returns the number of files added as additional dependencies.
rsRsiGetDependency
Return a file from the "Additional Dependencies" list.
Return a file from the "Additional Dependencies" list in the .rsi file.
Syntax
int rsRsiGetDependency(RsRsiFile *hRsi,
int index,
char *buffer,
int bufferSize
);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- index
- Index of the file. This value must be greater or equal to 0 and less
than the return value of rsRsiGetNumDependencies.
- buffer
- The buffer that receives the file name. The buffer's size must
correspond to the value of the bufferSize parameter. If the buffer
parameter is NULL then the value returned by rsRsiGetDependency will
be the buffer size required to store the whole system path.
- bufferSize
- The size of the buffer passed in as the third argument. If the actual
system path is longer than this value, it will be truncated to the
length of the buffer. In that case the return value of
rsRsiGetDependency will be the buffer size that would be required to
receive the whole system path.
Return Value
- -1
- If an error occurred. In this case you may call rsGetLastError to
retrieve the error message string.
- 0
- On success.
- A value greater than 0
- If either the buffer parameter is NULL or the bufferSize was not
sufficient to receive the complete system path. In that case the
value returned specifies the buffer size required to store the
complete system path.
rsRsiAddDependency
Adds the file specified by the 'file' parameter as an additional
dependency.
Adds the file specified by the 'file' parameter as an additional
dependency. No checking for duplicate listings is performed. A file
does not need to exist to be added to this list.
Syntax
int rsRsiAddDependency(RsRsiFile *hRsi, const char *file);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- file
- Path of file to be added to the list of dependencies.
Return Value
- 0
- If an error occurred. In this case call rsGetLastError to get
the error string.
- 1
- If no error occurred.
rsRsiRemoveDependency
Remove a file from the "Additional Dependencies" list.
Remove a file from the "Additional Dependencies" list in the .rsi file.
Syntax
int rsRsiRemoveDependency(RsRsiFile *hRsi, const char *file);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
- name
- Name of the file to be removed.
Return Value
- 0
- If an error occurred. In this case call rsGetLastError to get
the error string.
- 1
- If no error occurred.
rsRsiClearDependencies
Removes all entries from the "Additional Dependencies" list.
Removes all entries from the "Additional Dependencies" list in the .rsi file.
Syntax
int rsRsiClearDependencies(RsRsiFile *hRsi);
Parameters
- hRsi
- Pointer to RsRsiFile structure as returned by rsRsiOpen.
Return Value
- 0
- If an error occurred. In this case call rsGetLastError to get
the error string.
- 1
- If no error occurred.