stt Instructions ¶An assembler program can have names assigned to its states by arguments of stt instructions.
Use the following function to retrieve the index of a state of a node by the name of the state after loading an assembler program into the node.
int qsmm_get_node_state_by_name (qsmm_t model, const char *state_name, qsmm_sig_t node, qsmm_sig_t *state_p) ¶This function retrieves the index of a state of a node of a multinode model by a state_name assigned by an stt instruction marking the beginning of the state in an assembler program loaded into the node.
The argument node specifies the identifier of the node.
On success, the function returns a non-negative value and sets *state_p if state_p is not NULL.
If the state exists, the function sets *state_p to the index of the state.
If the node does not have an assembler program loaded, or the assembler program does not define a state named state_name, the function sets *state_p to QSMM_SIG_INVALID.
If the node uses a source probability profile provided by another node, the function retrieves the index of a node state defined in an assembler program loaded into the latter node. See Memory Efficient Cloning the Probability Profile, for a detailed description of this mode.
On failure, the function returns a negative error code. Currently, the function can return the following error codes.
QSMM_ERR_NOTFOUNDA node with identifier node does not exist.
QSMM_ERR_ILSEQUnable to convert state_name to a wide string according to a current locale.
QSMM_ERR_NOMEMThere was not enough memory to perform the operation.
Use the following function to retrieve the name of a node state by its index.
int qsmm_get_node_state_name (qsmm_t model, qsmm_sig_t node, qsmm_sig_t state, const char **state_name_pp) ¶This function retrieves the name of a state of a node of a multinode model by the index of the state.
An stt instruction in an assembler program loaded into the node assigns that name to the state.
The argument node specifies the identifier of the node.
The argument state specifies the index of the state.
On success, the function returns a non-negative value and sets *state_name_pp if state_name_pp is not NULL.
If the state has a name assigned by the argument of an stt instruction, the function sets *state_name_pp to the name.
If the state does not have an assigned name, the function sets *state_name_pp to NULL.
If the node uses a source probability profile provided by another node, the function retrieves a state name specified in an assembler program loaded into the latter node. See Memory Efficient Cloning the Probability Profile, for a detailed description of this mode.
On failure, the function returns a negative error code. Currently, the function can return the following error codes.
QSMM_ERR_INVALThe argument state is greater than or equal to the number of node states holding a probability profile specified by an assembler program.
QSMM_ERR_NOTFOUNDA node with identifier node does not exist.
QSMM_ERR_ILSEQUnable to convert a state name to a multibyte string according to a current locale.
QSMM_ERR_NOMEMThere was not enough memory to perform the operation.