4.2.3.1 Function Declaration

If an instruction class set has an event handler function, you normally declare or define the instruction class set using the following macro.

Macro: QSMM_INSTR_CLASS_SET (instr_class_set_name)

This macro declares the prototype of a function named instr_class_set_name that represents an instruction class set with the same name and is the event handler function of the instruction class set. You can prepend the macro with the static keyword to declare or define a static function. A pointer to the function has the type qsmm_instr_class_set_func_t. The function has the return type int and the following arguments.

Function argument: qsmm_t qsmm

The handle of a multinode model containing the instruction class set.

Function argument: qsmm_mehcall_t mehcall

The parameters of a call to the event handler function. See Event Handler Call Parameters, for a description of parameters of a model event handler call.

For example, you can declare the prototype of a static function representing the instruction class set ‘walker’ as follows:

static QSMM_INSTR_CLASS_SET(walker);

Define the static function ‘walker’ as follows:

static QSMM_INSTR_CLASS_SET(walker) {
    ...
}
Data type: qsmm_instr_class_set_func_t

This is a type for a pointer to the event handler function of an instruction class set. See above for the description of non-deprecated arguments of that event handler function. To improve compatibility with future versions of QSMM library, avoid declaring the event handler function explicitly—use the macro QSMM_INSTR_CLASS_SET instead.